/* =====================================================
   GIXO STUDIO - AURORA DARK (FOCUS VARIANT)
   Same foundation as Aurora Dark, quieter palette
   Folio indigo is the one accent — everything else recedes
   ===================================================== */

/* ==========================================================================
   1. CSS Variables - Studio Focus Palette
   ==========================================================================
   
   Philosophy: This is Aurora Dark with the volume turned down.
   - The primary is Folio's indigo (FOL-N8, UX deep dive 2026-10-23). It was the suite's old
     cyan, so a Folio author saw indigo on the Folio home and cyan in the studio and the
     workspace. Section 2 re-points it at Folio's product tokens; these :root values are the
     same shades, for anything drawn outside the product scope (dialogs).
   - Secondary colors become muted/desaturated
   - Backgrounds shift slightly cooler for extended reading
   - Glows are softer, less frequent
   - The result: same brand, calmer energy
   
   ========================================================================== */

:root {
  /* ─────────────────────────────────────────────────────────────────────────
     GIXO Studio Brand Colors - Folio Indigo Primary, Muted Supporting Cast
     A light indigo under the studio's dark ink: #161a2e on #818cf8 is 5.76:1, on the
     #a5b4fc hover 8.6:1, and #818cf8 as text on the studio surface 5.15:1.
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-primary: #818cf8;        /* indigo-400, Folio's --product-primary-lighten */
  --gixo-studio-primary-dark: #6366f1;   /* indigo-500, Folio's --product-primary */
  --gixo-studio-primary-light: #a5b4fc;  /* indigo-300 */
  /* Filled-button hover: moves the fill AWAY from its ink. Dark ink here, so it lightens;
     light theme's ink is near-white, so there it darkens (see the light block). */
  --gixo-studio-primary-hover: var(--gixo-studio-primary-light);
  --gixo-studio-secondary: #64748b;      /* Slate-500 — neutral, not competing */
  --gixo-studio-accent: #94a3b8;         /* Slate-400 — subtle accent */
  
  /* ─────────────────────────────────────────────────────────────────────────
     Semantic Colors - Functional, not decorative
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-success: #22c55e;        /* Green-500 — slightly muted from Aurora */
  --gixo-studio-info: #818cf8;           /* Use primary for info — unified */
  --gixo-studio-warning: #eab308;        /* Yellow-500 — functional only */
  --gixo-studio-error: #ef4444;          /* Red-500 — unchanged, safety critical */
  
  /* ─────────────────────────────────────────────────────────────────────────
     Surface Colors - Slightly deeper for focus
     Same midnight blue family, marginally darker for reduced distraction
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-background: #161a2e;     /* Slightly deeper than Aurora's #1a1f3a */
  --gixo-studio-surface: #1e2340;        /* Slightly deeper than Aurora's #242b47 */
  --gixo-studio-surface-light: #282e4a;  /* Slightly deeper than Aurora's #2d3654 */
  --gixo-studio-surface-hover: #353c5a;  /* Slightly deeper than Aurora's #3d4766 */
  
  /* ─────────────────────────────────────────────────────────────────────────
     Text Colors - Identical to Aurora (proven contrast ratios)
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-text-primary: #f8fafc;   /* slate-50 */
  --gixo-studio-text-secondary: #e2e8f0; /* slate-200 */
  --gixo-studio-text-muted: #cbd5e1;     /* slate-300 */
  --gixo-studio-text-disabled: #94a3b8;  /* slate-400 */
  
  /* ─────────────────────────────────────────────────────────────────────────
     Borders & Dividers - Softer definition
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-border: rgba(148, 163, 184, 0.18);    /* Slightly more subtle */
  --gixo-studio-border-hover: color-mix(in srgb, var(--gixo-studio-primary) 35%, transparent); /* Primary on hover */
  --gixo-studio-divider: #2d3654;                      /* Subtle divider */
  
  /* ─────────────────────────────────────────────────────────────────────────
     Glow Effects - Softer, less aggressive
     The primary, dialed back ~30%
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-glow-sm: 0 0 8px color-mix(in srgb, var(--gixo-studio-primary) 20%, transparent);
  --gixo-studio-glow-md: 0 0 16px color-mix(in srgb, var(--gixo-studio-primary) 25%, transparent);
  --gixo-studio-glow-lg: 0 0 24px color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
  
  /* ─────────────────────────────────────────────────────────────────────────
     Shadows - Identical to Aurora
     ───────────────────────────────────────────────────────────────────────── */
  --gixo-studio-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --gixo-studio-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --gixo-studio-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --gixo-studio-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --gixo-studio-shadow-color: 0 4px 16px color-mix(in srgb, var(--gixo-studio-primary) 12%, transparent);
}

