/* Required Notice: Copyright (c) 2026 Carsten Isert AI Labs (https://carsten-isert-ai-labs.de). All rights reserved.
   Dual-licensed under the Carsten Isert AI Labs Research License (based on PolyForm Noncommercial 1.0.0, + Industrial Research Grant) and the Carsten Isert AI Labs Commercial License. See LICENSE. */

/* CAI RoboMaps design tokens, shared by the web app and the map inspector
   (docs/DEPLOYMENT_DESIGN.md §5.4): a cartographic "paper" light mode and a "night chart" dark mode.
   The theme follows the system unless the person picked one (`data-theme` on <html>, theme.js). */

:root {
  color-scheme: light;
  --paper: #f3efe4;
  --paper-raised: #faf8f2;
  --panel: #ebe5d6;
  --ink: #1e2a32;
  --ink-muted: #66695f;
  --line: #cdc4ad;
  --line-strong: #a89e86;
  --grid: rgba(30, 42, 50, 0.055);
  --contour: rgba(140, 110, 60, 0.16);
  --accent: #b8460e;        /* survey orange */
  --accent-ink: #ffffff;
  --sea: #0f6f7c;           /* chart teal */
  --ok: #2d8547;
  --warn: #b97f00;
  --crit: #b8322a;
  --info: #2c68a8;
  --idle: #8b8d86;
  --heat-0: #e9e4d4;
  --heat-1: #d7dfb0;
  --heat-2: #e9cf7a;
  --heat-3: #e7a04c;
  --heat-4: #d4652f;
  --heat-5: #a8261d;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 1px 3px rgba(60, 45, 20, 0.12);

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 20px;
  --space-5: 32px;
}

/* Night chart. Written twice: once for a chosen dark theme, once for the system's dark mode. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c1a22;
  --paper-raised: #11232d;
  --panel: #0f2029;
  --ink: #d5e4e8;
  --ink-muted: #86a1aa;
  --line: #23404c;
  --line-strong: #3a6070;
  --grid: rgba(110, 200, 220, 0.06);
  --contour: rgba(80, 200, 175, 0.10);
  --accent: #ff9a3d;
  --accent-ink: #1a0d00;
  --sea: #4fcfc2;
  --ok: #52c47a;
  --warn: #f0b429;
  --crit: #ff6b5b;
  --info: #6aaef0;
  --idle: #6c8790;
  --heat-0: #15303a;
  --heat-1: #1f5a54;
  --heat-2: #6c8a3a;
  --heat-3: #c99a2e;
  --heat-4: #ef7a35;
  --heat-5: #ff4d3d;
  --shadow: 0 1px 0 rgba(120, 220, 230, 0.05) inset, 0 2px 6px rgba(0, 0, 0, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0c1a22;
    --paper-raised: #11232d;
    --panel: #0f2029;
    --ink: #d5e4e8;
    --ink-muted: #86a1aa;
    --line: #23404c;
    --line-strong: #3a6070;
    --grid: rgba(110, 200, 220, 0.06);
    --contour: rgba(80, 200, 175, 0.10);
    --accent: #ff9a3d;
    --accent-ink: #1a0d00;
    --sea: #4fcfc2;
    --ok: #52c47a;
    --warn: #f0b429;
    --crit: #ff6b5b;
    --info: #6aaef0;
    --idle: #6c8790;
    --heat-0: #15303a;
    --heat-1: #1f5a54;
    --heat-2: #6c8a3a;
    --heat-3: #c99a2e;
    --heat-4: #ef7a35;
    --heat-5: #ff4d3d;
    --shadow: 0 1px 0 rgba(120, 220, 230, 0.05) inset, 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

.mono, code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }

/* `hidden` wins over every component's own display rule. */
[hidden] { display: none !important; }

/* The CAI RoboMaps mark (favicon.svg in the app's own colours): set --mark-bg to the colour
   behind it, which outlines the star against the plates. */
.mark .mark-floor { fill: var(--sea); fill-opacity: 0.45; }
.mark .mark-plate { fill: var(--sea); }
.mark .mark-star { fill: var(--accent); stroke: var(--mark-bg, var(--paper)); stroke-width: 2.5; stroke-linejoin: round; paint-order: stroke; }
.mark .mark-hole { fill: var(--mark-bg, var(--paper)); }
