/* ==========================================================================
   Kovrio — stylesheet
   Warm editorial theme: cream page, ink-navy type, amber accent.
   Headings are Space Grotesk (geometric sans); body/UI is Inter.
   Flat solid colors only -- no gradients, no glow shadows anywhere.
   Red/green are reserved exclusively for quiz correct/incorrect feedback.
   Mobile-first: base rules target small screens, the @media query near the
   bottom adds breathing room on larger ones.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------- */
:root {
  /* Surfaces: cards sit one subtle step above the cream page, so they
     separate by value + border rather than by a drop shadow. */
  --color-bg: #f7f3ec;
  --color-surface: #fbf9f4;
  --color-surface-sunk: #f2ece0;

  --color-text: #1e2340;
  --color-muted: #6b6a74;
  --color-border: #e5dfd2;
  --color-border-strong: #d4cbb8;

  /* Amber accent: buttons, active states, progress, highlights. */
  --color-primary: #d9a441;
  --color-primary-dark: #c08f32;
  --color-primary-tint: #f0dfb8;
  /* Darkened amber for text/links that need real contrast on cream. */
  --color-primary-ink: #8a6420;

  /* Ink navy used as a solid fill (header, primary buttons). */
  --color-ink: #1e2340;
  --color-ink-hover: #2b3156;
  --color-on-ink: #f7f3ec;
  --color-on-ink-muted: #b9b7c6;

  /* --- Quiz feedback ONLY. Do not use these outside correct/incorrect. ---
     Hues sit far from the amber accent so they stay distinguishable. */
  --color-correct-bg: #e4f3e8;
  --color-correct-text: #1a6b36;
  --color-correct-border: #2e8b4f;

  --color-incorrect-bg: #fbe9e7;
  --color-incorrect-text: #b3261e;
  --color-incorrect-border: #d1372c;

  --radius: 4px;
  --max-width: 640px;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

/* ---- Reset / base ----------------------------------------------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  /* Space Grotesk sets wide by default -- a touch of negative tracking
     keeps display sizes feeling deliberate rather than airy. */
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: 1.75rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-primary-ink);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* ---- Layout ------------------------------------------------------------ */
.page-header {
  background: var(--color-ink);
  border-bottom: 3px solid var(--color-primary);
  padding: 1rem 1.25rem;
}

.page-header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--color-on-ink);
}

.site-tagline {
  margin-top: 0.15rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-primary);
}

.page-header nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--color-on-ink-muted);
}

