/* =====================================================================
   My First Mile — platform stylesheet
   Dark navy base, restrained amber accent, system fonts only.
   ===================================================================== */

:root {
  --navy-900: #0b1220;
  --navy-850: #101a2c;
  --navy-800: #142338;
  --navy-700: #1c3049;
  --navy-600: #27415f;
  --line: #24374f;

  --ink: #f2f6fb;
  --ink-soft: #b6c4d6;
  --ink-faint: #7f92aa;

  --accent: #f0a92b;
  --accent-soft: rgba(240, 169, 43, 0.14);
  --accent-line: rgba(240, 169, 43, 0.4);

  --good: #43b581;
  --good-soft: rgba(67, 181, 129, 0.14);
  --bad: #e5606a;
  --bad-soft: rgba(229, 96, 106, 0.14);
  --warn: #e8a33d;

  --bg: var(--navy-900);
  --surface: var(--navy-850);
  --surface-2: var(--navy-800);
  --raised: var(--navy-700);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.22);
  --maxw: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

[data-theme="light"] {
  --navy-900: #eef2f7;
  --navy-850: #ffffff;
  --navy-800: #f5f8fc;
  --navy-700: #e7edf6;
  --navy-600: #d6e0ee;
  --line: #d3dce8;

  --ink: #10192a;
  --ink-soft: #41546e;
  --ink-faint: #64758c;

  --accent: #b4740a;
  --accent-soft: rgba(180, 116, 10, 0.12);
  --accent-line: rgba(180, 116, 10, 0.35);

  --good: #1c7a4f;
  --good-soft: rgba(28, 122, 79, 0.12);
  --bad: #b32d3a;
  --bad-soft: rgba(179, 45, 58, 0.1);
  --warn: #99631a;

  --shadow: 0 1px 2px rgba(16, 25, 42, 0.06), 0 8px 20px rgba(16, 25, 42, 0.08);
}

/* ------------------------------------------------------------ base -- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.015em; }
h1 { font-size: 1.85rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #14100a;
  padding: 10px 16px;
  z-index: 200;
  font-weight: 650;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------ app frame -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #16110a;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  overflow: hidden;
}
.brand-mark.has-img { background: transparent; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 1rem; }
.brand-sub { font-size: 0.72rem; color: var(--ink-faint); }

.header-spacer { flex: 1; }

#primary-nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--ink-soft);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 550;
  white-space: nowrap;
}
.nav-link:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  width: 38px; height: 38px;
  border-radius: 9px;
  font-size: 1rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--raised); color: var(--ink); }

#nav-toggle { display: none; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 64px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* --------------------------------------------------------- blocks -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card-title { font-size: 1.1rem; margin-bottom: 0.6em; }

.page-head { margin-bottom: 22px; }
.page-title { font-size: 2rem; margin-bottom: 8px; }
.page-title:focus { outline: none; }
.page-sub { color: var(--ink-soft); max-width: 68ch; margin: 0; }

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.fine-print { font-size: 0.78rem; color: var(--ink-faint); margin-top: 12px; }
.warn-text { color: var(--warn); }

.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.spacer-sm { height: 10px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.bullets { margin: 0 0 14px; padding-left: 1.2em; color: var(--ink-soft); }
.bullets li { margin-bottom: 6px; }

/* -------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 17px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--navy-600); text-decoration: none; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #17110a;
}
.btn.primary:hover { filter: brightness(1.07); }

.btn.ghost { background: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--raised); color: var(--ink); }
.btn.ghost.marked { color: var(--accent); border-color: var(--accent-line); }

.btn.danger {
  background: transparent;
  border-color: var(--bad);
  color: var(--bad);
}
.btn.danger:hover { background: var(--bad-soft); }

.btn.small-btn { padding: 6px 12px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.toggle-chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.toggle-chip:hover { border-color: var(--navy-600); color: var(--ink); }
.toggle-chip.on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* ---------------------------------------------------------- chips -- */

.chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.chip.subtle { background: transparent; }
.chip.done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.diff-easy { color: var(--good); }
.chip.diff-medium { color: var(--ink-soft); }
.chip.diff-hard { color: var(--warn); }

.chip-row { display: flex; gap: 8px; align-items: center; }
.chip-row.wrap { flex-wrap: wrap; }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
}
.pill.pass { background: var(--good-soft); color: var(--good); }
.pill.fail { background: var(--bad-soft); color: var(--bad); }

/* ------------------------------------------------------ progress --- */

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--navy-700);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.progress-fill.good { background: var(--good); }
.progress-fill.warn { background: var(--bad); }

