/* Veltner Command.
   Direction: industrial monochrome / cinematic intelligence, per
   docs/design/VELTNER_COMMAND_VISUAL_STANDARD.md (v1.0), which is the
   canonical source for colour. The five approved references in
   docs/design/references/ govern composition, atmosphere and interaction
   only; where a reference and the standard disagree, the standard wins.

   The environment is quiet. Important information commands attention.

   Every colour in the application lives in the :root block below. No
   component hard-codes one. Oxide is an accent, never a decoration: keep
   coloured area to roughly 2-5% of any screen. */

/* --- Inter, served locally -------------------------------------------- *
   Variable weight 100-900, SIL Open Font License 1.1. Vendored into
   static/fonts/ so the application serves its own copy; nothing in this
   project may reference a remote font host. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-latin.65850a373e25.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-latin-ext.01ba6c2a184b.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ====================================================================
     1. Canonical palette — VELTNER_COMMAND_VISUAL_STANDARD.md section 2.
     These twelve values are quoted from the standard and must match it
     exactly. Derived steps below are marked as derived.
     ==================================================================== */

  --obsidian:        #080A0B;   /* main application canvas */
  --graphite:        #111416;   /* primary panels and navigation */
  --graphite-raised: #1A1E20;   /* elevated surfaces, selected layers */
  --structural:      #2B3133;   /* hairlines, dividers, grids */
  --text-primary:    #F0EEE9;   /* main text and prominent numbers */
  --text-secondary:  #A1A7A6;   /* supporting descriptions */
  --text-subdued:    #777F80;   /* decorative and nonessential metadata */
  --paper:           #EAE6DE;   /* dossiers, important reading surfaces */
  --paper-ink:       #191B1C;   /* typography on warm paper */
  --oxide:           #B56549;   /* focus, priority actions, active links */
  --signal-green:    #82A99B;   /* verified positive progress */
  --caution-amber:   #BEA078;   /* genuine warnings, pending decisions */

  /* ====================================================================
     2. Surface ladder. The standard names three surfaces; the application
     shell needs five steps to separate chrome from canvas from panel.
     The two extra steps are interpolated within the standard's range and
     never outside it — no step is darker than obsidian or lighter than
     raised graphite.
     ==================================================================== */

  --bg:          var(--obsidian);  /* page canvas */
  --surface-1:   #0D1012;          /* derived: top bar and command bar */
  --surface-2:   var(--graphite);  /* panels */
  --surface-3:   var(--graphite-raised);  /* chips, inputs, cards */
  --raised:      #232829;          /* derived: hover on an elevated surface */

  --line:        var(--structural);
  --line-strong: #3A4143;          /* derived: a border that must read as an edge */
  --line-quiet:  #1E2325;          /* derived: cartographic grid, faint rules */

  /* ====================================================================
     3. Type colour
     ==================================================================== */

  --text:          var(--text-primary);
  --text-2:        var(--text-secondary);
  --text-3:        var(--text-subdued);
  --text-disabled: #58605F;   /* derived: dimmed but still legible */

  /* On warm paper */
  --paper-text:   var(--paper-ink);
  --paper-text-2: #4A4F50;   /* derived: secondary ink on paper */
  --paper-line:   #CFC9BD;   /* derived: rule on paper */

  /* ====================================================================
     4. Oxide accent. Reserved for the principal action, the selected
     navigation destination, the active entity, a meaningful signal and an
     important decision point. Never for every button, metric, heading or
     border. Prefer one dominant oxide action per working area.
     ==================================================================== */

  --accent:        var(--oxide);
  --accent-strong: #C27052;   /* derived: primary button face */
  --accent-deep:   #A05840;   /* derived: its lower edge */
  --accent-hover:  #CE7A5A;
  --accent-dim:    #9A5B45;   /* a small mark that should not shout */
  --accent-text:   #D08062;   /* derived: links and accented text on graphite */
  --accent-bright: #E09274;   /* hover for accented text */
  --accent-on:     #16100D;   /* label on an oxide fill — dark, per references */

  --accent-soft:   rgba(181, 101, 73, .14);   /* selected row */
  --accent-soft-2: rgba(181, 101, 73, .22);
  --accent-wash:   rgba(181, 101, 73, .06);   /* quiet local tint */
  --accent-line:   rgba(181, 101, 73, .55);
  --accent-ring:   rgba(181, 101, 73, .34);   /* focus ring */

  /* ====================================================================
     5. Meaningful statuses. Never carried by colour alone — every state
     that matters also has a text label (standard section 5).
     ==================================================================== */

  --green:        var(--signal-green);
  --green-soft:   rgba(130, 169, 155, .13);
  --green-line:   rgba(130, 169, 155, .40);

  --amber:        var(--caution-amber);
  --amber-soft:   rgba(190, 160, 120, .13);
  --amber-line:   rgba(190, 160, 120, .40);

  /* The standard defines no negative colour. Lost and overdue still need
     one, so this is derived: held well away from oxide in hue so the two
     never read as the same signal, and muted to the same degree as green
     and amber. Flagged for confirmation. */
  --red:          #C2706C;
  --red-soft:     rgba(194, 112, 108, .13);
  --red-line:     rgba(194, 112, 108, .42);

  --neutral-soft: rgba(161, 167, 166, .10);

  /* ====================================================================
     6. Shared surfaces and depth. Almost-flat: 1px structural borders,
     minimal rounding, no heavy drop shadows, no neon outlines. Hierarchy
     comes from placement, scale, contrast and content.
     ==================================================================== */

  --hover-film:   rgba(240, 238, 233, .030);
  --hover-film-2: rgba(240, 238, 233, .050);
  --scrim:        rgba(8, 10, 11, .92);

  /* A recessed well — a count inside a chip, a closed column. Obsidian,
     so it sinks into the canvas rather than going flat black. */
  --inset:        rgba(8, 10, 11, .30);
  --inset-strong: rgba(8, 10, 11, .55);

  /* Cartography. Land is a quiet silver, never a bright fill, and the
     sheen is a single faint light source, not a coloured wash. */
  --map-land:   rgba(161, 167, 166, .22);
  --map-sheen:  rgba(240, 238, 233, .028);
  --map-grid:   rgba(43, 49, 51, .55);

  --radius:   3px;   /* standard section 4: 0-4px, no SaaS-rounded cards */
  --radius-s: 2px;

  /* Restrained separation, not a drop shadow. */
  --shadow:      0 1px 0 rgba(8, 10, 11, .6), 0 10px 26px rgba(8, 10, 11, .45);
  --shadow-lift: 0 1px 0 rgba(8, 10, 11, .6), 0 18px 44px rgba(8, 10, 11, .55);
  /* Subtle lighting around a selected object or an active operation. */
  --glow-select: 0 0 0 1px var(--accent-line), 0 0 24px rgba(181, 101, 73, .10);

  /* ====================================================================
     7. Typography. Inter for headlines, body, navigation and figures;
     a monospace for technical labels, system states, timestamps,
     coordinates and identifiers.

     The standard recommends IBM Plex Mono. It is not vendored here and
     this project installs no packages, so --mono resolves to a system
     monospace stack. Dropping IBM Plex Mono woff2 files into
     static/fonts/ and naming them first in this stack is the only change
     needed to adopt it.
     ==================================================================== */

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", "Liberation Mono",
          Menlo, Consolas, monospace;

  /* Scale, from standard section 3. */
  --fs-cinematic:  clamp(40px, 3.9vw, 68px);  /* editorial statements */
  --fs-display:    clamp(30px, 2.4vw, 44px);
  --fs-figure:     clamp(34px, 2.9vw, 56px);  /* prominent operational figures */
  --fs-heading:    24px;                      /* section headings 20-28px */
  --fs-subheading: 18px;
  --fs-body:       15px;                      /* body copy 14-16px */
  --fs-small:      13px;
  --fs-meta:       11.5px;                    /* technical metadata 11-12px */

  --tracking-cinematic: -0.025em;   /* tight tracking on large headlines */
  --tracking-display:   -0.015em;
  --tracking-meta:      0.11em;     /* generous on monospace metadata only */

  /* ====================================================================
     8. Motion. 150-250ms for navigation, selection and panel expansion.
     Honoured only when the viewer has not asked for reduced motion.
     ==================================================================== */

  --t-fast: 150ms;
  --t-base: 200ms;
  --t-slow: 250ms;
  --ease:   cubic-bezier(.4, 0, .2, 1);

  /* ==================================================================== */

  --topbar-h:     56px;
  --commandbar-h: 64px;
  --rail-w:       318px;
  --subnav-w:     198px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 1ms; --t-base: 1ms; --t-slow: 1ms; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1;   /* Inter: a lowercase l with a tail */
}

/* Figures are compared down columns all over this application, so they are
   always tabular. */
.num, .figure, td, th, .count, time { font-variant-numeric: tabular-nums; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ---------------------------------------------------- type vocabulary -- */
/* Hierarchy comes from typography before any panel or colour is added
   (standard section 3). These are the shared primitives; a screen composes
   them rather than inventing its own sizes. */

/* "The network moved. Your turn." — confident, spacious, tightly tracked. */
.t-cinematic {
  font-size: var(--fs-cinematic);
  line-height: 1.02;
  letter-spacing: var(--tracking-cinematic);
  font-weight: 650;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}
/* The quieter second line of a cinematic statement. */
.t-cinematic-sub {
  font-size: var(--fs-cinematic);
  line-height: 1.02;
  letter-spacing: var(--tracking-cinematic);
  font-weight: 300;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}
.t-display {
  font-size: var(--fs-display);
  line-height: 1.1;
  letter-spacing: var(--tracking-display);
  font-weight: 600;
  text-wrap: balance;
}
/* A prominent operational figure: 87, 1 412, 23. */
.t-figure {
  font-size: var(--fs-figure);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.t-heading {
  font-size: var(--fs-heading);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 600;
}
.t-subheading { font-size: var(--fs-subheading); line-height: 1.35; font-weight: 600; }
.t-body       { font-size: var(--fs-body);  line-height: 1.55; color: var(--text-2); }
.t-small      { font-size: var(--fs-small); line-height: 1.5;  color: var(--text-2); }

/* Technical metadata: labels, system states, timestamps, coordinates and
   identifiers. Generous tracking is for these only — never for body copy,
   which must not read as terminal output (standard section 3). */
.t-meta {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}
/* The same technical register without shouting — a timestamp in a row. */
.t-mono {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .04em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Typography on a warm-paper dossier surface. */
.on-paper              { background: var(--paper); color: var(--paper-text); }
.on-paper .t-body,
.on-paper .t-small     { color: var(--paper-text-2); }
.on-paper .t-meta,
.on-paper .t-mono      { color: var(--paper-text-2); }
.on-paper .t-cinematic,
.on-paper .t-display,
.on-paper .t-figure,
.on-paper .t-heading   { color: var(--paper-text); }
.on-paper hr,
.on-paper .rule        { border-color: var(--paper-line); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- shell -- */
/* One shell for every screen: a quiet top bar and a persistent bottom command
   bar (standard sections 8 and 9). The command bar is fixed to the viewport,
   so it is never a second scroll area and never scrolls away on a long board;
   .app reserves its height so nothing hides underneath it.

   .app keeps an explicit minmax(0, 1fr) column. Without it a wide board
   stretches the grid and the whole page scrolls sideways, carrying the header
   off screen. Re-check at 1180px and 1600px after touching this. */

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "topbar" "main";
  min-height: 100vh;
  padding-bottom: var(--commandbar-h);
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; flex: none;
  padding-right: 18px; border-right: 1px solid var(--line);
}
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }

/* "COMMAND / MORNING BRIEF" — the technical register, set by each screen. */
.topbar-section {
  flex: 1; min-width: 0; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-2);
}

.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.topbar-date { color: var(--text-3); text-transform: uppercase; }

/* --------------------------------------------------------- command bar -- */

.commandbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--commandbar-h);
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  z-index: 60;
}

