:root {
    /* Světlý režim (default) */
    --bg: #f4f6f8;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e6edf5;
    --line-strong: #d1dbe8;

    /* WEDOS brand */
    --brand: #005bbb;
    --brand-2: #0070e0;
    --brand-ink: #003f8a;

    /* Kategorie */
    --ip: #005bbb;
    --device: #f59e0b;
    --privacy: #7c3aed;
    --finger: #0ea5e9;
    --media: #22c55e;
    --headers: #334155;
    --probe: #10b981;
    --probe-warn: #f59e0b;
    --probe-bad: #ef4444;

    /* Stavy */
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 24px rgba(15, 23, 42, .06);
    --shadow-hover: 0 14px 30px rgba(15, 23, 42, .08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --bg-elev: #111a2e;
        --card: #141f36;
        --text: #e5e7eb;
        --muted: #94a3b8;
        --line: #1f2b47;
        --line-strong: #2a3a5c;
        --brand-ink: #7cb4ff;
        --shadow: 0 10px 24px rgba(0, 0, 0, .3);
        --shadow-hover: 0 14px 30px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

main {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem 1.2rem 3rem;
}

.page-title {
    text-align: center;
    color: var(--brand-ink);
    margin: 0 0 .6rem;
    font-weight: 800;
    letter-spacing: .2px;
    font-size: 1.8rem;
}

.page-sub {
    text-align: center;
    color: var(--muted);
    margin: 0 0 1.4rem;
    font-size: .95rem;
}

/* GDPR banner */
.legal-banner {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 1.2rem;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.5;
}

.legal-banner strong { color: var(--text); }
.legal-banner a { color: var(--brand); }

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 0 1.2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 91, 187, .18);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-elev);
    color: var(--text);
    border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* Permalink box */
.permalink-box {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 4px solid var(--success);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 0 0 1.2rem;
    display: none;
}

.permalink-box.is-visible { display: block; }

.permalink-box .pl-title {
    font-weight: 800;
    color: var(--success);
    margin-bottom: 6px;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.permalink-box .pl-url {
    display: flex;
    gap: 8px;
    align-items: center;
}

.permalink-box input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .85rem;
}

.permalink-box .pl-meta {
    margin-top: 8px;
    font-size: .8rem;
    color: var(--muted);
}

/* Loading */
.loading-box {
    margin: 12px 0 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--brand-ink);
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.loading-box::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.loading-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .95rem;
}

.loading-sub {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 500;
    font-size: .88rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(0, 91, 187, .25);
    border-top-color: var(--brand);
    animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Report sections */
.diagnostic-report { display: grid; gap: 12px; margin-top: 6px; }

.report-section {
    margin: 18px 0 6px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--brand-ink);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .78rem;
    position: relative;
    overflow: hidden;
}

.report-section::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.report-section .sec-desc {
    display: block;
    margin-top: 6px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    font-weight: 600;
    font-size: .92em;
}

.report-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.section-copy {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .7rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    font-family: inherit;
}
.section-copy:hover { color: var(--brand); border-color: var(--brand); }

/* Item */
.report-item {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 12px 14px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.report-item::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent, linear-gradient(180deg, var(--brand), var(--brand-2)));
}

.report-item:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-hover);
}

.report-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin: 0 0 4px;
}

.report-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.report-item.is-header .report-label { font-size: .7rem; }
.report-item.is-header .report-value { font-size: .88rem; opacity: .9; font-weight: 500; }

/* Probe výsledky */
.probe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.probe-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    position: relative;
}

.probe-item .p-name {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
}

.probe-item .p-value {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.probe-item.p-ok .p-value    { color: var(--success); }
.probe-item.p-warn .p-value  { color: var(--warning); }
.probe-item.p-bad .p-value   { color: var(--danger); }

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
}

.footer a { color: var(--brand); text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
    main { padding: 1.2rem .8rem 2.2rem; }
    .page-title { font-size: 1.4rem; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .report-value { font-size: .95rem; }
}

/* Print */
@media print {
    .toolbar, .permalink-box, .legal-banner { display: none !important; }
    .report-item { box-shadow: none; break-inside: avoid; }
    .anomalies-box { break-inside: avoid; }
}

/* ==========================================================================
   Anomálie - zobrazení detekovaných podezřelých hodnot nad reportem
   ========================================================================== */

.anomalies-box {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 5px solid var(--warning);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 0 0 1.4rem;
    box-shadow: var(--shadow);
}

.anomalies-box.anomalies-ok {
    border-left-color: var(--success);
    padding: 12px 18px;
    font-size: .92rem;
    color: var(--text);
}

.anomalies-box.anomalies-ok strong {
    color: var(--success);
}

.anomalies-box .ano-sub {
    color: var(--muted);
    margin-left: 4px;
}

.anomalies-box .ano-title {
    font-weight: 800;
    color: var(--warning);
    font-size: .95rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.anomalies-box .ano-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.anomalies-box .ano-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border-left: 3px solid var(--muted);
}

.anomalies-box .ano-item.ano-info  { border-left-color: var(--brand); }
.anomalies-box .ano-item.ano-warn  { border-left-color: var(--warning); background: rgba(217, 119, 6, .06); }
.anomalies-box .ano-item.ano-bad   { border-left-color: var(--danger);  background: rgba(220, 38, 38, .06); }

.anomalies-box .ano-item-header strong {
    color: var(--text);
    font-size: .95rem;
}

.anomalies-box .ano-item.ano-bad .ano-item-header strong  { color: var(--danger); }
.anomalies-box .ano-item.ano-warn .ano-item-header strong { color: var(--warning); }

.anomalies-box .ano-detail {
    margin-top: 4px;
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.45;
}

@media (max-width: 600px) {
    .anomalies-box { padding: 12px 14px; }
    .anomalies-box .ano-item { padding: 10px; }
}
