/* ═══════════════════════════════════════════
   EMBER DARK — AgentLighthouse Design System v4
   VoltAgent structure + Obscura spacing discipline
   WCAG AA Compliant — All text ≥ 4.5:1
   ═══════════════════════════════════════════ */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

:root {
    /* ── Colors ── */
    --void: #050507;
    --carbon: #101010;
    --surface: #141416;
    --surface-hover: #1a1a1e;
    --border: #1e1e22;
    --border-hover: #2e2e34;
    --ember: #ff6b2b;
    --ember-light: #ff8c4c;
    --ember-dark: #cc5522;
    --ember-glow: rgba(255,107,43,0.12);
    --snow: #f0f0f0;
    --parchment: #b8b3b0;
    --steel: #9a9aa2;
    --muted: #76767e;
    --dim: #636370;
    --green: #22c55e;
    --green-bg: #0a1f0a;
    --green-border: #1a3a1a;
    --amber: #f59e0b;
    --amber-bg: #1f1a0a;
    --amber-border: #3a2a1a;
    --amber-glow: rgba(245, 158, 11, 0.5);
    --red: #ef4444;
    --red-bg: #1f0a0a;
    --red-border: #3a1a1a;
    --red-glow: rgba(239, 68, 68, 0.5);

    /* ── Spacing (10px base) ── */
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 14px;
    --space-4: 18px;
    --space-5: 22px;
    --space-6: 26px;
    --space-8: 34px;
    --space-9: 38px;
    --space-10: 42px;
    --space-12: 50px;
    --space-16: 66px;

    /* ── Layout ── */
    --section-gap: 38px;
    --card-padding: 18px;
    --element-gap: 18px;

    /* ── Radii ── */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;

    /* ── Typography (Obscura hierarchy) ── */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    --text-xs: 11px;
    --text-sm: 13px;
    --text-caption: 14px;
    --text-body: 16px;
    --text-subheading: 18px;
    --text-heading: 22px;
    --text-heading-lg: 28px;
    --text-display: 32px;

    --leading-tight: 1.25;
    --leading-snug: 1.4;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-loose: 1.75;

    --tracking-tight: -0.5px;
    --tracking-normal: 0;
    --tracking-wide: 0.5px;
    --tracking-wider: 1px;
    --tracking-widest: 1.5px;

    /* ── Container ── */
    --max-w: 1280px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-normal);
    background: var(--void);
    color: var(--snow);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ember); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--ember-light); }

/* Focus ring (WCAG) */
:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--carbon); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═══ HEADER ═══ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--carbon);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-left { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }

.header-logo {
    font-family: var(--font-mono);
    font-size: var(--text-subheading);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    color: var(--snow);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.header-logo svg { width: 22px; height: 22px; }

.header-tag {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--steel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px var(--space-2);
    letter-spacing: var(--tracking-wide);
}

/* ── Header search bar — hidden initially, visible after audit ── */
.header-search {
    display: none;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    max-width: 480px;
}

.header-search.visible {
    display: flex;
}

.header-search .url-wrap {
    flex: 1;
}

.header-search .btn-scan {
    padding: var(--space-2) var(--space-4);
}

.header-right {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--steel);
    letter-spacing: var(--tracking-wide);
    flex-shrink: 0;
}

/* ═══ FOOTER ═══ */
.footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: var(--carbon);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--steel);
}

.footer a { color: var(--ember); }

/* ═══ MAIN ═══ */
main {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-6);
}

/* ═══ HERO ═══ */
.hero {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    z-index: 10;
    background: var(--void);
}

/* Header over hero */
.header { z-index: 100; }

/* While hero is visible, hide main content behind it */
body:has(.hero:not(.hidden)) main,
body:has(.hero:not(.hidden)) .scroll-top {
    visibility: hidden;
}

