/* Standalone 1:1 Studio Design System — 11 Iconic Product Skins
 * Modern CSS: color-scheme, light-dark(), @supports fallbacks, closedby dialogs,
 * native popovers, field-sizing: content, prefers-reduced-motion, zero emojis.
 */

:root {
  /* Base monochrome studio tokens (Light & Dark pairs) */
  --bg-light: #f5f5f7;
  --bg-dark: #0e0e0e;
  --surface-light: #ffffff;
  --surface-dark: #141416;
  --surface-2-light: #efeff2;
  --surface-2-dark: #1b1b1f;
  --surface-3-light: #e6e6eb;
  --surface-3-dark: #222227;
  --border-light: #e2e2e8;
  --border-dark: #26262c;
  --border-strong-light: #cbcbe0;
  --border-strong-dark: #383842;
  --text-light: #0e0e11;
  --text-dark: #f4f4f5;
  --text-soft-light: #3f3f46;
  --text-soft-dark: #d4d4d8;
  --muted-light: #62626d;
  --muted-dark: #9494a0;
  --accent-light: #111114;
  --accent-dark: #fafafa;
  --accent-ink-light: #fafafa;
  --accent-ink-dark: #0e0e10;
  --focus-light: #18181b;
  --focus-dark: #e4e4e7;
  --shadow-light: 0 12px 32px rgba(14, 14, 18, 0.08);
  --shadow-dark: 0 20px 50px rgba(0, 0, 0, 0.55);

  /* Fallbacks for browsers without light-dark() */
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-2: var(--surface-2-light);
  --surface-3: var(--surface-3-light);
  --border: var(--border-light);
  --border-strong: var(--border-strong-light);
  --text: var(--text-light);
  --text-soft: var(--text-soft-light);
  --muted: var(--muted-light);
  --accent: var(--accent-light);
  --accent-ink: var(--accent-ink-light);
  --focus-ring: var(--focus-light);
  --shadow: var(--shadow-light);

  --skin-header-bg: var(--surface);
  --skin-primary-btn-bg: var(--accent);
  --skin-primary-btn-ink: var(--accent-ink);
  --skin-highlight: var(--accent);

  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-2: var(--surface-2-dark);
    --surface-3: var(--surface-3-dark);
    --border: var(--border-dark);
    --border-strong: var(--border-strong-dark);
    --text: var(--text-dark);
    --text-soft: var(--text-soft-dark);
    --muted: var(--muted-dark);
    --accent: var(--accent-dark);
    --accent-ink: var(--accent-ink-dark);
    --focus-ring: var(--focus-dark);
    --shadow: var(--shadow-dark);
  }
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-2: light-dark(var(--surface-2-light), var(--surface-2-dark));
    --surface-3: light-dark(var(--surface-3-light), var(--surface-3-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --text-soft: light-dark(var(--text-soft-light), var(--text-soft-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --accent-ink: light-dark(var(--accent-ink-light), var(--accent-ink-dark));
    --focus-ring: light-dark(var(--focus-light), var(--focus-dark));
    --shadow: light-dark(var(--shadow-light), var(--shadow-dark));
    --scrollbar-track: light-dark(#ececef, #141416);
    --scrollbar-thumb: light-dark(#b0b0ba, #3b3b44);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    accent-color: var(--skin-highlight);
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* Fallback if light-dark() is missing but manual meta override is active */
@supports not (color: light-dark(white, black)) {
  :root:has(> head > meta[name="color-scheme"][content="dark"]) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-2: var(--surface-2-dark);
    --surface-3: var(--surface-3-dark);
    --border: var(--border-dark);
    --border-strong: var(--border-strong-dark);
    --text: var(--text-dark);
    --text-soft: var(--text-soft-dark);
    --muted: var(--muted-dark);
    --accent: var(--accent-dark);
    --accent-ink: var(--accent-ink-dark);
    --focus-ring: var(--focus-dark);
    --shadow: var(--shadow-dark);
  }
  :root:has(> head > meta[name="color-scheme"][content="light"]) {
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --surface-2: var(--surface-2-light);
    --surface-3: var(--surface-3-light);
    --border: var(--border-light);
    --border-strong: var(--border-strong-light);
    --text: var(--text-light);
    --text-soft: var(--text-soft-light);
    --muted: var(--muted-light);
    --accent: var(--accent-light);
    --accent-ink: var(--accent-ink-light);
    --focus-ring: var(--focus-light);
    --shadow: var(--shadow-light);
  }
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--skin-highlight) 24%, transparent);
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.icon-md {
  width: 17px;
  height: 17px;
}

.icon-lg {
  width: 18px;
  height: 18px;
}

.brand-mark-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

.boot-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ============================================================================
   SHARED CONTROLS, BUTTONS, INPUTS, TAGS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease, transform 120ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--skin-primary-btn-bg);
  color: var(--skin-primary-btn-ink);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--skin-primary-btn-bg);
  border-color: transparent;
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.text-input,
.text-area,
.select-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.text-input {
  min-height: 40px;
  padding: 0 12px;
}

.text-area {
  padding: 10px 12px;
  min-height: 44px;
  max-height: 180px;
  resize: none;
  line-height: 1.45;
  field-sizing: content;
}

.select-input {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.text-input:focus,
.text-area:focus,
.select-input:focus {
  outline: none;
  border-color: var(--skin-highlight);
}

.text-input::placeholder,
.text-area::placeholder {
  color: var(--muted);
}

.mono-input {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.mono-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pill-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.pill-choice {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: background-color 120ms ease, color 120ms ease;
}

.pill-choice:hover {
  color: var(--text);
}

.pill-choice[aria-pressed="true"],
.pill-choice.is-active {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-strong);
}

.sample-chip {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.sample-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}

/* ============================================================================
   11 ICONIC 1:1 MEMABLE UI SKINS — THEME TOKEN MORPHING
   ============================================================================ */

/* 1. VibeDrop — VibeStack Studio (#0d0d0d matte) */
#app[data-skin="vibestack"] {
  --bg: light-dark(#f6f6f7, #0d0d0d);
  --surface: light-dark(#ffffff, #141416);
  --surface-2: light-dark(#efeff2, #1b1b1e);
  --surface-3: light-dark(#e5e5ea, #242429);
  --border: light-dark(#e2e2e7, #26262a);
  --border-strong: light-dark(#c9c9d2, #383840);
  --skin-header-bg: light-dark(#ffffff, #101012);
  --skin-primary-btn-bg: light-dark(#111113, #f4f4f5);
  --skin-primary-btn-ink: light-dark(#fafafa, #0d0d0d);
  --skin-highlight: light-dark(#18181b, #e4e4e7);
}

/* 2. ShipLog — GitHub Dark Dimmed (#010409 / #0d1117 / #161b22 / #238636) */
#app[data-skin="github"] {
  --bg: light-dark(#ffffff, #0d1117);
  --surface: light-dark(#f6f8fa, #161b22);
  --surface-2: light-dark(#eef2f6, #1c2128);
  --surface-3: light-dark(#e3e8ee, #262c36);
  --border: light-dark(#d0d7de, #30363d);
  --border-strong: light-dark(#afb8c1, #484f58);
  --text: light-dark(#1f2328, #e6edf3);
  --text-soft: light-dark(#3b434b, #c9d1d9);
  --muted: light-dark(#656d76, #8b949e);
  --skin-header-bg: light-dark(#f6f8fa, #010409);
  --skin-primary-btn-bg: light-dark(#1f883d, #238636);
  --skin-primary-btn-ink: #ffffff;
  --skin-highlight: light-dark(#0969da, #2f81f7);
  --gh-tab-underline: #f78166;
}

/* 3. LaunchCut — Pro Dark NLE / Remotion Studio (#0e0e0e / #161618) */
#app[data-skin="nle"] {
  --bg: light-dark(#f3f3f5, #0e0e0e);
  --surface: light-dark(#ffffff, #161618);
  --surface-2: light-dark(#ebebf0, #1d1d21);
  --surface-3: light-dark(#e0e0e6, #27272c);
  --border: light-dark(#dcdce2, #27272b);
  --border-strong: light-dark(#c2c2cc, #3c3c44);
  --skin-header-bg: light-dark(#ffffff, #121214);
  --skin-primary-btn-bg: light-dark(#111113, #f4f4f5);
  --skin-primary-btn-ink: light-dark(#ffffff, #0e0e0e);
  --skin-highlight: light-dark(#18181b, #e4e4e7);
}

/* 4. PRWalk — GitHub Pull Request View */
#app[data-skin="github-pr"] {
  --bg: light-dark(#ffffff, #0d1117);
  --surface: light-dark(#f6f8fa, #161b22);
  --surface-2: light-dark(#eef2f6, #1c2128);
  --surface-3: light-dark(#e3e8ee, #262c36);
  --border: light-dark(#d0d7de, #30363d);
  --border-strong: light-dark(#afb8c1, #484f58);
  --text: light-dark(#1f2328, #e6edf3);
  --text-soft: light-dark(#3b434b, #c9d1d9);
  --muted: light-dark(#656d76, #8b949e);
  --skin-header-bg: light-dark(#f6f8fa, #010409);
  --skin-primary-btn-bg: light-dark(#1f883d, #238636);
  --skin-primary-btn-ink: #ffffff;
  --skin-highlight: light-dark(#1f883d, #3fb950);
  --pr-open: #238636;
  --pr-merged: #8957e5;
}

/* 5. Chalkboard — 3Blue1Brown Slate Blackboard (#0b0e14 + subtle grid) */
#app[data-skin="blackboard"] {
  --bg: light-dark(#f2f5fa, #0b0e14);
  --surface: light-dark(#ffffff, #121722);
  --surface-2: light-dark(#e8eef7, #182030);
  --surface-3: light-dark(#dbe4f3, #202a3f);
  --border: light-dark(#d2dce9, #232c3d);
  --border-strong: light-dark(#b4c3d8, #33415c);
  --text: light-dark(#0f172a, #f1f5f9);
  --text-soft: light-dark(#334155, #cbd5e1);
  --muted: light-dark(#52627a, #94a3b8);
  --skin-header-bg: light-dark(#ffffff, #0d121b);
  --skin-primary-btn-bg: light-dark(#1e293b, #e0b462);
  --skin-primary-btn-ink: light-dark(#ffffff, #0b0e14);
  --skin-highlight: light-dark(#b45309, #e0b462);
  background-image:
    linear-gradient(color-mix(in srgb, var(--skin-highlight) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--skin-highlight) 6%, transparent) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* 6. RoastPage — Chrome DevTools / Lighthouse Audit (#1e1e1e) */
#app[data-skin="devtools"] {
  --bg: light-dark(#f3f3f3, #1e1e1e);
  --surface: light-dark(#ffffff, #252526);
  --surface-2: light-dark(#ebebeb, #2d2d30);
  --surface-3: light-dark(#dfdfdf, #38383c);
  --border: light-dark(#d4d4d4, #3c3c3c);
  --border-strong: light-dark(#b8b8b8, #525257);
  --text: light-dark(#202124, #ededed);
  --text-soft: light-dark(#3c4043, #cccccc);
  --muted: light-dark(#5f6368, #9ca3af);
  --skin-header-bg: light-dark(#f3f3f3, #252526);
  --skin-primary-btn-bg: light-dark(#c5221f, #f87171);
  --skin-primary-btn-ink: light-dark(#ffffff, #1a0c0c);
  --skin-highlight: light-dark(#1a73e8, #8ab4f8);
}

/* 7. GitWrapped — Monochrome Thermal Receipt Studio (#0a0a0a / #141414) */
#app[data-skin="receipt"] {
  --bg: light-dark(#efefe9, #0a0a0a);
  --surface: light-dark(#ffffff, #141414);
  --surface-2: light-dark(#f5f5f0, #1b1b1b);
  --surface-3: light-dark(#e9e9e2, #252525);
  --border: light-dark(#d8d8ce, #2a2a2a);
  --border-strong: light-dark(#b8b8ae, #404040);
  --text: light-dark(#111111, #fafafa);
  --text-soft: light-dark(#333333, #d4d4d4);
  --muted: light-dark(#666660, #9a9a9a);
  --skin-header-bg: light-dark(#f8f8f4, #0f0f0f);
  --skin-primary-btn-bg: light-dark(#111111, #fafafa);
  --skin-primary-btn-ink: light-dark(#ffffff, #0a0a0a);
  --skin-highlight: light-dark(#111111, #f5f5f5);
}

/* 8. ReleaseCast — Linear Changelog (#0c0c0e + subtle top illumination) */
#app[data-skin="linear"] {
  --bg: light-dark(#f9f9fb, #0c0c0e);
  --surface: light-dark(#ffffff, #131317);
  --surface-2: light-dark(#f1f1f6, #1a1a20);
  --surface-3: light-dark(#e7e7f0, #23232c);
  --border: light-dark(#e4e4ec, #24242b);
  --border-strong: light-dark(#cdcdd8, #363642);
  --text: light-dark(#111116, #f4f4f6);
  --text-soft: light-dark(#3c3c48, #d2d2dc);
  --muted: light-dark(#646474, #9494a3);
  --skin-header-bg: light-dark(rgba(255, 255, 255, 0.88), rgba(12, 12, 14, 0.88));
  --skin-primary-btn-bg: light-dark(#18181b, #f4f4f6);
  --skin-primary-btn-ink: light-dark(#ffffff, #0c0c0e);
  --skin-highlight: light-dark(#1f883d, #45b880);
  background-image: radial-gradient(ellipse 60% 22% at 50% 0%, color-mix(in srgb, var(--skin-highlight) 5%, transparent), transparent);
}

/* 9. RepoTour — VS Code / Cursor Dark Modern IDE (#181818 / #1f1f1f) */
#app[data-skin="vscode"] {
  --bg: light-dark(#f8f8f8, #181818);
  --surface: light-dark(#ffffff, #1f1f1f);
  --surface-2: light-dark(#f0f0f0, #252526);
  --surface-3: light-dark(#e4e4e4, #2d2d30);
  --border: light-dark(#e1e1e1, #2d2d2d);
  --border-strong: light-dark(#c8c8c8, #424245);
  --text: light-dark(#242424, #cccccc);
  --text-soft: light-dark(#444444, #d4d4d4);
  --muted: light-dark(#6e6e6e, #858585);
  --skin-header-bg: light-dark(#f3f3f3, #181818);
  --skin-primary-btn-bg: light-dark(#005fb8, #0078d4);
  --skin-primary-btn-ink: #ffffff;
  --skin-highlight: light-dark(#005fb8, #3794ff);
}

/* 10. TLDRReel — Vertical 9:16 Creator Reel Studio (#09090b) */
#app[data-skin="reel"] {
  --bg: light-dark(#f4f4f6, #09090b);
  --surface: light-dark(#ffffff, #131316);
  --surface-2: light-dark(#ececf0, #1b1b20);
  --surface-3: light-dark(#e0e0e7, #25252c);
  --border: light-dark(#dedee6, #27272a);
  --border-strong: light-dark(#c5c5d0, #3b3b44);
  --skin-header-bg: light-dark(#ffffff, #0e0e11);
  --skin-primary-btn-bg: light-dark(#111114, #fafafa);
  --skin-primary-btn-ink: light-dark(#fafafa, #09090b);
  --skin-highlight: light-dark(#18181b, #e4e4e7);
}

/* 11. DayRecap — Editorial Daily Standup Timeline (#0d0f13 warm charcoal / ivory daylight) */
#app[data-skin="dayrecap"],
#app[data-skin="editorial"],
#app[data-app="dayrecap"] {
  --bg: light-dark(#f7f6f2, #0d0f13);
  --surface: light-dark(#ffffff, #151820);
  --surface-2: light-dark(#efeee8, #1c202a);
  --surface-3: light-dark(#e5e3da, #252a37);
  --border: light-dark(#dfddd4, #282d3a);
  --border-strong: light-dark(#c8c5b8, #3b4254);
  --text: light-dark(#141417, #f4f5f8);
  --text-soft: light-dark(#3b3c44, #d4d7e0);
  --muted: light-dark(#62636e, #949ba9);
  --skin-header-bg: light-dark(rgba(255, 255, 255, 0.9), rgba(13, 15, 19, 0.9));
  --skin-primary-btn-bg: light-dark(#18181b, #f59e0b);
  --skin-primary-btn-ink: light-dark(#fafafa, #0d0f13);
  --skin-highlight: light-dark(#b45309, #f59e0b);
  background-image: radial-gradient(ellipse 65% 24% at 50% 0%, color-mix(in srgb, var(--skin-highlight) 6%, transparent), transparent);
}

/* ============================================================================
   WORKSPACE SHELL & SHARED SKIN CHROME
   ============================================================================ */
.ws-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
  background: var(--skin-header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.ws-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ws-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 680;
  font-size: 15px;
  letter-spacing: -0.025em;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
}

.app-brand-link:hover {
  opacity: 0.9;
}

.app-brand-name {
  white-space: nowrap;
}

#app[data-skin="vscode"] .ws-topbar {
  min-height: 44px;
}

#app[data-skin="vscode"] .ws-topbar-inner {
  max-width: none;
  padding: 6px 12px;
}

#app[data-skin="devtools"] .ws-topbar {
  min-height: 44px;
}

#app[data-skin="devtools"] .ws-topbar-inner {
  padding: 6px 14px;
}

.ws-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 620;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-breadcrumb-sep {
  color: var(--muted);
  font-weight: 400;
}

.ws-topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-panel-trigger {
  display: none;
}

/* Skin-specific sub-headers & tabs (GitHub, GitHub PR, DevTools, VS Code) */
.skin-subbar {
  background: var(--skin-header-bg);
  border-bottom: 1px solid var(--border);
}

.skin-subbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  overflow-x: auto;
}

.skin-subbar-inner > .pill-group {
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.skin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.skin-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.skin-tab:hover {
  color: var(--text);
}

.skin-tab[aria-selected="true"] {
  color: var(--text);
}

.skin-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--skin-highlight);
}

#app[data-skin="github"] .skin-tab[aria-selected="true"]::after,
#app[data-skin="github-pr"] .skin-tab[aria-selected="true"]::after {
  background: #f78166;
}

#app[data-skin="vscode"] .skin-tab {
  min-height: 36px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}

#app[data-skin="vscode"] .skin-tab[aria-selected="true"] {
  background: var(--surface);
}

#app[data-skin="vscode"] .skin-tab[aria-selected="true"]::after {
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 0;
  background: var(--skin-highlight);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
}

/* PR Status Badges */
.pr-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.pr-pill-open {
  background: #238636;
}

.pr-pill-merged {
  background: #8957e5;
}

/* Workspace Body Layouts */
.ws-body {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 16px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ws-body.has-left-sidebar {
  grid-template-columns: 248px minmax(0, 1fr);
}

.ws-body.has-right-sidebar {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.ws-body.has-ide-chrome {
  max-width: none;
  padding: 0;
  gap: 0;
  grid-template-columns: 46px 248px minmax(0, 1fr);
  min-height: calc(100dvh - 52px - 26px);
}

.ws-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sidebars */
.ws-sidebar {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-sidebar-title {
  margin: 0;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}

.sidebar-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-item.is-active {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

.sidebar-item-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* VS Code Activity Rail & Explorer */
.ide-activity-rail {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ide-rail-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.ide-rail-btn.is-active,
.ide-rail-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.ide-explorer {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ide-editor-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.ide-editor-inner {
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ide-statusbar {
  height: 26px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ide-statusbar-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Composer Card */
.composer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.composer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.composer-tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-input-wrap {
  flex: 1;
  min-width: 0;
}

.composer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.composer-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.option-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.option-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.composer-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.example-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-right: 2px;
}

/* ============================================================================
   LIVE 60FPS VIDEO PLAYER STAGE & TRANSPORT
   ============================================================================ */
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage-topbar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.stage-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.voice-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.voice-status-pill[data-state="ready"] {
  color: var(--text-soft);
  border-color: var(--border-strong);
}

.voice-status-pill[data-state="loading"] {
  color: var(--text);
}

.voice-select {
  min-height: 30px;
  max-width: 196px;
  padding: 0 24px 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  text-overflow: ellipsis;
}

.voice-select:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.stage-title {
  font-size: 13.5px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-live-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Force dark studio room inside video monitor regardless of light/dark outer theme */
.player-stage {
  color-scheme: dark;
  position: relative;
  background: #08080a;
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 320px;
}

.player-frame {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0b0d;
  border: 1px solid #26262d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.player-frame.is-vertical {
  max-width: 340px;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  border: 5px solid #26262e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.68), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#app[data-skin="reel"] .player-frame.is-vertical {
  max-width: 356px;
  border: 7px solid #222229;
  border-radius: 32px;
}

.player-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  cursor: pointer;
}

.player-overlay-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 10, 0.28);
  border: none;
  color: #fafafa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.player-overlay-play.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.player-overlay-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 14, 16, 0.88);
  color: #fafafa;
  font-size: 13.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.player-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(9, 9, 11, 0.78);
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 12.5px;
  backdrop-filter: blur(6px);
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fafafa;
  animation: cs-spin 0.75s linear infinite;
}

@keyframes cs-spin {
  to { transform: rotate(360deg); }
}

.player-transport {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transport-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scrubber {
  flex: 1;
  min-width: 80px;
  height: 6px;
  cursor: pointer;
}

.timecode {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 82px;
  text-align: right;
}

.scene-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.scene-pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scene-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.scene-pill.is-active {
  background: var(--surface-3);
  border-color: var(--skin-highlight);
  color: var(--text);
}

.narration-bar {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.narration-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  flex-shrink: 0;
}

.narration-text {
  color: var(--text-soft);
  margin: 0;
}

/* Primary Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.action-bar-spacer {
  flex: 1;
}

/* Metrics Strip */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
}

.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.metric-value {
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   SKIN-SPECIFIC SPECIAL PANELS (NLE, DEVTOOLS, RECEIPT, LINEAR, REEL, DIFF)
   ============================================================================ */

/* NLE 4-Track Timeline (LaunchCut) */
.nle-timeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nle-timeline-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.nle-tracks {
  position: relative;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nle-track-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.nle-track-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.nle-track-lane {
  position: relative;
  height: 26px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  gap: 3px;
  padding: 2px;
  overflow: hidden;
}

.nle-clip {
  height: 100%;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.nle-clip.is-active {
  background: var(--skin-primary-btn-bg);
  color: var(--skin-primary-btn-ink);
  border-color: transparent;
}

.nle-clip-muted {
  opacity: 0.72;
}

.nle-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--skin-highlight);
  pointer-events: none;
  z-index: 4;
}

/* Lighthouse Rings (RoastPage DevTools) */
.lighthouse-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.lh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.lh-ring {
  position: relative;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
}

.lh-ring svg {
  width: 62px;
  height: 62px;
  transform: rotate(-90deg);
}

.lh-ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 5;
}

.lh-ring-fg {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.lh-ring-fg.good { stroke: #3fb950; }
.lh-ring-fg.warn { stroke: #f59e0b; }
.lh-ring-fg.bad { stroke: #f87171; }

.lh-score-num {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.lh-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Thermal Receipt Preview (GitWrapped) */
.thermal-receipt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-rule {
  border: none;
  border-top: 1px dashed var(--border-strong);
  margin: 2px 0;
}

.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.receipt-row-key {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
}

.receipt-row-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.receipt-stamp {
  align-self: center;
  margin-top: 4px;
  padding: 5px 12px;
  border: 1.5px solid var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Linear Changelog Pills (ReleaseCast) */
.linear-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
}

.linear-pill-added {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.09);
}

.linear-pill-improved {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.09);
}

.linear-pill-fixed {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.09);
}

/* Beat Cards (TLDRReel & Chalkboard Chapters & NLE Inspector) */
.beat-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.beat-card {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.beat-card:hover {
  border-color: var(--border-strong);
}

.beat-card.is-active {
  border-color: var(--skin-highlight);
  background: var(--surface-3);
}

.beat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.beat-card-title {
  font-size: 13px;
  font-weight: 620;
  color: var(--text);
}

.beat-card-body {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.42;
}

/* Code / Artifact / Tab Panels */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-card-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-card-title {
  font-size: 13px;
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-card-body {
  padding: 14px;
}

.code-viewer {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0d0d10;
  color: #e4e4e7;
  color-scheme: dark;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  max-height: 460px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Data Lists (Commits, Risk Diffs, Issues, Changelog) */
.data-list {
  display: flex;
  flex-direction: column;
}

.data-row {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.data-row:last-child {
  border-bottom: none;
}

.data-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.data-row-title {
  font-size: 13.5px;
  font-weight: 580;
  color: var(--text);
  word-break: break-word;
}

.data-row-sub {
  font-size: 12px;
  color: var(--muted);
}

.diff-stat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
  display: inline-flex;
  gap: 6px;
}

.diff-add { color: #3fb950; }
.diff-del { color: #f87171; }

/* Share Mode Banner */
.share-banner {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.share-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-banner-title {
  font-size: 14px;
  font-weight: 650;
}

.share-banner-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* Inline Alert / Error State */
.notice-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notice-banner.is-error {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

/* ============================================================================
   NATIVE DIALOGS (<dialog closedby="any">) & POPOVERS ([popover="auto"])
   ============================================================================ */
.cs-dialog,
.cs-sheet {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.cs-dialog-wide {
  width: min(780px, calc(100vw - 24px));
}

.cs-dialog-agent {
  width: min(640px, calc(100vw - 24px));
}

dialog:modal {
  overscroll-behavior: contain;
}

.cs-dialog[open],
.cs-sheet[open] {
  display: flex;
  flex-direction: column;
}

.cs-dialog::backdrop,
.cs-sheet::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.cs-sheet {
  margin: auto 0 0 auto;
  width: min(360px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.dialog-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.dialog-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.dialog-body {
  padding: 16px 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-body {
  padding: 14px;
  overflow: auto;
  flex: 1;
}

.dialog-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.card-preview-stage {
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  place-items: center;
}

#card-canvas {
  max-width: 100%;
  max-height: 56vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  display: block;
}

.skill-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
}

.skill-tab {
  position: relative;
  min-height: 38px;
  padding: 0 11px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.skill-tab[aria-selected="true"] {
  color: var(--text);
}

.skill-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.skill-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skill-meta-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.share-url-row {
  display: flex;
  gap: 8px;
}

.dialog-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================================
   ZERO-FAIL AGENT LAUNCHER MODAL & SPLIT BUTTON
   ============================================================================ */
.split-btn-group {
  display: inline-flex;
  align-items: stretch;
}

.split-btn-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.split-btn-caret {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(128, 128, 128, 0.35);
  padding: 0 9px;
  min-width: 34px;
}

.agent-dialog-body {
  gap: 14px;
}

.agent-cmd-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.agent-cmd-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.agent-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.agent-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.agent-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.agent-card.is-preferred {
  border-color: var(--skin-highlight);
}

.agent-card-fallback {
  border-style: dashed;
}

.agent-card-trigger {
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  flex: 1;
}

.agent-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.agent-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.agent-card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.agent-card-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.agent-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}

.agent-mode-pills {
  display: flex;
  gap: 4px;
  padding: 0 11px 10px;
}

.agent-mode-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
}

.agent-mode-pill.is-active {
  background: var(--skin-primary-btn-bg);
  color: var(--skin-primary-btn-ink);
  border-color: transparent;
}

.agent-recovery-bar {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.agent-recovery-bar[hidden] {
  display: none;
}

.agent-recovery-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.agent-recovery-main strong {
  color: var(--text);
  font-weight: 620;
  font-size: 12.5px;
}

.agent-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.agent-drawer-summary {
  list-style: none;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.agent-drawer-summary::-webkit-details-marker {
  display: none;
}

.agent-drawer-summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  margin-left: 2px;
  flex-shrink: 0;
}

.agent-drawer[open] > .agent-drawer-summary::before {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .agent-drawer-summary::before {
    transition: transform 0.18s ease;
  }

  .agent-drawer::details-content {
    interpolate-size: allow-keywords;
    overflow: clip;
    contain: layout;
    transition: block-size 0.22s ease, content-visibility 0.22s ease;
    transition-behavior: allow-discrete;
  }

  .agent-drawer:not([open])::details-content {
    block-size: 0;
  }
}

.agent-drawer-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 6px;
  gap: 3px;
}

.agent-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-row-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.agent-row-btn:hover {
  background: var(--surface-3);
}

.agent-row-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.agent-row-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.agent-row-name {
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agent-row-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
}

.agent-row-sub {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-row-cli {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Option B: 2-Step Guided Wizard */
.wiz-choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wiz-choice {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.wiz-choice:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.wiz-choice:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--skin-highlight);
  background: var(--surface-3);
}

.wiz-choice-dash {
  border-style: dashed;
}

.wiz-choice-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wiz-choice-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wiz-choice-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.wiz-choice-top strong {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.wiz-choice-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.wiz-choice-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 140ms ease, color 140ms ease;
}

.wiz-choice:hover .wiz-choice-arrow,
.wiz-choice:focus-visible .wiz-choice-arrow {
  color: var(--text);
  transform: translateX(2px);
}

.wiz-step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wiz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.wiz-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.wiz-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.wiz-chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.wiz-chip.is-preferred:not(.is-active) {
  border-color: var(--border-strong);
}

.wiz-chip.is-active {
  background: var(--skin-primary-btn-bg);
  color: var(--skin-primary-btn-ink);
  border-color: transparent;
}

.wiz-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wiz-chip-icon .agent-icon {
  width: 14px;
  height: 14px;
}

.wiz-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiz-chip-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.wiz-chip.is-active .wiz-chip-tag {
  border-color: color-mix(in srgb, var(--skin-primary-btn-ink) 32%, transparent);
  background: color-mix(in srgb, var(--skin-primary-btn-ink) 14%, transparent);
  color: var(--skin-primary-btn-ink);
}

.wiz-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  min-width: 0;
}

.wiz-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wiz-detail-ident {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1 1 200px;
}

.wiz-detail-text {
  min-width: 0;
  flex: 1;
}

.wiz-mode-pills {
  padding: 0;
  flex-wrap: wrap;
}

.agent-mode-pill:focus-visible,
.agent-row-btn:focus-visible,
.agent-drawer-summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.wiz-detail-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.wiz-launch-btn {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 14px;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.28;
}

.wiz-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .agent-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-dialog-agent {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 20px);
  }

  .cs-dialog-agent .dialog-header {
    padding: 13px 14px;
  }

  .cs-dialog-agent .dialog-body {
    padding: 13px 14px;
    gap: 12px;
  }

  .wiz-choice {
    padding: 12px;
    gap: 10px;
    align-items: flex-start;
  }

  .wiz-choice-icon {
    width: 32px;
    height: 32px;
    margin-top: 1px;
  }

  .wiz-choice-top strong {
    font-size: 13.5px;
  }

  .wiz-choice-arrow {
    margin-top: 4px;
  }

  .wiz-chip {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .wiz-detail-card {
    padding: 12px;
  }

  .wiz-detail-actions > .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .agent-cmd-strip {
    padding: 8px 10px;
    gap: 8px;
  }
}

/* Native Popovers */
.cs-popover {
  margin: 0;
  padding: 6px;
  min-width: 224px;
  max-width: calc(100vw - 16px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  inset: auto;
}

.cs-popover:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.popover-label {
  padding: 5px 9px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-item {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 13px;
}

.popover-item:hover {
  background: var(--surface-2);
}

.popover-item-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.popover-item-title {
  font-weight: 560;
}

.popover-item-sub {
  font-size: 11px;
  color: var(--muted);
}

.popover-check {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* Toast Notifications */
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (Tablet & Mobile 390px)
   ============================================================================ */
@media (max-width: 980px) {
  .ws-body.has-left-sidebar,
  .ws-body.has-right-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .ws-body.has-left-sidebar > .ws-sidebar,
  .ws-body.has-right-sidebar > .ws-sidebar {
    display: none;
  }

  .ws-body.has-ide-chrome {
    grid-template-columns: minmax(0, 1fr);
  }

  .ide-activity-rail,
  .ide-explorer {
    display: none;
  }

  .mobile-panel-trigger {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .ws-topbar-inner {
    padding: 8px 12px;
  }

  .skin-subbar-inner {
    flex-wrap: wrap;
    padding: 0 12px;
    row-gap: 4px;
    column-gap: 10px;
    overflow-x: visible;
  }

  .skin-tabs {
    overflow-x: auto;
    max-width: 100%;
  }

  .skin-subbar-inner > .pill-group {
    flex-wrap: nowrap;
    margin-bottom: 8px;
    max-width: 100%;
    overflow-x: auto;
  }

  .skin-subbar-inner > .pill-group .pill-choice {
    min-height: 36px;
    white-space: nowrap;
  }

  .ws-body {
    padding: 12px 12px 28px;
  }

  .ide-editor-inner {
    padding: 12px 12px 24px;
  }

  .composer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .icon-btn,
  .pill-choice,
  .scene-pill,
  .sample-chip {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .player-stage {
    padding: 10px;
    min-height: 210px;
  }

  .stage-controls {
    width: 100%;
    gap: 6px;
  }

  .stage-controls .btn-sm,
  .stage-controls .voice-select {
    min-height: 38px;
  }

  .stage-controls .voice-status-pill {
    min-height: 30px;
  }

  .action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-bar-spacer {
    display: none;
  }

  .action-bar .btn-primary,
  .action-bar .split-btn-group {
    grid-column: 1 / -1;
  }

  .action-bar .split-btn-group {
    width: 100%;
  }

  .action-bar .split-btn-main {
    flex: 1;
    min-width: 0;
  }

  .stage-controls .voice-select {
    max-width: 100%;
    flex: 1 1 160px;
  }

  .share-url-row {
    flex-direction: column;
  }

  .topbar-hide-sm {
    display: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
