:root {
  color-scheme: light dark;
  --bg: #f4f7fa;
  --surface: #fff;
  --surface-2: #edf3f7;
  --text: #17252f;
  --muted: #607382;
  --line: #d5e0e7;
  --accent: #18a58b;
  --accent-strong: #087d6a;
  --accent-soft: #dff7f1;
  --blue: #03a9f4;
  --danger: #c23a4b;
  --warning: #986800;
  --shadow: 0 12px 34px rgb(20 45 58 / 8%);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1724; --surface: #132337; --surface-2: #192d43; --text: #f2f7fa;
    --muted: #a9bcc8; --line: #2d4358; --accent: #39d7b4; --accent-strong: #5ee5c6;
    --accent-soft: #123f3b; --blue: #45bdf5; --danger: #ff7180; --warning: #ffd166;
    --shadow: 0 16px 38px rgb(0 0 0 / 22%);
  }
}
:root[data-theme="light"] { color-scheme: light; --bg:#f4f7fa; --surface:#fff; --surface-2:#edf3f7; --text:#17252f; --muted:#607382; --line:#d5e0e7; --accent:#18a58b; --accent-strong:#087d6a; --accent-soft:#dff7f1; --blue:#038bc9; --danger:#c23a4b; --warning:#986800; --shadow:0 12px 34px rgb(20 45 58 / 8%); }
:root[data-theme="dark"] { color-scheme: dark; --bg:#0b1724; --surface:#132337; --surface-2:#192d43; --text:#f2f7fa; --muted:#a9bcc8; --line:#2d4358; --accent:#39d7b4; --accent-strong:#5ee5c6; --accent-soft:#123f3b; --blue:#45bdf5; --danger:#ff7180; --warning:#ffd166; --shadow:0 16px 38px rgb(0 0 0 / 22%); }
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
a { color: var(--blue); text-underline-offset: 3px; }
button, .button { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: .66rem .9rem; cursor: pointer; font-weight: 650; }
button:hover, .button:hover { border-color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button.primary { border-color: var(--accent); background: var(--accent); color: #05241f; }
button.filter-pending { border-color:var(--blue); background:var(--blue); color:#062335; box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 22%,transparent); }
button.danger { border-color: var(--danger); color: var(--danger); }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 2rem; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.product { display:flex; align-items:center; gap:.65rem; color:var(--text); text-decoration:none; font-weight:780; letter-spacing:-.02em; }
.product img { width: 30px; height: 30px; }
.topnav { display:flex; align-items:center; gap:.85rem; font-size:.9rem; }
.topnav a { color: var(--text); text-decoration: none; }
.language { width:auto; padding:.28rem .4rem; border:1px solid var(--line); border-radius:8px; color:var(--muted); background:transparent; font-size:.8rem; }
.version { color:var(--muted); font-size:.78rem; }
#message:not(:empty) { margin:.4rem 0 1rem; padding:.75rem 1rem; color:var(--danger); background:color-mix(in srgb, var(--danger) 9%, var(--surface)); border:1px solid color-mix(in srgb, var(--danger) 30%, var(--line)); border-radius:10px; }
.hero { position:relative; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) minmax(230px,320px); gap:2rem; align-items:center; padding:clamp(1.5rem,4vw,3.25rem); margin:0 0 1.4rem; border-radius:22px; color:#fff; background:linear-gradient(125deg,#0b1b2d 0%,#123651 70%,#125a66 130%); box-shadow:var(--shadow); }
.hero::after { content:""; position:absolute; width:280px; height:280px; right:-120px; top:-170px; border-radius:50%; background:rgb(57 215 180 / 12%); }
.hero h1 { max-width:720px; margin:0 0 .7rem; font-size:clamp(2rem,5vw,3.4rem); line-height:1.04; letter-spacing:-.045em; }
.hero p { margin:0; color:#c8deec; font-size:clamp(.95rem,2vw,1.08rem); }
.hero-copy { position:relative; z-index:1; }
.hero-actions { display:flex; flex-wrap:wrap; gap:.7rem; margin-top:1.15rem; }
.hero-install { display:inline-flex; align-items:center; gap:.55rem; padding:.66rem .9rem; border:1px solid rgb(255 255 255 / 32%); border-radius:10px; color:#fff; background:rgb(255 255 255 / 8%); font-weight:700; text-decoration:none; }
.hero-install:hover { border-color:#39e3ba; background:rgb(57 227 186 / 12%); }
.index-card { position:relative; z-index:1; display:grid; place-items:center; min-height:172px; padding:1.2rem; border:1px solid rgb(255 255 255 / 14%); border-radius:19px; color:#dcebf3; background:rgb(9 24 43 / 55%); text-align:center; }
button.index-card { width:100%; }
.index-card strong { display:block; color:#39e3ba; font-size:clamp(2.8rem,7vw,4.4rem); line-height:1; margin:.35rem 0; }
.index-card small { color:#bdd3e1; }
.highscore-card { text-decoration:none; }
.highscore-card:disabled { cursor:default; opacity:1; }
.highscore-action { margin-top:.45rem; color:#7be8d0; font-size:.75rem; font-weight:700; }
.install-intro { max-width:760px; margin:0 auto 1rem; text-align:center; }
.install-hero-icon { position:relative; z-index:1; justify-self:center; width:min(150px,40vw); height:auto; filter:drop-shadow(0 10px 24px rgb(0 0 0 / 20%)); }
.install-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; counter-reset:install-step; }
.install-step { position:relative; padding:1.2rem 1.2rem 1.2rem 3.7rem; border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:var(--shadow); }
.install-step::before { counter-increment:install-step; content:counter(install-step); position:absolute; left:1.1rem; top:1.1rem; display:grid; place-items:center; width:1.8rem; height:1.8rem; border-radius:50%; color:#05241f; background:var(--accent); font-weight:800; }
.install-step h3 { margin:0 0 .35rem; }
.install-step p { margin:0; color:var(--muted); }
.install-primary { display:flex; justify-content:center; margin:1.35rem 0 1.8rem; }
.install-primary .button { display:inline-flex; align-items:center; gap:.5rem; border-color:var(--accent); background:var(--accent); color:#05241f; text-decoration:none; }
.manual-install { max-width:820px; margin:0 auto; }
.repo-url { display:block; margin:.65rem 0; padding:.75rem; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); overflow-wrap:anywhere; user-select:all; }
h2 { margin:1.8rem 0 .7rem; font-size:1.3rem; letter-spacing:-.02em; }
h3 { margin:.2rem 0 .4rem; }
.section-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:.5rem 1rem; }
.section-heading h2 { margin-bottom:0; }
.note { color:var(--muted); font-size:.88rem; }
.run-grid, .metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.metric-grid { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); }
.panel { padding:1.15rem; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
.panel p:first-child, .panel h2:first-child { margin-top:0; }
.metric { position:relative; min-height:148px; display:flex; flex-direction:column; align-items:flex-start; gap:.15rem; padding:1rem; text-align:left; border-radius:15px; background:var(--surface); box-shadow:var(--shadow); }
.metric .weight { position:absolute; top:.75rem; right:.8rem; color:var(--muted); font-size:.76rem; font-weight:600; }
.metric .name { padding-right:2.7rem; color:var(--muted); font-size:.85rem; }
.metric .metric-index { margin-top:auto; font-size:2rem; line-height:1.1; letter-spacing:-.04em; }
.metric .raw { color:var(--text); font-size:.85rem; font-variant-numeric:tabular-nums; }
.metric .action { margin-top:.25rem; color:var(--blue); font-size:.76rem; }
.diagnostic-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:.7rem; }
.diagnostic { min-height:104px; box-shadow:none; background:var(--surface-2); padding:.8rem; }
.diagnostic .metric-index { font-size:1.35rem; }
.diagnostic .name { font-size:.79rem; }
.toolbar, .filters { display:flex; align-items:end; flex-wrap:wrap; gap:.65rem; margin:.9rem 0; }
.filters { padding:1rem; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.filters label { min-width:130px; flex:1 1 145px; }
.toolbar .spacer { flex:1; }
label { display:grid; gap:.25rem; color:var(--muted); font-size:.82rem; }
input, select { width:100%; min-height:42px; padding:.55rem .65rem; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--surface); }
label.inline { display:flex; align-items:center; gap:.5rem; }
label.inline input { width:auto; min-height:auto; }
progress { width:100%; height:8px; margin-top:1rem; border:0; border-radius:10px; overflow:hidden; }
progress::-webkit-progress-bar { background:var(--surface-2); }
progress::-webkit-progress-value { background:linear-gradient(90deg,var(--blue),var(--accent)); }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
table { width:100%; border-collapse:collapse; min-width:760px; }
th, td { padding:.72rem .8rem; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; font-size:.88rem; }
th { color:var(--muted); font-size:.76rem; letter-spacing:.02em; }
.select-column { width:84px; text-align:center; }
.select-column input { width:18px; min-height:18px; vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
td strong { font-size:1.05rem; }
.badge { display:inline-flex; gap:.3rem; align-items:center; padding:.2rem .5rem; border-radius:999px; color:var(--accent-strong); background:var(--accent-soft); font-size:.75rem; font-weight:700; white-space:nowrap; }
.badge.variable { color:var(--warning); background:color-mix(in srgb,var(--warning) 12%,var(--surface)); }
dl { display:grid; grid-template-columns:minmax(130px,1fr) minmax(180px,2fr); gap:.45rem 1rem; margin:0; }
dt { color:var(--muted); } dd { margin:0; overflow-wrap:anywhere; }
dialog { width:min(720px,calc(100% - 28px)); max-height:88vh; overflow:auto; padding:1.4rem; border:1px solid var(--line); border-radius:17px; color:var(--text); background:var(--surface); box-shadow:0 24px 80px rgb(0 0 0 / 35%); }
dialog::backdrop { background:rgb(4 14 24 / 62%); backdrop-filter:blur(3px); }
dialog h2 { margin-top:0; }
dialog pre { max-height:300px; overflow:auto; padding:.8rem; background:var(--surface-2); border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.75rem; }
.modal-actions { display:flex; justify-content:flex-end; gap:.6rem; margin-top:1rem; }
.dialog-stack { display:grid; gap:1rem; }
.dialog-stack > p { margin:0; }
.field-stack { display:grid; gap:.75rem; }
.consent-line { min-height:28px; }
.consent-line input { flex:0 0 auto; width:18px; height:18px; min-height:18px; margin:0; }
.consent-line span { line-height:1.35; }
.dialog-action-row { display:flex; align-items:center; gap:.65rem; }
.consent-box { display:grid; gap:.9rem; padding-top:1rem; border-top:1px solid var(--line); }
.dialog-close { padding-top:1rem; border-top:1px solid var(--line); }
.ranking-toolbar { margin-bottom:.55rem; }
.compare-index { display:block; font-size:1.2rem; }
.compare-raw { display:block; color:var(--muted); font-size:.75rem; white-space:nowrap; }
.hidden { display:none !important; }
footer { display:flex; align-items:center; flex-wrap:wrap; gap:.7rem 1rem; margin-top:2.2rem; padding:1.2rem 0; border-top:1px solid var(--line); color:var(--muted); font-size:.78rem; }
footer .brand { width:76px; height:auto; opacity:.48; filter:var(--brand-filter,none); }
@media (prefers-color-scheme:dark) { footer .brand { filter:invert(1); } }
:root[data-theme="dark"] footer .brand { filter:invert(1); }
:root[data-theme="light"] footer .brand { filter:none; }
@media (max-width:720px) {
  main { width:min(100% - 20px,1180px); }
  .topbar { min-height:56px; }
  .topnav a { display:none; }
  .version { display:none; }
  .hero { grid-template-columns:1fr; padding:1.35rem; gap:1rem; border-radius:17px; }
  .hero h1 { font-size:2.2rem; }
  .install-hero-icon { width:96px; }
  .index-card { min-height:125px; }
  .run-grid { grid-template-columns:1fr; }
  .install-grid { grid-template-columns:1fr; }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
  .metric { min-height:132px; padding:.8rem; }
  .diagnostic-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  dl { grid-template-columns:1fr; gap:.1rem; }
  dd { margin-bottom:.55rem; }
}
@media (max-width:420px) {
  .metric-grid, .diagnostic-grid { grid-template-columns:1fr; }
  .toolbar > button, .toolbar > .button { flex:1; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
