:root {
  /* Palette: "Soft Slate" */
  --bg-dark: #0f172a;
  --bg-gradient-start: #1e293b;
  --bg-gradient-end: #020617;

  --glass-panel: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-highlight: rgba(255, 255, 255, 0.04);

  --primary: #e2e8f0;
  /* Slate 200 */
  --primary-glow: rgba(226, 232, 240, 0.15);
  --primary-dark: #94a3b8;
  /* Slate 400 */

  --accent: #f472b6;
  /* Pink 400 */
  --warning: #fbbf24;
  /* Amber 400 */
  --success: #34d399;
  /* Emerald 400 */
  --danger: #ef4444;
  /* Red 500 */

  --highlight-rgb: 251, 191, 36;
  /* Amber 400 */
  --tactical-highlight-rgb: 239, 68, 68;
  /* Red 500 */

  --text-main: #f8fafc;
  /* Slate 50 */
  --text-muted: #cbd5e1;
  /* Slate 300 */
  --text-dim: #64748b;
  /* Slate 500 */

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(226, 232, 240, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(244, 114, 182, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  /* App-like feel */
  -webkit-font-smoothing: antialiased;
  /* Fix for Navbar Layout */
  display: flex;
  flex-direction: column;
}

/* --- App Layout --- */
.app-container {
  display: grid;
  grid-template-columns: minmax(480px, 1.2fr) minmax(360px, 0.8fr);
  flex: 1;
  width: 100%;
  min-height: 100vh;
}

@media (max-width: 1200px) {
  .app-container {
    grid-template-columns: minmax(420px, 1fr) minmax(320px, 0.9fr);
  }
}

@media (max-width: 900px) {
  .app-container {
    display: grid;
    grid-template-columns: 1fr minmax(400px, 32vw);
    /* Proportional Sidebar */
    height: auto;
    flex: 1;
    width: 100vw;
    overflow: hidden;
  }
}

/* Left Stage: Board */
.stage {
  display: flex;
  flex-direction: row;
  /* Horizontal layout */
  padding: 2vh 2vw;
  gap: 24px;
  /* Gap between board and side controls */
  position: sticky;
  top: 0;
  align-self: start;
  height: 100%;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
  border-right: 1px solid var(--glass-border);
  justify-content: center;
  align-items: center;
  /* Center vertically */
  /* Relative padding */
  /* Relative gap */
}

top: 0;
align-self: start;
height: 100%;
/* Fix overflow: was 100vh */
overflow: hidden;
background: rgba(15, 23, 42, 0.35);
border-right: 1px solid var(--glass-border);
/* justify-content: space-between; */
/* Let flex-grow handle spacing */
}

@media (max-width: 900px) {
  .stage {
    position: relative;
    top: unset;
    height: auto;
    border-right: none;
    overflow: visible;
    padding: 20px;
  }
}

.board-wrapper {
  /* Flex magic: be as big as possible but fitting in the container */
  width: auto;
  /* Let height drive width via aspect-ratio */
  height: 100%;
  /* Try to fill the stack height */
  max-width: 100%;
  /* Strict width constraint */
  max-height: 94vh;
  /* BIGGER BOARD */
  aspect-ratio: 1;
  /* Force square */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.board-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Take all available space above controls */
  min-height: 0;
  /* Allow shrinking below content size */
  justify-content: center;
  /* Center board vertically in this space */
  gap: 1.5vh;
  width: 100%;
  align-items: center;
  /* Center the board stack */
}

/* Chessboard Styles */
.board-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(226, 232, 240, 0.03);
  background: #0f172a;
  position: relative;
  overflow: hidden;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.pieces-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.heat-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
}

.square {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.square.light {
  background: rgba(226, 232, 240, 0.08);
  color: rgba(226, 232, 240, 0.5);
}

.square.dark {
  background: rgba(15, 23, 42, 0.65);
  color: rgba(148, 163, 184, 0.6);
}

.square-highlight {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
  pointer-events: none;
  z-index: 5;
}

.square.highlight-positional .square-highlight {
  inset: 0;
  border: 2px solid rgba(var(--highlight-rgb), var(--hl-alpha, 0.5));
  box-shadow: inset 0 0 20px rgba(var(--highlight-rgb), calc(var(--hl-alpha, 0.5) * 0.4));
  background: rgba(var(--highlight-rgb), calc(var(--hl-alpha, 0.08) * 0.2));
  border-radius: 0;
  /* Full square highlight looks better with color */
}

.square.highlight-tactical .square-highlight {
  inset: 0;
  border: 2px solid rgba(var(--tactical-highlight-rgb), var(--tactical-hl-alpha, 0.65));
  box-shadow: inset 0 0 25px rgba(var(--tactical-highlight-rgb), calc(var(--tactical-hl-alpha, 0.65) * 0.5));
  background: rgba(var(--tactical-highlight-rgb), calc(var(--tactical-hl-alpha, 0.08) * 0.6));
  border-radius: 0;
}

.square-tooltip-bubble {
  position: fixed;
  pointer-events: none;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.15);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.65);
  color: var(--text-main);
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 260px;
  width: max-content;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.2s ease;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  left: -9999px;
  top: -9999px;
}