/* ==========================================================================
   2. MudBlazor Palette Override - Studio Context
   ========================================================================== */

.gixo-studio {
  /* FOL-N8: the studio's accent is Folio's, read from the product scope MainLayout puts around
     every /studio page (.product-scope--folio, product-themes.css), so the Folio home, the
     wizard, the library and the workspace share one indigo. The light product scope remaps
     these tokens, so one declaration serves both themes: #818cf8 / #6366f1 dark, #4f46e5 /
     #4338ca light (#f8fafc on #4f46e5 is 6.02:1). The hover stays the :root shade for the
     theme, the one that moves the fill away from its ink. */
  --gixo-studio-primary: var(--product-primary-lighten, #818cf8);
  --gixo-studio-primary-dark: var(--product-primary, #6366f1);
  --mud-palette-primary: var(--gixo-studio-primary);
  --mud-palette-primary-darken: var(--gixo-studio-primary-dark);
  --mud-palette-primary-lighten: var(--gixo-studio-primary-light);
  /* Text on that fill takes the studio's own ink, the one its filled buttons use below.
     Re-pointing the fill alone left Folio's white under it: badges and primary tab bars
     were white on cyan, 1.70:1 (2026-09-28). --gixo-on-primary too, because primary tab
     labels read it. */
  --gixo-on-primary: var(--gixo-studio-background);
  --mud-palette-primary-text: var(--gixo-on-primary);
  --mud-palette-secondary: var(--gixo-studio-secondary);
  --mud-palette-tertiary: var(--gixo-studio-accent);
  --mud-palette-success: var(--gixo-studio-success);
  --mud-palette-info: var(--gixo-studio-info);
  --mud-palette-warning: var(--gixo-studio-warning);
  --mud-palette-error: var(--gixo-studio-error);
  --mud-palette-background: var(--gixo-studio-background);
  /* No --mud-palette-background-grey here: it was a third copy of the mistake app.css
     carried — an app-invented name one letter off MudBlazor's real
     --mud-palette-background-gray, set to the SAME value as --mud-palette-surface, so
     tonal separation inside the studio scope was 1.00:1. Studio panels use
     --gixo-surface-tonal instead. It is restated here, like the rest of this block, so
     the step is mixed from the STUDIO's ink rather than the root's — the :root
     declaration substitutes its var()s against :root, not against this scope. */
  --gixo-surface-tonal: color-mix(in srgb, var(--gixo-studio-text-primary) 10%, transparent);
  --mud-palette-surface: var(--gixo-studio-surface);
  --mud-palette-drawer-background: var(--gixo-studio-surface);
  --mud-palette-appbar-background: var(--gixo-studio-background);
  --mud-palette-text-primary: var(--gixo-studio-text-primary);
  --mud-palette-text-secondary: var(--gixo-studio-text-secondary);
  --mud-palette-text-disabled: var(--gixo-studio-text-disabled);
  --mud-palette-action-default: var(--gixo-studio-primary);
  --mud-palette-lines-default: var(--gixo-studio-border);
  --mud-palette-lines-inputs: var(--gixo-studio-border);
  --mud-palette-table-lines: var(--gixo-studio-divider);
  --mud-palette-divider: var(--gixo-studio-divider);
  --mud-palette-overlay-dark: transparent;
}

/* ==========================================================================
   3. Base Styles - Studio Context
   ========================================================================== */

.gixo-studio,
.gixo-studio body {
  background-color: var(--gixo-studio-background);
  color: var(--gixo-studio-text-primary);
}

.gixo-studio .mud-layout,
.gixo-studio .mud-main-content {
  background-color: var(--gixo-studio-background) !important;
  color: var(--gixo-studio-text-primary) !important;
}

/* ==========================================================================
   4. Component Styling - Quieter Than Aurora
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────
   App Bar - Minimal, recedes into background
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-appbar {
  background: rgba(22, 26, 46, 0.95) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--gixo-studio-border);
  box-shadow: none; /* Removed the tinted shadow */
}

/* ─────────────────────────────────────────────────────────────────────────
   Drawer - Clean, functional
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-drawer {
  background-color: var(--gixo-studio-surface) !important;
  border-right: 1px solid var(--gixo-studio-border);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

.gixo-studio .mud-drawer-header {
  background-color: var(--gixo-studio-surface) !important;
  border-bottom: 1px solid var(--gixo-studio-border);
}

/* ─────────────────────────────────────────────────────────────────────────
   Navigation - Subtle primary accents
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-nav-item {
  color: var(--gixo-studio-text-secondary) !important;
  border-radius: 6px;
  margin: 4px 8px;
  transition: all 0.2s ease;
  position: relative;
  border: 1px solid transparent;
}

.gixo-studio .mud-nav-item:hover {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 5%, transparent) !important; /* Softer than Aurora */
  color: var(--gixo-studio-text-primary) !important;
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 15%, transparent);
}

