@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/montserrat-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/montserrat-latin-800-normal.woff2') format('woff2'); }

/* TOEIC Learning Lab — The Kreative graphic charter
   Montserrat · blue #016997 · ochre #E3BF65 · coral #E3785E · plum #811F50
   secondary: sage #ABB19C · teal #87BDBD · green #689982 · pale gold #DDD082 */
:root {
  --blue: #016997; --blue-ink: #014e70; --blue-soft: #e6f0f5;
  --ochre: #E3BF65; --ochre-soft: #fbf3df;
  --coral: #E3785E; --coral-ink: #b4472e; --coral-soft: #fbebe6;
  --plum: #811F50; --plum-soft: #f5e8ee;
  --sage: #ABB19C; --teal: #87BDBD; --green: #689982; --green-ink: #3f6c56; --green-soft: #e8f1ec; --gold: #DDD082;
  --ink: #1d2730; --ink-2: #444f5a; --ink-3: #5c6670;
  --paper: #faf8f4; --card: #ffffff; --line: #e4e0d8; --line-2: #efece6;
  --radius: 14px; --radius-s: 9px;
  --shadow: 0 1px 2px rgba(29,39,48,.04), 0 6px 24px rgba(29,39,48,.05);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --read: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--paper); line-height: 1.55; font-size: 16px; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h2 { font-weight: 700; font-size: 1.3rem; }
