/* Tool Manager — Polar Precision skin (light + dark).
   Local fonts only; isolated devices must not wait on CDN. */

:root {
  /* polar-precision-ui light tokens */
  --bg-base: #EAF0F3;
  --bg-soft: #F2F6F8;
  --surface-0: #EEF4F6;
  --surface-1: #F9FBFC;
  --surface-2: #EEF4F6;
  --surface-3: #DEE8EC;
  --border: rgba(28, 58, 74, 0.11);
  --border-strong: rgba(28, 58, 74, 0.20);
  --border-highlight: rgba(255, 255, 255, 0.9);
  --text-1: #10232D;
  --text-2: #687C88;
  --text-3: #9AAAB3;
  --accent: #087F88;
  --accent-2: #0FA3AD;
  --accent-rgb: 8, 127, 136;
  --accent-strong: #06666E;
  --accent-dim: rgba(8, 127, 136, 0.10);
  --teal: #087F88;
  --teal-dim: rgba(8, 127, 136, 0.10);
  --success: #0D9D72;
  --warning: #C58A1D;
  --danger: #D94754;
  --st-online: #34D399;
  --st-offline: #6B7280;
  --st-alarm: #F87171;
  --shadow-1: 0 1px 2px rgba(28, 58, 74, 0.05), 0 8px 20px -14px rgba(28, 58, 74, 0.18);
  --shadow-2: 0 12px 30px -18px rgba(28, 58, 74, 0.28), 0 2px 8px rgba(28, 58, 74, 0.05);
  --ring: 0 0 0 3px rgba(8, 127, 136, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  --sans: "Geist Variable", "Public Sans", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --glass-panel: rgba(249, 251, 252, 0.86);
  --glass-panel-strong: rgba(249, 251, 252, 0.96);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --glass-rim: rgba(28, 58, 74, 0.06);
  --rail-w: 56px;
  --topbar-h: 48px;
  --detail-w: 400px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --ctrl-h: 30px;
  --row-h: 40px;
  --icon-sm: 14px;
  --icon-md: 16px;
  --z-toast: 70;
  --action-start-bg: var(--accent);
  --action-start-fg: #ffffff;
  --action-start-bd: transparent;
  --action-cfg-bg: var(--surface-1);
  --action-cfg-fg: var(--text-1);
  --action-cfg-bd: var(--border);
  --action-doc-bg: var(--surface-1);
  --action-doc-fg: var(--text-1);
  --action-doc-bd: var(--border);
  --action-danger-bg: rgba(217, 71, 84, 0.10);
  --action-danger-fg: var(--danger);
  --action-danger-bd: transparent;
  --action-warn-bg: rgba(197, 138, 29, 0.10);
  --action-warn-fg: #A16207;
  --action-warn-bd: transparent;
  --bg: var(--bg-base);
  --sidebar-bg: var(--surface-1);
  --surface: var(--surface-1);
  --surface-muted: var(--surface-2);
  --accent-soft: var(--accent-dim);
  --online: var(--success);
  --offline: var(--danger);
  --unknown: var(--text-3);
  --danger-fg: var(--danger);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-base: #0C1418;
  --bg-soft: #101A1F;
  --surface-0: #121D22;
  --surface-1: #142026;
  --surface-2: #1B2A31;
  --surface-3: #24363E;
  --border: rgba(180, 215, 230, 0.10);
  --border-strong: rgba(180, 215, 230, 0.18);
  --border-highlight: rgba(255, 255, 255, 0.05);
  --text-1: #E8F1F5;
  --text-2: #93A8B2;
  --text-3: #647983;
  --accent: #71E3EC;
  --accent-2: #8FEAF1;
  --accent-rgb: 113, 227, 236;
  --accent-strong: #4ECCD6;
  --accent-dim: rgba(113, 227, 236, 0.14);
  --teal: #71E3EC;
  --teal-dim: rgba(113, 227, 236, 0.14);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --st-online: #34d399;
  --st-offline: #737373;
  --st-alarm: #fb7185;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -18px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 18px 40px -24px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(90, 173, 243, 0.28);
  --glass-panel: rgba(23, 23, 23, 0.9);
  --glass-panel-strong: rgba(23, 23, 23, 0.96);
  --glass-edge: rgba(255, 255, 255, 0.06);
  --glass-rim: rgba(255, 255, 255, 0.08);
  --action-start-bg: var(--accent);
  --action-start-fg: #0a0a0a;
  --action-start-bd: transparent;
  --action-cfg-bg: rgba(255, 255, 255, 0.04);
  --action-cfg-fg: var(--text-1);
  --action-cfg-bd: var(--border);
  --action-doc-bg: rgba(255, 255, 255, 0.04);
  --action-doc-fg: var(--text-1);
  --action-doc-bd: var(--border);
  --action-danger-bg: rgba(248, 113, 113, 0.16);
  --action-danger-fg: #fda4af;
  --action-danger-bd: transparent;
  --action-warn-bg: rgba(251, 191, 36, 0.14);
  --action-warn-fg: #fcd34d;
  --action-warn-bd: transparent;
  --sidebar-bg: color-mix(in srgb, var(--foreground, #fafafa) 1%, var(--surface-1));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.45 var(--sans);
  color: var(--text-1);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[data-theme="dark"] body {
  background: var(--bg-base);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
[hidden] { display: none !important; }

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