/* AKRA ARENA v3 dashboard — DESIGN B "sharp" (institutional / research
 * terminal). Pure override layer: every rule is scoped to
 * [data-design="sharp"], so Design A (classic) is untouched and the owner
 * can switch back at any time. Application logic is shared.
 *
 * Dark is the default; light is a designed palette, not an inversion.
 * Model identity is a quiet secondary cue (small marker + name); strong
 * color is reserved for semantic meaning (positive / negative / warning).
 */

:root[data-design="sharp"] {
  --bg: #0a0b0d;
  --panel: #111214;
  --panel-2: #17181b;
  --line: #26272b;
  --grid: #202124;
  --fg: #eceae6;
  --dim: #9c9c97;
  --muted: #6f6f6a;
  --up: #0ca30c;
  --down: #e34948;
  --warn: #fab219;
  --live: #0ca30c;
  --accent: #8ab0e0;
  --brand: #d4a857;   /* official logo gold (sampled from the frozen artwork);
                         brand accent ONLY — never P&L, warning or health */
  --radius: 2px;
  /* categorical model hues, dark steps (validated on dark surface) */
  --m1: #3987e5; --m2: #d95926; --m3: #199e70;
  --m4: #c98500; --m5: #d55181; --m6: #008300;
  /* PERMANENT CHART IDENTITY (owner ruling 2026-08-15; js/chartseries.js is
     the authority): primary account = brand gold, benchmark = neutral gray
     (always dashed), comparisons = restrained fixed palette. Never red/green
     as series identity; red/green stay reserved for P&L semantics.
     Comparison ORDER is CVD-validated — blue,rose,cyan,violet — don't
     reorder it (blue beside violet fails colorblind separation). */
  --chart-primary: #d4a857;
  --chart-benchmark: #8a8a85;
  --cmp1: #3987e5; --cmp2: #d55181; --cmp3: #2fa4b8; --cmp4: #7e6ae0;
}

:root[data-design="sharp"][data-mode="light"] {
  color-scheme: light;
  --bg: #f4f4f1;
  --panel: #ffffff;
  --panel-2: #f0f0ec;
  --line: #dddDD6;
  --grid: #e9e9e3;
  --fg: #161613;
  --dim: #5d5d58;
  --muted: #8b8b84;
  --up: #006300;
  --down: #c22a29;
  --warn: #9a6700;
  --live: #006300;
  --accent: #1c5cab;
  --brand: #a87f2e;   /* gold stepped darker for the light surface */
  /* light steps of the same six hues (validated on white) */
  --m1: #2a78d6; --m2: #eb6834; --m3: #1baf7a;
  --m4: #eda100; --m5: #e87ba4; --m6: #008300;
  /* chart identity, light steps (same roles, validated on white) */
  --chart-primary: #a87f2e;
  --chart-benchmark: #767671;
  --cmp1: #2a78d6; --cmp2: #ad3a68; --cmp3: #0d8fa0; --cmp4: #5a48c9;
  /* light surfaces need less colour to read as tinted, and the light --up /
     --down steps are already dark, so both mixes come down a little */
  --tint-fill-mix: 9%;
  --tint-edge-mix: 38%;
  --tint-fill-mix-strong: 16%;
}

