/* ═══════════════════════════════════════════════════════════════════════════
   WAM Ai — INSIGHTS (2026-09-02)
   The page's own stylesheet. wam.html links it with its own cache-buster
   (insights.css?v=insN) — bump it in the same commit as any change here.

   THE LOOK is design-explorations/insights-v1-2026-09-01/v3/d1-title.html,
   the direction Munier settled on 2026-09-02: a soft green header, a white
   sheet, cards that float on a tinted ground, statuses instead of sentences.

   WHERE THIS BREAKS THE HOUSE RULES, ON PURPOSE (recorded in tokens.css §11b and
   docs/design-system.md): a soft shadow on every card (--shadow-card), 22px /
   16px corners (--radius-soft, --radius-soft-sm), one "display" text rung for
   the margin number (--fs-display), and a mint / coral / teal trio for the
   bars and the curve. Everything else is on the system: the eight text rungs
   chosen by role, the seven spacing steps (rounded DOWN), hairlines, tokens
   only — no raw colour anywhere in this file.

   LIGHT ONLY, by Munier's instruction ("no dark mode"). The page paints its
   own ground and reads only --color-* tokens, so the app's dark theme does not
   reach it.

   Scope: everything lives under .page[data-page="insights"] with an ins-
   prefix. Nothing here touches another screen.
   ═══════════════════════════════════════════════════════════════════════════ */

.page[data-page="insights"] {
  font-family: var(--font-ui);
  color: var(--color-text);
  --ins-max: 1100px;
  /* The band and the sheet share one width, so the header's mark sits on the
     band's own edge rather than floating in from a wider container. */
  max-width: calc(var(--ins-max) + 2 * var(--s4));
  margin: 0 auto;
}
.page[data-page="insights"] * { box-sizing: border-box; }
.page[data-page="insights"] .ins-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-text);
}
/* Only the CHARTS fill their box. A blanket `svg { width:100% }` here would
   outrank the icon sizes below by specificity and stretch the header mark
   across the band (it did, once). */
.page[data-page="insights"] .ins-curve svg,
.page[data-page="insights"] .ins-gauge svg { display: block; width: 100%; overflow: visible; }
.page[data-page="insights"] svg text { font-family: inherit; font-variant-numeric: tabular-nums; }

/* ---- the header band ---------------------------------------------------- */
.ins-hdr {
  background: var(--gradient-insights);
  color: var(--color-text-on-dark);
  padding: var(--s4) var(--s4) var(--s7);
  border-radius: var(--radius-soft);
}
.ins-hdr .ins-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  max-width: var(--ins-max); margin: 0 auto; min-width: 0;
}
.ins-hdr h1 {
  margin: 0; font-size: var(--fs-title); font-weight: var(--fw-bold); letter-spacing: var(--ls-title);
  display: flex; align-items: center; gap: var(--s2); line-height: var(--lh-head); white-space: nowrap;
}
.ins-hdr h1 svg { width: 26px; height: 26px; flex: 0 0 auto; display: block; }
.ins-hdr .ins-store {
  font-size: var(--fs-small); font-weight: var(--fw-medium);
  background: color-mix(in srgb, var(--color-text-on-dark) 16%, transparent);
  padding: var(--s1) var(--s3); border-radius: var(--radius-pill); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
/* The phone's own top bar already names the store; the pill is a desktop thing. */
@media (max-width: 1023px) { .ins-hdr .ins-store { display: none; } }

/* ---- the sheet: cards on a tinted ground, overlapping the band ----------- */
.ins-sheet {
  background: var(--color-paper);
  border-radius: var(--radius-soft) var(--radius-soft) 0 0;
  margin-top: calc(-1 * (var(--s7) - var(--s1)));
  padding: var(--s5) var(--s4) var(--s6);
}
.ins-in { max-width: var(--ins-max); margin: 0 auto; display: grid; gap: var(--s3); }

.ins-title { margin: 0 var(--s0) var(--s1); }
.ins-title h2 {
  display: flex; align-items: center; gap: var(--s2); margin: 0;
  font-size: var(--fs-title); font-weight: var(--fw-bold); letter-spacing: var(--ls-title); line-height: var(--lh-head);
}
.ins-title .ins-when { font-size: var(--fs-small); color: var(--color-text-muted); margin-top: var(--s1); }
.ins-ok {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto;
  border-radius: var(--radius-pill); background: var(--color-positive); color: var(--color-text-on-dark);
}
.ins-ok svg { width: 14px; height: 14px; display: block; }

/* ---- cards -------------------------------------------------------------- */
.ins-card {
  background: var(--color-card); border-radius: var(--radius-soft);
  padding: var(--s4); box-shadow: var(--shadow-card); min-width: 0;
}
.ins-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.ins-card h3 { margin: 0; font-size: var(--fs-head); font-weight: var(--fw-bold); letter-spacing: var(--ls-title); line-height: var(--lh-head); }
.ins-card h3 .up { color: var(--color-positive-text); }
.ins-card h3 .dn { color: var(--color-negative-text); }
.ins-sub { font-size: var(--fs-small); color: var(--color-text-muted); }
.ins-sel {
  font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--color-text-muted);
  background: var(--color-paper); padding: var(--s1) var(--s2); border-radius: var(--radius-pill); white-space: nowrap;
}

