/* Quiz-only colours (mapped onto the meaning accents); everything else comes from tokens.css (copied from the study site). */
:root {
  --ok: var(--cool);
  --ok-soft: var(--cool-tint);
  --no: var(--warm);
  --no-soft: var(--warm-tint);
  --btn-edge: var(--awning);
  --shadow: 0 1px 2px rgba(43, 33, 26, .06), 0 6px 20px rgba(43, 33, 26, .06);
  --shadow-lift: 0 2px 4px rgba(43, 33, 26, .08), 0 10px 28px rgba(43, 33, 26, .10);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --btn-edge: #D0645A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lift: 0 4px 18px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* base: global.css from the study site */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ground);
  color: var(--ink-2);
  font: 400 17px/1.55 var(--font-body);
}
@media (max-width: 640px) { body { font-size: 16px; } }
/* Phones: room for the fixed bottom tab bar, at the end of the page and when a focused control scrolls into view. */
@media (max-width: 760px) {
  html { scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: 64px; line-height: 1.02; }
h2 { font-size: 30px; line-height: 1.15; }
h3 { font-size: 24px; line-height: 1.2; }
@media (max-width: 640px) { h1 { font-size: 40px; } }
button, input { font: inherit; color: inherit; }
a { color: var(--cool); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* On the lemon bands a dark ring reads best (light ring in the dark theme). */
.site-header, .site-footer, .hero { --focus: var(--focus-band); }
#app:focus { outline: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px)); width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.caption { font-size: 14px; color: var(--muted); }
.lead { color: var(--muted); margin: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.err { color: var(--no); margin: 0; font-size: .9rem; font-weight: 600; }
.err:empty { display: none; }
.loading { padding: 4rem 0; text-align: center; color: var(--muted); }

.skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; z-index: 1000; top: max(12px, env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px));
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--hi); color: var(--night); font: 700 16px/1.2 var(--font-body); text-decoration: none;
  box-shadow: 0 6px 20px rgb(0 0 0 / .35); outline: 3px solid var(--on-night); outline-offset: 2px;
}

/* header: Header.astro from the study site. Solid green shop sign; the awning hangs below it. */
.site-header { background: var(--band-deep); position: relative; }
.site-header::after {
  content: ''; display: block; height: 20px; background: url('/kedai/awning.svg') 0 0 / 40px 20px repeat-x;
}
/* A page with a hero band continues the green under the awning instead of showing the ground. */
body:has(main > .hero:first-child) .site-header::after { background-color: var(--band-hero); }
.site-header .bar { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; padding-block: 10px 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--on-band-strong); }
.logo { flex: none; }
.wordmark { font: 700 24px/1 var(--font-display); letter-spacing: .2px; }
.top-nav { display: flex; gap: 6px 22px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.top-nav a {
  display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 0;
  color: var(--on-band); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent;
}
.top-nav a:hover { color: var(--on-band-strong); border-bottom-color: var(--band-line); }
.top-nav a[aria-current] { border-bottom-color: var(--on-band-strong); color: var(--on-band-strong); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.theme {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 6px 14px;
  border: 1.5px solid var(--band-line); border-radius: var(--r-pill); background: transparent;
  color: var(--on-band-strong); font: 600 14px/1 var(--font-body); cursor: pointer; justify-content: center;
}
.theme:hover { background: var(--band-hover); }
.theme-icon { font-size: 16px; }
.to-light { display: none; }
:root[data-theme='dark'] .to-light { display: inline; }
:root[data-theme='dark'] .to-dark { display: none; }
@media (max-width: 900px) {
  .site-header .bar { gap: 16px; }
  .top-nav { column-gap: 16px; }
  .theme-label { display: none; }
}
/* Phone tab bar. display:none (not just off-screen) so only one nav is in the accessibility tree. */
.tab-bar { display: none; }
@media (max-width: 760px) {
  .top-nav { display: none; }
  .tab-bar {
    display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    background: var(--paper); border-top: 1px solid var(--line-2);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
    --focus: var(--hi-text);
  }
  .tab-bar a {
    flex: 1 1 0; min-width: 0; min-height: var(--tabbar-h); position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px;
    color: var(--muted); font: 600 12px/1.1 var(--font-body); text-decoration: none; text-align: center;
  }
  .tab-bar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar a:focus-visible { outline-offset: -4px; border-radius: 10px; }
  .tab-bar a[aria-current] { color: var(--cool); font-weight: 700; }
  .tab-bar a[aria-current]::before {
    content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--hi);
  }
  .tab-bar a[aria-current] svg { stroke-width: 2.3; }
}
@media (max-width: 420px) { .theme { padding: 6px 12px; } }
@media (max-width: 380px) {
  .site-header .bar { column-gap: 10px; }
  .tools { gap: 6px; }
  .brand { gap: 8px; }
  .wordmark { font-size: 19px; }
}
@media (forced-colors: active) {
  .top-nav a:not([aria-current]) { border-bottom-color: Canvas; }
  .top-nav a[aria-current] { border-bottom-color: Highlight; }
  .tab-bar a[aria-current]::before { background: Highlight; }
}

/* main is a grid so a hero can run full width while everything else keeps the 848px column */
main {
  flex: 1; isolation: isolate;
  display: grid; align-content: start;
  grid-template-columns: [full-start] minmax(var(--gutter), 1fr) [content-start] min(848px, 100% - 2 * var(--gutter)) [content-end] minmax(var(--gutter), 1fr) [full-end];
  padding: 1.5rem 0 2.5rem;
}
main > * { grid-column: content; min-width: 0; }
main:has(> .hero:first-child) { padding-top: 0; }
/* a hero that ends the screen grows to meet the footer, so no strip of plain page shows between the bands */
main:has(> .hero:last-child) { align-content: stretch; padding-bottom: 0; }
main:has(> .hero:last-child) > .hero:last-child { margin-bottom: 0; }
main:has(> .hero:last-child) + .site-footer { margin-top: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; margin-bottom: 1rem; }

/* small text: global.css */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warm); margin: 0 0 10px; }

