/* ============================================================
   CyberSlide Creator v3.3 – Design System
   Aesthetic: Matrix-green on void-black (v2.3b palette restored)
   Fonts: Orbitron / Share Tech Mono + Space Grotesk
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Share+Tech+Mono&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── DARK THEME (Hacker / Cyber, v2.3b palette) ── */
[data-ui-theme="dark"] {
  --bg-app:            #03080d;
  --bg-panel:          #070e14;
  --bg-panel-2:        #080f17;
  --bg-surface:        #0c1520;
  --bg-surface-2:      #0d1822;
  --bg-hover:          #111d2b;
  --bg-input:          #0a1219;
  --bg-modal:          #070e14;
  --border:            #1a2d3d;
  --border-bright:     #223a50;
  --border-subtle:     #0f1f2e;
  --text-primary:      #d4f0e8;
  --text-secondary:    #7ab5a0;
  --text-muted:        #3d6e5c;
  --accent:            #00ff88;
  --accent-dim:        rgba(0, 255, 136, 0.15);
  --accent-hover:      #33ffaa;
  --accent-press:      #00cc6a;
  --danger:            #ff3366;
  --danger-dim:        rgba(255, 51, 102, 0.12);
  --warn:              #ffaa00;
  --warn-dim:          rgba(255, 170, 0, 0.12);
  --success:           #00ff88;
  --success-dim:       rgba(0, 255, 136, 0.1);
  --shadow-sm:         0 2px 8px rgba(0,0,0,0.6);
  --shadow-md:         0 4px 20px rgba(0,0,0,0.8);
  --shadow-lg:         0 8px 40px rgba(0,0,0,0.95);
  --glow:              0 0 24px rgba(0,255,136,0.3);
  --glow-sm:           0 0 10px rgba(0,255,136,0.18);
  --radius-sm:         3px;
  --radius-md:         6px;
  --radius-lg:         10px;
  --font-display:      'Orbitron', monospace;
  --font-mono:         'Share Tech Mono', monospace;
  --font-body:         'Space Grotesk', sans-serif;
}

/* ── LIGHT THEME ── */
[data-ui-theme="light"] {
  --bg-app:            #f0f4f8;
  --bg-panel:          #ffffff;
  --bg-panel-2:        #f8fafc;
  --bg-surface:        #eef2f7;
  --bg-surface-2:      #e4eaf3;
  --bg-hover:          #dde5f0;
  --bg-input:          #f8fafc;
  --bg-modal:          #ffffff;
  --border:            #d0dbe8;
  --border-bright:     #b8c8da;
  --border-subtle:     #e0eaf4;
  --text-primary:      #1a2540;
  --text-secondary:    #4a5a78;
  --text-muted:        #8898b0;
  --accent:            #00aa55;
  --accent-dim:        rgba(0,170,85,0.1);
  --accent-hover:      #00cc66;
  --accent-press:      #008844;
  --danger:            #dc2626;
  --danger-dim:        rgba(220,38,38,0.1);
  --warn:              #d97706;
  --warn-dim:          rgba(217,119,6,0.1);
  --success:           #059669;
  --success-dim:       rgba(5,150,105,0.1);
  --shadow-sm:         0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:         0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:         0 8px 40px rgba(0,0,0,0.18);
  --glow:              0 0 20px rgba(0,170,85,0.2);
  --glow-sm:           0 0 8px rgba(0,170,85,0.12);
  --radius-sm:         3px;
  --radius-md:         6px;
  --radius-lg:         10px;
  --font-display:      'Orbitron', monospace;
  --font-mono:         'Share Tech Mono', monospace;
  --font-body:         'Space Grotesk', sans-serif;
}

/* ── UTILITY ── */
.hidden { display: none !important; }

/* ── NO-SAVE BADGE ── */
.nosave-badge {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  background: var(--warn); color: #000;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 18px; border-radius: 0 0 6px 6px;
  z-index: 9999; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ────────────────────────────────────
   TOP BAR
──────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 100;
  box-shadow: 0 1px 0 var(--border-subtle), var(--shadow-sm);
}
/* Subtle accent scanline on bottom of topbar */
.topbar::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.25; pointer-events: none;
}

.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; }
.topbar__center { position: absolute; left: 50%; transform: translateX(-50%); }