/* fuel margin */
.ins-prof { display: grid; gap: var(--s2); margin-top: var(--s3); }
.ins-prof .ins-v { font-size: var(--fs-display); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: var(--ls-hero); }
.ins-prof .ins-d { font-size: var(--fs-body); font-weight: var(--fw-medium); margin-top: var(--s1); color: var(--color-positive-text); }
.ins-prof .ins-d.dn { color: var(--color-negative-text); }
.ins-prof .ins-d.flat, .ins-prof .ins-d.none { color: var(--color-text-muted); }
.ins-prof .ins-d span { color: var(--color-text-muted); font-weight: var(--fw-regular); }
.ins-prof .ins-tank { font-size: var(--fs-small); color: var(--color-text-muted); margin-top: var(--s0); }
.ins-curve svg { height: 130px; }
.ins-tk { fill: var(--color-text-muted); font-size: var(--fs-label); }

/* why */
.ins-why .ins-r { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: var(--s2); padding: var(--s1) 0; }
.ins-why .ins-n { font-size: var(--fs-small); font-weight: var(--fw-medium); }
.ins-why .ins-t { height: 14px; border-radius: var(--radius-pill); background: var(--color-paper); position: relative; overflow: hidden; }
.ins-why .ins-f { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--radius-pill); background: var(--color-mint); }
.ins-why .ins-f.neg { background: var(--color-coral); }
.ins-why .ins-v { font-size: var(--fs-small); font-weight: var(--fw-bold); text-align: right; }
.ins-why .ins-v.neg { color: var(--color-negative-text); }
.ins-why .ins-none { font-size: var(--fs-small); color: var(--color-text-muted); padding: var(--s2) 0; }