.cmd-primary { display: flex; align-items: center; flex: none; }

.cmd-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  height: var(--commandbar-h); padding: 0 15px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  background: none; border: 0;
  transition: color var(--t-fast) var(--ease);
}
.cmd-item svg { flex: none; color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.cmd-item:hover { color: var(--text); text-decoration: none; }
.cmd-item:hover svg { color: var(--text-2); }

/* A selected navigation destination is one of the few things oxide is for
   (standard section 5). It is a 2px mark and an icon, not a filled panel. */
.cmd-item.is-active { color: var(--text); font-weight: 600; }
.cmd-item.is-active svg { color: var(--accent-text); }
.cmd-item.is-active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 12px;
  height: 2px; background: var(--accent);
}

/* A destination with no screen behind it yet. Dimmed by colour so it stays
   readable and never looks like a rendering fault. */
.cmd-item.is-later { color: var(--text-disabled); cursor: default; }
.cmd-item.is-later svg { color: var(--text-disabled); }
.cmd-item.is-later:hover { color: var(--text-disabled); }

.cmd-search { flex: 1; min-width: 0; display: flex; justify-content: center; }

/* --- the two command-bar menus ------------------------------------------- */

.cmd-more, .cmd-user { position: relative; flex: none; }
.cmd-more > summary, .cmd-user > summary { list-style: none; cursor: pointer; }
.cmd-more > summary::-webkit-details-marker,
.cmd-user > summary::-webkit-details-marker { display: none; }
.cmd-more > summary::marker, .cmd-user > summary::marker { content: ""; }

.cmd-user > summary {
  display: flex; align-items: center; gap: 9px;
  height: var(--commandbar-h); padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
}
.cmd-user > summary:hover { color: var(--text); }
.cmd-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text-2); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.cmd-user svg { color: var(--text-3); }
.cmd-user[open] > summary { color: var(--text); }

/* Menus open upward: the bar they belong to is at the bottom of the viewport. */
.cmd-menu {
  position: absolute; bottom: calc(100% - 10px); left: 0;
  min-width: 252px; padding: 8px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  z-index: 70;
}
.cmd-menu-user { left: auto; right: 0; min-width: 210px; }

.cmd-menu-label { margin: 6px 8px 5px; }
.cmd-menu-label + .cmd-menu-item { margin-top: 0; }

.cmd-menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-s);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  text-decoration: none; text-align: left;
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cmd-menu-item svg { flex: none; color: var(--text-3); }
.cmd-menu-item:hover { background: var(--hover-film); color: var(--text); text-decoration: none; }
.cmd-menu-item.is-active { color: var(--text); background: var(--accent-wash); border-color: var(--accent-line); }
.cmd-menu-item.is-active svg { color: var(--accent-text); }
.cmd-menu-item.is-later { color: var(--text-disabled); cursor: default; }
.cmd-menu-item.is-later svg { color: var(--text-disabled); }
.cmd-menu-item.is-later:hover { background: none; color: var(--text-disabled); }
.cmd-menu-item.as-button { background: none; cursor: pointer; font-family: inherit; }
.cmd-menu-item.as-button:hover { background: var(--hover-film); }

.cmd-menu-foot {
  margin: 8px 8px 4px; padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.5; color: var(--text-3);
}
.cmd-menu-who { margin: 0 8px 8px; font-size: 13px; color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- search -- */

.search-field { position: relative; width: 100%; max-width: 620px; }
.search-field input[type="text"] {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit; font-size: 13.5px;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.search-field input[type="text"]::placeholder { color: var(--text-3); }
.search-field input[type="text"]:focus {
  border-color: var(--accent-line);
  background: var(--surface-3);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; display: grid; place-items: center;
}

.linkbutton {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer;
}
.linkbutton:hover { color: var(--accent-text); text-decoration: underline; }

/* Below the desktop widths the standard designs for, the command bar keeps the
   destinations and drops the search field rather than wrapping to two rows. */
@media (max-width: 1180px) {
  .cmd-search { display: none; }
  .cmd-item { padding: 0 12px; }
  .cmd-item.is-active::after { left: 12px; right: 12px; }
}
@media (max-width: 860px) {
  .cmd-item span { display: none; }
  .cmd-user .who { display: none; }
  .topbar-section { display: none; }
}

/* ----------------------------------------------------------------- main -- */

.main { grid-area: main; padding: 22px 24px 44px; max-width: 1760px; min-width: 0; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------ map band -- */

.map-band {
  position: relative;
  height: 330px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(900px 320px at 70% 42%, var(--map-sheen), transparent 72%),
    linear-gradient(180deg, var(--graphite) 0%, var(--obsidian) 100%);
  overflow: hidden;
  margin-bottom: 18px;
}

/* The viewport keeps the generated map's 1000 x 387.5 ratio, so a pin placed
   with map_x/map_y lands on the matching coastline at any window width. */
.map-viewport {
  position: absolute; top: 14px; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 1000 / 387.5;
  max-width: calc(100% - 28px);
}
.map-world {
  position: absolute; inset: 0;
  background-color: var(--map-land);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-position: center; mask-position: center;
}

.map-plane { position: absolute; inset: 0; }

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-ring);
  display: block;
}
.map-pin:hover, .map-pin:focus-visible {
  background: var(--accent-hover);
  box-shadow: 0 0 0 5px var(--accent-soft-2);
}
.map-pin .pin-label {
  position: absolute; left: 16px; top: -5px;
  white-space: nowrap; font-size: 11px; font-weight: 600;
  color: var(--text); background: var(--scrim);
  border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 2px 7px; opacity: 0; pointer-events: none; transition: opacity .12s;
}
.map-pin:hover .pin-label, .map-pin:focus-visible .pin-label { opacity: 1; }

.map-selector {
  position: absolute; left: 16px; top: 16px;
  display: flex; align-items: center; gap: 11px;
  background: var(--scrim);
  border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 9px 14px;
  backdrop-filter: blur(6px);
}
.map-selector .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--text-2);
}
.map-selector .meta span {
  display: block; font-size: 10.5px; color: var(--text-3);
  letter-spacing: .04em; text-transform: uppercase;
}
.map-selector .meta strong { font-size: 18px; font-weight: 650; }

.map-legend {
  position: absolute; right: 16px; top: 16px;
  min-width: 182px;
  background: var(--scrim);
  border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 10px 12px;
  backdrop-filter: blur(6px);
}
.map-legend .row {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 0; font-size: 12px; color: var(--text-2);
}
.map-legend .row strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.map-legend .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.map-empty {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--scrim);
  border: 1px dashed var(--line-strong);
  border-radius: 8px; padding: 8px 14px;
  font-size: 12px; color: var(--text-2); text-align: center;
}
.map-empty strong { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- panels -- */

.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel + .panel { margin-top: 14px; }

.panel-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--hover-film), transparent);
}
.panel-head h3 { font-size: 13.5px; font-weight: 600; letter-spacing: .005em; }
.panel-head .icon { color: var(--text-3); display: grid; place-items: center; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 15px; }
.panel-body.tight { padding: 11px 15px; }

/* ------------------------------------------------------- company header -- */

.company-header {
  display: flex; align-items: flex-start; gap: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.company-logo {
  width: 74px; height: 74px; flex: none;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 27px; font-weight: 700; color: var(--text-2);
  letter-spacing: .02em; overflow: hidden;
}
.company-logo img { width: 100%; height: 100%; object-fit: contain; }

.company-id { flex: 1; min-width: 0; }
.company-id .line1 { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.company-id h1 { font-size: 27px; letter-spacing: -0.025em; }
.company-id .line2 {
  margin-top: 7px; display: flex; align-items: center;
  gap: 11px; flex-wrap: wrap; color: var(--text-2); font-size: 13px;
}
.company-id .sep { color: var(--line-strong); }
.company-id .line3 { margin-top: 7px; font-size: 12px; color: var(--text-3); }

.header-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- chips -- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text-2); white-space: nowrap;
}
.chip-accent   { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.chip-brown  { background: var(--surface-3); border-color: var(--line-strong); color: var(--text-2); }
.chip-amber  { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.chip-green  { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.chip-red    { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.chip-demo   { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }

/* An explicit, visible unknown. Never an empty gap. */
.unknown {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; font-style: normal;
  background: var(--neutral-soft);
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  white-space: nowrap;
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-3); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--raised); border-color: var(--accent-line); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent-deep) 100%);
  border-color: var(--accent-deep); color: var(--accent-on);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent-strong) 100%); color: var(--accent-on); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 10px; font-size: 11.5px; }
.btn-danger:hover { border-color: var(--red-line); color: var(--red); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------- workspace grid -- */

.workspace {
  display: grid;
  grid-template-columns: var(--subnav-w) minmax(0, 1fr) var(--rail-w);
  gap: 16px;
  align-items: start;
}

.subnav {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
  position: sticky; top: 74px;
}
.subnav a, .subnav span.item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 7px;
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  text-decoration: none; border: 1px solid transparent;
}
.subnav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
/* A selected control is raised and bright, not filled with orange. Only
   the 2px mark is oxide, so a screen full of controls stays monochrome. */
.subnav a.active, .subnav .item.active {
  position: relative;
  background: var(--surface-3); border-color: var(--line-strong);
  color: var(--text); font-weight: 600;
}
.subnav a.active::before, .subnav .item.active::before {
  content: ""; position: absolute; left: -1px; top: 7px; bottom: 7px;
  width: 2px; background: var(--accent); border-radius: 2px;
}
.subnav .count {
  margin-left: auto; font-size: 11px; color: var(--text-3);
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 6px; min-width: 21px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.subnav a.active .count { background: var(--inset); border-color: var(--line-strong); color: var(--text-2); }
.subnav .item.later { opacity: .4; }
.subnav svg { flex: none; color: var(--text-3); }
.subnav a.active svg, .subnav .item.active svg { color: var(--text-2); }

.col-main { min-width: 0; }
.rail { min-width: 0; position: sticky; top: 74px; }

.card-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.card-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --------------------------------------------------------- data display -- */

.kv { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; font-size: 12.5px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv dt, .kv .k { color: var(--text-3); min-width: 92px; flex: 0 1 auto; }
.kv dd, .kv .v {
  margin: 0; color: var(--text); text-align: right; margin-left: auto;
  min-width: 0; overflow-wrap: break-word; word-break: normal;
}
/* Chips in a value cell must not be clipped by the panel edge. */
.kv .v .chip, .kv .v .unknown { white-space: normal; text-align: right; }

.product-figure {
  width: 100%; height: 104px; border-radius: 8px;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 9px, var(--surface-3) 9px 18px);
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--text-3); font-size: 11.5px; text-align: center; padding: 10px;
  margin-bottom: 12px;
}

.prose { font-size: 13px; line-height: 1.62; color: var(--text-2); white-space: pre-wrap; }
.prose.bright { color: var(--text); }

.stage-bar {
  border-left: 3px solid var(--line-strong);
  padding-left: 13px;
}

.empty {
  padding: 16px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  color: var(--text-3); font-size: 12.5px; background: var(--hover-film);
}
.empty strong { display: block; color: var(--text-2); margin-bottom: 3px; font-weight: 600; }

/* A short explanatory line above a list inside a panel — used on the engine
   status page to say what a group of rows means (why a case is out of scope,
   why a rejection is recorded). Tokens only, no hard-coded colour. */
.panel-note {
  margin: 10px 0 6px; font-size: 12px; line-height: 1.5;
  color: var(--text-3);
}

/* --------------------------------------------------------- activity feed -- */

.filterbar {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap; padding: 11px 15px; border-bottom: 1px solid var(--line);
}
.filterchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--text-2); cursor: pointer; text-decoration: none;
}
.filterchip:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.filterchip.active { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.filterchip .n {
  font-size: 10.5px; padding: 0 5px; border-radius: 4px;
  background: var(--inset); color: inherit; opacity: .8;
  font-variant-numeric: tabular-nums;
}

.entry { display: flex; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--hover-film); }
.entry.pinned { background: var(--hover-film); border-left: 2px solid var(--line-strong); }

