/* Fonts: Lora & Source Sans 3 — SIL Open Font License, see assets/fonts */
@font-face{font-family:'Lora';font-style:normal;font-weight:200 900;font-display:swap;src:url('../fonts/lora.woff2') format('woff2')}
@font-face{font-family:'Lora';font-style:italic;font-weight:200 900;font-display:swap;src:url('../fonts/lora-italic.woff2') format('woff2')}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:200 900;font-display:swap;src:url('../fonts/sourcesans.woff2') format('woff2')}
@font-face{font-family:'Source Sans 3';font-style:italic;font-weight:200 900;font-display:swap;src:url('../fonts/sourcesans-italic.woff2') format('woff2')}
/* Romanian at Work — Lesson 1 · interactive lesson styles */
:root {
  --ivory: #FBF7EF; --paper: #FFFDF9; --beige: #EFE5D3; --beige-d: #E2D3BA; --sand: #D9C6A5;
  --terra: #B8664A; --terra-d: #97503A; --terra-l: #F3E0D6;
  --sage: #8A9A7B; --sage-d: #56664B; --sage-l: #E3E9DA;
  --ink: #2F2A26; --muted: #6A6057; --line: #E6DBC9;
  --ok: #3F7A4A; --ok-bg: #E2F0E0; --bad: #A8432C; --bad-bg: #F8E1DA;
  --radius: 16px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 6px 20px rgba(60, 40, 20, .06);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --nav-w: 264px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--sans); font-size: 18px; line-height: 1.5; color: var(--ink); background: var(--ivory); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--terra); 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; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--beige); padding: 28px 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.brand { padding: 0 8px; }
