/* DriveReady NY — Mobile-first design system
   Colors anchor on NY DMV: navy #0a2c5c, accent orange #ff8a1f,
   soft surface #f6f7fb, plus semantic green/red for correct/wrong. */

:root {
  --navy: #0a2c5c;
  --navy-700: #15407a;
  --navy-50:  #eaf0f9;
  --orange: #ff8a1f;
  --orange-600: #e87900;
  --green: #16a34a;
  --green-50: #e8f7ee;
  --red: #cc0a18;
  --red-50: #fdecee;
  --ink: #0d1424;
  --ink-2: #4a5468;
  --ink-3: #8892a4;
  --line: #e5e8ef;
  --line-2: #eef0f5;
  --bg: #f6f7fb;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(15,25,52,.05), 0 6px 24px rgba(15,25,52,.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; display: block; }

/* ---------- App Bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px 8px; margin-left: -8px;
  cursor: pointer; border-radius: 12px;
}
.brand:active { background: var(--line-2); }
.brand-text {
  font-weight: 700; font-size: 17px; letter-spacing: -0.2px; color: var(--navy);
}
.brand-text em { font-style: normal; color: var(--orange); }

.appbar-actions { display: flex; align-items: center; gap: 8px; }
.appbar-progress {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  background: var(--navy-50); color: var(--navy);
  border-radius: 999px;
}
.appbar-progress .dot { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; }
.appbar-icon {
  background: var(--navy-50); border: 0; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--navy);
}
.appbar-icon:active { transform: scale(.94); }

/* ---------- View / Pages ---------- */
.view {
  padding: 16px 16px calc(96px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .view { max-width: 880px; padding: 24px 24px calc(120px + var(--safe-bottom)); }
}

h1.page-title { font-size: 26px; line-height: 1.15; letter-spacing: -0.4px; margin: 8px 0 4px; }
h2.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; margin: 24px 0 12px; }
.muted { color: var(--ink-2); }

/* ---------- Bottom Nav ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px; background: none; border: 0;
  font-size: 11px; color: var(--ink-3);
  cursor: pointer; min-height: 60px;
}
.navbtn svg { color: var(--ink-3); transition: color .15s, transform .15s; }
.navbtn[aria-current="true"] { color: var(--navy); }
.navbtn[aria-current="true"] svg { color: var(--navy); }
.navbtn:active svg { transform: scale(.92); }
.navbtn-primary {
  position: relative; color: var(--card) !important;
}
.navbtn-primary::before {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(140deg, var(--orange), var(--orange-600));
  box-shadow: 0 6px 16px rgba(255,138,31,.45);
  z-index: -1;
}
.navbtn-primary svg { color: #fff; }
.navbtn-primary span { color: var(--ink-3); }
.navbtn-primary[aria-current="true"] span { color: var(--navy); font-weight: 700; }

/* ---------- Cards / Surfaces ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line-2);
  padding: 16px;
}
.card + .card { margin-top: 12px; }

.card-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  text-align: left; width: 100%;
  cursor: pointer;
}
.card-row:active { transform: scale(.99); }

.row-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--navy-50); color: var(--navy);
  display: grid; place-items: center; flex-shrink: 0;
}
.row-icon.green { background: var(--green-50); color: var(--green); }
.row-icon.orange { background: #fff4e6; color: var(--orange-600); }
.row-icon.red { background: var(--red-50); color: var(--red); }

.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.row-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.row-arrow { color: var(--ink-3); flex-shrink: 0; }

/* ---------- Hero / Dashboard ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 60%, #1d4d96 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative; overflow: hidden;
  margin-top: 4px;
}
.hero::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,31,.4), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.85);
}
.hero-title { font-size: 24px; line-height: 1.15; letter-spacing: -0.3px; margin: 6px 0 8px; font-weight: 700; }
.hero-sub { font-size: 14px; color: rgba(255,255,255,.85); margin-bottom: 14px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #1a1004; font-weight: 700;
  border: 0; padding: 12px 18px; border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,138,31,.4);
}
.hero-cta:active { transform: scale(.97); }

.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px;
}
.stat {
  background: var(--card); padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--ink-2); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -0.4px; }
.stat .bar {
  margin-top: 8px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.stat .bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--orange));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .1s, background .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-accent { background: var(--orange); color: #1a1004; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-block { width: 100%; padding: 14px 18px; }
.btn-lg { padding: 16px 22px; font-size: 16px; }

/* ---------- Quiz Engine UI ---------- */
.quiz-shell { display: flex; flex-direction: column; gap: 16px; }
.quiz-progress {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2);
}
.quiz-progress .bar { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.quiz-progress .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--orange)); transition: width .3s; }