.entry-icon {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--text-3);
}
.entry-main { min-width: 0; flex: 1; }
.entry-body { font-size: 13px; color: var(--text); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.entry-meta {
  margin-top: 7px; display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap; font-size: 11.5px; color: var(--text-3);
}
.entry-meta .author { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.entry-meta .mini-avatar {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text-2); display: grid; place-items: center; font-size: 9px; font-weight: 700;
}

/* --------------------------------------------------------------- tasks -- */

.task {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: 0; }
.task-title { font-size: 13px; color: var(--text); font-weight: 500; }
.task-meta { margin-top: 5px; display: flex; gap: 9px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); align-items: center; }
.task.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------- glossary -- */

.glossary-item { border-bottom: 1px solid var(--line); }
.glossary-item:last-child { border-bottom: 0; }
.glossary-item summary {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.glossary-item summary::-webkit-details-marker { display: none; }
.glossary-item summary:hover { background: var(--surface-3); }
.glossary-item summary .caret { margin-left: auto; color: var(--text-3); transition: transform .15s ease; }
.glossary-item[open] summary { background: var(--surface-3); color: var(--text); }
.glossary-item[open] summary .caret { transform: rotate(180deg); color: var(--text-2); }
.glossary-def { padding: 0 15px 13px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.glossary-def .src { display: block; margin-top: 6px; font-size: 11px; color: var(--text-3); }

/* ------------------------------------------------------- company list -- */

.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 13px; }

.company-card {
  display: flex; gap: 13px; padding: 15px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.company-card:hover {
  border-color: var(--line-strong); background: var(--surface-3);
  text-decoration: none; transform: translateY(-1px);
}
.company-card:focus-visible { border-color: var(--accent-text); }
.company-card .avatar-sq {
  width: 46px; height: 46px; flex: none; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--text-2);
  font-size: 15px; font-weight: 700; overflow: hidden;
}
.company-card .avatar-sq img { width: 100%; height: 100%; object-fit: contain; }
.company-card h3 { font-size: 15px; margin-bottom: 3px; }
.company-card .sub { font-size: 12px; color: var(--text-3); margin-bottom: 9px; }
.company-card .stats { display: flex; gap: 13px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.company-card .stats b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-tile {
  flex: 1; min-width: 132px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
}
.stat-tile .n { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-tile .l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }
/* A figure is never oxide. Standard section 5 forbids orange on every
   metric, and section 8 asks the eye to separate genuine results from
   research activity by typography, not by hue. The emphasised tile earns
   its weight from a brighter face and a stronger rule. */
.stat-tile.accent { border-color: var(--line-strong); background: var(--surface-3); }
.stat-tile.accent .n { color: var(--text); }
.stat-tile.accent .l { color: var(--text-2); }

/* --------------------------------------------------------------- forms -- */

.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field label, .field > p > label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.field .helptext, .field .help {
  display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-3);
}

input[type="text"], input[type="url"], input[type="email"], input[type="date"],
input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: inherit; font-size: 13px;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-strong);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option { background: var(--surface-1); color: var(--text); }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent-strong); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7) sepia(.4); cursor: pointer; }

.checkrow { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.checkrow label { margin: 0; font-weight: 500; }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}

.errorlist {
  list-style: none; margin: 0 0 12px; padding: 10px 13px;
  background: var(--red-soft); border: 1px solid var(--red-line);
  border-radius: var(--radius-s); color: var(--red); font-size: 12.5px;
}
.errorlist li + li { margin-top: 4px; }
.field .errorlist { margin: 6px 0 0; }

.messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.messages li {
  padding: 10px 14px; border-radius: var(--radius-s); font-size: 13px;
  background: var(--green-soft); border: 1px solid var(--green-line); color: var(--green);
}
.messages li.error { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }

.inline-form { display: flex; gap: 9px; align-items: flex-start; }
.inline-form textarea { min-height: 42px; }

.form-shell { max-width: 760px; }

/* --------------------------------------------------------------- login -- */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(720px 400px at 50% 8%, var(--map-sheen), transparent 70%), var(--bg); }
.login-card {
  width: 100%; max-width: 392px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 30px; box-shadow: var(--shadow);
}
.login-card .brand { justify-content: center; margin-bottom: 7px; min-width: 0; }
.login-card h1 { font-size: 19px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin-bottom: 22px; }
.login-card .field + .field { margin-top: 14px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 20px; padding: 10px; }
.login-note {
  margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.55;
}

/* --------------------------------------------------------------- table -- */

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; padding: 9px 13px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
  border-bottom: 1px solid var(--line-strong);
}
.table td { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--hover-film); }
.table td strong { color: var(--text); font-weight: 600; }

.table-scroll { overflow-x: auto; }

.breadcrumb { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-2); }

.htmx-request .htmx-hide { opacity: .5; }

@media (max-width: 1420px) {
  .workspace { grid-template-columns: var(--subnav-w) minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; position: static; }
  .rail .rail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
  .rail .rail-grid .panel + .panel { margin-top: 0; }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .subnav { position: static; }
  .card-row, .card-row.two { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  /* Keep the header inside the viewport instead of widening the page. */
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { padding-right: 12px; }
  .brand-logo { height: 20px; }
  .commandbar { gap: 0; padding: 0 8px; }
  .cmd-item { padding: 0 10px; }
  .cmd-item.is-active::after { left: 10px; right: 10px; }
  .cmd-user > summary { padding-left: 12px; }
  .main { padding: 14px 12px 32px; }
}

/* ------------------------------------------------- scope tabs and paging -- */

.scope-tabs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 11px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scope-hint { font-size: 11.5px; color: var(--text-3); margin-left: 6px; }

.pager {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 15px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pager-status { font-size: 12px; color: var(--text-3); margin: 0 auto; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- imported source -- */

.source-panel .panel-body { background: var(--hover-film); }
.source-note {
  font-size: 11.5px; color: var(--text-3); margin: 0 0 11px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.source-text {
  font-size: 12.5px; line-height: 1.62; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 290px; overflow-y: auto;
}
.kind-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text-2);
}
.kind-badge.supplier { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }

/* ------------------------------------------------------- pipeline boards -- */

.pipeline-tabs {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pipe-spacer { flex: 1; }

.pipe-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--text-2); border: 1px solid transparent;
}
.pipe-tab:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.pipe-tab.active {
  position: relative;
  background: var(--surface-3); border-color: var(--line-strong); color: var(--text);
}
.pipe-tab.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 4px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.pipe-tab .n {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--inset); font-variant-numeric: tabular-nums;
}

.view-toggle {
  display: inline-flex; border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden;
}
.view-btn {
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none; background: transparent;
}
.view-btn + .view-btn { border-left: 1px solid var(--line-strong); }
.view-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.view-btn.active { background: var(--surface-3); color: var(--text); }

.pipeline-filters {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pipeline-scope-note {
  margin-bottom: 14px; padding: 10px 14px; font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-s);
}

.board-footnote {
  font-size: 11.5px; color: var(--text-3); margin-top: 16px; max-width: 980px; line-height: 1.6;
}

.stage-error {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 11px 14px; font-size: 13px;
  background: var(--red-soft); border: 1px solid var(--red-line);
  border-radius: var(--radius-s); color: var(--red);
}
.stage-error .btn { margin-left: auto; }

/* --- columns ------------------------------------------------------------- */

/* The board scrolls sideways inside this container; vertically the page is
   the only scroll area. `overflow-x: auto` alone still let the board subtree
   widen the document's scroll area, so the whole page scrolled sideways and
   carried the header off screen. Paint containment keeps that overflow here.
   The element's height stays automatic, so it grows with the tallest column
   and never becomes a second vertical scroller. */
.board-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  contain: paint;
  padding-bottom: 10px;
  /* Fill the viewport when the board is short, so the columns use the space
     that is there, instead of stopping at an arbitrary height. */
  min-height: max(340px, calc(100vh - 330px));
}
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 310px;
  gap: 13px;
  /* Stretch: the tallest column sets the height and every other column
     background runs alongside it. */
  align-items: stretch;
  min-height: max(340px, calc(100vh - 330px));
}

.board-col {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  /* No height cap and no scroller of its own: a column grows with its cards
     and the page scrolls. */
}
.board-col.is-closed { background: var(--inset-strong); }
.board-col.is-overflow { border-style: dashed; border-color: var(--line-strong); }

.board-col-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.board-col-head h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .055em;
  text-transform: uppercase; color: var(--text-2);
}
.board-col.is-closed .board-col-head h2 { color: var(--text-3); }
.col-count {
  /* Counts stay neutral: terracotta is reserved for actions and selection,
     and the outcome columns below override this with their own colour. */
  margin-left: auto; font-size: 11.5px; font-weight: 700;
  min-width: 24px; text-align: center; padding: 1px 7px;
  border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--line-strong); color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.board-col-body {
  padding: 11px; display: flex; flex-direction: column; gap: 11px;
  /* flex: 1 makes the body fill the stretched column, so the empty space under
     a short column's cards is still a drop target. */
  flex: 1; min-height: 90px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.board-col-body.drag-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent-line);
}
.col-empty {
  margin: 0; padding: 18px 10px; text-align: center;
  font-size: 12px; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: 8px;
}

/* --- cards --------------------------------------------------------------- */

