/* ============================================================================================
   CA Ladder — motion, loaders and polish. Loaded after app.css; everything here is decoration.
   With "reduce motion" switched on in the device, all of it stands still (see the end of the file).
   ============================================================================================ */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
:root {
  --ease: cubic-bezier(.2, .7, .2, 1); --spring: cubic-bezier(.3, 1.4, .5, 1);
  --r: 18px; --accent-2: #f6c458;
  --shadow: 0 1px 2px rgba(20,33,61,.05), 0 10px 28px rgba(20,33,61,.08);
  --shadow-lg: 0 2px 4px rgba(20,33,61,.06), 0 18px 44px rgba(20,33,61,.14);
  --glow-a: color-mix(in srgb, var(--accent) 16%, transparent); --glow-b: color-mix(in srgb, var(--info) 9%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root { --accent-2: #ffd98a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.28); --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 20px 48px rgba(0,0,0,.42);
    --glow-a: color-mix(in srgb, var(--accent) 11%, transparent); --glow-b: color-mix(in srgb, var(--info) 10%, transparent); }
}
/* a soft wash of colour behind every page */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(820px 480px at 92% -8%, var(--glow-a), transparent 62%), radial-gradient(640px 460px at -12% 18%, var(--glow-b), transparent 60%); }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
svg { flex: none; }
.btn svg, .pill svg, .eyebrow svg { width: 18px; height: 18px; }
.pill svg { width: 13px; height: 13px; }