.question-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px;
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.question-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.tag {
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; letter-spacing: 0.4px;
  background: var(--navy-50); color: var(--navy); text-transform: uppercase;
}
.tag.orange { background: #fff4e6; color: var(--orange-600); }
.tag.gray { background: var(--line-2); color: var(--ink-2); }

.sign-stage {
  display: grid; place-items: center;
  padding: 18px 0 10px;
  background: linear-gradient(180deg, var(--navy-50) 0%, transparent 100%);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.question-text {
  font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -0.2px;
  margin: 4px 0 16px;
}

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1.5px solid var(--line);
  font-size: 15px; line-height: 1.4; text-align: left;
  cursor: pointer; min-height: 56px;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.option:active { background: var(--line-2); }
.option .letter {
  display: grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--navy-50); color: var(--navy);
  font-weight: 700; font-size: 14px;
}
.option.correct { border-color: var(--green); background: var(--green-50); }
.option.correct .letter { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-50); }
.option.wrong .letter { background: var(--red); color: #fff; }
.option:disabled, .option[aria-disabled="true"] { cursor: default; }

.feedback {
  margin-top: 14px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--navy-50); border-left: 4px solid var(--navy);
}
.feedback.correct { background: var(--green-50); border-left-color: var(--green); }
.feedback.wrong { background: var(--red-50); border-left-color: var(--red); }
.feedback-title { font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.feedback-body { font-size: 14px; color: var(--ink-2); line-height: 1.45; }

.quiz-actions { display: grid; gap: 10px; }

/* ---------- Lessons ---------- */
.lesson-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.lesson-thumb {
  height: 88px;
  background: linear-gradient(135deg, var(--navy), #1d4d96);
  position: relative; display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 28px;
}
.lesson-thumb::after {
  content: ""; position: absolute; right: -20px; bottom: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,31,.3), transparent 70%);
}
.lesson-body { padding: 14px 16px; }
.lesson-title { font-size: 16px; font-weight: 600; }
.lesson-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.lesson-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 700px) { .lesson-grid { grid-template-columns: repeat(2, 1fr); } }

article.lesson-reader { line-height: 1.6; }
article.lesson-reader h3 {
  font-size: 17px; margin: 22px 0 8px; color: var(--navy); letter-spacing: -0.2px;
}
article.lesson-reader p { color: var(--ink); margin: 0 0 12px; font-size: 15px; }
article.lesson-reader strong { color: var(--ink); }

/* ---------- Mock Exam ---------- */
.exam-banner {
  background: linear-gradient(135deg, #15407a, #0a2c5c);
  color: #fff;
  padding: 24px 22px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.exam-banner::after {
  content: ""; position: absolute; right: -40px; top: -30px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,31,.3), transparent 70%);
  pointer-events: none;
}
.exam-rules {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin: 14px 0 0;
}
.exam-rules li {
  list-style: none; font-size: 13px; padding: 8px 10px;
  background: rgba(255,255,255,.1); border-radius: 8px;
}