.opp-card {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 9px;
  cursor: grab;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.opp-card:hover { border-color: var(--line-strong); background: var(--surface-3); }
.opp-card:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.opp-card.is-dragging { opacity: .45; cursor: grabbing; transform: rotate(-1deg); }
.opp-card.is-saving { opacity: .6; pointer-events: none; }
.opp-card.just-moved {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.opp-card-open { text-decoration: none; color: inherit; display: block; }
.opp-card-open:hover { text-decoration: none; }
.opp-card-head { display: flex; gap: 10px; align-items: flex-start; }

.opp-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; overflow: hidden;
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.opp-avatar img { width: 100%; height: 100%; object-fit: contain; }

.opp-card-id { min-width: 0; flex: 1; }
.opp-company {
  display: block; font-size: 13px; font-weight: 650; color: var(--text);
  line-height: 1.3; overflow-wrap: break-word;
}
.opp-title {
  display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-3);
  line-height: 1.4; overflow-wrap: break-word;
}

.opp-row { display: flex; flex-direction: column; gap: 2px; }
.opp-k {
  font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}
.opp-v { font-size: 12px; color: var(--text-2); overflow-wrap: break-word; }

.opp-action {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 9px; border-radius: 7px;
  background: var(--hover-film);
  border-left: 2px solid var(--line-strong);
  font-size: 12px; color: var(--text-2);
}
.opp-action.overdue { border-left-color: var(--red); background: var(--red-soft); }
/* With no task to show, the slot stays a single quiet line rather than a
   block that outweighs the rest of the card. */
.opp-action:has(.opp-action-empty) { padding: 6px 9px; border-left-color: var(--line-strong); }
.opp-action-empty { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.opp-action-empty a { font-size: 11.5px; font-weight: 600; }
.opp-action svg { color: var(--text-3); vertical-align: -1px; margin-right: 5px; }
.opp-action-text { color: var(--text); line-height: 1.4; overflow-wrap: break-word; }
.opp-action-text.muted { color: var(--text-3); }
.opp-action-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.opp-dates, .opp-money { display: flex; flex-direction: column; gap: 7px; }
.opp-date, .opp-money-item { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.opp-date b, .opp-money-item b { color: var(--text); font-weight: 600; }
.opp-hint { font-size: 10px; color: var(--text-3); font-style: italic; }

.opp-foot {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding-top: 9px; border-top: 1px solid var(--line);
}
.opp-owner { font-size: 11.5px; color: var(--text-3); }
.opp-stage-control { margin-left: auto; }
.opp-stage-control select {
  width: auto; min-width: 118px; padding: 4px 7px;
  font-size: 11px; border-radius: 6px;
  background: var(--surface-1); border-color: var(--line-strong);
}

/* Narrow screens: stack the columns instead of shrinking the type. */
@media (max-width: 880px) {
  .board {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
  }
  .board-col-body { max-height: none; }
  .board-scroll {
    overflow-x: visible;
    contain: none;
    min-height: 0;
  }
  .board { min-height: 0; }
  .pipeline-filters > * { flex: 1 1 100%; }
  .pipeline-filters select, .pipeline-filters .search-field { max-width: none; width: 100%; }
}

.stage-form { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.stage-form label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.stage-form select { width: auto; min-width: 210px; }

.company-board-links {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 15px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3);
}
.company-board-links a {
  padding: 2px 9px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--text-2); text-decoration: none;
}
.company-board-links a:hover {
  background: var(--raised); border-color: var(--line-strong);
  color: var(--text); text-decoration: none;
}
.subnav .subnav-sub { font-size: 11.5px; padding-left: 22px; color: var(--text-3); }

/* --------------------------------------------------------------- brand -- */
/* The supplied Veltner wordmark, shown at its own aspect ratio and colours. */
.brand-logo { height: 26px; width: auto; display: block; }
.login-logo { height: 34px; margin: 0 auto 6px; }

/* --------------------------------------------------------- company logo -- */
/* One component for lists, headers, boards and detail screens. Dimensions are
   fixed per size so a logo loading late cannot shift the layout. The artwork
   is never recoloured, never cropped to a circle and never stretched. */

.clogo {
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
}
.clogo img {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* preserves the original proportions */
  display: block;
}

/* A pale tile only where the artwork is dark enough to disappear otherwise.
   Decided per logo at cache time from its own pixels. */
.clogo-image.clogo-back-light {
  background: var(--paper);
  border-color: var(--paper-line);
}
.clogo-image.clogo-back-dark { background: var(--surface-1); }

.clogo-initials { color: var(--text-2); font-weight: 700; letter-spacing: .02em; }

.clogo-sm { width: 32px; height: 32px; font-size: 11.5px; }
.clogo-sm img { padding: 3px; }
.clogo-md { width: 46px; height: 46px; border-radius: 10px; font-size: 15px; }
.clogo-md img { padding: 4px; }
.clogo-lg { width: 74px; height: 74px; border-radius: 12px; font-size: 27px; }
.clogo-lg img { padding: 7px; }

.clogo-preview {
  width: 148px; height: 148px; border-radius: 14px; font-size: 44px;
}
.clogo-preview img { padding: 12px; }

/* A wide wordmark would otherwise shrink to a sliver in a square tile. Less
   padding gives it the full width; it is still contained, never cropped. */
.clogo-wide.clogo-sm img { padding: 2px 1px; }
.clogo-wide.clogo-md img { padding: 3px 2px; }
.clogo-wide.clogo-lg img { padding: 5px 3px; }
.clogo-wide.clogo-preview img { padding: 10px 6px; }

.opp-detail-head { align-items: flex-start; }
.opp-detail-id { display: flex; gap: 16px; align-items: flex-start; }
.opp-detail-company { margin: 3px 0 5px !important; font-size: 13px; font-weight: 600; }

input[type="file"] {
  width: 100%; padding: 9px 11px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-1); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
}
input[type="file"]::file-selector-button {
  margin-right: 11px; padding: 6px 12px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--text); background: var(--surface-3);
  border: 1px solid var(--line-strong); border-radius: 6px;
}
input[type="file"]::file-selector-button:hover {
  background: var(--raised); border-color: var(--accent-line);
}

/* ===========================================================================
   Charcoal + terracotta: states, scrollbars and pipeline strips
   =========================================================================== */

/* --- selection and focus ------------------------------------------------- */

::selection { background: var(--accent-soft-2); color: var(--text); }

:focus-visible { outline-color: var(--accent); }

/* A keyboard focus ring must be visible on every surface, including on top of
   a terracotta fill, so it pairs a dark halo with the accent. */
.btn:focus-visible,
.pipe-tab:focus-visible,
.filterchip:focus-visible,
.view-btn:focus-visible,
.cmd-item:focus-visible,
.cmd-menu-item:focus-visible,
.cmd-more > summary:focus-visible,
.cmd-user > summary:focus-visible,
.subnav a:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.btn-primary:focus-visible { outline-color: var(--accent-on); }

/* --- disabled and inactive ----------------------------------------------- */
/* Inactive items stay readable: dimmed by colour, not by near-invisible
   opacity, so "later increment" never looks like a rendering fault. */

.cmd-item.is-later,
.cmd-menu-item.is-later,
.subnav .item.later {
  opacity: 1;
  color: var(--text-disabled);
}
.cmd-item.is-later svg,
.cmd-menu-item.is-later svg,
.subnav .item.later svg { color: var(--text-disabled); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 1;
  color: var(--text-disabled);
  background: var(--surface-2);
  border-color: var(--line);
  cursor: not-allowed;
}
input[disabled], select[disabled], textarea[disabled] {
  color: var(--text-disabled);
  background: var(--surface-2);
  border-color: var(--line);
  cursor: not-allowed;
}

/* --- scrollbars ----------------------------------------------------------- */
/* Slim and quiet: a thin bar with a transparent track and a terracotta thumb
   at low opacity, lifting a little on hover so it is easy to find and grab.
   Opacity, not a lighter colour, keeps it from reading as a bright orange bar.
   Firefox gets the same treatment through scrollbar-width/-color; mouse,
   keyboard and touch scrolling are untouched. */

:root {
  --scroll-thumb:       rgba(181, 101, 73, .30);
  --scroll-thumb-hover: rgba(181, 101, 73, .55);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* The board's horizontal bar is the one people drag most, so it gets a
   slightly taller track while keeping the same muted thumb. */
.board-scroll::-webkit-scrollbar { height: 8px; }
.board-scroll:hover, .table-scroll:hover, .source-text:hover, .cmd-menu:hover {
  scrollbar-color: var(--scroll-thumb-hover) transparent;
}

/* --- pipeline header strips ----------------------------------------------- */
/* A 3px strip across each column header. These are small status indicators
   that supplement the written label, never a replacement for it: the title and
   count stay fully readable on the usual charcoal header. */

:root {
  /* Work in progress is a tonal ramp, brightening as a stage advances, so
     the board reads as monochrome and no early stage shouts. Oxide is
     deliberately absent here: it belongs to the active card and the
     principal action, not to a column border. Only a real outcome earns
     a hue, and each still carries its written label. */
  --strip-slate:  #4A5253;   /* nothing committed yet */
  --strip-terra:  #5E6768;   /* active interest */
  --strip-violet: #788284;
  --strip-teal:   #949C9C;
  --strip-sage:   #6B8C81;   /* collaboration agreed - positive, not Won */
  --strip-green:  var(--signal-green);    /* won */
  --strip-red:    var(--red);             /* lost */
  --strip-amber:  var(--caution-amber);   /* awaiting a decision */
  --strip-muted:  var(--structural);      /* not part of this board */
}

.board-col-head {
  border-top: 3px solid var(--strip-muted);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Veltner: Contacted, Interested, Qualified, Proposal sent,
   Collaboration agreed, Won, Lost. */
.board-col[data-stage="contacted"]            > .board-col-head { border-top-color: var(--strip-slate); }
.board-col[data-stage="interested"]           > .board-col-head { border-top-color: var(--strip-terra); }
.board-col[data-stage="qualified"]            > .board-col-head { border-top-color: var(--strip-violet); }
.board-col[data-stage="proposal_sent"]        > .board-col-head { border-top-color: var(--strip-teal); }
.board-col[data-stage="collaboration_agreed"] > .board-col-head { border-top-color: var(--strip-sage); }

/* Supplier: To verify, Need confirmed, Preparing proposal/bid, Submitted,
   Decision, Won, Lost. Same restraint, matched to its own stages. */
.board-col[data-stage="unconfirmed"]    > .board-col-head { border-top-color: var(--strip-slate); }
.board-col[data-stage="need_confirmed"] > .board-col-head { border-top-color: var(--strip-violet); }
.board-col[data-stage="preparing"]      > .board-col-head { border-top-color: var(--strip-teal); }
.board-col[data-stage="submitted"]      > .board-col-head { border-top-color: var(--strip-terra); }
.board-col[data-stage="decision"]       > .board-col-head { border-top-color: var(--strip-amber); }

/* Shared outcomes on both boards. */
.board-col[data-stage="won"]  > .board-col-head { border-top-color: var(--strip-green); }
.board-col[data-stage="lost"] > .board-col-head { border-top-color: var(--strip-red); }

.board-col[data-stage="won"]  .col-count { color: var(--green); border-color: var(--green-line); }
.board-col[data-stage="lost"] .col-count { color: var(--red);   border-color: var(--red-line); }

/* ------------------------------------------------------------------ today -- */

.tday-section + .tday-section { margin-top: 14px; }
.tday-note {
  margin: 0 0 14px; padding: 10px 14px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.tday-note .chip { margin-right: 8px; }
.tday-scope {
  margin: 0 0 13px; padding-bottom: 11px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3); line-height: 1.6;
}

.tday-list { display: flex; flex-direction: column; }

.tday-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.tday-row:last-child { border-bottom: 0; }
.tday-row:hover { background: var(--hover-film); }
/* Overdue carries a red edge; the row still appears in exactly one section. */
.tday-row.is-overdue { border-left: 3px solid var(--red); background: var(--red-soft); }

.tday-main { min-width: 0; }
.tday-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.45; }
.tday-meta {
  margin-top: 5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-3);
}
.tday-company { font-weight: 600; }
.tday-sep { color: var(--line-strong); }
.tday-detail {
  margin: 7px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.55;
}

.tday-facts { display: flex; gap: 20px; align-items: flex-start; }
.tday-fact { display: flex; flex-direction: column; gap: 3px; font-size: 12px; white-space: nowrap; }
.tday-fact b { color: var(--text); font-weight: 600; }
.tday-k {
  font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}

.tday-actions { display: flex; align-items: center; gap: 7px; }
.tday-plan { position: relative; }
.tday-plan > summary { list-style: none; cursor: pointer; }
.tday-plan > summary::-webkit-details-marker { display: none; }
.tday-plan[open] > summary { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.tday-plan-form {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 11px; white-space: nowrap;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.tday-plan-form select { width: auto; min-width: 150px; }
.tday-plan-form input[type="date"] { width: auto; }

.tday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.tday-company-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; text-decoration: none; color: inherit;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tday-company-card:hover {
  border-color: var(--line-strong); background: var(--raised); text-decoration: none;
}
.tday-company-id { min-width: 0; flex: 1; }
.tday-company-id strong { display: block; font-size: 13.5px; color: var(--text); }
.tday-company-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 4px; font-size: 11.5px; color: var(--text-3);
}
.tday-company-cta {
  flex: none; font-size: 11.5px; font-weight: 600; color: var(--accent-text);
}

@media (max-width: 1080px) {
  .tday-row { grid-template-columns: auto minmax(0, 1fr); }
  .tday-facts { grid-column: 1 / -1; gap: 18px; }
  .tday-actions { grid-column: 1 / -1; }
  .tday-plan-form { right: auto; left: 0; flex-wrap: wrap; white-space: normal; }
  .tday-plan-form select, .tday-plan-form input[type="date"] { width: 100%; min-width: 0; }
}

/* -------------------------------------------------------------------- s04 -- */

.gate-list { margin: 0 0 14px; padding: 0; list-style: none; }
.gate-list li {
  padding: 9px 12px; margin-bottom: 7px; font-size: 12.5px;
  border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface-3); color: var(--text-2);
}
.gate-list li.is-blocking { border-left: 3px solid var(--amber); }
.gate-list li.is-waived { border-left: 3px solid var(--green); color: var(--text-3); }
.gate-form {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.gate-form select, .gate-form input[type="text"] { width: auto; min-width: 200px; flex: 1; }
.gate-exception {
  margin: 11px 0 0; padding: 10px 12px; font-size: 12px; color: var(--text-2);
  background: var(--green-soft); border: 1px solid var(--green-line);
  border-radius: var(--radius-s);
}

.plain-list { margin: 5px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text); }
.plain-list li { margin-bottom: 4px; line-height: 1.5; }
.plain-list.muted li { color: var(--text-3); }

