/* theSitrep — design tokens (ported from theSitrep 2.1, with --ph-queue addition) */

@import url('https://rsms.me/inter/inter.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* App-wide zoom. Inside the zoomed subtree 100vh paints zoom× too tall,
     so viewport-sized elements must use calc(100vh / var(--app-zoom)). */
  --app-zoom: 1.25;

  --density: 1;
  --row-h: calc(36px * var(--density));
  --pad-card: calc(16px * var(--density));

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
}

/* Dark — default */
:root, [data-theme="dark"] {
  color-scheme: dark;

  --bg: #08090a;
  --bg-elev: #0c0d0e;
  --surface: #111214;
  --surface-2: #17181b;
  --surface-3: #1d1e22;
  --surface-hover: #1a1b1e;
  --border: #1f2023;
  --border-2: #28292d;
  --border-3: #34363b;

  --text: #e6e6e6;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --text-4: #52525b;

  --accent: #7170ff;
  --accent-2: #5e6ad2;
  --accent-tint: rgba(113, 112, 255, 0.12);
  --accent-tint-2: rgba(113, 112, 255, 0.20);
  --accent-border: rgba(113, 112, 255, 0.35);

  --good: #4cb782;
  --good-2: #2f9d6a;
  --good-tint: rgba(76, 183, 130, 0.12);
  --good-border: rgba(76, 183, 130, 0.30);

  --warn: #e9b949;
  --warn-2: #d29d29;
  --warn-tint: rgba(233, 185, 73, 0.13);
  --warn-border: rgba(233, 185, 73, 0.30);

  --bad: #f06464;
  --bad-2: #db4f4f;
  --bad-tint: rgba(240, 100, 100, 0.13);
  --bad-border: rgba(240, 100, 100, 0.30);

  --info: #4ea7e0;
  --info-tint: rgba(78, 167, 224, 0.12);

  --human: #4ea7e0;
  --human-tint: rgba(78, 167, 224, 0.12);
  --human-border: rgba(78, 167, 224, 0.30);

  /* Gantt commit-dot marker */
  --commit-dot: #3fd6c6;

  /* Phase colors */
  --ph-dev: #4f7df0;
  --ph-review: #d49831;
  --ph-rework: #a766c8;
  --ph-bug: #c85547;
  --ph-deploy: #4f9558;
  /* theSitrep extension: queue / wait fill (hatched overlay color) */
  --ph-queue: rgba(255, 255, 255, 0.18);

  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 0 1px rgba(113, 112, 255, 0.35), 0 0 24px rgba(113, 112, 255, 0.15);

  --kbd-bg: #1a1b1e;
  --kbd-border: #2a2b2f;
}

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

  --bg: #fbfbfb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f7;
  --surface-3: #ededee;
  --surface-hover: #f1f1f2;
  --border: #e8e8ea;
  --border-2: #dcdcde;
  --border-3: #c8c8cb;

  --text: #18191b;
  --text-2: #4d4f55;
  --text-3: #7c7e85;
  --text-4: #a0a2a8;

  --accent: #5e6ad2;
  --accent-2: #4a55b8;
  --accent-tint: rgba(94, 106, 210, 0.10);
  --accent-tint-2: rgba(94, 106, 210, 0.18);
  --accent-border: rgba(94, 106, 210, 0.35);

  --good: #2f9d6a;
  --good-tint: rgba(47, 157, 106, 0.10);
  --good-border: rgba(47, 157, 106, 0.30);

  --warn: #b8801a;
  --warn-tint: rgba(184, 128, 26, 0.10);
  --warn-border: rgba(184, 128, 26, 0.30);

  --bad: #d1453b;
  --bad-tint: rgba(209, 69, 59, 0.10);
  --bad-border: rgba(209, 69, 59, 0.30);

  --info: #2c7ec0;
  --info-tint: rgba(44, 126, 192, 0.10);

  --human: #2c7ec0;
  --human-tint: rgba(44, 126, 192, 0.10);
  --human-border: rgba(44, 126, 192, 0.30);

  --commit-dot: #14a99a;

  --ph-dev: #4f7df0;
  --ph-review: #c98322;
  --ph-rework: #9a55b8;
  --ph-bug: #c33d31;
  --ph-deploy: #2f8d4d;
  --ph-queue: rgba(0, 0, 0, 0.20);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 0 1px rgba(94, 106, 210, 0.30), 0 0 16px rgba(94, 106, 210, 0.10);

  --kbd-bg: #f3f3f4;
  --kbd-border: #dcdcde;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

#root { min-height: calc(100vh / var(--app-zoom)); zoom: var(--app-zoom); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: padding-box; border: 2px solid transparent; }

.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-weight: 600; }
.mono-caps { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; color: var(--text-3); font-weight: 600; }

a { color: inherit; text-decoration: none; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-border);
  border-radius: 4px;
  font-family: var(--font-mono); font-weight: 600; font-size: 10px;
  color: var(--text-3);
  line-height: 1;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.tone-good { color: var(--good); border-color: var(--good-border); background: var(--good-tint); }
.pill.tone-warn { color: var(--warn); border-color: var(--warn-border); background: var(--warn-tint); }
.pill.tone-bad  { color: var(--bad);  border-color: var(--bad-border);  background: var(--bad-tint); }
.pill.tone-accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-tint); }
.pill.tone-human { color: var(--human); border-color: var(--human-border); background: var(--human-tint); }

.dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; display: inline-block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.card-flat {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 12.5px; font-weight: 500;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-3); }
.btn:active { transform: translateY(0.5px); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.icon { padding: 5px; width: 28px; height: 28px; justify-content: center; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.divider-v { width: 1px; align-self: stretch; background: var(--border); }

.focus-ring:focus-visible { outline: none; box-shadow: var(--shadow-glow); }

[data-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 12% 0%, rgba(113, 112, 255, 0.06), transparent 40%),
              radial-gradient(circle at 88% 100%, rgba(78, 167, 224, 0.04), transparent 45%);
  z-index: 0;
}

.page-fade { animation: pageFadeIn 220ms var(--ease-out); }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.spark > i { flex: 1; min-width: 3px; background: var(--border-3); border-radius: 1.5px; display: block; }
.spark > i.last { background: var(--text); }
.spark.tone-good > i.last { background: var(--good); }
.spark.tone-warn > i.last { background: var(--warn); }
.spark.tone-bad > i.last { background: var(--bad); }
.spark.tone-accent > i.last { background: var(--accent); }

[data-density="compact"] { --density: 0.88; font-size: 13px; }
[data-density="cozy"] { --density: 1.06; }