/* ----------------------------------------------------------- stats -- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-grid.tight { margin-bottom: 16px; }

.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
}
.stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 0.8rem; color: var(--ink-soft); }
.stat-hint { font-size: 0.72rem; color: var(--ink-faint); margin-top: 3px; }

/* ------------------------------------------------------- readiness -- */

.readiness-card { padding: 24px 24px 22px; }

.readiness-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}
.readiness-label { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.02em; }
.readiness-blurb { color: var(--ink-soft); font-size: 0.92rem; max-width: 46ch; }
.readiness-score { text-align: right; white-space: nowrap; }
.readiness-number { font-size: 2.6rem; font-weight: 750; color: var(--accent); letter-spacing: -0.03em; }
.readiness-of { font-size: 1rem; color: var(--ink-faint); }

.readiness-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: var(--navy-700);
  overflow: hidden;
  margin-bottom: 14px;
}
.readiness-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d1553f 0%, var(--accent) 55%, var(--good) 100%);
  transition: width 0.5s ease;
}
.readiness-ticks span {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--bg);
  opacity: 0.55;
}

.readiness-reasons {
  margin: 0 0 4px;
  padding-left: 1.15em;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.readiness-reasons li { margin-bottom: 5px; }

.recommend { border-color: var(--accent-line); }

/* --------------------------------------------------------- modules -- */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.module-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.module-card:hover {
  text-decoration: none;
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.module-card.highlight { border-color: var(--accent-line); background: var(--surface-2); }

.module-top { display: flex; gap: 8px; margin-bottom: 10px; }
.module-title { font-size: 1.1rem; margin-bottom: 6px; }
.module-blurb { color: var(--ink-soft); font-size: 0.89rem; margin-bottom: 12px; }
.module-meta {
  display: flex; justify-content: space-between;
  font-size: 0.76rem; color: var(--ink-faint); margin-bottom: 8px;
}
.module-stats {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--ink-soft); margin-top: 7px;
}

/* --------------------------------------------------------- listing -- */

.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 1.4fr) auto;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.sub-row:last-child { border-bottom: none; }
.sub-name { font-size: 0.9rem; font-weight: 550; }
.sub-count { white-space: nowrap; text-align: right; }

.cat-name { font-weight: 650; margin-bottom: 7px; }

