/* ==========================================================================
   RochakOS design system — "Rochak Pro" (PRD §9.1) + micro-interactions (§9.2)
   No build step. Tokens first, then base, layout, components, motion.
   ========================================================================== */

:root {
  --ink: #1a1035;
  --ink-2: #4a4468;
  --muted: #6b6589;
  --bg: #f8f6ff;
  --surface: #ffffff;
  --surface-2: #f4f1fb;
  --line: #ebe7f6;
  --line-2: #e3ddf5;
  --violet: #6d28d9;
  --violet-2: #7c3aed;
  --violet-deep: #5b21b6;
  --violet-soft: #f1ebff;
  --violet-ink: #ddd6fe;
  --night: #1a1035;
  --night-2: #2b1d5a;
  --night-ink: #c9c2e6;
  --grad: linear-gradient(90deg, #9333ea, #4f46e5);
  --amber-soft: #fff4dc;
  --amber-ink: #8a4b00;
  --amber: #f59e0b;
  --green: #15803d;
  --green-soft: #ecfdf3;
  --wa: #128c4a;
  --red: #dc2626;
  --red-ink: #b91c1c;
  --red-soft: #fef2f2;
  --blue: #1d4ed8;
  --blue-soft: #eef6ff;
  --teal: #0f766e;

  --r-sm: 10px;
  --r: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --pill: 999px;

  --sh-1: 0 1px 2px rgb(26 16 53 / .06);
  --sh-2: 0 12px 32px -16px rgb(76 29 149 / .25);
  --sh-float: 0 24px 48px -20px rgb(26 16 53 / .35);

  --f-display: 'Outfit', 'Noto Sans Devanagari', system-ui, sans-serif;
  --f-body: 'Plus Jakarta Sans', 'Noto Sans Devanagari', system-ui, sans-serif;
  --f-hi: 'Noto Sans Devanagari', 'Plus Jakarta Sans', system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: 24px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-pop: cubic-bezier(.175, .885, .32, 1.275);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules (.notice, .opt-row, .meter…). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html[lang="hi"] body { font-family: var(--f-hi); }
img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-deep); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hi { font-family: var(--f-hi); }
.ic { flex-shrink: 0; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: 96px; }
.section--tight { padding-top: 56px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.cols-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { display: grid; gap: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex-grow: 1; }
.between { justify-content: space-between; }
.center { text-align: center; }

/* ---------- Type ---------- */
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .08em; color: var(--violet); text-transform: uppercase; }
.eyebrow--amber { color: #b45309; } .eyebrow--teal { color: var(--teal); } .eyebrow--blue { color: var(--blue); }
.display { font-family: var(--f-display); font-size: clamp(40px, 5.2vw, 68px); line-height: 1.04; font-weight: 700; letter-spacing: -.025em; }
.h1 { font-family: var(--f-display); font-size: clamp(32px, 3.8vw, 52px); font-weight: 700; letter-spacing: -.02em; }
.h2 { font-family: var(--f-display); font-size: clamp(28px, 3vw, 42px); font-weight: 700; letter-spacing: -.02em; }
.h3 { font-family: var(--f-display); font-size: 24px; font-weight: 700; }
.h4 { font-size: 18px; font-weight: 800; line-height: 1.35; }
.lead { font-size: 20px; line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--muted); } .ink-2 { color: var(--ink-2); }
.small { font-size: 14px; } .tiny { font-size: 12px; }
.accent { color: var(--violet); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.section-head .eyebrow { display: block; margin-bottom: 8px; }
.prose { font-size: 17px; line-height: 1.8; color: var(--ink-2); }
.prose h2 { font-family: var(--f-display); font-size: 26px; color: var(--ink); margin: 32px 0 12px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: transform .1s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgb(99 52 234 / .6); }
.btn--primary:hover { color: #fff; box-shadow: 0 12px 26px -8px rgb(99 52 234 / .7); }
.btn--dark { background: var(--night); color: #fff; } .btn--dark:hover { color: #fff; background: #2b1d5a; }
.btn--light { background: #fff; color: var(--ink); } .btn--light:hover { color: var(--ink); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-2); } .btn--ghost:hover { color: var(--ink); border-color: #cfc3f5; }
.btn--outline-light { background: transparent; color: #fff; border-color: #4a3d7a; } .btn--outline-light:hover { color: #fff; border-color: #a99fd0; }
.btn--wa { background: var(--wa); color: #fff; } .btn--wa:hover { color: #fff; background: #0f7a40; }
.btn--danger { background: var(--red); color: #fff; } .btn--danger:hover { color: #fff; }
.btn--sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn--lg { height: 56px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 42px; padding: 0; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.link-arrow .ic { transition: transform .2s ease; }
.link-arrow:hover .ic { animation: bounce-x 1.1s ease-in-out infinite; }

/* ---------- Chips, pills, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; transition: border-color .2s, transform .2s; }
a.chip:hover { color: var(--ink); border-color: #cfc3f5; transform: translateY(-1px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--pill); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.pill--violet { background: var(--violet-soft); color: var(--violet-deep); }
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill--red { background: var(--red-soft); color: var(--red-ink); }
.pill--night { background: var(--night-2); color: #c4b5fd; }
.tag { display: inline-block; padding: 5px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.verify { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--pill); font-size: 13px; font-weight: 800; }
.verify--verified { background: var(--green-soft); color: var(--green); }
.verify--sourced { background: var(--violet-soft); color: var(--violet-deep); }
.verify--disputed { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.card--flat { background: var(--surface-2); border-color: transparent; }
.card--night { background: var(--night); color: #fff; border-color: transparent; }
.card--violet { background: var(--violet); color: #fff; border-color: transparent; }
.card--amber { background: var(--amber-soft); border-color: transparent; }
.card--blue { background: var(--blue-soft); border-color: transparent; }
.lift { transition: transform .2s var(--ease-out), box-shadow .2s ease, border-color .2s ease; }
.lift:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: #ddd3fb; }
.lift img { transition: transform .35s var(--ease-out); }
.lift:hover img { transform: scale(1.03); }
.orb { position: absolute; border-radius: 50%; pointer-events: none; }

/* ---------- Header ---------- */
.announce { background: var(--night); color: #e9e4fb; font-size: 14px; }
.announce .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; }
.announce a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; transition: transform .6s var(--ease-out); }
.brand:hover img { transform: rotate(-12deg) scale(1.05); }
.brand__name { font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.brand__name span { color: var(--violet); }
.nav { display: flex; gap: 2px; flex-grow: 1; }
.nav a { position: relative; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 15px; white-space: nowrap; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--violet-soft); color: var(--violet-deep); font-weight: 700; }
.wa-follow { background: #128c4a; color: #fff; gap: 6px; white-space: nowrap; }
.wa-follow:hover { background: #0f7a40; color: #fff; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); isolation: isolate; }
.seg > * { position: relative; z-index: 1; border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 13px; transition: color .2s; }
.seg > [aria-pressed="true"], .seg > [aria-selected="true"], .seg > [aria-current="true"] { color: var(--ink); }
.seg__thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: 9px; background: #fff; box-shadow: 0 1px 3px rgb(26 16 53 / .12); transition: transform .25s var(--ease-out), width .25s var(--ease-out); }
.seg--lg > * { padding: 10px 18px; font-size: 15px; }
.seg--dark > [aria-selected="true"] { color: #fff; }
.seg--dark .seg__thumb { background: var(--night); }
.mobile-bar { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; }
.hero .grid { align-items: center; gap: 48px; }
.hero__copy { display: flex; flex-direction: column; gap: 24px; }
.hero__badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 7px; border-radius: var(--pill); background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.search { display: flex; align-items: center; gap: 10px; height: 64px; max-width: 560px; padding: 0 8px 0 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--sh-2); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 4px rgb(167 139 250 / .25), var(--sh-2); }
.search input { flex-grow: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }
.trust { display: flex; flex-wrap: wrap; gap: 22px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust .ic { color: var(--green); }
.hero__art { position: relative; height: 560px; }
.hero__panel { position: absolute; left: 60px; right: 0; top: 20px; bottom: 0; border-radius: 36px; background: var(--violet); overflow: hidden; }
.hero__panel .hero__kid { position: absolute; right: 30px; bottom: -10px; height: 540px; width: auto; }
.float-card { position: absolute; background: #fff; border-radius: 20px; box-shadow: var(--sh-float); }

/* ---------- Tiles ---------- */
.tier { position: relative; display: flex; flex-direction: column; gap: 4px; height: 310px; padding: 22px; border-radius: var(--r-lg); overflow: hidden; color: var(--ink); }
.tier:hover { color: var(--ink); }
.tier img { position: absolute; left: 50%; bottom: -8px; height: 170px; width: auto; transform: translateX(-50%); transition: transform .35s var(--ease-out); }
.tier:hover img { transform: translateX(-50%) translateY(-6px) scale(1.04); }
.exam { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: 22px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.exam:hover { color: var(--ink); }
.exam__mark { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 18px; font-weight: 800; }

/* ---------- Quiz bits ---------- */
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; transition: border-color .2s, background-color .2s, transform .1s; }
.opt:hover { border-color: #c4b5fd; }
.opt:active { transform: scale(.99); }
.opt[disabled] { cursor: default; }
.opt.is-correct { background: var(--green-soft); border: 1.5px solid var(--green); animation: correct-glow .6s ease-out; }
.opt.is-wrong { background: var(--red-soft); border: 1.5px solid var(--red-ink); animation: shake-sm .35s ease-in-out; }
.opt.is-picked { background: #f5f3ff; border: 2px solid var(--violet); }
.opt__key { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; transition: background-color .2s, color .2s; }
.opt.is-picked .opt__key { background: var(--violet); color: #fff; }
.opt.is-correct .opt__key { background: var(--green); color: #fff; }
.opt.is-wrong .opt__key { background: var(--red-ink); color: #fff; }
.feedback { font-size: 14px; font-weight: 600; min-height: 22px; }
.feedback.is-good { color: var(--green); } .feedback.is-bad { color: var(--red-ink); }

/* ---------- Quote & share ---------- */
.quote-hi { font-family: var(--f-hi); font-weight: 700; line-height: 1.45; }
.share-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.share-more { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card-preview { display: flex; align-items: center; justify-content: center; height: 540px; background: var(--bg); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.qcard { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; border-radius: 22px; background: var(--violet); color: #fff; box-shadow: 0 30px 60px -30px rgb(76 29 149 / .6); transition: width .35s var(--ease-out), height .35s var(--ease-out), padding .35s var(--ease-out); }
.qcard[data-size="square"] { width: 460px; height: 460px; padding: 34px; }
.qcard[data-size="square"] .qcard__text { font-size: 30px; }
.qcard[data-size="story"] { width: 272px; height: 484px; padding: 24px; }
.qcard[data-size="story"] .qcard__text { font-size: 22px; }
.qcard[data-size="og"] { width: 700px; height: 367px; padding: 36px; }
.qcard[data-size="og"] .qcard__text { font-size: 28px; }
.qcard__text { position: relative; font-family: var(--f-hi); font-weight: 700; line-height: 1.45; transition: font-size .35s var(--ease-out); }
.qcard--poster { padding: 0 !important; background: var(--night); }
.qcard--poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.qcard--poster[data-size="portrait"] { width: 380px; height: 475px; }
.avatar { border-radius: 50%; object-fit: cover; }

/* ---------- Test player ---------- */
.player { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }
.player__bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); }
.player__body { flex-grow: 1; display: flex; gap: 24px; padding: 24px 28px; max-width: 1440px; width: 100%; margin: 0 auto; }
.timer { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-family: var(--f-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.is-low { background: var(--red-soft); color: var(--red-ink); animation: pulse-soft 1s ease-in-out infinite; }
.palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.palette button { height: 44px; border-radius: 12px; border: 1px solid #cfc8e6; background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 800; transition: transform .1s, background-color .2s; }
.palette button:active { transform: scale(.94); }
.palette .is-answered { background: var(--green); color: #fff; border-color: var(--green); }
.palette .is-review { background: var(--violet-2); color: #fff; border-color: var(--violet-2); }
.palette .is-skipped { background: var(--red); color: #fff; border-color: var(--red); }
.palette .is-current { outline: 3px solid var(--ink); outline-offset: 1px; }
.progress { height: 8px; border-radius: 8px; background: var(--violet-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--violet); border-radius: 8px; transition: width .4s var(--ease-out); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 13px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Results ---------- */
.ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 14; }
.ring .ring__track { stroke: var(--violet-soft); }
.ring .ring__fill { stroke: var(--violet); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.1s var(--ease-out); }
.ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring__label b { font-family: var(--f-display); font-size: 34px; }
.review-item { border-left: 4px solid var(--line-2); padding: 14px 18px; background: #fff; border-radius: 0 14px 14px 0; }
.review-item.is-right { border-left-color: var(--green); } .review-item.is-wrong { border-left-color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; background: #fff; border-top: 1px solid var(--line); padding: 64px 0 40px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.site-footer a { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.site-footer a:hover { color: var(--violet); }
.site-footer .base { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: var(--night); color: #fff; font-size: 14px; font-weight: 700; box-shadow: var(--sh-float); animation: pop-in .25s var(--ease-pop) both; }

/* ==========================================================================
   Motion (PRD §9.2) — transform/opacity only; all off for reduced motion
   ========================================================================== */
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float-slow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-reverse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes shake-sm { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes correct-glow { 0% { box-shadow: 0 0 0 0 rgb(21 128 61 / .45); } 100% { box-shadow: 0 0 0 10px rgb(21 128 61 / 0); } }
@keyframes bounce-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes pulse-soft { 50% { opacity: .75; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { animation: fade-up .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.anim-float { animation: float 3.5s ease-in-out infinite; }
.anim-float-slow { animation: float-slow 5s ease-in-out infinite; }
.anim-float-reverse { animation: float-reverse 4s ease-in-out infinite; }
.anim-pop { animation: pop-in .25s var(--ease-pop) both; }
.anim-wiggle:hover .ic { animation: wiggle .6s ease-in-out; }
.shimmer { background-image: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / .55) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.live-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.2s cubic-bezier(0, 0, .2, 1) infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
/* Header: tighter on laptop screens so it never runs off the right edge; below 1180 px the links move into the Menu button. */
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(30, 20, 70, .16); }
.nav-menu__panel a { padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.nav-menu__panel a:hover { background: var(--surface-2); color: var(--ink); }
.nav-menu__panel a[aria-current="page"] { background: var(--violet-soft); color: var(--violet-deep); }
/* The page is at most 1248 px wide inside: the full menu fits at this size in both languages. */
.site-header .wrap { gap: 12px; }
.nav { min-width: 0; }
.nav a { padding: 8px 9px; font-size: 14px; }
@media (max-width: 1440px) {
  .brand__name { font-size: 20px; }
}
@media (max-width: 1180px) {
  .nav { display: none; }
  .nav-menu { display: block; }
}
@media (max-width: 480px) {
  .nav-menu__label { display: none; }
}
@media (max-width: 1100px) {
  .nav { display: none; }
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__art { height: 480px; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > [class*="span-"] { grid-column: auto; grid-row: auto !important; }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .player__body { flex-direction: column; }
  .player__side { width: 100% !important; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .section { padding-top: 56px; }
  .hero { padding: 32px 0 40px; }
  .hero__art { height: 380px; }
  .hero__panel { left: 0; }
  .hero__panel .hero__kid { height: 380px; right: 0; }
  .float-card--quiz { left: 0 !important; top: 10px !important; width: 230px !important; }
  .float-card--quote { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier { height: 220px; } .tier img { height: 118px; left: auto; right: -4px; transform: none; }
  .tier:hover img { transform: translateY(-4px); }
  .tier .small.ink-2 { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .share-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-preview { height: 420px; }
  .qcard[data-size="square"] { width: 300px; height: 300px; padding: 22px; }
  .qcard[data-size="square"] .qcard__text { font-size: 20px; }
  .qcard[data-size="og"] { width: 320px; height: 168px; padding: 16px; }
  .qcard[data-size="og"] .qcard__text { font-size: 14px; }
  .qcard[data-size="story"] { width: 200px; height: 356px; padding: 16px; }
  .qcard--poster[data-size="portrait"] { width: 272px; height: 340px; }
  .qcard[data-size="story"] .qcard__text { font-size: 17px; }
  .header-actions .hide-sm { display: none; }
  .wa-follow { padding-inline: 10px; }
  .wa-follow__label { display: none; }
  .announce span.hide-sm { display: none; }
  .site-footer .base { flex-direction: column; }
  .mobile-bar { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: 68px; padding: 0 6px 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line); }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .mobile-bar a[aria-current="page"] { color: var(--violet); font-weight: 800; }
  body.has-mobile-bar { padding-bottom: 68px; }
  .player__bar { padding: 0 14px; gap: 10px; }
  .player__bar .hide-sm { display: none; }
  .player__body { padding: 14px; }
}

/* ---------- Form fields ---------- */
.field { height: 50px; width: 100%; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field:focus { outline: 0; border-color: #a78bfa; box-shadow: 0 0 0 4px rgb(167 139 250 / .25); }

/* ---------- Admin studio ---------- */
.af { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.af__label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.af__hint { font-size: 12px; color: var(--muted); }
.field--area { height: auto; padding: 12px 14px; line-height: 1.55; resize: vertical; }
select.field { appearance: auto; }
.field.hi, .field--area.hi { font-family: var(--f-hi); }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { font-family: var(--f-display); font-size: 28px; font-weight: 700; flex-grow: 1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); margin-bottom: 16px; }
.toolbar .af { min-width: 160px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 12px 14px; background: var(--surface-2); }
.table td { padding: 12px 14px; border-top: 1px solid var(--surface-2); vertical-align: top; }
.table tr:hover td { background: #fcfbff; }
.table .clip { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.panel h2 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.flash--ok { background: var(--green-soft); color: var(--green); } .flash--err { background: var(--red-soft); color: var(--red-ink); }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 16px 0 0; }
.pagination a { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; padding: 0 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 14px; }
.pagination .active a { background: var(--night); color: #fff; border-color: var(--night); }
.opt-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 10px; align-items: center; }
.opt-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); justify-self: center; }
.diff-hi { outline: 2px dashed #f59e0b; outline-offset: 2px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .opt-row { grid-template-columns: 34px 1fr; } .opt-row .field.hi { grid-column: 2; } }

/* ==========================================================================
   AI assist (PRD Phase 2) — admin only
   ========================================================================== */
.btn--ai { background: linear-gradient(90deg, #7c3aed, #db2777); color: #fff; box-shadow: 0 8px 20px -10px rgb(190 24 93 / .55); }
.btn--ai:hover { color: #fff; box-shadow: 0 12px 24px -10px rgb(190 24 93 / .65); }
.btn--ai .ic { transition: transform .35s var(--ease-pop); }
.btn--ai:hover .ic { transform: rotate(18deg) scale(1.12); }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn[aria-busy="true"] { pointer-events: none; position: relative; overflow: hidden; }
.btn[aria-busy="true"]::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / .45) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.ai-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, #f5f3ff, #fdf2f8); border: 1px solid #ede9fe; }
.ai-bar__label { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #86198f; }
.ai-filled { animation: ai-glow 1.4s var(--ease-out) both; border-color: #c084fc !important; }
@keyframes ai-glow { 0% { box-shadow: 0 0 0 0 rgb(192 132 252 / .6); } 100% { box-shadow: 0 0 0 12px rgb(192 132 252 / 0); } }
.ai-notes { background: #fdf4ff; border-color: #f5d0fe; }
.ai-notes ul { margin: 6px 0 0 18px; padding: 0; }
.ai-notes li { margin: 3px 0; }
.pill--ai { background: #fae8ff; color: #86198f; }
.field--code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.dist-preview { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.code-out { margin: 0; padding: 14px; border-radius: 12px; background: var(--night); color: #e9e4fb; font: 12.5px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .progress > span.is-warn { background: var(--amber); }
.meter .progress > span.is-over { background: var(--red); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }

/* ==========================================================================
   Control Center (PRD M14) — admin only
   ========================================================================== */
.kill { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); background: #fff; }
.kill.is-on { background: #fef2f2; border-color: #fecaca; }
.kill__dot { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--green-soft); color: var(--green); }
.kill.is-on .kill__dot { background: var(--red); color: #fff; animation: pulse-soft 1.6s ease-in-out infinite; }
.btn--kill { background: var(--red); color: #fff; box-shadow: 0 8px 20px -10px rgb(220 38 38 / .7); }
.btn--kill:hover { color: #fff; background: #b91c1c; }
.modes { display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(4, minmax(90px, 1fr)) minmax(170px, 1.4fr); align-items: center; gap: 8px 10px; }
.modes__head { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.modes label.opt { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.modes label.opt input { position: absolute; opacity: 0; pointer-events: none; }
.modes label.opt:has(input:checked) { background: var(--violet-soft); border-color: #c4b5fd; color: var(--violet-deep); }
.modes label.opt.is-auto:has(input:checked) { background: var(--green-soft); border-color: #86efac; color: var(--green); }
.modes label.opt:has(input:focus-visible) { outline: 3px solid #a78bfa; outline-offset: 2px; }
.health { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 70px 80px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .modes { grid-template-columns: 1fr 1fr; }
  .modes__head { display: none; }
  .modes > .modes__name { grid-column: 1 / -1; margin-top: 8px; }
}

/* ==========================================================================
   Current affairs (PRD M05) + print
   ========================================================================== */
.ca-note { border-radius: 22px; scroll-margin-top: 96px; }
.ca-note:target { outline: 3px solid #c4b5fd; outline-offset: 3px; animation: pop-in .3s var(--ease-pop) both; }
.ca-note h3 { font-family: var(--f-display); font-size: 21px; line-height: 1.3; }
.ca-note__label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--violet-deep); }
.ca-note ul { margin: 6px 0 0 20px; padding: 0; }
.ca-note li { margin: 5px 0; }
.ca-note__static { padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14px; }
.ca-day { display: flex; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); margin: 28px 0 14px; break-after: avoid; }
.print-doc .announce, .print-doc .site-header, .print-doc .site-footer, .print-doc .mobile-bar, .print-doc .no-print { display: none !important; }
.print-doc main { padding-bottom: 0; }
@media print {
  .announce, .site-header, .site-footer, .mobile-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}
/* Reveal animations wait for scrolling; a printed page must show everything at once. */
.print-doc .reveal, .print-doc [data-reveal], .print-doc [data-reveal-group] > * { opacity: 1 !important; transform: none !important; animation: none !important; }
@media print { .reveal, [data-reveal], [data-reveal-group] > * { opacity: 1 !important; transform: none !important; animation: none !important; } }

/* ==========================================================================
   Analytics charts (PRD M10) — thin marks, recessive furniture (dataviz spec)
   ========================================================================== */
.vchart { position: relative; height: 200px; margin: 8px 0 0 44px; }
.vchart__grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.vchart__tick { position: absolute; left: -44px; width: 38px; transform: translateY(-50%); text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vchart__cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.vchart__slot { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; outline: none; }
.vchart__bar { width: 100%; max-width: 24px; background: var(--violet); border-radius: 4px 4px 0 0; transition: filter .15s; }
.vchart__slot:hover .vchart__bar, .vchart__slot:focus-visible .vchart__bar { filter: brightness(1.25); }
.vchart__slot:focus-visible { box-shadow: 0 0 0 2px #a78bfa inset; border-radius: 6px; }
.vchart__cap { position: absolute; bottom: calc(var(--h) + 4px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.vchart__axis { display: flex; justify-content: space-between; margin: 6px 0 0 44px; font-size: 11px; color: var(--muted); }
.charttip { position: fixed; z-index: 95; pointer-events: none; padding: 8px 11px; border-radius: 10px; background: var(--night); color: #fff; font-size: 13px; box-shadow: var(--sh-float); }
.charttip b { display: block; font-size: 15px; }
.charttip span { color: #c4b5fd; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 7px 0; }
.mrow__track { display: block; grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--violet-soft); overflow: hidden; }
.mrow__fill { display: block; height: 100%; background: var(--violet); border-radius: 6px; }
.stat__value { font-family: var(--f-body); font-size: 34px; font-weight: 700; line-height: 1.1; display: block; margin-top: 6px; }
.stat__delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 700; }
.stat__delta.is-up { color: var(--green); } .stat__delta.is-down { color: var(--red-ink); } .stat__delta.is-flat { color: var(--muted); }

/* ==========================================================================
   Curriculum & question bank 2.0 (PRD M18, Phase 5A) — admin
   ========================================================================== */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.fold { border-radius: 12px; padding: 6px 10px; }
.fold[open] { background: var(--surface-2); }
.fold > summary, .node > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker, .node > summary::-webkit-details-marker { display: none; }
.node { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.node > summary { padding: 12px 16px; }
.node > summary:hover { background: #fcfbff; border-radius: 16px; }
.node[open] > summary { border-bottom: 1px solid var(--surface-2); }
.node__num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px; background: var(--violet-soft); color: var(--violet-deep); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.node__body { padding: 14px 16px; }
.node--topic, .node--concept { border-radius: 12px; background: var(--surface-2); border-color: transparent; }
.node--topic > summary, .node--concept > summary { padding: 9px 12px; }
.node--concept { background: #fff; border-color: var(--line); margin-top: 8px; }
.node__form { padding: 12px; border-radius: 12px; background: #fcfbff; border: 1px dashed #e4defa; }
.node__add { gap: 8px; margin-top: 10px; }
.node__add .field { flex: 1 1 180px; min-width: 0; }
.progress > span.is-done { background: var(--green); }
.cov { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; }
.cov::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cov--complete { color: var(--green); } .cov--in_progress { color: var(--violet-deep); } .cov--needs_review { color: var(--amber-ink); } .cov--needs_content { color: var(--red-ink); }
.covbar { display: flex; height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; gap: 2px; }
.covbar > span { display: block; height: 100%; }
.covbar__pub { background: var(--violet); border-radius: 6px 0 0 6px; }
.covbar__rev { background: #c4b5fd; }
.stat-tile { padding: 16px 18px; border-radius: 18px; color: var(--ink); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.stat-tile:hover { transform: translateY(-2px); color: var(--ink); }
.stat-tile .stat__value { font-size: 28px; font-variant-numeric: tabular-nums; }
.bulkbar { position: sticky; top: 0; z-index: 5; }
@media (max-width: 900px) { .stat-tile.span-2 { grid-column: span 6; } }

/* ---------- Test feedback (FR-03.10) ---------- */
.fb-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ink-2); }
.fb-table { width: 100%; border-collapse: collapse; }
.fb-table th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 6px 8px 8px 0; }
.fb-table td { padding: 9px 8px 9px 0; border-top: 1px solid var(--surface-2); vertical-align: middle; }

/* ---------- "Create my test" choice chips (FR-03.12) ---------- */
.picks-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 10px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--pill); border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: 15px; transition: border-color .2s, background .2s, transform .2s var(--ease-pop), box-shadow .2s; }
.pick small { font-size: 12px; font-weight: 700; color: var(--muted); }
.pick:hover span { border-color: #cfc3f5; transform: translateY(-1px); }
.pick input:checked + span { background: var(--violet-soft); border-color: var(--violet); color: var(--violet-deep); box-shadow: 0 0 0 3px rgb(124 58 237 / .12); }
.pick input:checked + span small { color: var(--violet-deep); }
.pick input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pick span { transition: none; } .pick:hover span { transform: none; } }
.pill--muted { background: var(--surface-2); color: var(--ink-2); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
select.field[multiple] { height: auto; min-height: 120px; padding: 8px 10px; }
select.field[multiple] option { padding: 4px 6px; border-radius: 6px; }

/* ---------- Report a problem / leaderboard (FR-02.7, FR-03.7) ---------- */
.report { margin-top: 8px; }
.report > summary { cursor: pointer; color: var(--muted); font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.report > summary::-webkit-details-marker { display: none; }
.report > summary:hover { color: var(--red-ink); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.board li.is-me { border-color: var(--violet); background: var(--violet-soft); }
.board__rank { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface-2); flex-shrink: 0; }
.board li:nth-child(1) .board__rank { background: #fde68a; color: #7c4a03; }
.board li:nth-child(2) .board__rank { background: #e5e7eb; color: #374151; }
.board li:nth-child(3) .board__rank { background: #fed7aa; color: #7c2d12; }

/* ---------- Reel studio and gallery (PRD M04) ---------- */
.reel-canvas { width: 100%; max-width: 340px; aspect-ratio: 9 / 16; height: auto; border-radius: 22px; background: #0b0820; box-shadow: 0 20px 40px -24px rgb(26 16 53 / .55); }
.reel-video { width: 100%; max-width: 340px; aspect-ratio: 9 / 16; border-radius: 16px; background: #000; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.checks li.is-error { background: var(--red-soft); color: var(--red-ink); font-weight: 700; }
.checks li.is-warn { background: var(--amber-soft); color: var(--amber-ink); }
.checks li.is-ok { background: var(--green-soft); color: var(--green); font-weight: 700; }
.scene-edit { border: 1px solid var(--line); background: #fff; }
.reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.reel-grid--small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.reel-tile { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.reel-tile__img { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #1a1035, #6d28d9); }
.reel-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-tile__play { position: absolute; inset: auto auto 12px 12px; width: 40px; height: 40px; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--violet-deep); display: flex; align-items: center; justify-content: center; font-size: 15px; padding-left: 3px; }
.reel-tile__len { position: absolute; right: 10px; bottom: 12px; padding: 3px 9px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; font-weight: 700; }
.reel-player { width: 100%; max-width: 380px; aspect-ratio: 9 / 16; border-radius: 24px; background: #000; box-shadow: 0 24px 48px -28px rgb(26 16 53 / .6); }


/* ---------- Content calendar (PRD §6.6) ---------- */
.cal-seg { text-decoration: none; }
.cal-seg[aria-current="true"] { background: #fff; box-shadow: 0 1px 3px rgb(26 16 53 / .12); }
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar__title { font-family: var(--f-display); font-size: 20px; margin: 0 6px; min-width: 150px; text-align: center; }
.cal-filter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--pill); border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; }
.cal-chip[aria-pressed="false"] { opacity: .45; background: var(--surface-2); }
.cal-chip[aria-pressed="false"] .cal-dot { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--muted); }
.cal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--violet)); flex: none; }
.cal-chip--ghost .cal-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); border: 1px dashed var(--muted); }
.cal-chip--article, .cal-item--article { --c: #6d28d9; --cs: #f1ebff; }
.cal-chip--fact, .cal-item--fact { --c: #b45309; --cs: #fff4dc; }
.cal-chip--quote, .cal-item--quote { --c: #0f766e; --cs: #e6f6f4; }
.cal-chip--quiz, .cal-item--quiz { --c: #1d4ed8; --cs: #eef6ff; }
.cal-chip--ca, .cal-item--ca { --c: #15803d; --cs: #ecfdf3; }
.cal-chip--job, .cal-item--job { --c: #b91c1c; --cs: #fef2f2; }
.cal-chip--reel, .cal-item--reel { --c: #be185d; --cs: #fdf2f8; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cal__dow { background: var(--surface-2); padding: 8px 10px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.cal__day { background: #fff; min-height: 118px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .15s; }
.cal--week .cal__day { min-height: 420px; }
.cal__day.is-out { background: #fcfbff; }
.cal__day.is-out .cal__date { opacity: .5; }
.cal__day.is-past { background: #fbfafe; }
.cal__day.is-today { box-shadow: inset 0 0 0 2px var(--violet); }
.cal__day.is-today .cal__date b { background: var(--violet); color: #fff; border-radius: var(--pill); padding: 0 7px; }
.cal__day.is-over { background: var(--violet-soft); }
.cal.is-dragging .cal__day:not(.is-past) { outline: 1px dashed #cfc3f5; outline-offset: -4px; }
.cal__date { font-size: 13px; padding: 2px 4px 4px; color: var(--ink-2); }
.cal__dname { display: none; }
.cal-item, .cal-ghost { display: flex; flex-direction: column; gap: 1px; padding: 4px 7px; border-radius: 8px; font-size: 12px; line-height: 1.3; color: var(--ink); text-decoration: none; min-width: 0; }
.cal-item__meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.cal-item { background: var(--cs); border-left: 3px solid var(--c); }
.cal-item:hover, .cal-ghost:hover { color: var(--ink); filter: brightness(.97); }
.cal-item[draggable="true"] { cursor: grab; }
.cal-item.is-draft, .cal-item.is-in_review, .cal-item.is-ready { background: #fff; border: 1px solid var(--line-2); border-left: 3px solid var(--c); }
.cal-item__time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c, var(--muted)); }
.cal-item__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; overflow-wrap: anywhere; }
.cal-item__state { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-ghost { border: 1px dashed #cfc3f5; color: var(--ink-2); background: repeating-linear-gradient(135deg, #fff 0 6px, #faf8ff 6px 12px); }
.cal-ghost .cal-item__text { font-weight: 600; -webkit-line-clamp: 1; }
.cal-ghost--sum { flex-direction: row; align-items: center; gap: 5px; font-weight: 700; color: var(--muted); }
.cal-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: #fff; padding: 10px 16px; border-radius: var(--pill); font-size: 14px; font-weight: 600; box-shadow: var(--sh-float); z-index: 60; }
.cal-toast.is-bad { background: var(--red-ink); }
@media (max-width: 760px) {
  .cal { display: block; background: none; border: 0; }
  .cal__dow, .cal__day:not(.has) { display: none; }
  .cal__day, .cal--week .cal__day { min-height: 0; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
  .cal__dname { display: inline; }
  .cal-filter { justify-content: flex-start; }
  .cal-bar__title { min-width: 0; }
}

/* ---------- Edit lock + history (FR-01.10, FR-01.3) ---------- */
.edit-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: -6px 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.edit-bar__lock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--green); font-weight: 600; }
.edit-bar .btn .muted { margin-left: 4px; font-weight: 700; }
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.notice > svg { flex: none; margin-top: 3px; }
.notice--warn { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid #f6d58f; }
.rev-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow-y: auto; }
.rev-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
.rev-item:hover { background: var(--surface-2); color: var(--ink); }
.rev-item.is-current { background: var(--violet-soft); border-color: #d9ccfb; }
.rev-item__top { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.diff { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.diff__field { font-size: 13px; font-weight: 700; color: var(--ink-2); overflow-wrap: anywhere; }
.diff__body { font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.diff del, .diff-key:is(del) { background: #fde2e2; color: #8f1d1d; text-decoration: line-through; border-radius: 3px; padding: 0 1px; }
.diff ins, .diff-key:is(ins) { background: #d9f7e3; color: #0f5d2c; text-decoration: none; border-radius: 3px; padding: 0 1px; }
@media (max-width: 760px) { .diff { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Media library (FR-01.6) ---------- */
.media-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; text-align: center; border: 2px dashed var(--line-2); color: var(--ink-2); transition: border-color .2s, background .2s; }
.media-drop.is-over { border-color: var(--violet); background: var(--violet-soft); }
.link-like { color: var(--violet); text-decoration: underline; cursor: pointer; }
.chip.is-on { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-ink); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.media-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.media-card:target { box-shadow: 0 0 0 2px var(--violet); }
.media-card__img { display: block; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#f1eef8 0 25%, #fff 0 50%) 0 0 / 16px 16px; aspect-ratio: 4 / 3; }
.media-card__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-card__meta { display: flex; justify-content: space-between; gap: 8px; }
.media-card__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.media-card__del { color: var(--red-ink); }
.media-picker { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 18px; border: 0; border-radius: var(--r-lg); box-shadow: var(--sh-float); }
.media-picker::backdrop { background: rgb(26 16 53 / .45); }
.media-picker__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.media-picker__head h2 { margin: 0; font-size: 18px; flex: 1 1 auto; }
.media-picker__head .field { height: 38px; max-width: 280px; }
.media-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.media-pick { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.media-pick:hover, .media-pick:focus-visible { border-color: var(--violet); }
.media-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.media-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-pick.is-noalt span { color: var(--amber-ink); font-weight: 700; }
.prose figure { margin: 24px 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r); display: block; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- My tests (FR-03.5) ---------- */
.my-stat { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.my-stat__n { display: block; font-family: var(--f-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.my-stat__l { font-size: 13px; font-weight: 700; color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history__item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s var(--ease-out); }
.history__item:hover { border-color: #cfc3f5; color: var(--ink); transform: translateY(-1px); }
.history__main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.history__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: 110px; flex: none; font-variant-numeric: tabular-nums; }
.history__score .progress { width: 100%; }

/* ---------- Two-step sign-in (FR-11.3) ---------- */
.tfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; color: var(--ink-2); }
.tfa-qr { margin: 10px 0 8px; width: 208px; height: 208px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.tfa-qr svg { display: block; width: 100%; height: 100%; }
.tfa-key { font-size: 16px; letter-spacing: .06em; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.tfa-code { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; height: 56px; }
.tfa-codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; background: var(--surface-2); border-radius: 14px; }
.tfa-codes code { font-size: 17px; letter-spacing: .08em; }
@media print { header, .btn, .eyebrow + h1 + p { display: none !important; } .tfa-codes { background: none; border: 1px solid #000; } }

/* ---------- Job quick answers (FAQPage) ---------- */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq details[open] summary { margin-bottom: 6px; }
.faq p { margin: 0; color: var(--ink-2); }

/* ---------- Live SEO checks (FR-07.1) ---------- */
.seo-score { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.seo-score__head { display: flex; align-items: baseline; gap: 8px; }
.seo-score__head b { font-family: var(--f-display); font-size: 28px; font-variant-numeric: tabular-nums; }
.seo-score__head span { font-size: 13px; font-weight: 700; color: var(--muted); }
.seo-score[data-level="good"] .progress > span { background: var(--green); }
.seo-score[data-level="fair"] .progress > span { background: var(--amber); }
.seo-score[data-level="low"] .progress > span { background: var(--red); }
.seo-score ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.seo-score li { padding-left: 20px; position: relative; color: var(--ink-2); }
.seo-score li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.seo-score li.is-ok::before { content: '✓'; color: var(--green); }
.seo-score li.is-todo::before { content: '!'; color: var(--amber-ink); left: 4px; }

/* ---------- Challenge a friend (FR-17.9) ---------- */
.challenge-banner { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: 16px; background: var(--amber-soft); color: var(--amber-ink); font-size: 15px; }
.vs-card { display: grid; grid-template-columns: 1fr minmax(0, 2fr) 1fr; gap: 16px; align-items: center; padding: 24px; border-radius: 24px; text-align: center; }
.vs-card__side { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.vs-card__side b { font-family: var(--f-display); font-size: 34px; font-variant-numeric: tabular-nums; }
.vs-card__side.is-win { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); }
.vs-card__mid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vs-card__vs { font-family: var(--f-display); font-weight: 800; color: var(--violet); letter-spacing: .1em; }
@media (max-width: 640px) { .vs-card { grid-template-columns: 1fr 1fr; } .vs-card__mid { grid-column: 1 / -1; order: -1; } }

/* ---------- Brand kit (FR-17.8) ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.brand-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.brand-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink-2); font-weight: 700; }
.brand-swatch input[type="color"] { width: 100%; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.brand-preview { position: relative; width: 100%; aspect-ratio: 1200 / 630; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.brand-preview iframe { position: absolute; left: 0; top: 0; width: 1200px; height: 630px; border: 0; transform-origin: 0 0; transform: scale(var(--k, .23)); pointer-events: none; }

/* ---------- Share preview in editors (FR-17.11) ---------- */
.share-preview summary { list-style: none; }
.share-preview summary::-webkit-details-marker { display: none; }
.wa-bubble { max-width: 360px; border-radius: 12px; overflow: hidden; background: #dcf8c6; box-shadow: 0 1px 2px rgb(0 0 0 / .15); }
.wa-bubble img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: #eee; }
.wa-bubble__meta { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; background: #cfe9ba; font-size: 13px; color: #111; }
.wa-bubble__meta b { font-size: 14px; }
.wa-bubble__meta span { color: #333; }
.wa-bubble__domain { color: #6b7c62 !important; font-size: 12px; }

/* ---------- Bulk bar for content lists (FR-01.9) ---------- */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.bulk-col { width: 34px; }
.bulk-col input { width: 17px; height: 17px; accent-color: var(--violet); }

/* ---------- Block editor (FR-01.4) ---------- */
.blocks { display: flex; flex-direction: column; gap: 8px; }
.blocks__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.blocks__list { display: flex; flex-direction: column; gap: 6px; }
.blocks__add { display: flex; flex-wrap: wrap; gap: 6px; }
.blocks__add .btn { font-size: 12px; padding: 5px 10px; }
.block { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.block:focus-within { border-color: #cfc3f5; box-shadow: 0 0 0 3px var(--violet-soft); }
.block__tools { display: flex; align-items: center; gap: 4px; opacity: .55; transition: opacity .15s; }
.block:hover .block__tools, .block:focus-within .block__tools { opacity: 1; }
.block__tools select.field { height: 30px; font-size: 12px; padding: 2px 8px; max-width: 150px; }
.block__tools .btn--icon { width: 30px; height: 30px; padding: 0; }
.block__text { min-height: 26px; outline: none; font-size: 16px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.block__text:empty::before { content: attr(aria-label); color: var(--muted); opacity: .6; }
.block--h2 .block__text { font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.block--h3 .block__text { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.block--quote .block__text { border-left: 3px solid var(--violet); padding-left: 12px; font-style: italic; color: var(--ink-2); }
ul.block__text, ol.block__text { padding-left: 22px; margin: 0; }
.block__image img { max-width: 100%; max-height: 240px; height: auto; border-radius: 10px; display: block; }
.block__image figcaption { font-size: 12px; color: var(--muted); }
.block__warn { color: var(--amber-ink); font-weight: 700; }
.block__hr { border: 0; border-top: 2px dashed var(--line-2); margin: 8px 0; }
.block__raw { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* ---------- AI call detail (FR-14.4) ---------- */
.payload { max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }

/* Cookie notice for optional Google Analytics (FR-10.1) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(30, 20, 70, .18); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.consent p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .has-mobile-bar .consent { bottom: 84px; } }

/* ---------- Question explainers (FR-02.14 – 02.17) ---------- */
.xp-goal { margin: -6px 0 0; }
.xp-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 14px; }
.xp-sec { margin-top: 16px; border-radius: 24px; scroll-margin-top: 96px; }
.xp-sec > h2 { margin-bottom: 12px; }
.xp-prose { font-size: 16.5px; margin: 0; }
.xp-sub { font-size: 15px; font-weight: 800; margin: 16px 0 6px; }
.xp-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.xp-list--check { list-style: none; padding-left: 0; }
.xp-list--check li { position: relative; padding-left: 26px; }
.xp-list--check li::before { content: '✓'; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.xp-steps { margin: 10px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.xp-problem { margin: 0; }
.xp-answer { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.xp-mistakes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.xp-mistakes p { margin: 0; }
.xp-mistakes__wrong { color: var(--red-ink); font-weight: 700; }
.xp-mistakes__fix { color: var(--ink-2); padding-left: 18px; }

/* Formula: plain text first; KaTeX replaces it when loaded (space reserved, no layout jump). */
/* Block + text-align (not flex centring): a formula wider than the box scrolls from its start instead of being cut off on the left. */
.xf { margin: 0; min-height: 56px; padding: 14px 18px; border-radius: 16px; background: var(--violet-soft); font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.4; text-align: center; overflow-x: auto; overflow-y: hidden; }
.xf .katex-display { margin: 0; }
@media (max-width: 640px) { .xf { font-size: 17px; padding: 12px 14px; } }
.xf__vars { margin-top: 12px; }

/* Visual templates (escaped text in CSS layouts). */
.xv { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.xv figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.xv b { display: block; font-weight: 800; color: var(--ink); }
.xv span { display: block; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.xv__cards { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; }
.xv__cards > div { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.xv__flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: 26px; counter-reset: xv; }
.xv__flow > li { position: relative; flex: 1 1 140px; padding: 12px 14px 12px 40px; border-radius: 14px; background: var(--violet-soft); counter-increment: xv; }
.xv__flow > li::before { content: counter(xv); position: absolute; left: 10px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.xv__flow > li + li::after { content: '→'; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); color: var(--violet); font-weight: 800; }
.xv__loop { margin: 0; text-align: right; font-weight: 700; color: var(--violet); font-size: 14px; }
.xv__root { padding: 12px 14px; border-radius: 14px; background: var(--violet); text-align: center; }
.xv__root b, .xv__root span { color: #fff; }
.xv__kids { list-style: none; margin: 0; padding: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; border-top: 2px solid var(--violet-ink); }
.xv__kids > li { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.xv__labels { margin: 0; display: grid; grid-template-columns: minmax(110px, 1fr) 3fr; gap: 8px 16px; }
.xv__labels dt { font-weight: 800; }
.xv__labels dd { margin: 0; color: var(--ink-2); }
.xv__table { width: 100%; border-collapse: collapse; font-size: 15px; }
.xv__table th, .xv__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.xv__table th { font-weight: 800; width: 35%; }
.xv--image img { max-width: 100%; height: auto; border-radius: 14px; display: block; margin: 0 auto; }
@media (max-width: 640px) {
  .xv__cards { grid-template-columns: minmax(0, 1fr); }
  .xv__flow { flex-direction: column; gap: 22px; }
  .xv__flow > li + li::after { content: '↓'; left: 50%; top: -19px; transform: translateX(-50%); }
  .xv__labels { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .xv__labels dd { margin-bottom: 8px; }
}

/* Step player: without JS (or with reduced motion) every scene shows as a list. */
.xp-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.xp-scene { padding: 18px 20px; border-radius: 18px; background: linear-gradient(135deg, var(--violet-soft), #fff); border: 1px solid var(--line); text-align: center; }
.xp-scene p { margin: 0; }
.xp-scene__title { font-family: var(--f-display); font-size: 24px; font-weight: 800; color: var(--violet-deep); margin-bottom: 8px !important; }
.xp-scene--highlight .xp-scene__title { display: inline-block; padding: 4px 14px; border-radius: 12px; background: #fde68a; color: var(--ink); }
.xp-scene--number .xp-scene__title { font-size: 40px; }
.xp-scene__caption { color: var(--ink-2); font-size: 16px; }
.xp-scene__vs { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.xp-scene__vs span { padding: 10px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); font-weight: 700; }
.xp-scene__vs b { color: var(--violet); }
.xp-scene__items { display: inline-flex; flex-direction: column; gap: 6px; text-align: left; margin: 0 0 10px; padding-left: 22px; }
.xp-player.is-live .xp-scenes { display: grid; }
.xp-player.is-live .xp-scene { grid-area: 1 / 1; min-height: 190px; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; transform: translateY(12px); visibility: hidden; transition: opacity .45s var(--ease-out), transform .45s var(--ease-out), visibility 0s linear .45s; }
.xp-player.is-live .xp-scene.is-on { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.xp-player.is-live .xp-scene.is-on :is(.xp-scene__items li, .xp-scene__vs > *) { animation: fade-up .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }
.xp-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.xp-controls[hidden] { display: none; }

/* Class → subject → questions lists (FR-02.17). */
.qlist { border-radius: 22px; padding: 0; overflow: hidden; margin-bottom: 16px; scroll-margin-top: 96px; }
.qlist__head { gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.qlist__items { margin: 0; padding: 4px 22px 8px 44px; }
.qlist__items li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.qlist__items li:last-child { border-bottom: 0; }
.qlist__items a { color: var(--ink); font-weight: 600; }
.qlist__items a:hover { color: var(--violet); }
.qlist__meta { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: 8px; }

/* Studio: section state chips. */
.xp-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.xp-chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; line-height: 1; border: 1.5px solid var(--line-2); background: #fff; filter: grayscale(1); opacity: .55; text-decoration: none; vertical-align: middle; }
.xp-legend .xp-chip { width: 14px; height: 14px; border-radius: 4px; }
.xp-chip--approved { background: var(--green-soft); border-color: var(--green); filter: none; opacity: 1; }
.xp-chip--na { background: var(--surface-2); border-color: var(--night-ink); border-style: dashed; filter: none; opacity: .8; }
.xp-chip--in_review { background: var(--violet-soft); border-color: var(--violet); filter: none; opacity: 1; }
.xp-chip--draft { background: var(--amber-soft); border-color: var(--amber); filter: none; opacity: 1; }
.xp-chip--stale { background: var(--amber-soft); border-color: var(--amber); border-style: dashed; filter: none; opacity: 1; }
.xp-chip--rejected { background: var(--red-soft); border-color: var(--red-ink); filter: none; opacity: 1; }
.xp-card { scroll-margin-top: 20px; }
@media (min-width: 1000px) { .xp-aside { position: sticky; top: 16px; } }
.xp-scene-edit { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }

/* Personalities directory (PRD FR-15.13–15.24). */
.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-chips .chip[aria-current="page"] { background: var(--night); border-color: var(--night); color: #fff; }
.pd-chips .chip[aria-current="page"] .muted { color: #c4b5fd; }
.pd-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.pd-filters .pd-q { grid-column: 1 / -1; }
.pd-filters .af__label { font-size: 12px; }
.pd-filters .field { height: 44px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.pd-card { padding: 12px; color: var(--ink); display: flex; flex-direction: column; gap: 10px; border-radius: 22px; min-width: 0; }
.pd-card:hover { color: var(--ink); }
.pd-card__img { overflow: hidden; border-radius: 16px; background: var(--violet-soft); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.pd-card__img img { width: 100%; height: 100%; object-fit: cover; }
.pd-card__initial { font-family: var(--f-display); font-size: 56px; font-weight: 700; color: var(--violet); }
.pd-eyebrow { font-size: 12px; font-weight: 800; color: var(--violet); letter-spacing: .04em; text-transform: uppercase; }
.pd-money { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: baseline; align-self: flex-start; padding: 4px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; font-weight: 800; }
.pd-dl { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 10px 18px; margin: 0; }
.pd-dl dt { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.pd-dl dd { margin: 0; font-weight: 600; }
.pd-trust { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--pill); font-weight: 800; font-size: 13px; }
.pd-trust--5, .pd-trust--4 { background: var(--green-soft); color: var(--green); }
.pd-trust--3 { background: var(--violet-soft); color: var(--violet-deep); }
.pd-trust--2, .pd-trust--1 { background: var(--amber-soft); color: var(--amber-ink); }
.pd-dots { display: inline-flex; gap: 3px; }
.pd-dots i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .25; }
.pd-dots i.on { opacity: 1; }
.pd-timeline { list-style: none; margin: 0 0 0 7px; padding: 0 0 0 22px; border-left: 2px solid var(--line-2); display: grid; gap: 14px; }
.pd-timeline li { position: relative; }
.pd-timeline li::before { content: ""; position: absolute; left: -31px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--violet); border: 4px solid var(--violet-soft); box-sizing: border-box; }
.pd-year { font-family: var(--f-display); font-weight: 700; color: var(--violet); margin-right: 10px; }
.pd-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: pdf; }
.pd-facts li { counter-increment: pdf; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.pd-facts li::before { content: counter(pdf); width: 36px; height: 36px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pd-hero { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.pd-hero__img { width: 250px; height: 310px; border-radius: 28px; object-fit: cover; border: 4px solid var(--night-2); }
@media (max-width: 720px) {
  .pd-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .pd-dl dd { margin-bottom: 10px; }
  .pd-hero { gap: 20px; }
  .pd-hero__img { width: 140px; height: 172px; border-radius: 20px; }
  .pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pd-card__initial { font-size: 40px; }
  .pd-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