.square-tooltip-bubble.visible {
  opacity: 1;
  transform: scale(1);
}

.square-tooltip-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid rgba(226, 232, 240, 0.15);
  border-bottom: 1px solid rgba(226, 232, 240, 0.15);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: inherit;
}

.square-tooltip-bubble.flip::after {
  bottom: auto;
  top: -6px;
  border-left: none;
  border-bottom: none;
  border-right: 1px solid rgba(226, 232, 240, 0.15);
  border-top: 1px solid rgba(226, 232, 240, 0.15);
}

.square-tooltip-bubble .tooltip-heading {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warning);
  margin-bottom: 6px;
  display: block;
}

.square-tooltip-bubble ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.square-tooltip-bubble li {
  font-size: 0.78rem;
  color: var(--text-main);
  padding: 0;
  border: none;
  line-height: 1.45;
}

.square-tooltip-bubble li+li {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.square-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(226, 232, 240, 0.15);
  color: var(--primary);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 3;
  pointer-events: none;
}

.piece {
  width: 12.5%;
  /* 1/8th */
  height: 12.5%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  will-change: transform;
}

.piece.entering {
  opacity: 0;
  transform: scale(0.8);
}

.coord {
  position: absolute;
  font-size: 0.8rem;
  /* Use vmin/vmax if needed, but fixed rem implies zoom. */
  font-weight: 600;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  z-index: 1;
}

/* Scales for large board */
@media(min-width: 1200px) {
  .coord {
    font-size: 1rem;
  }
}

.coord.rank {
  top: 4px;
  left: 6px;
}

.coord.file {
  bottom: 2px;
  right: 6px;
}

.board-meta-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  /* Reduced from 16px 20px */
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

/* Controls */
.control-panel {
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  flex: 0 0 300px;
  /* Fixed sidebar width */
  width: 300px;
  max-width: 300px;
  align-self: stretch;
  /* Full height or centered */
  height: fit-content;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 1100px) {
  .control-panel {
    width: 100%;
    max-width: 600px;
    flex: 0 0 auto;
    align-self: center;
    max-height: 40vh;
  }
}

@media (max-width: 560px) {
  .board-meta-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}

.board-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.board-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

.analysis-form {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* Game Navigation */
.game-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
  border-radius: 999px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 12px;
  transition: color 0.2s, background 0.2s;
  border-radius: 999px;
}

.nav-btn:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn:disabled {
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.move-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--primary);
}



/* Right Panel: Analysis Narrative */
/* Right Panel: Analysis Narrative */
.analysis-panel {
  display: flex;
  flex-direction: column;
  background: rgba(7, 11, 20, 0.65);
  /* slightly more transparent */
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(40px);
  /* Heavier blur for cleaner text */
  -webkit-backdrop-filter: blur(40px);
  min-height: 100vh;
  position: relative;
}

.position-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 32px 40px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  transition: padding 0.3s ease;
}