.gixo-studio .mud-nav-item.active,
.gixo-studio .mud-nav-link.active {
  background: color-mix(in srgb, var(--gixo-studio-primary) 10%, transparent) !important; /* Softer than Aurora's 0.15 */
  color: var(--gixo-studio-primary-light) !important;
  border: 1px solid color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent);
  box-shadow: none; /* Removed inset glow */
  font-weight: 600;
}

/* Active indicator - thinner, subtler glow */
.gixo-studio .mud-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px; /* Thinner than Aurora's 3px */
  height: 60%;
  background: var(--gixo-studio-primary);
  border-radius: 0 2px 2px 0;
  box-shadow: var(--gixo-studio-glow-sm);
}

/* ─────────────────────────────────────────────────────────────────────────
   Buttons - Indigo primary, neutral secondary
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-button-root {
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.gixo-studio .mud-button-filled-primary {
  background: var(--gixo-studio-primary) !important;
  color: var(--gixo-studio-background) !important;
  border: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--gixo-studio-primary) 20%, transparent); /* Softer shadow */
}

.gixo-studio .mud-button-filled-primary:hover {
  background: var(--gixo-studio-primary-hover) !important;
  transform: translateY(-1px); /* Subtler lift */
  box-shadow: 0 4px 16px color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
}

/* FOL-U3: a disabled button looks disabled. The fills here, and app.css's global filled-primary
   rule, force their background with !important and ignore :disabled, so a dead "Next" painted the
   same bright cyan as a live one. Re-pointing the tokens those fills read, on the disabled button
   itself, greys all of them with no further !important. Primary actions stay enabled and say what
   is missing on click; this covers the busy states that still disable a button. */
.gixo-studio .mud-button-filled-primary:disabled,
.gixo-studio .mud-button-filled-primary.mud-disabled,
.gixo-studio .mud-button-filled-secondary:disabled,
.gixo-studio .mud-button-filled-secondary.mud-disabled {
  --gixo-studio-primary: var(--mud-palette-action-disabled-background);
  --gixo-studio-primary-hover: var(--mud-palette-action-disabled-background);
  --gixo-studio-background: var(--mud-palette-action-disabled);
  --gixo-studio-surface-light: var(--mud-palette-action-disabled-background);
  --gixo-studio-surface-hover: var(--mud-palette-action-disabled-background);
  --gixo-studio-text-primary: var(--mud-palette-action-disabled);
  --gixo-primary: var(--mud-palette-action-disabled-background);
  --gixo-primary-hover: var(--mud-palette-action-disabled-background);
  --gixo-primary-light: var(--mud-palette-action-disabled-background);
  --gixo-on-primary: var(--mud-palette-action-disabled);
  box-shadow: none;
  transform: none;
}

/* Secondary buttons are now truly secondary — slate, not coral */
.gixo-studio .mud-button-filled-secondary {
  background: var(--gixo-studio-surface-light) !important;
  color: var(--gixo-studio-text-primary) !important;
  border: 1px solid var(--gixo-studio-border);
  box-shadow: none;
}

