/* MathsTutors.Online parent portal. Fonts are self-hosted (SIL OFL, see /fonts). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

:root {
  /* brand */
  --navy: #041f60; --navy-2: #0a2c7d; --cyan: #4de4ff; --dusky: #3bb5d9; --lilac: #a6b6f8; --purple: #5b5299; --white: #ffffff;
  /* ui */
  --ink: #0b1a45; --muted: #5b6687; --line: rgba(4, 31, 96, .08); --bg: #f4f6fd; --tint: #f1f4ff; --tint-2: #eef1ff;
  --good: #0f7a5c; --good-bg: #e3f7ef; --late: #e8a33a; --warn: #9a5b00; --warn-bg: #fff3dc; --bad: #b4233a; --bad-bg: #fdeaed;
  --shadow-sm: 0 1px 2px rgba(4, 31, 96, .06), 0 2px 8px rgba(4, 31, 96, .05);
  --shadow-lg: 0 2px 4px rgba(4, 31, 96, .06), 0 12px 32px rgba(4, 31, 96, .12);
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --text: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--text); color: var(--ink); background: var(--bg); }
body.has-tabs { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--display); }
a { color: var(--purple); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--dusky); outline-offset: 2px; }

/* ---------- header ---------- */
.hero-bg {
  position: relative; color: var(--white);
  padding: calc(16px + env(safe-area-inset-top)) 20px 76px; /* clear of the iPhone status bar (and its blur) in the home-screen app */
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(77, 228, 255, .35) 0%, rgba(77, 228, 255, 0) 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(91, 82, 153, .55) 0%, rgba(91, 82, 153, 0) 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero-inner { max-width: 34rem; margin: 0 auto; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.brand { font: 800 16px var(--display); letter-spacing: .01em; }
.brand span { color: var(--cyan); }
.logout { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: var(--white); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font: 600 13px var(--text); cursor: pointer; }
.logout svg { width: 16px; height: 16px; }
.greet { margin: 22px 0 2px; font-size: 15px; color: rgba(255, 255, 255, .78); }
.hero-bg h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.seg { display: inline-flex; flex-wrap: wrap; margin-top: 16px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.seg button { border: 0; background: none; color: rgba(255, 255, 255, .85); font: 600 14px var(--text); padding: 7px 18px; border-radius: 999px; cursor: pointer; }
.seg button.on, .seg span.on { background: var(--white); color: var(--navy); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.seg span.on { font: 600 14px var(--text); padding: 7px 18px; border-radius: 999px; }

/* ---------- content ---------- */
main { max-width: 36rem; margin: 0 auto; }
.content { position: relative; margin-top: -52px; padding: 0 16px; }
.card { background: var(--white); border-radius: 22px; padding: 20px; margin-bottom: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.card.lift { box-shadow: var(--shadow-lg); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 4px 10px; }
.section-title h2 { margin: 0; font-size: 17px; font-weight: 800; }
.section-title.stacked { flex-direction: column; align-items: flex-start; gap: 2px; }
.section-title.stacked p { margin: 0; font-size: 14px; color: var(--muted); }
.notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 14px; }
.loading { padding: 40px 20px; text-align: center; color: var(--muted); }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px; border: 0; border-radius: 16px; font: 700 16px var(--display); text-decoration: none; cursor: pointer; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { margin-top: 16px; color: var(--white); background: linear-gradient(135deg, var(--purple) 0%, var(--navy) 100%); box-shadow: 0 8px 20px rgba(91, 82, 153, .35); }
.btn-ghost { margin-top: 10px; color: var(--navy); background: var(--tint); border: 1px solid #dfe5ff; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-disabled { opacity: .45; box-shadow: none; cursor: default; filter: grayscale(.3); }

/* ---------- home ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--purple); }
.live { width: 8px; height: 8px; border-radius: 50%; background: #22c58b; box-shadow: 0 0 0 4px rgba(34, 197, 139, .18); }
.when { margin: 8px 0 2px; font: 800 30px/1.1 var(--display); letter-spacing: -.02em; }
.when small { font-size: 18px; font-weight: 700; color: var(--muted); }
.when-sub { margin: 4px 0 0; font: 700 17px var(--display); color: var(--muted); }
.countdown { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--tint-2); color: var(--purple); font: 600 13px var(--text); }
.meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.badge { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--lilac), var(--dusky)); color: var(--navy); font: 800 14px var(--display); }
.meta strong { display: block; font-size: 15px; line-height: 1.3; }
.meta span { font-size: 14px; color: var(--muted); }
.pending-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--tint); color: var(--muted); font-size: 14px; }

.block { margin-top: 18px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--muted); }
.block-head b { color: var(--ink); font: 700 14px var(--display); }
.segbar { display: grid; grid-template-columns: repeat(var(--weeks, 6), 1fr); gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.segbar li { height: 8px; border-radius: 99px; background: #e8ecfb; }
.segbar .yes { background: var(--good); }
.segbar .late { background: var(--late); }
.segbar .no { background: var(--bad); }
.segbar .na, .segbar .unknown { background: #cfd6f3; }
.segbar .next { background: linear-gradient(90deg, var(--dusky), var(--cyan)); box-shadow: 0 0 0 3px rgba(77, 228, 255, .25); }

.list { padding: 6px 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.date-chip { flex: none; width: 46px; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--tint); }
.date-chip b { display: block; font: 800 17px/1 var(--display); color: var(--navy); }
.date-chip span { font: 600 11px var(--text); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.row .t { flex: 1; min-width: 0; }
.row .t strong { display: block; font-size: 14px; }
.row .t span { font-size: 14px; color: var(--muted); }
.pill { font: 600 13px var(--text); padding: 4px 10px; border-radius: 99px; background: var(--tint); color: var(--purple); white-space: nowrap; }
.row.holiday .date-chip { background: var(--warn-bg); }
.row.holiday .date-chip b { color: var(--warn); }
.pill.holiday { background: var(--warn-bg); color: var(--warn); }
.pill.new { background: #e9fbff; color: #0b6d86; }
.list-more { display: block; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--purple); font: 600 14px var(--text); cursor: pointer; }

.iconrow { display: flex; align-items: center; gap: 14px; }
.iconrow .ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--good-bg); color: var(--good); }
.iconrow .ic.purple { background: var(--tint-2); color: var(--purple); }
.iconrow .ic.amber { background: var(--warn-bg); color: var(--warn); }
.iconrow .ic.cyan { background: linear-gradient(135deg, var(--cyan), var(--dusky)); color: var(--navy); }
.iconrow .ic svg { width: 22px; height: 22px; }
.iconrow strong { display: block; font: 700 15px var(--display); }
.iconrow span { font-size: 14px; color: var(--muted); }
.iconrow p { margin: 0; }

/* ---------- progress ---------- */
.summary { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.summary.no-ring { grid-template-columns: 1fr; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font: 800 30px/1 var(--display); color: var(--navy); }
.ring-center span { font: 600 12px var(--text); color: var(--muted); }
.kpis { display: grid; gap: 10px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi b { font: 800 20px var(--display); }
.kpi b.up { color: var(--good); }
.intro-note { margin: 8px 0 0; font-size: 15px; color: var(--ink); }
.ring-caption { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.target-note { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(90deg, var(--tint-2), #e9fbff); font: 600 14px var(--text); color: var(--navy); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.lg-yes { background: var(--good); } .lg-late { background: var(--late); } .lg-no { background: var(--bad); }
.lg-next { background: var(--cyan); box-shadow: 0 0 0 2px rgba(77, 228, 255, .3); } .lg-todo { background: #e8ecfb; }
.bar-legend { margin-top: 10px; gap: 4px 9px; font-size: 12px; }
.bar-legend i { margin-right: 4px; }

.topic h3 { margin: 0; font-size: 16px; font-weight: 800; }
.topic .sub { font-size: 14px; color: var(--muted); }
.topic-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 10px; }
.topic-head > div:first-child { flex: 1 1 170px; }
.delta { flex: none; font: 800 13px var(--display); padding: 5px 10px; border-radius: 99px; background: var(--good-bg); color: var(--good); white-space: nowrap; }
.delta.pending { background: var(--tint); color: var(--muted); font-weight: 600; }
.delta.down { background: var(--tint); color: var(--muted); }
.compare { margin-top: 14px; display: grid; gap: 10px; }
.cmp-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.cmp-head b { color: var(--ink); font: 700 14px var(--display); }
.cmp-head b.pending { color: var(--muted); font-weight: 600; }
.track { height: 10px; margin-top: 6px; border-radius: 99px; background: #edf0fb; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; }
.fill.first { background: var(--lilac); }
.fill.final { background: linear-gradient(90deg, var(--dusky), var(--cyan)); }
.weeks { display: flex; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.wk { flex: 1; text-align: center; padding: 7px 0 6px; border-radius: 10px; background: var(--tint); font: 600 12px var(--text); color: var(--muted); }
.wk i { display: block; margin: 0 auto 3px; width: 16px; height: 16px; border-radius: 50%; background: #d6dcf4; }
.wk.yes i { background: var(--good); }
.wk.late i { background: var(--late); }
.wk.no i { background: var(--bad); }
.wk.na i { background: #b9c2e6; }
.report { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--tint); border-left: 4px solid var(--lilac); }
.report h4 { margin: 0 0 6px; font: 700 14px var(--display); color: var(--purple); }
.report p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.report p:last-child, .report ul:last-child, .report ol:last-child { margin-bottom: 0; }
.report ul, .report ol { margin: 0 0 8px; padding-left: 20px; font-size: 15px; }
.video { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, var(--navy), var(--purple)); color: var(--white); text-decoration: none; }
.play { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.play svg { width: 18px; height: 18px; fill: var(--white); }
.video strong { display: block; font: 700 14px var(--display); }
.video span { font-size: 13px; opacity: .85; }
.show-more { margin: 0 0 14px; }

/* ---------- info ---------- */
.soon { margin-left: auto; font: 700 11px var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--purple); background: var(--tint-2); padding: 4px 8px; border-radius: 99px; }
.callout { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--tint-2), #e9fbff); font-size: 14px; }
.callout svg { flex: none; width: 22px; height: 22px; color: var(--purple); }
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: 0; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font: 600 14px var(--text); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.faq[open] summary svg { transform: rotate(90deg); }
.faq-body { padding: 0 0 14px; font-size: 14px; color: var(--muted); }
.faq-body p { margin: 0; }

/* ---------- help chat ---------- */
.help .chat { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bubble { max-width: 92%; padding: 12px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble.bot { align-self: flex-start; background: var(--tint); border-top-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--purple), var(--navy)); color: var(--white); border-top-right-radius: 6px; font-weight: 600; }
.bubble .chips { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-q { padding: 9px 14px; border-radius: 999px; border: 1px solid #d7ddf5; background: var(--white); color: var(--navy); font: 600 14px var(--text); cursor: pointer; text-align: left; }
.chip-q.accent { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip-q:disabled { opacity: .5; cursor: default; }
.help-list { margin: 0 0 8px; padding-left: 18px; }
.help-list li { margin: 2px 0; }
.help-link { font-weight: 700; }
.help-form { display: grid; gap: 10px; margin-top: 10px; }
.help-form .field span { display: block; font: 700 13px var(--display); margin-bottom: 4px; color: var(--ink); }
.help-form input, .help-form select, .help-form textarea { width: 100%; padding: 11px 12px; font: 500 15px var(--text); color: var(--ink); border: 1px solid #d7ddf5; border-radius: 12px; background: var(--white); }
.help-form textarea { resize: vertical; }
.help-form .btn-primary { margin-top: 4px; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-reset { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #dfe5ff; background: var(--tint); color: var(--navy); font: 600 13px var(--text); cursor: pointer; }
.chat-reset svg { width: 15px; height: 15px; }
.bot-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.bot-row .bubble.bot { max-width: calc(100% - 40px); }
.bot-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--display); color: var(--navy); background: linear-gradient(135deg, var(--cyan), var(--lilac)); }
.bubble.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--lilac); animation: blink 1s infinite ease-in-out; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble.typing i { animation: none; } }
.bubble-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.bubble-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--purple), var(--navy)); color: var(--white); font: 700 14px var(--display); text-decoration: none; cursor: pointer; }
.bubble-btn svg { width: 17px; height: 17px; }
.chat-compose { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-input { flex: 1; min-width: 0; padding: 11px 14px; font: 500 16px var(--text); color: var(--ink); border: 1px solid #d7ddf5; border-radius: 999px; background: var(--white); }
.chat-input:focus { outline: 3px solid rgba(59, 181, 217, .35); border-color: var(--dusky); }
.chat-send { flex: none; padding: 0 18px; border: 0; border-radius: 999px; background: var(--navy); color: var(--white); font: 700 14px var(--display); cursor: pointer; }
.help-form .btn-ghost { margin-top: 0; }

/* ---------- small buttons, pop-up panel ---------- */
.btn-sm { width: auto; padding: 10px 16px; font-size: 14px; border-radius: 12px; margin-top: 0; }
.done-note { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; }
.done-note svg { width: 18px; height: 18px; flex: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(4, 31, 96, .35); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 16px; overflow-y: auto; }
.sheet { width: min(34rem, 100%); background: var(--bg); border-radius: 24px; padding: 18px; box-shadow: var(--shadow-lg); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; color: var(--navy); }

/* ---------- shop (mockup) ---------- */
.shop { padding: 6px 16px; }
.shop-eyebrow { display: block; padding-top: 12px; }
.product { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product:last-child { border-bottom: 0; }
.product-art { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--white); background: linear-gradient(135deg, var(--purple), var(--navy)); }
.product-art.tier-foundation { background: linear-gradient(135deg, var(--dusky), var(--navy)); }
.product-art.tier-both { background: linear-gradient(135deg, var(--lilac), var(--purple)); }
.product-art svg { width: 26px; height: 26px; }
.product.compact .product-art { width: 44px; height: 44px; border-radius: 12px; }
.product-text { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: start; }
.product-text strong { font: 700 15px var(--display); }
.product-text .muted { font-size: 13px; }
.product-meta { font-size: 14px; }
.product .btn-sm { flex: none; }

/* ---------- tutor contact & booking (mockup) ---------- */
.tutor-contact .btn-ghost { margin-top: 10px; }
.tutor-email { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.tutor-email span { overflow-wrap: anywhere; }
.bubble .tutor-email { justify-content: flex-start; flex-basis: 100%; margin-top: 0; }
.copy-btn { flex: none; padding: 3px 10px; border-radius: 99px; border: 1px solid #d7ddf5; background: var(--white); color: var(--navy); font: 600 12px var(--text); cursor: pointer; }
.tutor-line { display: flex; align-items: center; gap: 12px; }
.tutor-line strong { display: block; font: 700 15px var(--display); }
.tutor-line .muted { font-size: 13px; }
.small { font-size: 13px; }
.day-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: thin; }
.day-chip { flex: none; display: grid; justify-items: center; gap: 0; width: 58px; padding: 8px 0; border-radius: 14px; border: 1px solid #d7ddf5; background: var(--white); color: var(--navy); font: 600 12px var(--text); cursor: pointer; }
.day-chip b { font: 800 20px var(--display); }
.day-chip.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.slot-day { margin: 10px 0 8px; font: 700 14px var(--display); }
.booking-field { display: block; margin-top: 12px; }
.booking-field span { display: block; font: 700 13px var(--display); margin-bottom: 4px; }
.booking-field textarea, .tutor-select { width: 100%; padding: 11px 12px; font: 500 15px var(--text); color: var(--ink); border: 1px solid #d7ddf5; border-radius: 12px; background: var(--white); resize: vertical; }
.sheet-list > .booking-field:first-child { margin-top: 0; }
.day-chip.has { box-shadow: inset 0 -3px 0 var(--cyan); }
.chip-q.slot.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.booking-footer { position: sticky; bottom: -18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px -18px -18px; padding: 12px 18px 18px; background: var(--bg); border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; font: 700 14px var(--display); color: var(--navy); }
.booking-footer .btn:disabled { opacity: .45; box-shadow: none; }
.booking-note { margin: 8px 0 0 !important; }
.sheet-list > p { margin: 0 0 10px; }

/* ---------- worksheets (mockup) ---------- */
.session-ws { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ws-label { margin: 0 0 8px; font: 700 12px var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--purple); }
.ws-label:not(:first-child) { margin-top: 12px; }
.ws-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.ws-pills { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ws-pill { display: inline-flex; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid #d7ddf5; background: var(--white); }
.ws-pill .pill-q { min-width: 0; padding: 8px 12px; color: var(--navy); font: 600 14px var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-pill .pill-a { flex: none; display: inline-flex; align-items: center; padding: 8px 10px; border-left: 1px solid #d7ddf5; background: var(--tint); color: var(--purple); font: 700 12px var(--text); text-decoration: none; }
.ws-pill .pill-a.locked { color: var(--muted); font-size: 13px; cursor: help; }
.ws-pill.test { border-color: var(--navy); background: var(--navy); }
.ws-pill.test .pill-q { color: var(--white); }
.ws-pill .pill-q:hover, .ws-pill a.pill-a:hover { background: var(--tint-2); }
.ws-pill.test .pill-q:hover { background: var(--navy-2); }
.ws-more { margin-top: 6px; border-top: 1px solid var(--line); }
.ws-more summary { padding: 12px 0; font: 600 14px var(--text); color: var(--purple); cursor: pointer; }
.ws-line { padding: 8px 0 10px; border-top: 1px solid var(--line); }
.ws-wk { display: block; margin-bottom: 6px; font: 700 11px var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ws-line .ws-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Progress: name on top (questions), a slim "Solutions" strip underneath. */
.ws-line .ws-pill { display: flex; flex-direction: column; border-radius: 12px; }
.ws-line .ws-pill .pill-q { flex: 1; padding: 9px 10px; font-size: 13px; line-height: 1.3; white-space: normal; overflow-wrap: break-word; hyphens: auto; }
.ws-line .ws-pill .pill-a { justify-content: center; padding: 6px 8px; border-left: 0; border-top: 1px solid #d7ddf5; font-size: 12px; }
.topic-ws { margin-top: 14px; }
/* In the session card: full-width, centred, like the other buttons. */
.session-ws .ws-pills { display: grid; gap: 8px; }
.session-ws .ws-pill { display: flex; width: 100%; border-radius: 14px; }
.session-ws .ws-pill .pill-q { flex: 1; padding: 12px 14px; text-align: center; font: 700 15px var(--display); white-space: normal; }
.session-ws .ws-pill .pill-a { padding: 12px 14px; font-size: 13px; }
.session-ws .ws-label, .session-ws .ws-note { text-align: center; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row > .btn { flex: 1; min-width: 0; margin-top: 0; padding: 12px 10px; font-size: 15px; }
.btn-row > .btn svg { width: 18px; height: 18px; }
.up-next { border: 1px dashed var(--lilac); }
.up-next .muted.small { margin: 6px 0 0; }
.pay-name { display: block; margin-bottom: 10px; }

/* ---------- payment schedule ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; }
.login-row { align-items: center; }
.login-row:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.login-row > span b { display: block; text-align: left; color: var(--ink); font-weight: 600; }
.login-row > span small { font-size: 13px; }
.switch { flex: none; position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: #cfd5ea; cursor: pointer; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 6px rgba(4, 31, 96, .25); transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(20px); }
.switch:disabled { opacity: .6; }
.login-row ~ .status:empty { display: none; }
.pay-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pay-note b { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }
.tier-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.form-status { margin: 0; font-size: 14px; color: var(--muted); }
.form-status.error { color: var(--bad); }

.footer { margin: 18px 0 8px; text-align: center; font-size: 13px; color: var(--muted); }
.footer p { margin: 2px 0; }
.link-btn { padding: 0; border: 0; background: none; color: var(--purple); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.tech-details { font-size: 13px; color: var(--muted); }
.tech-details summary { cursor: pointer; }
.tech-details li { overflow-wrap: anywhere; }

/* ---------- floating tab bar ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 10; width: min(34rem, calc(100% - 32px)); display: flex; gap: 4px; padding: 8px; border-radius: 24px; background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 10px 30px rgba(4, 31, 96, .18); }
/* Home-screen app: dock the bar to the bottom edge like a native app, rather than floating above the home indicator. */
@media (display-mode: standalone) {
  .tabbar { left: 0; right: 0; bottom: 0; transform: none; width: auto; border-radius: 22px 22px 0 0; border-width: 1px 0 0; padding: 8px max(12px, calc((100% - 34rem) / 2)) calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(4, 31, 96, .1); }
  body.has-tabs { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* iOS only puts "bottom: 0" at the real bottom of the screen when the page scrolls; on a page
     shorter than the screen it leaves a strip under the bar. So every page is at least a screen tall. */
  body { min-height: calc(100lvh + 1px); }
}
.tab-button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border: 0; border-radius: 16px; background: none; color: var(--muted); font: 600 12px var(--text); cursor: pointer; }
.tab-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-button.active { color: var(--navy); background: var(--tint-2); }
.tab-button.active svg { stroke: var(--purple); }

/* ---------- login page ---------- */
.login .hero-bg { padding-bottom: 84px; }
.login label { display: block; font: 700 14px var(--display); margin-bottom: 6px; }
.login input[type="email"], .login #code { width: 100%; padding: 14px; font: 500 16px var(--text); color: var(--ink); border: 1px solid #d7ddf5; border-radius: 14px; background: var(--white); }
.login #code { font: 700 24px var(--text); letter-spacing: .3em; text-align: center; }
.login input[type="email"]:focus, .login #code:focus { outline: 3px solid rgba(59, 181, 217, .35); border-color: var(--dusky); }
.login .hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.login .status { margin: 12px 0 0; font-size: 14px; }

/* ---------- first-time tour ---------- */
.tour-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(4, 31, 96, .45); }
body.touring .tabbar { z-index: 26; }
body.touring .tab-button:not(.tour-hi) { opacity: .45; }
.tab-button.tour-hi { opacity: 1; color: var(--navy); background: var(--tint-2); box-shadow: 0 0 0 3px var(--cyan); animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 6px rgba(77, 228, 255, .35); } }
.tour { position: fixed; z-index: 27; left: 50%; transform: translateX(-50%); bottom: calc(112px + env(safe-area-inset-bottom)); width: min(30rem, calc(100% - 32px)); padding: 20px; border-radius: 22px; background: var(--white); box-shadow: 0 20px 50px rgba(4, 31, 96, .35); }
.tour.centred { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.tour h2 { margin: 6px 0 6px; font-size: 20px; color: var(--navy); }
.tour p { margin: 0 0 8px; font-size: 15px; }
.tour p.muted { font-size: 14px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d7ddf5; }
.tour-dots i.on { width: 20px; border-radius: 4px; background: var(--purple); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tour-nav { display: flex; gap: 8px; }
@media (display-mode: standalone) { .tour { bottom: calc(100px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .tab-button.tour-hi { animation: none; } }
