/* ==========================================================================
   UI-Venus-2 project page — charts.css
   Results section: domain tabs, bar-chart cards, tooltip, comparison
   tables (also used by the lazily-loaded partials).
   ========================================================================== */

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

.bench {
  margin: 40px 0;
}
.bench-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.bench-head h3 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 21px;
  margin: 0;
  letter-spacing: -0.01em;
}
.bench-head .bench-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--venus);
  background: var(--ice);
  border-radius: 6px;
  padding: 3px 9px;
}
.bench > p { color: var(--muted); font-size: 14.5px; margin: 4px 0 16px; max-width: 820px; }

.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 14.5px;
}
thead th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  padding: 13px 14px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
thead th:first-child { text-align: left; padding-left: 20px; }

tbody td {
  padding: 9.5px 14px;
  text-align: center;
  border-bottom: 1px solid #ecf4fb;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
tbody td:first-child {
  text-align: left;
  padding-left: 20px;
  font-family: var(--font-body);
  font-size: 14.5px;
}
tbody tr:last-child td { border-bottom: none; }

td.group {
  background: var(--ice);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--venus-deep);
  text-align: left;
  padding: 7px 20px;
}

tr.ours td {
  background: linear-gradient(90deg, rgba(59, 139, 244, 0.10), rgba(59, 139, 244, 0.03));
}
tr.ours td:first-child {
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--venus);
}
tr.dim td { color: var(--muted); }
td .best { font-weight: 700; color: var(--venus-deep); }

.table-foot {
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

/* --------------------------------------------------------------------------
   Result charts — bar colors: ours = venus blue, previous gens = light venus
   tint, other models = deliberately de-emphasized slate. Identity never rides
   on color alone: every bar is direct-labeled and full tables sit below.
   -------------------------------------------------------------------------- */

:root {
  --bar-ours: #1d6fe0;
  --bar-family: #9cc3f5;
  --bar-family-edge: #5b96e0;
  --bar-base: #64748b;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.sw-ours { background: var(--bar-ours); }
.sw-family { background: var(--bar-family); box-shadow: inset 0 0 0 1px var(--bar-family-edge); }
.sw-base { background: var(--bar-base); }
.sw-ghost {
  background: repeating-linear-gradient(45deg, rgba(29, 111, 224, 0.22) 0 3px, rgba(29, 111, 224, 0.05) 3px 6px);
  border: 1px dashed rgba(29, 111, 224, 0.55);
}

/* Domain tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 24px;
}
.tab-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--venus-deep); border-color: var(--venus-bright); }
.tab-btn[aria-selected="true"] {
  background: var(--venus);
  border-color: var(--venus);
  color: #fff;
}


.panel-note {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 820px;
  margin: 0 0 18px;
}

/* Chart cards */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
}
.chart-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.chart-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--venus);
}
.chart-metric {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.chart-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 6px 0 26px;
}

.plot {
  position: relative;
  height: 210px;
  border-bottom: 1.5px solid var(--line);
}
.gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #e2edf8;
  pointer-events: none;
}
.gridline i {
  position: absolute;
  left: 0;
  top: -8px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9.5px;
  color: #a9bdd6;
  background: var(--card);
  padding-right: 4px;
}

.bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
}
.bar-slot {
  flex: 1 1 0;
  min-width: 0;
  max-width: 74px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 8px 8px 0 0;
  cursor: default;
}
.bar-slot:hover, .bar-slot:focus-visible { background: rgba(59, 139, 244, 0.06); }

.bar {
  width: 60%;
  max-width: 36px;
  min-width: 18px;
  height: 0;
  border-radius: 5px 5px 0 0;
  position: relative;
  transition: height 0.7s cubic-bezier(0.22, 0.8, 0.34, 1);
}
.grown .bar { height: var(--h); }
.bar.ours { background: var(--bar-ours); }
.bar.family { background: var(--bar-family); box-shadow: inset 0 0 0 1px var(--bar-family-edge); }
.bar.base { background: var(--bar-base); }
.bar.ghost {
  background: repeating-linear-gradient(45deg, rgba(29, 111, 224, 0.16) 0 6px, rgba(29, 111, 224, 0.04) 6px 12px);
  border: 1.5px dashed rgba(29, 111, 224, 0.5);
  border-bottom: none;
}

.bar-val {
  position: absolute;
  top: -21px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease 0.4s;
}
.grown .bar-val { opacity: 1; }
.bar-slot.is-ours .bar-val { font-weight: 600; }
.bar-val .tbd { font-size: 9.5px; padding: 1px 5px; letter-spacing: 0.06em; }

.chart-names {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px 0;
}
.name-slot {
  flex: 1 1 0;
  min-width: 0;
  max-width: 74px;
  text-align: center;
}
.bar-name {
  font-size: 10px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}
.name-slot.is-ours .bar-name { font-weight: 650; }
.bar-sub {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
}
.name-slot.is-ours .bar-sub { color: var(--venus-deep); font-weight: 550; }
.chart-foot {
  margin: 12px 2px 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* Hover tooltip for bars */
.chart-tooltip {
  position: fixed;
  z-index: 90;
  max-width: 240px;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 12px 28px -12px rgba(12, 30, 58, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.chart-tooltip.show { opacity: 1; transform: none; }
.chart-tooltip .tt-model { font-weight: 600; color: #fff; }
.chart-tooltip .tt-val {
  font-family: var(--font-mono);
  color: var(--sky);
}
.chart-tooltip .tt-note { color: #9db4d8; font-size: 11.5px; }

/* Collapsible full tables */
.full-table { margin-top: 18px; }
.full-table > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--venus);
  padding: 8px 0;
  user-select: none;
}
.full-table > summary::-webkit-details-marker { display: none; }
.full-table > summary::before {
  content: "▸";
  font-size: 11px;
  transition: transform 0.15s ease;
}
.full-table[open] > summary::before { transform: rotate(90deg); }
.full-table > summary:hover { color: var(--venus-deep); }
.full-table .table-card { margin-top: 8px; }

.section-footnote {
  font-size: 12.5px;
  color: var(--muted);
  margin: 16px 0 0;
}


/* Lazily-loaded table partial states */
.table-load-error {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 4px;
}