.page-header nav a:hover {
  color: var(--color-on-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* Trademark attribution line under the footer text. */
.footer-legal {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ---- Homepage: subject / unit list ---------------------------------- */
.intro {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Section heading above the card list. Plainly set -- the cards below are
   the structure, so this doesn't need a rule under it to prove it. */
#list-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

/* Homepage-only layout: content column plus a side note. Stacked on
   mobile; becomes a real sidebar at the 700px breakpoint below. */
.home-content {
  min-width: 0;
}

.home-sidebar {
  margin-top: 2rem;
}

#back-link {
  margin-bottom: 1.25rem;
}

.quiz-card {
  display: block;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.quiz-card:hover,
.quiz-card:focus-visible {
  border-color: var(--color-border-strong);
  border-left-color: var(--color-primary);
  background: #fffdf8;
}

/* Cards that lead somewhere primary (subjects, units) carry the amber rule
   at rest. Flat fill -- the accent is the rule, not a gradient. */
.quiz-card-featured {
  border-left-color: var(--color-primary);
  padding: 1.15rem 1.2rem;
}

/* ---- Card icons ------------------------------------------------------ */
/* Subject cards carry a small flat line-art mark. The icon is decorative
   -- the card's text already names the subject -- so it's aria-hidden in
   the markup and inherits its color from the card via currentColor. */
.quiz-card.has-icon {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.card-icon {
  flex-shrink: 0;
  display: block;
  color: var(--color-primary-ink);
  margin-top: 0.1rem;
  transition: color 0.12s ease;
}

.quiz-card:hover .card-icon,
.quiz-card:focus-visible .card-icon {
  color: var(--color-ink);
}

/* The text column, so the icon doesn't squash the topic/CTA lines. */
.card-body {
  display: block;
  min-width: 0;
}

.quiz-card .quiz-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.quiz-card .quiz-topic {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--color-text);
}

.quiz-card .quiz-cta {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
}

.quiz-card:hover .quiz-cta {
  color: var(--color-primary-ink);
}

.empty-state {
  color: var(--color-muted);
}

/* ---- Study tip card (homepage sidebar) --------------------------------
   js/homepage.js fills it with the 90% advice, or the student's lowest
   score so far with a link back to that quiz. */
.study-tip {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  font-size: 0.85rem;
  line-height: 1.5;
}

.study-tip a {
  color: var(--color-text);
  font-weight: 600;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
}

.mastery-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--color-primary-tint);
  border: 1px solid #e0cb9b;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--color-text);
  font-size: 0.88rem;
  line-height: 1.5;
}

.mastery-note::before {
  content: "";
  flex-shrink: 0;
  width: 3px;
  align-self: stretch;
  background: var(--color-primary-dark);
}

/* ---- Inline note, used for lightweight callouts ---------------------- */
.recommendation-note {
  background: var(--color-surface-sunk);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.recommendation-note a {
  color: var(--color-text);
  font-weight: 600;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
}
/* ---- Landing screen (landing.html): the unit picker ------------------- */
.landing-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
}

.landing-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.landing-heading {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.landing-unit-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.landing-unit-button {
  width: 100%;
  text-align: center;
}

.landing-skip {
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  min-height: 0;
}

/* ---- Unit page (unit.html): lesson list ------------------------------- */
#lesson-list {
  margin-bottom: 1rem;
}

.whole-unit-button {
  display: block;
}

/* ---- Quiz page: shared card look ------------------------------------ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.hidden {
  display: none !important;
}

/* ---- Quiz page: in-progress state ------------------------------------ */
.quiz-topic-heading {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.progress-text {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.options-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-button {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.98rem;
  padding: 0.8rem 1rem;
  min-height: 48px; /* comfortable tap target on phones */
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.option-button:hover:not(:disabled) {
  border-color: var(--color-primary);
}

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

/* Feedback states, applied after an answer is picked */
.option-button.correct {
  background: var(--color-correct-bg);
  border-color: var(--color-correct-border);
  color: var(--color-correct-text);
  font-weight: 600;
}

.option-button.incorrect {
  background: var(--color-incorrect-bg);
  border-color: var(--color-incorrect-border);
  color: var(--color-incorrect-text);
  font-weight: 600;
}

.feedback-box {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.feedback-box.correct {
  background: var(--color-correct-bg);
  color: var(--color-correct-text);
}

.feedback-box.incorrect {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
}

.feedback-box .feedback-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn-primary {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  border: 1px solid var(--color-primary-dark);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  display: inline-block;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

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

/* ---- Quiz page: results screen --------------------------------------- */
.score-summary {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Circular progress ring showing the score visually. The fill circle's
   stroke-dasharray/offset are set in JS based on the score percentage --
   see js/quiz.js (SCORE_RING_CIRCUMFERENCE matches r=52 below). */
.score-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 0.5rem;
}

.score-ring {
  width: 100%;
  height: 100%;
  /* Rotate so the fill starts at the top of the circle instead of the right. */
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 10;
}

.score-ring-fill {
  fill: none;
  stroke: url(#score-ring-gradient);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-summary .score-percent {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--color-primary);
}

.score-summary .score-fraction {
  color: var(--color-muted);
}

.missed-list h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.missed-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.missed-item .missed-question {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.missed-item .missed-answer-line {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.missed-item .your-answer {
  color: var(--color-incorrect-text);
}

.missed-item .correct-answer {
  color: var(--color-correct-text);
}

.missed-item .missed-explanation {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.4rem;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---- Loading / error states -------------------------------------------- */
.status-message {
  color: var(--color-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ---- About page --------------------------------------------------------- */
.about-content h2 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

/* Subject list: same rhythm as the surrounding paragraphs. */
.about-content ul {
  margin: 0 0 1em;
  padding-left: 1.25rem;
}

.about-content li {
  margin-bottom: 0.35rem;
}

.disclaimer {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* ---- Slightly roomier layout on larger screens ------------------------- */
@media (min-width: 700px) {
  main {
    padding-top: 2.5rem;
  }

  .score-summary .score-percent {
    font-size: 3rem;
  }

  .home-layout {
    max-width: calc(var(--max-width) + 260px);
    display: flex;
    align-items: flex-start;
    gap: 2rem;
  }

  .home-content {
    max-width: var(--max-width);
    flex: 1;
  }

  .home-sidebar {
    width: 220px;
    flex-shrink: 0;
    margin-top: 0.25rem;
  }
}

/* ==========================================================================
   History + Insights pages
   Score bands are the one place outside quiz feedback that uses color to
   carry meaning, so they reuse the existing correct/incorrect hues rather
   than introducing a third scale: green = mastered, amber = solid,
   red = shaky. Flat fills and 1px borders throughout, same as everywhere.
   ========================================================================== */

/* Current page in the header nav -- an underline in the amber accent, so
   it reads as "you are here" without a filled pill. */
.page-header nav a.is-current {
  color: var(--color-on-ink);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 2px;
}

.page-lede {
  color: var(--color-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.page-footnote {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* ---- Shared score bands ---------------------------------------------- */
.band-mastered .history-bar-fill,
.band-mastered .topic-bar-fill {
  background: var(--color-correct-border);
}
.band-solid .history-bar-fill,
.band-solid .topic-bar-fill {
  background: var(--color-primary);
}
.band-shaky .history-bar-fill,
.band-shaky .topic-bar-fill {
  background: var(--color-incorrect-border);
}

.band-mastered .history-score strong,
.band-mastered .topic-score {
  color: var(--color-correct-text);
}
.band-shaky .history-score strong,
.band-shaky .topic-score {
  color: var(--color-incorrect-text);
}

/* ---- History list ----------------------------------------------------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-row,
.topic-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.history-row:hover,
.history-row:focus-visible,
.topic-row:hover,
.topic-row:focus-visible {
  border-left-color: var(--color-primary);
  background: #fffdf8;
}

.history-icon {
  flex-shrink: 0;
  color: var(--color-primary-ink);
}

.history-body,
.topic-body {
  flex: 1;
  min-width: 0;
}

.history-title,
.topic-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
}

.history-meta,
.topic-meta {
  display: block;
  color: var(--color-muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

/* The bar is the scannable part: ten rows of these make a shape you read
   faster than ten percentages. */
.history-bar,
.topic-bar {
  display: block;
  height: 5px;
  margin-top: 0.5rem;
  background: var(--color-surface-sunk);
  border-radius: 2px;
  overflow: hidden;
}

.history-bar-fill,
.topic-bar-fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
}

.history-score {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.history-score strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.history-score small {
  color: var(--color-muted);
  font-size: 0.72rem;
}

.topic-score {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

/* ---- Insights: stat row ----------------------------------------------- */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.stat {
  flex: 1 1 8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
}

.stat-icon {
  color: var(--color-primary-ink);
  margin-bottom: 0.15rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.1;
}

.stat-label {
  color: var(--color-muted);
  font-size: 0.78rem;
}

/* ---- Insights: sections + plan ---------------------------------------- */
.insight-section {
  margin-bottom: 2rem;
}

.insight-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.section-icon {
  flex-shrink: 0;
  color: var(--color-primary-ink);
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Each step is a flat amber-tint card -- the plan is the point of the
   page, so it gets the accent surface and the lists below stay plain. */
.plan-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-primary-tint);
  border: 1px solid #e0cb9b;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.plan-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--color-primary-ink);
}

.plan-body {
  min-width: 0;
}

.plan-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.plan-cta {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-ink);
}

/* ---- Blank slates ------------------------------------------------------ */
.blank-slate {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  text-align: center;
}

.empty-icon {
  color: var(--color-border-strong);
  margin-bottom: 0.75rem;
}

.blank-slate p {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.blank-slate .blank-slate-note {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-muted);
  max-width: 34ch;
  margin: 0 auto 1.1rem;
}

/* ==========================================================================
   Account page (account.html)
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  max-width: 380px;
  margin-top: 1.25rem;
}

.auth-form label {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.9rem;
  margin-bottom: 0.35rem;
}

.auth-form input {
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.auth-form input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary-dark);
}

.auth-hint {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.auth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.auth-message {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 0.92rem;
}

.auth-message.is-error {
  border-left-color: var(--color-incorrect-border, #b3261e);
}

.btn-danger {
  border-color: var(--color-incorrect-border, #b3261e);
  color: var(--color-incorrect-text, #8c1d18);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Six nav links on a phone: let them wrap instead of overflowing. */
@media (max-width: 640px) {
  .page-header .header-inner {
    flex-wrap: wrap;
  }
  .page-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
  }
  .page-header nav a {
    margin-left: 0;
  }
}

/* ---- Google button + "or use email" divider -------------------------- */
.btn-google {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--color-text);
  cursor: pointer;
}

.btn-google:hover {
  border-color: var(--color-primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 380px;
  margin-top: 1.5rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--color-border);
}

/* ---- Login gate -------------------------------------------------------
   App pages start with <html class="auth-gate">, which hides the page
   until js/auth.js confirms the visitor is logged in (or sends them to
   the sign-in screen). Stops a flash of the app before the redirect. */
html.auth-gate body {
  visibility: hidden;
}

/* "Log out" sits in the nav like a link, but it's a button. */
.page-header nav .nav-logout {
  margin-left: 1.25rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--color-on-ink-muted);
  cursor: pointer;
}

.page-header nav .nav-logout:hover {
  color: var(--color-on-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
}

.footer-account {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .page-header nav .nav-logout {
    margin-left: 0;
  }
}

/* ---- 13+ checkbox (account.html) + footer legal links ---------------- */
.age-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: 420px;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
}

.age-check input {
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: var(--color-ink);
}

.footer-links,
.footer-account {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.legal-page h2 {
  margin-top: 1.75rem;
}