.position-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.side-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.side-indicator {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.phase-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  font-size: 0.75rem;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.eval-summary {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.position-aux {
  margin-top: 12px;
}

.eval-tone {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.analysis-body {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 0;
}

.analysis-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.analysis-scroll::-webkit-scrollbar {
  width: 6px;
}

.analysis-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.analysis-empty {
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.analysis-empty.is-hidden {
  display: none;
}

.analysis-section {
  background: rgba(13, 19, 34, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border 0.2s, background 0.2s;
}

.analysis-section.emphasis {
  border-color: rgba(244, 114, 182, 0.5);
  background: rgba(244, 114, 182, 0.08);
  box-shadow: 0 15px 35px rgba(244, 114, 182, 0.15);
}

.analysis-section.is-hidden {
  display: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.section-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.section-toggle::before {
  content: "–";
  font-size: 0.95rem;
  line-height: 1;
}

.analysis-section.is-collapsed .section-toggle::before {
  content: "+";
}

.section-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.section-body {
  color: var(--text-main);
  line-height: 1.6;
  font-size: 0.95rem;
}

.opening-line {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.opening-themes {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opening-themes li {
  line-height: 1.4;
}

.analysis-section.is-collapsed .section-body {
  display: none;
}

.primary-plan {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.secondary-plans {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-plan {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0;
}

.secondary-plan summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.secondary-plan summary::-webkit-details-marker {
  display: none;
}

.secondary-plan summary::after {
  content: "+";
  float: right;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.secondary-plan[open] summary::after {
  content: "–";
}

.secondary-plan p,
.secondary-plan ul {
  padding: 0 14px 12px;
  color: var(--text-muted);
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.concept-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
}

.concept-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.concept-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.concept-level {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.concept-meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.concept-meter span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f472b6, #facc15);
}

.coach-questions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coach-questions li {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-badge {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.question-text {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
}

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

.line-moves {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.line-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.line-full,
.line-alt-entry {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  line-height: 1.5;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
  text-align: left;
  font-size: 0.95rem;
}

.line-full:hover,
.line-alt-entry:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.line-alt-entry {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
}

.move-san {
  font-weight: 600;
}

.move-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alt-line-toggle {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s;
}

.alt-line-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.alt-line-toggle.muted {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  margin-left: 8px;
}

.line-alternatives {
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.line-alternatives.open {
  display: flex;
}

/* Rail removed */

@media (max-width: 1100px) {
  .section-rail {
    width: 64px;
    padding: 24px 10px;
  }
}

@media (max-width: 900px) {
  .analysis-panel {
    min-height: auto;
  }

  .position-header {
    padding: 20px;
  }

  .analysis-body {
    flex-direction: column;
  }

  .analysis-scroll {
    padding: 24px 20px 32px;
  }


}

/* Controls */
/* .control-panel style moved to line ~400 */

.input-row {
  margin-bottom: 8px;
  /* Reduced from 12px */
}

label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  /* Reduced from 6px */
  font-weight: 600;
}

textarea,
input,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  min-height: 60px;
  resize: vertical;
}

.panel-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.panel-link-header a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.panel-link-header a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #0f172a;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.collapse-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 12px;
}

.collapse-content {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.collapse-content.open {
  display: block;
}

/* Game Navigation */
.game-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 12px;
  transition: color 0.2s;
}

.nav-btn:hover {
  color: var(--text-main);
}

.nav-btn:disabled {
  color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

.move-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--primary);
}


/* Results Layout */
.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease forwards;
}

.card {
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Commentary Styles */
.commentary-summary {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}

.tab-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab-pill {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
}

.tab-pill.active {
  background: var(--primary);
  color: #0f172a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.commentary-body {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* Urgent Alert Section */
.urgent-section {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.urgent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--warning);
  margin-bottom: 8px;
}

.urgent-header .icon {
  font-size: 1rem;
}

.urgent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.urgent-list li {
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
  border-bottom: none;
}

.urgent-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--warning);
  font-weight: bold;
}

/* Best Moves Section */
.moves-section {
  margin-bottom: 16px;
}

.moves-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 10px;
}

.moves-header .icon {
  font-size: 1rem;
}

.move-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.move-chip {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warning);
  transition: all 0.2s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.move-chip:hover {
  background: rgba(251, 191, 36, 0.15);
  transform: translateY(-1px);
}

.move-chip .move-san {
  color: var(--text-main);
  font-weight: 700;
}

.move-chip .reason {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
}

/* Training Takeaway */
.takeaway-section {
  background: rgba(226, 232, 240, 0.05);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.takeaway-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.takeaway-header .icon {
  font-size: 1rem;
}

.takeaway-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  font-style: italic;
}

/* Section Header Icons */
.section-icon {
  font-size: 1rem;
  margin-right: 6px;
}

/* Commentary Body Formatting */
.commentary-body strong,
.commentary-body b {
  color: var(--text-main);
  font-weight: 600;
}

.commentary-body em,
.commentary-body i {
  color: var(--primary);
}

/* Divider */
.section-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
}

/* Lists */
ul {
  list-style: none;
}

li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

li:last-child {
  border-bottom: none;
}

/* Loader */
.loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn.loading .loader {
  display: block;
  margin: 0 auto;
}

.btn.loading span {
  display: none;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Navigation --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.navbar-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--warning);
  border-radius: 2px;
}

.nav-cta {
  background: var(--primary);
  color: #0f172a;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: filter 0.2s;
}

.nav-cta:hover {
  filter: brightness(1.1);
}

/* Landing Page Specifics */
.hero-section {
  padding: 80px 24px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  /* Reduced from 800 */
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 650px;
  /* Slightly wider for better flow */
  margin: 0 auto 40px;
  line-height: 1.7;
  /* Increased for breathability */
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  min-width: 160px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  /* Increased from 32px */
  max-width: 1200px;
  margin: 60px auto 100px;
  /* More bottom margin */
  padding: 0 24px;
}

.feature-card {
  background: rgba(30, 41, 59, 0.4);
  /* Lighter glass */
  border: 1px solid var(--glass-border);
  padding: 32px;
  border-radius: var(--radius-md);
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  /* Ensure readability */
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(30, 41, 59, 0.6);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--warning);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  /* Reduced slightly */
  margin-bottom: 12px;
  color: var(--text-main);
}

.feature-desc {
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-main);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-link {
  color: var(--warning);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

/* --- Coach Persona Styles --- */

.coach-bubble {
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  /* Callout effect */
  padding: 16px;
  position: relative;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.5s ease-out;
}

.coach-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 15px var(--primary-glow);
  flex-shrink: 0;
}

.coach-content {
  flex: 1;
}

.coach-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.threat-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  animation: pulse-danger 2s infinite;
}

.alert-header {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.evaluation-section {
  margin-bottom: 24px;
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--radius-md);
}

.eval-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

@keyframes pulse-danger {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}


.opening-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-highlight);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  animation: slideInRight 0.3s ease-out;
}

.opening-card .icon {
  font-size: 1.2rem;
}

/* --- LAYOUT REFACTOR OVERRIDES --- */

/* Fix Stage Alignment */
.stage {
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
}

/* Sidebar for Controls + Meta */
.stage-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 320px;
  min-width: 300px;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 70px;
  /* Taskbar safety */
  flex-shrink: 0;
}

/* Updated Control Panel (Sidebar Mode) */
.control-panel {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  margin: 0;
  max-height: none;
  /* remove cap */
}

/* Updated Meta Panel (Sidebar Mode) */
.board-meta-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
}

