/**
 * PromptForge - Modern Design System & Stylesheet
 * Handcrafted Vanilla CSS with CSS Custom Properties, Glassmorphism, and Micro-interactions
 */

/* Local-first fonts: no external font requests or third-party dependencies. */

:root {
  /* Color Palette - Obsidian Dark Theme (WCAG AAA Contrast Validated) */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(18, 26, 44, 0.75);
  --bg-card-hover: rgba(28, 38, 64, 0.85);
  --bg-input: #0b1120;
  --bg-glass: rgba(15, 23, 42, 0.65);

  --border-color: rgba(255, 255, 255, 0.12);
  --border-focus: #38bdf8;
  --border-glow: rgba(56, 189, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0284c7 100%);
  --accent-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --badge-bg: rgba(99, 102, 241, 0.2);
  --badge-text: #c7d2fe;
  --badge-border: rgba(99, 102, 241, 0.4);

  --danger-color: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.2);
  --success-color: #34d399;
  --success-bg: rgba(16, 185, 129, 0.2);

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Override (WCAG AAA Contrast Validated) */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --border-color: rgba(0, 0, 0, 0.12);
  --border-focus: #1d4ed8;
  --border-glow: rgba(29, 78, 216, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #334155;
  --text-accent: #0369a1;

  --accent-primary: #3730a3;
  --accent-primary-hover: #312e81;
  --accent-glow: 0 0 20px rgba(55, 48, 163, 0.2);

  --badge-bg: rgba(55, 48, 163, 0.12);
  --badge-text: #312e81;
  --badge-border: rgba(55, 48, 163, 0.3);

  --danger-color: #b91c1c;
  --danger-bg: rgba(185, 28, 28, 0.12);
  --success-color: #047857;
  --success-bg: rgba(4, 120, 87, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* Universal Accessible Focus Rings (WCAG 2.4.7 / 2.4.11 / 2.4.12 AAA) */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

/* Skip to content link (WCAG 2.4.1 AAA) */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-accent);
  border: 2px solid var(--border-focus);
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

/* Touch Target Size AAA (WCAG 2.5.5 / 2.5.8) */
@media (pointer: coarse) {
  button, 
  .btn, 
  .nav-tab-btn, 
  .chip-btn, 
  .power-btn, 
  .quick-goal-btn, 
  .theme-toggle-btn, 
  .iqc-chip,
  .cheatcode-cat-pill,
  .interview-cat-pill,
  .form-select, 
  .form-input {
    min-height: 44px;
  }
}

/* Reduced Motion AAA (WCAG 2.3.3) */
@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;
  }
}

/* Responsive Form Grids */
.grid-responsive-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.grid-responsive-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 580px) {
  .grid-responsive-3,
  .grid-responsive-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Visually Hidden Helper for Screen Readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Base Reset & Core Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

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

/* Header & Top Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--accent-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  margin-left: 0.35rem;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.25rem;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.header-action-pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.header-action-pill.learn-pill {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.header-action-pill.admin-pill {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* Welcome Hero Section */
.welcome-hero {
  max-width: 1600px;
  width: calc(100% - 3rem);
  margin: 1.5rem auto 0;
  padding: 1.75rem 2.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(24, 34, 56, 0.75) 0%, rgba(13, 20, 36, 0.9) 100%);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

[data-theme="light"] .welcome-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.welcome-copy {
  max-width: 680px;
  position: relative;
  z-index: 2;
}

.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #818cf8;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.welcome-spark {
  color: #38bdf8;
}

.welcome-separator {
  opacity: 0.4;
  margin: 0 2px;
}

.welcome-copy h2 {
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
  color: #f8fafc;
}

[data-theme="light"] .welcome-copy h2 {
  color: #0f172a;
}

.welcome-copy h2 span {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-copy p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.15rem;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.welcome-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.welcome-actions .btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.welcome-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.welcome-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

[data-theme="light"] .welcome-actions .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
}