.exam-list { list-style: none; margin: 0; padding: 0; }
.exam-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.exam-row:last-child { border-bottom: none; }
.exam-score { font-weight: 650; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
}
.data-table th { color: var(--ink-faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ------------------------------------------------------------ quiz -- */

.quiz-head { margin-bottom: 16px; }
.quiz-head-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin-bottom: 10px;
}
.quiz-progress-row {
  display: flex; justify-content: space-between; margin-bottom: 7px;
}

.quiz-card { padding: 24px; }

.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-text { font-size: 1.35rem; font-weight: 650; margin-bottom: 18px; }
.q-text:focus { outline: none; }

.q-image {
  display: flex;
  justify-content: center;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.q-image img { width: 190px; height: 190px; }

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.98rem;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option:hover:not([disabled]) { border-color: var(--accent-line); background: var(--raised); }
.option[disabled] { cursor: default; }

.option-key {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--raised);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.option.correct {
  border-color: var(--good);
  background: var(--good-soft);
}
.option.correct .option-key { background: var(--good); color: #06180f; }
.option.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}
.option.wrong .option-key { background: var(--bad); color: #1b0508; }
.option.dim { opacity: 0.55; }

.feedback {
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
}
.feedback.good { border-left-color: var(--good); }
.feedback.bad { border-left-color: var(--bad); }
.feedback-head { font-weight: 700; margin-bottom: 7px; }
.feedback.good .feedback-head { color: var(--good); }
.feedback.bad .feedback-head { color: var(--bad); }
.feedback-body { font-size: 0.94rem; }

.source-line {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.79rem;
  color: var(--ink-faint);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.source-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.quiz-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------- results -- */

.result-head {
  text-align: center;
  padding: 30px 24px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.result-head.pass { border-color: var(--good); background: var(--good-soft); }
.result-head.fail { border-color: var(--bad); background: var(--bad-soft); }
.result-score { font-size: 3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; margin: 0; }
.result-score:focus { outline: none; }
.result-pct { font-size: 1.2rem; color: var(--ink-soft); margin-top: 4px; }
.result-verdict { font-weight: 600; margin-top: 10px; }

.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px 14px;
}
.review-item summary {
  cursor: pointer;
  font-weight: 550;
  font-size: 0.93rem;
}
.review-item[open] summary { margin-bottom: 12px; }
.review-body { font-size: 0.92rem; }
.review-img { width: 130px; height: 130px; display: block; margin-bottom: 12px; }
.review-answer {
  background: var(--good-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* --------------------------------------------------------- gallery -- */

.gallery-group { margin-top: 18px; }
.gallery-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.sign-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.sign-tile summary { cursor: pointer; list-style: none; }
.sign-tile summary::-webkit-details-marker { display: none; }
.sign-tile img { width: 100%; height: auto; display: block; }
.sign-tile[open] { grid-column: 1 / -1; display: flex; gap: 16px; align-items: flex-start; }
.sign-tile[open] summary { flex: 0 0 120px; }
.sign-tile-body { font-size: 0.88rem; }

/* -------------------------------------------------------- settings -- */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 600; }

.switch {
  flex: 0 0 50px;
  width: 50px; height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--navy-700);
  cursor: pointer;
  position: relative;
  padding: 0;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s ease;
}
.switch.on .switch-knob { transform: translateX(22px); background: #17110a; }

/* ---------------------------------------------------------- modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.66);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.empty { text-align: center; }
.empty .card-title { margin-bottom: 8px; }

/* ------------------------------------------------------ responsive -- */

@media (max-width: 860px) {
  body { font-size: 16px; }
  .two-col { grid-template-columns: 1fr; gap: 18px; }
  .readiness-head { flex-direction: column; gap: 10px; }
  .readiness-score { text-align: left; }
  .sub-row { grid-template-columns: 1fr auto; }
  .sub-bar { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 720px) {
  #nav-toggle { display: block; }
  #primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  #primary-nav.open { display: flex; }
  .nav-link { padding: 11px 12px; font-size: 0.95rem; }
  .header-inner { position: relative; }
  .brand-sub { display: none; }
  main { padding: 20px 15px 52px; }
  .card { padding: 17px 16px; }
  .page-title { font-size: 1.6rem; }
  .q-text { font-size: 1.15rem; }
  .quiz-card { padding: 18px 16px; }
  .result-score { font-size: 2.4rem; }
  .sign-tile[open] { flex-direction: column; }
  .sign-tile[open] summary { flex: none; width: 130px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .btn { width: 100%; }
  .quiz-controls .btn { width: auto; }
}

/* -------------------------------------------------- accessibility --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .module-card:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root {
    --line: #6d86a4;
    --ink-soft: #d5e0ee;
    --ink-faint: #b3c2d5;
  }
  [data-theme="light"] {
    --line: #7c8a9d;
    --ink-soft: #22334a;
    --ink-faint: #33455e;
  }
  .option { border-width: 2px; }
}

@media print {
  .site-header, .site-footer, .quiz-controls, .btn { display: none; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #999; box-shadow: none; }
}

/* ===================================================================
   Auth & account (Milestone 2.1). Uses existing tokens; no new colors.
   =================================================================== */
.auth-wrap { max-width: 460px; margin: 6vh auto 0; }
.auth-wrap .card { padding: 28px; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.form-label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

.text-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}
.text-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent-line); }
.text-input::placeholder { color: var(--ink-faint); }

.form-error {
  color: var(--bad);
  background: rgba(229, 96, 106, 0.10);
  border: 1px solid rgba(229, 96, 106, 0.35);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.btn.selected, button.selected {
  background: var(--accent);
  color: #16110a;
  border-color: var(--accent);
}

.text-link { color: var(--accent); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.hidden { display: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 4px 0 0; }
.kv dt { color: var(--ink-faint); font-size: 0.9rem; }
.kv dd { margin: 0; color: var(--ink); font-size: 0.95rem; }

/* Store layout (Milestone 2.2) — wider than the narrow auth forms. */
.auth-wrap.wide { max-width: 720px; }
.auth-wrap.wide .card { margin-bottom: 14px; }

/* Sync-status indicator (Milestone 2.3.1) — subtle, non-intrusive. */
.sync-indicator {
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding: 3px 9px 3px 20px;
  border-radius: 999px;
  position: relative;
  white-space: nowrap;
  margin-right: 6px;
}
.sync-indicator::before {
  content: "";
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
}
.sync-indicator[data-status="synced"]::before  { background: var(--good, #57b894); }
.sync-indicator[data-status="pending"]::before { background: var(--accent, #d9a441); }
.sync-indicator[data-status="syncing"]::before { background: var(--accent, #d9a441); animation: mfm-pulse 1s infinite ease-in-out; }
.sync-indicator[data-status="offline"]::before { background: var(--ink-faint); }
@keyframes mfm-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (max-width: 640px) { .sync-indicator { display: none; } }