/* ---------- loaders ---------- */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; opacity: 0; border-radius: 0 3px 3px 0; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
#progress.on { opacity: 1; animation: crawl 9s cubic-bezier(.08, .7, .2, 1) forwards; }
#progress.done { width: 100%; opacity: 0; transition: opacity .4s .12s; }
@keyframes crawl { from { width: 6%; } to { width: 90%; } }
.sk { border-radius: 10px; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.25s linear infinite; }
.sk.line { height: 13px; } .sk.line.tiny { height: 10px; } .sk.line.chip { height: 36px; border-radius: 10px; } .sk.title { height: 30px; border-radius: 12px; }
@keyframes shimmer { to { background-position: -220% 0; } }
.skeleton-page { animation: fade .25s both; }
.btn { position: relative; --spin: var(--on-brand); }
.btn.gold { --spin: #2a1c00; } .btn.soft, .btn.ghost { --spin: var(--ink); }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--spin) 28%, transparent); border-top-color: var(--spin); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- a page arriving ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 60% { transform: scale(1.015); } 100% { transform: none; opacity: 1; } }
main .wrap.enter > * > * { animation: rise .46s var(--ease) both; }
main .wrap.enter > * > :nth-child(2) { animation-delay: 50ms; } main .wrap.enter > * > :nth-child(3) { animation-delay: 100ms; }
main .wrap.enter > * > :nth-child(4) { animation-delay: 150ms; } main .wrap.enter > * > :nth-child(5) { animation-delay: 200ms; }
main .wrap.enter > * > :nth-child(6) { animation-delay: 250ms; } main .wrap.enter > * > :nth-child(n+7) { animation-delay: 300ms; }
.enter .stagger > * { animation: rise .42s var(--ease) both; }
.enter .stagger > :nth-child(1) { animation-delay: 80ms; } .enter .stagger > :nth-child(2) { animation-delay: 120ms; } .enter .stagger > :nth-child(3) { animation-delay: 160ms; }
.enter .stagger > :nth-child(4) { animation-delay: 200ms; } .enter .stagger > :nth-child(5) { animation-delay: 240ms; } .enter .stagger > :nth-child(6) { animation-delay: 280ms; }
.enter .stagger > :nth-child(7) { animation-delay: 320ms; } .enter .stagger > :nth-child(n+8) { animation-delay: 360ms; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.qslide { animation: rise .32s var(--ease) both; }

/* ---------- refreshed basics ---------- */
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); }
.logo img { transition: transform .4s var(--spring); } .logo:hover img { transform: rotate(-6deg) scale(1.08); }
.top nav a { transition: background .18s, color .18s; }
.btn { transition: transform .14s var(--ease), filter .18s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); } .btn:active { transform: translateY(1px) scale(.985); }
.btn.gold { background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.gold:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 24px color-mix(in srgb, var(--accent) 42%, transparent); }
.card { border-radius: var(--r); }
a.card { transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.input, select.input, textarea.input { transition: border-color .15s, box-shadow .15s; }
.input:focus, select.input:focus, textarea.input:focus, .nila-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.bar i { transition: width .9s var(--ease); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.good i { background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 70%, #fff)); }
.ring { transition: --p 1.1s var(--ease); }
.stat { position: relative; overflow: hidden; } .stat b { font-size: 1.8rem; }
.tabs button { transition: background .18s, color .18s, border-color .18s, transform .12s; } .tabs button:active { transform: scale(.97); }
.err, .note { animation: rise .3s var(--ease) both; }
#toast { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .35s var(--spring); }
dialog[open] { animation: pop .28s var(--ease) both; } dialog::backdrop { backdrop-filter: blur(3px); animation: fade .25s both; }
details > summary { transition: color .15s; }
.auth { animation: pop .4s var(--ease) both; }
@media (max-width: 700px) {
  .tabbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: 0 -6px 24px rgba(0,0,0,.12); }
  .tabbar a { position: relative; transition: color .18s; padding: 9px 0 8px; }
  .tabbar a svg { transition: transform .3s var(--spring); }
  .tabbar a.on svg { transform: translateY(-1px) scale(1.12); }
  .tabbar a.on::before { content: ''; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 4px 4px; background: var(--accent); animation: pop .3s var(--ease) both; }
}

/* ---------- icons in tiles and lists ---------- */
.ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.ico svg { width: 22px; height: 22px; }
.ico.good { background: var(--good-soft); color: var(--good); } .ico.info { background: var(--info-soft); color: var(--info); } .ico.bad { background: var(--bad-soft); color: var(--bad); }
.ico.sm { width: 34px; height: 34px; border-radius: 10px; } .ico.sm svg { width: 18px; height: 18px; }
.eyebrow svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* ---------- landing ---------- */
.hero { position: relative; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 16px; }
.hero-badge svg { width: 15px; height: 15px; }
.hero h1 { letter-spacing: -.02em; }
.hero h1 em { background: linear-gradient(transparent 64%, color-mix(in srgb, var(--accent) 38%, transparent) 64%); border-radius: 2px; }
.statchips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.statchips div { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 104px; }
.statchips b { display: block; font: 700 1.35rem var(--serif); line-height: 1.1; } .statchips span { font-size: .76rem; color: var(--muted); font-weight: 600; }
.phone { background: linear-gradient(165deg, #22335c, #14213d 70%); color: #fdf8ec; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg), 0 0 0 8px color-mix(in srgb, var(--accent) 10%, transparent); animation: float 6s ease-in-out infinite; }
.phone .q { background: rgba(255,255,255,.08); } .phone .o { border-color: rgba(255,255,255,.2); }
.phone .o.ok { animation: pop .5s var(--ease) 1.1s both; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (min-width: 900px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { display: flex; flex-direction: column; gap: 4px; transition: transform .2s var(--ease), border-color .2s; }
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.feature .ico { font-size: 0; } .feature h3 { margin: 10px 0 2px; }
.sechead { max-width: 40em; } .sechead h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-top: 6px; } .sechead p { margin-top: 8px; }
.steps { display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding: 18px 18px 18px 64px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 1.05rem var(--serif); background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #2a1c00; }
.step b { display: block; margin-bottom: 2px; }
.nila-band { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 55%); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nila-av { animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 8%, transparent); } }
.promises .card { display: flex; gap: 12px; align-items: flex-start; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; transition: border-color .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font-weight: 650; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 400 1.5rem/1 var(--sans); color: var(--accent-ink); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); animation: rise .3s var(--ease) both; }
.cta-band { text-align: center; padding: 34px 20px; border-radius: 24px; background: linear-gradient(160deg, #22335c, #14213d 75%); color: #fdf8ec; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); }
.cta-band h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); } .cta-band p { color: rgba(253,248,236,.78); margin: 10px auto 20px; max-width: 34em; }
.cta-band .btn.ghost { color: #fdf8ec; border-color: rgba(255,255,255,.3); }

/* ---------- home ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-weight: 700; font-size: .86rem; background: var(--surface); border: 1px solid var(--line); }
.streak svg { width: 17px; height: 17px; color: #ef7d3c; } .streak.hot { border-color: color-mix(in srgb, #ef7d3c 50%, var(--line)); }
.streak.hot svg { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.14) rotate(3deg); } }
.plancard { border-left: 0; position: relative; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 46%); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.plancard .big b { font-size: 2.3rem; background: linear-gradient(180deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tasks a { transition: transform .16s var(--ease), border-color .16s, background .16s; } .tasks a:hover { transform: translateX(3px); }
.tasks a::after { content: '›'; font-size: 1.3rem; color: var(--muted); margin-left: auto; }
.quick .btn { gap: 7px; } .quick .btn svg { width: 16px; height: 16px; color: var(--accent-ink); }
.sech { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; } .sech h2 { font-size: 1.3rem; }
.paper { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.paper h3 { font-size: 1.12rem; } .paper .meta { font-size: .84rem; color: var(--muted); }
.paper .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; font-size: .88rem; }
.paper.mine { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.paper .go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; } .paper .go svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
a.paper:hover .go svg { transform: translateX(4px); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg a { flex: none; border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 650; font-size: .9rem; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }

/* ---------- paper and chapter pages ---------- */
.actions3 { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; padding: 14px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: .88rem; line-height: 1.25; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile small { font-weight: 600; color: var(--muted); font-size: .76rem; }
.chap { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.chap .num svg { width: 20px; height: 20px; }
.chap .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chap .bar { height: 5px; margin-top: 7px; }
.chap.next { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 60%); }
.chap.locked .num svg { width: 17px; height: 17px; color: var(--muted); }
.part-h h2 { font-size: 1.25rem; }
.chead2 { display: flex; flex-direction: column; gap: 10px; }

/* ---------- reading a lesson ---------- */
.readbar { position: fixed; top: 58px; left: 0; height: 3px; width: 0; z-index: 19; background: linear-gradient(90deg, var(--good), var(--accent)); border-radius: 0 3px 3px 0; pointer-events: none; }
.lessonnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 32px; }
@media (max-width: 700px) {
  .lessonnav { position: sticky; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 6; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 26%); }
  .lessonnav .btn { flex: 1; }
}
.lesson .callout { transition: transform .2s var(--ease); }
.lessontools .btn { transition: transform .25s var(--spring), background .2s; } .lessontools .btn.gold { animation: pop .35s var(--ease); }

/* ---------- questions and results ---------- */
.opt { transition: border-color .15s, background .15s, transform .12s var(--ease); } .opt:not([disabled]):active { transform: scale(.985); }
.opt.right { animation: pop .35s var(--ease); } .opt.wrong { animation: shake .35s var(--ease); }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.opt .k { transition: background .15s, color .15s, border-color .15s; }
.dots button { transition: transform .12s, background .15s; } .dots button:hover { transform: translateY(-2px); }
.resultcard { position: relative; overflow: visible; }
.confetti { position: absolute; left: 50%; top: 92px; width: 0; height: 0; pointer-events: none; z-index: 3; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: burst 1.4s var(--ease) both; }
@keyframes burst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 120px)) rotate(var(--r)); opacity: 0; } }
.flash .face { box-shadow: var(--shadow-lg); }

