[hidden] { display: none !important; }
:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #18202a;
    background: #f3f5f7;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #eef2f6 0, #f8f9fb 320px); }
.shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 36px; }
.hero { text-align: center; margin-bottom: 28px; }
.brand { display: inline-block; font-weight: 800; letter-spacing: .15em; font-size: .82rem; margin-bottom: 12px; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; }
.hero p { max-width: 700px; margin: 18px auto 0; color: #5c6773; font-size: 1.05rem; line-height: 1.65; }
.panel, .results { background: #fff; border: 1px solid #e0e5ea; border-radius: 18px; box-shadow: 0 14px 36px rgba(29, 45, 62, .08); padding: 28px; }
label { display: block; font-weight: 700; margin-bottom: 9px; }
input[type=file] { width: 100%; border: 1px solid #cfd6dd; border-radius: 11px; padding: 13px; background: #fafbfc; }
.hint { color: #6b7580; font-size: .9rem; margin: 9px 0 18px; }
button { appearance: none; border: 0; border-radius: 11px; background: #17212b; color: white; padding: 13px 21px; font-size: 1rem; font-weight: 700; cursor: pointer; }
button:hover { background: #283745; }
button:disabled { opacity: .65; cursor: wait; }
.processing { display: inline-flex; align-items: center; gap: 10px; margin-left: 15px; color: #5e6974; }
.spinner { width: 18px; height: 18px; border: 2px solid #d4dbe1; border-top-color: #17212b; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message { margin-top: 20px; border-radius: 12px; padding: 14px 16px; }
.error { background: #fff0f0; border: 1px solid #efc5c5; color: #8e2525; }
.warning { background: #fff8e8; border: 1px solid #eedba9; color: #705a1f; }
.results { margin-top: 24px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.result-head h2 { margin: 0; }
.result-head span { color: #35734d; font-size: .9rem; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.metric { border: 1px solid #e4e8ec; border-radius: 14px; padding: 22px; background: #fbfcfd; }
.metric-label { color: #5f6a75; font-weight: 650; }
.metric-value { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; line-height: 1.1; margin-top: 7px; letter-spacing: -.03em; }
.metric-note { color: #8a939d; font-size: .83rem; margin-top: 7px; }
footer { text-align: center; color: #7b858e; font-size: .88rem; padding-top: 22px; }
@media (max-width: 650px) {
    .shell { width: min(100% - 20px, 980px); padding-top: 30px; }
    .panel, .results { padding: 19px; border-radius: 14px; }
    .grid { grid-template-columns: 1fr; }
    .processing { display: flex; margin: 15px 0 0; }
    .result-head { align-items: flex-start; flex-direction: column; }
}

.variant-select {
    margin-top: 20px;
    border: 1px solid #e4e8ec;
    border-radius: 14px;
    padding: 18px;
    background: #fbfcfd;
}
.variant-select label {
    margin-bottom: 9px;
}
.variant-select select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd6dd;
    border-radius: 11px;
    padding: 10px 12px;
    background: #fff;
    color: #18202a;
    font: inherit;
}


.child-articles {
    margin-top: 18px;
    border: 1px solid #e4e8ec;
    border-radius: 14px;
    padding: 18px;
    background: #fff;
}

.child-articles-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.child-articles-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.child-count {
    color: #68717c;
    font-size: .9rem;
}

.child-empty {
    padding: 12px 0;
    color: #68717c;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.child-table {
    width: 100%;
    border-collapse: collapse;
}

.child-table th,
.child-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #edf0f2;
    vertical-align: top;
}

.child-table th {
    font-size: .85rem;
    color: #68717c;
    font-weight: 600;
    background: #fafbfc;
}

.child-table td:first-child {
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 640px) {
    .child-articles-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}


.category-analysis {
    margin-top: 20px;
    border: 1px solid #e4e8ec;
    border-radius: 14px;
    padding: 18px;
    background: #fff;
}

.category-analysis-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.category-analysis-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.category-analysis-head span {
    color: #68717c;
    font-size: .9rem;
}

.category-table {
    width: 100%;
    border-collapse: collapse;
}

.category-table th,
.category-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
}

.category-table th {
    background: #fafbfc;
    color: #68717c;
    font-size: .85rem;
    font-weight: 600;
}

.category-table td:last-child,
.category-table th:last-child {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .category-analysis-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}


/* WDEPOS Farbschema: DeepSkyBlue + mittleres Grau */
:root {
    --wdepos-blue: DeepSkyBlue;
    --wdepos-gray: #6b7280;
    --wdepos-gray-dark: #4b5563;
    --wdepos-gray-light: #d1d5db;
    --wdepos-surface: #e5e7eb;
    --wdepos-text: #1f2937;
}

html,
body {
    background: DeepSkyBlue;
    color: var(--wdepos-text);
}

.shell {
    background: transparent;
}

.hero {
    color: #ffffff;
}

.hero .brand,
.hero h1,
.hero p {
    color: #ffffff;
}

.panel,
.results,
.metric,
.variant-select,
.child-articles,
.category-analysis {
    background: var(--wdepos-surface);
    border-color: var(--wdepos-gray);
}

.metric-label,
.metric-note,
.hint,
.category-analysis-head span,
.child-count,
.child-empty {
    color: var(--wdepos-gray-dark);
}

input[type="file"],
select {
    background: #d1d5db !important;
    border-color: var(--wdepos-gray) !important;
    color: var(--wdepos-text) !important;
}

button,
button[type="submit"] {
    background: var(--wdepos-gray-dark);
    color: #ffffff;
    border-color: var(--wdepos-gray-dark);
}

button:hover,
button[type="submit"]:hover {
    background: #374151;
}

.category-table th,
.child-table th {
    background: #c7cbd1;
    color: #374151;
}

.category-table td,
.child-table td {
    border-bottom-color: #b9bec5;
}

.message.warning {
    background: #d1d5db;
    color: #374151;
    border-color: var(--wdepos-gray);
}

.message.error {
    background: #d1d5db;
    color: #7f1d1d;
    border-color: #9ca3af;
}


.site-logo {
    display: block;
    width: min(420px, 85%);
    height: auto;
    margin: 0 auto 22px auto;
    object-fit: contain;
}

@media (max-width: 640px) {
    .site-logo {
        width: min(320px, 90%);
        margin-bottom: 16px;
    }
}


/* Logo links, kompakter Kopfbereich */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(150px, 210px) 1fr;
    align-items: center;
    gap: 28px;
    text-align: left;
}

.logo-column {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.hero-layout .site-logo {
    width: 50%;
    min-width: 120px;
    max-width: 190px;
    height: auto;
    margin: 0;
}

.hero-content {
    min-width: 0;
}

.hero-content h1,
.hero-content p {
    text-align: left;
}

@media (max-width: 720px) {
    .hero-layout {
        grid-template-columns: 110px 1fr;
        gap: 16px;
    }

    .hero-layout .site-logo {
        width: 100%;
        min-width: 0;
        max-width: 110px;
    }
}

@media (max-width: 520px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-layout .site-logo {
        max-width: 130px;
    }
}