/* hero: full-width lemon band with the faint shop pattern (global.css .hero), edged with the awning */
.hero {
  grid-column: full;
  display: grid; grid-template-columns: subgrid; align-content: center;
  position: relative;
  color: var(--on-band-strong);
  background: var(--band-hero) url('/kedai/corak.svg') 0 0 / 120px 120px;
  padding: 28px 0 36px;
  margin: 0 0 calc(36px + 20px);
}
.hero > * { grid-column: content; }
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -20px;
  height: 20px; background: url('/kedai/awning.svg') 0 0 / 40px 20px repeat-x;
}
.hero h1 { color: var(--on-band-strong); max-width: 16ch; }
.hero .lead { color: var(--on-band); max-width: 40ch; font-size: 20px; }
.hero .eyebrow { color: var(--hi-on-band); }
.hero-stats { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.3rem 0 0; padding: 0; }
.hero-stats li { background: var(--band-pill); border: 1px solid var(--band-line); border-radius: var(--r-pill); padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--on-band); }
.hero-stats b { color: var(--on-band-strong); font-weight: 700; }
@media (max-width: 640px) {
  .hero { padding: 20px 0 28px; }
  .hero .lead { font-size: 18px; }
}

/* buttons: global.css .btn-solid (.btn), .btn-outline (.btn.ghost), .btn-text (.linkbtn) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 14px 22px; border-radius: var(--r-btn);
  font: 600 16px/1 var(--font-body); text-decoration: none; cursor: pointer;
  background: var(--awning); border: 2px solid var(--btn-edge); color: var(--on-night);
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.study-links { margin-top: .7rem; }
.btn:hover { background: var(--warm-fill); box-shadow: 0 4px 14px rgba(122, 34, 40, .22); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--sand); box-shadow: none; }
.hero .btn.ghost { color: var(--on-band-strong); border-color: var(--on-band-strong); }
.hero .btn.ghost:hover { background: var(--band-hover); }
.btn.danger { color: var(--no); border-color: var(--no); }
.linkbtn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin: 0 -8px;
  background: none; border: 0; color: var(--cool); cursor: pointer; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn[hidden] { display: none; }

/* setup */
.step-h { display: flex; align-items: center; gap: .6rem; font-size: 24px; margin-bottom: 1rem; }
.step { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--hi-tint); color: var(--warm); font-family: var(--font-display); font-size: 1rem; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hi) 45%, transparent); }
.resume { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-color: color-mix(in srgb, var(--hi) 55%, var(--line)); background: var(--hi-tint); border-left: 5px solid var(--hi); }
/* Tingkatan tabs: global.css .seg (segmented control) */
.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px; margin: 0 0 .8rem;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 26px;
}
.tab {
  flex: 1 1 auto; min-width: 44px; min-height: 44px; padding: 8px 18px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2); font: 600 15px/1.2 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.tab:hover { background: var(--sand); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--awning); color: var(--on-night); }