.hero.hidden {
    display: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(5, 5, 7, 0.88) 0%,
        rgba(5, 5, 7, 0.65) 40%,
        rgba(5, 5, 7, 0.65) 60%,
        rgba(5, 5, 7, 0.88) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ═══ AUDIT DIALOG — centered loading overlay ═══ */
.audit-dialog {
    border: none;
    background: transparent;
    padding: 0;
    max-width: none;
    max-height: none;
    overflow: hidden;
}

.audit-dialog[open] {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: var(--void);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.audit-dialog::backdrop {
    background: rgba(5, 5, 7, 0.92);
}

.dialog-url {
    font-family: var(--font-mono);
    font-size: var(--text-heading);
    font-weight: 600;
    color: var(--ember);
    margin-bottom: var(--space-6);
    text-align: center;
    letter-spacing: var(--tracking-wide);
}

.dialog-term {
    width: 100%;
    max-width: 520px;
}

/* ── Terminal scan output ── */
.dialog-term .term-cmd {
    width: 100%;
    max-width: 520px;
    padding: var(--space-4);
    padding-bottom: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 2;
    margin: 0 auto;
    color: var(--ember);
    font-weight: 600;
}

.dialog-term .term-body {
    width: 100%;
    max-width: 520px;
    padding: var(--space-1) var(--space-4) var(--space-4);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 2;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Step lines flow beneath cmd */
.term-line.step {
    color: var(--steel);
    opacity: 0;
    transform: translateY(8px);
    animation: termIn 0.2s ease forwards;
}

@keyframes termIn {
    to { opacity: 1; transform: translateY(0); }
}

/* After a line sits, it fades out and slides down */
.term-line.exit {
    animation: termOut 0.8s ease forwards;
}

@keyframes termOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(16px); }
}

.term-line .cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: var(--ember);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-title {
    font-family: var(--font-mono);
    font-size: var(--text-display);
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.hero-title span { color: var(--ember); }

.hero-desc {
    color: var(--steel);
    font-size: var(--text-body);
    max-width: 520px;
    margin: 0 auto var(--space-6);
    line-height: var(--leading-relaxed);
}

#heroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

/* ═══ INPUT ═══ */
.input-area {
    display: flex;
    gap: var(--space-2);
    max-width: 560px;
    width: 100%;
    margin-top: var(--space-6);
    transition: all 0.4s ease;
}

.url-wrap {
    flex: 1;
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    position: relative;
    transition: border-color 0.2s;
}

.url-wrap:focus-within {
    border-color: var(--ember);
    box-shadow: 0 0 0 1px var(--ember-glow);
}

.url-prefix {
    padding: var(--space-3) 0 var(--space-3) var(--space-3);
    display: flex;
    align-items: center;
}

.url-prefix svg { opacity: 0.35; }

.url-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    padding: var(--space-3) 36px var(--space-3) var(--space-1);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--snow);
    outline: none;
}

.url-wrap input::placeholder { color: var(--dim); }

.btn-scan {
    background: var(--ember);
    color: var(--void);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-scan:hover { background: var(--ember-light); transform: translateY(-1px); }
.btn-scan:active { background: var(--ember-dark); transform: translateY(0); }
.btn-scan:disabled { background: #333340; color: #666670; cursor: not-allowed; transform: none; }

/* ═══ LOADING — Skeleton ═══ */
.loading {
    text-align: center;
    padding: 40px 0 20px;
    display: none;
}

.loading.active { display: block; }

.loading .scan-text {
    color: var(--steel);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.loading .scan-steps {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--dim);
}

/* ═══ ERROR ═══ */
.error-msg {
    text-align: center;
    padding: 16px;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-lg);
    color: var(--red);
    font-family: var(--font-mono);
    font-size: 12px;
    display: none;
    max-width: 560px;
    margin: 20px auto 0;
}

.error-msg.active { display: block; }

/* ═══ RESULTS ═══ */
.results {
    display: none;
    margin-top: var(--section-gap);
    opacity: 0;
    transform: translateY(12px);
}

.results.active {
    display: block;
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ RESULTS GRID — 70/30 split ═══ */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: var(--space-4);
    align-items: start;
}

.audit-details {
    min-width: 0;
}

/* ═══ ACCORDION — native <details>/<summary> ═══ */
.accordion-section {
    margin-bottom: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    scroll-margin-top: 72px;
    transition: border-color 0.15s;
    position: relative;
}

/* Status dot indicator on accordion — visible in summary */
.accordion-section > summary .acc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.accordion-section.has-fail > summary .acc-status-dot { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.accordion-section.has-warn > summary .acc-status-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }

.accordion-section[open] {
    border-color: var(--border-hover);
}

/* Summary — styled like old nav-item */
.accordion-section > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    list-style: none;
}