/* ── LOGO ── */
.topbar__logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  color: var(--text-primary); user-select: none;
  transition: opacity 0.15s;
}
.topbar__logo:hover { opacity: 0.85; }
.logo-icon {
  color: var(--accent); font-size: 20px; line-height: 1;
  text-shadow: var(--glow-sm);
  animation: icon-pulse 5s ease-in-out infinite;
}
@keyframes icon-pulse {
  0%,100% { opacity:1; text-shadow: var(--glow-sm); }
  50%      { opacity:0.65; text-shadow: 0 0 18px var(--accent); }
}
.logo-text {
  font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-primary);
}
.logo-text strong { color: var(--accent); text-shadow: var(--glow-sm); }
.logo-version {
  font-size: 9px; font-family: var(--font-mono);
  color: var(--text-muted); background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 6px; border-radius: var(--radius-sm); letter-spacing: 0.08em;
}

/* ── TAB NAV ── */
.tab-nav { display: flex; gap: 0; }
.tab-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 0;
  transition: all 0.15s; outline: none; cursor: pointer;
  position: relative;
}
.tab-btn::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.2s;
}
.tab-btn:hover { color: var(--text-secondary); background: var(--bg-surface); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { transform: scaleX(1); box-shadow: var(--glow-sm); }

/* ── TOP BAR ACTION BUTTONS ── */
.btn-ideas {
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent); font-size: 10px; font-weight: 600;
  font-family: var(--font-mono); letter-spacing: 0.08em;
  padding: 5px 12px; transition: all 0.15s;
}
.btn-ideas:hover { background: var(--accent); color: #000; box-shadow: var(--glow); }

.btn-help, .btn-theme-toggle {
  width: 30px; height: 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 700;
  transition: all 0.15s; font-family: var(--font-mono);
}
.btn-help:hover, .btn-theme-toggle:hover {
  color: var(--accent); border-color: var(--accent); box-shadow: var(--glow-sm);
}

/* ────────────────────────────────────
   APP LAYOUT
──────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* ────────────────────────────────────
   PANEL: SLIDES LIST
──────────────────────────────────── */
.panel-slides {
  display: flex; flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.panel-slides__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; color: var(--text-muted);
  text-transform: uppercase;
}
.panel-slides__actions { display: flex; gap: 4px; }

/* ── ICON BUTTONS ── */
.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px; padding: 3px 8px;
  transition: all 0.12s; line-height: 1.4;
  font-family: var(--font-mono);
}
.btn-icon:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); box-shadow: var(--glow-sm);
}
.btn-icon-danger {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px; padding: 4px 10px;
  transition: all 0.12s; font-family: var(--font-mono);
}
.btn-icon-danger:hover {
  color: var(--danger); border-color: var(--danger); background: var(--danger-dim);
}

/* ── SLIDE LIST ── */
.slide-list {
  flex: 1; overflow-y: auto; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.slide-list::-webkit-scrollbar { width: 3px; }
.slide-list::-webkit-scrollbar-track { background: transparent; }
.slide-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── SLIDE ITEM ── */
.slide-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.1s; user-select: none;
}
.slide-item:hover { background: var(--bg-hover); border-color: var(--border); }
.slide-item.active {
  background: var(--accent-dim); border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, var(--glow-sm);
}
.slide-item__num {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-muted); min-width: 18px;
}
.slide-item.active .slide-item__num { color: var(--accent); }
.slide-item__thumb {
  width: 42px; height: 26px; border-radius: 2px;
  background: var(--bg-surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--border); font-family: var(--font-mono);
}
.slide-item.active .slide-item__thumb { border-color: var(--accent); color: var(--accent); }
.slide-item__title {
  flex: 1; font-size: 12px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slide-item__layout-badge {
  font-size: 8px; font-family: var(--font-mono);
  color: var(--text-muted); background: var(--bg-surface);
  padding: 1px 4px; border-radius: 2px; flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.slide-item.active .slide-item__layout-badge { color: var(--accent); border-color: var(--accent); }

/* ── CTA EMPTY ── */
.cta-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 14px;
  padding: 20px; text-align: center;
}
.cta-empty__icon {
  font-size: 32px; color: var(--text-muted); opacity: 0.2;
  font-family: var(--font-mono);
  animation: blink-caret 1.8s step-end infinite;
}
@keyframes blink-caret { 0%,100%{opacity:0.15} 50%{opacity:0.45} }
.cta-empty p { color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.06em; }

/* ────────────────────────────────────
   PANEL MAIN
──────────────────────────────────── */
.panel-main {
  display: flex; flex-direction: column;
  background: var(--bg-app); overflow: hidden;
}

/* ── PREVIEW ── */
.preview-wrapper {
  display: flex; flex-direction: column;
  flex: 0 0 auto; border-bottom: 1px solid var(--border);
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; background: var(--bg-panel);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.preview-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.15em; color: var(--text-muted); text-transform: uppercase;
}
.preview-controls { display: flex; align-items: center; gap: 8px; }

.media-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100%{ opacity:1; box-shadow:0 0 8px var(--accent); }
  50%     { opacity:0.3; box-shadow:0 0 3px var(--accent); }
}