.tab:focus-visible { position: relative; z-index: 1; }
:root[data-theme='dark'] .tab[aria-selected="true"] { box-shadow: inset 0 0 0 2px #C0575D; }
@media (forced-colors: active) {
  .tab[aria-selected="true"] { outline: 2px solid ButtonText; outline-offset: -4px; }
}

.chapter { border-top: 1px solid var(--line); }
.chapter:first-child { border-top: 0; }
.ch-head { display: flex; align-items: center; gap: .75rem; padding: .25rem 0; }
.ch-all-hit { flex: none; display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; margin: 0 -.5rem 0 -.25rem; cursor: pointer; }
.toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .8rem;
  min-height: 44px; background: none; border: 0; padding: .55rem .5rem; margin-right: -.5rem; text-align: left; cursor: pointer;
  border-radius: 10px; transition: background-color .15s;
}
.toggle:hover { background: var(--sand); }
.ch-num {
  flex: none; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 9px;
  background: var(--warm-tint); color: var(--warm); font-family: var(--font-display); font-size: 1.05rem;
  transition: background-color .15s, color .15s;
}
.chapter.picked .ch-num { background: var(--awning); color: var(--on-night); }
.ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-title { font-weight: 600; line-height: 1.3; }
.ch-meta { color: var(--muted); font-size: .82rem; }
.ch-picked { color: var(--warm); font-weight: 600; }
.chev { flex: none; width: .6rem; height: .6rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; margin: 0 .5rem; }
.toggle.open .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.chapter .subs { padding: .1rem 0 .75rem 3.1rem; }
.chapter .subs:not([hidden]) { animation: drop .18s ease-out; }
.sub { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; align-items: baseline; align-content: center; min-height: 44px; padding: .4rem .55rem; margin: 0 -.55rem; cursor: pointer; border-radius: 8px; }
.sub:hover { background: var(--sand); }
.sub:has(input:checked) { background: var(--warm-tint); }
.sub input { transform: translateY(2px); }
.sub-num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .15rem; }
.sub-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
/* a subtopic whose bank isn't written yet: listed, not pickable */
.sub.soon { cursor: default; color: var(--muted); }
.sub.soon:hover { background: none; }
.sub.soon .sub-meta { font-style: italic; }
@media (max-width: 560px) { .sub-meta { grid-column: 2; } .chapter .subs { padding-left: .6rem; } }
input[type=checkbox], input[type=radio] { accent-color: var(--warm); width: 1.1rem; height: 1.1rem; flex: none; cursor: pointer; }
.acc { font-weight: 600; margin-left: .2rem; padding: 0 .4rem; border-radius: 6px; font-size: .82rem; }
.acc.good { color: var(--ok); background: var(--ok-soft); }
.acc.mid { color: var(--hi-text); background: var(--hi-tint); }
.acc.low { color: var(--no); background: var(--no-soft); }

.options .opt { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; align-items: center; padding: .6rem 0; }
.options .opt + .opt { border-top: 1px dashed var(--line); }
.options .opt[hidden] { display: none; }
.opt-label { font-weight: 600; }
.opt .check { grid-column: 1 / -1; min-height: 44px; display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .95rem; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; background: var(--paper); transition: background-color .12s, border-color .12s, color .12s; }
.seg label:hover span { border-color: var(--warm); }
.seg input:checked + span { background: var(--awning); border-color: var(--awning); color: var(--on-night); font-weight: 600; }
/* dark: a darker fill alone doesn't show what is picked, so selected toggles get a brass edge */
:root[data-theme='dark'] .seg input:checked + span, :root[data-theme='dark'] .chapter.picked .ch-num { border-color: var(--hi); box-shadow: inset 0 0 0 1px var(--hi); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg.count input[type=number] { position: static; opacity: 1; width: 5.5rem; min-height: 44px; padding: .4rem .7rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); }
#ptitle { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); }

