:root {
  --flash-text: #111827;
  --flash-muted: #64748b;
  --flash-border: #cbd5e1;
  --flash-card-bg: #ffffff;
  --flash-button-bg: #2563eb;
  --flash-button-bg-hover: #1d4ed8;
  --flash-button-text: #ffffff;
  --flash-progress-bg: #e2e8f0;
  --flash-progress-fill: #2563eb;
  --flash-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --flash-focus: #93c5fd;
  --flash-known: #16a34a;
  --flash-known-hover: #15803d;
  --flash-unknown: #dc2626;
  --flash-unknown-hover: #b91c1c;
  --flash-reset: #64748b;
  --flash-reset-hover: #475569;
}

body {
  line-height: 1.5;
}

.fc-session {
  max-width: 980px;
  margin: 0 auto;
}

.fc-topbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fc-progress-block {
  max-width: 760px;
  margin: 1.5rem auto 0;
}

.fc-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.fc-progress-title {
  font-weight: 700;
  color: inherit;
}

.fc-progress-count {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

#fc-progress-meter {
  display: block;
  width: 100%;
  height: 12px;
  appearance: none;
}

#fc-progress-meter::-webkit-progress-bar {
  background: var(--flash-progress-bg);
  border-radius: 999px;
}

#fc-progress-meter::-webkit-progress-value {
  background: var(--flash-progress-fill);
  border-radius: 999px;
}

#fc-progress-meter::-moz-progress-bar {
  background: var(--flash-progress-fill);
  border-radius: 999px;
}

.fc-scoreboard {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.fc-score-item {
  font-weight: 650;
  color: inherit;
}

#flashcard-container {
  margin-bottom: 1.25rem;
}

.flashcard.single-card {
  display: none;
  min-height: 220px;
  padding: 2rem;
  border: 1px solid var(--flash-border);
  border-radius: 10px;
  background: var(--flash-card-bg);
  color: var(--flash-text);
  box-shadow: var(--flash-shadow);
  cursor: pointer;
}

.flashcard.single-card.active-card {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.flashcard-face {
  width: 100%;
  font-size: 1.25rem;
  line-height: 1.6;
  text-align: center;
  color: inherit;
}

.flashcard-back {
  display: none;
}

.flashcard.is-revealed .flashcard-front {
  display: none;
}

.flashcard.is-revealed .flashcard-back {
  display: block;
}

.flashcard:focus {
  outline: 3px solid var(--flash-focus);
  outline-offset: 3px;
}

.flashcard-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.flashcard-controls button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.flashcard-controls button:active {
  transform: translateY(1px);
}

.flashcard-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#reveal-btn {
  background: var(--flash-button-bg);
  color: var(--flash-button-text);
}

#reveal-btn:hover {
  background: var(--flash-button-bg-hover);
}

#known-btn {
  background: var(--flash-known);
  color: #ffffff;
}

#known-btn:hover {
  background: var(--flash-known-hover);
}

#unknown-btn {
  background: var(--flash-unknown);
  color: #ffffff;
}

#unknown-btn:hover {
  background: var(--flash-unknown-hover);
}

#reset-progress-btn {
  background: var(--flash-reset);
  color: #ffffff;
}

#reset-progress-btn:hover {
  background: var(--flash-reset-hover);
}

#next-batch-btn {
  background: var(--flash-button-bg);
  color: var(--flash-button-text);
}

#next-batch-btn:hover {
  background: var(--flash-button-bg-hover);
}

.fc-summary {
  max-width: 760px;
  margin: 1.5rem auto 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--flash-border);
  border-radius: 10px;
  background: var(--flash-card-bg);
  color: var(--flash-text);
  box-shadow: var(--flash-shadow);
}

.fc-summary h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.fc-summary p {
  margin: 0.35rem 0;
}

.flashcard-notes {
  max-width: 760px;
  margin: 1.5rem auto 2rem;
}

.flashcard-notes label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 650;
  color: inherit;
}

.flashcard-notes textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 0.9rem 1rem;
  border: 1px solid var(--flash-border);
  border-radius: 8px;
  background: var(--flash-card-bg);
  color: var(--flash-text);
  font: inherit;
  line-height: 1.5;
  box-shadow: var(--flash-shadow);
}

.flashcard-notes textarea:focus {
  outline: 3px solid var(--flash-focus);
  outline-offset: 2px;
  border-color: var(--flash-button-bg);
}

.sidebar,
.sidebar-navigation {
  font-size: 0.95rem;
}

.sidebar nav[role="doc-toc"] ul,
.sidebar-navigation ul {
  gap: 0.15rem;
}

.sidebar-item {
  line-height: 1.25;
}

.sidebar-item-text,
.sidebar nav a {
  border-radius: 6px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.sidebar-item-text:hover,
.sidebar nav a:hover {
  background: rgba(37, 99, 235, 0.12);
}

.sidebar-item-text.active,
.sidebar nav a.active {
  color: #2563eb;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  :root {
    --flash-text: #111827;
    --flash-muted: #94a3b8;
    --flash-border: #94a3b8;
    --flash-card-bg: #f9fafb;
    --flash-button-bg: #60a5fa;
    --flash-button-bg-hover: #93c5fd;
    --flash-button-text: #0f172a;
    --flash-progress-bg: #334155;
    --flash-progress-fill: #60a5fa;
    --flash-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --flash-focus: #60a5fa;
    --flash-known: #22c55e;
    --flash-known-hover: #16a34a;
    --flash-unknown: #ef4444;
    --flash-unknown-hover: #dc2626;
    --flash-reset: #94a3b8;
    --flash-reset-hover: #64748b;
  }

  .fc-progress-title,
  .fc-progress-count,
  .fc-score-item {
    color: #f9fafb;
  }

  .sidebar-item-text:hover,
  .sidebar nav a:hover {
    background: rgba(96, 165, 250, 0.16);
  }

  .sidebar-item-text.active,
  .sidebar nav a.active {
    color: #5eead4;
  }
}
