/* ═══════════════════════════════════════════════════════════════════════════
   CRONY DESIGN TOKENS  —  v1.4.0
   Single source of truth for the entire Crony firmware console brand.
   Import order: tokens.css → styles.css → feature/*.css
   ═══════════════════════════════════════════════════════════════════════════ */

:root {

  /* ── Core Palette ────────────────────────────────────────────────────── */
  --bg-cream:       #FAF7F2;
  --bg-card:        #F2E6D8;
  --text-main:      #111111;
  --border-main:    #111111;
  --accent:         #2F4F3A;

  /* ── Text Opacity Scale ─────────────────────────────────────────────── */
  --text-body:      rgba(0, 0, 0, 0.78);
  --text-nav:       rgba(0, 0, 0, 0.65);
  --text-footer:    rgba(0, 0, 0, 0.60);
  --text-kicker:    rgba(0, 0, 0, 0.55);
  --text-watermark: rgba(0, 0, 0, 0.45);

  /* ── UI Element Colours ─────────────────────────────────────────────── */
  --pill-active-bg:       #111111;
  --pill-active-text:     #FAF7F2;
  --btn-primary-bg:       #111111;
  --btn-primary-text:     #FAF7F2;
  --btn-primary-hover-bg: #000000;
  --nav-pill-border:      rgba(0, 0, 0, 0.18);
  --nav-pill-bg:          rgba(255, 255, 255, 0.45);
  --divider:              rgba(0, 0, 0, 0.06);

  /* ── Crony Tag ──────────────────────────────────────────────────────── */
  --tag-text:   rgba(47, 79, 58, 0.90);
  --tag-border: rgba(47, 79, 58, 0.30);
  --tag-bg:     rgba(47, 79, 58, 0.05);

  /* ── Semantic aliases ──────────────────────────────────────────────── */
  --color-bg:             var(--bg-cream);
  --color-surface:        #FFFFFF;
  --color-surface-2:      var(--bg-card);
  --color-surface-offset: #EDE0CF;
  --color-border:         rgba(0, 0, 0, 0.12);
  --color-border-strong:  var(--border-main);
  --color-text:           var(--text-main);
  --color-text-muted:     var(--text-body);
  --color-text-faint:     var(--text-kicker);
  --color-primary:        var(--accent);
  --color-primary-hover:  #1e3528;
  --color-primary-active: #162a1e;
  --color-primary-highlight: rgba(47, 79, 58, 0.10);
  --color-primary-dim:    rgba(47, 79, 58, 0.15);
  --color-success:        #2F4F3A;
  --color-success-highlight: rgba(47, 79, 58, 0.08);
  --color-warning:        #92400e;
  --color-warning-highlight: rgba(146, 64, 14, 0.08);
  --color-error:          #9b1c1c;
  --color-error-highlight: rgba(155, 28, 28, 0.08);
  --color-danger:         #9b1c1c;
  --color-danger-hover:   #7f1d1d;

  /* ── Typography ─────────────────────────────────────────────────────── */
  --font-display: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-md:   1rem;

  /* ── Spacing ────────────────────────────────────────────────────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ── Radius ─────────────────────────────────────────────────────────── */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  /* ── Shadows ────────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(17, 17, 17, 0.06), 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-md: 0 4px 12px rgba(17, 17, 17, 0.08), 0 2px 6px rgba(17, 17, 17, 0.04);
  --shadow-lg: 0 12px 32px rgba(17, 17, 17, 0.10), 0 4px 12px rgba(17, 17, 17, 0.06);

  /* ── Transitions ────────────────────────────────────────────────────── */
  --transition-fast:        120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth:      260ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Layout ─────────────────────────────────────────────────────────── */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;
  --sidebar-width:   220px;
  --sidebar-collapsed: 0px;
  --header-height:   60px;
  --mobile-header-height: 52px;
}

