/* TONELAB design tokens — single source of truth for colors, type, radii, shadows and spacing.
   Custom properties inherit through shadow roots, so tl-* components read these directly.
   Values come from the Figma Make mockup (src/index.css). Name by role, never by value. */
:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --tl-bg: #090b0b;
  --tl-app-gradient: radial-gradient(circle at 55% -20%, #212822 0, #0b0e0d 36%, #080a0a 76%);
  --tl-surface-sunken: #080a09;
  --tl-surface-0: #0d100f;   /* sidebar */
  --tl-surface-1: #131615;   /* modules, panels */
  --tl-surface-2: #151817;   /* inputs, modal body */
  --tl-surface-3: #171a19;   /* buttons */
  --tl-surface-4: #191d1b;   /* titlebars, modal header */
  --tl-surface-5: #202422;   /* hover */
  --tl-surface-6: #2a2f2c;   /* active */

  /* Borders */
  --tl-border-subtle: #252928;
  --tl-border: #303532;
  --tl-border-strong: #3d433f;
  --tl-border-hover: #4d5651;

  /* Text */
  --tl-text: #f3f5f1;
  --tl-text-1: #e6eae7;
  --tl-text-2: #aab1ad;
  --tl-text-muted: #6f7773;
  --tl-text-faint: #4f5652;

  /* Accent (lime) */
  --tl-accent: #c7f65b;
  --tl-accent-hover: #d6ff76;
  --tl-on-accent: #10150d;
  --tl-accent-glow: rgba(199, 246, 91, .65);
  --tl-accent-tint: #192017;
  --tl-accent-tint-strong: #25301f;
  --tl-accent-border: #63733e;

  /* Muted accent (sage): catalogue icons and count badges */
  --tl-accent-muted: #91a675;
  --tl-accent-muted-strong: #a7bd7e;
  --tl-accent-muted-tint: #222b1d;

  /* States */
  --tl-danger: #d07a6a;
  --tl-danger-tint: #2a1d1b;
  --tl-warning: #d4b449;
  --tl-success: #73d69b;
  --tl-meter-ok: #83b94d;
  --tl-meter-warn: #d4b449;
  --tl-meter-clip: #d0674e;
  --tl-meter-gradient: linear-gradient(90deg, var(--tl-meter-ok) 0 77%, var(--tl-meter-warn) 77% 92%, var(--tl-meter-clip) 92%);

  /* Pedal faces */
  --tl-pedal-gold: linear-gradient(145deg, #d7b848, #81671c);
  --tl-pedal-blue: linear-gradient(145deg, #668cc0, #294c7c);
  --tl-pedal-violet: linear-gradient(145deg, #9c82d4, #4f3c74);
  --tl-pedal-cream: linear-gradient(145deg, #d7d2b6, #938b6d);
  --tl-pedal-black: linear-gradient(145deg, #424745, #101211);
  --tl-pedal-teal: linear-gradient(145deg, #79aaa5, #315e5b);
  --tl-pedal-pink: linear-gradient(145deg, #d883bd, #8a3f75);
  --tl-pedal-green: linear-gradient(145deg, #81bf75, #416e3e);

  /* Typography */
  --tl-font-ui: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tl-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --tl-fs-2xs: 9px;     /* mono values, versions */
  --tl-fs-xs: 10px;     /* uppercase labels, captions */
  --tl-fs-sm: 11px;     /* body, titles */
  --tl-fs-control: 12px; /* buttons, selects, segmented */
  --tl-fs-md: 13px;
  --tl-fs-lg: 19px;
  --tl-fs-xl: 25px;
  --tl-tracking-label: .12em;
  --tl-tracking-title: -.025em;

  /* Radii */
  --tl-radius-sm: 5px;
  --tl-radius-md: 8px;
  --tl-radius-lg: 10px;
  --tl-radius-xl: 13px;
  --tl-radius-pill: 999px;

  /* Shadows */
  --tl-shadow-module: 0 13px 28px rgba(0, 0, 0, .3);
  --tl-shadow-panel: 0 18px 60px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .025);
  --tl-shadow-modal: 0 35px 90px rgba(0, 0, 0, .6);
  --tl-shadow-knob: 0 4px 8px #050606, inset 0 1px rgba(255, 255, 255, .08);
  --tl-glow-accent: 0 0 18px rgba(199, 246, 91, .08);
  --tl-glow-led: 0 0 9px var(--tl-accent-glow);

  /* Spacing (4px scale) */
  --tl-space-1: 4px;
  --tl-space-2: 8px;
  --tl-space-3: 12px;
  --tl-space-4: 16px;
  --tl-space-5: 20px;
  --tl-space-6: 24px;
  --tl-space-7: 28px;
  --tl-space-8: 32px;

  /* Layout */
  --tl-sidebar-width: 286px;
  --tl-topbar-height: 72px;
  --tl-focus-ring: 0 0 0 2px var(--tl-bg), 0 0 0 4px var(--tl-accent);

  /* Waveforms: neutral for listening, accent kept for the tracks you can record on */
  --tl-wave: var(--tl-text-muted);
  --tl-wave-played: var(--tl-text-2);
}

/* Host appearance: shared semantic tokens also inherit into component shadows. */
:root { --tl-topbar-bg: rgba(12,14,14,.94); --tl-workspace-header: rgba(14,16,15,.7); --tl-clip-bg: linear-gradient(90deg,#202a1b,#192218); --tl-rack-bg: linear-gradient(145deg,rgba(26,30,28,.96),rgba(12,14,13,.98)); }
:root[data-theme="light"], :root[data-theme="warm"] {
  color-scheme: light;
  --tl-bg: #eef1f2; --tl-app-gradient: radial-gradient(ellipse at top,#fafcfc,#eef1f2 80%);
  --tl-surface-sunken: #e5eaec; --tl-surface-0: #f3f5f6; --tl-surface-1: #ffffff;
  --tl-surface-2: #f8fafb; --tl-surface-3: #edf1f3; --tl-surface-4: #e9eef0; --tl-surface-5: #dde6e9; --tl-surface-6: #cad9dd;
  --tl-border-subtle: #d5dfe2; --tl-border: #b7c5ca; --tl-border-strong: #8a9da5; --tl-border-hover: #627e89;
  --tl-text: #172b34; --tl-text-1: #243c46; --tl-text-2: #405a65; --tl-text-muted: #526b75; --tl-text-faint: #627983;
  --tl-accent: #006b66; --tl-accent-hover: #005651; --tl-on-accent: #ffffff;
  --tl-accent-glow: rgba(0,107,102,.25); --tl-accent-tint: #e1f2ed; --tl-accent-tint-strong: #cbe6de; --tl-accent-border: #58998d;
  --tl-accent-muted: #376d61; --tl-accent-muted-strong: #28594f; --tl-accent-muted-tint: #dfeee7;
  --tl-danger: #a62c34; --tl-danger-tint: #fbe5e5; --tl-warning: #805500; --tl-success: #1c714b;
  --tl-meter-ok: #347d30; --tl-meter-warn: #976900; --tl-meter-clip: #b53135;
  --tl-shadow-module: 0 8px 22px rgba(28,50,60,.09); --tl-shadow-panel: 0 12px 36px rgba(28,50,60,.08);
  --tl-shadow-modal: 0 24px 70px rgba(28,50,60,.22); --tl-glow-accent: none;
  --tl-topbar-bg: rgba(248,250,251,.96); --tl-workspace-header: rgba(248,250,251,.8);
  --tl-clip-bg: linear-gradient(90deg,#e1eee8,#edf5f1); --tl-rack-bg: linear-gradient(145deg,#f8fafb,#e7edef);
}
:root[data-theme="warm"] {
  --tl-bg: #f1ece3; --tl-app-gradient: radial-gradient(ellipse at top,#fcf8f0,#f1ece3 80%);
  --tl-surface-sunken: #e7dfd2; --tl-surface-0: #f5efe6; --tl-surface-1: #fffcf6; --tl-surface-2: #faf5ed;
  --tl-surface-3: #efe8dd; --tl-surface-4: #ece3d6; --tl-surface-5: #e2d6c7; --tl-surface-6: #d5c5b1;
  --tl-border-subtle: #ded3c2; --tl-border: #c3b49e; --tl-border-strong: #a28f74; --tl-border-hover: #887459;
  --tl-text: #30291f; --tl-text-1: #453a2c; --tl-text-2: #5b4e3d; --tl-text-muted: #6c5d49; --tl-text-faint: #786950;
  --tl-accent: #315e87; --tl-accent-hover: #25496a; --tl-accent-glow: rgba(49,94,135,.25);
  --tl-accent-tint: #e6edf2; --tl-accent-tint-strong: #d4e0ea; --tl-accent-border: #7c9bb2;
  --tl-accent-muted: #4a657d; --tl-accent-muted-strong: #324e66; --tl-accent-muted-tint: #e1e7ec;
  --tl-topbar-bg: rgba(250,245,237,.96); --tl-workspace-header: rgba(250,245,237,.8);
  --tl-clip-bg: linear-gradient(90deg,#e3e8ed,#eff2f4); --tl-rack-bg: linear-gradient(145deg,#fffcf6,#eee5d8);
}
/* Teal: dark warm-neutral surfaces with a teal accent (after the IPTVnator website palette). */
:root[data-theme="teal"] {
  --tl-bg: #0a0a08; --tl-app-gradient: radial-gradient(circle at 55% -20%, #1a2321 0, #0d0d0b 36%, #0a0a08 76%);
  --tl-surface-sunken: #080806; --tl-surface-0: #0e0e0c; --tl-surface-1: #121210; --tl-surface-2: #161613;
  --tl-surface-3: #1a1a17; --tl-surface-4: #1e1e1a; --tl-surface-5: #22221e; --tl-surface-6: #2e2e28;
  --tl-border-subtle: #22221e; --tl-border: #2e2e28; --tl-border-strong: #3a3a33; --tl-border-hover: #52524a;
  --tl-text: #f0f0eb; --tl-text-1: #d4d4cc; --tl-text-2: #b0b0a6; --tl-text-muted: #8a8a80; --tl-text-faint: #6b6b62;
  --tl-accent: #20a8a8; --tl-accent-hover: #38c4c4; --tl-on-accent: #0a0a08;
  --tl-accent-glow: rgba(32, 168, 168, .6); --tl-accent-tint: #0f1c1b; --tl-accent-tint-strong: #132c2b; --tl-accent-border: #107070;
  --tl-accent-muted: #6fa6a3; --tl-accent-muted-strong: #8ec4c1; --tl-accent-muted-tint: #152120;
  --tl-glow-accent: 0 0 18px rgba(32, 168, 168, .1);
  --tl-topbar-bg: rgba(12,12,10,.94); --tl-workspace-header: rgba(14,14,12,.7);
  --tl-clip-bg: linear-gradient(90deg,#132826,#11201f); --tl-rack-bg: linear-gradient(145deg,rgba(28,28,25,.96),rgba(12,12,10,.98));
}