.proposal {
  padding: 13px; margin-bottom: 12px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-s);
}
.proposal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.proposal-warn {
  margin: 0 0 9px; padding: 8px 11px; font-size: 12px; color: var(--amber);
  background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 6px;
}
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.diff-side {
  padding: 10px; background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 6px;
}
.decision-form { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

@media (max-width: 880px) { .diff { grid-template-columns: 1fr; } }

/* The facts column must not be compressed by a long title: its labels were
   being clipped under the action button on Traffic Control rows. */
.tday-facts { min-width: max-content; flex: none; }
@media (max-width: 1080px) { .tday-facts { min-width: 0; } }

/* ----------------------------------------------------------- outreach draft -- */

.draft-rules {
  margin-bottom: 16px; padding: 13px 16px;
  background: var(--amber-soft); border: 1px solid var(--amber-line);
  border-radius: var(--radius); font-size: 12.5px; color: var(--text-2);
}
.draft-rules strong { color: var(--amber); }
.draft-rules ul { margin: 8px 0 8px 18px; padding: 0; }
.draft-rules li { margin-bottom: 3px; line-height: 1.5; }
.draft-rules p { margin: 0; }
.draft-form .panel + .panel { margin-top: 14px; }
.evidence-picker {
  max-height: 220px; overflow-y: auto; padding: 9px 11px;
  background: var(--surface-1); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
}
.evidence-picker ul { list-style: none; margin: 0; padding: 0; }
.evidence-picker li { margin-bottom: 7px; font-size: 12px; line-height: 1.45; }
.evidence-picker label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }

/* ------------------------------------------------------- command centre -- */
/* The morning brief. Composition from the approved reference; colour and
   restraint from the visual standard, which wins where the two disagree.

   The screen is obsidian and graphite throughout. Oxide appears in three
   places only: the principal action, the edge of the most pressing decision,
   and a verified map pin. Hierarchy is carried by typography and scale, which
   is what the standard asks for before any panel or colour is added. */

.cc { display: flex; flex-direction: column; gap: 20px; }

/* --- hero ---------------------------------------------------------------- */
/* The stage holds the statement over the network; the decisions rail sits
   beside it at a fixed measure. Both share one height so the campaign front
   stays close to the fold on a 1440-1920 desktop. */

.cc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 24px;
  align-items: stretch;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.cc-stage {
  position: relative;
  min-height: 436px;
  display: flex; align-items: flex-start;
  isolation: isolate;
}

/* The network is the backdrop, not a decorative panel: it reports verified
   locations. The scrim keeps the statement legible and never swallows a
   click on a pin. */
.cc-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(8, 10, 11, .90) 0%, rgba(8, 10, 11, .74) 24%,
    rgba(8, 10, 11, .40) 40%, rgba(8, 10, 11, .08) 56%, transparent 70%);
}

.cc-hero-text { position: relative; z-index: 2; max-width: 760px; min-width: 0; }

.cc-principal { margin-top: 26px; }
.cc-principal .t-figure { margin: 0; }
/* Zero is a real answer, not a gap: dimmed, never hidden. */
.cc-principal .t-figure.is-zero { color: var(--text-3); }
.cc-principal-label {
  margin: 2px 0 0; font-size: 15px; color: var(--text-2); font-weight: 500;
}
.cc-principal-note {
  margin: 8px 0 0; max-width: 40ch;
  font-size: 11.5px; line-height: 1.55; color: var(--text-3);
}

.cc-cta { margin-top: 16px; display: inline-flex; align-items: center; gap: 9px; }

.cc-subfigures {
  display: flex; gap: 26px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 560px;
}
.cc-subfigures strong {
  display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.1;
}
.cc-subfigures span { font-size: 11.5px; color: var(--text-3); }

.cc-not-recorded {
  margin: 14px 0 0; max-width: 52ch;
  font-size: 11.5px; line-height: 1.6; color: var(--text-3);
}

/* --- the network --------------------------------------------------------- */
/* Silver on obsidian. No arcs, no scatter of coloured dots: the standard
   forbids flooding a map, and an invented connection would be a lie. */

/* Full width: the world is shown whole, as in the reference, and the scrim
   rather than a crop is what keeps the statement legible over it. */
.cc-map {
  position: absolute; z-index: 0;
  top: 0; bottom: 26px; right: 0; left: 0;
  display: grid; place-items: center;
}

/* The viewport keeps the generated map's 1000 x 387.5 ratio and the pin plane
   is the same box, so a pin placed with map_x/map_y lands on the matching
   coastline at any window width. Sizing the mask and the plane differently is
   exactly how pins drift, so they share this element and nothing else. */
.cc-map-viewport {
  position: relative;
  aspect-ratio: 1000 / 387.5;
  height: 100%; max-width: 100%;
  background: radial-gradient(68% 86% at 52% 42%, var(--map-sheen), transparent 72%);
}
.cc-map-world {
  position: absolute; inset: 0;
  background-color: var(--map-land);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-position: center; mask-position: center;
}
.cc-map-plane { position: absolute; inset: 0; }

.cc-pin { position: absolute; width: 0; height: 0; z-index: 3; }
.cc-pin::before {
  content: ""; position: absolute; left: -3px; top: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 101, 73, .16);
  transition: box-shadow var(--t-base) var(--ease);
}
.cc-pin:hover::before, .cc-pin:focus-visible::before {
  box-shadow: 0 0 0 7px rgba(181, 101, 73, .26);
}
.cc-pin-label {
  position: absolute; left: 10px; top: -8px; white-space: nowrap;
  padding: 2px 7px; border-radius: var(--radius-s);
  background: var(--scrim); border: 1px solid var(--line);
  font-size: 10.5px; color: var(--text);
  opacity: 0; transition: opacity var(--t-fast) var(--ease);
  pointer-events: none;
}
.cc-pin:hover .cc-pin-label, .cc-pin:focus-visible .cc-pin-label { opacity: 1; }

.cc-map-caption {
  position: absolute; left: 0; right: 0; bottom: -20px;
  margin: 0; text-align: center; color: var(--text-3); z-index: 2;
}

.cc-map-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; max-width: 380px; padding: 11px 16px; text-align: center;
  background: var(--scrim); border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 12px; line-height: 1.55; color: var(--text-2);
}
.cc-map-empty strong { color: var(--text); font-weight: 600; }

/* --- today's decisions --------------------------------------------------- */
/* Deliberately short. Three items is a briefing; a dozen is another backlog,
   and Today already is that list. */

.cc-decisions { min-width: 0; display: flex; flex-direction: column; }
.cc-rail-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.cc-rail-head h2 { margin: 0; }
.cc-rail-count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--text-2); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 1px 7px; font-variant-numeric: tabular-nums;
}

.cc-decision {
  display: block; position: relative;
  padding: 12px 14px 12px 15px;
  border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
.cc-decision:hover { background: var(--hover-film); text-decoration: none; }

/* The most pressing item is "the principal action requiring attention", so it
   is the one entry here that may carry oxide. A genuine warning or overdue
   state overrides it with its own colour and keeps its written label. */
.cc-decision.is-first { background: var(--accent-wash); }
.cc-decision.is-first::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}
.cc-decision.tone-red::before   { background: var(--red); }
.cc-decision.tone-amber::before { background: var(--amber); }

.cc-decision-kind { margin: 0 0 5px; display: flex; align-items: baseline; gap: 9px; }
.cc-decision-when { color: var(--text-3); letter-spacing: .06em; }
.cc-decision-title {
  margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em;
  color: var(--text); line-height: 1.25;
}
.cc-decision-line {
  margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2);
}
.cc-decision-meta { margin: 4px 0 0; font-size: 11px; color: var(--text-3); }
.cc-decision-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
}
.cc-decision:hover .cc-decision-cta,
.cc-decision.is-first .cc-decision-cta { color: var(--accent-text); }

.cc-rail-empty {
  padding: 18px 16px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  margin-top: 12px;
}
.cc-rail-empty strong { display: block; font-size: 13.5px; color: var(--text); }
.cc-rail-empty span {
  display: block; margin-top: 5px; font-size: 12px; color: var(--text-3);
  line-height: 1.55;
}
.cc-rail-more {
  margin: auto 0 0; padding-top: 11px;
  font-size: 11.5px; color: var(--text-3);
}

/* --- campaign front ------------------------------------------------------ */

.cc-front-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding-bottom: 9px; border-bottom: 1px solid var(--line); margin-bottom: 2px;
}
.cc-front-head h2 { margin: 0; }
.cc-front-note { font-size: 11.5px; color: var(--text-3); max-width: 108ch; line-height: 1.55; }
.cc-front-note strong { color: var(--text-2); font-weight: 600; }

.cc-table th.n, .cc-table td.n { text-align: right; white-space: nowrap; }
.cc-table td.n { font-variant-numeric: tabular-nums; }
.cc-front-name {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.cc-front-name:hover { color: var(--accent-text); }
.cc-front-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.cc-front-open { font-size: 12px; font-weight: 600; }
.cc-front-empty { margin-top: 14px; }

.cc-footnote {
  margin: 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.65; color: var(--text-3); max-width: 110ch;
}
.cc-demo-flag { color: var(--amber); font-weight: 600; }

/* The standard designs for 1440-1920. Below 1280 the rail drops under the
   stage rather than squeezing the network out of legibility. */
@media (max-width: 1280px) {
  .cc-hero { grid-template-columns: minmax(0, 1fr); }
  .cc-stage { min-height: 380px; }
  .cc-decisions { padding-top: 16px; border-top: 1px solid var(--line); }
  .cc-rail-more { margin-top: 10px; }
}
@media (max-width: 980px) {
  .cc-map { left: 0; opacity: .5; }
  .cc-stage::after {
    background: linear-gradient(180deg, rgba(8, 10, 11, .55), rgba(8, 10, 11, .88));
  }
  .cc-hero-text { max-width: none; }
}

/* Drafts that are ready but held — a parked or flagged case, or a market the
   sourcing policy has not cleared. Stated, never hidden: an unseen figure is
   how a blocked market quietly becomes a sent email. */
.cc-held {
  margin: 10px 0 0; max-width: 46ch;
  font-size: 11.5px; line-height: 1.55; color: var(--text-3);
}
.cc-held strong { color: var(--text-2); font-weight: 600; }
.cc-held .unknown { display: block; margin-top: 4px; }

/* ------------------------------------------------------------- dossier -- */
/* The Company Intelligence Dossier. Warm paper against the deep graphite
   environment, per the standard's section 6: "The dossier should feel like
   opening an important intelligence file."

   The paper is a reading surface and carries the brief. Everything that is
   working state — situations, evidence, people, the next action — stays on
   graphite beside it. Confirmed facts, inferences and unknowns are visibly
   distinct everywhere they appear, and never by colour alone: each carries a
   written label. */

.dossier {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr) var(--rail-w);
  gap: 22px;
  align-items: start;
}

/* --- the warm-paper brief ------------------------------------------------ */

.dsr-brief {
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  /* The bound edge of a physical file. Quiet, local, and the only texture on
     the screen — the standard allows paper texture "with restraint". */
  background-image:
    linear-gradient(90deg, rgba(25, 27, 28, .16) 0 14px, transparent 14px),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(25, 27, 28, .05) 46px 47px);
}
.dsr-brief-body { padding: 26px 26px 20px 34px; }