.gixo-studio .mud-button-filled-secondary:hover {
  background: var(--gixo-studio-surface-hover) !important;
  border-color: var(--gixo-studio-border-hover);
}

.gixo-studio .mud-button-outlined {
  border: 1px solid color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent) !important;
  color: var(--gixo-studio-primary) !important;
  background: transparent !important;
}

.gixo-studio .mud-button-outlined:hover {
  background: color-mix(in srgb, var(--gixo-studio-primary) 5%, transparent) !important;
  border-color: var(--gixo-studio-primary) !important;
}

.gixo-studio .mud-button-text {
  color: var(--gixo-studio-primary) !important;
}

.gixo-studio .mud-button-text:hover {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 5%, transparent) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Icon Buttons - Quieter hover states
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-icon-button {
  color: var(--gixo-studio-text-secondary) !important;
  transition: all 0.2s ease;
}

.gixo-studio .mud-icon-button:hover {
  color: var(--gixo-studio-primary) !important;
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 5%, transparent) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Papers & Cards - Clean, minimal borders
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-paper {
  background-color: var(--gixo-studio-surface) !important;
  border: 1px solid var(--gixo-studio-border) !important;
  color: var(--gixo-studio-text-primary) !important;
  transition: all 0.2s ease;
}

.gixo-studio .mud-paper:hover {
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 20%, transparent) !important;
  /* No box-shadow on hover — keep it quiet */
}

/* ─────────────────────────────────────────────────────────────────────────
   Forms & Inputs - Focus-friendly
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-input-root {
  color: var(--gixo-studio-text-primary) !important;
}

.gixo-studio .mud-input-root-outlined {
  background-color: rgba(255, 255, 255, 0.02) !important;
  border-radius: 6px;
}

.gixo-studio .mud-input-outlined .mud-input-root:hover .mud-input-outlined-border {
  border-color: var(--gixo-studio-border-hover) !important;
}

.gixo-studio .mud-input-outlined.mud-focused .mud-input-outlined-border {
  border-color: var(--gixo-studio-primary) !important;
  border-width: 2px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gixo-studio-primary) 8%, transparent);
}

.gixo-studio .mud-input-label {
  color: var(--gixo-studio-text-muted) !important;
}

.gixo-studio .mud-input-label.mud-focused {
  color: var(--gixo-studio-primary) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Chips & Tags - Monochromatic, primary only when needed
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-chip {
  background-color: var(--gixo-studio-surface-light) !important;
  color: var(--gixo-studio-text-primary) !important;
  border: 1px solid var(--gixo-studio-border);
  font-weight: 500;
}

.gixo-studio .mud-chip:hover {
  background-color: var(--gixo-studio-surface-hover) !important;
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
}

/* Primary chips get the primary treatment */
.gixo-studio .mud-chip-primary {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 12%, transparent) !important;
  color: var(--gixo-studio-primary-light) !important;
  border: 1px solid color-mix(in srgb, var(--gixo-studio-primary) 25%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Progress Indicators - Primary, subtle glow
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-progress-circular-svg {
  color: var(--gixo-studio-primary) !important;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent));
}

.gixo-studio .mud-progress-linear {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 8%, transparent) !important;
}

/* FOL-U6: the colour belongs on the moving bar. On .mud-progress-linear-bars (the bar's
   container, the whole track) it drew every progress bar full at 0%. */
.gixo-studio .mud-progress-linear-bar {
  background: var(--gixo-studio-primary) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Dialogs & Overlays - Focused attention
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-dialog {
  background: rgba(26, 29, 46, 0.84) !important;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.1) !important;
  color: var(--gixo-studio-text-primary) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              0 1px 0 rgba(255, 255, 255, 0.03) inset !important;
  border-radius: 14px !important;
}

