:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #14202b;
  --muted: #5c6975;
  --line: #d9e1e8;
  --panel: #ffffff;
  --road: #24313b;
  --sky: #dfeffc;
  --blue: #0f3d5e;
  --blue-soft: #d8eaf7;
  --yellow: #f5c542;
  --green: #247b5b;
  --red: #b33b31;
  --bg: #eef4f7;
  --page-top: #e6f2f8;
  --page-bottom: #f7f9fb;
  --surface: #fff;
  --surface-soft: #f4f7fa;
  --surface-tint: #f4f9f8;
  --surface-detail: #f1f7f7;
  --hover: #e8f2f0;
  --track: #dce7ee;
  --path-line: #dce4e8;
  --success-bg: #eaf7f1;
  --success-answer: #e4f5ed;
  --danger-bg: #fff0ee;
  --danger-answer: #fae8e5;
  --button-text: #fff;
  --score-bg: #24313b;
  --score-muted: #cdd8df;
  --shadow: rgba(24, 45, 61, 0.08);
  --sticky-bg: rgba(238, 244, 247, 0.92);
  --account-start: #d7eef0;
  --account-end: #e2edf9;
  --account-border: #b7d7de;
  --account-muted: #3f5f6b;
  --account-chip: rgba(255, 255, 255, 0.65);
  --recommendation-border: #71ad86;
  --recommendation-ink: #206137;
  --recommendation-glow: rgba(62, 154, 94, 0.15);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef2f0;
  --muted: #bac7c4;
  --line: #3a4a4b;
  --panel: #202b2b;
  --road: #283532;
  --sky: #7693a0;
  --blue: #8dd7d4;
  --blue-soft: #294344;
  --yellow: #f0c962;
  --green: #78d3a9;
  --red: #f28d82;
  --bg: #151c1d;
  --page-top: #1b2929;
  --page-bottom: #151c1d;
  --surface: #202b2b;
  --surface-soft: #263435;
  --surface-tint: #223230;
  --surface-detail: #263836;
  --hover: #304542;
  --track: #3b5150;
  --path-line: #58706a;
  --success-bg: #223d32;
  --success-answer: #244538;
  --danger-bg: #482e30;
  --danger-answer: #512f31;
  --button-text: #122624;
  --score-bg: #293838;
  --score-muted: #d2dfd9;
  --shadow: rgba(0, 0, 0, 0.2);
  --sticky-bg: rgba(21, 28, 29, 0.94);
  --account-start: #203f40;
  --account-end: #263b50;
  --account-border: #42646e;
  --account-muted: #c5dadd;
  --account-chip: rgba(255, 255, 255, 0.08);
  --recommendation-border: #7ccf99;
  --recommendation-ink: #b1edc3;
  --recommendation-glow: rgba(100, 203, 135, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--page-top) 0%, var(--bg) 42%, var(--page-bottom) 100%);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1380px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex: 0 1 476px;
  gap: 12px;
  min-width: 0;
}

.theme-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--blue);
  outline: 2px solid transparent;
}

.theme-icon {
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: 1.4rem;
  line-height: 1;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: 0.98;
  margin-bottom: 0;
}

h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.score-strip {
  background: var(--score-bg);
  border-radius: 8px;
  color: white;
  display: grid;
  flex: 1;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
}

.score-strip > div {
  background: rgba(255, 255, 255, 0.08);
  padding: 13px 16px;
}

.score-strip span {
  display: block;
  font-size: 1.45rem;
  font-weight: 850;
}

