/* ==========================================================
   EON — Design Flow STRUCTURAL layer (2026-07-06)

   The full editorial system from the operator's DESIGN FLOW boards,
   applied on top of the token skin that shipped in #911: text-only
   nav, cards become hairlines, lowercase wordmarks with a vermilion
   period, giant tabular numerals, [ BRACKET ] micro-labels, accent
   discipline (vermilion speaks once per screen).

   HARD INVARIANT — Classic must render byte-identical with this file
   loaded: EVERY rule in this file is scoped under [data-theme="flow"].
   A source test (tests/test_theme_flow.py) parses the file and fails
   on any unscoped selector; a playwright check pixel-compares Classic
   with and without this stylesheet. Do not add :root, html, body or
   bare-class rules here.
   ========================================================== */

/* ── 1 · Wordmark: lowercase, signed with the vermilion period ── */

[data-theme="flow"] .brand-name {
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}
[data-theme="flow"] .brand-name::after {
  content: '.';
  color: var(--accent);
}
[data-theme="flow"] .splash-word {
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}
[data-theme="flow"] .splash-word::after {
  content: '.';
  color: var(--accent);
}

/* ── 2 · App-bar: flat field, hairline underline, square targets ── */

[data-theme="flow"] .app-bar {
  border-bottom: 1px solid var(--line);
}
[data-theme="flow"] .icon-btn {
  border-radius: 0;
}
[data-theme="flow"] .icon-btn:hover {
  background: var(--surface);
}

/* ── 3 · Bottom nav: text-only, tracked caps, vermilion overline ── */

[data-theme="flow"] .nav {
  border-top: 1px solid var(--line);
}
[data-theme="flow"] .nav-item svg {
  display: none;
}
[data-theme="flow"] .nav-item {
  min-height: 44px;               /* keep the tap target the icons gave */
  justify-content: center;
  position: relative;
}
[data-theme="flow"] .nav-item .nav-label {
  font-size: 11px;
  letter-spacing: 0.18em;
}
[data-theme="flow"] .nav-item.active {
  color: var(--ink);
}
[data-theme="flow"] .nav-item.active::before {
  content: '';
  position: absolute;
  top: -9px;                       /* sits on the nav's hairline */
  left: 22%;
  right: 22%;
  height: 2px;
  background: var(--accent);
}

/* ── 4 · Section voice: lowercase grotesque h2, [ BRACKET ] micro ── */