.welcome-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.welcome-stats {
  display: flex;
  gap: 1rem;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.welcome-stat {
  display: flex;
  flex-direction: column;
  background: rgba(11, 17, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  min-width: 125px;
}

[data-theme="light"] .welcome-stat {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

.welcome-stat strong {
  font-size: 1.45rem;
  font-weight: 850;
  color: #f8fafc;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

[data-theme="light"] .welcome-stat strong {
  color: #0f172a;
}

.welcome-stat span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  margin-top: 3px;
}

.welcome-orbit {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.welcome-orbit-one {
  width: 380px;
  height: 380px;
  right: -80px;
  top: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

.welcome-orbit-two {
  width: 220px;
  height: 220px;
  right: 180px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
}

@media (max-width: 960px) {
  .welcome-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.5rem;
    width: calc(100% - 2rem);
  }
  .welcome-stats {
    width: 100%;
    flex-wrap: wrap;
  }
  .welcome-stat {
    flex: 1;
    min-width: 100px;
  }
}

/* Studio Mode Switcher Toolbar */
.studio-mode-bar {
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 6px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.mode-tabs-track {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-tabs-track::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .nav-tab-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.tab-icon {
  font-size: 14px;
}

/* App Main Layout: Two Columns */
.app-main {
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
}

.builder-column {
  flex: 1.15;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.preview-column {
  flex: 0.95;
  min-width: 0;
  position: sticky;
  top: 66px;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.preview-column.collapsed-on-catalog {
  display: none;
}

/* Panels & Cards (Glassmorphism) */
.glass-panel {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.tab-view-panel {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-view-panel.active {
  display: flex;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control, .form-textarea, .form-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-textarea-tall {
  min-height: 120px;
}

/* Chip Buttons & Quick Pickers */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip-btn.active {
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border-color: var(--badge-border);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

/* Dynamic Variable Section */
.dynamic-vars-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.vars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.variable-item-pill {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.var-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-accent);
}

.variable-input-field {
  background-color: var(--bg-input);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.variable-input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--border-glow);
}

/* Power Enhancements Bar */
.power-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.power-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.power-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.power-btn:hover {
  color: #fff;
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Live Preview Column */
.preview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.85rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Stats Pill Bar */
.stats-badge-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-pill {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.stat-val {
  color: var(--text-primary);
  font-weight: 700;
}

/* Output Textarea */
.preview-output-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.output-textarea {
  flex: 1;
  width: 100%;
  background: var(--bg-input);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  resize: none;
  white-space: pre-wrap;
  tab-size: 2;
}

.output-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.preview-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.action-group-left, .action-group-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Template Library Grid */
.library-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.library-search-bar {
  display: flex;
  gap: 0.75rem;
}

.category-nav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-chip:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.category-chip.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
}

.fav-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.fav-btn:hover, .fav-btn.active {
  color: #fbbf24;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* History & Saved Presets */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.saved-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.saved-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.saved-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saved-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.saved-snippet {
  background: var(--bg-input);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  max-height: 80px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Slider Controls */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.range-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  height: 6px;
  background: var(--bg-input);
  border-radius: 999px;
  cursor: pointer;
}

/* Toast Notification */
#pf-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: #1e1b4b;
  color: #e0e7ff;
  border: 1px solid #6366f1;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#pf-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-glass);
  backdrop-filter: blur(8px);
}

.footer-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- 10M+ MATRIX ENGINE STYLES --- */
.matrix-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
  100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
}

.matrix-seed-card {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(180deg, rgba(18, 26, 44, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.seed-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.seed-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.75rem;
  flex: 1;
  min-width: 220px;
  transition: var(--transition-fast);
}

.seed-input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--border-glow);
}

.seed-prefix {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-right: 0.5rem;
  user-select: none;
}

.seed-input-wrapper input {
  border: none;
  background: transparent;
  padding: 0.65rem 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  width: 100%;
}

.seed-input-wrapper input:focus {
  outline: none;
}

.matrix-toggle-row {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.toggle-switch-label {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  position: relative;
  transition: var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-checkbox:checked + .toggle-switch {
  background: var(--accent-gradient);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toggle-text strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toggle-text small {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.matrix-batch-card {
  border-color: rgba(6, 182, 212, 0.3);
}

.batch-export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.batch-count-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label-inline {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.batch-select {
  width: auto;
  min-width: 170px;
}

.shared-hosting-notice {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.4);
}

/* --- WORKFLOW TOGGLE (SIMPLE VS ADVANCED) --- */
.workflow-toggle-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2px;
  gap: 2px;
}

.workflow-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition-fast);
}

.workflow-toggle-btn:hover {
  color: var(--text-primary);
}

.workflow-toggle-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

/* --- QUICK-START GOALS BAR --- */
.quick-goals-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.25rem 0.25rem;
  scrollbar-width: thin;
}

.quick-goals-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-accent);
  white-space: nowrap;
}

.quick-goal-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-xl);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-goal-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* --- PROMPT QUALITY METER --- */
.prompt-quality-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
}

.quality-label-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quality-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.quality-score-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
}

.quality-meter-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.quality-meter-fill {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
  transition: width 0.35s ease, background 0.35s ease;
}

/* --- ACADEMY MASTERCLASS STYLES --- */
.academy-nav-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 0.25rem;
}

.academy-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.academy-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.academy-chip.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.academy-section {
  display: none;
}

.academy-section.active {
  display: block;
}

.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.anatomy-card {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.anatomy-number {
  width: 32px;
  height: 32px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.anatomy-content h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.anatomy-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.anatomy-example {
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  color: var(--text-accent) !important;
  font-size: 0.82rem !important;
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.model-guide-card {
  padding: 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.claude-card { border-left: 4px solid #a855f7; }
.openai-card { border-left: 4px solid #10b981; }
.gemini-card { border-left: 4px solid #38bdf8; }
.deepseek-card { border-left: 4px solid #ef4444; }

.model-guide-header {
  margin-bottom: 0.75rem;
}

.model-badge {
  font-size: 0.9rem;
  font-weight: 700;
}

.claude-badge { color: #c084fc; }
.openai-badge { color: #34d399; }
.gemini-badge { color: #38bdf8; }
.deepseek-badge { color: #f87171; }

.model-guide-body h5 {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.model-guide-body ul {
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.model-guide-body li {
  margin-bottom: 0.5rem;
}

/* Patterns List */
.patterns-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pattern-item {
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.pattern-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.pattern-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pattern-header h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.pattern-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-left: 2.25rem;
}

/* Comparison Cards */
.comparison-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.comparison-header h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.prompt-box {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--radius-sm);
  gap: 0.65rem;
}

.amateur-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.master-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.prompt-box-tag {
  font-size: 0.82rem;
  font-weight: 700;
}

.amateur-box .prompt-box-tag { color: #f87171; }
.master-box .prompt-box-tag { color: #34d399; }

.prompt-box code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  color: var(--text-primary);
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
}

.prompt-box-analysis {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Linter Checklist */
.linter-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.linter-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.linter-item:hover {
  border-color: var(--border-focus);
}

.linter-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.linter-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.linter-checkbox:checked + .linter-box {
  background: #10b981;
  border-color: #10b981;
}

.linter-checkbox:checked + .linter-box::after {
  content: '✓';
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.linter-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.linter-text strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.linter-text small {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.linter-score-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
}

.linter-score-number {
  font-size: 2.25rem;
  font-weight: 900;
  color: #34d399;
  font-family: var(--font-display);
}

.linter-score-status h4 {
  font-size: 1rem;
  color: #10b981;
  margin-bottom: 0.25rem;
}

.linter-score-status p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .app-main {
    flex-direction: column;
  }
  .preview-column {
    position: static;
    height: 500px;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }
  .header-container {
    flex-wrap: wrap;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
  .preview-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .action-group-left, .action-group-right {
    justify-content: space-between;
  }
}


/* PromptForge 2.0 visual refresh: sharper hierarchy, vivid but restrained accents, responsive surfaces. */
:root {
  --accent-primary: #8b5cf6;
  --accent-primary-hover: #7c3aed;
  --accent-gradient: linear-gradient(120deg, #8b5cf6 0%, #ec4899 48%, #06b6d4 100%);
  --border-color: rgba(148, 163, 184, .16);
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
}
body {
  background-image: radial-gradient(ellipse at 10% 0%, rgba(139,92,246,.19), transparent 36%),
                    radial-gradient(ellipse at 92% 8%, rgba(6,182,212,.13), transparent 32%),
                    linear-gradient(180deg, rgba(15,23,42,.12), transparent 45%);
}
.app-header { border-bottom-color: rgba(139,92,246,.24); box-shadow: 0 10px 36px rgba(0,0,0,.14); }
.brand-logo-icon { border-radius: 14px; box-shadow: 0 8px 24px rgba(139,92,246,.34); }
.brand-badge { border: 1px solid rgba(236,72,153,.25); background: rgba(236,72,153,.12); color: #f0abfc; }
.nav-tab-btn { border-radius: 11px; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.nav-tab-btn:hover { transform: translateY(-1px); }
.nav-tab-btn.active { background: linear-gradient(135deg, rgba(139,92,246,.23), rgba(6,182,212,.12)); border-color: rgba(167,139,250,.42); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.card, .panel-card, .matrix-seed-card, .matrix-batch-card, .matrix-topic-card {
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: 0 14px 42px rgba(0,0,0,.14); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: rgba(139,92,246,.28); }
.card-header h3, .panel-header-title h2 { letter-spacing: -.025em; }
.panel-header { align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.panel-header-title h2 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); line-height: 1.15; }
.panel-header-title p { max-width: 70ch; color: var(--text-secondary); }
.matrix-stat-pill { background: linear-gradient(120deg, rgba(139,92,246,.17), rgba(6,182,212,.12)); border: 1px solid rgba(139,92,246,.32); border-radius: 999px; padding: .6rem .9rem; font-size: .82rem; font-weight: 700; }
.matrix-seed-card { background: linear-gradient(125deg, rgba(139,92,246,.12), rgba(15,23,42,.72) 56%, rgba(6,182,212,.08)); }
.form-input:focus, .form-select:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(139,92,246,.15); outline: none; }
.btn-primary { background: var(--accent-gradient); background-size: 180% 180%; border: 0; box-shadow: 0 8px 22px rgba(139,92,246,.2); transition: background-position .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn-primary:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 11px 28px rgba(139,92,246,.3); }
.quick-goal-btn { border-radius: 999px; border: 1px solid var(--border-color); transition: all .18s ease; }
.quick-goal-btn:hover { border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.12); transform: translateY(-1px); }
.field-hint { max-width: 78ch; }
input, select, textarea { min-width: 0; }
.matrix-toggle-row { border: 1px solid var(--border-color); border-radius: 14px; padding: 1rem; background: rgba(148,163,184,.04); }
.app-footer { border-top: 1px solid var(--border-color); }
[data-theme="light"] body { background-image: radial-gradient(ellipse at 10% 0%, rgba(139,92,246,.10), transparent 36%), radial-gradient(ellipse at 92% 8%, rgba(6,182,212,.09), transparent 32%); }
[data-theme="light"] .matrix-seed-card { background: linear-gradient(125deg, rgba(139,92,246,.08), rgba(255,255,255,.94) 56%, rgba(6,182,212,.06)); }
[data-theme="light"] .brand-badge { color: #7e22ce; }
@media (max-width: 760px) {
  .app-header { padding: .65rem .8rem; }
  .header-container { align-items: flex-start; flex-wrap: wrap; gap: .8rem; }
  .brand-text h1 { font-size: 1.05rem; }
  .brand-subtitle { display: none; }
  .nav-tabs { width: 100%; order: 3; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; scrollbar-width: thin; }
  .nav-tab-btn { flex: 0 0 auto; white-space: nowrap; }
  .header-actions { margin-left: auto; }
  .panel-header-title h2 { font-size: 1.55rem; }
  .seed-input-group, .batch-export-row { align-items: stretch; flex-direction: column; }
  .seed-input-wrapper { width: 100%; }
  .seed-input-group .btn, .batch-export-row .btn { width: 100%; justify-content: center; }
  .matrix-stat-pill { max-width: 100%; overflow-wrap: anywhere; border-radius: 12px; }
  .grid.grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Welcome / landing hero */
.welcome-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: center;
  max-width: 1600px; width: calc(100% - 3rem); margin: 1.5rem auto 1.25rem;
  padding: clamp(1.5rem, 4vw, 3.25rem); border-radius: 28px;
  border: 1px solid rgba(167,139,250,.28);
  background: linear-gradient(118deg, rgba(91,33,182,.28), rgba(15,23,42,.9) 54%, rgba(8,145,178,.17));
  box-shadow: 0 24px 70px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.06);
}
.welcome-copy, .welcome-stats { position: relative; z-index: 2; }
.welcome-eyebrow { display:flex; align-items:center; gap:.55rem; color:#c4b5fd; font-size:.72rem; font-weight:800; letter-spacing:.16em; }
.welcome-spark { display:inline-grid; place-items:center; width:1.55rem; height:1.55rem; border-radius:.5rem; color:white; background:var(--accent-gradient); letter-spacing:0; }
.welcome-separator { color:var(--text-muted); }
.welcome-hero h2 { max-width: 760px; margin:1.1rem 0 .85rem; font-family:var(--font-display); font-size:clamp(2rem,4.2vw,3.65rem); line-height:1.04; letter-spacing:-.055em; }
.welcome-hero h2 span { background:var(--accent-gradient); -webkit-background-clip:text; background-clip:text; color:transparent; }
.welcome-hero p { max-width: 68ch; color:var(--text-secondary); font-size:clamp(.95rem,1.2vw,1.08rem); }
.welcome-actions { display:flex; flex-wrap:wrap; gap:.7rem; margin-top:1.45rem; }
.welcome-actions .btn { display:inline-flex; align-items:center; gap:.7rem; }
.welcome-stats { display:grid; gap:.75rem; }
.welcome-stat { display:flex; align-items:center; gap:1rem; padding:.9rem 1rem; border:1px solid rgba(203,213,225,.14); border-radius:15px; background:rgba(15,23,42,.45); backdrop-filter:blur(12px); }
.welcome-stat strong { min-width:4.3rem; font-family:var(--font-display); font-size:1.6rem; letter-spacing:-.04em; color:#e9d5ff; }
.welcome-stat span { color:var(--text-secondary); font-size:.82rem; }
.welcome-orbit { position:absolute; z-index:1; pointer-events:none; border:1px solid rgba(103,232,249,.12); border-radius:50%; }
.welcome-orbit-one { width:360px; height:360px; right:-120px; top:-230px; }
.welcome-orbit-two { width:480px; height:480px; right:-180px; top:-280px; }
[data-theme="light"] .welcome-hero { background:linear-gradient(118deg, rgba(139,92,246,.12), rgba(255,255,255,.95) 54%, rgba(6,182,212,.10)); }
[data-theme="light"] .welcome-stat { background:rgba(255,255,255,.7); border-color:rgba(100,116,139,.18); }
[data-theme="light"] .welcome-stat strong { color:#6d28d9; }
[data-theme="light"] .welcome-eyebrow { color:#6d28d9; }
@media(max-width:850px) { .welcome-hero { grid-template-columns:1fr; width:calc(100% - 1.5rem); margin:.8rem auto; padding:1.4rem; gap:1.3rem; } .welcome-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5rem; } .welcome-stat { display:block; padding:.7rem; } .welcome-stat strong { display:block; min-width:0; font-size:1.35rem; } .welcome-stat span { font-size:.72rem; } }
@media(max-width:480px) { .welcome-hero { border-radius:20px; } .welcome-eyebrow { font-size:.62rem; letter-spacing:.1em; } .welcome-actions { flex-direction:column; } .welcome-actions .btn { justify-content:center; width:100%; } .welcome-stats { grid-template-columns:1fr; } .welcome-stat { display:flex; align-items:center; } .welcome-stat strong { min-width:4.3rem; } }

/* Prompt Engineering Course — local, responsive learning experience */
.course-hero{position:relative;overflow:hidden;margin-bottom:1rem;padding:clamp(1.2rem,3vw,2rem);background:radial-gradient(ellipse at 90% 0%,rgba(124,58,237,.28),transparent 42%),linear-gradient(135deg,rgba(14,165,233,.10),rgba(124,58,237,.10));}
.course-kicker{font-size:.75rem;font-weight:800;letter-spacing:.16em;color:var(--accent,#8b5cf6);margin-bottom:.55rem}
.course-hero h2{font-size:clamp(1.65rem,3vw,2.5rem);line-height:1.15;margin:.2rem 0 .7rem;letter-spacing:-.035em}
.course-hero h2 span{background:linear-gradient(90deg,#38bdf8,#a78bfa,#f472b6);-webkit-background-clip:text;background-clip:text;color:transparent}
.course-hero p{max-width:780px;line-height:1.7;color:var(--text-secondary,#9ca3af)}
.course-hero-meta{display:flex;gap:.55rem;flex-wrap:wrap;margin:1rem 0 1.2rem}.course-hero-meta span,.course-level-badge{font-size:.78rem;border:1px solid var(--border-color,rgba(148,163,184,.25));border-radius:999px;padding:.38rem .65rem;background:rgba(148,163,184,.08)}
.course-progress-track{height:9px;border-radius:999px;background:rgba(148,163,184,.18);overflow:hidden}.course-progress-track>div{height:100%;width:0;background:linear-gradient(90deg,#06b6d4,#8b5cf6,#ec4899);border-radius:inherit;transition:width .25s ease}.course-progress-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:.65rem;font-size:.85rem;color:var(--text-secondary,#9ca3af)}


.course-portal-cta{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:1rem 0;padding:1rem 1.1rem;border:1px solid var(--border-color,rgba(148,163,184,.25));border-radius:14px;background:linear-gradient(110deg,rgba(6,182,212,.08),rgba(139,92,246,.10))}.course-portal-cta strong{display:block}.course-portal-cta p{margin:.25rem 0 0;color:var(--text-secondary,#9ca3af);font-size:.9rem}.course-portal-cta a{text-decoration:none}

/* Learn tab: clear four-level route into the full mastery curriculum */
.learn-level-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-top:1rem}.learn-level-card{min-width:0;padding:1.15rem;border:1px solid var(--border-color,rgba(148,163,184,.25));border-radius:15px;background:var(--bg-card,rgba(15,23,42,.25));display:flex;flex-direction:column}.learn-level-card h3{margin:.35rem 0;font-size:1.15rem}.learn-level-card p{color:var(--text-secondary,#9ca3af);line-height:1.55;font-size:.9rem}.learn-level-card ul{padding-left:1.1rem;margin:.2rem 0 1rem;font-size:.86rem}.learn-level-number{font-size:.68rem;font-weight:850;letter-spacing:.12em;color:var(--text-secondary,#9ca3af)}.learn-module-count{display:block;margin-top:auto;padding-top:.7rem;border-top:1px solid var(--border-color,rgba(148,163,184,.2));font-size:.77rem;font-weight:750}.level-core{border-top:3px solid #06b6d4}.level-applied{border-top:3px solid #8b5cf6}.level-advanced{border-top:3px solid #f59e0b}.level-expert{border-top:3px solid #10b981}.learn-launch-footer{margin-top:1rem;padding:1rem 1.1rem;border:1px dashed var(--border-color,rgba(148,163,184,.25));border-radius:12px;color:var(--text-secondary,#9ca3af);font-size:.9rem;line-height:1.6}.learn-launch-footer strong{color:var(--text-primary,#fff)}
@media(max-width:1100px){.learn-level-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.learn-level-grid{grid-template-columns:1fr}.course-portal-cta{align-items:flex-start}.course-portal-cta .btn{width:100%;text-align:center}}


/* PromptForge unified shell: sticky header & common footer */
:root { --pf-header-offset: 0px; --pf-footer-offset: 0px; }
html { scroll-padding-top: 64px; }
body { padding-top: 0; padding-bottom: 0; }
.app-header { display: none !important; }
.header-container { max-width: 1900px; gap: .65rem; }
.brand-section { gap: .5rem; flex: 0 0 auto; }
.brand-logo-icon { width: 32px; height: 32px; font-size: 1rem; }
.brand-text h1 { font-size: 1.05rem; }
.brand-subtitle { display: none; }
.nav-tabs { flex: 1 1 auto; min-width: 0; gap: .12rem; padding: .2rem; overflow-x: auto; scrollbar-width: thin; }
.nav-tab-btn { padding: .42rem .55rem; font-size: .76rem; gap: .28rem; }
.header-actions { gap: .35rem; flex: 0 0 auto; }
.icon-btn { width: 32px; height: 32px; }
.app-main { max-width: 1900px; padding: .55rem; gap: .6rem; }
.builder-column { gap: .6rem; }
.glass-panel { padding: .8rem; border-radius: 13px; }
.welcome-hero { width: calc(100% - 1rem); max-width: 1900px; margin: .55rem auto .4rem; padding: clamp(.85rem, 1.7vw, 1.5rem); border-radius: 16px; gap: .8rem; }
.welcome-hero h2 { margin: .5rem 0; }
.welcome-hero p { line-height: 1.45; }
.welcome-stat { padding: .55rem .65rem; }
#pf-toast { bottom: 1.25rem; right: .75rem; }
.app-footer { display: none !important; }
.footer-container { max-width: 1900px; font-size: .73rem; line-height: 1.3; gap: .5rem; }
.footer-container > div:first-child { min-width: 0; }
.footer-badges { display: none; }
.footer-container a { color: var(--text-accent); font-weight: 700; }
@media (max-width: 1200px) {
  :root { --pf-header-offset: 0px; }
  .header-container { flex-wrap: wrap; row-gap: .35rem; }
  .brand-section { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .nav-tabs { order: 3; flex-basis: 100%; width: 100%; }
}
@media (max-width: 760px) {
  :root { --pf-header-offset: 0px; --pf-footer-offset: 0px; }
  .header-container { gap: .3rem; }
  .brand-logo-icon { width: 29px; height: 29px; }
  .brand-text h1 { font-size: .95rem; }
  .brand-badge { font-size: .58rem; }
  .nav-tabs { gap: .12rem; padding: .15rem; }
  .nav-tab-btn { padding: .38rem .48rem; font-size: .72rem; }
  .app-main { padding: .35rem; gap: .45rem; }
  .welcome-hero { width: calc(100% - .5rem); margin: .3rem auto; padding: .8rem; }
  .welcome-stats { gap: .3rem; }
  .welcome-stat { padding: .45rem; }
  .glass-panel { padding: .65rem; }
  .preview-column { height: min(58vh, 460px); }
  .footer-container { justify-content: center; text-align: center; font-size: .68rem; }
}
@media (max-width: 420px) {
  :root { --pf-header-offset: 0px; }
  .brand-badge { display: none; }
  .nav-tab-btn { padding: .34rem .42rem; }
  .welcome-hero h2 { font-size: 1.65rem; }
}

/* ==========================================================================
   PROMPTFORGE 2.0 - STEPPER, CHEATCODES, STRUCTURAL EXPLAINER & COMFORT UX
   ========================================================================== */

/* --- Modal Backdrops & Overlays --- */
.pf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: pfFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pfFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Command Palette (Ctrl+K) --- */
.pf-command-palette {
  width: 100%;
  max-width: 640px;
  background: #0d1424;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(139, 92, 246, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .pf-command-palette {
  background: #ffffff;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.palette-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .palette-header {
  background: #f8fafc;
}

.palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.palette-search-icon {
  font-size: 1.2rem;
  color: #a78bfa;
}

.palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.palette-kbd {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.palette-chips-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.palette-quick-chip {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.palette-quick-chip:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.palette-item {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.palette-item:hover, .palette-item.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.35);
}

.palette-item-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.palette-item-cmd {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.palette-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.palette-item-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.palette-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.palette-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.palette-footer {
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.palette-footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.palette-footer-shortcuts kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* --- Cheat Sheet Directory Modal --- */
.pf-cheatsheet-modal, .pf-structural-modal {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: #0d1424;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="light"] .pf-cheatsheet-modal, [data-theme="light"] .pf-structural-modal {
  background: #ffffff;
  border-color: rgba(139, 92, 246, 0.3);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
}

.cheatsheet-body, .sm-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cs-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-heading {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.cs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.3);
}

.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  text-align: left;
}

.cs-table th {
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.cs-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.cs-table code {
  font-family: var(--font-mono);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.btn-xs-run {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-xs-run:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.cs-card {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cs-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

.cs-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.cs-key-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.cs-key-item kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #c4b5fd;
}

/* --- STEPPER PROGRESSIVE WORKFLOW SYSTEM --- */
.pf-stepper-panel {
  padding: 1rem 1.25rem !important;
  border-color: rgba(139, 92, 246, 0.3) !important;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, rgba(24, 34, 56, 0.85), rgba(15, 23, 42, 0.95)) !important;
}

[data-theme="light"] .pf-stepper-panel {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95)) !important;
}

.stepper-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.stepper-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #a78bfa;
}

.stepper-heading {
  margin: 0.2rem 0 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.stepper-progress-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.stepper-track-wrap {
  position: relative;
  margin-bottom: 0.85rem;
}

.stepper-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
  position: relative;
  z-index: 2;
}

.step-node {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
}

[data-theme="light"] .step-node {
  background: rgba(255, 255, 255, 0.7);
}

.step-node:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.step-node.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15));
  border-color: #a78bfa;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.step-node-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-icon {
  font-size: 1rem;
}

.step-num {
  display: none !important;
}

.step-check {
  display: none;
  font-size: 0.7rem;
  font-weight: 900;
  color: #10b981;
}

.step-node.step-complete .step-check {
  display: inline-block;
}

.step-node-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.step-node-title strong {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.step-level-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.level-foundation { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.level-applied { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
.level-advanced { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.level-expert { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.step-node-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stepper-progress-line {
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.step-helper-banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.step-helper-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-helper-icon {
  font-size: 1.4rem;
}

.step-helper-content strong {
  font-size: 0.88rem;
  color: var(--text-primary);
  display: block;
}

.step-helper-content p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.step-helper-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.step-focused-highlight {
  animation: stepPulse 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stepPulse {
  0% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.45); border-color: #a78bfa; }
  100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
}

.step-level-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

/* --- Structural Guide Buttons on Fields --- */
.structural-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.structural-guide-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.sm-attention-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.sm-attention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sm-chip {
  font-size: 0.72rem;
  font-weight: 800;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sm-section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.sm-section p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sm-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sm-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sm-good {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sm-bad {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sm-badge-good {
  font-size: 0.75rem;
  font-weight: 800;
  color: #34d399;
}

.sm-badge-bad {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f87171;
}

.sm-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.sm-pitfall-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.82rem;
  color: #fde68a;
  line-height: 1.45;
}

/* --- Preview Panel Views (Raw, Breakdown, Linter) --- */
.preview-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-color);
}

.preview-view-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preview-view-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.preview-view-btn.active {
  color: #ffffff;
  background: var(--accent-gradient);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.structural-breakdown-view, .prompt-audit-view {
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #c4b5fd;
}

.breakdown-block {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breakdown-tag {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breakdown-alloc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.breakdown-chars {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.breakdown-content {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.tag-purple { border-color: rgba(167, 139, 250, 0.4); }
.tag-purple .breakdown-tag { color: #a78bfa; }
.tag-indigo { border-color: rgba(99, 102, 241, 0.4); }
.tag-indigo .breakdown-tag { color: #818cf8; }
.tag-cyan { border-color: rgba(6, 182, 212, 0.4); }
.tag-cyan .breakdown-tag { color: #22d3ee; }
.tag-amber { border-color: rgba(245, 158, 11, 0.4); }
.tag-amber .breakdown-tag { color: #fbbf24; }
.tag-emerald { border-color: rgba(16, 185, 129, 0.4); }
.tag-emerald .breakdown-tag { color: #34d399; }
.tag-rose { border-color: rgba(244, 63, 94, 0.4); }
.tag-rose .breakdown-tag { color: #fb7185; }

/* Audit View */
.audit-score-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
}

.audit-score-gauge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid currentColor;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.audit-score-gauge strong {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.audit-score-gauge small {
  font-size: 0.58rem;
  text-transform: uppercase;
}

.audit-lists-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.audit-col-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }

.audit-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.audit-items li {
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.audit-items li span {
  color: #10b981;
  font-weight: 800;
}

.audit-items li strong {
  color: #fbbf24;
}

.audit-items li p {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

/* --- MOBILE FLOATING PROMPT DOCK --- */
.pf-mobile-prompt-dock {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 999;
  background: rgba(13, 20, 36, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.2);
  padding: 6px 12px;
}

[data-theme="light"] .pf-mobile-prompt-dock {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mobile-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-dock-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.mobile-dock-tokens {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.mobile-dock-score {
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
}

.mobile-dock-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mobile-preview-glow {
  animation: mobileGlow 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mobileGlow {
  0% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 0 35px rgba(139, 92, 246, 0.6); }
  100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
}

/* Konami Pulse */
.konami-pulse-active {
  animation: konamiPulse 2s ease infinite;
}

@keyframes konamiPulse {
  0% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(180deg) saturate(1.4); }
  100% { filter: hue-rotate(360deg); }
}

/* Responsive adjustments for Stepper and Mobile Dock */
@media (max-width: 900px) {
  .stepper-track {
    grid-template-columns: repeat(3, 1fr);
  }
  .sm-comparison-grid, .audit-lists-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pf-mobile-prompt-dock {
    display: block;
  }
  .stepper-track {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-main {
    padding-bottom: 70px !important; /* give space for mobile dock */
  }
  .interview-workspace-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Interview Studio & AI Bot Simulator Styles
   ========================================================================== */
.interview-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.interview-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.interview-toolbar-card {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.interview-search-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.interview-search-input-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.interview-search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.interview-search-field {
  padding-left: 38px !important;
  width: 100%;
}

.interview-select-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-compact {
  margin-bottom: 0 !important;
  min-width: 170px;
}

.form-label-compact {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: block;
}

/* Category Pills Track */
.interview-category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.interview-cat-pill {
  padding: 6px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.interview-cat-pill:hover {
  border-color: #38bdf8;
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
}

.interview-cat-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Workspace Layout */
.interview-workspace-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Question Bank List */
.interview-bank-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.interview-bank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.interview-questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 4px;
}

.interview-q-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: inherit;
  width: 100%;
}

.interview-q-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.interview-q-card.active {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.22);
}

.iq-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.iq-tier-chip {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.iq-salary-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
}

.iq-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--text-primary);
}

.iq-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.iq-category-tag, .iq-bar-tag {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

/* Detail Viewer (Right Column) */
.interview-active-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.iq-detail-header {
  padding: 1.5rem;
}

.iq-detail-meta-top {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}

.iq-salary-badge, .iq-company-badge {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.iq-detail-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  color: #fff;
  line-height: 1.3;
}

.iq-question-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.iq-box-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.iq-question-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #f1f5f9;
  margin: 0;
  font-weight: 500;
}

/* Strategy Grid */
.iq-strategy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 950px) {
  .iq-strategy-grid {
    grid-template-columns: 1fr;
  }
}

.iq-strategy-card {
  padding: 1.25rem;
}

.card-signals {
  border-left: 4px solid #38bdf8 !important;
}

.card-traps {
  border-left: 4px solid #ef4444 !important;
}

.iq-card-subhead {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.iq-strategy-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* Keywords Panel */
.iq-keywords-panel {
  padding: 1rem 1.25rem;
}

.iq-keywords-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.iq-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.iq-kw-pill {
  font-size: 0.76rem;
  padding: 3px 8px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

/* Model Answer Panel */
.iq-model-answer-panel {
  padding: 1.5rem;
  border-top: 3px solid #10b981;
}

.iq-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.iq-model-answer-content {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}

.iq-model-answer-content strong {
  color: #38bdf8;
}

.iq-model-answer-content code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fca5a5;
  font-size: 0.85rem;
}

.iq-model-answer-content ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

.iq-model-answer-content li {
  margin-bottom: 0.4rem;
}

/* Practice Sandbox */
.iq-practice-panel {
  padding: 1.5rem;
}

.iq-rubric-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  font-weight: 700;
}

.iq-practice-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem 0;
}

.iq-answer-textarea {
  width: 100%;
  padding: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 1rem;
  font-family: inherit;
}

.iq-answer-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.iq-practice-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Evaluation Output */
.iq-eval-output-wrap {
  margin-top: 1.5rem;
}

.iq-eval-summary-card {
  background: rgba(15, 23, 42, 0.9);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.iq-score-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.iq-score-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
}

.iq-verdict-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0.4rem 0 0 0;
}

.iq-score-metric {
  text-align: right;
}

.iq-score-metric strong {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.iq-score-metric span {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.iq-score-metric small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.iq-rubric-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.iq-rubric-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.iq-rc-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.iq-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.iq-bar-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.iq-rubric-col small {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.iq-missing-keywords-tip {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.iq-missing-keywords-tip strong {
  color: #fcd34d;
  font-size: 0.85rem;
}

.iq-missing-keywords-tip p {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0.25rem 0 0.5rem 0;
}

.iq-missing-kw-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.iq-missing-kw-list code {
  background: rgba(0, 0, 0, 0.4);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.iq-perfect-keywords-tip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.iq-perfect-keywords-tip strong {
  color: #34d399;
}

.iq-perfect-keywords-tip p {
  color: #cbd5e1;
  margin: 0.25rem 0 0 0;
  font-size: 0.82rem;
}

/* ==========================================================================
   FOUNDATIONS PRIMER & NON-MODAL CHEATCODES COMMAND CENTER
   Strictly unnumbered, zero certificates, zero login, vast production styling.
   ========================================================================== */

/* --- Primer Header & QuickNav --- */
.primer-header,
.cheatcodes-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.primer-header-actions,
.cheatcodes-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primer-quicknav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.primer-nav-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.primer-nav-card:hover {
  background: var(--bg-card-hover, rgba(30, 41, 59, 0.7));
  border-color: var(--accent-primary, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.pnc-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.pnc-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pnc-text small {
  display: block;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.3;
}

/* --- Primer Section Cards --- */
.primer-section-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.primer-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.primer-section-title h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0.25rem 0 0 0;
  letter-spacing: -0.01em;
}

.primer-lead-para {
  font-size: 1.05rem;
  line-height: 1.68;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
}

/* --- Primer Concept Grid --- */
.primer-concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.15rem;
  margin: 1.5rem 0;
}

.primer-concept-card {
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.primer-concept-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.pcc-icon {
  font-size: 1.8rem;
  margin-bottom: 0.65rem;
}

.pcc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.pcc-desc {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.pcc-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pcc-points li {
  font-size: 0.82rem;
  color: #cbd5e1;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.45;
}

.pcc-points li::before {
  content: "✦";
  color: var(--accent-primary, #6366f1);
  font-size: 0.75rem;
  margin-top: 2px;
}

/* --- Primer Callout & Code Blocks --- */
.primer-callout {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-primary, #6366f1);
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  border-right: 1px solid rgba(99, 102, 241, 0.15);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  margin: 1.35rem 0;
}

.primer-callout-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}

.primer-callout-body strong {
  color: #fff;
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.primer-callout-body p {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.primer-code-block {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.35rem 0;
}

.primer-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.primer-code-lang {
  color: #a5b4fc;
  font-family: ui-monospace, monospace;
}

.primer-code-pre {
  margin: 0;
  padding: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #e2e8f0;
  overflow-x: auto;
}

/* --- Primer Tables & Model Matrices --- */
.primer-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.35rem 0;
  background: rgba(10, 15, 26, 0.7);
}

.primer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.primer-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.primer-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  vertical-align: middle;
  line-height: 1.5;
}

.primer-table tr:last-child td {
  border-bottom: none;
}

.primer-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.primer-model-badge {
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}

.primer-badge-proprietary {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.primer-badge-open {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.primer-reasoning-chip {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Primer Parameters Grid --- */
.primer-param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.15rem;
  margin: 1.35rem 0;
}

.primer-param-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.primer-param-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.primer-param-top h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.primer-param-range {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.45);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primer-param-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 0.85rem;
  flex-grow: 1;
}

.primer-param-analogy {
  font-size: 0.82rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.08);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  line-height: 1.45;
}

/* --- Primer Takeaways Box --- */
.primer-takeaways-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.65) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.primer-takeaways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.primer-takeaway-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.pti-badge {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.pti-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.pti-text p {
  font-size: 0.83rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.45;
}

/* --- CHEATCODES STUDIO (NON-MODAL) --- */
.cheatcodes-toolbar-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cheatcodes-search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.cheatcodes-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.cheatcodes-search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-primary, #6366f1);
  font-size: 1.1rem;
  pointer-events: none;
}

.cheatcodes-search-field {
  width: 100%;
  padding: 11px 16px 11px 42px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.cheatcodes-search-field:focus {
  border-color: var(--accent-primary, #6366f1);
  outline: none;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.cheatcodes-count-badge {
  font-size: 0.84rem;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.cheatcodes-category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.cheatcode-cat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cheatcode-cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cheatcode-cat-pill.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.cheatcodes-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.cheatcode-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  min-height: 190px;
}

.cheatcode-card:hover {
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.cc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cc-cmd-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.cc-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.45rem;
}

.cc-card-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

.cc-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
}

.btn-inject-cc {
  flex: 1;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-inject-cc:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-copy-cc {
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-cc:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.cheatcodes-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- BUILDER INLINE QUICK CHEATCODES BAR --- */
.inline-quick-cheatcodes-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 8px 12px;
  margin-bottom: 1.15rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
}

.iqc-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.iqc-chips-track {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.iqc-chip {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.iqc-chip:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.5);
}

.iqc-more {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.iqc-more:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

@media (max-width: 768px) {
  .primer-section-card {
    padding: 1.25rem;
  }
  .primer-header,
  .cheatcodes-studio-header {
    flex-direction: column;
    align-items: stretch;
  }
  .cheatcodes-grid-container {
    grid-template-columns: 1fr;
  }
}