.timer-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); padding: 6px 12px; border-radius: 999px;
  font-weight: 700; font-size: 13px; color: var(--navy);
  border: 1px solid var(--line);
}
.timer-pill.warn { color: var(--orange-600); border-color: var(--orange); }
.timer-pill.crit { color: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.exam-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.summary-tile {
  background: var(--card); padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); text-align: center;
}
.summary-tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.summary-tile.pass .v { color: var(--green); }
.summary-tile.fail .v { color: var(--red); }
.summary-tile .l { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.result-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 18px; border-radius: var(--radius-lg);
  margin-bottom: 16px;
  color: #fff;
}
.result-banner.pass { background: linear-gradient(135deg, #16a34a, #0e7a37); }
.result-banner.fail { background: linear-gradient(135deg, #cc0a18, #9b0612); }
.result-banner .ico {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); flex-shrink: 0;
}
.result-banner h2 { font-size: 22px; margin: 0; letter-spacing: -0.3px; }
.result-banner p { margin: 4px 0 0; opacity: .9; font-size: 14px; }

/* ---------- Signs Trainer ---------- */
.cat-pills {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 12px; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
  scroll-snap-align: start;
}
.cat-pill[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.signs-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 600px) { .signs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .signs-grid { grid-template-columns: repeat(4, 1fr); } }
.sign-card {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; cursor: pointer;
}
.sign-card .sign-art { width: 100px; height: 100px; display: grid; place-items: center; }
.sign-card .sign-art > svg { max-width: 100px; max-height: 100px; }
.sign-card .sign-name { font-size: 13px; font-weight: 600; color: var(--ink); }

.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8,18,40,.55);
  display: flex; align-items: flex-end;
  animation: fade .15s ease;
}
.sheet-inner {
  width: 100%; max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(22px + var(--safe-bottom));
  animation: slide-up .25s ease;
}
.sheet-grab { width: 44px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
@keyframes slide-up { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) {
  .sheet { align-items: center; justify-content: center; padding: 24px; }
  .sheet-inner { max-width: 540px; border-radius: 22px; }
}

/* ---------- Practice Topic Tiles ---------- */
.topic-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (min-width: 600px) { .topic-grid { grid-template-columns: repeat(3, 1fr); } }
.topic-tile {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 14px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 110px; box-shadow: var(--shadow);
}
.topic-tile .ic {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--navy-50); color: var(--navy);
  display: grid; place-items: center;
}
.topic-tile h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.1px; }
.topic-tile p { margin: 0; font-size: 12px; color: var(--ink-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Misc ---------- */
.empty {
  text-align: center; padding: 40px 24px; color: var(--ink-2);
}
.empty svg { margin: 0 auto 12px; opacity: .5; }

.section-link {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px;
}
.section-link h2 { margin: 0; font-size: 17px; font-weight: 700; }
.section-link button {
  background: none; border: 0; color: var(--navy); font-weight: 600; font-size: 13px; cursor: pointer;
}

/* skeletons */
.sk { background: linear-gradient(90deg, var(--line) 0%, var(--line-2) 50%, var(--line) 100%); background-size: 200% 100%; border-radius: 8px; animation: sk 1.4s infinite; height: 16px; }
@keyframes sk { from { background-position: -100% 0; } to { background-position: 100% 0; } }

/* ---------- Question transitions / feedback animations ---------- */
.question-card.entering {
  animation: q-enter .28s cubic-bezier(.2,.7,.2,1);
}
@keyframes q-enter {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.question-card.leaving {
  animation: q-leave .2s cubic-bezier(.4,.0,.7,.2) forwards;
}
@keyframes q-leave {
  to { opacity: 0; transform: translateX(-16px); }
}
.option.flash-correct { animation: flash-green .5s; }
.option.flash-wrong { animation: flash-red .5s; }
@keyframes flash-green { 0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } 30% { box-shadow: 0 0 0 8px rgba(22,163,74,.18); } }
@keyframes flash-red   { 0%,100% { box-shadow: 0 0 0 0 rgba(204,10,24,0); } 30% { box-shadow: 0 0 0 8px rgba(204,10,24,.18); } }

/* Bookmark button */
.bookmark-btn {
  background: none; border: 0; cursor: pointer;
  padding: 6px; border-radius: 8px; color: var(--ink-3);
}
.bookmark-btn[aria-pressed="true"] { color: var(--orange); }
.bookmark-btn:active { transform: scale(.9); }

/* Profile chapter row */
.chapter-progress {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--card); border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  margin-bottom: 8px;
}
.chapter-progress .chip {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy-50); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.chapter-progress .chap-info { flex: 1; min-width: 0; }
.chapter-progress .chap-title { font-weight: 600; font-size: 14px; }
.chapter-progress .chap-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.chapter-progress .chap-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--orange)); }
.chapter-progress .chap-pct { font-size: 12px; color: var(--ink-2); min-width: 36px; text-align: right; }

/* iOS-style toggle */
.toggle {
  appearance: none; -webkit-appearance: none;
  width: 48px; height: 28px; background: var(--line);
  border-radius: 999px; position: relative;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0; margin: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; background: #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .2s;
}
.toggle:checked { background: var(--navy); }
.toggle:checked::after { transform: translateX(20px); }

/* Settings list */
.settings-list .row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); margin-bottom: 8px;
}
.settings-list .row .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy-50); color: var(--navy);
  display: grid; place-items: center; flex-shrink: 0;
}
.settings-list .row .body { flex: 1; }
.settings-list .row .body strong { font-size: 14px; }
.settings-list .row .body p { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }
.settings-list .row .body small { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }

/* Smooth view transition */
.view { animation: view-fade .2s ease; }
@keyframes view-fade {
  from { opacity: 0.4; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bottom nav active dot */
.navbtn { position: relative; }
.navbtn[aria-current="true"]::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--navy);
}
.navbtn-primary[aria-current="true"]::after { display: none; }

/* responsive type tweaks for very small phones */
@media (max-width: 360px) {
  .question-text { font-size: 16.5px; }
  .option { padding: 12px; font-size: 14.5px; }
  h1.page-title { font-size: 22px; }
}

/* keyboard focus */
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 8px; }

/* ---------- Reminders setup ---------- */
.reminders-steps {
  list-style: none; padding: 0; margin: 0;
  counter-reset: step;
}
.reminders-steps li {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 10px;
  position: relative;
  counter-increment: step;
}
.reminders-steps li > strong { font-size: 15px; }
.reminders-steps li > p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.reminders-steps label {
  display: block; font-size: 13px; color: var(--ink-2);
  font-weight: 600;
}
.reminders-steps input[type="text"],
.reminders-steps input[type="date"],
.reminders-steps input[type="number"] {
  width: 100%; margin-top: 6px;
  padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 15px; font-weight: 500; color: var(--ink);
  background: var(--card); font-family: inherit;
}
.reminders-steps input:focus {
  outline: none; border-color: var(--navy);
}
.topic-row {
  display: flex; gap: 6px; align-items: center;
  margin-top: 8px; flex-wrap: wrap;
}
.topic-row code {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  background: var(--navy-50); color: var(--navy);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.topic-row .btn { padding: 10px 14px; font-size: 13px; }