/* The spine tab, the one oxide mark on the paper. */
.dsr-tab {
  position: absolute; left: -1px; top: 26px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--accent); color: var(--accent-on);
  padding: 11px 4px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-weight: 600; letter-spacing: .14em;
}

.dsr-ident { margin: 0 0 10px; color: var(--paper-text-2); text-transform: uppercase; }

.dsr-name {
  margin: 0; font-size: clamp(30px, 2.6vw, 46px); line-height: 1.02;
  letter-spacing: -0.03em; font-weight: 700; color: var(--paper-text);
  text-wrap: balance;
}
.dsr-headline {
  margin: 8px 0 0; font-size: 17px; line-height: 1.3;
  color: var(--paper-text-2); font-weight: 400;
}
.dsr-demo {
  margin: 12px 0 0; padding: 5px 9px; display: inline-block;
  background: rgba(190, 160, 120, .22); border: 1px solid rgba(120, 95, 55, .4);
  border-radius: var(--radius-s);
  font-size: 11.5px; font-weight: 600; color: #5d4a2a;
}

.dsr-rule { border: 0; border-top: 1px solid var(--paper-line); margin: 18px 0 14px; }

.dsr-label { margin: 0 0 7px; color: var(--paper-text-2) !important; }
.dsr-prose { margin: 0; font-size: 14px; line-height: 1.55; color: var(--paper-text); }
.dsr-source-desc { font-style: italic; }
.dsr-basis { margin: 6px 0 0; font-size: 11px; color: var(--paper-text-2); }

.dsr-products { margin: 0; padding-left: 17px; font-size: 13.5px; line-height: 1.5; color: var(--paper-text); }
.dsr-products li + li { margin-top: 5px; }

/* The confirmed figures, as the reference sets them: large, in a row, each
   with its quiet caption. */
/* Three at most, in equal columns, so a long value wraps inside its own
   cell instead of pushing the next one onto a second row. */
.dsr-confirmed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dsr-fact { padding-right: 12px; min-width: 0; }
.dsr-fact + .dsr-fact { padding-left: 12px; border-left: 1px solid var(--paper-line); }
.dsr-fact strong {
  display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.015em;
  color: var(--paper-text); line-height: 1.2; overflow-wrap: anywhere;
}
.dsr-fact span {
  display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.35;
  color: var(--paper-text-2);
}
.dsr-gaps-more { color: var(--paper-text-2); font-style: italic; }

.dsr-gaps { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--paper-text); }

.dsr-locale { margin-top: 18px; }
.dsr-mini-map {
  position: relative; aspect-ratio: 1000 / 387.5; width: 100%;
  background: rgba(25, 27, 28, .05); border: 1px solid var(--paper-line);
  border-radius: var(--radius-s); overflow: hidden;
}
.dsr-mini-world {
  position: absolute; inset: 0; background-color: rgba(25, 27, 28, .30);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.dsr-mini-pin {
  position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 101, 73, .22);
}
.dsr-coords { margin: 7px 0 0; color: var(--paper-text-2); }

.dsr-brief-foot {
  margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--paper-line);
  font-size: 11.5px; color: var(--paper-text-2);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.dsr-brief-foot a { color: #8a4a2c; font-weight: 600; }
.dsr-brief-foot a:hover { color: var(--accent); }

/* --- the situations ------------------------------------------------------ */

.dsr-cases { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dsr-case-count { margin: 0; color: var(--amber); }

.dsr-case {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.dsr-case-eyebrow { margin: 0 0 7px; }
.dsr-case-title {
  margin: 0; font-size: clamp(22px, 1.9vw, 30px); line-height: 1.12;
  letter-spacing: -0.02em; font-weight: 650; color: var(--text); text-wrap: balance;
}
.dsr-case-meaning { margin: 7px 0 0; font-size: 12.5px; color: var(--text-3); }
.dsr-case-summary { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }

.dsr-flag {
  margin: 12px 0 0; padding: 9px 12px;
  background: var(--amber-soft); border-left: 2px solid var(--amber);
  border-radius: var(--radius-s); font-size: 12.5px; line-height: 1.5; color: var(--text-2);
}
.dsr-flag strong { color: var(--amber); }

.dsr-sub { margin: 20px 0 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.dsr-case > .dsr-sub:first-of-type { margin-top: 18px; }

/* Fact, estimate, researched-unknown, not-researched and contradictory each
   read differently — and each says which it is in words, because the standard
   forbids a meaningful state resting on colour alone. */
.dsr-facts { list-style: none; margin: 0; padding: 0; }
.dsr-facts li {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) auto;
  gap: 10px; align-items: baseline;
  padding: 8px 0 8px 11px; border-left: 2px solid var(--line-strong);
}
.dsr-facts li + li { border-top: 1px solid var(--line); }
.dsr-facts li.is-fact { border-left-color: var(--green); }
.dsr-facts li.is-inference { border-left-color: var(--caution-amber); }
.dsr-facts li.is-unknown { border-left-color: var(--text-3); }
.dsr-facts li.is-not-researched { border-left-color: var(--line-strong); }
.dsr-facts li.is-conflict { border-left-color: var(--red); }

.dsr-fact-label { font-size: 12.5px; color: var(--text-3); }
.dsr-fact-value { font-size: 13.5px; color: var(--text); font-weight: 500; }
.dsr-fact-kind {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.dsr-facts li.is-fact .dsr-fact-kind { color: var(--green); }
.dsr-facts li.is-inference .dsr-fact-kind { color: var(--amber); }
.dsr-facts li.is-conflict .dsr-fact-kind { color: var(--red); }
.dsr-fact-basis {
  grid-column: 2 / -1; font-size: 11.5px; color: var(--text-3); line-height: 1.5;
}

.dsr-unknowns { margin: 0; padding-left: 17px; font-size: 13px; line-height: 1.6; color: var(--text-2); }

/* --- the source trail ---------------------------------------------------- */

.dsr-trail, .dsr-timeline { list-style: none; margin: 0; padding: 0; }
.dsr-trail li, .dsr-timeline li {
  display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.dsr-trail-date { flex: none; min-width: 64px; color: var(--text-3); }
.dsr-trail-title { flex: 1; min-width: 0; color: var(--text-2); }
.dsr-trail-kind { flex: none; }
.dsr-trail-agent { flex: none; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }
.dsr-trail-more { margin: 10px 0 0; font-size: 12.5px; }
.dsr-timeline-who { flex: none; font-size: 11.5px; color: var(--text-3); }

.dsr-case-foot { margin: 16px 0 0; font-size: 12.5px; }
.dsr-history {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.dsr-history .dsr-sub { margin-top: 0; padding-top: 0; border-top: 0; }

.dsr-empty {
  margin: 0; padding: 12px 14px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-s);
  font-size: 12.5px; line-height: 1.55; color: var(--text-3);
}

/* Partial research is the normal state, not a failure, so the blank dossier
   explains what will appear rather than apologising. */
.dsr-blank {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
}
.dsr-blank h2 { margin: 0 0 10px; }
.dsr-blank p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); max-width: 64ch; }
.dsr-blank-what { color: var(--text-3) !important; font-size: 12.5px !important; }

/* --- the rail ------------------------------------------------------------ */

.dsr-rail { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dsr-rail > div {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
}
.dsr-rail h2 { margin: 0 0 9px; }

/* The one dominant oxide action on this screen. */
.dsr-next {
  background: var(--accent-wash) !important;
  border-left: 2px solid var(--accent) !important;
}
.dsr-next-text {
  margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.012em; color: var(--text);
}
.dsr-next-none { color: var(--text-3); font-weight: 500; }
.dsr-next-meta { margin: 7px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.dsr-next-cta { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; }

/* The actual outreach copy, in its own register: monospace, verbatim, and
   plainly labelled unsent. It must never be mistaken for the research. */
.dsr-draft-subject { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.dsr-draft-body {
  margin: 0; padding: 11px 12px; max-height: 190px; overflow-y: auto;
  background: var(--inset); border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
.dsr-draft-meta { margin: 8px 0 0; font-size: 11.5px; color: var(--text-3); }
.dsr-draft-note { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-3); }
.dsr-draft-link { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; }

.dsr-person { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; }
.dsr-person + .dsr-person { border-top: 1px solid var(--line); }
.dsr-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text-2); display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.dsr-person-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dsr-person-id strong { font-size: 13.5px; color: var(--text); }
.dsr-person-id > span { font-size: 11.5px; color: var(--text-3); }
.dsr-person-mail { font-size: 11.5px; word-break: break-all; }
.dsr-person-tel { font-size: 11px; color: var(--text-3); }
.dsr-person-last { font-size: 11px; color: var(--text-3); }
.dsr-flagword { font-size: 11px; font-weight: 600; color: var(--red); }

.dsr-supplier-name { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.dsr-supplier-meta { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); }

/* --- stakeholder network ------------------------------------------------- */
/* Grayscale by default; oxide marks the selected person. Circular initials,
   fine lines, concise role labels. No photographs: a face this application
   does not have is not a face it may show. */

.sn { margin-top: 4px; }
.sn-canvas {
  width: 100%; max-width: 440px; height: auto; display: block;
  margin: 0 auto 10px;
}
.sn-hub { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1; }
.sn-hub-label {
  fill: var(--text-2); font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
}
.sn-hub-sub { fill: var(--text-3); font-family: var(--mono); font-size: 8px; }

.sn-link { stroke: var(--line-strong); stroke-width: 1; }
.sn-link.is-inferred { stroke-dasharray: 3 3; stroke: var(--text-3); opacity: .7; }

.sn-node-ring { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1; }
.sn-node.is-inferred .sn-node-ring { stroke-dasharray: 3 3; }
.sn-node-initials {
  fill: var(--text-2); font-size: 11px; font-weight: 600;
  font-family: var(--sans);
}

.sn-list { list-style: none; margin: 0; padding: 0; }
.sn-item + .sn-item { border-top: 1px solid var(--line); }
.sn-item-btn {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 10px 8px; background: none; border: 0; cursor: pointer;
  text-align: left; font: inherit; color: inherit;
  border-radius: var(--radius-s);
  transition: background var(--t-fast) var(--ease);
}
.sn-item-btn:hover { background: var(--hover-film); }
.sn-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text-2); display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
}
.sn-item.is-inferred .sn-avatar { border-style: dashed; }
.sn-item-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sn-item-id strong { font-size: 13.5px; color: var(--text); }
.sn-item-role { font-size: 11.5px; color: var(--text-2); }
.sn-item-state { font-size: 10.5px; letter-spacing: .06em; color: var(--text-3); }
.sn-item.is-confirmed .sn-item-state { color: var(--green); }

.sn-legend {
  margin: 10px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--text-3);
  letter-spacing: .04em;
}
.sn-key {
  display: inline-block; width: 16px; height: 0; vertical-align: middle;
  margin: 0 5px 0 10px; border-top: 1px solid var(--line-strong);
}
.sn-key-dashed { border-top-style: dashed; }

/* The revealed stakeholder. Oxide identifies the selected person — one of
   the few things the standard reserves it for. */
.sn-detail:empty { display: none; }
.sn-card {
  margin-top: 12px; padding: 15px 16px;
  background: var(--surface-3); border: 1px solid var(--accent-line);
  border-left: 2px solid var(--accent); border-radius: var(--radius);
}
.sn-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sn-avatar-lg {
  width: 42px; height: 42px; font-size: 14px;
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text);
}
.sn-card-id h4 { margin: 0; font-size: 16px; color: var(--text); }
.sn-card-role { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }
.sn-card-state { margin: 4px 0 0; font-size: 10.5px; letter-spacing: .06em; }
.sn-card-state.is-confirmed { color: var(--green); }
.sn-card-state.is-inferred { color: var(--amber); }

.sn-card-label { margin: 14px 0 5px; }
.sn-card-text { margin: 0 0 6px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.sn-card-caution {
  margin: 8px 0 0; padding: 8px 10px;
  background: var(--amber-soft); border-radius: var(--radius-s);
  font-size: 11.5px; line-height: 1.5; color: var(--text-2);
}
.sn-card-contact { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.sn-card-contact li { padding: 4px 0; color: var(--text-2); }
.sn-card-contact .t-mono { display: inline-block; min-width: 48px; color: var(--text-3); }
.sn-card-stop { color: var(--red) !important; font-weight: 600; }
.sn-card-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; }
.sn-card-log li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--text-2); }

