/* Fonts are served from this site (no third party sees the visitor). Subsets: latin, latin-ext, vietnamese. */
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-vietnamese-wght-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Fraunces; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fraunces; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Fraunces; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-vietnamese-wght-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Fraunces; font-style: italic; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fraunces; font-style: italic; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Fraunces; font-style: italic; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-vietnamese-wght-italic.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  --paper: #f6f1e7; --paper-2: #ece4d2; --surface: #fffdf8; --ink: #14231b; --muted: #5a665d; --line: #ded5c1;
  --forest: #13382a; --forest-ink: #f6f1e7; --lime: #c9f26a; --lime-ink: #16300f;
  --btn: #15402e; --btn-ink: #fffdf8; --leaf: #3f9a5a; --glow: rgba(201, 242, 106, .55);
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 14px 34px -12px rgba(20, 40, 30, .22);
  --radius: 22px; --serif: Fraunces, 'Iowan Old Style', Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1912; --paper-2: #14251b; --surface: #15241b; --ink: #ecf3e8; --muted: #a3b5a8; --line: #26382d;
    --forest: #10281d; --forest-ink: #ecf3e8; --lime: #c9f26a; --lime-ink: #16300f;
    --btn: #23704a; --btn-ink: #ffffff; --leaf: #b6e36a; --glow: rgba(201, 242, 106, .25);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -12px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper); color: var(--ink); min-height: 100dvh;
  display: flex; flex-direction: column; -webkit-text-size-adjust: 100%; position: relative; overflow-x: hidden;
}
.aura { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 40vmax at 100% -10%, color-mix(in srgb, var(--lime) 30%, transparent), transparent 60%),
              radial-gradient(50vmax 40vmax at -10% 110%, color-mix(in srgb, var(--leaf) 22%, transparent), transparent 60%); }

.top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1080px; margin: 0 auto; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 9px; font: 600 1.08rem var(--serif); color: var(--ink); letter-spacing: -.01em; }
.brand .logo { color: var(--leaf); }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--line); }
.seg button { font: inherit; font-size: .8rem; font-weight: 700; min-height: 40px; min-width: 48px; padding: 0 14px; border-radius: 99px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 4px 16px 36px; }
.screen[hidden] { display: none !important; }   /* beats the id rule on #s-trial */
.screen:not(#s-trial) { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
#s-trial { animation: fade .3s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.narrow { max-width: 600px; margin: 0 auto; }
.center { text-align: center; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(2rem, 6.4vw, 3.3rem); line-height: 1.06; margin-bottom: 14px; }
h2 { font-size: clamp(1.4rem, 4.2vw, 1.9rem); line-height: 1.18; margin-bottom: 8px; }
h3 { font-size: 1.05rem; }
h1:focus, h2:focus { outline: none; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 1.04rem; }
h2.lead { font: 400 1rem/1.5 Inter, system-ui, sans-serif; letter-spacing: 0; }
.eyebrow { margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--leaf); }
.fine { color: var(--muted); font-size: .8rem; margin: 14px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; position: relative; overflow: hidden; }