/* Responsive Revert */
@media (max-width: 1100px) {
  .stage {
    flex-direction: column;
  }

  .stage-sidebar {
    width: 100%;
    height: auto;
    padding-bottom: 24px;
    overflow: visible;
  }
}


/* --- TABBED LAYOUT REFACTOR --- */

/* 1. App Container: Wide Right Panel */
.app-container {
  display: grid;
  grid-template-columns: 1fr minmax(400px, 35vw);
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: transparent;
}

/* 2. Stage: Clean Column with Controls Below */
.stage {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  padding: 2vh 2vw;
  gap: 16px;
  position: relative;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--glass-border);
  justify-content: center;
  align-items: center;
}

.board-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  align-items: center;
}

.board-wrapper {
  max-height: 76vh;
  /* Safely fit above taskbar */
  width: auto;
  aspect-ratio: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  /* Strong shadow */
}

/* 3. Horizontal Board Controls (Small Panel) */
.board-meta-panel.horizontal-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  /* Match board width roughly */
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  /* Pill shape */
  gap: 20px;
  height: 50px;
}

.horizontal-controls .status-group {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.horizontal-controls .game-nav {
  display: flex;
  gap: 4px;
}

.horizontal-controls .nav-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1rem;
}

/* 4. Right Panel (Tabs) */
.right-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  /* If hidden, handled by JS/inline style */
}

/* Ensure Analysis content flows well */
#tab-analysis .position-header {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

#tab-setup {
  padding: 24px;
}

/* --- Upload / Setup Form Styles --- */
.input-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.input-row textarea,
.input-row input[type="text"],
.input-row select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.2s ease;
  width: 100%;
}

.input-row textarea:focus,
.input-row input[type="text"]:focus,
.input-row select:focus {
  outline: none;
  border-color: rgba(226, 232, 240, 0.3);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(226, 232, 240, 0.05);
}

.input-row input[type="file"] {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  width: 100%;
  font-size: 0.85rem;
}

.input-row input[type="file"]::file-selector-button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 4px;
  margin-right: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.input-row input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.helper-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.btn-group {
  margin-bottom: 24px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.1);
}

.collapse-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 12px;
  user-select: none;
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
}

.collapse-header:hover {
  color: var(--text-main);
}

.collapse-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.collapse-content.open {
  max-height: 500px;
  opacity: 1;
  margin-bottom: 20px;
}

.panel-link-header {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  margin-top: auto;
}

.panel-link-header span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.panel-link-header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

.panel-link-header a:hover {
  color: #fff;
}

.loader {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--text-main);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn.loading .loader {
  display: block;
}

.btn.loading span {
  display: none;
}

/* Review Tabs */
.review-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 12px;
}

.review-tab {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.review-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.review-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.review-stats {
  margin-left: auto;
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

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