.gixo-studio .mud-dialog-title {
  background: transparent !important;
  color: var(--gixo-studio-text-primary) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.gixo-studio .mud-overlay,
.gixo-studio .mud-overlay .mud-overlay-scrim,
.gixo-studio .mud-overlay .mud-overlay-scrim.mud-overlay-dark {
  background-color: transparent !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Tabs - Clean, primary indicator
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-tabs-panels {
  background-color: var(--gixo-studio-surface) !important;
}

.gixo-studio .mud-tab {
  color: var(--gixo-studio-text-secondary) !important;
}

.gixo-studio .mud-tab.mud-tab-active {
  color: var(--gixo-studio-primary) !important;
}

/* No slider rule: .gixo-studio sets --mud-palette-primary to the studio primary above,
   and that is what MudTabs's .mud-tab-slider draws. */

/* ─────────────────────────────────────────────────────────────────────────
   Tables - Clean, functional
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-table {
  background-color: var(--gixo-studio-surface) !important;
  color: var(--gixo-studio-text-primary) !important;
}

.gixo-studio .mud-table-head {
  background-color: var(--gixo-studio-surface-light) !important;
}

.gixo-studio .mud-table-cell {
  color: var(--gixo-studio-text-primary) !important;
  border-bottom: 1px solid var(--gixo-studio-divider) !important;
}

.gixo-studio .mud-table-row:hover .mud-table-cell {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 3%, transparent) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Alerts - Functional colors only
   ───────────────────────────────────────────────────────────────────────── */
.gixo-studio .mud-alert-filled-success {
  background-color: var(--gixo-studio-success) !important;
  color: white !important;
}

.gixo-studio .mud-alert-filled-error {
  background-color: var(--gixo-studio-error) !important;
  color: white !important;
}

.gixo-studio .mud-alert-filled-warning {
  background-color: var(--gixo-studio-warning) !important;
  color: var(--gixo-studio-background) !important;
}

.gixo-studio .mud-alert-filled-info {
  background-color: var(--gixo-studio-primary) !important;
  color: var(--gixo-studio-background) !important;
}

/* ==========================================================================
   5. Studio-Specific Components
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────
   Book Card - Clean, subtle hover
   ───────────────────────────────────────────────────────────────────────── */
.studio-book-card {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.studio-book-card:hover {
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 25%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--gixo-studio-shadow-md);
}

/* ─────────────────────────────────────────────────────────────────────────
   Chapter Counter - Primary accent
   ───────────────────────────────────────────────────────────────────────── */
.studio-chapter-counter {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  box-shadow: var(--gixo-studio-shadow-sm);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.studio-chapter-counter .counter-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gixo-studio-primary);
  margin: 0.5rem 0;
  text-shadow: 0 0 20px color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Writing Progress Bar - Primary only
   ───────────────────────────────────────────────────────────────────────── */
.studio-progress-bar {
  background: var(--gixo-studio-surface-light);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid var(--gixo-studio-border);
}

.studio-progress-fill {
  background: var(--gixo-studio-primary);
  border-radius: 4px;
  height: 6px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Document Outline - Minimal, functional
   ───────────────────────────────────────────────────────────────────────── */
.studio-outline-item {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 6px;
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  transition: all 0.15s ease;
}

.studio-outline-item:hover {
  background: var(--gixo-studio-surface-light);
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 20%, transparent);
}

.studio-outline-item.active {
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent);
  border-left: 3px solid var(--gixo-studio-primary);
  padding-left: calc(0.875rem - 2px);
}

.studio-outline-item.completed {
  opacity: 0.6;
}

.studio-outline-item.completed::after {
  content: '✓';
  float: right;
  color: var(--gixo-studio-success);
}

/* ─────────────────────────────────────────────────────────────────────────
   Focus Mode - Distraction-free writing
   ───────────────────────────────────────────────────────────────────────── */
.studio-focus-mode {
  background: var(--gixo-studio-background);
  min-height: 100vh;
}

.studio-focus-mode .editor-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--gixo-studio-text-primary);
}

