/*
 * DroneStream shared tokens + base. Linked BEFORE each page's own <style>, so pages
 * build on these variables; pages no longer define their own :root palette.
 * Direction: a command vehicle at night. Graphite chrome, one signal-blue accent,
 * colour is reserved for the map, the video/thermal overlay and status.
 * Bump ?v= in the <link> tags on change (nginx caches .css 7 days, immutable).
 */

/* IBM Plex, self-hosted (SIL OFL 1.1, fonts/OFL.txt) — no third-party font requests */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-400.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: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-ext-400.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; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-500.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: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-ext-500.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; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-600.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: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-ext-600.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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-400.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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-ext-400.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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-500.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: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-ext-500.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 {
  color-scheme: dark;

  /* Graphite ramp */
  --ds-bg-0:     #0f0f10;   /* deepest: sidebars, top bars */
  --ds-bg:       #141415;   /* page */
  --ds-surface:  #1a1a1c;   /* cards, panels */
  --ds-raised:   #232325;   /* inputs, active rows, hover */
  --ds-line:     rgba(237, 237, 237, 0.08);
  --ds-line-2:   rgba(237, 237, 237, 0.12);  /* inputs, controls: must stay visible on a tablet in daylight */
  --ds-text:     #ededed;
  --ds-text-2:   #a1a1a6;
  --ds-text-3:   #8a8a90;

  /* One accent: signal blue. Dark text on it (white would be 2.9:1). */
  --ds-accent:      #5b9cf0;
  --ds-accent-ink:  #0c1524;
  --ds-accent-soft: rgba(91, 156, 240, 0.12);
  --ds-accent-line: rgba(91, 156, 240, 0.40);

  /* Status only — toned to the ramp */
  --ds-ok:    #4cc38a;  --ds-ok-soft:   rgba(76, 195, 138, 0.12);
  --ds-warn:  #e0a23b;  --ds-warn-soft: rgba(224, 162, 59, 0.12);
  --ds-bad:   #e5484d;  --ds-bad-soft:  rgba(229, 72, 77, 0.12);

  --ds-font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ds-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ds-r-sm: 6px;   /* tags, small buttons */
  --ds-r:    8px;   /* controls, rows */
  --ds-r-lg: 12px;  /* cards */
  --ds-r-xl: 16px;  /* panels, modals */

  --ds-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ds-fast: 150ms;
  --ds-med:  200ms;

  /* Aliases for the names the pages already use */
  --bg:        var(--ds-bg);
  --surface:   var(--ds-surface);
  --surface2:  var(--ds-raised);
  --border:    var(--ds-line-2);
  --text:      var(--ds-text);
  --text-dim:  var(--ds-text-3);
  --muted:     var(--ds-text-3);
  --accent:    var(--ds-accent);
  --accent2:   var(--ds-accent);
  --success:   var(--ds-ok);
  --green:     var(--ds-ok);
  --warning:   var(--ds-warn);
  --yellow:    var(--ds-warn);
  --orange:    var(--ds-warn);
  --danger:    var(--ds-bad);
  --red:       var(--ds-bad);
  --radius:    var(--ds-r);
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-font);
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; }
b, strong { font-weight: 500; }
table { font-variant-numeric: tabular-nums; }

/* Icons (js/icons.js) */
.i {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke-width: 1.5;
  vertical-align: -3px;
  fill: none; stroke: currentColor;
}
.i-lg { width: 18px; height: 18px; vertical-align: -4px; }
.i-xl { width: 32px; height: 32px; stroke-width: 1.25; }
.ic { display: inline-flex; align-items: center; gap: 8px; }

/* Instrument readouts (the signature): mono tabular figure + small sentence-case label */
.ds-fig, .num { font-family: var(--ds-mono); font-variant-numeric: tabular-nums; }
.ds-readout-label { font-size: 12px; color: var(--ds-text-3); }

:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

::selection { background: rgba(91, 156, 240, 0.35); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Warning banners (icing, Kp storm): one line icon, drawn in CSS so the JS can keep textContent */
.icing-alert.show::before, .cl-icing-warn.show::before {
  content: ''; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Weather bar readouts */
.wx-k { color: var(--ds-text-3); margin-right: 4px; }
.weather-bar .num { color: var(--ds-text-2); }