.accordion-section > summary::-webkit-details-marker { display: none; }
.accordion-section > summary::marker { display: none; content: ''; }

.accordion-section > summary:hover {
    background: var(--surface-hover);
}

.accordion-section[open] > summary {
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
}

.acc-icon { width: var(--space-4); height: var(--space-4); flex-shrink: 0; color: var(--steel); }
.acc-icon svg { width: var(--space-4); height: var(--space-4); }

.acc-name {
    flex: 1;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--snow);
}

.acc-badge {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
}

.acc-badge.pass { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.acc-badge.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.acc-badge.fail { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

.acc-toggle {
    width: var(--space-4);
    height: var(--space-4);
    color: var(--dim);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.acc-toggle svg { width: var(--space-3); height: var(--space-3); }
.accordion-section[open] > summary .acc-toggle { color: var(--ember); }

/* ═══ RIGHT SCORE CARD ═══ */
.score-card {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-5);
    text-align: center;
    position: sticky;
    top: 64px;
}

.scanned-url {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--dim);
    margin-bottom: var(--space-4);
    word-break: break-all;
    line-height: var(--leading-snug);
}

.score-ring {
    width: 120px; height: 120px;
    margin: 0 auto var(--space-3);
    position: relative;
}

.score-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.score-ring .bg { fill: none; stroke: var(--border); stroke-width: 6; }
.score-ring .progress {
    fill: none; stroke: var(--ember); stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 345.6;
    stroke-dashoffset: 345.6;
    transition: stroke-dashoffset 1.5s ease, stroke 0.3s;
}
.score-ring .progress.excellent { stroke: var(--green); }
.score-ring .progress.good { stroke: var(--ember); }
.score-ring .progress.fair { stroke: var(--amber); }
.score-ring .progress.poor { stroke: var(--red); }

.score-number {
    position: absolute; top: 46%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: var(--text-heading-lg);
    font-weight: 700;
}

.score-sub {
    position: absolute; top: 46%; left: 50%;
    transform: translate(-50%, calc(-50% + 18px));
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--dim);
}

.score-label {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    margin-bottom: var(--space-3);
    font-weight: 600;
}

.score-label.excellent { color: var(--green); }
.score-label.good { color: var(--ember); }
.score-label.fair { color: var(--amber); }
.score-label.poor { color: var(--red); }

.summary-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
}

.stat { text-align: center; }
.stat .num { font-family: var(--font-mono); font-size: var(--text-heading); font-weight: 700; }
.stat .lbl { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-top: 1px; }
.stat.pass .num { color: var(--green); }
.stat.warn .num { color: var(--amber); }
.stat.fail .num { color: var(--red); }

/* Score card extras */
.score-extras {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    text-align: left;
}

.score-extras .extra-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.score-extras .extra-label { color: var(--muted); min-width: 40px; }
.score-extras .extra-value { color: var(--snow); font-weight: 500; }
.score-extras .extra-value.ok { color: var(--green); }
.score-extras .extra-value.warn { color: var(--amber); }
.score-extras .extra-value.bad { color: var(--red); }

/* ═══ REPORT BUTTONS ═══ */
.report-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-report {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--ember-dark);
    color: var(--snow);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.btn-report:not(.disabled):hover {
    border-color: var(--orange);
    background: rgba(255,107,43,0.08);
}
.btn-report-wrap {
    position: relative;
}
.btn-report-wrap .btn-report.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--muted);
}
.badge-coming-soon {
    position: absolute;
    top: 30px;
    right: 1px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--border);
    z-index: 1;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--amber);
}

/* ═══ CHECK ITEM ═══ */
.accordion-body {
    background: var(--carbon);
    padding: var(--space-2);
}

/* ═══ CHECK ITEM ═══ */
.check-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: 3px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    transition: border-color 0.15s, transform 0.15s;
    opacity: 0;
    animation: slideIn 0.25s ease forwards;
}

.check-item:hover {
    border-color: var(--border-hover);
}

@keyframes slideIn { to { opacity: 1; } }

.check-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}