.brand .k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); font-weight: 700; }
.brand .t { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.brand .s { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-size: 15px; margin-top: 4px; }
.nav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 16px; }
.nav a .n { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--paper); color: var(--muted); }
.nav a:hover { background: rgba(255, 255, 255, .55); }
.nav a[aria-current="page"] { background: var(--paper); box-shadow: var(--shadow); font-weight: 600; }
.nav a[aria-current="page"] .n { background: var(--terra); color: #fff; }
.nav a.done .n { background: var(--sage-l); color: var(--sage-d); }
.nav a.done[aria-current="page"] .n { background: var(--terra); color: #fff; }

.audio-panel { margin-top: auto; background: var(--paper); border-radius: var(--radius); padding: 14px; font-size: 14px; box-shadow: var(--shadow); }
.audio-panel h2 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-d); margin-bottom: 8px; }
.audio-status { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--beige); margin-bottom: 10px; line-height: 1.35; }
.audio-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sand); flex: none; margin-top: 5px; }
.audio-status[data-state="ready"] .dot { background: var(--ok); }
.audio-status[data-state="novoice"] .dot { background: #C98E2B; }
.audio-status[data-state="unsupported"] .dot, .audio-status[data-state="error"] .dot { background: var(--bad); }
.rate { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.rate input { width: 100%; accent-color: var(--terra); }
.rate output { font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; color: var(--muted); }
.audio-panel .row { display: flex; gap: 8px; margin-top: 10px; }

.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1080px; margin: 0 auto; padding: 44px 48px 80px; }
.section { display: none; }
.section.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- typography ---------- */
.kicker { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); font-weight: 700; margin-bottom: 6px; }
.h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 600; }
.h1 .ro, .ro-i { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-weight: 500; }
.lead { font-size: 19px; color: var(--muted); max-width: 70ch; margin-top: 10px; }
.h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-d); font-weight: 700; margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
em.ro { font-family: var(--serif); font-style: italic; color: var(--terra-d); }
.sec-head { margin-bottom: 28px; }
.block { margin-top: 36px; }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.soft { background: var(--beige); border-radius: var(--radius); padding: 20px 22px; }
.sage { background: var(--sage-l); border-radius: var(--radius); padding: 20px 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid2 > *, .grid3 > *, .hero > * { min-width: 0; }
.section { scroll-margin-top: 80px; }
.scene { width: 100%; border-radius: var(--radius); background: var(--beige); }
.tip { border-left: 3px solid var(--terra); background: var(--ivory); padding: 10px 14px; border-radius: 0 10px 10px 0; margin-top: 14px; font-size: 16px; }
.tip.sagey { border-color: var(--sage-d); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--terra); background: var(--terra); color: #fff; padding: 9px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 16px; line-height: 1.2; transition: background .15s, transform .1s; text-decoration: none; }
.btn:hover { background: var(--terra-d); border-color: var(--terra-d); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--terra-d); }
.btn.ghost:hover { background: var(--terra-l); }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.play { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1.5px solid var(--terra); background: var(--paper); color: var(--terra); cursor: pointer; display: inline-grid; place-items: center; padding: 0; transition: background .15s, color .15s; }
.play svg { width: 16px; height: 16px; }
.play:hover { background: var(--terra-l); }
.play.is-playing { background: var(--terra); color: #fff; }
.play.sm { width: 32px; height: 32px; } .play.sm svg { width: 13px; height: 13px; }
.play[disabled] { border-color: var(--sand); color: var(--sand); cursor: not-allowed; background: transparent; }
.reveal { background: none; border: 0; padding: 4px 0; color: var(--sage-d); font-weight: 600; cursor: pointer; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sand); }
.reveal:hover { color: var(--terra-d); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager .btn { min-width: 160px; }

/* ---------- feedback ---------- */
.score { display: inline-flex; align-items: center; gap: 8px; background: var(--sage-l); color: var(--sage-d); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.fb { margin-top: 8px; font-size: 15px; min-height: 1.4em; }
.fb.ok { color: var(--ok); } .fb.bad { color: var(--bad); }
.is-correct { background: var(--ok-bg) !important; border-color: var(--ok) !important; color: var(--ok) !important; }
.is-wrong { background: var(--bad-bg) !important; border-color: var(--bad) !important; color: var(--bad) !important; }
.mark::before { font-weight: 800; margin-right: 6px; }
.is-correct.mark::before { content: "✓"; } .is-wrong.mark::before { content: "✗"; }

/* ---------- welcome ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.hero .title { font-family: var(--serif); font-size: clamp(40px, 5.4vw, 62px); font-weight: 600; line-height: 1.02; }
.hero .sub { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--terra-d); margin-top: 6px; }
.qlist { display: flex; flex-direction: column; }
.qitem { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.qitem .n { font-family: var(--serif); font-size: 22px; color: var(--terra); font-weight: 700; }
.qitem .r { font-family: var(--serif); font-size: 21px; }
.qitem .e { color: var(--muted); font-size: 16px; }
.conf-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.conf-row .r { font-family: var(--serif); font-weight: 600; font-size: 19px; }
.conf-row .e { color: var(--muted); font-size: 15px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 12px; font-size: 14px; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); white-space: nowrap; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--sage-d); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--terra); outline-offset: -3px; }

/* ---------- vocab ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.vcard { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.vcard .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vcard img { width: 40px; height: 40px; }
.vcard .w { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.15; }
.vcard .p { font-size: 14px; color: var(--sage-d); letter-spacing: .02em; }
.vcard .cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.vcard .back { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }
.vcard .m { font-weight: 700; font-size: 17px; }
.vcard .x { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.vcard .x .r { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-size: 16px; }
.vcard .x .e { color: var(--muted); font-size: 14px; }
.vcard .note { font-size: 14px; color: var(--muted); margin-top: 6px; }
.sound { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 24px; }
.sound div { display: grid; grid-template-columns: 96px 1fr; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.sound b { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-size: 19px; font-weight: 600; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.match .col { display: flex; flex-direction: column; gap: 10px; }
.mbtn { text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px 16px; cursor: pointer; font-size: 17px; transition: border-color .15s, background .15s; }
.mbtn.ro { font-family: var(--serif); font-weight: 600; }
.mbtn:hover:not([disabled]) { border-color: var(--terra); }
.mbtn.selected { border-color: var(--terra); background: var(--terra-l); }
.mbtn[disabled] { cursor: default; }

/* ---------- expressions ---------- */
.expr { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.expr .r { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.25; }
.who { display: inline-block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 3px; font-family: var(--sans); font-weight: 700; }
.who.you { background: var(--sage-l); color: var(--sage-d); } .who.customer { background: var(--terra-l); color: var(--terra-d); }
.expr .e { font-weight: 700; margin-top: 4px; }
.expr .c { color: var(--muted); font-size: 16px; }

/* ---------- quiz ---------- */
.quiz { display: flex; flex-direction: column; gap: 14px; }
.qq { background: var(--paper); border-radius: var(--radius-s); padding: 16px 18px; border: 1px solid var(--line); }
.qq legend, .qq .qt { font-weight: 600; font-size: 17px; padding: 0; margin-bottom: 10px; }
.qq .qt .ro { font-family: var(--serif); }
.qq fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1.5px solid var(--line); background: var(--ivory); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 16px; transition: border-color .15s; }
.opt.ro { font-family: var(--serif); }
.opt:hover:not([disabled]) { border-color: var(--terra); }
.opt[disabled] { cursor: default; }
.opt.chosen { border-color: var(--terra); background: var(--terra-l); }
.quiz-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* ---------- grammar ---------- */
table.conj { width: 100%; border-collapse: collapse; font-size: 17px; }
table.conj td { padding: 7px 10px; border-top: 1px solid var(--line); }
table.conj td.p { color: var(--muted); width: 34%; }
table.conj td.v { font-family: var(--serif); font-weight: 600; font-size: 19px; }
table.conj td.t { color: var(--muted); font-size: 15px; }
table.conj tr.key td { background: var(--terra-l); } table.conj tr.key td.v { color: var(--terra-d); }
.exl { list-style: none; padding: 0; margin: 0; }
.exl li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.exl .r { font-family: var(--serif); font-style: italic; font-size: 18px; }
.exl .e { color: var(--muted); font-size: 15px; }
.builder { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.builder select { font-family: var(--serif); font-size: 18px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--sand); background: var(--paper); max-width: 100%; }
.builder .out { flex-basis: 100%; display: flex; align-items: center; gap: 10px; }
.builder .out .r { font-family: var(--serif); font-size: 20px; color: var(--terra-d); font-weight: 600; }
.builder .out .e { color: var(--muted); font-size: 15px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 17px; }
table.cmp th { text-align: left; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
table.cmp td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.cmp .tu { font-family: var(--serif); font-style: italic; color: var(--sage-d); }
table.cmp .dv { font-family: var(--serif); font-weight: 600; color: var(--terra-d); }
table.cmp .en { color: var(--muted); font-size: 15px; }
.cell { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 15px; margin: 0 6px 8px 0; }
.pill.tu { background: var(--sage-l); color: var(--sage-d); } .pill.dv { background: var(--terra-l); color: var(--terra-d); }
.numtab { display: grid; grid-template-columns: 90px 1fr; font-size: 17px; }
.numtab div { padding: 7px 0; border-top: 1px solid var(--line); }
.numtab .k { font-weight: 700; color: var(--terra-d); }
.sort-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.sort-row .r { font-family: var(--serif); font-size: 19px; display: flex; gap: 10px; align-items: center; }

/* ---------- dialogues ---------- */
.dline { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.dline .s { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; padding-top: 5px; }
.dline .s.j { color: var(--terra); } .dline .s.c { color: var(--sage-d); }
.dline .r { font-family: var(--serif); font-size: 20px; line-height: 1.4; }
.dline .e { color: var(--muted); font-size: 15px; margin-top: 2px; }
.dline.speaking { background: linear-gradient(90deg, var(--terra-l), transparent 70%); border-radius: 8px; }
.hide-tr .dline .e { display: none; }
mark { background: var(--terra-l); color: var(--terra-d); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.sit { font-style: italic; color: var(--muted); margin-bottom: 8px; }

/* ---------- reading ---------- */
.para { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.para .r { font-family: var(--serif); font-size: 20px; line-height: 1.65; margin: 0; }
.para .e { color: var(--muted); font-size: 16px; margin-top: 8px; background: var(--beige); padding: 10px 14px; border-radius: 10px; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 20px; }
.gloss div { padding: 6px 0; border-top: 1px solid var(--line); font-size: 16px; }
.gloss b { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-weight: 500; }
.field { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.field label { font-size: 17px; }
.field input, .field select, textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--sand); background: var(--paper); font-family: var(--serif); font-size: 18px; }
.field .fb { grid-column: 1 / -1; margin: 0; }
.field .fb:empty { display: none; }
textarea { font-family: var(--sans); font-size: 16px; resize: vertical; min-height: 72px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.starters span { background: var(--paper); border-radius: 999px; padding: 5px 12px; font-family: var(--serif); font-style: italic; color: var(--terra-d); }

/* ---------- speaking ---------- */
.rp { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 8px; border: 2px solid transparent; transition: border-color .2s; }
.rp.picked { border-color: var(--terra); }
.rp .top { display: flex; gap: 12px; align-items: center; }
.rp .badge { width: 38px; height: 38px; border-radius: 50%; background: var(--terra); color: #fff; font-family: var(--serif); font-weight: 700; display: grid; place-items: center; font-size: 18px; flex: none; }
.rp .tt { font-weight: 700; font-size: 18px; line-height: 1.2; }
.rp .tt span { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--terra-d); font-size: 16px; }
.rp .ta { color: var(--sage-d); font-weight: 600; }
.help { list-style: none; padding: 0; margin: 4px 0 0; }
.help li { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-family: var(--serif); font-style: italic; }
.timer { font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: 30px; font-weight: 600; min-width: 3ch; }

/* ---------- review / homework ---------- */
.gapline { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 19px; }
.gapline .s { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--terra); }
.gapline select, .gapline input { font-family: var(--serif); font-size: 17px; padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--sand); background: var(--paper); margin: 2px 4px; max-width: 160px; }
.gapline .fbx { font-family: var(--sans); font-size: 14px; margin-left: 6px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.bank span { border: 1.5px solid var(--terra); color: var(--terra-d); border-radius: 999px; padding: 3px 12px; font-family: var(--serif); font-style: italic; }
.total { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 24px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.total .big { font-family: var(--serif); font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.total .msg { flex: 1; min-width: 200px; }
.total .btn.ghost { color: #fff; border-color: #fff; } .total .btn.ghost:hover { background: rgba(255,255,255,.12); }
.bar { height: 8px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; flex-basis: 100%; }
.bar i { display: block; height: 100%; width: 0; background: var(--sage); transition: width .4s; }
.mrow { display: grid; grid-template-columns: 36px 1fr 110px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mrow .n { font-weight: 700; color: var(--terra); }
.mrow .r { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.mrow select { padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--sand); background: var(--paper); }
.letters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.letters div { padding: 7px 0; border-top: 1px solid var(--line); }
.letters b { color: var(--terra); margin-right: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sage-d); margin-top: 3px; flex: none; }
.notice { font-size: 14px; color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .content { padding: 36px 32px 72px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  body { font-size: 17px; }
  .app { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--beige); border-bottom: 1px solid var(--line); }
  .topbar .t { font-family: var(--serif); font-weight: 600; font-size: 18px; }
  .topbar .t span { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 400; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 50; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(47, 42, 38, .35); z-index: 45; }
  .content { padding: 26px 18px 64px; }
  .hero, .grid2, .grid3, .grid2[style] { grid-template-columns: 1fr !important; }
  table.conj td { padding: 7px 6px; } table.conj td.p { width: auto; } table.conj td.t { font-size: 14px; }
  .hero .scene { order: -1; }
  .match { gap: 10px; }
  .dline { grid-template-columns: 1fr auto; }
  .dline .s { grid-column: 1 / -1; padding-top: 0; }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .gapline { grid-template-columns: 1fr; gap: 4px; }
  .conf-row { grid-template-columns: auto 1fr; }
  .conf-row .seg { grid-column: 1 / -1; justify-self: start; }
  .pager .btn { min-width: 0; flex: 1; }
  .card, .soft, .sage { padding: 18px; }
}
@media (max-width: 520px) {
  .qitem { grid-template-columns: 26px 1fr auto; }
  .seg span { padding: 6px 9px; font-size: 13px; }
  .mbtn { padding: 10px 12px; font-size: 15px; }
  .letters { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 30px 1fr 96px; }
  table.cmp th:nth-child(3), table.cmp td:nth-child(3) { display: none; }
}
@media print {
  .sidebar, .topbar, .pager, .play, .btn, .reveal { display: none !important; }
  .section { display: block !important; page-break-after: always; }
  .app { display: block; }
}
