/* The design tokens: the dark theme on :root, the light theme's swap. Split out of style.css (issue #159). */

/* The look (issue #267) is the keskuskuvaskanneri's (its web/style.css), so
   the two JIS tools read as one product: a dark top bar in both themes, a
   grey page, white (dark theme: slate) panels under a dark title strip, 4px
   corners and a faint shadow. Orange is the logo's colour and marks a
   panel's main button, not decoration.

   Dark is the default here (:root); html[data-theme="light"] further down
   this file swaps the light values in. The I/O and realization
   variables after the theme tokens are the single source of truth for
   swatches, badges, and hardwired bbox overlays: they match annotate.py and
   do not change with the theme. */
:root {
  /* The keskuskuvaskanneri's tokens under its own names, its dark theme. */
  --bar: #0f171f;
  --bar-text: #ffffff;
  --bar-muted: #a9b1bc;
  --bar-hover: rgba(255, 255, 255, 0.1);
  --page: #131920;
  --panel: #232d3a;
  --panel-head: #373f47;
  --panel-head-text: #ffffff;
  --text: #eef0f3;
  --muted: #9aa3ae;
  --border: #3a4350;
  --control-border: #4b5563;
  --control-bg: #1b2430;
  --control-hover: #2b3644;
  --neutral-fill: #2b3644;
  --accent: #ff8447;
  --accent-hover: #f2733a;
  --accent-ink: #19181a;
  --focus: #6aa8ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --radius: 4px;
  /* A menu, dialog or toast that floats over the page; the kanneri's
     phone-menu shadow. */
  --shadow-float: 0 6px 18px rgba(0, 0, 0, 0.5);

  /* This app's older names, pointed at the tokens above so the rules that
     use them did not need rewriting. */
  --bg: var(--page);
  --bg-elevated: var(--control-bg);
  --panel-raised: var(--control-bg);
  --panel-hover: var(--control-hover);
  --border-soft: var(--border);
  --muted-strong: var(--text);
  --accent-soft: rgba(255, 132, 71, 0.13);
  --accent-border: rgba(255, 132, 71, 0.45);
  --success: #6cc566;
  --warning: #e8b85b;
  --danger: #f7736e;
  /* Readable danger *text* tone, defined per theme: --danger itself is
     tuned as a border/accent color and both themes need a different
     lightness for text to clear WCAG AA on their own panel. */
  --danger-strong: #ff9ca4;
  /* Alert glyph, shared by both themes -- used as a mask (see
     .error-line::before), so only its shape matters, never its color. */
  --error-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v4.6'/%3E%3Cpath d='M12 16.3v.1'/%3E%3C/svg%3E");
  --shadow-sm: var(--shadow);
  --radius-sm: var(--radius);
  --header-height: 4rem;
  --di: #e6952b;
  --do: #e0453f;
  --ai: #3d7cf5;
  --ao: #2fb765;
  --unknown: #808a99;
  --ohj: #d84fd8;
  --bus: #23b8b8;
  /* Small circle containing literal TI (temperature indicator). This is a
     separate non-I/O symbol color, matching annotate.py's TI_COLOR. */
  --ti: #f25ac8;
  /* Where a tag's own printed characters were found, colored by which of
     four tiers found it -- matches annotate.py's TEXT_BBOX_COLORS palette
     so the browser review UI and the exported PDF agree. Independent of
     the DI/DO/AI/AO grid-marker colors above: a text-marker box never
     replaces or recolors the grid .bbox, it's always a second, separate
     mark near the actual device. */
  --text-plain: #19a640;
  --text-layered: #1959d9;
  --text-ocr: #8b5cf6;
  --text-vision: #d9bf00;
}

/* The light theme: the keskuskuvaskanneri's light values for the same
   tokens; the top bar, the title strip and the accent are the same in both
   themes. Where a token cannot say it -- a box set into a panel is darker
   than the panel in the dark theme but grey on the white panel in the light
   one -- the component's own file has an html[data-theme="light"] rule.
   Semantic point, OCR, TI and device colors stay the same in both. */
html[data-theme="light"] {
  color-scheme: light;
  --page: #f0f2f5;
  --panel: #ffffff;
  --text: #19181a;
  --muted: #62646f;
  --border: #d9dbde;
  --control-border: #b7bcc4;
  --control-bg: #ffffff;
  --control-hover: #f0f2f5;
  --neutral-fill: #e1e2e6;
  --focus: #1f6fd1;
  --shadow: 0 1px 3px rgba(15, 23, 31, 0.12), 0 1px 2px rgba(15, 23, 31, 0.06);
  --shadow-float: 0 6px 18px rgba(15, 23, 31, 0.25);
  /* This app's own names that have no kanneri token. */
  --accent-soft: rgba(224, 92, 34, 0.105);
  --accent-border: rgba(211, 78, 22, 0.42);
  --success: #276b2b;
  --warning: #9b6710;
  --danger: #c62828;
  /* Measured 6.2:1 against the white panel, over the 4.5:1 AA floor. */
  --danger-strong: #a63d42;
}