.preview-frame-container {
  position: relative; background: #000; overflow: hidden;
  aspect-ratio: 16/9; max-height: 310px;
}
.preview-frame-container iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── EDITOR PANEL ── */
.editor-panel { flex: 1; overflow-y: auto; background: var(--bg-panel-2); }
.editor-panel::-webkit-scrollbar { width: 3px; }
.editor-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.editor-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted);
  font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.1em;
}
.editor-form { padding: 12px; display: flex; flex-direction: column; gap: 11px; }

/* ── LAYOUT PICKER ── */
.layout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.layout-option {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.12s;
  background: var(--bg-surface);
}
.layout-option:hover { border-color: var(--accent); background: var(--accent-dim); }
.layout-option.selected {
  border-color: var(--accent); background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent), var(--glow-sm);
}
.layout-option__icon {
  font-size: 14px; line-height: 1; color: var(--text-secondary); font-family: var(--font-mono);
}
.layout-option.selected .layout-option__icon { color: var(--accent); }
.layout-option__label {
  font-size: 8px; color: var(--text-muted); font-family: var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.layout-option.selected .layout-option__label { color: var(--accent); }

/* ────────────────────────────────────
   FORM ELEMENTS
──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group--checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--text-muted); text-transform: uppercase; font-family: var(--font-mono);
}
.form-hint { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.form-input, .form-textarea, .form-select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 12px; padding: 6px 9px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; width: 100%; font-family: var(--font-body);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim), var(--glow-sm);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); opacity: 0.5; }
.form-input--sm { width: auto; flex: 1; }
.form-textarea { resize: vertical; min-height: 58px; }
.form-textarea--notes { min-height: 68px; }
.form-textarea--parse {
  min-height: 350px; resize: vertical;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: var(--text-primary);
}
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-panel); }
.form-row-actions { display: flex; align-items: center; justify-content: space-between; }

.char-counter {
  font-size: 9px; color: var(--text-muted);
  font-family: var(--font-mono); text-align: right; letter-spacing: 0.04em;
}
.char-counter.warn   { color: var(--warn); }
.char-counter.danger { color: var(--danger); }

.bg-controls { display: flex; gap: 6px; align-items: center; }
.bg-preview-strip {
  height: 18px; border-radius: 2px; border: 1px solid var(--border);
  transition: background 0.2s; display: none;
}

/* ────────────────────────────────────
   BUTTONS
──────────────────────────────────── */
.btn-sm {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  letter-spacing: 0.08em; padding: 4px 12px; transition: all 0.12s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow-sm); }
.btn-sm:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; }

.btn-tiny {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.06em;
  padding: 3px 8px; transition: all 0.12s; cursor: pointer; white-space: nowrap;
}
.btn-tiny:hover { color: var(--accent); border-color: var(--accent); }

.btn-file-label {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 9px; font-family: var(--font-mono);
  padding: 3px 8px; transition: all 0.12s; cursor: pointer;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.btn-file-label:hover { color: var(--accent); border-color: var(--accent); }

.btn-primary {
  background: var(--accent); color: #000; border: none;
  border-radius: var(--radius-sm);
  font-weight: 700; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 18px; transition: all 0.15s; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--glow); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent-press); transform: none; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-secondary {
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  letter-spacing: 0.06em; padding: 8px 18px; transition: all 0.15s; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--danger); border: none;
  border-radius: var(--radius-sm); color: #fff;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
  letter-spacing: 0.06em; padding: 8px 18px; transition: all 0.15s; cursor: pointer;
}
.btn-danger:hover { opacity: 0.88; box-shadow: 0 0 16px var(--danger-dim); }