/* the six small cards */
.ins-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.ins-kpi {
  background: var(--color-card); border-radius: var(--radius-soft-sm);
  padding: var(--s3) var(--s3) var(--s2); box-shadow: var(--shadow-card); min-width: 0;
}
.ins-kpi .ins-k {
  font-size: var(--fs-label); color: var(--color-text-muted); font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ins-kpi .ins-v { font-size: var(--fs-metric); font-weight: var(--fw-bold); margin: var(--s1) 0; line-height: var(--lh-tight); letter-spacing: var(--ls-title); }
.ins-kpi .ins-v small { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--color-text-muted); margin-left: 1px; }
.ins-kpi .ins-v.none { color: var(--color-text-muted); }
.ins-kp { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.ins-kp .ins-avg { font-size: var(--fs-label); color: var(--color-text-muted); }
.ins-pill {
  display: inline-flex; align-items: center; border-radius: var(--radius-pill);
  padding: var(--s0) var(--s2); font-size: var(--fs-label); font-weight: var(--fw-bold); white-space: nowrap;
}
.ins-pill.up { background: var(--color-mint-tint); color: var(--color-teal-deep); }
.ins-pill.flat, .ins-pill.none { background: var(--color-paper); color: var(--color-text-muted); }
.ins-pill.dn { background: var(--color-coral-tint); color: var(--color-negative-text); }

/* the street */
.ins-st .ins-me { display: flex; align-items: baseline; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
.ins-st .ins-me .ins-v { font-size: var(--fs-metric2); font-weight: var(--fw-bold); letter-spacing: var(--ls-hero); line-height: var(--lh-tight); }
.ins-st .ins-me .ins-s { font-size: var(--fs-small); color: var(--color-text-muted); }
.ins-price sup { font-size: .6em; line-height: 0; vertical-align: super; }
.ins-st .ins-l {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--s3); align-items: center;
  padding: var(--s2) 0; border-top: var(--hairline-w) solid var(--color-hairline); font-size: var(--fs-body);
}
.ins-st .ins-l:first-child { border-top: 0; }
.ins-st .ins-l .ins-w { font-weight: var(--fw-medium); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-st .ins-l .ins-w span { color: var(--color-text-muted); font-size: var(--fs-small); margin-left: var(--s1); }
.ins-st .ins-l .ins-g { font-weight: var(--fw-bold); min-width: 44px; text-align: right; }
.ins-st .ins-l .ins-g.dn { color: var(--color-negative-text); }
.ins-st .ins-l .ins-g.up, .ins-st .ins-l .ins-g.same { color: var(--color-text-muted); }
.ins-st .ins-l .ins-p { color: var(--color-text-muted); font-size: var(--fs-small); }

/* how the street moves */
.ins-vr { display: grid; grid-template-columns: 104px 1fr; gap: var(--s3); padding: var(--s3) 0; border-top: var(--hairline-w) solid var(--color-hairline); }
.ins-verdicts .ins-vr:first-child { border-top: 0; }
.ins-vk { font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--color-text-muted); font-weight: var(--fw-medium); padding-top: var(--s0); }
.ins-vs { font-size: var(--fs-body); line-height: var(--lh-text); }
.ins-vs b { font-weight: var(--fw-bold); }
.ins-ve { display: block; font-size: var(--fs-small); color: var(--color-text-muted); margin-top: var(--s0); }
.ins-more {
  appearance: none; border: 0; background: var(--color-paper); color: var(--color-interactive);
  font: inherit; font-size: var(--fs-small); font-weight: var(--fw-bold);
  padding: var(--s2) var(--s3); min-height: var(--h-control-lg); border-radius: var(--radius-control);
  margin-top: var(--s3); cursor: pointer;
}
.ins-more:focus-visible { outline: 2px solid var(--color-interactive); outline-offset: 2px; }
.ins-lists[hidden] { display: none; }
.ins-lists { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin-top: var(--s3); }
.ins-fl { background: var(--color-paper); border-radius: var(--radius-soft-sm); padding: var(--s3) var(--s3) var(--s2); min-width: 0; }
.ins-flh { font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--color-teal-deep); margin-bottom: var(--s1); }
.ins-flh span { font-weight: var(--fw-regular); color: var(--color-text-muted); }
.ins-fi { display: grid; grid-template-columns: 96px 1fr 92px; gap: var(--s2); align-items: center; padding: var(--s1) 0; }
.ins-fn { font-size: var(--fs-small); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-fn span { display: block; font-size: var(--fs-label); color: var(--color-text-muted); font-weight: var(--fw-regular); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-ft { height: 9px; border-radius: var(--radius-pill); background: var(--color-card); overflow: hidden; }
.ins-ff { height: 100%; border-radius: var(--radius-pill); }
.ins-ff.c { background: var(--color-mint); }
.ins-ff.r { background: var(--color-teal-deep); }
.ins-ff.k { background: var(--chart-ramp-1); }
.ins-fi.you .ins-fn, .ins-fi.you .ins-fn span { color: var(--color-teal-deep); }
.ins-fi.you .ins-ff.k { background: var(--color-teal-deep); }
.ins-fv { font-size: var(--fs-small); font-weight: var(--fw-bold); text-align: right; }
.ins-fv span { display: block; font-size: var(--fs-label); color: var(--color-text-muted); font-weight: var(--fw-regular); }
.ins-fnv { font-size: var(--fs-small); color: var(--color-text-muted); padding: var(--s1) 0 var(--s0); }

/* mix gauges */
.ins-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s2); }
.ins-gauge { text-align: center; position: relative; }
.ins-gauge svg { height: 80px; }
.ins-gauge .ins-v { position: absolute; left: 0; right: 0; top: 44px; font-size: var(--fs-metric); font-weight: var(--fw-bold); letter-spacing: var(--ls-title); line-height: var(--lh-tight); }
.ins-gauge .ins-k2 { font-size: var(--fs-small); color: var(--color-text-muted); margin-top: var(--s1); }