[data-theme="flow"] .section-h h2 {
  font-family: var(--body);
  font-weight: 750;
  font-size: clamp(21px, 3vw, 28px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-transform: lowercase;
}
[data-theme="flow"] .eyebrow,
[data-theme="flow"] .section-h .meta,
[data-theme="flow"] .hero-label,
[data-theme="flow"] .data-card-meta {
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
[data-theme="flow"] .eyebrow::before,
[data-theme="flow"] .section-h .meta::before,
[data-theme="flow"] .hero-label::before,
[data-theme="flow"] .data-card-meta::before {
  content: '[ ';
  color: var(--ink-faint);
}
[data-theme="flow"] .eyebrow::after,
[data-theme="flow"] .section-h .meta::after,
[data-theme="flow"] .hero-label::after,
[data-theme="flow"] .data-card-meta::after {
  content: ' ]';
  color: var(--ink-faint);
}

/* ── 5 · Cards become hairlines ─────────────────────────────
   Content sits directly on the paper; a rule above each block is
   the only chrome. The hero gets the strong 2px ink rule and loses
   its radial accent wash (vermilion speaks once, not as atmosphere). */

[data-theme="flow"] .card,
[data-theme="flow"] .stat,
[data-theme="flow"] .insight,
[data-theme="flow"] .data-card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
[data-theme="flow"] .card:hover,
[data-theme="flow"] .stat:hover,
[data-theme="flow"] .insight:hover {
  border-color: var(--line-strong);
  background: transparent;
}
[data-theme="flow"] .hero {
  background: transparent;
  border: none;
  border-top: 2px solid var(--ink);
  border-radius: 0;
}
[data-theme="flow"] .hero::before {
  display: none;
}

/* Giant numerals: grotesque, BOLD, tight — numbers are typography.
   Round 2 (operator): medium read washy; the marketing hero numerals
   (clamp'd huge, 700, -.045em, .9 line) are the reference. */
[data-theme="flow"] .hero-num {
  font-family: var(--body);
  font-weight: 700;
  font-size: clamp(38px, 6.5vw, 60px);
  letter-spacing: -0.045em;
  line-height: 0.92;
}
[data-theme="flow"] .stat-val,
[data-theme="flow"] .data-stat-num {
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── 6 · Rows: hairline separators, no card chrome ─────────── */

[data-theme="flow"] .row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
[data-theme="flow"] .row:first-child,
[data-theme="flow"] .row:last-child,
[data-theme="flow"] .row:only-child {
  border-radius: 0;
}
[data-theme="flow"] .row:hover {
  background: var(--surface-soft);
}

/* ── 7 · Actions: square, tracked caps ──────────────────────── */

[data-theme="flow"] .btn-primary {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 600;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
}
[data-theme="flow"] .btn-primary:hover {
  background: var(--accent);
  color: var(--accent-text);
}
[data-theme="flow"] .btn,
[data-theme="flow"] .btn-secondary {
  border-radius: 0;
  border: 1px solid rgba(19, 18, 17, 0.4);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 13px;
}
[data-theme="flow"] .btn-ghost {
  /* WS-A (2026-07-26): app.css now gives .btn-ghost a base border for
     Classic; flow's authored ghost is underline-only — re-assert it. */
  border: none;
  border-radius: 0;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
[data-theme="flow"] .btn-ghost:hover {
  color: var(--ink);
}
[data-theme="flow"][data-flow="ink"] .btn,
[data-theme="flow"][data-flow="ink"] .btn-secondary {
  border-color: rgba(255, 255, 255, 0.4);
}
[data-theme="flow"] .chip {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 600;
  border-color: rgba(19, 18, 17, 0.35);
  color: var(--ink);
}
/* Active chips (operator 2026-07-08, IMG_8735: "white buttons, can't
   see the text"): the rule above wins the color tie against app.css's
   `.date-chips .chip-active { color: var(--bg) }` (same specificity,
   this file loads later) — active chips painted --ink on --ink. Flow
   states them explicitly: accent-solid, which is also his ruling
   (active = green — deep green on bone, EON green on ink). */
[data-theme="flow"] .chip-active,
[data-theme="flow"] .chip.primary,
[data-theme="flow"] .date-chips .chip-active,
[data-theme="flow"] .rec-filter-bar .chip-active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ── 8 · Menu sheet: hairline launcher tiles, square sheet ─────
   (theme v2: retargeted from the retired #997-era text rows to the
   #999 launcher grid — .menu-tile/.menu-glab/.menu-util-btn) */

[data-theme="flow"] .menu-panel {
  border-radius: 0;
  border-top: 2px solid var(--ink);
  box-shadow: none;
}
[data-theme="flow"] .menu-handle {
  display: none;
}
[data-theme="flow"] .menu-tile {
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
}
[data-theme="flow"] .menu-tile:hover {
  background: var(--bg-card-2);
  border-color: var(--line);
}
[data-theme="flow"] .menu-tile-l {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 600;
}
[data-theme="flow"] .menu-glab {
  color: var(--ink-faint);
  letter-spacing: 0.2em;
}
[data-theme="flow"] .menu-util-btn {
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}
[data-theme="flow"] .menu-backdrop {
  background: rgba(19, 18, 17, 0.28);
}

/* ── 9 · Chat: printed-interview read ────────────────────────
   Operator message = solid ink block, bone type. EON reply = no
   bubble at all — plain type over the paper under a hairline.
   The terminal-tight chat redesign (app.css ~6400) styles these
   with !important and green-mixed --chat-line tokens, so flow must
   (a) re-point the tokens to warm hairlines and (b) match the
   !important at higher specificity. */

[data-theme="flow"] {
  --chat-line: var(--line);
  --chat-line-soft: var(--line-soft);
  --chat-line-strong: var(--line-strong);
}
[data-theme="flow"] .msg.user {
  background: var(--ink) !important;
  color: var(--bg) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
[data-theme="flow"] .msg.user .text::before {
  color: var(--ink-faint);
}
[data-theme="flow"] .msg.eon {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ── 10 · Pills keep their job, lose the capsule ────────────── */

[data-theme="flow"] .pill {
  border-radius: 0;
  letter-spacing: 0.14em;
}

/* ── 11 · Motion discipline: one soft entry, nothing ambient ── */

[data-theme="flow"] .view {
  animation-duration: 0.2s;
}

/* ==========================================================
   FULL-PAGE PASS (operator 2026-07-06: "restyle the full page …
   when i switch to flow i want to be in a different app by design
   — just make sure all the data show"). Everything below deepens
   the editorial system; nothing hides data — the only display:none
   in this file are decorative glyphs whose text labels remain.
   ========================================================== */

/* ── 12 · Text-only chrome: the wordmark IS the header ─────── */

[data-theme="flow"] .brand-mark {
  display: none;                    /* glyph out; "crux." carries it */
}
[data-theme="flow"] .brand-sub::before {
  content: '[ ';
  color: var(--ink-faint);
}
[data-theme="flow"] .brand-sub::after {
  content: ' ]';
  color: var(--ink-faint);
}

/* ── 13 · Numbers get the headline sizes (board law) ───────── */

[data-theme="flow"] .hero-num {
  font-size: clamp(56px, 17vw, 104px);
}
[data-theme="flow"] .stat-val {
  font-size: 28px;
}
[data-theme="flow"] .data-stat-num {
  font-size: 32px;
  font-weight: 500;
}
[data-theme="flow"] .section-h h2 {
  font-size: 24px;
}
[data-theme="flow"] .data-card-title {
  text-transform: lowercase;
  font-weight: 700;
  letter-spacing: -0.02em;
}
[data-theme="flow"] .empty-title {
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

/* ── 14 · Editorial page rhythm ─────────────────────────────── */

[data-theme="flow"] .view {
  padding-top: 28px;
  padding-left: 22px;
  padding-right: 22px;
}

/* ── 15 · Chat greeting: lowercase display voice ────────────── */

[data-theme="flow"] .chat-greeting {
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}
[data-theme="flow"] .chat-greeting-name {
  color: var(--accent);
}

/* ── 16 · Composer: square paper field, ink send block ─────── */

[data-theme="flow"] .composer {
  border-radius: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
[data-theme="flow"] .composer:focus-within {
  border-color: var(--ink);
}
[data-theme="flow"] .composer .send {
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
}

/* ── 17 · Toast + notifications: ink slabs, square ──────────── */

[data-theme="flow"] .toast {
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
[data-theme="flow"] .notif-panel {
  border-radius: 0;
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  box-shadow: none;
}

/* ── 18 · Form fields: squared, ink-focused ─────────────────── */

[data-theme="flow"] textarea.field-input,
[data-theme="flow"] .field-input {
  border-radius: 0;
}

/* ── 19 · Chat markdown tables: the ledger read ─────────────── */

[data-theme="flow"] .msg.eon .text table {
  border-collapse: collapse;
}
[data-theme="flow"] .msg.eon .text th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 2px solid var(--ink);
  background: transparent;
}
[data-theme="flow"] .msg.eon .text td {
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  background: transparent;
}

/* ── 20 · Pinned section + misc slabs stay ledgered ─────────── */

[data-theme="flow"] .empty {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
[data-theme="flow"] .empty-cta {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

/* ── 21 · Theme v2 (2026-07-08): core dark-section remap tokens ──
   app.css's dark-styled sections (chat sidebar rail, ambient home,
   chat ground, menu sheet, ad-intel, warehouse CTA) read
   var(--flc-*, <original dark value>) — undefined under Classic
   (fallback carries the original), defined only here. Grounds that
   back OVERLAYS (--flc-tile, --flc-bg-soft) are OPAQUE bone so
   drawers/sheets never go see-through; fills stay ink-wash. */

[data-theme="flow"] {
  --flc-bg: #F2F0EC;
  --flc-bg-soft: #ECE9E3;
  --flc-tile: #FBFAF8;
  --flc-tile-hi: #F6F4EF;
  --flc-tx: #131211;
  --flc-mut: #5A554E;
  --flc-dim: #7E7870;
  --flc-lime: #2E7A50;
  --flc-mint: #2E7A50;
  --flc-amber: #A66B00;
  --flc-red: #C0201F;
  --flc-blue: #2749C9;
  --flc-violet: #6B5CC4;
  --flc-on-accent: #FFFFFF;
  --flc-wrgb: 19,18,17;
  --flc-limergb: 0,119,158;
  --flc-mintrgb: 0,119,158;
  --flc-bluergb: 39,73,201;
  --flc-violetrgb: 107,92,196;
  --flc-bgrgb: 242,240,236;
}

/* ── 22 · Theme v2: local token blocks re-tuned for bone ─────────
   The in-app home reuses the .mk-ads3 token system (defined in
   app.css for index.html — marketing.css's own remap only reaches
   the standalone pages). Chat rail + menu sheet define their own
   micro-palettes; re-point all three at the flow language. */

[data-theme="flow"] .mk-ads3 {
  --a3-bg: #F2F0EC;
  --a3-bg-soft: #FBFAF8;
  --a3-tile: rgba(19,18,17,.05);
  --a3-tile-hi: rgba(19,18,17,.09);
  --a3-line: rgba(19,18,17,.16);
  --a3-line-hi: rgba(19,18,17,.30);
  --a3-tx: #131211;
  --a3-mut: #5A554E;
  --a3-dim: #7E7870;
  --a3-lime: #2E7A50;
  --a3-mint: #2E7A50;
  --a3-amber: #A66B00;
  --a3-on-accent: #FFFFFF;
  --a3-wrgb: 19,18,17;
  --a3-limergb: 0,119,158;
  --a3-mintrgb: 0,119,158;
  --a3-amberrgb: 166,107,0;
  --a3-bgrgb: 242,240,236;
}
[data-theme="flow"] .chat-history-drawer.cc-rail {
  --cc-lime: #2E7A50;
  --cc-mint: #2E7A50;
  --cc-tx: #131211;
  --cc-mut: #5A554E;
  --cc-dim: #7E7870;
  --cc-line: rgba(19,18,17,.14);
  --cc-line-hi: rgba(19,18,17,.26);
  --cc-tile: rgba(19,18,17,.06);
}
[data-theme="flow"] .menu-panel.cc-menu {
  --m-lime: #2E7A50;
  --m-mint: #2E7A50;
}

/* ── 23 · Theme v2: spot fixes where one token wore two hats ──── */

[data-theme="flow"] .inv-warehouse-cta .inv-deep-link-btn {
  color: #FFFFFF;
}
[data-theme="flow"] .cc-rail .drawer-new-btn svg {
  stroke: #FFFFFF;
}

/* ── 24 · Design Flow INK mode (round 2, 2026-07-08) ─────────────
   Operator: "add a toggle to switch the flow design to dark mode like
   the marketing page." data-flow="ink" (stamped by setTheme/boot,
   only while data-theme="flow") keeps the flow STRUCTURE — hairlines,
   square corners, bold lowercase display, text nav — and flips the
   palette to dark grounds. DESIGN RULE (operator, durable): EON GREEN
   is THE accent on EON's dark surfaces — vermilion never appears on
   ink; red is kill semantics only. Structure tokens (radii, --display)
   are NOT redefined here, so they inherit from the flow block.
   Standalone dark-native pages (inventory/warehouse/reports/marketing)
   handle ink at boot by keeping their native dark design. */

[data-theme="flow"][data-flow="ink"] {
  --bg: #0A0A0C;
  --bg-elev: #101013;
  --bg-card: #101013;
  --bg-card-2: #16161A;
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --line-strong: #F4F4F2;
  --ink: #F4F4F2;
  --ink-dim: #C6C4BF;
  --ink-mute: #9A9AA2;
  --ink-faint: #5E5E66;
  --accent: #C8FF4D;
  --accent-text: #0A0A0C;
  --accent-soft: rgba(200, 255, 77, 0.10);
  --danger: #FF6B6B;
  --danger-soft: rgba(255, 107, 107, 0.10);
  --warn: #F2A24C;
  --warn-soft: rgba(242, 162, 76, 0.10);
  --ok: #56E39F;
  --ok-soft: rgba(86, 227, 159, 0.10);
  --whale: #B58CFF;
  --grain-opacity: 0.05;
  --border: var(--line);
  --bg-sub: var(--bg-card-2);
  --ink-soft: var(--ink-mute);
  --bg-elevated: var(--bg-elev);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.05);
  --card-line: rgba(255, 255, 255, 0.12);
  --good: var(--ok);
  --bad: var(--danger);
  --accent-bright: var(--accent);
  --flc-bg: #0A0A0C;
  --flc-bg-soft: #0d0d0f;
  --flc-tile: #141417;
  --flc-tile-hi: #1B1B20;
  --flc-tx: #F4F4F2;
  --flc-mut: #9A9AA2;
  --flc-dim: #5E5E66;
  --flc-lime: #C8FF4D;
  --flc-mint: #56E39F;
  --flc-amber: #F2A24C;
  --flc-red: #FF6B6B;
  --flc-blue: #6EA8FE;
  --flc-violet: #B58CFF;
  --flc-on-accent: #0A0A0C;
  --flc-wrgb: 255,255,255;
  --flc-limergb: 83,216,249;
  --flc-mintrgb: 50,214,255;
  --flc-bluergb: 86,132,255;
  --flc-violetrgb: 140,98,255;
  --flc-bgrgb: 10,10,12;
}
[data-theme="flow"][data-flow="ink"] .mk-ads3 {
  --a3-bg: #0A0A0C;
  --a3-bg-soft: #0F0F12;
  --a3-tile: #151518;
  --a3-tile-hi: #1B1B20;
  --a3-line: rgba(255, 255, 255, 0.07);
  --a3-line-hi: rgba(255, 255, 255, 0.14);
  --a3-tx: #F4F4F2;
  --a3-mut: #9A9AA2;
  --a3-dim: #5E5E66;
  --a3-lime: #C8FF4D;
  --a3-mint: #56E39F;
  --a3-amber: #F2A24C;
  --a3-on-accent: #0A0A0C;
  --a3-wrgb: 255,255,255;
  --a3-limergb: 83,216,249;
  --a3-mintrgb: 50,214,255;
  --a3-amberrgb: 242,162,76;
  --a3-bgrgb: 10,10,12;
}
[data-theme="flow"][data-flow="ink"] .chat-history-drawer.cc-rail {
  --cc-lime: #C8FF4D;
  --cc-mint: #56E39F;
  --cc-tx: #F4F4F2;
  --cc-mut: #9A9AA2;
  --cc-dim: #5E5E66;
  --cc-line: rgba(255, 255, 255, 0.07);
  --cc-line-hi: rgba(255, 255, 255, 0.14);
  --cc-tile: #17171b;
}
[data-theme="flow"][data-flow="ink"] .menu-panel.cc-menu {
  --m-lime: #C8FF4D;
  --m-mint: #56E39F;
}
[data-theme="flow"][data-flow="ink"] .menu-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
[data-theme="flow"][data-flow="ink"] .chip {
  border-color: rgba(255, 255, 255, 0.3);
}
[data-theme="flow"][data-flow="ink"] .inv-warehouse-cta .inv-deep-link-btn {
  color: #0A0A0C;
}
[data-theme="flow"][data-flow="ink"] .cc-rail .drawer-new-btn svg {
  stroke: #0A0A0C;
}

/* ── 25 · Round 3 (2026-07-08): flat cream home + green ink CTA ───
   Operator: "on homepage the page should be cream not grey" — the
   drifting blue/violet ambient washes greyed the bone; flow is flat
   (same law as /marketing), the paper IS the atmosphere. And: "for
   dark mode active button should be green not white" — ink primaries
   go EON-green (accent-solid), not ink-solid. */

[data-theme="flow"] #home-content::before {
  background: none;
  animation: none;
}
[data-theme="flow"] .eon-chat::before {
  background: var(--flc-bg, var(--bg));
  animation: none;
}
[data-theme="flow"] .eon-chat::after {
  background: none;
  animation: none;
}
[data-theme="flow"][data-flow="ink"] .btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
[data-theme="flow"][data-flow="ink"] .btn-primary:hover {
  background: #DCFF7A;
  color: #0A0A0C;
}

/* less motion (2026-09-02): this file is structurally flat — no at-rules,
   every selector scope-parseable (test_theme_flow.py gates both) — so its
   calm twin lives in app.css, on html-prefixed flow selectors that outweigh
   the 0.2s view entry above. Nothing here may wrap a rule in a media query. */
