/* spark-ds41f benchmark comparison dashboard — dark information-dense theme.
   Vanilla CSS only.  No external fonts or assets. */

:root {
  --bg: #0b0e13;
  --bg-elev: #0f131a;
  --panel: #141a23;
  --panel-2: #181f2a;
  --panel-3: #1d2531;
  --border: #232c39;
  --border-strong: #303c4d;
  --text: #dce3ec;
  --text-2: #a9b5c4;
  --muted: #7e8b9d;
  --dim: #5d6a7c;
  --accent: #5aa9e6;
  --accent-soft: rgba(90, 169, 230, 0.14);
  --good: #46c98b;
  --good-soft: rgba(70, 201, 139, 0.14);
  --bad: #ef7373;
  --bad-soft: rgba(239, 115, 115, 0.14);
  --warn: #e6b450;
  --warn-soft: rgba(230, 180, 80, 0.14);
  --v0: #e8a33d;
  --v0-soft: rgba(232, 163, 61, 0.14);
  --v1: #45c2d6;
  --v1-soft: rgba(69, 194, 214, 0.14);
  --v2: #a78bfa;
  --v2-soft: rgba(167, 139, 250, 0.14);
  --font-sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SF Mono", "Menlo", "DejaVu Sans Mono", monospace;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 400px at 20% -10%, rgba(90, 169, 230, 0.07), transparent 60%),
    radial-gradient(900px 300px at 90% -20%, rgba(232, 163, 61, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.dash { color: var(--dim); font-weight: 400; }
.nowrap { white-space: nowrap; }
.numeric { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #06101a;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ header */

.app-header {
  padding: 20px clamp(16px, 2.4vw, 34px) 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 26, 35, 0.72), rgba(11, 14, 19, 0.25));
}

.header-main {
  max-width: 1760px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 280px; }
.brand-mark { color: var(--accent); display: flex; filter: drop-shadow(0 0 12px rgba(90, 169, 230, 0.35)); }
.brand-text h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.h1-sub { color: var(--text-2); font-weight: 500; font-size: 19px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

.header-meta {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.meta-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meta-item-wide { max-width: 420px; }
.meta-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.meta-value { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
#meta-fingerprint { color: var(--text); cursor: help; }
.meta-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.reload-status { min-height: 15px; font-size: 11.5px; color: var(--muted); text-align: right; max-width: 260px; }
.reload-status.is-ok { color: var(--good); }
.reload-status.is-new { color: var(--accent); }
.reload-status.is-err { color: var(--bad); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 13px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--accent); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-small { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }

/* --------------------------------------------------------------- sticky bar */

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 17, 24, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.filter-bar { border-bottom: 1px solid var(--border); }
.filter-row {
  max-width: 1760px;
  margin: 0 auto;
  padding: 10px clamp(16px, 2.4vw, 34px) 9px;
  display: flex;
  align-items: flex-end;
  gap: 26px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.filter-en { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); letter-spacing: 0; }
.hint-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--dim);
  font-size: 9px;
  cursor: help;
}

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  --chip-color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color);
  opacity: 0.35;
  transition: opacity 120ms ease;
  flex: none;
}
.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--chip-color) 55%, var(--border));
  background: color-mix(in srgb, var(--chip-color) 13%, var(--panel));
}
.chip[aria-pressed="true"] .chip-dot { opacity: 1; box-shadow: 0 0 8px var(--chip-color); }
.chip-node .chip-dot { border-radius: 2px; }
.chip-version { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.chip-version .chip-name { font-family: var(--font-sans); }
.chip small { color: var(--dim); font-size: 10px; }

.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.filter-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-summary { font-size: 11.5px; color: var(--muted); }
.filter-summary .warn { color: var(--warn); }

/* ------------------------------------------------------------------- tabs */

.tabs {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.4vw, 34px);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 10px 15px 11px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text-2); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-en { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); }
.tab[aria-selected="true"] .tab-en { color: var(--accent); }

/* ------------------------------------------------------------------- main */

.main {
  max-width: 1760px;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.4vw, 34px) 44px;
  outline: none;
}