/* The standard designs for 1440-1920. Below that the rail drops under the
   situations, and the paper keeps its measure rather than stretching. */
@media (max-width: 1420px) {
  .dossier { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); }
  .dsr-rail { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .dsr-rail > div { flex: 1; min-width: 260px; }
}
@media (max-width: 980px) {
  .dossier { grid-template-columns: minmax(0, 1fr); }
  .dsr-rail { flex-direction: column; }
}

/* The most recent recorded exchange with the buyer. A draft is never one. */
.dsr-interaction {
  margin: 14px 0 0; padding: 11px 13px;
  background: var(--surface-3); border-left: 2px solid var(--accent-line);
  border-radius: var(--radius-s);
}
.dsr-interaction-label {
  margin: 0 0 5px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.dsr-interaction-label span { color: var(--text-3); letter-spacing: .06em; }
.dsr-interaction-text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.dsr-interaction-basis { margin: 5px 0 0; font-size: 11.5px; color: var(--text-3); }
.dsr-closed { color: var(--text-3); }

/* ------------------------------------------------ supplier operations -- */
/* The index of genuine supplier relationships, and one supplier's
   headquarters. Dark graphite throughout, with the relationship panel on warm
   paper — the one reading surface, as the dossier does it.

   Oxide appears only where the standard reserves it: the principal action,
   the strongest relationship state, and the qualified outcome. */

.sx { display: flex; flex-direction: column; gap: 20px; }

.sx-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.sx-lede { margin: 8px 0 0; max-width: 72ch; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.sx-head-stats { display: flex; gap: 28px; }
.sx-head-stats strong {
  display: block; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; color: var(--text);
}
.sx-head-stats span { font-size: 11.5px; color: var(--text-3); }

.sx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sx-card-open {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 20px;
  gap: 22px; align-items: center;
  padding: 15px 18px; text-decoration: none; color: inherit;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.sx-card-open:hover { background: var(--surface-3); border-color: var(--line-strong); text-decoration: none; }
.sx-card-id { display: flex; gap: 13px; align-items: center; min-width: 0; }
.sx-card-name h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; color: var(--text); }
.sx-card-tech { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.sx-card-state { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.sx-terms { font-size: 11.5px; color: var(--text-2); }
.sx-card-nums { display: flex; gap: 18px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.sx-card-nums strong { color: var(--text); font-size: 15px; font-weight: 650; margin-right: 3px; }
.sx-card-research { color: var(--text-3); font-style: italic; }
.sx-card-go { color: var(--text-3); }
.sx-card-open:hover .sx-card-go { color: var(--accent-text); }

/* The relationship ladder. Only an agreement in place earns oxide; the rest
   are tonal, so the list reads as a gradient rather than a traffic light. */
.sx-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-2);
}
.sx-rank-6 { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.sx-rank-5 { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.sx-rank-4 { color: var(--text); }
.sx-rank-0 { color: var(--text-3); }

.sx-empty, .hq-empty {
  margin: 0; padding: 16px 18px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.6; color: var(--text-3);
}
.sx-empty h2 { margin: 0 0 8px; color: var(--text); }
.sx-empty p { margin: 0; max-width: 72ch; }

.sx-research {
  padding-top: 18px; border-top: 1px solid var(--line);
}
.sx-research-note { margin: 6px 0 12px; font-size: 11.5px; color: var(--text-3); max-width: 80ch; line-height: 1.55; }
.sx-research-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.sx-research-list li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--text-3); }
.sx-research-list span { margin-left: 10px; font-size: 11.5px; }
.sx-foot { margin: 0; font-size: 12px; color: var(--text-3); }

/* --- the headquarters ---------------------------------------------------- */

.hq {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  grid-template-areas: "stage rail" "progress rail" "opps rail" "pipe rail";
  gap: 20px 22px; align-items: start;
}
.hq-stage { grid-area: stage; }
.hq-progress { grid-area: progress; }
.hq-opps { grid-area: opps; }
.hq-rail { grid-area: rail; display: flex; flex-direction: column; gap: 16px; }

.hq-eyebrow { margin: 0 0 10px; }
.hq-stage .t-cinematic { margin: 0; }
.hq-sub {
  margin: 4px 0 0; font-size: clamp(20px, 1.7vw, 30px); line-height: 1.2;
  letter-spacing: -0.015em; color: var(--text-2);
}
.hq-tech { margin: 16px 0 0; font-size: 14px; color: var(--text-2); }
.hq-state { margin: 12px 0 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.hq-terms-ok { color: var(--green); font-weight: 600; }

/* Territory evidence. Bars are counts, not a verdict: which market *works*
   needs replies, and replies are not tracked. */
.hq-territory {
  margin-top: 22px; padding: 16px 18px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.hq-territory h2 { margin: 0 0 12px; }
.hq-terr-list { list-style: none; margin: 0; padding: 0; }
.hq-terr-list li {
  display: grid; grid-template-columns: minmax(110px, 170px) minmax(80px, 1fr) auto;
  gap: 14px; align-items: center; padding: 7px 0;
}
.hq-terr-list li + li { border-top: 1px solid var(--line); }
.hq-terr-name { font-size: 13px; color: var(--text); }
.hq-terr-track { height: 5px; }
.hq-terr-bar {
  display: block; height: 5px; background: var(--structural);
  border-radius: 3px; overflow: hidden;
}
.hq-terr-fill { display: block; height: 100%; background: var(--text-3); }
.hq-terr-nums { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.hq-terr-note { margin: 12px 0 0; font-size: 11px; line-height: 1.55; color: var(--text-3); }

/* --- observed progress --------------------------------------------------- */

.hq-progress {
  padding: 18px 20px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.hq-progress h2 { margin: 0 0 18px; }
.hq-funnel {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
}
.hq-step { position: relative; padding-top: 18px; min-width: 0; }
/* The connecting line, drawn behind the dots. */
.hq-step::before {
  content: ""; position: absolute; left: 0; right: -10px; top: 5px;
  height: 1px; background: var(--line-strong);
}
.hq-step:last-child::before { right: 50%; }
.hq-step-dot {
  position: absolute; left: 0; top: 1px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--surface-3);
  border: 1px solid var(--line-strong);
}
.hq-step.is-untracked .hq-step-dot { border-style: dashed; }
.hq-step.is-outcome .hq-step-dot { background: var(--green); border-color: var(--green); }

.hq-step-n {
  display: block; font-size: 27px; font-weight: 650; letter-spacing: -0.025em;
  line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums;
}
/* Untracked is not a number and must not look like one. */
.hq-step-untracked {
  font-size: 12px; font-weight: 600; letter-spacing: 0; line-height: 1.25;
  color: var(--text-3); font-style: italic;
}
.hq-step.is-outcome .hq-step-n { color: var(--green); }
.hq-step-label { display: block; margin-top: 5px; font-size: 11.5px; line-height: 1.35; color: var(--text-2); }
.hq-step-note { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; color: var(--text-3); }
.hq-funnel-note {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.6; color: var(--text-3); max-width: 96ch;
}
.hq-funnel-note strong { color: var(--text-2); }

/* --- qualified opportunities --------------------------------------------- */

.hq-opps h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.hq-opps-count {
  font-size: 11px; font-weight: 600; color: var(--green);
  background: var(--green-soft); border: 1px solid var(--green-line);
  border-radius: var(--radius-s); padding: 1px 7px;
}
.hq-opp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.hq-opp {
  padding: 16px 18px; background: var(--surface-2);
  border: 1px solid var(--line); border-left: 2px solid var(--green);
  border-radius: var(--radius);
}
.hq-opp-index { margin: 0 0 7px; font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); }
.hq-opp-name { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.hq-opp-where { margin: 3px 0 0; font-size: 12px; color: var(--text-2); }
.hq-opp-what { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.hq-opp-tech { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.hq-opp-next {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.hq-opp-links { margin: 10px 0 0; display: flex; gap: 16px; font-size: 12px; font-weight: 600; }

/* --- the rail ------------------------------------------------------------ */

.hq-rail > div {
  padding: 15px 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.hq-rail h2 { margin: 0 0 10px; }

/* The warm-paper relationship panel, as the reference sets it. */
.hq-rel {
  position: relative; border-radius: var(--radius); box-shadow: var(--shadow-lift);
  background-image: linear-gradient(90deg, rgba(25, 27, 28, .14) 0 10px, transparent 10px);
}
.hq-rel-body { padding: 16px 18px 15px 24px; }
.hq-rel-tab {
  position: absolute; left: -1px; top: 20px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--accent); color: var(--accent-on);
  padding: 9px 4px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-weight: 600; letter-spacing: .14em;
}
.hq-rel-label { margin: 0 0 8px; color: var(--paper-text-2) !important; }
.hq-rel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hq-rel-name {
  margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.1; color: var(--paper-text);
}
.hq-rel-role { margin: 4px 0 0; font-size: 12.5px; color: var(--paper-text-2); }
.hq-rel-avatar {
  width: 38px; height: 38px; flex: none; border-radius: var(--radius-s);
  border: 1px solid var(--paper-line); color: var(--paper-text);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.hq-rel-field {
  margin: 0 0 8px; font-size: 13px; color: var(--paper-text);
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.hq-rel-field .t-meta { color: var(--paper-text-2) !important; min-width: 74px; }
.hq-rel-fee { display: block; width: 100%; font-size: 11.5px; color: var(--paper-text-2); }
.hq-rel-quote {
  margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--paper-text);
  font-style: italic;
}
.hq-rel-quote-by { margin: 5px 0 0; font-size: 11px; color: var(--paper-text-2); }
.hq-rel-foot { margin: 12px 0 0; font-size: 12px; }
.hq-rel-foot a { color: #8a4a2c; font-weight: 600; }
.hq-rel-foot a:hover { color: var(--accent); }

/* The experiment. Hypothesis and stop rule are quoted from the record. */
.hq-exp { border-left: 2px solid var(--accent-line) !important; }
.hq-exp-hypothesis {
  margin: 0 0 12px; font-size: 16px; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.012em; color: var(--text);
}
.hq-exp-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 12px; }
.hq-exp-facts dt { color: var(--text-3); }
.hq-exp-facts dd { margin: 0; color: var(--text-2); }
.hq-exp-label { margin: 13px 0 4px; }
.hq-exp-stop { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }

.hq-next { background: var(--accent-wash) !important; border-left: 2px solid var(--accent) !important; }
.hq-next-text {
  margin: 0; font-size: 16px; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.012em; color: var(--text);
}
.hq-next-none { color: var(--text-3); font-weight: 500; }
.hq-next-meta { margin: 7px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.hq-next-cta { margin-top: 13px; display: inline-flex; align-items: center; gap: 8px; }

.hq-research-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.hq-research-list li { padding: 5px 0; }
.hq-research-note { margin: 9px 0 0; font-size: 11px; line-height: 1.55; color: var(--text-3); }
.hq-eng-name { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.hq-eng-stage { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); }

/* The standard designs for 1440-1920. Below that the rail drops under the
   stage and the funnel wraps rather than crushing seven columns. */
@media (max-width: 1420px) {
  .hq { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "progress" "opps" "pipe" "rail"; }
  .hq-rail { flex-direction: row; flex-wrap: wrap; }
  .hq-rail > article, .hq-rail > div { flex: 1; min-width: 270px; }
}
@media (max-width: 1100px) {
  .hq-funnel { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 10px; }
  .hq-step::before { display: none; }
}
@media (max-width: 860px) {
  .hq-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-card-open { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* The commercial pipeline behind the qualified outcomes: every live case,
   navigable, so a merely-discovered one is reachable rather than invisible. */
.hq-pipeline {
  grid-area: pipe; padding: 18px 20px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.hq-pipeline h2 { margin: 0 0 12px; }
.hq-pipe-list { list-style: none; margin: 0; padding: 0; }
.hq-pipe-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 2fr) minmax(0, 1.2fr) 110px auto;
  gap: 14px; align-items: baseline;
  padding: 9px 0; font-size: 13px;
}
.hq-pipe-row + .hq-pipe-row { border-top: 1px solid var(--line); }
.hq-pipe-stage { font-size: 10.5px; letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; }
.hq-pipe-name { color: var(--text); font-weight: 500; }
.hq-pipe-buyer { font-size: 12px; color: var(--text-2); min-width: 0; }
.hq-pipe-where { font-size: 11.5px; color: var(--text-3); }
.hq-pipe-flag { font-size: 10.5px; font-weight: 600; color: var(--amber); }

/* -------------------------------------------------------- market radar -- */
/* Geographic intelligence on the obsidian canvas. Predominantly black,
   silver and graphite, per the standard's section 6: restrained illumination
   for selected areas and real activity, and deliberately not a scatter of
   coloured dots. Oxide marks only a market where an opportunity was actually
   accepted, and the selected one. */

.rdr {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) var(--rail-w);
  gap: 20px; align-items: start;
}

/* --- controls ------------------------------------------------------------ */

.rdr-controls {
  padding: 15px 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.rdr-controls h2 { margin: 0 0 7px; }
.rdr-controls-note, .rdr-scale-note {
  margin: 0 0 12px; font-size: 11px; line-height: 1.55; color: var(--text-3);
}
.rdr-scale-h { margin-top: 20px !important; padding-top: 16px; border-top: 1px solid var(--line); }

.rdr-layers { display: flex; flex-direction: column; gap: 2px; }
.rdr-layer {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px; align-items: start; padding: 8px 7px;
  border-radius: var(--radius-s); cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--t-fast) var(--ease);
}
.rdr-layer:hover { background: var(--hover-film); }
/* The two layers that assert a real opportunity are marked apart from the
   three that only report something observed. */
.rdr-layer.is-solid { border-left-color: var(--accent-line); }
.rdr-layer input { margin-top: 2px; }
.rdr-layer-label { display: block; font-size: 12.5px; color: var(--text); }
.rdr-layer-note { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.4; color: var(--text-3); }
.rdr-layer-n { font-size: 13px; font-weight: 650; color: var(--text-2); }
.rdr-apply { margin-top: 10px; width: 100%; justify-content: center; }

.rdr-scale { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.rdr-scale li {
  padding: 6px 0 6px 15px; position: relative; color: var(--text-3);
}
.rdr-scale li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.rdr-scale li.is-on { color: var(--text); }
.rdr-scale li.is-on::before { background: var(--text-2); border-color: var(--text-2); }
.rdr-scale li.is-off span { display: block; font-size: 10px; color: var(--text-disabled); }

.rdr-legend { list-style: none; margin: 0; padding: 0; font-size: 11px; color: var(--text-3); }
.rdr-legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; line-height: 1.4; }
.rdr-key { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rdr-key-solid { background: var(--accent); }
.rdr-key-open { background: transparent; border: 1px solid var(--text-3); }
.rdr-key-blocked { background: transparent; border: 1px dashed var(--red); }
.rdr-key-exact { background: var(--text-2); box-shadow: 0 0 0 2px var(--surface-3), 0 0 0 3px var(--text-3); }

/* --- the map ------------------------------------------------------------- */

.rdr-map {
  position: relative; padding: 14px;
  background:
    radial-gradient(70% 90% at 50% 45%, var(--map-sheen), transparent 72%),
    var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
/* The viewport keeps the generated map's ratio and the marker plane is the
   same box, so a marker lands on the matching coastline at any width. */
.rdr-map-viewport { position: relative; aspect-ratio: 1000 / 387.5; width: 100%; }
.rdr-world {
  position: absolute; inset: 0; background-color: var(--map-land);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-position: center; mask-position: center;
}
.rdr-plane { position: absolute; inset: 0; }

.rdr-marker {
  position: absolute; width: 0; height: 0; text-decoration: none;
  z-index: 2;
}
.rdr-marker-dot {
  position: absolute; left: 50%; top: 50%;
  width: var(--r); height: var(--r); margin: calc(var(--r) / -2) 0 0 calc(var(--r) / -2);
  border-radius: 50%;
  background: rgba(161, 167, 166, .10);
  border: 1px solid var(--text-3);
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
/* A market where an opportunity was actually accepted. The only warm marker. */
.rdr-marker.is-solid .rdr-marker-dot {
  background: rgba(181, 101, 73, .22); border-color: var(--accent);
}
.rdr-marker.is-blocked .rdr-marker-dot { border-style: dashed; border-color: var(--red); }
.rdr-marker:hover .rdr-marker-dot { background: rgba(240, 238, 233, .14); }
.rdr-marker.is-selected .rdr-marker-dot {
  background: rgba(181, 101, 73, .30); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(181, 101, 73, .14);
}
/* Labels are the dense part. Only the busiest markets keep one standing;
   everything else reveals on hover or keyboard focus, and the ranked list
   beside the map names them all regardless. */
.rdr-marker-label {
  position: absolute; left: 50%; top: calc(50% + var(--r) / 2 + 3px);
  transform: translateX(-50%);
  padding: 1px 5px; border-radius: var(--radius-s);
  background: var(--scrim);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; line-height: 1.3;
  color: var(--text-2); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t-fast) var(--ease);
}
.rdr-marker.is-labelled .rdr-marker-label { opacity: 1; }
.rdr-marker:hover, .rdr-marker:focus-visible { z-index: 5; }
.rdr-marker:hover .rdr-marker-label,
.rdr-marker:focus-visible .rdr-marker-label,
.rdr-marker.is-selected .rdr-marker-label { opacity: 1; color: var(--text); }
.rdr-marker.is-solid .rdr-marker-label { color: var(--text); }
.rdr-marker-n { display: inline; margin-left: 4px; font-size: 8.5px; color: var(--text-3); }

.rdr-map-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 380px; padding: 12px 16px; text-align: center; z-index: 3;
  background: var(--scrim); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); font-size: 12px; line-height: 1.55; color: var(--text-2);
}
.rdr-map-empty strong { color: var(--text); }

.rdr-map-foot {
  margin: 10px 0 0; font-size: 11px; line-height: 1.6; color: var(--text-3);
}
.rdr-foot-blocked { color: var(--red); }

/* --- timeline ------------------------------------------------------------ */

.rdr-time {
  margin-top: 16px; padding: 15px 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.rdr-time-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.rdr-time-head h2 { margin: 0; }
.rdr-time-note { font-size: 11px; color: var(--text-3); max-width: 80ch; line-height: 1.5; }
.rdr-bars {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 5px; align-items: end; height: 76px;
}
.rdr-bars li { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 5px; }
.rdr-bar {
  display: block; width: 100%; max-width: 26px; margin: 0 auto; min-height: 1px;
  background: var(--text-3); border-radius: 1px;
}
.rdr-bar-label { font-size: 9.5px; color: var(--text-3); text-align: center; }

/* --- the selected market panel ------------------------------------------- */

.rdr-panel {
  padding: 15px 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 0;
}
.rdr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rdr-panel-head h2 { margin: 0; }
.rdr-panel-close { font-size: 11.5px; }
.rdr-panel-name {
  margin: 8px 0 3px; font-size: 30px; font-weight: 650; letter-spacing: -0.025em;
  color: var(--text);
}
.rdr-panel-basis { margin: 0 0 14px; font-size: 10.5px; line-height: 1.5; color: var(--text-3); }

.rdr-panel-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.rdr-panel-stats dt { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.rdr-panel-stats dd {
  margin: 2px 0 0; font-size: 19px; font-weight: 650; color: var(--text);
  font-variant-numeric: tabular-nums;
}

.rdr-panel-sub {
  margin: 16px 0 7px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.rdr-more { font-size: 10px; color: var(--text-3); letter-spacing: 0; text-transform: none; }

.rdr-list { list-style: none; margin: 0; padding: 0; }
.rdr-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rdr-list-name { color: var(--text); font-weight: 500; }
.rdr-list-meta { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); line-height: 1.45; }
.rdr-list-compact li { padding: 5px 0; display: flex; justify-content: space-between; gap: 8px; }
.rdr-exact { font-size: 9.5px; color: var(--green); letter-spacing: .06em; }

.rdr-panel-note { margin: 7px 0 0; font-size: 10.5px; line-height: 1.55; color: var(--text-3); }
.rdr-panel-empty { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.rdr-panel-foot {
  margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 10.5px; line-height: 1.6; color: var(--text-3);
}

.rdr-rank { list-style: none; margin: 0; padding: 0; }
.rdr-rank li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rdr-rank-bits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rdr-bit {
  font-size: 10px; padding: 1px 6px; border-radius: var(--radius-s);
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text-3);
}
.rdr-bit.is-solid { color: var(--accent-text); border-color: var(--accent-line); }
.rdr-bit.is-quiet { color: var(--text-disabled); }
.rdr-bit.is-blocked { color: var(--red); border-color: var(--red-line); }

/* The real command, shown because there is no safe web path that starts a
   research job and a button that only looked like one would be worse. */
.rdr-survey { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.rdr-cmd {
  margin: 8px 0 0; padding: 10px 11px; overflow-x: auto;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-family: var(--mono); font-size: 10.5px; line-height: 1.55;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}

/* The standard designs for 1440-1920. Below that the controls and panel drop
   under the map rather than squeezing the cartography. */
@media (max-width: 1420px) {
  .rdr { grid-template-columns: 230px minmax(0, 1fr); }
  .rdr-panel { grid-column: 1 / -1; }
  .rdr-panel-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .rdr { grid-template-columns: minmax(0, 1fr); }
  .rdr-controls { order: 2; }
  .rdr-stage { order: 1; }
}

/* ---------------------------------------------- google connection page -- */
/* One settings page, not another dashboard: connection health, last sync and
   the controls. Everything the sync produces appears on the screens that
   already exist. */

.gl { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.gl-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.gl-lede { margin: 8px 0 0; max-width: 78ch; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.gl-state {
  flex: none; padding: 3px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-3);
}
.gl-state.is-on { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }

.gl-panel {
  padding: 16px 18px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.gl-panel h2 { margin: 0 0 12px; }
.gl-blocker {
  padding: 14px 16px; background: var(--amber-soft);
  border-left: 2px solid var(--amber); border-radius: var(--radius);
}
.gl-blocker h2 { margin: 0 0 8px; }
.gl-blocker ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.6; }

.gl-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
.gl-facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.gl-facts dd { margin: 3px 0 0; font-size: 13.5px; color: var(--text); }

.gl-scopes {
  margin: 14px 0 6px; padding: 10px 12px;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 10.5px; line-height: 1.7; color: var(--text-2);
}
.gl-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text-3); }
.gl-note code { font-size: 11px; color: var(--text-2); }
.gl-empty { margin: 0; font-size: 12.5px; color: var(--text-3); }
.gl-error { margin: 10px 0 0; font-size: 12px; color: var(--red); }
.gl-error-row { font-size: 11.5px; color: var(--red) !important; }
.gl-note-row { font-size: 11.5px; color: var(--text-3) !important; }
.gl-ok { color: var(--green); font-weight: 600; }
.gl-bad { color: var(--red); font-weight: 600; }

.gl-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.gl-sync th.n, .gl-sync td.n { text-align: right; }
.gl-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 12.5px; }
.gl-list li {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.gl-subject { color: var(--text-3); }
