:root {
  --bg: #05070b;
  --bg-soft: #0b1118;
  --panel: rgba(10, 14, 20, 0.94);
  --panel-border: rgba(120, 144, 168, 0.2);
  --panel-border-strong: rgba(95, 165, 255, 0.35);
  --text-main: #e6edf5;
  --text-soft: #9aa7b7;
  --text-faint: #6c7a89;
  --accent: #6fb5ff;
  --accent-soft: rgba(111, 181, 255, 0.12);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
}

* {
  box-sizing: border-box;
}

button {
  cursor: pointer;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: 'VT323', monospace;
  background:
    radial-gradient(circle at top left, rgba(34, 82, 135, 0.18), transparent 34%),
    linear-gradient(180deg, #06080c 0%, #09111a 100%);
}

.font-arcade {
  font-family: 'Orbitron', sans-serif;
}

.font-terminal {
  font-family: 'Share Tech Mono', monospace;
}

.analysis-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.topbar {
  padding: 22px 24px;
}

.topbar-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.eyebrow {
  color: var(--accent);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0.03em;
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.page-note {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 220px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.top-link:hover {
  border-color: var(--panel-border-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.top-link.primary {
  border-color: rgba(111, 181, 255, 0.28);
  background: var(--accent-soft);
}

.analysis-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.sidebar-title {
  margin: 0 0 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-main);
}

.sidebar-note {
  margin: 0 0 14px;
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.nav-card {
  width: 100%;
  padding: 14px 14px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.nav-card:hover {
  border-color: rgba(120, 144, 168, 0.28);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.nav-card.active {
  border-color: var(--panel-border-strong);
  background: linear-gradient(180deg, rgba(111, 181, 255, 0.16), rgba(111, 181, 255, 0.06));
}

.content-stack {
  display: grid;
  gap: 16px;
}

.analysis-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.page-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.025);
}

.meta-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  background: rgba(255, 255, 255, 0.025);
}

.official-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  padding: 20px 22px;
  margin-top: 18px;
  border-color: rgba(111, 181, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(111, 181, 255, 0.1), rgba(111, 181, 255, 0.02)),
    rgba(10, 14, 20, 0.94);
}

.official-summary-copy,
.official-summary-score-block,
.official-summary-stats {
  display: grid;
  gap: 10px;
}

.official-summary-kicker {
  color: var(--accent);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.official-summary-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.official-summary-note {
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.official-summary-score {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1;
  color: #f7fbff;
  letter-spacing: 0.02em;
}

.official-summary-band {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 181, 255, 0.22);
  background: rgba(111, 181, 255, 0.1);
  color: #dceeff;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.official-summary-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.official-summary-stat {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.official-summary-stat-label,
.official-stat-label {
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.official-summary-stat-value,
.official-stat-value {
  margin-top: 8px;
  color: var(--text-main);
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  line-height: 1.3;
}

.filter-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.filter-panel-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-main);
}

.filter-panel-note {
  margin: 6px 0 0;
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 144, 168, 0.3);
  background: rgba(255, 255, 255, 0.045);
}

.filter-chip.active {
  border-color: rgba(111, 181, 255, 0.3);
  background: rgba(111, 181, 255, 0.12);
  color: #f4f9ff;
}

.filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.nav-score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.nav-score-pill,
.official-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.2);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-score-pill.ok,
.official-score-pill.ok {
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
}

.nav-score-pill.good,
.official-score-pill.good {
  border-color: rgba(111, 181, 255, 0.24);
  color: #dceeff;
  background: rgba(111, 181, 255, 0.1);
}

.nav-score-pill.warn,
.official-score-pill.warn {
  border-color: rgba(245, 158, 11, 0.24);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

.nav-score-pill.err,
.official-score-pill.err {
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.nav-score-pill.neutral,
.official-score-pill.neutral {
  border-color: rgba(120, 144, 168, 0.18);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.03);
}

.nav-score-note {
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.empty-panel {
  padding: 26px;
}

.empty-state {
  border: 1px dashed rgba(120, 144, 168, 0.22);
  border-radius: 14px;
  padding: 18px;
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
}

.section-stack {
  display: grid;
  gap: 16px;
}

.section-card {
  display: grid;
  gap: 12px;
}

.question-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(120, 144, 168, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.official-record,
.practice-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
}

.official-record {
  border: 1px solid rgba(111, 181, 255, 0.18);
  background: rgba(111, 181, 255, 0.055);
}

.practice-panel {
  border: 1px solid rgba(120, 144, 168, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.official-record-head,
.practice-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.official-record-title,
.practice-panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-main);
}

.official-record-note,
.practice-panel-note {
  margin-top: 5px;
  color: var(--text-faint);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.official-status-line {
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.official-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.official-stat {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(120, 144, 168, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.question-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.2);
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.question-label.violet {
  border-color: rgba(167, 139, 250, 0.24);
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.08);
}

.question-label.amber {
  border-color: rgba(245, 158, 11, 0.24);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
}

.question-label.green {
  border-color: rgba(34, 197, 94, 0.24);
  color: #86efac;
  background: rgba(34, 197, 94, 0.08);
}

.option-grid {
  display: grid;
  gap: 10px;
}

.option-btn,
.option-check,
.practice-input,
.practice-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(120, 144, 168, 0.2);
  background: rgba(7, 10, 15, 0.9);
  color: var(--text-main);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  line-height: 1.45;
}

.option-btn {
  padding: 12px 14px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.option-btn.selected,
.option-check.selected {
  border-color: var(--panel-border-strong);
  background: rgba(111, 181, 255, 0.1);
}

.option-check {
  display: flex;
  padding: 12px 14px;
  cursor: pointer;
}

.practice-input,
.practice-textarea {
  padding: 12px 14px;
  outline: none;
}

.practice-input:focus,
.practice-textarea:focus {
  border-color: var(--panel-border-strong);
  box-shadow: 0 0 0 3px rgba(111, 181, 255, 0.08);
}

.practice-textarea {
  min-height: 124px;
  resize: vertical;
}

.code-practice {
  min-height: 220px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 168, 0.22);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 144, 168, 0.32);
  background: rgba(255, 255, 255, 0.045);
}

.action-btn.primary {
  border-color: rgba(111, 181, 255, 0.28);
  background: rgba(111, 181, 255, 0.12);
}

.action-btn.warn {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
}

.feedback,
.answer-sheet,
.test-case {
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid rgba(120, 144, 168, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.feedback.ok {
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
}

.feedback.warn {
  border-color: rgba(245, 158, 11, 0.24);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

.feedback.err {
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.answer-sheet {
  display: grid;
  gap: 8px;
  border-color: rgba(111, 181, 255, 0.18);
  background: rgba(111, 181, 255, 0.06);
}

.recall-note-sheet {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.test-case-list {
  display: grid;
  gap: 10px;
}

.test-case {
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .analysis-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .official-summary-card {
    grid-template-columns: 1fr;
  }

  .official-summary-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .analysis-shell {
    width: calc(100vw - 18px);
    max-width: 100%;
    padding-top: 10px;
    padding-bottom: 28px;
  }

  .topbar {
    padding: 18px;
  }

  .topbar-row {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
    min-width: 0;
  }

  .top-link {
    flex: 1 1 0;
  }

  .sidebar {
    padding: 16px;
  }

  .filter-bar {
    gap: 8px;
  }

  .filter-chip {
    width: 100%;
    justify-content: space-between;
  }

  .official-record-head,
  .practice-panel-header {
    flex-direction: column;
  }
}