/* ---- buttons ---- */
.btn { appearance: none; font: inherit; font-weight: 650; min-height: 52px; padding: 10px 22px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .seg button:focus-visible, .link:focus-visible, .opt:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: default; }
.cta { background: var(--btn); color: var(--btn-ink); border-color: transparent; min-height: 56px; padding: 12px 30px; font-size: 1.05rem; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--btn) 80%, transparent); }
.cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.cta:hover svg { transform: translateX(4px); }
.ghost { background: transparent; color: var(--ink); }
.link { font: inherit; background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 44px; margin-top: 10px; cursor: pointer; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.row .btn { flex: 1 1 170px; }

/* ---- welcome ---- */
.hero { position: relative; display: grid; gap: 0; overflow: hidden; border-radius: 28px; color: var(--forest-ink);
  background: radial-gradient(70% 90% at 90% 0%, color-mix(in srgb, var(--lime) 22%, transparent), transparent 60%), var(--forest);
  box-shadow: var(--shadow); }
.hero-copy { padding: 26px 22px 28px; position: relative; z-index: 1; }
.hero .eyebrow { color: var(--lime); }
.hero .lead { color: color-mix(in srgb, var(--forest-ink) 78%, transparent); }
.hero .fine { color: color-mix(in srgb, var(--forest-ink) 62%, transparent); }
.hero .cta { background: var(--lime); color: var(--lime-ink); box-shadow: 0 12px 30px -10px var(--glow); width: 100%; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.badges li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 99px; font-size: .84rem; font-weight: 600; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); }
.badges svg { width: 17px; height: 17px; fill: none; stroke: var(--lime); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mosaic { order: -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: 190px; padding: 0 14px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); }
.mosaic .col { display: flex; flex-direction: column; gap: 10px; animation: drift 46s linear infinite; }
.mosaic .col.up { animation-direction: reverse; animation-duration: 54s; }
.mosaic img { display: block; width: 100%; aspect-ratio: 260 / 340; object-fit: cover; border-radius: 14px; background: var(--paper-2); }
@keyframes drift { to { transform: translateY(-50%); } }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding: 0; margin: 18px 0 0; list-style: none; counter-reset: s; }
.steps li { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.steps li:nth-child(2) { animation-delay: .08s; } .steps li:nth-child(3) { animation-delay: .16s; }
.steps .ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--lime) 40%, var(--surface)); color: var(--lime-ink); }
.steps .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .steps .ico { background: color-mix(in srgb, var(--lime) 22%, var(--surface)); color: var(--lime); } }
.steps b { position: absolute; top: 8px; right: 14px; font: 700 1.6rem var(--serif); color: color-mix(in srgb, var(--ink) 12%, transparent); }
@media (min-width: 860px) {
  /* Fixed height: the looping photo columns are far taller than the card and must not stretch the row. */
  .hero { grid-template-columns: 1.05fr .95fr; grid-template-rows: minmax(0, 1fr); height: clamp(560px, 76vh, 640px); }
  .hero-copy { padding: 36px 20px 36px 48px; align-self: center; }
  .hero .cta { width: auto; }
  .mosaic { order: 0; height: 100%; min-height: 0; padding: 18px 22px 18px 0; gap: 12px; }
  .mosaic .col { gap: 12px; }
  .mosaic .col:nth-child(2) { margin-top: -60px; }
}