/* WAM by grade */
.ins-mg .ins-r { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: var(--s2); padding: var(--s1) 0; }
.ins-mg .ins-t { height: 12px; border-radius: var(--radius-pill); background: var(--color-paper); position: relative; }
.ins-mg .ins-f { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); background: var(--color-mint); }
.ins-mg .ins-f.neg { background: var(--color-coral); }
.ins-mg .ins-n { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--color-teal-deep); border-radius: 1px; }
.ins-mg .ins-lab { font-size: var(--fs-small); font-weight: var(--fw-medium); }
.ins-mg .ins-val { font-size: var(--fs-small); font-weight: var(--fw-bold); text-align: right; }

/* merch */
.ins-inside .ins-prof { grid-template-columns: auto 1fr; align-items: center; }
.ins-inside .ins-prof .ins-v { font-size: var(--fs-metric2); }
.ins-inside .ins-idx { font-size: var(--fs-small); color: var(--color-text-muted); text-align: right; }

/* the foot + states */
.ins-foot { font-size: var(--fs-small); color: var(--color-text-muted); padding: var(--s2) var(--s1) 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.ins-state { padding: var(--s6) var(--s4); text-align: center; color: var(--color-text-muted); font-size: var(--fs-body); }
.ins-state button {
  appearance: none; border: var(--hairline-w) solid var(--color-hairline); background: var(--color-card); color: var(--color-interactive);
  font: inherit; font-weight: var(--fw-bold); padding: var(--s2) var(--s4); min-height: var(--h-control-lg);
  border-radius: var(--radius-control); margin-top: var(--s3); cursor: pointer;
}

/* ---- desktop: the same cards on a three-column grid --------------------- */
@media (min-width: 1024px) {
  .page[data-page="insights"] { --fs-display: 48px; }
  .ins-in { grid-template-columns: repeat(3, 1fr); }
  .ins-in > .ins-title, .ins-in > .ins-kpis, .ins-in > .ins-foot, .ins-in > .ins-state { grid-column: 1 / -1; }
  .ins-kpis { grid-template-columns: repeat(6, 1fr); }
  .ins-card.ins-profit { grid-column: span 2; }
  .ins-card.ins-profit .ins-prof { grid-template-columns: auto 1fr; align-items: start; gap: var(--s5); }
  .ins-card.ins-profit .ins-curve svg { height: 210px; }
  /* The DOM keeps the phone order (street → moves → mix → grades → merch). On
     the grid, "How the street moves" takes the full width so its three lists
     sit side by side when opened, and Merch closes the page. */
  .ins-card.ins-fol { order: 8; grid-column: 1 / -1; }
  .ins-card.ins-inside { order: 9; grid-column: 1 / -1; }
  .ins-in > .ins-foot { order: 10; }
  .ins-lists { grid-template-columns: 1fr 1fr 1fr; }
}