.boot-state { padding: 20vh 0; text-align: center; color: var(--muted); }
.boot-state p { margin: 8px 0; }
.boot-hint { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.page-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.page-title .en { font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-left: 8px; font-weight: 400; letter-spacing: 0; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; max-width: 1000px; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.section-grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.card {
  background: linear-gradient(180deg, rgba(24, 31, 42, 0.9), rgba(18, 23, 31, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  min-width: 0;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.2px; }
.card-title .en { font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-left: 7px; font-weight: 400; letter-spacing: 0; }
.card-sub { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 0; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.card-note .mono { color: var(--text-2); }

/* -------------------------------------------------------------------- kpi */

.kpi {
  padding: 14px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.55;
}
.kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: baseline; gap: 7px; }
.kpi-label .en { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); }
.kpi-value { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -0.3px; }
.kpi-value .unit { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 5px; letter-spacing: 0; }
.kpi-value.pos { color: var(--good); }
.kpi-value.neg { color: var(--bad); }
.kpi-sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 17px; }
.kpi-sub .tag {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
}

/* ----------------------------------------------------------------- matrix */

.matrix-wrap { overflow-x: auto; }
.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.matrix th, .matrix td {
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  text-align: left;
  vertical-align: middle;
}
.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.matrix thead th .en { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); font-weight: 400; margin-left: 5px; }
.matrix tbody tr:hover td { background: rgba(90, 169, 230, 0.045); }
.matrix .row-label { white-space: nowrap; color: var(--text-2); font-weight: 600; }
.node-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text);
}
.matrix .cell { min-width: 150px; }
.cell-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.cell-value .unit { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 5px; letter-spacing: 0; }
.cell-note { margin-top: 2px; font-size: 10.5px; color: var(--dim); font-family: var(--font-mono); }
.cell-empty { color: var(--dim); font-size: 16px; }
.cell-base { margin-top: 3px; font-size: 10.5px; color: var(--dim); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-good { background: var(--good-soft); color: var(--good); border: 1px solid rgba(70, 201, 139, 0.35); }
.badge-bad { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(239, 115, 115, 0.35); }
.badge-flat { background: var(--panel-3); color: var(--muted); border: 1px solid var(--border-strong); }
.badge-neutral { background: var(--panel-3); color: var(--text-2); border: 1px solid var(--border-strong); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(230, 180, 80, 0.35); }
.badge-image { background: rgba(167, 139, 250, 0.13); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.42); }
.badge-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.image-id-list { margin: 5px 0 0; padding-left: 18px; }
.image-id-list li { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); overflow-wrap: anywhere; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(90, 169, 230, 0.35); }
.badge-version {
  border: 1px solid currentColor;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
}
.badge .arrow { font-size: 9px; line-height: 1; }

/* ----------------------------------------------------------------- charts */

.chart-card { min-width: 0; }
.chart-section-heading {
  margin: 14px 0 7px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.chart-section-heading:first-child { margin-top: 0; }
.chart-host {
  position: relative;
  width: 100%;
  min-width: 0;
}
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  background: rgba(15, 19, 26, 0.5);
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 3px 14px;
  margin: 2px 0 12px;
  font-size: 11.5px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  cursor: default;
  padding: 2px 4px;
  border-radius: 4px;
  min-width: 0;
}
.legend-item:hover { background: var(--panel-2); color: var(--text); }
.legend-swatch { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 12px; }
.legend-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-note { color: var(--dim); font-family: var(--font-mono); font-size: 9.5px; margin-left: auto; }
.legend-heading { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; align-self: center; grid-column: 1 / -1; margin-top: 3px; }