/* ---- background question ---- */
.opts { display: grid; gap: 10px; margin: 18px 0 4px; }
.opt { appearance: none; font: inherit; font-weight: 600; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px; text-align: left; border-radius: 18px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .2s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.opt:hover { border-color: var(--leaf); background: color-mix(in srgb, var(--lime) 14%, var(--paper)); box-shadow: 0 8px 20px -12px var(--leaf); }
.opt:active { transform: scale(.98); }
.opt .em { font-size: 1.7rem; line-height: 1; }
@media (min-width: 520px) { .opts { grid-template-columns: 1fr 1fr; } }

/* ---- trial ---- */
#s-trial { display: flex; flex-direction: column; gap: 10px; max-width: 780px; margin: 0 auto; padding-bottom: 104px; }
.trial-head { display: flex; align-items: center; gap: 12px; }
.pips { flex: 1; display: flex; gap: 4px; align-items: center; }
.pips span { flex: 1; max-width: 22px; height: 11px; border-radius: 0 100% 0 100%; background: var(--line); transition: background .25s, transform .25s; }
.pips span.on { background: var(--leaf); }
.pips span.now { background: var(--lime); box-shadow: 0 0 0 2px var(--leaf); transform: scale(1.18); }
.count { font-size: .85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ref-wrap { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: center; padding: 8px 10px 8px 8px; margin-inline: -4px; background: var(--paper); border-radius: 20px; box-shadow: 0 10px 14px -14px rgba(0, 0, 0, .35); }
.ref { height: 148px; }
.ref-info { min-width: 0; }
.kicker { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--leaf); }
.species { margin: 2px 0 4px; font: italic 600 1.18rem/1.2 var(--serif); overflow-wrap: anywhere; }
.hint { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.q { margin: 6px 0 0; text-align: center; font-size: clamp(1.15rem, 3.6vw, 1.45rem); }
.panel { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.panel img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; background: color-mix(in srgb, var(--ink) 6%, transparent); transition: opacity .2s; }
.tag { position: absolute; left: 8px; top: 8px; background: rgba(10, 25, 17, .72); backdrop-filter: blur(4px); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: 2px 9px; border-radius: 99px; }
.ref .tag { display: none; }
.cands { --cands-vh: 72vh; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-inline: auto; max-width: calc(var(--cands-vh) + 12px); }
.cand { aspect-ratio: 1 / 1; width: 100%; }
/* Same square box and same crop for both candidates, so neither can be told apart by its shape. */
.cand img, dialog img.sq { object-fit: cover; }
.letter { position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font: 700 1.2rem var(--serif); background: var(--lime); color: var(--lime-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.panel.pick { animation: pick .55s ease-out; }
@keyframes pick { 0% { box-shadow: 0 0 0 0 var(--lime); } 30% { box-shadow: 0 0 0 7px var(--lime); } 100% { box-shadow: 0 0 0 0 transparent; } }
#s-trial.enter .cand, #s-trial.enter .ref { animation: pop .28s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pop { from { opacity: .0; transform: scale(.96); } to { opacity: 1; transform: none; } }
body.loading #s-trial .panel img { opacity: 0; }
body.loading #s-trial .panel { background: linear-gradient(90deg, var(--line), transparent, var(--line)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
body.loading #s-trial .btn { pointer-events: none; opacity: .5; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.actions { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr .8fr 1fr; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.choice { flex-direction: column; gap: 2px; min-height: 62px; padding: 8px 6px; border-radius: 20px; background: var(--btn); color: var(--btn-ink); border-color: transparent; font-size: .84rem; line-height: 1.2; text-align: center; }
.choice b { font: 700 1.35rem/1 var(--serif); color: var(--lime); }
.choice.same { background: var(--surface); color: var(--ink); border-color: var(--line); }
.choice.same b { color: var(--leaf); }
.tip { margin: 2px 0 0; }
kbd { font: inherit; font-size: .75rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; }
.kbds { display: none; }
@media (min-width: 900px) {
  /* Laptop: real photo on the left, A/B and the answer buttons on the right, so a whole trial fits one screen. */
  main { padding-top: 6px; }
  #s-trial { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-rows: auto auto auto auto 1fr auto; column-gap: 28px; row-gap: 12px; align-items: start; padding-bottom: 0; }
  .trial-head { grid-column: 1 / -1; }
  .ref-wrap { position: static; grid-column: 1; grid-row: 2 / 6; grid-template-columns: 1fr; align-self: start; padding: 0; margin: 0; background: transparent; box-shadow: none; align-content: start; gap: 12px; }
  .ref { height: auto; aspect-ratio: 3 / 4; width: min(100%, 42vh); justify-self: center; }
  .ref img { position: absolute; inset: 0; object-fit: cover; }
  .ref .tag { display: block; }
  .ref-info { text-align: center; }
  .species { font-size: 1.35rem; }
  .q { grid-column: 2; grid-row: 2; margin: 0; text-align: left; }
  .cands { --cands-vh: 86vh; grid-column: 2; grid-row: 3; margin: 0; }
  .actions { position: static; grid-column: 2; grid-row: 4; width: 100%; max-width: calc(86vh + 12px); padding: 0; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .choice { flex-direction: row; min-height: 52px; gap: 8px; font-size: .9rem; }
  .choice.same { grid-column: 1 / -1; grid-row: 2; min-height: 44px; }
  .tip { grid-column: 1 / -1; grid-row: 6; }
  .kbds { display: inline; }
}

/* ---- between / done ---- */
.celebrate { text-align: center; padding-top: 34px; }
.big { display: flex; flex-direction: column; align-items: center; margin-bottom: 8px; }
.big b { font: 700 clamp(3.4rem, 14vw, 5.2rem)/1 var(--serif); color: var(--leaf); letter-spacing: -.03em; }
.big span { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.leafmark { color: var(--leaf); animation: sway 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 50% { transform: rotate(7deg); } }
.why { margin-top: 24px; padding: 16px 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); text-align: left; }
.why p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.burst { position: absolute; left: 50%; top: 70px; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 0 100% 0 100%; background: var(--leaf); opacity: 0; animation: fly 1.3s cubic-bezier(.1, .7, .3, 1) forwards; animation-delay: var(--d, 0s); }
.burst i:nth-child(3n) { background: var(--lime); }
.burst i:nth-child(4n) { background: color-mix(in srgb, var(--leaf) 55%, var(--forest)); }
@keyframes fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.5); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1.1); } }

.spinner { width: 30px; height: 30px; margin: 80px auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--leaf); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94dvh; }
dialog::backdrop { background: rgba(5, 12, 8, .82); backdrop-filter: blur(4px); }
dialog img { display: block; max-width: 96vw; max-height: 82dvh; margin: 0 auto 12px; border-radius: 16px; }
dialog img.sq { width: min(96vw, 82dvh); height: min(96vw, 82dvh); max-width: none; max-height: none; }
dialog .btn { display: flex; margin: 0 auto; background: var(--surface); }
.link.inline { min-height: 0; margin: 0; padding: 8px 2px; }
#note { width: min(92vw, 460px); }
.note-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.note-card h3 { margin: 0 0 6px; font: 600 1.2rem var(--serif); }
.note-card .fine { margin: 6px 0; }
.note-card .err { color: #b3261e; font-weight: 600; }
@media (prefers-color-scheme: dark) { .note-card .err { color: #ff9b8f; } }
.note-card textarea { display: block; width: 100%; font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; resize: vertical; }
.note-card textarea:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }
.note-card .row .btn { background: var(--btn); color: var(--btn-ink); }
.note-card .row .ghost { background: transparent; color: var(--ink); }
#toast { position: fixed; width: max-content; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px); background: var(--forest); color: var(--forest-ink); font-weight: 600; padding: 11px 18px; border-radius: 99px; font-size: .92rem; max-width: calc(100vw - 32px); z-index: 10; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateX(-50%); }
body[data-screen="trial"] #toast { bottom: calc(94px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body[data-screen="trial"] #toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .mosaic .col { transform: none; }
}

/* Consent screen: same card + tile language as the rest of the site, centred */
.consent { padding: 36px 24px 26px; }
.consent .lead { max-width: 46ch; margin-inline: auto; }
.shield { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--lime) 40%, var(--surface)); color: var(--forest); }
.shield svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .shield { background: color-mix(in srgb, var(--lime) 22%, var(--surface)); color: var(--lime); } }
.check { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 20px; padding: 16px 18px; text-align: left; border-radius: 18px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; line-height: 1.4; transition: border-color .2s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.check:hover { border-color: var(--leaf); background: color-mix(in srgb, var(--lime) 14%, var(--paper)); }
.check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check .box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--leaf); background: var(--surface); display: grid; place-items: center; transition: background .2s, transform .12s; }
.check .box::after { content: ''; width: 6px; height: 12px; margin-top: -2px; border: solid var(--btn-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .15s; }
.check:has(input:checked) { border-color: var(--leaf); background: color-mix(in srgb, var(--lime) 22%, var(--paper)); box-shadow: 0 8px 20px -12px var(--leaf); }
.check:has(input:checked) .box { background: var(--btn); border-color: var(--btn); }
.check:has(input:checked) .box::after { transform: rotate(45deg) scale(1); }
.check:has(input:focus-visible) { outline: 3px solid var(--leaf); outline-offset: 3px; }
.consent .cta { width: 100%; max-width: 340px; }
.consent .link { display: block; margin-inline: auto; }
/* Centre the consent card vertically in the space under the header (the header is ~68px, so pad the bottom to match). */
body[data-screen="consent"] main { display: flex; flex-direction: column; justify-content: center; padding-bottom: 72px; }
body[data-screen="consent"] #s-consent { width: 100%; }

/* ---- expert study ---- */
[hidden] { display: none !important; }
.consent-list { text-align: left; margin: 14px 0 0; padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.45; font-size: .95rem; }
.fams { display: grid; gap: 8px; margin: 14px 0 6px; max-height: 46vh; overflow: auto; padding: 2px; }
.fam { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; }
.fam:has(input:checked) { border-color: var(--leaf); background: color-mix(in srgb, var(--lime) 18%, var(--paper)); }
.fam input { grid-row: span 2; width: 22px; height: 22px; accent-color: var(--leaf); }
.fam .fine { margin: 0; }
.sub { font-size: .95rem; margin: 18px 0 8px; text-align: left; }
.text { width: 100%; font: inherit; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); }
.err { color: #b3402a; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }
.conf { display: grid; gap: 6px; justify-items: center; margin: 14px 0 120px; }
.credit { margin-top: 20px; display: grid; gap: 8px; text-align: left; }
@media (max-width: 899px) {
  body[data-study="expert"] .actions { grid-template-columns: 1fr .8fr .8fr 1fr; gap: 6px; }
  body[data-study="expert"] .choice { font-size: .74rem; padding: 8px 4px; }
}
@media (min-width: 900px) {
  body[data-study="expert"] #btn-a { grid-column: 1; grid-row: 1; }
  body[data-study="expert"] #btn-b { grid-column: 2; grid-row: 1; }
  body[data-study="expert"] .choice.same { grid-column: 1; grid-row: 2; }
  body[data-study="expert"] .choice.neither { grid-column: 2; grid-row: 2; min-height: 44px; }
}
.choice.neither { background: var(--surface); color: var(--ink); border-color: var(--line); }
.choice.neither b { color: #b3402a; }

/* Expert families screen: the continue button gets its own full-width row, clear of the region box. */
#s-families #exp-region { margin-bottom: 4px; }
#s-families .fine.err { margin: 14px 0 0; }
#s-families #fam-go { width: 100%; margin-top: 40px; }
/* Expert note button: in the page flow, above the fixed answer bar. */
.conf .note-btn { min-height: 44px; width: 100%; margin-top: 10px; }
.conf .note-hint { display: block; margin-top: 6px; text-align: center; }