[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-cream:       #13110e;
    --bg-card:        #1c1915;
    --text-main:      #e8e4dd;
    --border-main:    #e8e4dd;
    --accent:         #6aa882;
    --text-body:      rgba(232, 228, 221, 0.82);
    --text-nav:       rgba(232, 228, 221, 0.65);
    --text-footer:    rgba(232, 228, 221, 0.58);
    --text-kicker:    rgba(232, 228, 221, 0.52);
    --text-watermark: rgba(232, 228, 221, 0.38);
    --pill-active-bg:       #e8e4dd;
    --pill-active-text:     #13110e;
    --btn-primary-bg:       #e8e4dd;
    --btn-primary-text:     #13110e;
    --btn-primary-hover-bg: #ffffff;
    --nav-pill-border:      rgba(232, 228, 221, 0.16);
    --nav-pill-bg:          rgba(0, 0, 0, 0.30);
    --divider:              rgba(232, 228, 221, 0.07);
    --tag-text:   rgba(106, 168, 130, 0.92);
    --tag-border: rgba(106, 168, 130, 0.28);
    --tag-bg:     rgba(106, 168, 130, 0.07);
    --color-bg:             var(--bg-cream);
    --color-surface:        #1e1c18;
    --color-surface-2:      var(--bg-card);
    --color-surface-offset: #252219;
    --color-border:         rgba(232, 228, 221, 0.10);
    --color-border-strong:  rgba(232, 228, 221, 0.30);
    --color-text:           var(--text-main);
    --color-text-muted:     var(--text-body);
    --color-text-faint:     var(--text-kicker);
    --color-primary:        var(--accent);
    --color-primary-hover:  #87c4a0;
    --color-primary-active: #a3d4b8;
    --color-primary-highlight: rgba(106, 168, 130, 0.12);
    --color-primary-dim:    rgba(106, 168, 130, 0.18);
    --color-danger:         #f87171;
    --color-danger-hover:   #fca5a5;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
  }
}
[data-theme="dark"] {
  --bg-cream:       #13110e;
  --bg-card:        #1c1915;
  --text-main:      #e8e4dd;
  --border-main:    #e8e4dd;
  --accent:         #6aa882;
  --text-body:      rgba(232, 228, 221, 0.82);
  --text-nav:       rgba(232, 228, 221, 0.65);
  --text-footer:    rgba(232, 228, 221, 0.58);
  --text-kicker:    rgba(232, 228, 221, 0.52);
  --text-watermark: rgba(232, 228, 221, 0.38);
  --pill-active-bg:       #e8e4dd;
  --pill-active-text:     #13110e;
  --btn-primary-bg:       #e8e4dd;
  --btn-primary-text:     #13110e;
  --btn-primary-hover-bg: #ffffff;
  --nav-pill-border:      rgba(232, 228, 221, 0.16);
  --nav-pill-bg:          rgba(0, 0, 0, 0.30);
  --divider:              rgba(232, 228, 221, 0.07);
  --tag-text:   rgba(106, 168, 130, 0.92);
  --tag-border: rgba(106, 168, 130, 0.28);
  --tag-bg:     rgba(106, 168, 130, 0.07);
  --color-bg:             var(--bg-cream);
  --color-surface:        #1e1c18;
  --color-surface-2:      var(--bg-card);
  --color-surface-offset: #252219;
  --color-border:         rgba(232, 228, 221, 0.10);
  --color-border-strong:  rgba(232, 228, 221, 0.30);
  --color-text:           var(--text-main);
  --color-text-muted:     var(--text-body);
  --color-text-faint:     var(--text-kicker);
  --color-primary:        var(--accent);
  --color-primary-hover:  #87c4a0;
  --color-primary-active: #a3d4b8;
  --color-primary-highlight: rgba(106, 168, 130, 0.12);
  --color-primary-dim:    rgba(106, 168, 130, 0.18);
  --color-danger:         #f87171;
  --color-danger-hover:   #fca5a5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
}
