/* microFlow tokens */

/* fonts.css */
/* Webfonts. NOTE: no binaries were supplied with the source references —
   these are served from the Google CDN. Replace with self-hosted @font-face
   rules when real font files are available.

   Figtree is the single brand face. Exactly four weights ship — 400 / 500 /
   600 / 700 — matching the weight ramp; 800 is deliberately not loaded.
   IBM Plex Mono is used only for machine identifiers. */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Noto+Sans:wght@500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --font-display: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --font-numeric: "Figtree", -apple-system, sans-serif;
  /* Wordmark stack. Figtree has no Greek block, so the sigma and omega in the
     sigmaFlow / omegaFlow lockups fall through to Noto Sans. */
  --font-wordmark: "Figtree", "Noto Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* colors.css */
/* Base palette. Raw ramps only — components consume the role tokens in
   semantic.css, status.css and layers.css, never these. */
:root {
  /* Brand blue ramp — the accent that carries every interactive affordance */
  --blue-950: #061729;
  --blue-900: #0A2342;
  --blue-850: #0E2C4E;
  --blue-800: #123A63;
  --blue-700: #1B4FA0;
  --blue-650: #0F58C6;
  --blue-600: #1266E0;
  --blue-550: #2478EE;
  --blue-500: #2E90FA;
  --blue-400: #5AACFF;
  --blue-300: #93C5FD;
  --blue-200: #C7E0FB;
  --blue-100: #E4EFFC;
  --blue-50:  #F2F7FD;

  /* Neutral / ink ramp — cool, slightly blue-cast greys */
  --ink-900: #0F2440;
  --ink-800: #17324F;
  --ink-700: #274563;
  --ink-600: #3F5E7C;
  --ink-500: #5A7591;
  --ink-400: #7E95AC;
  --ink-300: #A9BACB;
  --line-300: #C9D7E5;
  --line-200: #DCE6F1;
  --line-100: #EAF0F7;
  --paper: #FFFFFF;

  /* CATEGORICAL palette — product identity only (category, material type).
     Structurally separate from status.css: never use a status token to code a
     category, and never a category hue to signal state. No red-family identity
     (it reads as an error). Hues are picked by association, not palette order. */
  --cat-electronics: #1266E0;
  --cat-automotive:  #6E5AC8;
  --cat-fmcg:        #12876A;
  --cat-textile:     #B0731A;
  --cat-industrial:  #4B6B8A;
  --cat-other:       #7E8CA0;

  /* Identity chips: low-alpha tint + text mixed toward --text-1 so the label
     passes contrast. Raw identity hues fail as text. */
  --cat-electronics-bg: rgba(18, 102, 224, 0.10);
  --cat-automotive-bg:  rgba(110, 90, 200, 0.10);
  --cat-fmcg-bg:        rgba(18, 135, 106, 0.10);
  --cat-textile-bg:     rgba(176, 115, 26, 0.12);
  --cat-industrial-bg:  rgba(75, 107, 138, 0.10);
  --cat-other-bg:       rgba(126, 140, 160, 0.12);
  --cat-electronics-text: #0B4693;
  --cat-automotive-text:  #493A8C;
  --cat-fmcg-text:        #0B5A47;
  --cat-textile-text:     #744B0F;
  --cat-industrial-text:  #33495E;
  --cat-other-text:       #4C5766;

  /* CHART series — its own family again. Never status, never categorical
     semantics. Adjacent slots must survive a colour-vision-deficiency check. */
  --chart-1: #1266E0;
  --chart-2: #B0731A;
  --chart-3: #12876A;
  --chart-4: #6E5AC8;
  --chart-5: #6E9BD1;
  --chart-6: #8A97A6;

  /* SEQUENTIAL utilisation ramp. Neither categorical nor status: it encodes a
     magnitude, and the hue break at 5 marks the over-utilisation threshold that
     the domain actually cares about. Documented as its own family in readme.md. */
  --heat-0: #EDF4FC;
  --heat-1: #D3E6FA;
  --heat-2: #A9CDF6;
  --heat-3: #6BAAF2;
  --heat-4: #2E90FA;
  --heat-5: #FEF0C7;
  --heat-6: #FDDE96;
  --heat-7: #F5A524;
  --heat-8: #EE7A3C;
  --heat-9: #E0343B;

  /* Signature gradients */
  --grad-brand: linear-gradient(135deg, #1D4ED8 0%, #38BDF8 100%); /* @kind color */
  --grad-sidebar: linear-gradient(180deg, #0A2342 0%, #0E2C4E 55%, #123A63 100%); /* @kind color */
  --grad-canvas: linear-gradient(160deg, #EDF4FC 0%, #F7FAFD 45%, #FFFFFF 100%); /* @kind color */
}

/* layers.css */
/* Elevation layers and interaction fills.

   FOUR LAYERS MAX, monotonic: bg-0 canvas -> bg-1 cards -> bg-2 nested ->
   bg-3 popovers/modals/tooltips. Jumps are allowed (a modal may sit on the
   canvas). Light mode carries depth with shadows; dark mode carries it with
   lightness alone. */
:root {
  --bg-0: #F2F6FB;
  --bg-1: #FFFFFF;
  --bg-2: #F7FAFD;
  --bg-3: #FFFFFF;

  /* Interaction fills are ALPHA OVERLAYS so they compose on any layer.
     Never mint a per-surface hover colour. */
  --fill-subtle: rgba(15, 36, 64, 0.028);
  --fill-hover: rgba(15, 36, 64, 0.055);
  --fill-active: rgba(15, 36, 64, 0.095);
  --fill-selected: rgba(18, 102, 224, 0.10);
  --fill-disabled: rgba(15, 36, 64, 0.06);
  --fill-on-accent-hover: rgba(255, 255, 255, 0.12);
  --fill-on-accent-active: rgba(255, 255, 255, 0.2);

  /* Scrim behind modals and drawers. */
  --scrim: rgba(10, 35, 66, 0.45);
}

/* status.css */
/* Four status families — danger / warning / success / info. Each is minted as a
   FULL set: fill, hover, active, text, bg (low-alpha tint), border, on-{role}.
   No new status hue without running the full contrast verification.

   Role boundaries:
     danger  destructive actions, failures, hard limits, validation errors
     warning approaching limits, expirations, deprecations
     success transient confirmations only (a persistent "healthy" state is a
             small badge, never a row tint)
     info    neutral FYI — keep info-blue out of body copy, it reads as a link
   Tiebreaker: the user MUST act -> danger; SHOULD know -> warning.

   Banner/badge anatomy is four parts TOGETHER: tint bg + {role}-text +
   1px {role}-border + a status icon. The icon is the mandatory
   colour-independent cue. Never communicate status by colour alone. */
:root {
  --danger-fill: #E0343B;
  --danger-hover: #C8272E;
  --danger-active: #A81E24;
  --danger-text: #A81E24;
  --danger-bg: rgba(224, 52, 59, 0.10);
  --danger-border: rgba(224, 52, 59, 0.38);
  --on-danger: #FFFFFF;

  --warning-fill: #B0731A;
  --warning-hover: #96610F;
  --warning-active: #7C500A;
  --warning-text: #7C500A;
  --warning-bg: rgba(245, 165, 36, 0.14);
  --warning-border: rgba(176, 115, 26, 0.38);
  --on-warning: #FFFFFF;

  --success-fill: #0E9F62;
  --success-hover: #0B8853;
  --success-active: #086F44;
  --success-text: #086F44;
  --success-bg: rgba(18, 183, 106, 0.12);
  --success-border: rgba(14, 159, 98, 0.36);
  --on-success: #FFFFFF;

  /* Info shares the blue family with --accent but is an INDEPENDENT token.
     Never alias one to the other; the duplication is the feature. */
  --info-fill: #1266E0;
  --info-hover: #0F58C6;
  --info-active: #1B4FA0;
  --info-text: #0B4693;
  --info-bg: rgba(18, 102, 224, 0.10);
  --info-border: rgba(18, 102, 224, 0.34);
  --on-info: #FFFFFF;

  /* Neutral is not a status. It is the absence of one. */
  --neutral-text: var(--ink-600);
  --neutral-bg: var(--fill-subtle);
  --neutral-border: var(--line-200);
}

/* typography.css */
/* Type ROLES, not raw sizes. Use only these utilities; never assign a role
   mechanically from a size — a 16px string is not automatically a card title.

   Weight ramp, exactly four faces: 400 secondary body / 500 body /
   600 emphasis / 700 titles + display. 800 and 900 are banned.

   Tracking is semantic and in em: 0 by default, +0.08em for uppercase at any
   size, -0.01em only at >=24px. Uppercase without caps-tracking is a bug. */
:root {
  --type-display: 700 30px/1.2 var(--font-display);
  --type-title-page: 700 24px/32px var(--font-display);
  --type-title-section: 600 18px/28px var(--font-display);
  --type-title-card: 600 16px/24px var(--font-display);
  --type-body: 500 14px/20px var(--font-ui);
  --type-body-secondary: 400 14px/20px var(--font-ui);
  --type-label: 500 12px/16px var(--font-ui);
  --type-micro: 600 10px/1.3 var(--font-ui);
  --type-stat: 700 30px/1.15 var(--font-numeric);
  --type-stat-sm: 700 20px/1.2 var(--font-numeric);
  --type-mono: 400 13px/20px var(--font-mono);
  --type-mono-sm: 400 12px/16px var(--font-mono);

  /* 10px is the floor, and only as a caps-tracked micro label.
     There is deliberately no non-caps 10px role. */
  --tracking-normal: 0; /* @kind other */
  --tracking-caps: 0.08em; /* @kind other */
  --tracking-display: -0.01em; /* @kind other */
}

/* spacing.css */
/* 4px grid.

   Interior ladder: 4 micro (icon <-> adjacent glyph) - 8 icon <-> label -
   12 toolbar/menu clusters - 16 between groups in a card and as card-grid gap.

   PADDING RECIPES, not ad-hoc values. Pick the recipe by what the surface is,
   then let the three correctness rules settle the rest:
     1. Monotonic nesting  separation never shrinks moving outward
     2. Gap matches tier   a grid's gap equals its cards' padding tier
     3. Same value only for the same relationship */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Padding recipes */
  --pad-card-compact: 16px;                /* toasts, action bars, dense stat cards */
  --pad-card: 24px;                        /* the default surface padding */
  --pad-card-roomy: clamp(24px, 4vw, 40px);/* LEAF content only — see the leaf test */
  --pad-strip-x: 24px;                     /* header/footer bars, small list/tile cards */
  --pad-strip-y: 16px;
  --pad-tile-x: 16px;                      /* text-bearing grid tiles (horizontal-dominant) */
  --pad-tile-y: 12px;
  --pad-empty-state: 48px;                 /* the one sanctioned giant */
  --pad-menu-row-x: 16px;
  --pad-menu-row-y: 8px;

  /* Grid gaps — rule 2: the gap equals the cards' padding tier. */
  --gap-card: 24px;
  --gap-compact: 16px;
  --gap-cluster: 12px;

  /* Page rhythm: one block-to-block margin and one gutter set, hoisted into the
     layout. Child views never re-pad. */
  --page-block: 16px;
  --page-gutter: 24px;
  --page-gutter-mobile: 16px;

  /* Control heights, locked. Same scale for buttons and inputs.
     sm 28 dense chrome - md 36 THE default - lg 44 moments only. */
  --control-h-sm: 28px;
  --control-h: 36px;
  --control-h-lg: 44px;
  /* Minimum hit target on coarse pointers, regardless of visual height. */
  --hit-target: 44px;

  /* Fixed chrome */
  --sidebar-w: 208px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 72px;
  --mobile-header-h: 56px;
  --mobile-tabbar-h: 64px;
  --row-h: 44px;
}

/* radius.css */
/* FIVE tokens, one radius per element class — a corner should tell you what kind
   of object you are looking at. Never mix in a framework's stock ladder.

   Nesting law: when corners are proximate they are concentric —
   inner = outer - gap, clamped at 4. (surface 12 - 4px inset = menu row 8;
   segmented track 8 - 4px inset = segment 4.) If a control would need
   re-radiusing to fit, move it inward instead: padding >= container radius.
   Distant corners keep their identity radius.

   Attached edges are square. Pill procedure: clicking-as-primary-purpose means
   it is a control, so rectangle; purely informational means pill. */
:root {
  --radius-xs: 4px;          /* checkboxes, inline code, skeletons, token chips */
  --radius-control-sm: 6px;  /* small controls (28px) */
  --radius-control: 8px;     /* default buttons/inputs, 36px+ */
  --radius-surface: 12px;    /* cards, panels, popovers, banners */
  --radius-surface-lg: 16px; /* modals, drawers, large media */
  --radius-pill: 9999px;     /* informational badges/chips and switches ONLY */
  --radius-circle: 50%;      /* avatars, status dots */
}

/* elevation.css */
/* Light mode carries depth with shadows; dark mode carries it with lightness
   alone (see tokens/dark.css, where these are muted to near-nothing).

   Elevation is quiet either way: hairline borders do most of the work, and every
   raised surface keeps its border so it never depends on shadow alone. */
:root {
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(15, 36, 64, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 36, 64, 0.06), 0 1px 2px rgba(15, 36, 64, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 36, 64, 0.08);
  --shadow-lg: 0 12px 28px -6px rgba(15, 36, 64, 0.12);
  --shadow-xl: 0 24px 56px -12px rgba(15, 36, 64, 0.18);
  --shadow-nav: 2px 0 16px rgba(10, 35, 66, 0.12);
}

/* motion.css */
/* Motion is functional, never decorative. Fades and 2–4px slides only; no bounce, no spring. */
:root {
  --dur-instant: 80ms; /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-base: 160ms; /* @kind other */
  --dur-slow: 240ms; /* @kind other */
  --dur-panel: 320ms; /* @kind other */
  --ease-out: cubic-bezier(0.2, 0.8, 0.3, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* @kind other */
  --ease-in: cubic-bezier(0.4, 0, 1, 1); /* @kind other */
  --transition-control: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); /* @kind other */
}

/* semantic.css */
/* Role aliases. Product code reaches for these, never the raw ramps.

   THREE LIVE TEXT LEVELS MAX. A fourth is never derived via opacity — quieter
   means smaller or more whitespace. --text-disabled is for disabled controls
   only, never live content.

   ACCENT MEANS INTERACTIVE: one accent hue for buttons, links, checked controls,
   focus and selection. Everything non-interactive and non-status is neutral.
   Status colours never decorate. */
:root {
  /* Text */
  --text-1: var(--ink-900);
  --text-2: var(--ink-600);
  --text-3: var(--ink-400);
  --text-disabled: var(--ink-300);
  --on-accent: #FFFFFF;

  /* Border ladder. --border-interactive must hold >=3:1 against its background;
     never soften it to the decorative tier. */
  --border-subtle: var(--line-100);
  --border-default: var(--line-200);
  --border-strong: var(--line-300);
  --border-interactive: #94A9BF;

  /* Accent */
  --accent: var(--blue-600);
  --accent-hover: var(--blue-650);
  --accent-active: var(--blue-700);
  --accent-text: var(--blue-650);

  /* Focus ring — must hold >=3:1 against every layer it can sit on. */
  --focus-ring: var(--blue-600);

  /* Navigation chrome. The navy rail is the one surface outside the bg-0..bg-3
     ladder: it is a fixed frame, not a content layer. */
  --nav-bg: var(--grad-sidebar);
  --nav-active: var(--accent);
  --nav-hover: rgba(255, 255, 255, 0.06);
  --on-nav: #FFFFFF;
  --on-nav-2: rgba(255, 255, 255, 0.62);
  --border-on-nav: rgba(255, 255, 255, 0.12); /* @kind other */

  /* Inverse chip — toasts and any dark-on-light acknowledgement. */
  --surface-inverse: var(--ink-900);
  --text-on-inverse: #FFFFFF;

  /* Hairline for dense data cells (heatmap squares) — finer than border-subtle. */
  --cell-hairline: rgba(15, 36, 64, 0.05);

  /* Machine-readable graphics stay dark-on-light in BOTH themes: a scanner
     reading the screen does not care about the operator's theme preference. */
  --barcode-ink: #0F2440;
  --surface-scan: #FFFFFF;

  /* Track fill for meters and progress rails. --fill-subtle (3%) is correct for
     zebra rows but too weak to read as an unlit segment, so a meter needs its
     own visible role. */
  --track: rgba(15, 36, 64, 0.13);

  /* Occupancy bands. Magnitude, not status — but they share the status hues
     because crossing a threshold IS the operational meaning here. */
  --occupancy-free: var(--success-text);
  --occupancy-low: var(--accent);
  --occupancy-medium: var(--warning-fill);
  --occupancy-high: var(--danger-fill);

  /* Deltas: direction is not sentiment. Pick by meaning at the call site. */
  --delta-positive: var(--success-text);
  --delta-negative: var(--danger-fill);
  --delta-flat: var(--text-3);
}

/* dark.css */
/* Dark theme. Scoped to [data-theme="dark"] — set it on <html>, or on any
   subtree for a dark island. Light is the default; nothing here applies unless
   the attribute is present.

   Depth is carried by LIGHTNESS, not shadow: the bg-0..bg-3 ladder steps up in
   luminance and every raised surface keeps its border. Shadows are muted to
   near-nothing — on dark they read as dirt, not elevation.

   MECHANIC, read before adding a token: var() is substituted at computed-value
   time on the element carrying the declaration. An alias declared on :root as
   --text-1: var(--ink-900) is already the literal light hex by the time a
   descendant redefines --ink-900, so remapping a ramp alone changes nothing.
   Every role alias is therefore RE-DECLARED in this scope, which forces it to
   resolve against the dark ramp and keeps it per-scope.

   RULE: any role added to layers/status/semantic must be mirrored here. */

[data-theme="dark"] {
  color-scheme: dark;

  /* ---- Raw ramps ---- */

  --paper: #101C2C;
  --ink-900: #EEF4FB;
  --ink-800: #DDE7F2;
  --ink-700: #C2D1E1;
  --ink-600: #A8BACD;
  --ink-500: #8FA3B8;
  --ink-400: #7C90A6;
  --ink-300: #55697E;
  --line-100: #1E2E41;
  --line-200: #26384D;
  --line-300: #35495F;

  --blue-700: #7AB6FD;
  --blue-650: #6FB2FF;
  --blue-600: #3B8BF5;
  --blue-500: #6FB2FF;
  --blue-400: #93C6FF;
  --blue-200: #2A4A72;
  --blue-100: #1B3350;
  --blue-50: #15263C;

  /* ---- Layers: monotonic lift, since shadows no longer carry depth ---- */
  --bg-0: #0A121C;
  --bg-1: #101C2C;
  --bg-2: #162436;
  --bg-3: #1B2C40;

  --fill-subtle: rgba(255, 255, 255, 0.032);
  --fill-hover: rgba(255, 255, 255, 0.07);
  --fill-active: rgba(255, 255, 255, 0.12);
  --fill-selected: rgba(59, 139, 245, 0.20);
  --fill-disabled: rgba(255, 255, 255, 0.07);
  --fill-on-accent-hover: rgba(255, 255, 255, 0.14);
  --fill-on-accent-active: rgba(255, 255, 255, 0.22);
  --scrim: rgba(4, 9, 15, 0.66);

  /* ---- Categorical identity: raised luminance, same associations ---- */
  --cat-electronics: #5AA2F8;
  --cat-automotive:  #A79BEA;
  --cat-fmcg:        #3CC79C;
  --cat-textile:     #E0A44B;
  --cat-industrial:  #7C9DBF;
  --cat-other:       #97A5B8;
  --cat-electronics-bg: rgba(90, 162, 248, 0.16);
  --cat-automotive-bg:  rgba(167, 155, 234, 0.16);
  --cat-fmcg-bg:        rgba(60, 199, 156, 0.15);
  --cat-textile-bg:     rgba(224, 164, 75, 0.16);
  --cat-industrial-bg:  rgba(124, 157, 191, 0.16);
  --cat-other-bg:       rgba(151, 165, 184, 0.16);
  --cat-electronics-text: #9CC8FB;
  --cat-automotive-text:  #C6BDF3;
  --cat-fmcg-text:        #7EDCBC;
  --cat-textile-text:     #EFC489;
  --cat-industrial-text:  #AFC5DA;
  --cat-other-text:       #C0CAD7;

  /* ---- Chart series ---- */
  --chart-1: #5AA2F8;
  --chart-2: #E0A44B;
  --chart-3: #3CC79C;
  --chart-4: #A79BEA;
  --chart-5: #7C9DBF;
  --chart-6: #6B7A8B;

  /* ---- Sequential heat ramp: starts at the canvas, keeps the hue break ---- */
  --heat-0: #14212F;
  --heat-1: #1A3350;
  --heat-2: #22497A;
  --heat-3: #2C68AE;
  --heat-4: #3B8BF5;
  --heat-5: #6B5A2A;
  --heat-6: #A07C2C;
  --heat-7: #D89A34;
  --heat-8: #E0713A;
  --heat-9: #E8474F;

  /* ---- Gradients ---- */
  --grad-brand: linear-gradient(135deg, #2A6FE0 0%, #4FC0F5 100%); /* @kind color */
  --grad-sidebar: linear-gradient(180deg, #0C1826 0%, #101F31 55%, #14273C 100%); /* @kind color */
  --grad-canvas: linear-gradient(160deg, #0A121C 0%, #0D1724 45%, #101C2C 100%); /* @kind color */

  /* ---- Elevation: muted, because lightness carries depth here ---- */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.34);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-nav: none;

  /* ---- Status families, full sets ---- */
  --danger-fill: #F1555C;
  --danger-hover: #F97078;
  --danger-active: #FF8A90;
  --danger-text: #FF9BA0;
  --danger-bg: rgba(241, 85, 92, 0.16);
  --danger-border: rgba(241, 85, 92, 0.44);
  --on-danger: #2A0C0F;

  --warning-fill: #E0A44B;
  --warning-hover: #EDB463;
  --warning-active: #F7C47C;
  --warning-text: #F2C185;
  --warning-bg: rgba(224, 164, 75, 0.16);
  --warning-border: rgba(224, 164, 75, 0.42);
  --on-warning: #2A1D06;

  --success-fill: #21C97B;
  --success-hover: #3AD68D;
  --success-active: #55E0A0;
  --success-text: #6FE0AC;
  --success-bg: rgba(33, 201, 123, 0.16);
  --success-border: rgba(33, 201, 123, 0.40);
  --on-success: #05271A;

  --info-fill: #3B8BF5;
  --info-hover: #57A0FA;
  --info-active: #7AB6FD;
  --info-text: #9CC8FB;
  --info-bg: rgba(59, 139, 245, 0.16);
  --info-border: rgba(59, 139, 245, 0.42);
  --on-info: #04203D;

  --neutral-text: var(--ink-600);
  --neutral-bg: var(--fill-subtle);
  --neutral-border: var(--line-200);

  /* ---- Semantic roles, re-resolved in this scope ---- */
  --text-1: var(--ink-900);
  --text-2: var(--ink-600);
  --text-3: var(--ink-400);
  --text-disabled: var(--ink-300);
  --on-accent: #FFFFFF;

  --border-subtle: var(--line-100);
  --border-default: var(--line-200);
  --border-strong: var(--line-300);
  --border-interactive: #52697F;

  --accent: var(--blue-600);
  --accent-hover: var(--blue-650);
  --accent-active: var(--blue-700);
  --accent-text: var(--blue-650);
  --focus-ring: #6FB2FF;

  --nav-bg: var(--grad-sidebar);
  --nav-active: var(--accent);
  --nav-hover: rgba(255, 255, 255, 0.07);
  --on-nav: #FFFFFF;
  --on-nav-2: rgba(255, 255, 255, 0.62);
  --border-on-nav: rgba(255, 255, 255, 0.12); /* @kind other */

  --surface-inverse: var(--ink-900);
  --text-on-inverse: #0F2440;
  --cell-hairline: rgba(255, 255, 255, 0.07);
  --track: rgba(255, 255, 255, 0.16);

  /* Theme-invariant on purpose — a scanner reads the screen, not the setting. */
  --barcode-ink: #0F2440;
  --surface-scan: #FFFFFF;

  --occupancy-free: var(--success-text);
  --occupancy-low: var(--accent);
  --occupancy-medium: var(--warning-fill);
  --occupancy-high: var(--danger-fill);

  --delta-positive: var(--success-text);
  --delta-negative: var(--danger-fill);
  --delta-flat: var(--text-3);
}

[data-theme="dark"] ::selection { background: var(--fill-selected); color: var(--text-1); }

/* base.css */
/* Element defaults so consumers inherit the system without extra work.
   Base weight is set once here, not maintained across utility classes. */
html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  margin: 0;
  font: var(--type-body);
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }

h1, h2, h3, h4, h5 { font-family: var(--font-display); color: var(--text-1); margin: 0; }
h1 { font: var(--type-title-page); letter-spacing: var(--tracking-display); }
h2 { font: var(--type-title-section); }
h3, h4, h5 { font: var(--type-title-card); }

/* Normal-flow rhythm goes on the PRECEDING element as margin-bottom, never
   margin-top on the follower. Negative margins are banned system-wide. */
p { margin: 0 0 var(--space-3); text-wrap: pretty; }

/* Links: accent text + PERSISTENT underline. The underline is droppable only for
   an unambiguous standalone link, and must then appear on hover. */
a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

code, kbd, samp { font: var(--type-mono); }

/* FOCUS RECIPE 1 — outward ring, for buttons, links, tabs, checkboxes.
   Declared at low specificity so recipe 2 can suppress it where it applies. */
:where(:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
/* FOCUS RECIPE 2 — inward edge, for bordered composite inputs. An outward ring
   clips inside overflow-auto ancestors; that is why this recipe exists. The
   transparent outline keeps a cue in forced-colors mode. */
.mf-focus-inward:focus-within {
  outline: 2px solid transparent;
  outline-offset: 0;
}

::selection { background: var(--fill-selected); color: var(--text-1); }

/* Tabular figures for every stat and table number. */
.mf-tabular { font-variant-numeric: tabular-nums; }

/* Uppercase micro labels always carry caps tracking. */
.mf-micro { font: var(--type-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; }

/* sm controls are 28px tall but must still offer a 44px hit target on coarse
   pointers. The pseudo-element expands the target without changing layout. */
@media (pointer: coarse) {
  .mf-hit-44 { position: relative; }
  .mf-hit-44::after {
    content: ""; position: absolute; left: 0; right: 0; top: 50%;
    height: var(--hit-target); transform: translateY(-50%);
  }
}

/* ===== Flow WMS site ===== */
html{scroll-padding-top:64px}
body{background:var(--bg-1);color:var(--text-1);font-family:var(--font-ui)}
a{color:var(--accent-text);text-decoration:none}a:hover{color:var(--accent-hover)}
img{display:block;max-width:100%}
.wrap{max-width:1152px;margin:0 auto}
.px{padding-left:clamp(16px,5vw,64px);padding-right:clamp(16px,5vw,64px)}
.eyebrow{font:600 12px/16px var(--font-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.h2{margin:0;font:700 clamp(24px,2.6vw,30px)/1.25 var(--font-display);letter-spacing:-0.01em}
.head{display:flex;flex-direction:column;gap:12px}
.muted{color:var(--text-2)}
.band{background:var(--bg-2);border-top:1px solid var(--border-subtle);border-bottom:1px solid var(--border-subtle)}
.sec{padding-top:clamp(56px,7vw,96px);padding-bottom:clamp(56px,7vw,96px)}
.col{display:flex;flex-direction:column;gap:32px}
.card{background:var(--bg-1);border:1px solid var(--border-default);border-radius:var(--radius-surface)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--control-h);padding:0 12px;box-sizing:border-box;font:600 14px/1 var(--font-ui);border-radius:var(--radius-control);border:1px solid transparent;cursor:pointer;white-space:nowrap;text-decoration:none;transition:var(--transition-control)}
.btn-lg{height:var(--control-h-lg);padding:0 20px;font-size:15px;gap:10px}
.btn-full{display:flex;width:100%}
.btn-primary{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.btn-primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);color:var(--on-accent)}
.btn-primary:active{background:var(--accent-active)}
.btn-secondary{background:transparent;color:var(--accent-text);border-color:var(--accent-text)}
.btn-secondary:hover{background-image:linear-gradient(var(--fill-hover),var(--fill-hover));color:var(--accent-text)}
.btn-ondark{background:transparent;color:var(--on-nav);border-color:rgba(255,255,255,.28)}
.btn-ondark:hover{background-image:linear-gradient(var(--fill-on-accent-hover),var(--fill-on-accent-hover));color:var(--on-nav)}
.btn:disabled{background:var(--fill-disabled);color:var(--text-disabled);border-color:transparent;cursor:not-allowed}
/* header */
.hdr{position:sticky;top:0;z-index:10;background:var(--nav-bg);border-bottom:1px solid var(--border-on-nav)}
.hdr-in{height:64px;display:flex;align-items:center;gap:24px}
.logo{display:flex;align-items:center;gap:8px;color:var(--on-nav)}.logo:hover{color:var(--on-nav)}
.logo span{font:700 18px/1 var(--font-display)}
.nav{flex:1;display:flex;gap:24px;justify-content:center;font:500 14px/20px var(--font-ui)}
.nav a{color:var(--on-nav-2);transition:color 160ms}.nav a:hover{color:var(--on-nav)}
.lang{display:flex;gap:2px;font:500 12px/16px var(--font-ui)}
.lang span{padding:6px 8px;color:var(--on-nav-2)}
.lang .on{border-radius:var(--radius-control-sm);background:var(--nav-hover);color:var(--on-nav);font-weight:600;box-shadow:inset 0 0 0 1px var(--border-on-nav)}
.spacer{flex:1;display:none}
/* hero */
.hero{background:var(--nav-bg);color:var(--on-nav);padding-top:clamp(48px,8vw,120px);padding-bottom:clamp(56px,8vw,112px)}
.hero-in{display:flex;flex-wrap:wrap;align-items:center;gap:clamp(32px,5vw,64px)}
.hero-copy{flex:1 1 360px;display:flex;flex-direction:column;gap:20px;min-width:0}
.pill{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;padding:4px 12px 4px 8px;border-radius:var(--radius-pill);background:var(--nav-hover);border:1px solid var(--border-on-nav);color:var(--on-nav);font:600 12px/16px var(--font-ui)}
.hero h1{margin:0;color:var(--on-nav);font:700 clamp(34px,4vw,40px)/1.1 var(--font-display);letter-spacing:-0.01em;text-wrap:balance}
.hero .lede{margin:0;font:400 18px/28px var(--font-ui);color:var(--on-nav-2);max-width:500px;text-wrap:pretty}
.ctas{display:flex;flex-wrap:wrap;gap:12px}
.hero-shots{flex:1.25 1 400px;min-width:0;position:relative;aspect-ratio:16/9}
.frame-d{padding:6px;background:var(--bg-1);border:1px solid var(--border-default);border-radius:var(--radius-surface);box-shadow:var(--shadow-md)}
.frame-d img{width:100%;height:auto;border-radius:7px}
.frame-p{padding:5px;background:var(--bg-1);border:1px solid var(--border-default);border-radius:var(--radius-surface-lg);box-shadow:var(--shadow-md)}
.frame-p img{width:100%;height:auto;border-radius:11px}
.hero-shots .frame-d{position:absolute;left:0;top:0;width:84%;box-sizing:border-box;border-color:var(--border-on-nav);box-shadow:var(--shadow-xl)}
.hero-shots .frame-p{position:absolute;right:0;bottom:0;width:22%;box-sizing:border-box;box-shadow:var(--shadow-xl)}
/* problem */
.prob{background:var(--bg-0);border-top:1px solid var(--border-subtle);border-bottom:1px solid var(--border-subtle);padding-top:clamp(56px,8vw,112px);padding-bottom:clamp(56px,8vw,112px)}
.prob-in{display:flex;flex-direction:column;align-items:center;gap:clamp(32px,4vw,48px)}
.prob-head{display:flex;flex-direction:column;align-items:center;gap:16px;text-align:center;max-width:820px}
.prob-head h2{margin:0;font:700 clamp(28px,3.4vw,40px)/1.2 var(--font-display);letter-spacing:-0.01em;text-wrap:balance}
.prob-grid{width:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(max(160px,calc((100% - 48px) / 4)),1fr));gap:16px}
.prob-grid div{display:flex;gap:8px;align-items:center;padding:12px 16px;font:500 14px/20px var(--font-ui)}
.prob-grid svg{color:var(--text-3);flex:none}
/* why */
.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(max(260px,calc((100% - 48px) / 3)),1fr));gap:24px}
.feat{display:flex;flex-direction:column;gap:12px;padding:24px}
.tile-ic{width:44px;height:44px;border-radius:var(--radius-control);background:var(--fill-selected);color:var(--accent-text);display:flex;align-items:center;justify-content:center;flex:none}
.feat h3{margin:0;font:600 18px/28px var(--font-display)}
.feat p{margin:0;font:400 14px/20px var(--font-ui);color:var(--text-2)}
/* product */
.prod{padding-top:clamp(48px,5vw,72px);padding-bottom:clamp(48px,5vw,72px)}
.prod .wrap{display:flex;flex-direction:column;gap:clamp(28px,3.5vw,40px)}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:clamp(20px,4vw,48px)}
.row.rev{flex-wrap:wrap-reverse}
.row-copy{flex:1 1 280px;display:flex;flex-direction:column;gap:8px}
.row-copy h3{margin:0;font:600 20px/28px var(--font-display)}
.row-copy p{margin:0;font:400 16px/24px var(--font-ui);color:var(--text-2)}
.tag{align-self:flex-start;margin-top:4px;padding:4px 8px;border-radius:var(--radius-xs);background:var(--bg-1);border:1px solid var(--border-default);font:var(--type-mono-sm);color:var(--text-1)}
.shots{flex:1.4 1 400px;min-width:0;display:flex;align-items:flex-end;gap:16px}
.shots .frame-d{flex:1;min-width:0}
.shots .frame-p{width:24%;flex:none;box-sizing:border-box}
/* how */
.grid4{display:grid;grid-template-columns:repeat(auto-fit,minmax(max(200px,calc((100% - 72px) / 4)),1fr));gap:24px}
.step{position:relative;display:flex;flex-direction:column;gap:16px;padding:24px;box-shadow:var(--shadow-sm)}
.step-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.step .tile-ic{width:48px;height:48px}
.step-n{font:400 32px/1 var(--font-display);color:var(--text-3);letter-spacing:-0.01em;font-variant-numeric:tabular-nums}
.step-t{display:flex;flex-direction:column;gap:4px}
.step-t b{font:600 18px/28px var(--font-display)}
.step-t span{font:400 14px/20px var(--font-ui);color:var(--text-2)}
.arrow{position:absolute;right:-17px;top:36px;z-index:1;width:26px;height:26px;border-radius:50%;background:var(--bg-1);border:1px solid var(--border-default);color:var(--accent-text);display:flex;align-items:center;justify-content:center}
.rule{display:flex;align-items:center;gap:20px;padding-top:8px}
.rule i{flex:1;height:1px;background:var(--border-default)}
.rule p{margin:0;font:400 clamp(18px,2vw,22px)/1.4 var(--font-display);color:var(--text-1);text-align:center;text-wrap:balance}
/* detail */
.det{display:flex;flex-wrap:wrap;gap:clamp(24px,5vw,64px);align-items:flex-start}
.det-head{flex:1 1 260px;display:flex;flex-direction:column;gap:12px;position:sticky;top:96px}
.det-list{flex:2.2 1 420px;min-width:0;display:flex;flex-direction:column}
.det-item{display:flex;gap:16px;padding:24px 0;border-bottom:1px solid var(--border-subtle)}
.det-item:first-child{padding-top:0}.det-item:last-child{padding-bottom:0;border-bottom:0}
.det-item>span{font:600 14px/28px var(--font-ui);color:var(--text-3);width:24px;flex:none;font-variant-numeric:tabular-nums}
.det-item div{display:flex;flex-direction:column;gap:6px}
.det-item h3{margin:0;font:600 18px/28px var(--font-display)}
.det-item p{margin:0;font:400 15px/24px var(--font-ui);color:var(--text-2);text-wrap:pretty}
/* editions */
.ed{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px}
.ed>div{display:flex;flex-direction:column;gap:12px;padding:24px;border:1px solid var(--border-default);border-radius:var(--radius-surface)}
.ed p{margin:0;font:400 16px/24px var(--font-ui);color:var(--text-2)}
.word{font:700 21px/1 var(--font-wordmark);letter-spacing:var(--tracking-display);color:var(--text-1);white-space:nowrap}
.word b{font-weight:500}
/* pilot */
.pilot{padding-bottom:clamp(56px,7vw,96px)}
.pilot-box{display:flex;flex-wrap:wrap;align-items:center;gap:24px;padding:clamp(24px,4vw,40px);background:var(--bg-0);border:1px solid var(--border-default);border-radius:var(--radius-surface)}
.pilot-box>div:first-child{flex:1 1 320px;display:flex;flex-direction:column;gap:8px}
.pilot-box h3{margin:0;font:700 24px/32px var(--font-display);letter-spacing:-0.01em}
.pilot-box p{margin:0;font:400 16px/24px var(--font-ui);color:var(--text-2)}
.pilot-cta{margin:0 auto;display:flex}
/* contact */
.contact{background:var(--nav-bg);color:var(--on-nav)}
.contact-in{max-width:560px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:24px}
.contact-head{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.contact-head .eyebrow{color:var(--on-nav-2)}
.contact-head h2{color:var(--on-nav)}
.contact-head p{margin:0;font:400 16px/24px var(--font-ui);color:var(--on-nav-2)}
.form,.sent{width:100%;box-sizing:border-box;background:var(--bg-1);border:1px solid var(--border-default);border-radius:var(--radius-surface);box-shadow:var(--shadow-sm);color:var(--text-1)}
.form{display:flex;flex-direction:column;gap:16px;padding:clamp(24px,4vw,40px)}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
.field{min-width:0}
.field label{display:block;font:var(--type-label);color:var(--text-2);margin-bottom:var(--space-1)}
.field label em{font-style:normal;color:var(--text-3)}
.field input,.field textarea{display:block;width:100%;box-sizing:border-box;font:var(--type-body);color:var(--text-1);background:var(--bg-1);border:1px solid var(--border-interactive);border-radius:var(--radius-control);transition:var(--transition-control);outline:2px solid transparent}
.field input{height:var(--control-h);padding:0 var(--space-3)}
.field textarea{padding:8px var(--space-3);resize:vertical;min-height:120px}
.field input::placeholder,.field textarea::placeholder{color:var(--text-3)}
.field input:focus,.field textarea:focus{border-color:var(--focus-ring);box-shadow:inset 0 0 0 1px var(--focus-ring)}
.hp{position:absolute;left:-9999px}
.form-err{margin:0;font:var(--type-label);color:var(--danger-text)}
.sent{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;padding:48px}
.sent svg{color:var(--success-text)}
.sent h3{margin:0;font:600 18px/28px var(--font-display)}
.sent p{margin:0;font:400 14px/20px var(--font-ui);color:var(--text-2)}
[hidden]{display:none!important}
/* footer */
.ftr{background:var(--nav-bg);border-top:1px solid var(--border-on-nav);padding-top:24px;padding-bottom:24px}
.ftr-in{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;font:400 14px/20px var(--font-ui);color:var(--on-nav-2)}
.ftr-in>span{display:flex;align-items:center;gap:8px}
.ftr-in b{font-weight:600;color:var(--on-nav)}
.ftr-lang{gap:12px!important}
@media (max-width:759px){
  .nav,.lang{display:none}.spacer{display:block}
  .arrow{display:none}
  .det-head{position:static}
}