.studio-focus-mode .editor-content:focus {
  outline: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   Metric Tiles - Clean, primary values
   ───────────────────────────────────────────────────────────────────────── */
.studio-metric-tile {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.studio-metric-tile .metric-icon {
  color: var(--gixo-studio-text-muted);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.studio-metric-tile .metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gixo-studio-primary);
  margin: 0.25rem 0;
}

.studio-metric-tile .metric-label {
  font-size: 0.75rem;
  color: var(--gixo-studio-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Export Panel - Neutral, functional
   ───────────────────────────────────────────────────────────────────────── */
.studio-export-panel {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 10px;
  padding: 1.25rem;
}

.studio-export-option {
  background: var(--gixo-studio-surface-light);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-export-option:hover {
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 25%, transparent);
}

.studio-export-option.selected {
  background: color-mix(in srgb, var(--gixo-studio-primary) 8%, transparent);
  border-color: var(--gixo-studio-primary);
}

/* ─────────────────────────────────────────────────────────────────────────
   Chapter Editor - Writing workspace
   ───────────────────────────────────────────────────────────────────────── */
.studio-chapter-editor {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 10px;
  min-height: 500px;
  padding: 1.5rem;
}

.chapter-toolbar {
  background: var(--gixo-studio-surface-light);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--gixo-studio-border);
}

.word-count-indicator {
  margin-left: auto;
  color: var(--gixo-studio-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.word-count-indicator.on-track {
  color: var(--gixo-studio-text-secondary);
}

.word-count-indicator.near-goal {
  color: var(--gixo-studio-primary);
}

.word-count-indicator.goal-reached {
  color: var(--gixo-studio-success);
}

/* ─────────────────────────────────────────────────────────────────────────
   Outline Generator - Clean cards
   ───────────────────────────────────────────────────────────────────────── */
.studio-outline-generator {
  background: var(--gixo-studio-surface);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.outline-variation {
  background: var(--gixo-studio-surface-light);
  border: 1px solid var(--gixo-studio-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.outline-variation:hover {
  border-color: color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
}

.outline-variation.selected {
  background: color-mix(in srgb, var(--gixo-studio-primary) 6%, transparent);
  border-color: var(--gixo-studio-primary);
}

/* ==========================================================================
   6. Scrollbar - Subtle, functional
   ========================================================================== */

.gixo-studio ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.gixo-studio ::-webkit-scrollbar-track {
  background: var(--gixo-studio-background);
}

.gixo-studio ::-webkit-scrollbar-thumb {
  background: var(--gixo-studio-surface-hover);
  border-radius: 4px;
}

.gixo-studio ::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--gixo-studio-primary) 40%, transparent);
}

/* Firefox */
.gixo-studio * {
  scrollbar-width: thin;
  scrollbar-color: var(--gixo-studio-surface-hover) var(--gixo-studio-background);
}

/* ==========================================================================
   7. Focus States - Primary ring
   ========================================================================== */

.gixo-studio *:focus-visible {
  outline: 2px solid var(--gixo-studio-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   8. Selection - Primary highlight
   ========================================================================== */

.gixo-studio ::selection {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
  color: var(--gixo-studio-text-primary);
}

.gixo-studio ::-moz-selection {
  background-color: color-mix(in srgb, var(--gixo-studio-primary) 30%, transparent);
  color: var(--gixo-studio-text-primary);
}

/* ==========================================================================
   10. Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
  .gixo-studio .studio-book-card {
    padding: 1.25rem;
  }
  
  .gixo-studio .studio-chapter-editor {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .gixo-studio .studio-focus-mode .editor-content {
    padding: 2rem 1rem;
    font-size: 1rem;
    line-height: 1.75;
  }
  
  .gixo-studio .studio-metric-tile {
    padding: 1rem;
  }
  
  .gixo-studio .chapter-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .gixo-studio .word-count-indicator {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Small phone optimizations */
@media (max-width: 480px) {
  .gixo-studio .studio-focus-mode .editor-content {
    padding: 1.5rem 0.75rem;
    font-size: 0.95rem;
  }

  .gixo-studio .studio-metric-tile {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .gixo-studio .chapter-toolbar {
    gap: 0.375rem;
    padding: 0.5rem;
  }

  .gixo-studio .studio-book-card {
    padding: 1rem;
  }

  .gixo-studio .studio-chapter-editor {
    padding: 1rem;
  }
}

/* ==========================================================================
   11. Print Styles
   ========================================================================== */

@media print {
  .gixo-studio {
    background: white !important;
    color: black !important;
  }
  
  .gixo-studio .mud-appbar,
  .gixo-studio .mud-drawer,
  .gixo-studio .studio-outline-item,
  .gixo-studio .studio-export-panel,
  .gixo-studio .chapter-toolbar {
    display: none !important;
  }
  
  .gixo-studio .studio-chapter-editor {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: white !important;
  }
  
  .gixo-studio .studio-focus-mode .editor-content {
    max-width: 100%;
    padding: 0;
    color: black;
  }
}

/* ==========================================================================
   End of GIXO Studio - Aurora Dark (Focus Variant)
   ========================================================================== */

/* ==========================================================================
   Light mode - Midnight Ink was dark-only; every component rule above reads
   through the --gixo-studio-* vars (many with !important), so re-pointing the
   vars here flips the whole sheet coherently. Surfaces mirror app.css's
   :root[data-theme="light"] palette; the primary is Folio's light indigo
   (FOL-N8), the same values the light product scope gives section 2.
   ========================================================================== */
:root[data-theme="light"] {
  --gixo-studio-primary: #4f46e5;        /* indigo-600 - 6.3:1 on white */
  --gixo-studio-primary-dark: #4338ca;   /* indigo-700 */
  /* Read as text (active nav, primary chips), so in light it is the darker shade: 7.9:1 on white. */
  --gixo-studio-primary-light: #4338ca;
  --gixo-studio-primary-hover: var(--gixo-studio-primary-dark); /* #f8fafc on it 7.57:1 */
  --gixo-studio-secondary: #475569;      /* slate-600 - AA on white */
  --gixo-studio-accent: #475569;
  --gixo-studio-success: #15803d;        /* green-700 */
  --gixo-studio-info: #4f46e5;           /* the primary, as in dark */
  --gixo-studio-warning: #a16207;        /* yellow-700 */
  --gixo-studio-error: #dc2626;          /* red-600 */
  --gixo-studio-background: #f8fafc;     /* slate-50 */
  --gixo-studio-surface: #ffffff;
  --gixo-studio-surface-light: #f1f5f9;  /* slate-100 */
  --gixo-studio-surface-hover: #e2e8f0;  /* slate-200 */
  --gixo-studio-text-primary: #0f172a;   /* slate-900 */
  --gixo-studio-text-secondary: #334155; /* slate-700 */
  --gixo-studio-text-muted: #475569;     /* slate-600 */
  --gixo-studio-text-disabled: #94a3b8;  /* disabled is WCAG-exempt */
  --gixo-studio-border: rgba(15, 23, 42, 0.12);
  --gixo-studio-border-hover: color-mix(in srgb, var(--gixo-studio-primary) 50%, transparent);
  --gixo-studio-divider: #e2e8f0;
  --gixo-studio-glow-sm: none;
  --gixo-studio-glow-md: none;
  --gixo-studio-glow-lg: none;
  --gixo-studio-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --gixo-studio-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --gixo-studio-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);
  --gixo-studio-shadow-xl: 0 16px 40px rgba(15, 23, 42, 0.14);
  --gixo-studio-shadow-color: 0 4px 16px color-mix(in srgb, var(--gixo-studio-primary) 15%, transparent);
}

/* UI review rest: folio (FOL-U14) — the wizard's voice tiles */
.gixo-studio .folio-tone-tiles { border: 0; padding: 0; margin: 0; min-width: 0; }
.gixo-studio .folio-tone-tiles legend { font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--folio-studio-heading); }
.gixo-studio .folio-tone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); gap: .6rem; }
.gixo-studio .folio-tone-tile { display: flex; flex-direction: column; gap: .35rem; text-align: left; padding: .8rem .9rem; border-radius: 10px; border: 1px solid var(--mud-palette-lines-default); background: var(--folio-studio-panel); color: var(--folio-studio-text); font: inherit; cursor: pointer; min-height: 44px; }
.gixo-studio .folio-tone-tile:hover { border-color: var(--folio-studio-primary); }
.gixo-studio .folio-tone-tile.selected { border: 2px solid var(--folio-studio-primary); padding: calc(.8rem - 1px) calc(.9rem - 1px); }
.gixo-studio .folio-tone-name { font-weight: 650; color: var(--folio-studio-heading); }
.gixo-studio .folio-tone-sample { font-size: .85rem; color: var(--folio-studio-muted); font-style: italic; }
.gixo-studio .folio-tone-other { margin: .5rem 0 0; font-size: .85rem; color: var(--folio-studio-muted); }