/* sticky action bar */
.actionbar {
  position: sticky; bottom: 12px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line-2); border-radius: calc(var(--r-card) + 2px);
  padding: .7rem .7rem .7rem 1.1rem; margin-top: 1.25rem;
  box-shadow: var(--shadow-lift);
}
.actionbar-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; min-width: 0; }
.actionbar-info .err { flex-basis: 100%; }
/* phones: the sticky bar sits above the fixed tab bar */
@media (max-width: 760px) { .actionbar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); } }
@media (max-width: 560px) {
  .options .opt { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .actionbar { padding: .6rem .6rem .6rem .9rem; }
  .actionbar .btn { padding-inline: 18px; }
  .actionbar-info { font-size: .9rem; }
  .actionbar-info .bankcount { display: none; }
}

/* quiz */
.quiz-head { margin-bottom: 1rem; }
/* progress bar on an awning-stripe track (global.css .thread) */
.thread {
  position: relative; height: 14px; border-radius: 4px; overflow: hidden; margin-bottom: .7rem;
  background: repeating-linear-gradient(90deg, var(--awning) 0 10px, var(--band-deep) 10px 20px);
}
.thread > span {
  position: absolute; top: 5px; bottom: 5px; left: 0; max-width: 100%;
  background: linear-gradient(90deg, var(--hi-on-band), var(--hi)); box-shadow: 0 0 6px var(--hi-on-band);
  transition: width .3s ease-out;
}
@media (forced-colors: active) {
  .thread { border: 1px solid CanvasText; }
  .thread > span { top: 0; bottom: 0; background: Highlight; forced-color-adjust: none; }
}
.quiz-meta { gap: .5rem; }
.qcount { color: var(--muted); }
.qcount b { color: var(--ink); font-size: 1.1rem; }
.pill { display: inline-flex; align-items: center; padding: .15rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; border: 1px solid var(--line); background: var(--paper); }
.scorepill { color: var(--warm); background: var(--warm-tint); border-color: transparent; }
.tier { font-weight: 600; }
.tier-R { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tier-S { color: var(--hi-text); background: var(--hi-tint); border-color: transparent; }
.tier-T { color: var(--no); background: var(--no-soft); border-color: transparent; }
.qcard { padding: 1.6rem 1.6rem 1.4rem; border-top: 4px solid var(--awning); }
.quiz.fresh .qcard { animation: rise .25s ease-out; }
.qnum { margin: 0 0 .35rem; color: var(--warm); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.stem { font-size: 1.18rem; margin: 0 0 1rem; font-weight: 500; line-height: 1.5; }
.roman { list-style: none; padding: .6rem .9rem; margin: 0 0 1.1rem; background: var(--sand); border: 1px solid var(--line); border-radius: 10px; }
.roman li { display: flex; gap: .7rem; padding: .2rem 0; }
.rn { flex: none; width: 2.2rem; font-weight: 600; color: var(--cool); font-family: var(--font-display); }
.choices { display: grid; gap: .6rem; }
.choice {
  position: relative; display: flex; gap: .85rem; align-items: center; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px;
  padding: .8rem 2.6rem .8rem .9rem; cursor: pointer;
  transition: border-color .12s, background-color .12s, transform .12s, box-shadow .12s;
}
.choice:hover:not(:disabled) { border-color: var(--warm); background: var(--warm-tint); transform: translateY(-1px); box-shadow: var(--shadow); }
.choice:hover:not(:disabled) .key { background: var(--awning); border-color: var(--awning); color: var(--on-night); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.right):not(.wrong) { opacity: .65; }
.key { flex: none; display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1.5px solid var(--line-2); font-weight: 700; font-size: .85rem; transition: background-color .12s, color .12s, border-color .12s; }
.choice.right, .opts-static .right { border-color: var(--ok); background: var(--ok-soft); }
.choice.right .key, .opts-static .right .key { background: var(--ok); color: #fff; border-color: var(--ok); }
.choice.wrong, .opts-static .wrong { border-color: var(--no); background: var(--no-soft); }
.choice.wrong .key, .opts-static .wrong .key { background: var(--no); color: #fff; border-color: var(--no); }
:root[data-theme='dark'] .choice.right .key, :root[data-theme='dark'] .opts-static .right .key, :root[data-theme='dark'] .choice.wrong .key, :root[data-theme='dark'] .opts-static .wrong .key { color: #161412; }
.choice.right::after, .choice.wrong::after { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 1.1rem; }
.choice.right::after { content: "✓"; color: var(--ok); }
.choice.wrong::after { content: "✗"; color: var(--no); }
.choice.right { animation: pop .3s ease-out; }
.choice.wrong { animation: shake .3s ease-out; }
.feedback { margin-top: 1.1rem; padding: .9rem 1.1rem; border-radius: 12px; border-left: 5px solid; animation: rise .25s ease-out; }
.feedback p { margin: .2rem 0; }
.feedback.ok { border-color: var(--ok); background: var(--ok-soft); }
.feedback.no { border-color: var(--no); background: var(--no-soft); }
.verdict { font-weight: 700; font-size: 1.05rem; }
.feedback.ok .verdict { color: var(--ok); }
.feedback.no .verdict { color: var(--no); }
.ref { color: var(--muted); font-size: .875rem; }
.hint { text-align: center; margin-top: 1.2rem; }
@media (hover: none) { .hint { display: none; } }
@media (max-width: 560px) { .qcard { padding: 1.2rem 1rem 1.1rem; } .stem { font-size: 1.08rem; } }

/* results */
.result { text-align: center; padding: 2.2rem 1.2rem 2rem; position: relative; overflow: hidden; }
.result::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px; background: url('/kedai/awning.svg') 0 0 / 40px 20px repeat-x; }
.ring {
  --c: var(--awning);
  width: 168px; height: 168px; margin: 1rem auto 1.1rem; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
  animation: rise .4s ease-out;
}
.ring.good { --c: var(--ok); }
.ring.mid { --c: var(--hi); }
.ring.low { --c: var(--no); }
.ring > div { width: 134px; height: 134px; border-radius: 50%; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-score { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--ink); }
.ring-score small { font-size: 1.1rem; color: var(--muted); }
.ring-pct { color: var(--muted); font-weight: 600; margin-top: .3rem; }
.result .lead { font-size: 1.05rem; }
.result .row { margin-top: 1.3rem; }
.review { margin-top: 1.75rem; }
.review .qcard { border-top-color: var(--no); }
.opts-static { list-style: none; padding: 0; margin: 0 0 .9rem; display: grid; gap: .4rem; }
.opts-static li { display: flex; gap: .65rem; align-items: center; padding: .45rem .65rem; border: 1.5px solid transparent; border-radius: 10px; }

/* progress */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat { text-align: center; display: flex; flex-direction: column; border-top: 4px solid var(--awning); }
.stat.good { border-top-color: var(--ok); }
.stat.mid { border-top-color: var(--hi); }
.stat.low { border-top-color: var(--no); }
.stat .big { font-size: 2.1rem; font-family: var(--font-display); line-height: 1.2; }
.ptable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ptable th, .ptable td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable thead th { color: var(--warm); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ptable .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable .chrow th { background: var(--sand); font-weight: 600; color: var(--warm); }
.meter { display: inline-block; width: 100px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; vertical-align: middle; margin-right: .45rem; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.meter .good { background: var(--ok); }
.meter .mid { background: var(--hi); }
.meter .low { background: var(--no); }
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li { display: flex; gap: .3rem 1rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.sessions li:last-child { border-bottom: 0; }
@media (max-width: 560px) {
  .stats { gap: .5rem; }
  .stat { padding: 1rem .5rem; }
  .stat .big { font-size: 1.6rem; }
  .meter { width: 50px; }
}

/* print paper (screen preview) */
.print-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 5px solid var(--hi); }
.paper { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 4px; padding: 2rem 2.2rem; margin-bottom: 1.5rem; font-family: Georgia, "Times New Roman", serif; box-shadow: var(--shadow-lift); }
.paper h1 { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
.paper-head { border-bottom: 2px solid #111; margin-bottom: 1.2rem; padding-bottom: .8rem; }
.paper-head h1 { margin: 0 0 .3rem; font-size: 1.5rem; }
.paper-head p { margin: .15rem 0; }
.fields { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: .8rem; }
.fields span { display: flex; align-items: baseline; gap: .3rem; white-space: nowrap; }
.fields .f-nama { flex: 1 1 12rem; }
.fields i { display: inline-block; border-bottom: 1px solid #111; height: 1em; }
.fields .f-nama i { flex: 1; min-width: 8rem; }
.fields i.kelas { width: 5rem; }
.fields i.tarikh { width: 6.5rem; }
.fields i.short { width: 2.5rem; }
.pq { list-style: none; padding: 0; margin: 0; }
.pitem { padding: .5rem 0 .7rem; break-inside: avoid; page-break-inside: avoid; }
.pitem .stem { font-size: 1rem; font-weight: 400; margin: 0 0 .35rem; display: flex; gap: .6rem; }
.pn { flex: none; min-width: 1.6rem; font-weight: 700; }
.pitem .roman { margin: 0 0 .35rem 2.2rem; padding: 0; background: none; border: 0; border-radius: 0; }
.pitem .rn { color: inherit; font-family: inherit; }
.popts { list-style: none; padding: 0; margin: 0 0 0 2.2rem; display: grid; gap: .15rem; }
.popts li { display: flex; gap: .5rem; }
.popts .key, .keygrid .key { border: 0; width: auto; height: auto; font-weight: 700; display: inline; }
.keygrid { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .3rem .8rem; }
.keygrid span { display: inline-block; min-width: 1.8rem; text-align: right; }
.keyexp { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.keyexp li { padding: .3rem 0; border-top: 1px solid #ddd; break-inside: avoid; }
.keyexp .ref { color: #555; font-size: .85rem; }
@media (max-width: 560px) { .paper { padding: 1.2rem 1rem; } }

/* footer: Footer.astro from the study site */
.site-footer {
  background: url('/kedai/awning.svg') 0 0 / 40px 20px repeat-x, var(--band-deep) url('/kedai/corak.svg') 0 0 / 120px 120px;
  margin-top: 64px; padding: 44px 0 40px; font-size: 15px; color: var(--on-band);
}
.site-footer a { color: var(--on-band-strong); }
.site-footer .caption { color: var(--on-band); }
.site-footer p { margin: 0 0 6px; }
.foot-brand { font: 700 22px/1.2 var(--font-display); color: var(--hi-on-band); }
.foot-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 20px; margin-bottom: 16px; }
.foot-nav ul { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; grid-column: 1; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-band-strong); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-main a { font-weight: 600; }
.foot-ref { font-size: 14px; }
.foot-ref a { color: var(--on-band); font-weight: 500; }
.foot-nav .top { grid-column: 2; grid-row: 1; align-self: start; color: var(--hi-on-band); font-weight: 500; }
@media (max-width: 480px) {
  .foot-nav { grid-template-columns: minmax(0, 1fr); }
  .foot-nav ul { column-gap: 16px; }
  .foot-nav .top { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* high contrast: no pattern behind text */
@media (prefers-contrast: more) {
  .hero, .site-header, .site-footer { background-image: none !important; }
}

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; display: block; min-height: 0; }
  .no-print, .print-bar, .skip-link, .site-header, .tab-bar, .site-footer { display: none !important; }
  body { padding-bottom: 0 !important; }
  main { display: block; padding: 0; }
  .hero { background: none !important; color: #000 !important; padding: 0 0 1rem; }
  .hero h1, .hero .lead, .hero .eyebrow, .hero-stats li, .hero-stats b { color: #000 !important; }
  .hero-stats li { background: none; border-color: #999; }
  .hero::after, .result::before { display: none; }
  .paper { border: 0; padding: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .paper.answers { break-before: page; page-break-before: always; }
}
