/* Gora SEO Audit — UI styles.
   Tokens first (light, then dark), then layout, components, report, charts.
   Status colours follow a validated status palette (good / warning / serious /
   critical); they always ship with an icon + label, never colour alone. */

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;

  --brand: #2a78d6;
  --brand-hover: #256abf;
  --brand-soft: #e8f1fc;
  --brand-text: #1c5cab;
  --on-brand: #ffffff;

  /* status marks (fills) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --neutral: #898781;
  /* status text + tinted backgrounds (text-contrast safe) */
  --good-text: #006300;     --good-bg: #e7f6e7;
  --warn-text: #8a5a00;     --warn-bg: #fff4dc;
  --crit-text: #b42323;     --crit-bg: #fdecec;
  --info-text: #4b5563;     --info-bg: #eef0f3;

  --chart-bar: #2a78d6;
  --grid: #e1e0d9;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --border: #2a2f3a;
    --border-strong: #3a404d;
    --text: #f3f4f6;
    --text-2: #c3c7cf;
    --muted: #9097a3;
    --brand: #3987e5;
    --brand-hover: #5598e7;
    --brand-soft: #1a2b44;
    --brand-text: #86b6ef;
    --good-text: #5fd35f;     --good-bg: #15301a;
    --warn-text: #fcc75a;     --warn-bg: #3a2d10;
    --crit-text: #ff8f8f;     --crit-bg: #3a1c1c;
    --info-text: #c3c7cf;     --info-bg: #262b35;
    --chart-bar: #3987e5;
    --grid: #2c2c2a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --border-strong: #3a404d;
  --text: #f3f4f6;
  --text-2: #c3c7cf;
  --muted: #9097a3;
  --brand: #3987e5;
  --brand-hover: #5598e7;
  --brand-soft: #1a2b44;
  --brand-text: #86b6ef;
  --good-text: #5fd35f;     --good-bg: #15301a;
  --warn-text: #fcc75a;     --warn-bg: #3a2d10;
  --crit-text: #ff8f8f;     --crit-bg: #3a1c1c;
  --info-text: #c3c7cf;     --info-bg: #262b35;
  --chart-bar: #3987e5;
  --grid: #2c2c2a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor;
        stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface);
             padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  height: var(--topbar-h); display: flex; align-items: center; gap: 24px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--on-brand);
              display: grid; place-items: center; }
.brand-logo .icon { width: 17px; height: 17px; }
.brand-name b { color: var(--brand-text); font-weight: 700; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--text-2); font-weight: 500; padding: 6px 10px; border-radius: var(--radius-sm); }
.topnav a:hover { background: var(--surface-2); text-decoration: none; }
.topnav a.on { color: var(--text); background: var(--surface-2); }
.auth { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.auth form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
          background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: 13px; }
.auth-user { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.auth-user span { max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
               color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
               border-radius: 999px; padding: 3px 10px; }

/* ----------------------------------------------------------------- layout */
.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 20px 56px; flex: 1; }
.foot { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.stack > * + * { margin-top: 20px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--font); padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm);
            color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------------ flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px;
         border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--text);
         border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.flash .icon { color: var(--brand-text); margin-top: 2px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
             padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }

/* ------------------------------------------------------------ home / hero */
.hero { padding: 36px 32px; display: grid; gap: 22px; }
.hero h1 { font-size: 28px; }
.hero-copy p { color: var(--text-2); font-size: 15px; margin-top: 8px; max-width: 64ch; }
.url-bar { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.url-input { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
             background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.url-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.url-input .icon { color: var(--muted); }
.url-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
                   font: 15px/1 var(--font); padding: 13px 0; }
.advanced { border-top: 1px solid var(--border); padding-top: 14px; }
.advanced summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px;
                    display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary .icon { transition: transform .15s; }
.advanced[open] summary .icon { transform: rotate(90deg); }
.settings-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-weight: 400; }
.field input[type=number] { width: 120px; font: 14px/1 var(--font); padding: 9px 10px; color: var(--text);
                            background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.field input[type=text], .field textarea, .field select {
  font: 14px/1.4 var(--font); padding: 8px 10px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.field textarea { width: 260px; min-height: 64px; resize: vertical; font-family: var(--mono); font-size: 12px; }
.field input[type=text] { width: 260px; }
.field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field-help { font-size: 12px; color: var(--muted); max-width: 260px; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding-bottom: 9px; }
.plan-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.plan-note .icon { color: var(--muted); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 32px 0 12px; }
.section-head p { color: var(--muted); font-size: 13px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 18px; }
.feature .feature-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
                         background: var(--brand-soft); color: var(--brand-text); margin-bottom: 12px; }
.feature p { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .icon { width: 32px; height: 32px; color: var(--border-strong); margin-bottom: 8px; }
.empty-state h3 { color: var(--text); margin-bottom: 4px; }

/* site identity (letter avatar + host) */
.site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-mark { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
             background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
             font-weight: 700; font-size: 13px; text-transform: uppercase; }
.site-text { min-width: 0; }
.site-host { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-url { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }

/* ----------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
         padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge .icon { width: 13px; height: 13px; }
.sev-high   { background: var(--crit-bg); color: var(--crit-text); }
.sev-medium { background: var(--warn-bg); color: var(--warn-text); }
.sev-low    { background: var(--info-bg); color: var(--info-text); }
.st-running  { background: var(--brand-soft); color: var(--brand-text); }
.st-finished { background: var(--good-bg); color: var(--good-text); }
.st-failed   { background: var(--crit-bg); color: var(--crit-text); }
.st-cancelled { background: var(--surface-2); color: var(--text-2); }
.st-running .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.code { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.code-2 { background: var(--good-bg); color: var(--good-text); }
.code-3 { background: var(--brand-soft); color: var(--brand-text); }
.code-4, .code-5, .code-x { background: var(--crit-bg); color: var(--crit-text); }
.len { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.len.bad { color: var(--warn-text); }
.sev-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; }
.sev-icon .icon { width: 14px; height: 14px; }

/* --------------------------------------------------------------- tables */
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; flex: 0 1 300px;
          background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search .icon { color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); font: 13px var(--font); padding: 8px 0; width: 100%; }
.table-count { color: var(--muted); font-size: 12px; margin-left: auto; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
           background: var(--surface-2); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data td.url-cell { min-width: 240px; max-width: 420px; }
.data .clip { display: block; max-width: 360px; color: var(--text-2); }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th-sort::after { content: "↕"; font-size: 10px; opacity: .45; }
th[aria-sort="ascending"] .th-sort::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .th-sort::after { content: "↓"; opacity: 1; }
.th-sort:focus-visible { outline: 2px solid var(--brand); border-radius: 3px; }
a.url { font-family: var(--mono); font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
a.url:hover { color: var(--brand-text); }
span.url { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.linked-from { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.linked-from li { word-break: break-all; }
.linked-from li + li { margin-top: 3px; }
.table-note { padding: 10px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.row-link { color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------------- report */
.report { flex: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr);
          /* paint the sidebar column full-height, even when the sticky nav is shorter than the page */
          background: linear-gradient(to right, var(--surface) 247px, var(--border) 247px 248px, transparent 248px); }
.report-nav { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h));
              overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; }
.report-nav .site { padding: 4px 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
            color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.on { background: var(--brand-soft); color: var(--brand-text); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item.on .count { color: var(--brand-text); }
.report-main { padding: 24px 28px 56px; min-width: 0; }
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.report-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.report-meta span { display: inline-flex; align-items: center; gap: 6px; }
.report-actions { display: flex; gap: 8px; align-items: center; }
.report-actions form { margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* dropdown menu (details/summary) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 6px;
             background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.menu-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; }
.menu-list a:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .icon { color: var(--muted); }
.menu-sep { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

/* sitemap tab */
.check-list { display: grid; gap: 10px; margin: 14px 0 18px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check-list input { margin-top: 3px; accent-color: var(--brand); }
.check-list b { color: var(--text); font-weight: 600; }
.inline-select { margin-left: 8px; font: 13px var(--font); padding: 2px 6px; color: var(--text);
                 background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.steps { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 8px; }
.steps code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { border-bottom: 1px solid var(--border); }

/* progress (running crawl) */
.progress-card { padding: 16px 20px; margin-bottom: 20px; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 10px; }
.progress-top b { font-weight: 600; }
.progress { height: 8px; border-radius: 4px; background: var(--brand-soft); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--brand); border-radius: 4px; transition: width .4s ease; }

/* stat tiles */
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
a.stat-tile { display: block; color: inherit; }
a.stat-tile:hover { text-decoration: none; border-color: var(--border-strong); }

/* health score (hero figure + meter) */
.health { display: flex; flex-direction: column; gap: 10px; }
.health-value { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.health-value small { font-size: 20px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.health-grade { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.meter { height: 8px; border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; }
.meter.good { background: color-mix(in srgb, var(--good) 18%, transparent); }  .meter.good .meter-fill { background: var(--good); }
.meter.fair { background: color-mix(in srgb, var(--warning) 22%, transparent); } .meter.fair .meter-fill { background: var(--warning); }
.meter.poor { background: color-mix(in srgb, var(--critical) 18%, transparent); } .meter.poor .meter-fill { background: var(--critical); }
.grade-good { color: var(--good-text); } .grade-fair { color: var(--warn-text); } .grade-poor { color: var(--crit-text); }
.health-mini { display: flex; align-items: center; gap: 10px; min-width: 110px; }
.health-mini b { font-variant-numeric: tabular-nums; width: 2.4em; }
.health-mini .meter { flex: 1; height: 6px; }

/* severity tiles */
.sev-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sev-tile { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: inherit; display: block; }
.sev-tile:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.sev-tile .stat-value { font-size: 26px; }

/* url type breakdown */
.kv { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.kv b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------------------------------------------------------- charts */
.stackbar { display: flex; gap: 2px; height: 14px; margin: 16px 0 14px; }
.stackbar span { display: block; height: 100%; min-width: 3px; cursor: default; }
.stackbar span:first-child { border-radius: 4px 0 0 4px; }
.stackbar span:last-child { border-radius: 0 4px 4px 0; }
.stackbar span:only-child { border-radius: 4px; }
.stackbar span:hover, .stackbar span:focus-visible { filter: brightness(1.12); outline: none; }
.stackbar.mini { height: 6px; margin: 0; width: 110px; gap: 1px; }
.stackbar.empty { background: var(--surface-2); border-radius: 4px; }
.c-2xx { background: var(--good); } .c-3xx { background: var(--brand); } .c-4xx { background: var(--warning); }
.c-5xx { background: var(--critical); } .c-error { background: var(--neutral); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 52px; align-items: center; gap: 10px; font-size: 13px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .lbl { color: var(--text-2); }
.legend .val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.columns { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 22px;
           border-bottom: 1px solid var(--border-strong); margin-top: 8px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
       gap: 4px; min-width: 0; outline: none; }
.col-val { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.col-bar { width: 100%; max-width: 24px; min-height: 2px; background: var(--chart-bar); border-radius: 4px 4px 0 0; }
.col:hover .col-bar, .col:focus-visible .col-bar { filter: brightness(1.15); }
.col-axis { display: flex; gap: 6px; margin-top: 6px; }
.col-axis span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-caption { font-size: 12px; color: var(--muted); margin-top: 8px; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 260px; padding: 7px 10px;
           background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500; border-radius: 6px;
           box-shadow: var(--shadow-lg); }

/* --------------------------------------------------------------- issues */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border);
             border-radius: 8px; flex-wrap: wrap; }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px;
               color: var(--text-2); font-weight: 600; font-size: 13px; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.issue-group + .issue-group { margin-top: 16px; }
.issue-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 32px; align-items: center; gap: 14px;
             padding: 11px 20px; border-top: 1px solid var(--border); }
.issue-row:first-of-type { border-top: 0; }
.issue-row > .badge { justify-self: start; }
.issue-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.issue-name { color: var(--text); font-weight: 500; }
.issue-count { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.issue-count b { color: var(--text); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.help-block p { color: var(--text-2); }
.help-block .icon { color: var(--muted); }

/* ---------------------------------------------------------------- login */
.auth-page { display: grid; place-items: center; padding: 48px 16px; flex: 1; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; }
.auth-card h1 { font-size: 22px; }
.auth-card > p { color: var(--text-2); margin-top: 8px; }
.benefits { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.benefits .icon { color: var(--good); margin-top: 2px; }
.btn-google { width: 100%; padding: 12px; font-size: 15px; }
.btn-google svg { width: 18px; height: 18px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 13px; }
.setup-hint { font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong);
              padding: 10px 12px; border-radius: var(--radius-sm); margin-top: 14px; }

/* ---------------------------------------------------------------- 404 */
.notfound { text-align: center; padding: 64px 16px; }
.notfound .big { font-size: 64px; font-weight: 800; color: var(--border-strong); line-height: 1; }
.notfound p { color: var(--text-2); margin: 10px 0 20px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-4, .span-5, .span-7, .span-8, .span-6 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .report { grid-template-columns: 1fr; background: none; }
  .report-nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border);
                padding: 10px 12px; display: flex; gap: 4px; overflow-x: auto; }
  .report-nav .site, .report-nav .nav-label { display: none; }
  .report-nav nav { display: flex; gap: 4px; }
  .nav-item { white-space: nowrap; }
  .report-main { padding: 20px 16px 48px; }
  .help-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .brand-name, .topnav, .auth-user span { display: none; }
  .page { padding: 20px 16px 48px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 22px; }
  .features, .sev-tiles { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: minmax(0, 1fr) auto 28px; gap: 6px 12px; padding: 11px 16px; }
  .issue-row > .badge { grid-column: 1 / -1; }
  .health-value { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .topbar, .report-nav, .report-actions, .foot, .table-tools { display: none !important; }
  .report { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---- danger button, menu forms ---------------------------------------- */
.btn-danger { color: var(--crit-text); }
.btn-danger:hover { background: var(--crit-bg); }
.menu-form { padding: 8px 10px; display: grid; gap: 10px; font-size: 13px; }
.menu-form .field textarea, .menu-form .field input[type=text] { width: 100%; }
.menu-form .muted { font-size: 12px; }

/* ---- change deltas (compare view) --------------------------------------- */
.delta { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.better { color: var(--good-text); }
.delta.worse { color: var(--crit-text); }
.delta.same { color: var(--muted); }

/* ---- page details ------------------------------------------------------- */
.details-link { display: inline-flex; margin-left: 6px; vertical-align: middle; color: var(--muted); }
.details-link:hover { color: var(--brand-text); }
.kv-wide li span:first-child { min-width: 140px; }
.kv-wide li b { text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.cwv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.cwv-metric { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.cwv-metric .stat-label { display: block; }
.cwv-metric .stat-value { font-size: 20px; }
.cwv-good { color: var(--good-text); } .cwv-needs-improvement { color: var(--warn-text); } .cwv-poor { color: var(--crit-text); }
@media (max-width: 640px) { .cwv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