/* ------------------------------------------------------------ typography -- */
[data-design="sharp"] body {
  font-size: 14px;
  line-height: 1.5;
}
[data-design="sharp"] .brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 4px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
[data-design="sharp"] .brand-sub {
  font-size: 10.5px;
  letter-spacing: 3.2px;
  margin-top: 1px;
}
[data-design="sharp"] .card-title {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg);
  margin: 0 0 10px;
}
[data-design="sharp"] .detail-title {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.2px;
}
[data-design="sharp"] .stat-label {
  text-transform: none;
  letter-spacing: 0.1px;
  font-size: 11.5px;
  font-weight: 500;
}
[data-design="sharp"] .stat-value,
[data-design="sharp"] .account-card-equity,
[data-design="sharp"] .model-card-return,
[data-design="sharp"] .matrix-val,
[data-design="sharp"] .picker-eq {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- geometry -- */
[data-design="sharp"] .site-header { padding: 16px 22px 11px; }
[data-design="sharp"] .site-nav a {
  font-size: 11.5px;
  letter-spacing: 1px;
  padding: 10px 12px;
  border-bottom-width: 2px;
}
/* active nav: brighter text + thin brand-gold indicator, no boxed state */
[data-design="sharp"] .site-nav a.nav-on {
  color: var(--fg);
  border-bottom-color: var(--brand);
}
[data-design="sharp"] main { padding: 16px 22px 48px; max-width: 1280px; }

[data-design="sharp"] section.card {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
[data-design="sharp"] .footnote { font-size: 11.5px; margin-top: 8px; }

/* metric INSTRUMENT PANEL: one shared surface, thin vertical separators
   only, quiet labels, strong numbers — not seven isolated rectangles */
[data-design="sharp"] .stat-grid {
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
[data-design="sharp"] .stat-card {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px 11px;
  gap: 3px;
}
[data-design="sharp"] .stat-card .stat-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .2px;
  min-height: 28px;
}
[data-design="sharp"] .stat-value { font-size: 24px; font-variant-numeric: tabular-nums; }
[data-design="sharp"] .stat-small .stat-value { font-size: 14px; padding-top: 3px; }
[data-design="sharp"] .stat-sub { font-size: 11.5px; }

/* ------------------------------------------------- restrained identity ---- */
[data-design="sharp"] .model-dot {
  width: 7px; height: 7px;
  border-radius: 1px;
  margin-right: 5px;
  opacity: 0.9;
}

/* ---------------------------------------------- THE SHARED CARD PRIMITIVE -
   One geometry for Model AND Family navigation cards (owner ruling: the
   two pages must feel like the same visual scale). Fixed target width via
   flex-basis + max-width — five Family cards leave breathing room on the
   row instead of stretching larger than the six Model cards. Fixed internal
   rows (title / subtitle / bottom-anchored metric / meta) keep baselines
   level regardless of text length. Wraps naturally below desktop width. */
[data-design="sharp"] .model-grid,
[data-design="sharp"] .family-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* Families has FIVE fixed-width cards to Models' six: the same primitive,
   centered on its row so the shorter row reads deliberate instead of
   left-heavy (owner ruling 2026-08-15). Card dimensions are untouched —
   centering is a container property, and wrapped rows keep wrapping
   naturally (each wrapped row centers within the same content width). */
[data-design="sharp"] .family-grid { justify-content: center; }
[data-design="sharp"] .model-card,
[data-design="sharp"] .family-card {
  display: flex;
  flex-direction: column;
  flex: 0 1 190px;                /* SAME fixed width on both pages */
  min-height: 188px;
  border: 1px solid var(--line);
  border-left-width: 1px;                   /* no rainbow edge */
  border-radius: var(--radius);
  padding: 13px 14px;
  gap: 4px;
  background: var(--panel);
}
[data-design="sharp"] .model-card:hover,
[data-design="sharp"] .family-card:hover { border-color: var(--dim); }
[data-design="sharp"] .model-card-short,
[data-design="sharp"] .family-card-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  min-height: 24px;
}
[data-design="sharp"] .model-card-full,
[data-design="sharp"] .family-card > .dim {
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
  margin-top: -2px;
  min-height: 37px;               /* absorbs 1- vs 2-line subtitles */
}
[data-design="sharp"] .model-card-metric {
  margin-top: 2px;                /* fixed offset: title and subtitle rows
                                     above are fixed-height, so every card's
                                     metric starts at the same y */
  display: grid;
  /* FIXED rows (label / value / optional note): identical geometry on every
     card, no row compression, empty note row simply stays empty */
  grid-template-rows: 18px 30px 18px;
  gap: 2px;
  align-content: start;
  padding-top: 6px;
}
[data-design="sharp"] .model-card-metric .info { width: 13px; height: 13px; line-height: 13px; }
[data-design="sharp"] .model-card-metric .stat-label {
  font-size: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-design="sharp"] .model-card-return { font-size: 20px; font-variant-numeric: tabular-nums; }
[data-design="sharp"] .model-card-foot,
[data-design="sharp"] .family-card > .pill {
  margin-top: auto;               /* bottom meta pinned to the card floor */
  min-height: 20px;
  font-size: 11.5px;
}
[data-design="sharp"] .model-card .pill,
[data-design="sharp"] .family-card > .pill {
  line-height: 15px;              /* identical foot-row height on both cards */
}
[data-design="sharp"] .family-card > .pill { align-self: flex-start; }
@media (max-width: 700px) {
  /* small screens: two-up fluid cards, same geometry otherwise */
  [data-design="sharp"] .model-card,
  [data-design="sharp"] .family-card { flex: 1 1 42%; min-height: 170px; }
}
[data-design="sharp"] .detail-head {
  border-left: 2px solid var(--fg);
  padding-left: 12px;
}

/* ------------------------------------------------------------- controls --- */
[data-design="sharp"] .pill {
  border-radius: 2px;
  padding: 1px 7px;
  font-size: 10.5px;
  letter-spacing: 0.4px;
}
[data-design="sharp"] .family-tag {
  border-radius: 2px;
  font-size: 10.5px;
  padding: 1px 6px;
}
[data-design="sharp"] .chip,
[data-design="sharp"] .tab {
  border-radius: 2px;
  font-size: 11.5px;
  padding: 3px 10px;
}
[data-design="sharp"] .chip-on {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
[data-design="sharp"] .tab { letter-spacing: 0.6px; padding: 5px 14px; }
[data-design="sharp"] .tab-on { border-color: var(--fg); }
[data-design="sharp"] .filter-bar { padding: 2px 0 10px; gap: 8px 14px; }

/* --------------------------------------------------------------- tables --- */
/* fewer horizontal rules: header underline + spacing + hover carry the
   structure; the matrix keeps its full grid (it IS a grid) */
[data-design="sharp"] .data-table { font-size: 12.5px; }
[data-design="sharp"] .data-table th {
  text-transform: none;
  letter-spacing: 0.1px;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
[data-design="sharp"] .data-table td { border-bottom: 0; }
[data-design="sharp"] .data-table th, [data-design="sharp"] .data-table td {
  padding: 8px 9px;
}
[data-design="sharp"] .matrix-table thead th,
[data-design="sharp"] .matrix-rowhead { padding: 6px 9px; font-size: 11.5px; }
[data-design="sharp"] .matrix-cell-link { padding: 9px 6px; min-height: 38px; }
[data-design="sharp"] .matrix-val { font-size: 12.5px; }

/* -------------------------------------------------------- cards & picker -- */
[data-design="sharp"] .account-card,
[data-design="sharp"] .compare-card,
[data-design="sharp"] .picker-item {
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
  gap: 5px;
}
[data-design="sharp"] .compare-card { border-top: 1px solid var(--line); }
[data-design="sharp"] .account-card-equity { font-size: 18px; }
[data-design="sharp"] .account-card:hover,
[data-design="sharp"] .picker-item:hover { border-color: var(--dim); }
[data-design="sharp"] .picker-on {
  border-color: var(--fg);
  background: var(--panel-2);
}

/* ----------------------------------------------------------- empty state -- */
[data-design="sharp"] .empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
[data-design="sharp"] .empty-title { font-size: 13px; }
[data-design="sharp"] .empty-detail { font-size: 12px; }

[data-design="sharp"] .chart-tip { border-radius: 2px; }
[data-design="sharp"] .problem-strip { border-radius: var(--radius); }

/* light-mode chrome details */
:root[data-design="sharp"][data-mode="light"] #fixture-banner {
  background: #fff3d6;
  color: #7a5200;
  border-bottom: 1px solid #e6c980;
}
:root[data-design="sharp"][data-mode="light"] .chart-tip {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------ brand (owner-frozen) ---- */
/* The banner line moved into the site header (owner ruling 2026-08-19: hero,
   then ONE market + round area, then the sticky navigation, then content).
   The Overview brand strip that used to carry it is gone; the wording, the
   gold period and the official mark are unchanged. */
[data-design="sharp"] .site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 10px 22px;
}
[data-design="sharp"] .hero-line {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}
[data-design="sharp"] .hero-slogan {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2.2px;
}
[data-design="sharp"] .hero-slogan .brand-period { color: var(--brand); }
[data-design="sharp"] .hero-sub {
  font-size: 10.5px;
  letter-spacing: 1.1px;
  color: var(--muted);
}
@media (max-width: 900px) {
  [data-design="sharp"] .site-header { grid-template-columns: 1fr auto; }
  [data-design="sharp"] .hero-line {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 700px) {
  [data-design="sharp"] .hero-slogan { font-size: 13px; letter-spacing: 1.4px; }
}

/* Ranking cards in the sharp layer: the design owns these surfaces, so the
   P&L tint has to be re-asserted here exactly as it is for every other
   tinted box on the site (same tokens, same sign rule, no new colours). */
[data-design="sharp"] .rank-card,
[data-design="sharp"] .family-rank-item {
  background: var(--panel);
  border-radius: var(--radius);
}
[data-design="sharp"] .rank-card.tint-up,
[data-design="sharp"] .family-rank-item.tint-up {
  background: var(--tint-up-fill-strong);
  border-color: var(--tint-up-edge);
}
[data-design="sharp"] .rank-card.tint-down,
[data-design="sharp"] .family-rank-item.tint-down {
  background: var(--tint-down-fill-strong);
  border-color: var(--tint-down-edge);
}
[data-design="sharp"] .rank-card:hover,
[data-design="sharp"] .family-rank-item:hover { border-color: var(--fg); }

/* Trader story + what-changed surfaces in the sharp layer (the design owns
   these planes, so they are re-stated here with the same tokens). */
[data-design="sharp"] .story-now,
[data-design="sharp"] .story-ev,
[data-design="sharp"] .changed-mover { background: var(--panel-2); }
[data-design="sharp"] .story-dar { background: var(--panel); }
[data-design="sharp"] .changed-mover.tint-up { background: var(--tint-up-fill-strong); border-color: var(--tint-up-edge); }
[data-design="sharp"] .changed-mover.tint-down { background: var(--tint-down-fill-strong); border-color: var(--tint-down-edge); }

/* the market + round bar and the pinned navigation share the page plane, so
   the bar never shows page content through itself while it is stuck */
[data-design="sharp"] .market-strip-inner { max-width: 1280px; }
[data-design="sharp"] .site-nav { background: var(--bg); }

/* About lockup: full official artwork on dark; vector mark + wordmark on
   light (the raster is black-backed; screen-blend keeps it faithful on
   dark surfaces, light usage inverts the vector ink instead) */
.about-lockup { display: none; }
[data-design="sharp"] .about-lockup {
  display: flex;
  align-items: center;
  margin: 4px 0 18px;
}
[data-design="sharp"] .about-lockup img {
  max-width: 420px;
  width: 100%;
  mix-blend-mode: screen;
}
[data-design="sharp"] .about-lockup .lockup-vector { display: none; }
:root[data-design="sharp"][data-mode="light"] .about-lockup img { display: none; }
:root[data-design="sharp"][data-mode="light"] .about-lockup .lockup-vector {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--fg);
}
:root[data-design="sharp"][data-mode="light"] .about-lockup .lockup-vector svg {
  width: 84px; height: 36px;
}
:root[data-design="sharp"][data-mode="light"] .about-lockup .lockup-word {
  font-size: 22px; font-weight: 800; letter-spacing: 3px;
}
:root[data-design="sharp"][data-mode="light"] .about-lockup .lockup-desc {
  font-size: 10.5px; letter-spacing: 2.6px; color: var(--dim);
}

/* modest family icons also show in Design B (identity without color noise) */
[data-design="sharp"] .fam-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--dim);
}
[data-design="sharp"] .fam-icon svg { width: 13px; height: 13px; }
[data-design="sharp"] .family-card:hover .fam-icon,
[data-design="sharp"] .about-family:hover .fam-icon { color: var(--fg); }
[data-design="sharp"] .about-family h3 {
  display: flex; align-items: center; gap: 9px;
}
[data-design="sharp"] .about .lede { font-size: 17px; }
[data-design="sharp"] .about h1 { font-size: 27px; }
[data-design="sharp"] .about h2 { font-size: 18px; }

