:root {
  --bg-oled: #020617;
  --bg-surface: #0b1120;
  --bg-elevated: #111b30;
  --bg-card: #0f172a;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-oled);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   APP SHELL — Mobile-first OLED vertical stack (100dvh)
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-oled);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  position: relative;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  gap: 8px;
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 700;
}

.wakelock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.25s, box-shadow 0.25s;
}

.wakelock-dot.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent-cyan);
}

.icon-btn.muted {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

/* ==========================================================================
   MAIN STAGE (Scrollable middle area — pure OLED, no board by default)
   ========================================================================== */
.stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}

.stage::-webkit-scrollbar {
  display: none;
}

/* Mode Segmented Switch */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  gap: 4px;
  flex-shrink: 0;
}

.mode-btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-align: center;
}

.mode-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Puzzle Info Card */
.puzzle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

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

.badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-opening {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
}

.badge-color {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
}

.badge-color.white::before {
  content: '♔';
}

.badge-color.black::before {
  content: '♚';
}

.badge-custom {
  background: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
}

.move-counter {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.puzzle-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.puzzle-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.puzzle-solved-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.14);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* Mic / Alert Banner */
.alert-banner {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fecdd3;
  font-size: 0.78rem;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-banner button {
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.24);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Central Blindfold Orb */
.blindfold-arena {
  flex: 1;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 8px 6px;
}

.orb-wrapper {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.3s, transform 0.3s;
}

.orb-core {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1e293b, #090f1d);
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 0 28px rgba(15, 23, 42, 0.9);
  transition: all 0.25s ease;
  z-index: 2;
}

/* Orb States */
.orb-wrapper[data-state='speaking'] .orb-core {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.35);
}
.orb-wrapper[data-state='speaking'] .orb-ring {
  border-color: rgba(56, 189, 248, 0.55);
  animation: pulseRing 1.4s ease-out infinite;
}

.orb-wrapper[data-state='listening'] .orb-core {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 36px rgba(16, 185, 129, 0.4);
}
.orb-wrapper[data-state='listening'] .orb-ring {
  border-color: rgba(16, 185, 129, 0.65);
  animation: pulseRing 1.1s ease-out infinite;
}

.orb-wrapper[data-state='blunder'] .orb-core {
  border-color: var(--accent-rose);
  box-shadow: 0 0 36px rgba(244, 63, 94, 0.45);
}
.orb-wrapper[data-state='blunder'] .orb-ring {
  border-color: rgba(244, 63, 94, 0.65);
  animation: pulseRing 0.9s ease-out infinite;
}

.orb-wrapper[data-state='solved'] .orb-core {
  border-color: var(--accent-emerald);
  background: radial-gradient(circle at 35% 30%, #065f46, #022c22);
  box-shadow: 0 0 36px rgba(16, 185, 129, 0.45);
}

.orb-wrapper[data-state='error'] .orb-core {
  border-color: var(--accent-amber);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.35);
}

@keyframes pulseRing {
  0% {
    transform: scale(0.86);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

.stage-headline {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  max-width: 340px;
}

.stage-subtext {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 340px;
  min-height: 1.3em;
}

.transcript-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-moves-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 350px;
}

.spoken-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.spoken-pill.blunder {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* ==========================================================================
   GHOST CHESSBOARD (Strictement masqué par défaut, révélable à la demande)
   ========================================================================== */
.ghost-board-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.ghost-board-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--accent-cyan);
  font-weight: 600;
  padding: 0 4px;
}

.ghost-hide-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
}

.chess-grid {
  width: min(100%, 272px);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.15rem, 5.2vw, 1.55rem);
  line-height: 1;
}

.sq.light {
  background: #334155;
}

.sq.dark {
  background: #0f172a;
}

.sq.last-move {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.85);
  background-color: rgba(245, 158, 11, 0.24) !important;
}

.sq-piece.w {
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(2, 6, 23, 0.9);
}

.sq-piece.b {
  color: #020617;
  text-shadow: 0 0 2px rgba(248, 250, 252, 0.75);
}

.sq-coord-file,
.sq-coord-rank {
  position: absolute;
  font-size: 0.52rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.55);
  pointer-events: none;
}

.sq-coord-file {
  bottom: 1px;
  right: 2px;
}

.sq-coord-rank {
  top: 1px;
  left: 2px;
}

/* ==========================================================================
   THUMB ZONE (Bottom 45% — Ergonomie à une main Pixel 10)
   ========================================================================== */
.thumb-zone {
  flex-shrink: 0;
  padding: 8px 12px 12px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, #020617 18%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Quick Voice Command Chips */
.cmd-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.cmd-strip::-webkit-scrollbar {
  display: none;
}

.cmd-chip {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  transition: all 0.15s;
}

.cmd-chip:active {
  transform: scale(0.95);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.cmd-chip.highlight {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.cmd-chip.nudge {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

/* Silent 1-Tap Tactical Keypad */
.tactical-keypad {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keypad-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
}

.keypad-display {
  flex: 1;
  background: var(--bg-oled);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.keypad-display.empty {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0;
}

.keypad-action-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.keypad-action-btn.submit {
  background: var(--accent-emerald);
  color: #022c22;
  border-color: transparent;
}

.keypad-action-btn:disabled {
  opacity: 0.4;
}

.keypad-disambig-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.disambig-pill {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
}

.keypad-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.key-btn {
  height: 38px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.08s, border-color 0.12s;
}

.key-btn:active {
  transform: scale(0.93);
}

.key-btn.selected {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
  color: #e0f2fe;
}

.key-btn.castle {
  font-size: 0.72rem;
  background: rgba(129, 140, 248, 0.14);
  border-color: rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

.key-btn.piece-key {
  font-size: 0.78rem;
}

/* Primary Thumb Dock */
.thumb-dock {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 8px;
  align-items: center;
}

.dock-side-btn {
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s;
}

.dock-side-btn span {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dock-side-btn.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent-cyan);
}

.dock-side-btn:active {
  transform: scale(0.95);
}

.hero-btn {
  height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.32);
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}

.hero-btn:active {
  transform: scale(0.97);
}

.hero-btn.listening {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.38);
}

.hero-btn.danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.32);
}

.hero-btn.success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   BOTTOM DRAWERS (Bibliothèque & Import PGN)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.drawer-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(28px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Settings bar inside Library drawer */
.speed-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-oled);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.speed-control input[type='range'] {
  width: 130px;
  accent-color: var(--accent-cyan);
}

/* Category Filter Chips */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-oled);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Puzzle List */
.puzzle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.puzzle-item {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-oled);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s;
}

.puzzle-item.current {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.puzzle-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.puzzle-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.puzzle-item-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.puzzle-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.delete-custom-btn {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  font-size: 0.72rem;
  font-weight: 700;
}

/* PGN Import Form */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-oled);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent-cyan);
}

.form-textarea {
  min-height: 92px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pgn-moves-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-oled);
  border: 1px solid var(--border-subtle);
  max-height: 120px;
  overflow-y: auto;
}

.pgn-ply-chip {
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pgn-ply-chip.selected-blunder {
  background: rgba(244, 63, 94, 0.24);
  border-color: var(--accent-rose);
  color: #fecdd3;
}

.pgn-ply-chip.selected-solution {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  color: #a7f3d0;
}

.primary-action-btn {
  width: 100%;
  height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.secondary-action-btn {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.pgn-feedback {
  font-size: 0.78rem;
  color: #fda4af;
  min-height: 1.1em;
}

.pgn-feedback.ok {
  color: #6ee7b7;
}