svg text { font-family: var(--font-sans); }
.axis-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.axis-title { fill: var(--dim); font-size: 10.5px; letter-spacing: 0.04em; }
.grid-line { stroke: #222a36; stroke-width: 1; }
.axis-line { stroke: #334052; stroke-width: 1; }
.ref-line { stroke: var(--dim); stroke-width: 1.2; stroke-dasharray: 6 4; }
.highlight-band { fill: rgba(90, 169, 230, 0.07); }
.highlight-line { stroke: rgba(90, 169, 230, 0.5); stroke-width: 1.2; stroke-dasharray: 4 4; }
.highlight-label { fill: var(--accent); font-size: 9.5px; font-family: var(--font-mono); }
.series-line { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.series-g.dim { opacity: 0.16; }
.series-g { transition: opacity 120ms ease; }
.errorbar { stroke-width: 1.1; opacity: 0.72; }
.errorbar-cap { stroke-width: 1.1; opacity: 0.72; }
.bar { stroke: rgba(255, 255, 255, 0.09); stroke-width: 0.6; }
.bar.dim { opacity: 0.2; }
.bar-value { fill: var(--text-2); font-size: 9.5px; font-variant-numeric: tabular-nums; text-anchor: middle; }
.bar-missing { fill: var(--dim); font-size: 11px; text-anchor: middle; }
.hover-line { stroke: rgba(220, 227, 236, 0.35); stroke-width: 1; pointer-events: none; }
.hover-dot { fill: var(--bg); stroke-width: 1.6; pointer-events: none; }

.chart-tip {
  position: absolute;
  z-index: 30;
  min-width: 170px;
  max-width: 330px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(10, 13, 18, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 11.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 80ms ease;
}
.chart-tip.is-visible { opacity: 1; }
.tt-title {
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text);
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.tt-row { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; min-width: 0; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tt-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-val { margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.tt-extra { color: var(--dim); font-size: 10.5px; padding-top: 4px; margin-top: 4px; border-top: 1px dashed var(--border); }

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.data-table th, .data-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table thead tr.sub th { position: static; }
.data-table th .en, .data-table td .en { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); font-weight: 400; }
.data-table tbody tr:hover td { background: rgba(90, 169, 230, 0.04); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.data-table td .cell-main { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.data-table td .cell-secondary { font-family: var(--font-mono); font-size: 10px; color: var(--dim); white-space: nowrap; margin-top: 1px; }
.data-table .group-head {
  background: var(--panel-3);
  color: var(--text-2);
  font-size: 11px;
  border-bottom: 1px solid var(--border-strong);
}
.data-table .group-head .en { color: var(--dim); }
.data-table .focus-col { box-shadow: inset 0 0 0 1px rgba(90, 169, 230, 0.28); }
.data-table tr.row-alt td { background: rgba(255, 255, 255, 0.012); }
.row-label-cell { white-space: nowrap; }
.row-label-cell .row-version { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.version-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.version-dot.v0 { background: var(--v0); box-shadow: 0 0 7px rgba(232, 163, 61, 0.5); }
.version-dot.v1 { background: var(--v1); box-shadow: 0 0 7px rgba(69, 194, 214, 0.5); }
.version-dot.v2 { background: var(--v2); box-shadow: 0 0 7px rgba(167, 139, 250, 0.5); }
.row-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.table-caption { padding: 9px 14px 11px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--border); }

/* ----------------------------------------------------------------- detail */

.detail-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.detail-table thead th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  text-align: right;
  position: sticky;
  top: 0;
  z-index: 1;
}
.detail-table thead tr:first-child th { top: 0; }
.detail-table thead tr.sub th { top: 28px; }
.detail-table thead th.case-col { min-width: 78px; }
.detail-table tbody td {
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.detail-table tbody td:first-child { text-align: left; }
.detail-table tbody tr.run-row { cursor: pointer; }
.detail-table tbody tr.run-row:hover td { background: rgba(90, 169, 230, 0.05); }
.detail-table tbody tr.run-row.is-open td { background: rgba(90, 169, 230, 0.07); border-bottom-color: transparent; }
.detail-table tbody tr.run-row td.focus-col { box-shadow: inset 0 0 0 1px rgba(90, 169, 230, 0.22); }
.detail-table td .cell-main { font-family: var(--font-mono); font-size: 11.5px; color: var(--text); white-space: nowrap; }
.detail-table td .cell-secondary { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); white-space: nowrap; }
.detail-table td.case-empty { color: var(--dim); }
.expand-row td { padding: 0 !important; background: rgba(9, 12, 17, 0.6); border-bottom: 1px solid var(--border-strong) !important; }
.expand-panel { padding: 14px 16px 16px; }
.expand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.fact-block { min-width: 0; }
.fact-title { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.fact-list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; font-size: 11.5px; }
.fact-list dt { color: var(--muted); white-space: nowrap; }
.fact-list dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.fact-list dd.mono, .fact-list .mono { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.mini-table th, .mini-table td { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table th { color: var(--dim); font-weight: 500; font-size: 10px; }
.mini-table td { color: var(--text-2); font-variant-numeric: tabular-nums; }
.mini-table td.num { text-align: right; font-family: var(--font-mono); }
.mini-table tr:last-child td { border-bottom: 0; }
.chips-line { display: flex; flex-wrap: wrap; gap: 5px; }
.verdict { padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 10px; }
.verdict.pass { background: var(--good-soft); color: var(--good); }
.verdict.fail { background: var(--bad-soft); color: var(--bad); }
.verdict.other { background: var(--panel-3); color: var(--muted); }
.warn-badge { cursor: help; }
.expand-toggle {
  display: inline-block;
  width: 13px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: transform 120ms ease;
}
tr.run-row.is-open .expand-toggle { color: var(--accent); transform: rotate(90deg); }
.metric-select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  min-width: 190px;
  cursor: pointer;
}
.metric-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.metric-select option { background: var(--panel-2); color: var(--text); }

/* --------------------------------------------------------------- versions */

.version-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 16px; }
.version-card { position: relative; overflow: hidden; }
.version-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--version-color, var(--accent));
  opacity: 0.85;
}
.version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.version-name { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; font-family: var(--font-mono); }
.version-tagline { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.version-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.version-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.version-section:last-child { border-bottom: 0; }
.version-section h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.version-section h3 .en { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0; margin-left: 6px; }
.change-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.change-text.expanded { display: block; -webkit-line-clamp: unset; }
.change-toggle { margin-top: 6px; }
.pin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pin-table th, .pin-table td { padding: 3px 8px 3px 0; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.pin-table th { color: var(--dim); font-weight: 500; font-size: 10px; white-space: nowrap; width: 1%; }
.pin-table td { color: var(--text-2); font-family: var(--font-mono); font-size: 10.5px; overflow-wrap: anywhere; }
.pin-table tr:last-child th, .pin-table tr:last-child td { border-bottom: 0; }
.capacity-table td.num { text-align: right; font-family: var(--font-mono); }
.diff-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.diff-table th, .diff-table td { padding: 6px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.diff-table th { color: var(--muted); font-size: 10.5px; font-weight: 600; background: var(--panel-2); }
.diff-table td.field { color: var(--text); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.diff-table td.hash { font-family: var(--font-mono); font-size: 10.5px; overflow-wrap: anywhere; }
.diff-table td.hash .before { color: var(--muted); }
.diff-table td.hash .after { color: var(--good); }
.diff-table tr:last-child td { border-bottom: 0; }
.diff-arrow { color: var(--dim); }
.change-note { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.details-block > summary { cursor: pointer; color: var(--muted); font-size: 11.5px; padding: 4px 0; }
.details-block > summary:hover { color: var(--text); }
.details-block[open] > summary { color: var(--text-2); margin-bottom: 6px; }
.details-block ul { margin: 4px 0 0; padding-left: 18px; }
.details-block li { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); overflow-wrap: anywhere; }

/* --------------------------------------------------------- empty / notice */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(15, 19, 26, 0.55);
  color: var(--muted);
}
.empty-state .empty-icon { color: var(--dim); font-size: 26px; line-height: 1; }
.empty-state .empty-title { color: var(--text-2); font-size: 14px; font-weight: 600; }
.empty-state .empty-hint { font-size: 12px; max-width: 640px; line-height: 1.6; }
.empty-state .empty-actions { margin-top: 6px; }

.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  margin-bottom: 14px;
}
.notice-bar.warn { border-color: rgba(230, 180, 80, 0.35); background: var(--warn-soft); color: #f0d59a; }
.notice-bar.info { border-color: rgba(90, 169, 230, 0.3); background: var(--accent-soft); color: #b9d9f3; }
.notice-bar .notice-icon { flex: none; font-size: 13px; line-height: 1.4; }
.notice-bar a, .notice-bar button.link {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  font: inherit;
  padding: 0;
}

/* ----------------------------------------------------------------- footer */

.app-footer {
  border-top: 1px solid var(--border);
  background: rgba(15, 19, 26, 0.6);
  padding: 22px clamp(16px, 2.4vw, 34px) 26px;
}
.footer-main {
  max-width: 1760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
}
.footer-title {
  margin: 0 0 9px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.footer-title .filter-en { letter-spacing: 0; }
.notes-list { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 12px; line-height: 1.7; }
.notes-list li { margin-bottom: 5px; }
.footer-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 11.5px; }
.footer-dl dt { color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; }
.footer-dl dd { margin: 0; color: var(--text-2); font-family: var(--font-mono); font-size: 10.5px; overflow-wrap: anywhere; }
.footer-legal { max-width: 1760px; margin: 18px auto 0; color: var(--dim); font-size: 10.5px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .grid-2, .grid-3, .version-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-main { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .filter-row { gap: 14px 20px; }
  .filter-actions { margin-left: 0; }
  .header-main { flex-direction: column; gap: 14px; }
  .header-meta { justify-content: flex-start; }
  .meta-actions { align-items: flex-start; }
  .reload-status { text-align: left; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .kpi-value { font-size: 23px; }
  .main { padding-top: 14px; }
  .brand-text h1 { font-size: 19px; }
  .h1-sub { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
