:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --border: #e3e6eb; --text: #151a22; --muted: #5d6675; --faint: #8b93a1;
  --accent: #4f52d8; --accent-soft: #ecebff; --good: #1f9d55; --good-soft: #e3f6ea; --warn: #c27c0e; --warn-soft: #fdf1dc; --bad: #d23a3a; --bad-soft: #fde7e7;
  --info: #5b6b85; --info-soft: #eceff4; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1116; --surface: #161b22; --surface-2: #1c222b; --border: #2a313c; --text: #e7ebf0; --muted: #9aa4b2; --faint: #6f7987;
  --accent: #8c8cff; --accent-soft: #23234a; --good: #3fbf74; --good-soft: #15291e; --warn: #e3a336; --warn-soft: #2e2413; --bad: #f06565; --bad-soft: #321a1b; --info: #9aa9c2; --info-soft: #1f2530;
  --shadow: none; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161b22; --surface-2: #1c222b; --border: #2a313c; --text: #e7ebf0; --muted: #9aa4b2; --faint: #6f7987;
  --accent: #8c8cff; --accent-soft: #23234a; --good: #3fbf74; --good-soft: #15291e; --warn: #e3a336; --warn-soft: #2e2413; --bad: #f06565; --bad-soft: #321a1b; --info: #9aa9c2; --info-soft: #1f2530;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.break { word-break: break-all; }

/* layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; }
.brand svg, .brand-logo { flex: none; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.brand-name b { font-weight: 700; background: linear-gradient(90deg, var(--accent), #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: .02em; margin-top: 2px; }
.side a.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.side a.nav:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side a.nav.active { background: var(--accent-soft); color: var(--accent); }
.side .sep { height: 1px; background: var(--border); margin: 8px 4px; }
.side .foot { margin-top: auto; padding: 10px 8px 0; font-size: 12px; color: var(--faint); }
.main { min-width: 0; padding: 24px 32px 64px; }
.wrap { max-width: 1240px; margin: 0 auto; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.topbar .title { min-width: 0; }
.topbar .title .url { color: var(--muted); font-size: 13px; word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mobile-nav { display: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h3, .card > h4 { margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.section { margin-top: 24px; } .section > h2 { margin-bottom: 12px; }
.stack > * + * { margin-top: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 8px; width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; }

/* hero / form */
.hero { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.hero-logo { display: block; margin: 0 auto 10px; width: 112px; height: 112px; filter: drop-shadow(0 6px 18px rgba(79,82,216,.35)); }
.hero h1 { font-size: 34px; letter-spacing: -.02em; }
.hero p.lead { color: var(--muted); font-size: 16px; margin: 10px 0 26px; }
.url-form { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 6px; border-radius: 12px; box-shadow: var(--shadow); }
.url-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-size: 16px; outline: none; }
.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.opts input[type=number] { width: 72px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 36px 0 10px; text-align: left; }
.feature { overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; }
.feature b { display: block; margin-bottom: 2px; }
.err { color: var(--bad); margin-top: 12px; }

/* progress */
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .4s ease; }
.log { font-family: var(--mono); font-size: 12px; color: var(--muted); max-height: 260px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 14px; text-align: left; }
.log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* scores */
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring .val { position: absolute; text-align: center; line-height: 1; }
.ring .val b { display: block; font-size: 30px; font-weight: 700; }
.ring .val span { font-size: 12px; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.cat:hover { border-color: var(--accent); text-decoration: none; }
.cat .n { font-size: 24px; font-weight: 700; }
.cat .l { font-size: 12.5px; color: var(--muted); }
.cat .bar { height: 4px; background: var(--surface-2); border-radius: 9px; margin-top: 8px; overflow: hidden; }
.cat .bar > i { display: block; height: 100%; }
.c-good { color: var(--good); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); } .c-info { color: var(--info); }
.bg-good { background: var(--good); } .bg-warn { background: var(--warn); } .bg-bad { background: var(--bad); } .bg-info { background: var(--info); }

/* key-value list */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12.5px; color: var(--muted); }

/* pills / badges */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sev-critical { background: var(--bad); color: #fff; } .sev-high { background: var(--bad-soft); color: var(--bad); } .sev-medium { background: var(--warn-soft); color: var(--warn); } .sev-low { background: var(--info-soft); color: var(--info); } .sev-info { background: var(--surface-2); color: var(--muted); }
.st-pass { background: var(--good-soft); color: var(--good); } .st-fail { background: var(--bad-soft); color: var(--bad); } .st-info, .st-na { background: var(--surface-2); color: var(--muted); } .st-warn { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.chip small { color: var(--faint); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; cursor: default; white-space: nowrap; font-size: 12.5px; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .u { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* issue list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[type=search], .filters select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.filters input[type=search] { flex: 1; min-width: 180px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.issue { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.issue > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; }
.issue > summary::-webkit-details-marker { display: none; }
.issue .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; font-weight: 700; }
.issue .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.issue .body { padding: 0 14px 14px 44px; font-size: 13px; }
.issue .body pre { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; margin: 6px 0; font-size: 12px; max-height: 220px; overflow: auto; }
.issue .fix { border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--accent-soft); border-radius: 0 6px 6px 0; margin: 8px 0; }
.urls { margin: 6px 0 0; padding-left: 16px; max-height: 200px; overflow: auto; }
.urls li { word-break: break-all; }

/* completeness */
.big-meter { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.big-meter > div { height: 100%; border-radius: 99px; }
.check-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: start; }
.check-row:last-child { border-bottom: 0; }
.tick { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; margin-top: 2px; }

/* bars */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbar > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.shots { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: start; }
.shot { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.shot img { display: block; width: 100%; height: auto; }
.summary-list { margin: 0; padding-left: 18px; } .summary-list li { margin: 4px 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.note { background: var(--info-soft); color: var(--info); padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }
.history-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: 0; }

@media (max-width: 1100px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: block; position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px; }
  .mobile-nav select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
  .main { padding: 16px 16px 48px; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .shots { grid-template-columns: 1fr 96px; }
  .issue > summary { grid-template-columns: 20px 1fr; }
  .issue .meta { grid-column: 2; justify-content: flex-start; }
  .hero h1 { font-size: 26px; }
  .url-form { flex-direction: column; }
  .features { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .history-row { grid-template-columns: 1fr auto; }
  .issue .body { padding-left: 14px; }
}
@media print {
  .side, .mobile-nav, .actions, .filters, .no-print { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  .card, .issue { break-inside: avoid; box-shadow: none; }
  details.issue { display: block; } details.issue > .body { display: block; }
}