/* header official mark sizing */
[data-design="sharp"] .brand-mark-official { width: 44px; height: 19px; }


/* ------------------------------------------------ P&L box tinting (sharp) --
   Re-asserted inside the sharp layer because the design layer sets its own
   surface on these cards further up this file; the VALUES are the shared
   tokens from dashboard.css, so there is exactly one definition of what a
   winning box and a losing box look like. Presentation only — no number, no
   definition and no ranking changes with it. */
[data-design="sharp"] .tint-up,
[data-design="sharp"] .stat-card.p-up {
  background: var(--tint-up-fill);
  border-color: var(--tint-up-edge);
}
[data-design="sharp"] .tint-down,
[data-design="sharp"] .stat-card.p-down {
  background: var(--tint-down-fill);
  border-color: var(--tint-down-edge);
}
/* the instrument panel keeps its shared frame: a tinted cell colours the
   surface, it does not grow a box of its own */
[data-design="sharp"] .stat-card.p-up,
[data-design="sharp"] .stat-card.p-down {
  border: 0;
  border-right: 1px solid var(--line);
}
/* model / family / account / compare cards keep the tint on their own edge */
[data-design="sharp"] .model-card.tint-up,
[data-design="sharp"] .family-card.tint-up,
[data-design="sharp"] .account-card.tint-up,
[data-design="sharp"] .compare-card.tint-up { border-color: var(--tint-up-edge); }
[data-design="sharp"] .model-card.tint-down,
[data-design="sharp"] .family-card.tint-down,
[data-design="sharp"] .account-card.tint-down,
[data-design="sharp"] .compare-card.tint-down { border-color: var(--tint-down-edge); }
/* hover still has to be visible ON a tinted card */
[data-design="sharp"] .model-card.tint-up:hover,
[data-design="sharp"] .family-card.tint-up:hover,
[data-design="sharp"] .account-card.tint-up:hover,
[data-design="sharp"] .compare-card.tint-up:hover,
[data-design="sharp"] .model-card.tint-down:hover,
[data-design="sharp"] .family-card.tint-down:hover,
[data-design="sharp"] .account-card.tint-down:hover,
[data-design="sharp"] .compare-card.tint-down:hover { border-color: var(--dim); }


/* ------------------------------ selectable account tiles (sharp) ----------
   Re-asserted in the design layer for the same reason as the cards above:
   sharp paints .picker-item's own surface further up this file. The tint
   owns the surface; SELECTION and HOVER own the edge, so a picked tile is
   unmistakable whether it is green, red or neutral. Order matters here —
   .picker-on is last so a selected tile always wins over its hover state. */
[data-design="sharp"] .picker-item.tint-up   { background: var(--tint-up-fill-strong); }
[data-design="sharp"] .picker-item.tint-down { background: var(--tint-down-fill-strong); }
[data-design="sharp"] .picker-item.tint-up,
[data-design="sharp"] .picker-item.tint-down { border-color: var(--line); }
[data-design="sharp"] .picker-item.tint-up:hover,
[data-design="sharp"] .picker-item.tint-down:hover { border-color: var(--dim); }
[data-design="sharp"] .picker-item.picker-on {
  border-color: var(--fg);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--fg);
}
[data-design="sharp"] .picker-item.picker-on.tint-up   { background: var(--tint-up-fill-strong); }
[data-design="sharp"] .picker-item.picker-on.tint-down { background: var(--tint-down-fill-strong); }