.score-strip small {
  color: var(--score-muted);
  display: block;
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.visual-filters { position: absolute; pointer-events: none; }

.score-strip > .streak-score {
  position: relative;
  padding-right: 64px;
}

.score-strip .study-day-fire {
  --fire-unit: 4px;
  position: absolute;
  right: 12px;
  top: 50%;
  width: calc(10 * var(--fire-unit));
  height: calc(15 * var(--fire-unit));
  overflow: hidden;
  transform: translateY(-50%);
  pointer-events: none;
  animation: study-fire-enter 650ms cubic-bezier(.16, 1, .3, 1) both;
}

/* Frame the original GIF's pixel art without changing its animation or file.
   The SVG filter removes only its white canvas in both color themes. */
.study-day-fire img {
  position: absolute;
  width: calc(32 * var(--fire-unit));
  height: calc(32 * var(--fire-unit));
  max-width: none;
  left: calc(-11 * var(--fire-unit));
  top: calc(-11 * var(--fire-unit));
  image-rendering: pixelated;
  filter: url(#fire-white-key);
}

.score-strip .study-day-fire-still { display: none; }

@keyframes study-fire-enter {
  from { opacity: 0; transform: translateY(calc(-50% + 8px)) scale(.65); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .score-strip .study-day-fire { animation: none; }
  .study-day-fire img { display: none; }
  .score-strip .study-day-fire-still {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 2rem;
  }
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: 270px minmax(0, 1fr) 280px;
  grid-template-areas: "modes quiz review" "sidebar quiz review";
  grid-template-rows: auto 1fr;
  align-items: start;
  margin: 0 auto;
  max-width: 1380px;
}

.study-day-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--ink);
}

.study-day-status-check {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: var(--panel);
  font-weight: 850;
}

.study-day-status strong { display: block; }
.study-day-status p { margin: 4px 0 0; font-size: .87rem; line-height: 1.5; }

.panel.mode-panel {
  grid-area: modes;
  margin-bottom: 0;
}

.sidebar {
  grid-area: sidebar;
  min-width: 0;
}

.right-rail {
  grid-area: review;
}

.panel,
.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 38px var(--shadow);
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
}

.segmented {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr;
  padding: 4px;
}

.mode-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  min-height: 42px;
}

.mode-button.active {
  background: var(--blue);
  color: var(--button-text);
  font-weight: 800;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
}

select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.progress-track {
  background: var(--track);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--yellow), var(--green));
  height: 100%;
  transition: width 240ms ease;
  width: 0%;
}

.progress-panel p,
.tips p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
  margin: 10px 0 0;
}

.quiz-area {
  grid-area: quiz;
  min-width: 0;
}

.quiz-area.path-overview > .question-card,
.quiz-area.path-overview > .actions,
.quiz-area.path-overview > .exam-banner {
  display: none;
}

.path-view {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.path-hero {
  align-items: end;
  background: linear-gradient(0deg, rgba(10, 29, 37, .86), rgba(10, 29, 37, .08) 90%), url("assets/ciudad-camino.webp") center 56% / cover;
  color: #fff;
  display: flex;
  min-height: 210px;
  padding: 24px;
}

.path-hero h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
}

.path-hero p {
  margin: 0;
}

.path-kicker {
  font-size: .76rem;
  font-weight: 800;
  margin-bottom: 5px !important;
  text-transform: uppercase;
}

.day-plan {
  background: var(--surface-tint);
  border-bottom: 1px solid var(--line);
  padding: 20px 24px 18px;
}

