:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #9aa1ac;
  --accent: #ff9900;
  --accent-text: #1a1200;
  --correct: #3fb950;
  --wrong: #f85149;
  --reword: #d29922;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #e1e4e8;
    --text: #1a1d24;
    --muted: #5a6270;
    --accent-text: #1a1200;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar h1 {
  font-size: 18px;
  margin: 0 0 8px;
}

.mode-badge {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.session-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.session-list li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}

.session-list li:hover {
  background: var(--border);
}

.session-list li.active {
  background: var(--accent);
  color: var(--accent-text);
}

.main {
  flex: 1;
  padding: 32px;
  max-width: 900px;
}

.hidden { display: none !important; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  margin-bottom: 12px;
  resize: vertical;
}

button {
  cursor: pointer;
  border-radius: 8px;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.secondary-btn {
  background: var(--border);
  color: var(--text);
}

.status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  color: var(--muted);
  border-radius: 0;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 14px;
}

.card h3 {
  margin-top: 0;
}

.card .label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}

.reveal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 6px;
  white-space: pre-wrap;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.quiz-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.quiz-summary b {
  color: var(--text);
}

.quiz-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-btn {
  background: var(--border);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 13px;
  margin: 0;
}

.filter-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.verdict {
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 10px;
  display: inline-block;
}

.verdict.correct { background: var(--correct); color: #06240c; }
.verdict.incorrect { background: var(--wrong); color: #2b0705; }
.verdict.correct_but_poorly_worded { background: var(--reword); color: #241a00; }

.mic-btn {
  background: var(--border);
}

.mic-btn.recording {
  background: var(--wrong);
  color: white;
}

.full-width-btn {
  width: 100%;
  margin-bottom: 8px;
}

.dashboard-row {
  margin-bottom: 10px;
}

.dashboard-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.progress-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
}

#exam-countdown input[type="date"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin-right: 8px;
}

.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
}

.auth-card h2 {
  margin-top: 0;
  text-align: center;
}

.auth-card input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.auth-card a {
  color: var(--accent);
}