.editor-actions {
  display: flex; gap: 5px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--border);
}

/* ── URL VALIDATION ── */
.url-validation-msg {
  font-size: 10px; font-family: var(--font-mono);
  padding: 3px 0; min-height: 16px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.url-valid   { color: var(--accent); }
.url-invalid { color: var(--danger); }
.url-warn    { color: var(--warn); }
.url-link    { text-decoration: underline; cursor: pointer; color: var(--accent); }

/* ── PACING HINT ── */
.pacing-hint { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); }
.pacing-hint .warn-icon { color: var(--warn); }

/* ────────────────────────────────────
   PANEL RIGHT: PACING
──────────────────────────────────── */
.panel-right {
  background: var(--bg-panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 8px; gap: 6px; overflow-y: auto;
}
.pacing-panel { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.pacing-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 5px; border-radius: 2px; font-size: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.1s; font-family: var(--font-mono);
}
.pacing-item:hover { background: var(--bg-hover); }
.pacing-item.current { background: var(--accent-dim); border-color: var(--accent); }
.pacing-item__num { color: var(--text-muted); }
.pacing-item__time { color: var(--text-secondary); }
.pacing-item.current .pacing-item__num,
.pacing-item.current .pacing-item__time { color: var(--accent); }
.pacing-item__warn { color: var(--warn); font-size: 11px; }
.pacing-total {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); border-top: 1px solid var(--border);
  padding-top: 8px; font-weight: 700; letter-spacing: 0.06em;
}

/* ────────────────────────────────────
   STYLE PANEL
──────────────────────────────────── */
.style-panel {
  position: absolute; top: 52px; left: 0; right: 0; bottom: 0;
  background: var(--bg-app); z-index: 50; overflow-y: auto;
}
.style-panel__inner { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

.style-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.style-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 18px; margin-bottom: -1px;
  cursor: pointer; transition: all 0.15s;
}
.style-tab:hover { color: var(--text-secondary); background: var(--bg-surface); }
.style-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── THEME GRID ── */
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .theme-grid { grid-template-columns: repeat(2,1fr); } }

.theme-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; overflow: hidden; transition: all 0.15s;
  background: var(--bg-panel);
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-bright); }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--glow); }
.theme-card__preview {
  height: 76px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; position: relative; overflow: hidden;
  font-family: var(--font-mono);
}
.theme-card__label {
  padding: 6px 10px; font-size: 9px; font-family: var(--font-mono);
  color: var(--text-secondary); text-align: center;
  background: var(--bg-surface); border-top: 1px solid var(--border);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.theme-card.selected .theme-card__label { color: var(--accent); }

/* ── EXPERT GRID ── */
.expert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-picker {
  width: 34px; height: 30px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: var(--bg-input);
}
.expert-actions { margin-top: 14px; }
.adaptive-contrast-preview {
  margin-top: 10px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-height: 38px; font-size: 11px; font-family: var(--font-mono);
}

/* ────────────────────────────────────
   EXPORT PANEL
──────────────────────────────────── */
.export-panel {
  position: absolute; top: 52px; left: 0; right: 0; bottom: 0;
  background: var(--bg-app); z-index: 50; overflow-y: auto;
}
.export-panel__inner { max-width: 900px; margin: 0 auto; padding: 24px 20px; }
.section-heading {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--accent); margin-bottom: 20px;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-shadow: var(--glow-sm);
}
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .export-grid { grid-template-columns: repeat(2,1fr); } }

.export-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all 0.15s;
}
.export-card:hover { border-color: var(--border-bright); }
.export-card__icon { font-size: 24px; }
.export-card h3 {
  font-size: 10px; font-weight: 700; color: var(--text-primary);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em;
}
.export-card p { font-size: 11px; color: var(--text-secondary); flex: 1; line-height: 1.65; }