h3 { font-weight: 600; font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--plum); margin-bottom: .4rem; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(250,248,244,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.1; margin-right: auto; }
.brand b { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.brand b span { color: var(--blue); }
.brand small { font-weight: 300; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .9rem; padding: .45rem .7rem; border-radius: 999px; }
.nav a:hover { background: var(--line-2); }
.nav a.on { background: var(--blue); color: #fff; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 64px; }
.narrow { max-width: 560px; margin: 0 auto; }
.mid { max-width: 820px; margin: 0 auto; }
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; font-size: .78rem; color: var(--ink-3); border-top: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; }
.foot a { color: var(--ink-3); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tint-blue { background: var(--blue-soft); border-color: #cfe1ea; }
.card.tint-ochre { background: var(--ochre-soft); border-color: #f0e2bd; }
.card.tint-plum { background: var(--plum-soft); border-color: #ead2dd; }
.card h3 { margin-bottom: .3em; }
.part-card { display: flex; flex-direction: column; gap: .5rem; border-top: 4px solid var(--blue); }
.part-card.p6 { border-top-color: var(--teal); }
.part-card.p7 { border-top-color: var(--plum); }
.part-card .num { font-weight: 800; font-size: 2rem; color: var(--blue); line-height: 1; }
.part-card.p6 .num { color: #3d7676; } .part-card.p7 .num { color: var(--plum); }
.part-card .actions { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- buttons & forms ---------- */
.btn { font: inherit; font-weight: 600; font-size: .92rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .62rem 1.05rem; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; line-height: 1.2; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); }
.btn.plum { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn.danger { color: var(--coral-ink); border-color: #efc2b6; }
.btn.danger.solid { background: var(--coral-ink); color: #fff; border-color: var(--coral-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.small { padding: .38rem .75rem; font-size: .82rem; }
.btn.big { padding: .85rem 1.4rem; font-size: 1rem; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

label { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 .3rem; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: .62rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea.passage { min-height: 200px; font-family: var(--read); font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(1,105,151,.15); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--ink); }
.check input { margin-top: .25rem; }
.tabs { display: inline-flex; background: var(--line-2); padding: 4px; border-radius: 999px; gap: 2px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 600; font-size: .88rem; border: 0; background: transparent; padding: .5rem 1rem; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected=true] { background: #fff; color: var(--blue); box-shadow: var(--shadow); }

.alert { padding: .75rem 1rem; border-radius: var(--radius-s); font-size: .9rem; margin-bottom: 14px; border: 1px solid; }
.alert.err { background: var(--coral-soft); border-color: #f1c6ba; color: #7d2e1b; }
.alert.ok { background: var(--green-soft); border-color: #cfe2d7; color: var(--green-ink); }
.alert.info { background: var(--blue-soft); border-color: #cfe1ea; color: var(--blue-ink); }
.alert.warn { background: var(--ochre-soft); border-color: #f0e2bd; color: #6c5414; }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag.blue { background: var(--blue-soft); color: var(--blue-ink); }
.tag.green { background: var(--green-soft); color: var(--green-ink); }
.tag.coral { background: var(--coral-soft); color: #9a3a24; }
.tag.ochre { background: var(--ochre-soft); color: #6c5414; }
.tag.plum { background: var(--plum-soft); color: var(--plum); }

/* ---------- stats ---------- */
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.8rem; font-weight: 800; line-height: 1.1; color: var(--blue); }
.stat span { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar.green > i { background: var(--green); } .bar.ochre > i { background: var(--ochre); } .bar.coral > i { background: var(--coral); }
.skill-row { display: grid; grid-template-columns: 1fr 120px 52px; gap: .8rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.skill-row:last-child { border-bottom: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; background: #fcfbf8; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fbfaf7; }

/* ---------- exercise runner ---------- */
.runbar { position: sticky; top: 61px; z-index: 10; background: var(--paper); padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.runbar .row { justify-content: space-between; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; padding: .3rem .8rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); }
.timer.low { background: var(--coral-soft); color: var(--coral-ink); }
.save-state { font-size: .78rem; color: var(--ink-3); }
.save-state.off { color: var(--coral-ink); font-weight: 600; }
.qmap { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; }
.qmap button { font: inherit; font-size: .75rem; font-weight: 600; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); padding: 0; }
.qmap button.ans { background: var(--blue-soft); border-color: #b9d4e2; color: var(--blue-ink); }
.qmap button.ok { background: var(--green-soft); border-color: #bcd8c8; color: var(--green-ink); }
.qmap button.ko { background: var(--coral-soft); border-color: #f1c6ba; color: var(--coral-ink); }
.qmap button.flag { box-shadow: inset 0 -3px 0 var(--ochre); }
.qmap button.cur { outline: 2px solid var(--ink); outline-offset: 1px; }

.ex { display: grid; gap: 22px; grid-template-columns: 1fr; }
.ex.split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.ex.split .texts { position: sticky; top: 175px; max-height: calc(100vh - 195px); overflow: auto; }
@media (max-width: 900px) { .ex.split { grid-template-columns: 1fr; } .ex.split .texts { position: static; max-height: none; } .runbar { top: 0; position: relative; } }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); font-family: var(--read); font-size: 1.02rem; line-height: 1.65; }
.doc + .doc { margin-top: 14px; }
.doc .doc-kind { font-family: var(--font); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: .2rem; }
.doc h4 { font-family: var(--font); font-size: 1rem; margin-bottom: .7rem; }
.doc p { margin: 0 0 .75em; white-space: pre-wrap; }
.blank { display: inline-block; min-width: 92px; border-bottom: 2px solid var(--blue); font-family: var(--font); font-weight: 700; font-size: .85rem; color: var(--blue); text-align: center; padding: 0 .3rem; cursor: pointer; border-radius: 4px 4px 0 0; }
.blank.cur { background: var(--ochre-soft); border-color: var(--ochre); color: #6c5414; }
.blank.filled { font-weight: 600; font-family: var(--read); font-size: .98rem; color: var(--ink); }
.marker { font-family: var(--font); font-weight: 700; font-size: .8rem; color: var(--plum); background: var(--plum-soft); padding: 0 .35rem; border-radius: 4px; }

.q { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.q + .q { margin-top: 14px; }
.q.cur { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1,105,151,.12); }
.q .qnum { font-size: .75rem; font-weight: 700; color: var(--blue); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .35rem; display: flex; justify-content: space-between; gap: .5rem; }
.q .prompt { font-weight: 500; margin-bottom: .8rem; }
.q .prompt.sentence { font-family: var(--read); font-size: 1.12rem; font-weight: 400; line-height: 1.6; }
.opts { display: grid; gap: 7px; }
.opt { display: flex; gap: .7rem; align-items: flex-start; text-align: left; font: inherit; padding: .62rem .8rem; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-s); cursor: pointer; color: var(--ink); width: 100%; }
.opt:hover:not(:disabled) { border-color: var(--blue); background: #fbfdfe; }
.opt .l { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .78rem; color: var(--ink-2); }
.opt.sel { border-color: var(--blue); background: var(--blue-soft); }
.opt.sel .l { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.right .l { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: var(--coral); background: var(--coral-soft); }
.opt.wrong .l { background: var(--coral); border-color: var(--coral); color: #fff; }
.opt:disabled { cursor: default; }
.explain { margin-top: 12px; padding: .8rem 1rem; border-radius: var(--radius-s); background: #fbfaf7; border-left: 4px solid var(--ochre); font-size: .92rem; }
.explain.ok { border-left-color: var(--green); } .explain.ko { border-left-color: var(--coral); }
.explain b { display: block; margin-bottom: .2rem; }
.qtools { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 12px; }
.linkbtn { font: inherit; background: none; border: 0; color: var(--ink-3); font-size: .8rem; cursor: pointer; text-decoration: underline; padding: 0; }
.linkbtn:hover { color: var(--ink); }
.navrow { display: flex; justify-content: space-between; gap: .6rem; margin-top: 22px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 20px 0 10px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 24px; } }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero .lead { font-size: 1.05rem; color: var(--ink-2); font-weight: 300; max-width: 34em; }
.parts-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.parts-strip span { font-size: .75rem; font-weight: 600; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.parts-strip span.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(29,39,48,.42); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 520px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: .6rem; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .88rem; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.code-big { font-family: 'Courier New', monospace; font-weight: 700; font-size: 1.25rem; letter-spacing: .14em; background: var(--ochre-soft); padding: .2rem .6rem; border-radius: 8px; color: #5d4710; }

/* ---------- admin ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.side { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 80px; align-self: start; }
@media (max-width: 860px) { .side { position: static; flex-direction: row; flex-wrap: wrap; } }
.side a { text-decoration: none; color: var(--ink-2); font-weight: 500; padding: .55rem .8rem; border-radius: 10px; font-size: .92rem; display: flex; justify-content: space-between; }
.side a:hover { background: var(--line-2); }
.side a.on { background: var(--blue); color: #fff; }
.side .badge { background: var(--coral); color: #fff; font-size: .7rem; font-weight: 700; padding: 0 .45rem; border-radius: 99px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1050px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-grid .preview { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.qedit { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fcfbf8; margin-bottom: 14px; }
.qedit .optrow { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.qedit .optrow input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); justify-self: center; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; background: #fff; }
.drop.over { border-color: var(--blue); background: var(--blue-soft); }
.pill-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pill-filter select, .pill-filter input { width: auto; min-width: 140px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }

/* ---------- refinements ---------- */
main:focus { outline: none; }
.qmap button.cur { outline: none; border: 2px solid var(--ink); }
.blank.filled { display: inline; border-radius: 3px; padding: 0 .2rem; text-align: left; background: var(--blue-soft); border-bottom: 2px solid var(--blue); }
@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; gap: .4rem; padding: .55rem 16px; }
  .brand { flex-direction: row; align-items: baseline; gap: .5rem; }
  .brand small { display: none; }
  .nav { width: 100%; }
  .nav a { padding: .35rem .6rem; font-size: .84rem; }
  .runbar .row { gap: .4rem; }
  main { padding-top: 18px; }
}

/* ---------- Phase 1 completion: listening, labels, plan, vocabulary ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: .3rem; padding: 0; }
.opt .otext { display: flex; flex-direction: column; gap: .25rem; }
.opt.heard { justify-content: flex-start; }
.obadge { display: inline-block; align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: .12rem .5rem; border-radius: 999px; }
.obadge.ok { background: var(--green-ink); color: #fff; }
.obadge.ko { background: var(--coral-ink); color: #fff; }
.why { font-size: .82rem; color: var(--ink-2); font-weight: 400; }
.opt.right .why, .opt.wrong .why { color: var(--ink); }
.player { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.player.done { border-left-color: var(--sage); }
.player .acc { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.player input[type=range] { accent-color: var(--blue); }
.pic { margin: 0 0 14px; }
.pic img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; background: #fff; }
.pic figcaption { margin-top: .3rem; }
.transcript { margin-top: 14px; }
.transcript summary { cursor: pointer; }
.transcript pre { white-space: pre-wrap; font-family: var(--read); font-size: .95rem; line-height: 1.6; margin: .6rem 0 0; }
.doc.graphic .g-rows { font-family: var(--font); font-size: .92rem; }
.doc.graphic .g-row { padding: .35rem .5rem; border-bottom: 1px solid var(--line-2); }
.doc.graphic .g-row:nth-child(odd) { background: #fbfaf7; }
.flash { text-align: center; padding: 28px; }
.flash hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.flash .row { justify-content: center; }
ul.tasks { list-style: none; padding: 0; margin: 0; }
ul.tasks li { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
ul.tasks li:last-child { border-bottom: 0; }
ul.tasks li.done span { color: var(--ink-3); text-decoration: line-through; }
a.card.topic { text-decoration: none; color: var(--ink); display: block; }
a.card.topic:hover { border-color: var(--blue); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2px 12px; }
.note-in { margin: 4px 0 6px 24px; width: calc(100% - 24px) !important; font-size: .85rem !important; background: #fffdf7 !important; }
.savebar { position: sticky; bottom: 10px; z-index: 5; }
.part-card.p1, .part-card.p2, .part-card.p3, .part-card.p4 { border-top-color: var(--ochre); }
.part-card.p1 .num, .part-card.p2 .num, .part-card.p3 .num, .part-card.p4 .num { color: #8a6a14; }
label.opt { cursor: pointer; }
label.opt input { position: absolute; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.astate { margin: .3rem 0 0; color: var(--ink-3); }
.astate.err { color: #9a2b16; font-weight: 600; }
.review-card .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.hint-box { margin: 0 0 12px; font-size: .85rem; }
.hint-box summary { cursor: pointer; color: var(--blue); font-weight: 600; }

/* ---------- Release candidate: compact navigation, toasts, long forms ---------- */
/* Toasts appear at the top, never over the answer buttons or the save bar, and never catch clicks. */
.toast-stack { position: fixed; top: 76px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: min(420px, calc(100vw - 32px)); }
.toast-stack .toast { position: static; transform: none; left: auto; bottom: auto; border-radius: 12px; pointer-events: auto; }
@media (max-width: 640px) {
  .toast-stack { top: 8px; right: 8px; left: 8px; max-width: none; align-items: stretch; }
  /* One compact header row for the menu: it scrolls sideways instead of wrapping onto several lines. */
  .top { position: static; }
  .top-in { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: .25rem; padding: .45rem 12px .35rem; }
  .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: .15rem; margin: 0 -4px; padding: 0 4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex: 0 0 auto; padding: .38rem .6rem; }
}
@media (max-width: 860px) {
  .side { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; padding-bottom: 4px; }
  .side::-webkit-scrollbar { display: none; }
  .side a { white-space: nowrap; flex: 0 0 auto; }
}
/* Jump links for the long exercise editor. */
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.jump a { font-size: .82rem; text-decoration: none; padding: .3rem .65rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.jump a:hover, .jump a:focus-visible { background: var(--blue-soft); color: var(--ink); }
:target { scroll-margin-top: 90px; }
.today { border-left: 4px solid var(--ochre); }
.today ol { margin: .4rem 0 0; padding-left: 1.2rem; }
.today li.done { color: var(--ink-3); text-decoration: line-through; }
[id^="sec-"], #revcard, #checks { scroll-margin-top: 90px; }
.nav .sm { display: none; }
@media (max-width: 640px) { .nav .lg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .nav .sm { display: inline; } }
.toast-stack .toast { pointer-events: none; }

/* Learner dashboard · practice index */
.dashboard-intro { margin: .35rem 0 0; color: var(--ink-3); }
.practice-library { display: grid; gap: 2.25rem; margin: 2rem 0; }
.practice-section > header { border-bottom: 2px solid #016997; padding-bottom: .75rem; }
.practice-section:nth-child(2) > header { border-color: #811f50; }
.practice-section > header h2 { margin: 0 0 .2rem; }
.practice-section > header p { margin: 0; color: var(--ink-3); }
.practice-entry { display: grid; grid-template-columns: 5rem minmax(0, 1fr) minmax(12rem, 16rem); align-items: start; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.practice-number { display: inline-block; justify-self: start; padding: .2rem .55rem; background: #e3bf65; color: #292019; border-radius: .25rem; font-size: .8rem; font-weight: 700; }
.practice-section:nth-child(2) .practice-number { background: #87bdbd; }
.practice-detail h3 { margin: 0 0 .25rem; }
.practice-detail p { margin: 0 0 .3rem; }
.practice-meta, .practice-actions p { color: var(--ink-3); font-size: .83rem; }
.practice-actions { display: grid; justify-items: start; gap: .3rem; }
.practice-actions p { margin: 0; }
.practice-settings { background: transparent; border: 0; padding: .25rem 0; color: #016997; text-decoration: underline; text-underline-offset: .18em; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 640px) {
  .practice-entry { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .practice-actions { margin-top: .25rem; }
}

.goal-overview { margin: 0 0 1.5rem; padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-left: 5px solid #e3bf65; background: #fcf7ec; border-radius: .65rem; }
.goal-overview h1 { margin: .2rem 0; }
.goal-overview > p { margin: .4rem 0 1.2rem; }
.goal-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.goal-metrics h2 { font-size: .9rem; margin: 0 0 .25rem; }
.goal-metrics strong { font-size: clamp(1rem, 2vw, 1.25rem); }
.goal-metrics p { margin: .25rem 0 0; font-size: .85rem; }
.goal-metrics progress { display: block; width: min(100%, 13rem); margin-top: .45rem; accent-color: #016997; }
.goal-links { margin-top: 1rem; }
@media (max-width: 640px) { .goal-metrics { grid-template-columns: 1fr; } }

/* Pastel palette from The Kreative's graphic charter. */
.goal-overview { background: #fbf3eb; border-color: #e8dacf; border-left-color: #f5bfab; }
.goal-overview .eyebrow { color: #811f50; }
.goal-metrics { gap: .75rem; border: 0; padding: 0; }
.goal-metrics > div { padding: .85rem 1rem; border-radius: .5rem; background: #f8e3da; }
.goal-metrics > div:nth-child(2) { background: #e9efdf; }
.goal-metrics > div:nth-child(3) { background: #deefef; }
.goal-metrics progress { accent-color: #2d7383; }
.practice-section > header { padding: .85rem 1rem; border: 0; border-radius: .5rem; background: #deefef; }
.practice-section:nth-child(2) > header { background: #f8e3da; }
.practice-number { background: #e9efdf; }
.practice-section:nth-child(2) .practice-number { background: #f6edd1; }
.goal-links .btn.primary, .practice-actions .btn.primary { background: #deefef; border-color: #87bdbd; color: #014e70; }
.goal-links .btn.primary:hover, .practice-actions .btn.primary:hover { background: #cbe4e4; color: #014e70; }
.practice-settings { color: #811f50; }

/* Free-trial entry points use the existing site palette. */
.trial-entry { background: #5f97d1; color: #000000 !important; }
.trial-intro { margin: 24px 0; }
.trial-intro .btn { background: #5f97d1; color: #000000; border-color: #5f97d1; }
.trial-intro p { margin: 12px 0 0; font-size: 16px; }
