/* ═══════════════════════════════════════════════════════════════════
   WINTER CHILL — shared design tokens & base components
   Source of truth for: chart-system-builder.html, find-your-color.html
   CHANGES HERE affect both pages.
═══════════════════════════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ── */
:root {
  /* Primary - Winter Chill */
  --p-50:  #E8F7F8;
  --p-100: #B8E3E9;
  --p-200: #93B1B5;
  --p-300: #6E9DA5;
  --p-400: #4F7C82;
  --p-500: #3A6068;
  --p-600: #2A4A50;
  --p-700: #1E3A40;
  --p-800: #112E33;
  --p-900: #071820;

  /* Neutrals */
  --n-0:   #FFFFFF;
  --n-50:  #F4F6F7;
  --n-100: #E8ECED;
  --n-200: #D6DCDE;
  --n-300: #BEC6CA;
  --n-400: #A0ABB0;
  --n-500: #7D8D93;
  --n-600: #566870;
  --n-700: #374750;
  --n-800: #1F2D35;
  --n-900: #0F1A20;

  /* Semantic */
  --error:   #E03131;
  --warning: #F08C00;
  --success: #2F9E44;

  /* Typography */
  --font-sans: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Layout */
  --header-h: 52px;
}

/* ── BASE ── */
body {
  font-family: var(--font-sans);
  color: var(--n-900);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── DARK MODE TOKENS ── */
body.dark {
  --n-0:   #1a1d21;
  --n-50:  #1e2227;
  --n-100: #252a31;
  --n-200: #2e3338;
  --n-300: #3a3f47;
  --n-400: #4a5160;
  --n-500: #6e7a8a;
  --n-600: #8c96a0;
  --n-700: #adb5bd;
  --n-800: #ced4da;
  --n-900: #f1f3f5;
  /* Primary — dark mode scale */
  --p-300: #4A8898;
  --p-400: #5FAABC;
  --p-500: #80C0CC;
  --p-700: #3A7A8C;
  --p-800: #2A5E70;
}

/* ── HEADER ── */
.header {
  height: var(--header-h);
  background: var(--n-0);
  border-bottom: 1px solid var(--n-300);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 100;
  position: sticky;
  top: 0;
}
.logo {
  width: 28px; height: 28px;
  background: var(--p-800);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 12px; letter-spacing: -0.5px;
  flex-shrink: 0;
}
.app-name {
  font-family: 'nocturne-serif', serif;
  font-weight: 500; font-size: 14px;
  color: var(--n-900);
  white-space: nowrap;
}
.version-badge {
  background: var(--p-50); color: var(--p-400);
  font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 99px;
  flex-shrink: 0;
}
.header-spacer { flex: 1; }
.header-ctx-badge {
  font-size: 11px; color: var(--n-600);
  background: var(--n-100); border-radius: 6px;
  padding: 4px 10px; font-weight: 500;
  white-space: nowrap;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 32px; height: 32px;
  background: var(--n-100);
  border: 1px solid var(--n-300);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--n-700);
  transition: all 0.15s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--n-200); color: var(--n-900); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 7px 14px; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.15s;
  white-space: nowrap; text-decoration: none;
}
.btn-primary { background: var(--p-800); color: white; }
.btn-primary:hover { background: var(--p-700); }
.btn-secondary {
  background: var(--n-0); color: var(--p-400);
  border: 1.5px solid var(--p-400);
}
.btn-secondary:hover { background: var(--p-50); }
.btn-ghost {
  background: var(--n-100); color: var(--n-700);
  border: 1px solid var(--n-300);
}
.btn-ghost:hover { background: var(--n-200); }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 2px; }