.link-validation-results { margin-top: 8px; }
.link-val-item {
  font-size: 10px; padding: 4px 0;
  display: flex; align-items: center; gap: 6px; font-family: var(--font-mono);
}
.link-val-ok  { color: var(--accent); }
.link-val-err { color: var(--danger); }
.link-val-url { color: var(--accent); cursor: pointer; text-decoration: underline; word-break: break-all; }

/* ────────────────────────────────────
   MODALS
──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(1, 5, 9, 0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade-in 0.15s ease;
}
@keyframes fade-in { from{opacity:0} to{opacity:1} }

.modal {
  background: var(--bg-modal); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 26px;
  max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,255,136,0.03);
  animation: modal-in 0.2s ease; position: relative;
}
.modal--wide { max-width: 820px; }
@keyframes modal-in {
  from { transform: scale(0.96) translateY(8px); opacity:0; }
  to   { transform: none; opacity:1; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title {
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase;
  text-shadow: var(--glow-sm);
}
.modal-body {
  color: var(--text-secondary); font-size: 12px; line-height: 1.7;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.modal-close {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  width: 26px; height: 26px; cursor: pointer;
  font-size: 11px; font-family: var(--font-mono); transition: all 0.12s;
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }

/* ── PARSE LAYOUT ── */
.parse-layout { display: grid; grid-template-columns: 1fr 250px; gap: 14px; }
.cheatsheet-title {
  font-size: 10px; font-weight: 700; color: var(--accent); margin-bottom: 10px;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em;
}
.cheatsheet-content { display: flex; flex-direction: column; gap: 6px; }
.cheatsheet-item { font-size: 11px; color: var(--text-secondary); line-height: 1.6; font-family: var(--font-mono); }
.cheatsheet-item code {
  background: var(--bg-surface); color: var(--accent);
  padding: 1px 5px; border-radius: 2px;
  font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border);
}
.cheatsheet-note {
  font-size: 9px; color: var(--text-muted); font-style: italic;
  padding-top: 4px; border-top: 1px solid var(--border); font-family: var(--font-mono);
}

/* ── HELP ── */
.help-tabs {
  display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.help-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 14px; margin-bottom: -1px; cursor: pointer; transition: all 0.15s;
}
.help-tab:hover { color: var(--text-secondary); }
.help-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.help-content {
  max-height: 420px; overflow-y: auto;
  color: var(--text-secondary); font-size: 12px; line-height: 1.75;
}
.help-content h3 {
  color: var(--accent); font-size: 10px; font-weight: 700;
  margin: 14px 0 6px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.help-content p { margin-bottom: 8px; }
.help-content code {
  background: var(--bg-surface); color: var(--accent);
  padding: 1px 5px; border-radius: 2px;
  font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border);
}
.help-content .kbd {
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  border-radius: 2px; padding: 1px 6px;
  font-size: 10px; font-family: var(--font-mono);
  color: var(--accent); letter-spacing: 0.06em;
}

/* ────────────────────────────────────
   TOAST
──────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--bg-panel); border: 1px solid var(--border-bright);
  border-radius: var(--radius-md); padding: 9px 14px;
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.04em;
  color: var(--text-primary); box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease, toast-out 0.3s ease 2.7s forwards;
  pointer-events: all; min-width: 200px; max-width: 340px;
  display: flex; align-items: center; gap: 8px;
}
.toast--success { border-left: 2px solid var(--accent); }
.toast--error   { border-left: 2px solid var(--danger); }
.toast--warn    { border-left: 2px solid var(--warn); }
.toast--info    { border-left: 2px solid var(--text-muted); }
@keyframes toast-in  { from{transform:translateX(120%);opacity:0} to{transform:none;opacity:1} }
@keyframes toast-out { to{transform:translateX(120%);opacity:0} }

/* ── DRAG ── */
.slide-item.dragging   { opacity: 0.25; }
.slide-item.drag-over  { border-color: var(--accent) !important; background: var(--accent-dim) !important; box-shadow: var(--glow-sm); }

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ── FOCUS ── */
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* ── CHECKBOX / SELECT ── */
input[type="checkbox"] { accent-color: var(--accent); }
input[type="color"] { -webkit-appearance: none; }
select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233d6e5c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px;
}

/* ── PRINT ── */
@media print {
  .topbar,.panel-slides,.panel-right,.editor-panel,.preview-header,.nosave-badge,.toast-container{display:none!important}
  body{background:white;color:black;}
}