.check-icon svg { width: 12px; height: 12px; }
.check-icon.pass { background: var(--green-bg); border: 1px solid var(--green-border); }
.check-icon.pass svg { stroke: var(--green); }
.check-icon.warning { background: var(--amber-bg); border: 1px solid var(--amber-border); }
.check-icon.warning svg { stroke: var(--amber); }
.check-icon.fail { background: var(--red-bg); border: 1px solid var(--red-border); }
.check-icon.fail svg { stroke: var(--red); }

.check-body { flex: 1; min-width: 0; }

.check-name {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--snow);
}

.check-value {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--steel);
    word-break: break-all;
    line-height: var(--leading-relaxed);
    margin-top: 2px;
}

.check-score {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--dim);
    flex-shrink: 0;
    margin-top: 2px;
}

.check-score.full { color: var(--green); }

.check-rec {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ember-light);
    margin-top: 3px;
    line-height: var(--leading-relaxed);
}

/* ═══ SCROLL TO TOP ═══ */
.scroll-top {
    position: fixed;
    bottom: 56px;
    right: 24px;
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ember);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s;
    pointer-events: none;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top:hover {
    background: var(--surface-hover);
    border-color: var(--ember);
}

/* ═══ SCAN HISTORY DROPDOWN ═══ */
.url-wrap { position: relative; }

.history-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dim);
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 0;
    line-height: 0;
}

.history-btn:hover { color: var(--ember); }

.history-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 260px;
    max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    display: none;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.history-dropdown.open { display: block; }

.history-empty {
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--dim);
    text-align: center;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.12s;
}

.history-item:hover { background: var(--surface-hover); }

.history-score {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    width: 28px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    flex-shrink: 0;
}

.history-score.pass { background: var(--green-bg); color: var(--green); }
.history-score.warn { background: var(--amber-bg); color: var(--amber); }
.history-score.fail { background: var(--red-bg); color: var(--red); }

.history-url {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--snow);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.history-ago {
    font-size: var(--text-xs);
    color: var(--dim);
    flex-shrink: 0;
}

/* ═══ CHECK ITEM TOOLTIP ═══ */
.check-item[title] { cursor: help; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .header-inner { padding: var(--space-3) var(--space-4); }
    .header-tag { display: none; }

    /* Header search takes full width on mobile */
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: var(--space-1);
    }
    .header-search .input-area {
        width: 100%;
    }

    /* Grid → single column, score on top */
    .results-grid {
        grid-template-columns: 1fr;
        align-items: center;
    }
    .score-card {
        width: 100%;
        position: static;
        padding: var(--space-4);
        order: -1;
    }

    /* History dropdown mobile-friendly */
    .history-dropdown {
        min-width: 200px;
        max-width: calc(100vw - 40px);
    }

    /* Accordion compact */
    .accordion-section {
        border-radius: var(--radius);
    }
    .accordion-section > summary {
        padding: var(--space-3);
        gap: var(--space-2);
    }
    .accordion-section[open] > summary {
        border-bottom-width: 1px;
    }
    .acc-name {
        font-size: var(--text-caption);
    }

    .check-item {
        padding: var(--space-2) var(--space-3);
        gap: var(--space-2);
        flex-wrap: wrap;
    }
    .check-body { min-width: calc(100% - 26px); }

    main { padding: var(--space-4) var(--space-3); }
    .hero-title { font-size: var(--text-heading-lg); }
    .input-area { flex-direction: column; }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-3) var(--space-4);
        gap: var(--space-1);
    }
    .header-search {
        margin-top: var(--space-2);
    }
    .header-right {
        font-size: var(--text-xs);
        letter-spacing: var(--tracking-wide);
        opacity: 0.7;
    }
    .accordion-section > summary {
        padding: var(--space-2) var(--space-3);
    }
    .check-item {
        padding: var(--space-2) var(--space-3);
    }
    .score-ring {
        width: 100px; height: 100px;
    }
    .score-ring svg { width: 100px; height: 100px; }
    .score-number { font-size: var(--text-heading); }

    /* Dialog mobile — slightly smaller text */
    .dialog-url { font-size: var(--text-subheading); }
    .dialog-term .term-cmd,
    .dialog-term .term-body { font-size: 13px; max-width: 100%; padding: var(--space-3); }
}