.day-plan-top {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.day-plan-label {
  color: var(--green);
  font-size: .77rem;
  font-weight: 800;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.day-plan-top h2 {
  font-size: 1.35rem;
  margin: 0;
}

.day-plan-top select {
  min-width: 108px;
  width: auto;
}

.day-plan-track {
  background: var(--track);
  border-radius: 999px;
  height: 8px;
  margin-top: 17px;
  overflow: hidden;
}

.day-plan-track span {
  background: var(--green);
  display: block;
  height: 100%;
}

.day-plan-summary {
  color: var(--muted);
  font-size: .82rem;
  margin: 7px 0 12px;
}

.study-recommendations {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  min-width: 0;
  padding: 12px;
}

.study-recommendations-copy {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.study-recommendations-copy strong {
  color: var(--ink);
}

.study-recommendation-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.study-recommendation-day {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.35;
  max-width: 100%;
  min-height: 44px;
  overflow-wrap: anywhere;
  padding: 8px 12px;
  text-align: left;
}

.day-lessons {
  border-top: 1px solid var(--line);
}

.day-lesson {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  gap: 12px;
  min-height: 64px;
  padding: 9px 0;
  text-align: left;
  width: 100%;
}

.day-lesson:hover,
.day-lesson:focus-visible {
  background: var(--hover);
  outline: none;
}

.day-lesson-number {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 50%;
  color: var(--blue);
  display: flex;
  flex: 0 0 36px;
  font-size: .87rem;
  font-weight: 800;
  height: 36px;
  justify-content: center;
}

.day-lesson.complete .day-lesson-number { background: var(--green); color: var(--button-text); }
.day-lesson.needs-review .day-lesson-number { background: #c38813; color: #fff; }

.day-lesson span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.day-lesson small {
  color: var(--muted);
  font-size: .75rem;
}

.day-lesson strong {
  font-size: .9rem;
  line-height: 1.2;
}

.path-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 20px 24px 4px;
}

.path-heading h2 {
  font-size: 1.1rem;
  margin: 0;
}

.path-heading span,
.path-detail-head small {
  color: var(--muted);
  font-size: .82rem;
}

.theme-path,
.lesson-path {
  display: grid;
  gap: 12px;
  margin: 14px auto 28px;
  max-width: 650px;
  padding: 0 24px;
  position: relative;
}

.theme-path::before,
.lesson-path::before {
  background: var(--path-line);
  border: 3px solid var(--surface);
  border-radius: 999px;
  bottom: 36px;
  content: "";
  left: 50%;
  position: absolute;
  top: 36px;
  transform: translateX(-50%);
  width: 12px;
}

.theme-node,
.lesson-node {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 14px;
  min-height: 90px;
  padding: 12px 15px;
  position: relative;
  text-align: left;
  width: min(84%, 480px);
  z-index: 1;
}

.theme-node:nth-child(odd),
.lesson-node:nth-child(odd) {
  justify-self: start;
}

.theme-node:nth-child(even),
.lesson-node:nth-child(even) {
  justify-self: end;
}

.theme-node:hover,
.lesson-node:hover,
.theme-node:focus-visible,
.lesson-node:focus-visible {
  border-color: #32808f;
  box-shadow: 0 4px 16px rgba(24, 45, 61, .12);
  outline: none;
}

.theme-dot,
.lesson-dot {
  align-items: center;
  background: #0f8cbe;
  border: 4px solid #dcf4fb;
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 54px;
  font-size: 1.05rem;
  font-weight: 850;
  height: 54px;
  justify-content: center;
}

.theme-node:nth-child(5n + 2) .theme-dot,
.lesson-node:nth-child(5n + 2) .lesson-dot { background: #cf4380; border-color: #fbe5ef; }
.theme-node:nth-child(5n + 3) .theme-dot,
.lesson-node:nth-child(5n + 3) .lesson-dot { background: #dfad16; border-color: #fff5cf; }
.theme-node:nth-child(5n + 4) .theme-dot,
.lesson-node:nth-child(5n + 4) .lesson-dot { background: #e4662b; border-color: #fff0e5; }
.theme-node:nth-child(5n) .theme-dot,
.lesson-node:nth-child(5n) .lesson-dot { background: #9b4cb4; border-color: #f6eaf9; }

.theme-node.complete .theme-dot,
.lesson-node.complete .lesson-dot { background: var(--green); border-color: #dff2e8; color: var(--button-text); }

.theme-node.needs-review .theme-dot,
.lesson-node.needs-review .lesson-dot { background: #c38813; border-color: #fff0c7; }

.theme-node-copy,
.lesson-node-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.theme-node-copy small,
.lesson-node-copy small {
  color: var(--muted);
  font-size: .78rem;
}

.theme-node-copy strong,
.lesson-node-copy strong {
  font-size: .96rem;
  line-height: 1.25;
}

.theme-node-copy em {
  color: var(--muted);
  font-size: .78rem;
  font-style: normal;
}

.theme-chevron {
  color: var(--muted);
  font-size: 1.8rem;
  margin-left: auto;
}

.path-detail-head {
  background: var(--surface-detail);
  padding: 22px 24px;
}

.path-detail-head p {
  color: var(--blue);
  font-size: .8rem;
  font-weight: 800;
  margin: 18px 0 4px;
  text-transform: uppercase;
}

.path-detail-head h2 {
  font-size: 1.55rem;
  margin: 0 0 18px;
}

.path-progress {
  background: var(--track);
  border-radius: 999px;
  height: 10px;
  margin-bottom: 7px;
  overflow: hidden;
}

.path-progress span {
  background: #c38813;
  display: block;
  height: 100%;
}

.path-progress.complete span { background: var(--green); }

.path-back {
  background: transparent;
  border: 0;
  color: var(--blue);
  font-weight: 800;
  padding: 0;
}

.path-lesson-bar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 14px 18px;
}

.exam-banner {
  align-items: center;
  background: var(--blue);
  border-radius: 8px 8px 0 0;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}

.question-card {
  min-height: 560px;
  padding: clamp(18px, 3vw, 34px);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.question-meta span {
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 7px 11px;
}

#questionText {
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  line-height: 1.12;
  margin-bottom: 22px;
}

.sign-scene {
  align-items: center;
  background:
    linear-gradient(180deg, var(--sky) 0 52%, #9dc278 52% 70%, var(--road) 70% 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  min-height: 154px;
  overflow: hidden;
  position: relative;
}

.sign-scene::after {
  background: repeating-linear-gradient(90deg, transparent 0 54px, rgba(255, 255, 255, 0.75) 54px 88px);
  bottom: 24px;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
}

.sign {
  align-items: center;
  background: white;
  color: #14202b;
  display: flex;
  font-size: 2.1rem;
  font-weight: 900;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.sign.circle {
  border: 12px solid var(--red);
  border-radius: 50%;
  height: 104px;
  width: 104px;
}

.sign.triangle {
  background: transparent;
  border-bottom: 105px solid white;
  border-left: 66px solid transparent;
  border-right: 66px solid transparent;
  height: 0;
  width: 0;
}

.sign.triangle span {
  display: block;
  margin-left: -16px;
  margin-top: 36px;
  position: absolute;
}

.sign.square {
  border: 8px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  height: 105px;
  width: 105px;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer-button {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 12px;
  line-height: 1.35;
  min-height: 58px;
  padding: 15px;
  text-align: left;
}

.answer-letter {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 6px;
  display: inline-flex;
  flex: 0 0 32px;
  font-weight: 850;
  height: 32px;
  justify-content: center;
}

.answer-button:hover {
  border-color: var(--blue);
}

.answer-button.selected {
  background: var(--blue-soft);
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.answer-button.correct {
  background: var(--success-answer);
  border-color: var(--green);
}

.answer-button.wrong {
  background: var(--danger-answer);
  border-color: var(--red);
}

.answer-button:disabled {
  cursor: default;
}

.feedback {
  border-left: 5px solid var(--blue);
  color: var(--ink);
  line-height: 1.5;
  margin-top: 18px;
  padding: 12px 14px;
}

.feedback.good {
  border-color: var(--green);
  background: var(--success-bg);
}

.feedback.bad {
  border-color: var(--red);
  background: var(--danger-bg);
}

.feedback-sources {
  font-size: .82rem;
  margin-top: 10px;
}

.feedback-sources a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.exam-review {
  margin-top: 24px;
}

.exam-review > p {
  color: var(--muted);
}

.exam-review-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  padding: 16px;
  line-height: 1.5;
}

.exam-review-item summary {
  cursor: pointer;
}

.exam-review-item summary strong {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .85rem;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.primary-button,
.ghost-button {
  border-radius: 8px;
  font-weight: 850;
  min-height: 48px;
  padding: 0 18px;
}

.primary-button {
  background: var(--yellow);
  border: 1px solid #d4a72e;
  color: #1c2530;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--blue);
}

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

.mistake-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 10px;
}

.mistake-review {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.mistake-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.mistake-heading strong,
.mistake-item > strong {
  color: var(--ink);
  display: block;
}

.mistake-counter {
  color: var(--muted);
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.traffic-light {
  align-items: center;
  background: #1f2933;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px 4px;
}

.traffic-light i {
  background: #607080;
  border-radius: 50%;
  display: block;
  height: 8px;
  opacity: 0.55;
  width: 8px;
}

.traffic-light.red i:first-child {
  background: var(--red);
  opacity: 1;
}

.traffic-light.yellow i:nth-child(2) {
  background: var(--yellow);
  opacity: 1;
}

.traffic-light.green i:nth-child(3) {
  background: var(--green);
  opacity: 1;
}

.mistake-item.cleared {
  background: var(--success-bg);
}

.mistake-answer {
  border-left: 4px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  margin: 0;
  padding: 8px 10px;
}

.mistake-answer b {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.mistake-answer.wrong {
  background: var(--danger-bg);
  border-color: var(--red);
}

.mistake-answer.correct {
  background: var(--success-bg);
  border-color: var(--green);
}

.mistake-toggle {
  background: var(--surface);
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  font-weight: 850;
  min-height: 42px;
  padding: 0 12px;
}

.auth-shell {
  align-items: center;
  background: url("assets/ciudad-acceso.webp") center center / cover no-repeat;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.study-guide { border-top: 1px solid var(--line); padding: 18px 0; }
.study-guide h2 { font-size: 1rem; margin: 0 0 12px; }
#studyGuideDays { display: grid; gap: 0; max-height: 620px; overflow-y: auto; }
.guide-day { background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 12px 10px; display: grid; gap: 6px; width: 100%; text-align: left; }
.guide-day span { font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.guide-day small { color: var(--muted); }
.guide-day:hover, .guide-day[aria-current="step"] { background: var(--blue-soft); }
.guide-day[aria-current="step"] { border-left: 3px solid var(--blue); }
.guide-day.complete strong { color: var(--green); }

/* Study recommendations stay visible without adding motion to the learning path. */
:is(.guide-day, .day-lesson, .theme-node, .lesson-node, .study-recommendation-day).is-recommended {
  border-color: var(--recommendation-border);
  box-shadow: inset 0 0 0 1px var(--recommendation-border), 0 0 14px var(--recommendation-glow);
  outline: 1px solid var(--recommendation-border);
  outline-offset: -1px;
}

:is(.guide-day, .day-lesson, .theme-node, .lesson-node, .study-recommendation-day).is-recommended:hover {
  border-color: var(--recommendation-border);
  box-shadow: inset 0 0 0 1px var(--recommendation-border), 0 0 18px var(--recommendation-glow);
}

:is(.guide-day, .day-lesson, .theme-node, .lesson-node, .study-recommendation-day).is-recommended:focus-visible {
  border-color: var(--recommendation-ink);
  outline: 2px solid var(--recommendation-ink);
  outline-offset: -2px;
}

.day-lesson.is-recommended {
  border-radius: 7px;
  padding-left: 10px;
  padding-right: 10px;
}

.guide-day.is-recommended {
  background: transparent;
}

.guide-day.is-recommended:hover,
.guide-day.is-recommended:focus-visible,
.day-lesson.is-recommended:hover,
.day-lesson.is-recommended:focus-visible {
  background: var(--surface-soft);
}

.recommendation-badge,
.guide-day .recommendation-badge,
.day-lesson .recommendation-badge,
.theme-node-copy .recommendation-badge,
.lesson-node-copy .recommendation-badge {
  background: transparent;
  border: 1px solid var(--recommendation-border);
  border-radius: 999px;
  color: var(--recommendation-ink);
  display: inline-flex;
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
  justify-self: start;
  line-height: 1.4;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 8px;
  width: fit-content;
}

/* Entry motion is added only when content enters the viewport; the default stays visible. */
.entry-reveal {
  --entry-x: 0px;
  --entry-y: 18px;
  animation: content-enter 480ms cubic-bezier(.22, 1, .36, 1) var(--entry-delay, 0ms) both;
}

.entry-reveal[data-entry-kind="guide"] {
  --entry-x: -24px;
  --entry-y: 0px;
}

.entry-reveal[data-entry-kind="review"] {
  --entry-x: 12px;
  --entry-y: 6px;
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translate3d(var(--entry-x), var(--entry-y), 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-reveal { animation: none; }
}
.guide-day .guide-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.guide-day-heading strong { min-width: 0; }
.guide-day .milestone-sign { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 4px solid #d52b31; border-radius: 50%; background: #fff; color: #161616; font-size: 16px; line-height: 1; font-weight: 800; box-shadow: 0 1px 3px var(--shadow); }
.guide-day .milestone-sign.unlimited { border-color: #747474; background: repeating-linear-gradient(135deg, #fff 0 5px, #777 5px 8px); }

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 38px var(--shadow);
  padding: 28px;
  width: min(100%, 440px);
}

.auth-panel h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 22px;
}

.auth-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
}

.auth-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 800;
  min-height: 42px;
  padding: 0 2px;
}

.auth-tab.active {
  border-bottom-color: var(--blue);
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label:not(.check-field) {
  color: var(--ink);
  display: grid;
  font-size: .9rem;
  font-weight: 700;
  gap: 6px;
}

.auth-form input:not([type="checkbox"]) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.auth-form input:focus-visible {
  border-color: var(--blue);
  outline: 2px solid var(--blue-soft);
}

.auth-form .primary-button {
  width: 100%;
}

.check-field {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: .86rem;
  gap: 10px;
  line-height: 1.35;
}

.check-field input {
  flex: 0 0 auto;
  margin-top: 2px;
}

a,
.text-button {
  color: var(--blue);
}

.text-button {
  background: transparent;
  border: 0;
  font-weight: 750;
  padding: 6px 0;
  text-align: left;
}

.text-button:hover,
.text-button:focus-visible,
a:hover,
a:focus-visible {
  text-decoration: underline;
}

.auth-message {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
  margin: 16px 0 0;
  min-height: 1.3em;
}

.auth-message.error,
.sync-error {
  color: var(--red);
}

.account-bar {
  align-items: center;
  background: linear-gradient(110deg, var(--account-start), var(--account-end));
  border: 1px solid var(--account-border);
  border-radius: 10px;
  color: var(--account-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .85rem;
  gap: 8px 16px;
  justify-content: flex-start;
  margin: 0 auto 14px;
  max-width: 1380px;
  padding: 8px 14px;
}

.account-bar #accountName {
  background: var(--account-chip);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 800;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 7px 10px;
}

.account-bar #logoutButton {
  background: var(--surface);
  border: 1px solid var(--account-border);
  border-radius: 7px;
  color: var(--blue);
  min-height: 44px;
  padding: 8px 12px;
  text-align: left;
}

.account-bar #logoutButton:hover,
.account-bar #logoutButton:focus-visible {
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.account-bar #syncStatus {
  line-height: 1.4;
  margin-left: auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-bar #syncStatus:empty {
  display: none;
}

.account-bar #syncStatus.sync-error {
  background: var(--danger-bg);
  border-radius: 6px;
  color: var(--red);
  padding: 6px 8px;
}

.legal-page {
  margin: 0 auto;
  max-width: 760px;
  padding: 40px 20px 80px;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 24px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas: "modes quiz" "sidebar quiz" "review review";
    grid-template-rows: auto 1fr auto;
  }

  .right-rail {
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 80px;
  }

  .app-shell {
    padding: 14px;
  }

  .topbar,
  .right-rail {
    display: block;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .mode-panel {
    order: 0;
    align-self: stretch;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px;
  }

  .mode-panel h2 {
    display: none;
  }

  .mode-panel .segmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mode-panel .mode-button {
    min-height: 44px;
    min-width: 0;
    padding: 6px 2px;
    font-size: .9rem;
  }

  .quiz-area { order: 1; width: 100%; }
  .sidebar { order: 2; width: 100%; }
  .right-rail { order: 3; width: 100%; }

  .score-strip {
    margin-top: 14px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    margin-top: 14px;
    width: 100%;
  }

  .topbar-actions .score-strip {
    margin-top: 0;
  }

  .score-strip > .streak-score { padding-right: 48px; }
  .score-strip .study-day-fire { --fire-unit: 3px; right: 8px; }

  .auth-panel { padding: 22px; }
  .account-bar { gap: 8px 10px; justify-content: flex-start; margin-top: 0; padding: 10px; }
  .account-bar #syncStatus { flex-basis: 100%; margin-left: 0; }

  .question-card {
    min-height: 0;
  }

  .actions {
    position: sticky;
    bottom: 0;
    background: var(--sticky-bg);
    padding: 10px 0;
  }

  .theme-path,
  .lesson-path { padding: 0 16px; }

  .day-plan { padding: 18px 16px; }

  .theme-node,
  .lesson-node { width: 91%; }

  .theme-dot,
  .lesson-dot { flex-basis: 44px; height: 44px; }

  .theme-node-copy strong,
  .lesson-node-copy strong { font-size: .87rem; }
}

.analytics-choice{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);width:min(620px,calc(100% - 28px));padding:20px;background:var(--panel,#fff);color:var(--text,#183b2b);border:1px solid #b7cbbb;border-radius:18px;box-shadow:0 12px 48px #0003;z-index:50}.analytics-choice p{font-size:13px;line-height:1.5}.analytics-buttons{display:flex;gap:12px;flex-wrap:wrap}.analytics-buttons button{flex:1;min-width:160px}.analytics-footer{padding:20px;text-align:center}.analytics-footer span{display:block;font-size:12px;margin-top:8px}.analytics-choice[hidden]{display:none}