/* ---------- Nila ---------- */
.msg { animation: rise .3s var(--ease) both; }
.nila-sugg button { transition: transform .15s var(--ease), border-color .15s, color .15s; } .nila-sugg button:hover { transform: translateY(-2px); }

/* ---------- account ---------- */
.profile { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 55%); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.35rem; }
.profile h2 { font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.linklist { display: grid; }
.linklist a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 2px; text-decoration: none; font-weight: 600; border-top: 1px solid var(--line); transition: padding .18s var(--ease), color .18s; }
.linklist a:first-child { border-top: 0; } .linklist a:hover { padding-left: 8px; color: var(--accent-ink); }
.linklist a svg { width: 16px; height: 16px; color: var(--muted); }
.cardh { display: flex; gap: 12px; align-items: flex-start; } .cardh h3 { margin-top: 2px; }

/* ---------- empty states ---------- */
.emptybox { text-align: center; padding: 34px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.emptybox .ico { width: 56px; height: 56px; border-radius: 18px; animation: float 5s ease-in-out infinite; } .emptybox .ico svg { width: 28px; height: 28px; }

/* ---------- company console ---------- */
.console > *, .console .grid > * { min-width: 0; }
.cnav a { transition: background .16s, color .16s, transform .12s; } .cnav a:active { transform: scale(.98); }
.console table tbody tr { transition: background .12s; } .console table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.checkrow .tick { transition: background .2s, border-color .2s, transform .2s var(--spring); } .checkrow.ok .tick { transform: scale(1.05); }
.spark i { transition: height .7s var(--ease); }

/* ---------- stillness for anyone who asks for it ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print { #progress, .readbar, .lessonnav, .confetti, body::before { display: none !important; } }

.boot { padding: 0; color: inherit; }

/* paper cards on Home */
.paper .desc { font-size: .88rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#courseBox.enter > .grid > * { animation: rise .36s var(--ease) both; }
.passbar .ico { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.hello h2 { letter-spacing: -.01em; }

/* rows and cards that are links: the layout must win over the plain 'a.card' rule */
a.card.chap, .chap { display: grid; }
a.card.paper, .paper { display: flex; flex-direction: column; gap: 8px; }
.paper .bar { height: 6px; }
.profile { align-items: flex-start; } .profile .grow { flex: 1 1 190px; } .profile > .btn { margin-left: auto; }

/* results: show only the answers to fix, or all of them */
#review[data-show="wrong"] > .isok { display: none; }
/* sign-in screens */
.authmark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #2a1c00; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.authmark svg { width: 24px; height: 24px; }
.emptybox b { font-size: 1.05rem; }

/* console overview */
.console .wide2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.donelist > summary { cursor: pointer; padding: 10px 0 2px; font-weight: 600; } .donelist[open] > summary { margin-bottom: 4px; }
.console table td:first-child { min-width: 150px; }

/* ---- About us and the policies at the foot of every page ---- */
footer.site { margin-top: 44px; padding: 26px 0 24px; }
footer.site .foot-grid { display: grid; gap: 22px 28px; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
footer.site .foot-brand .logo { font-size: 1.05rem; color: var(--ink); } footer.site .foot-brand p { margin-top: 8px; max-width: 30em; }
footer.site .foot-grid nav { display: flex; flex-direction: column; gap: 9px; }
footer.site .foot-grid nav b { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
footer.site .foot-grid nav a, footer.site .foot-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
footer.site .foot-grid nav a:hover, footer.site .foot-links a:hover { color: var(--ink); text-decoration: underline; }
footer.site .foot-copy { padding-top: 16px; border-top: 1px solid var(--line); }
footer.site.slim { margin-top: 36px; padding: 18px 0 6px; } footer.site.slim .foot-links { margin-bottom: 8px; gap: 6px 16px; }
@media (max-width: 760px) { footer.site .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } footer.site .foot-brand { grid-column: 1 / -1; } }
@media print { footer.site, .nila-fab { display: none !important; } }

/* ---- the menu on the public pages ---- */
.pub-nav .wide { display: none; }
.navmenu { position: relative; } .navmenu summary { list-style: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.navmenu summary::-webkit-details-marker { display: none; } .navmenu summary:hover, .navmenu[open] summary { background: var(--surface-2); } .navmenu summary svg { width: 22px; height: 22px; }
.navpanel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; padding: 8px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: rise .2s var(--ease) both; }
.top nav .navpanel a { padding: 11px 12px; border-radius: 9px; }
@media (max-width: 420px) { .pub-nav .login { display: none; } }
@media (min-width: 760px) { .pub-nav .wide { display: inline-block; } .navmenu { display: none; } }

/* ---- Nila, one tap away on every study page ---- */
.nila-fab { position: fixed; right: 20px; bottom: 22px; z-index: 18; display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 20px 0 16px; border-radius: 99px; text-decoration: none; font-weight: 700; font-size: .95rem;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 38%, transparent), 0 2px 6px rgba(0,0,0,.18); animation: fab-in .5s var(--spring, ease) both; transition: transform .2s var(--ease, ease), box-shadow .2s; }
.nila-fab svg { width: 24px; height: 24px; flex: none; color: var(--accent); } @media (prefers-color-scheme: dark) { .nila-fab svg { color: var(--on-brand); } }
.nila-fab:hover { transform: translateY(-3px); } .nila-fab:active { transform: translateY(0) scale(.97); }
.nila-fab::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--accent); opacity: 0; animation: fab-ring 2.4s ease-out 1s 2; pointer-events: none; }
@keyframes fab-in { from { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes fab-ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
@media (max-width: 700px) {
  .nila-fab { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); width: 56px; height: 56px; padding: 0; justify-content: center; }
  .nila-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nila-fab.notabs { bottom: calc(18px + env(safe-area-inset-bottom)); } .nila-fab.high { bottom: calc(138px + env(safe-area-inset-bottom)); }
  .nila-fab svg { width: 26px; height: 26px; }
}
.nila-away { display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; } .nila-away svg { width: 15px; height: 15px; flex: none; }
.nila-paused { margin-top: 28px; } .nila-paused .nila-av { width: 64px; height: 64px; }
@media (prefers-reduced-motion: reduce) { .nila-fab, .nila-fab::after, .navpanel { animation: none; } .nila-fab { transition: none; } }

/* ---- a student's tax invoice, folded under the purchase ---- */
.invoice { margin-top: 6px; } .invoice summary { cursor: pointer; color: var(--info); font-weight: 600; }
.invoice p { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); line-height: 1.6; }

/* ---- orders, receipts and tax invoices ---- */
.order h3 { font-size: 1.15rem; margin-top: 2px; }
.ofacts { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0; }
.ofacts dt { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ofacts dd { margin: 2px 0 0; font-weight: 600; } .ref { font: .82rem/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.invoicedoc { padding: 26px; } .invoicedoc > * + * { margin-top: 22px; }
.invoicedoc header { align-items: flex-start; gap: 16px; } .invoicedoc header .logo { font-size: 1.15rem; } .invoicedoc header p { margin-top: 8px; }
.invoicedoc .right { text-align: right; } .invoicedoc h2 { font-size: 1.5rem; }
.invoicedoc section p { margin-top: 4px; }
.invtable { width: 100%; border-collapse: collapse; } .invtable th { background: none; border-bottom: 2px solid var(--line); padding: 8px 0; }
.invtable td { padding: 11px 0; border-bottom: 1px solid var(--line); } .invtable .total td { border-bottom: 0; font-weight: 700; font-size: 1.05rem; }
@media (max-width: 560px) { .invoicedoc { padding: 18px; } .invoicedoc .right { text-align: left; } }
@media print { .invoicedoc { box-shadow: none; border: 0; padding: 0; } body.can-print main { padding: 0; } }

/* ---------- search inside the lessons ---------- */
.searchbar { position: relative; display: flex; gap: 8px; }
.searchbar > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbar .input { flex: 1; min-width: 0; padding-left: 42px; }
.searchbar .btn { flex: none; }
.hit { display: block; text-decoration: none; color: inherit; }
.hit h3 { font-size: 1.02rem; margin: 4px 0 4px; }
.hit p { color: var(--ink-2); line-height: 1.55; overflow-wrap: anywhere; }
.hit.locked { opacity: .82; } .hit.locked p { display: flex; gap: 7px; align-items: center; } .hit.locked svg { width: 15px; height: 15px; flex: none; }
mark { background: color-mix(in srgb, var(--accent) 34%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
@media (max-width: 480px) { .searchbar .btn { padding-inline: 14px; } }

/* ---------- Account: your data, and closing the account ---------- */
.dangerzone { border-top: 1px solid var(--line); padding-top: 12px; }
.dangerzone > summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--bad); width: fit-content; }
.dangerzone[open] > summary { margin-bottom: 12px; }
.btn svg { flex: none; }

/* ---------- the exam record: what past exams asked ---------- */
.stack-s { display: grid; gap: 8px; }
.pill.band { font-weight: 700; white-space: nowrap; }
.pill.band.hot { background: var(--bad-soft); color: var(--bad); } .pill.band.warm { background: var(--accent-soft); color: var(--accent-ink); }
.pill.band.mild { background: var(--info-soft); color: var(--info); } .pill.band.cool { background: color-mix(in srgb, var(--line) 60%, transparent); color: var(--muted); }
.echips { display: flex; flex-wrap: wrap; gap: 6px; }
.echip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 650; background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
a.echip.link { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); } a.echip.link:hover { background: var(--accent-soft); }
.examnote { border-left: 4px solid var(--accent); }
.askedline { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 4px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: .88rem; }
.askedline svg { width: 17px; height: 17px; flex: none; margin-top: 2px; } .askedline a { color: inherit; }
.mtopic { display: flex; gap: 14px; align-items: flex-start; }
.mtopic h3 { font-size: 1.05rem; }
.mrank { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 700 1rem var(--serif); background: var(--accent-soft); color: var(--accent-ink); }
.mrank svg { width: 18px; height: 18px; } .mtopic.done .mrank { background: var(--good-soft); color: var(--good); }
.mtopic .callout { margin: 2px 0; } .mtopic .lockline { display: flex; gap: 6px; align-items: center; } .mtopic .lockline svg { width: 14px; height: 14px; }
.asks > summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink-2); width: fit-content; }
.asks ul { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: .88rem; color: var(--ink-2); }
.heatwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.heat { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.heat th, .heat td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.heat thead th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: none; }
.heat tbody tr:last-child th, .heat tbody tr:last-child td { border-bottom: 0; }
.heat th[scope=row], .heat thead th:first-child { text-align: left; white-space: normal; min-width: 210px; max-width: 320px; position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 600; }
.heat th[scope=row] a { text-decoration: none; color: inherit; } .heat th[scope=row] a:hover { text-decoration: underline; }
.heat th[scope=row] .pill { margin-left: 8px; font-size: .68rem; padding: 2px 8px; vertical-align: 1px; } .heat .lk svg { width: 13px; height: 13px; margin-left: 6px; vertical-align: -2px; color: var(--muted); }
.heat td { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 54px; }
.heat td.h1 { background: color-mix(in srgb, var(--accent) 16%, transparent); } .heat td.h2 { background: color-mix(in srgb, var(--accent) 36%, transparent); }
.heat td.h3 { background: color-mix(in srgb, var(--accent) 62%, transparent); color: #2a1c00; } .heat td.h4 { background: var(--accent); color: #2a1c00; }
.heat td.avg { color: var(--muted); font-weight: 600; border-left: 1px solid var(--line); }
.heat tr.other th, .heat tr.other td { color: var(--muted); font-weight: 500; }
.examcard .ico { background: var(--accent); color: #2a1c00; }
.plainlist { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
@media (max-width: 560px) { .heat th[scope=row], .heat thead th:first-child { min-width: 150px; max-width: 170px; font-size: .8rem; } .heat th[scope=row] .pill { display: block; width: fit-content; margin: 4px 0 0; } .mtopic { gap: 10px; } }
.heat th[scope=row] { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); }

/* ---- Full-length mock papers (public/js/papers.js) ---- */
ul.plain { margin: 0; padding-left: 1.2em; display: grid; gap: 7px; }
.paperbar { position: sticky; top: 58px; z-index: 6; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.paperbar.bottom { top: auto; bottom: 12px; }
.paperbar .timer { font-size: 1.1rem; } .paperbar .row { gap: 12px; align-items: center; }
.psection { border-bottom: 2px solid var(--line); padding-bottom: 8px; } .psection h2 { font-size: 1.25rem; }
.pgroup { gap: 18px; } .pgroup + .pgroup { border-top: 1px dashed var(--line); padding-top: 20px; }
.callout.scenario { background: var(--surface-2); border-color: transparent; } .callout.scenario .lab { color: var(--ink-2); } .callout.scenario p + p { margin-top: 8px; }
.pquestion .ppart + .ppart { border-top: 1px solid var(--line); padding-top: 16px; }
.pquestion .qstem p + p, .ppart .qstem p + p { margin-top: 8px; }
.pquestion.notcounted { opacity: .62; } .pquestion.notcounted h3::after { content: ' · not counted'; font-size: .78rem; font-weight: 600; color: var(--muted); }
.ppart textarea.input { min-height: 120px; }
.papercard h3 .pill { vertical-align: 2px; margin-left: 6px; }
@media (max-width: 560px) { .paperbar { top: 54px; padding: 8px 10px; } .paperbar .timer { font-size: 1rem; } }
.pmcqs[data-show="wrong"] > .isok { display: none; }
.pnav .dots button { width: 32px; height: 32px; font-size: .78rem; }
.psection .seg { margin-top: 4px; }

/* ---------- revision sheets: one page for a chapter ---------- */
.sheet { padding: 20px 22px; }
.sheet h3 { font-size: 1rem; margin: 20px 0 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sheet > h3:first-child, .sheethead + h3 { margin-top: 0; }
.sheethead { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sheethead .sheettitle { font-size: 1.2rem; margin: 4px 0 0; display: block; }
.spoints { margin: 0; padding-left: 1.4em; display: grid; gap: 9px; }
.spoints li::marker { font-weight: 800; color: var(--accent-ink); }
.sfrom { display: inline-flex; gap: 6px; align-items: baseline; margin-left: 4px; white-space: nowrap; }
.reftag { font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.lref { font-size: .76rem; font-weight: 650; color: var(--muted); text-decoration: none; border-bottom: 1px dotted currentColor; }
.lref:hover { color: var(--accent-ink); }
.straps { margin: 0; padding-left: 1.2em; display: grid; gap: 7px; }
.straps li::marker { color: var(--bad); }
.sformulas { display: grid; gap: 8px; } .sformulas .callout { margin: 0; }
.sheet .tablewrap { margin: 0; }
.sheet .callout.warn { margin: 18px 0 0; } .sheet .callout.warn ul { margin: 6px 0 0; padding-left: 1.2em; }
@media (max-width: 560px) { .sheet { padding: 16px 14px; } }
.sheetnav { display: flex; justify-content: space-between; gap: 10px; }

/* sign-up: the age question; the parent's details show only for a student under 18 */
.agebox { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.agebox legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 2px; }
.agebox .minor-only { display: none; }
.agebox:has(input[value="minor"]:checked) .minor-only { display: grid; }

/* the one-time note about cookies: a small card at the bottom, clear of the phone's tab bar */
.cookienote { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: .88rem; }
.cookienote a { color: inherit; }
.cookienote p { margin: 0; flex: 1; }
@media (max-width: 720px) { .cookienote { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media print { .cookienote { display: none; } }

/* the app-store build of the Android app shows no price and no way to pay */
.storeapp .price, .storeapp .passbar[href^="#/buy"], .storeapp a[href="#/pricing"], .storeapp a[href^="#/unlock"], .storeapp a[href^="#/buy"], .storeapp #prices, .storeapp .promises { display: none !important; }
