/* Вільне місце — a Lviv café on a rainy evening, with a Ukrainian school notebook on the table.
   Deliberately one visual world (dark café, paper notebook); every color is painted explicitly. */
:root {
  --night: #17212E;
  --night-2: #1F2C3B;
  --night-3: #2A3A4D;
  --night-4: #34475D;
  --walnut: #3E2A24;
  --lamp: #F1B653;
  --lamp-dim: #C8944A;
  --foam: #EEE7DB;
  --foam-dim: #B9B2A7;
  --plum: #C46F86;
  --paper: #F3F5F7;
  --grid: #C9D6E1;
  --card: #FBFAF6;
  --rule: #D5E1EC;
  --ink: #1E2533;
  --ink-soft: #566070;
  --pen-blue: #2B3F8C;
  --pen-red: #C0373A;
  --ok: #2F7A55;
  --ok-soft: #DCEFE3;
  --bad-soft: #F6DEDE;
  --close-soft: #FBEFD5;
  --f-story: "Alegreya", Georgia, "Times New Roman", serif;
  --f-ui: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --side: 300px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--night); color: var(--foam); margin: 0; }
body { font-family: var(--f-ui); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lamp); }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
[hidden] { display: none !important; }
/* the characters and scenes are pictures, not content: they never get selected (no blue tint) or dragged */
img, .daryna-wrap, .scene-art { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--foam-dim); }
.small { font-size: .82rem; }
.empty { color: var(--foam-dim); font-style: italic; }
.icon { display: inline-flex; line-height: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #131B26; border-right: 1px solid #223041;
  display: flex; flex-direction: column; padding-block: 20px 12px; padding-inline: 12px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 6px 12px 10px; text-decoration: none; }
.brand-mark { color: var(--lamp); display: flex; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--f-story); font-weight: 700; font-size: 1.4rem; color: var(--lamp); }
.brand-sub { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #AEB6C1; margin-top: 4px; }
.side-rule { border: 0; border-top: 1px solid #223041; margin: 12px 10px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 20px; padding: 15px 18px 15px 22px; border-radius: 10px; text-decoration: none; color: var(--foam); }
.nav-item:hover { background: #1B2532; }
.nav-item[aria-current="page"] { background: #1F2935; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--lamp); }
.nav-icon { color: #B6BFCA; display: flex; justify-content: center; flex: none; width: 26px; }
.nav-item[aria-current="page"] .nav-icon { color: var(--foam); }
.nav-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.nav-uk { font-size: 1.15rem; font-weight: 500; color: #EEF0F2; }
.nav-en { font-size: .95rem; color: #9AA4B0; }
/* a count beside a section: plain, quiet numbers */
.badge { flex: none; text-align: right; font-size: .95rem; color: #9AA4B0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.convo-head { display: flex; align-items: center; min-height: 32px; padding: 0 6px 0 20px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #9AA4B0; }
.convo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.convo-empty { display: flex; gap: 14px; padding: 10px 14px; color: #AEB6C1; }
.convo-empty .nav-icon { color: #AEB6C1; }
.convo-empty-title { display: block; font-size: .95rem; }
.convo-empty-hint { display: block; margin-top: 6px; font-size: .84rem; color: #9AA4B0; text-decoration: none; line-height: 1.4; }
.convo-empty-hint:hover { color: var(--lamp); }
.pad { padding: 6px 12px; }
.convo { position: relative; display: flex; align-items: center; border-radius: 12px; }
.convo:hover { background: #1B2532; }
.convo.current { background: #242E3B; }
.convo-link { flex: 1; min-width: 0; display: flex; gap: 16px; align-items: center; padding: 10px 4px 10px 18px; text-decoration: none; color: var(--foam); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-story); font-weight: 700; background: #C46F8633; color: #F0B9C7; }
.avatar.person { background: #F1B65326; color: var(--lamp); }
.convo-text { min-width: 0; display: flex; flex-direction: column; }
.convo-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.convo-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; color: #9AA4B0; }
.convo-more { opacity: 0; }
.convo:hover .convo-more, .convo.current .convo-more, .convo-more:focus-visible, .convo-more[aria-expanded="true"] { opacity: 1; }
.convo-menu { position: absolute; right: 6px; top: 100%; z-index: 20; background: #1F2A38; border: 1px solid #2B3746; border-radius: 10px; padding: 4px; display: flex; flex-direction: column; min-width: 130px; box-shadow: 0 12px 30px -10px #000c; }
.convo-menu button { background: none; border: 0; text-align: left; padding: 6px 10px; border-radius: 6px; font-size: .88rem; }
.convo-menu button:hover { background: #2A3747; }
.convo-menu .danger { color: #F2A3A3; }
.archive { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.archive-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: #AEB6C1; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; text-align: left; }
.archive-toggle:hover { background: #1B2532; color: var(--foam); }
.archive-toggle .icon { transform: rotate(-90deg); }
.archive-toggle[aria-expanded="true"] .icon { transform: none; }
.archive-count { margin-left: auto; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.convo-list.archived .convo-link { opacity: .7; }
.convo-list.archived .convo:hover .convo-link, .convo-list.archived .convo.current .convo-link { opacity: 1; }
.rename { width: 100%; margin: 4px; padding: 6px 8px; border-radius: 8px; border: 1px solid #4D8FE8; background: #172130; }
.confirm-box { padding: 8px 12px; font-size: .84rem; display: flex; flex-direction: column; gap: 6px; }
.side-foot { margin-top: auto; padding-top: 8px; }
.save-line { font-size: .72rem; color: #9AA4B0; padding-inline: 14px; min-height: 1.2em; }
.save-line.failed, .save-line.full { color: #F2A3A3; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: inherit; text-decoration: none; flex: none; }
.icon-btn:hover { background: #1F2A38; }
.topbar, .scrim { display: none; }

.view { padding-inline: 28px; padding-block: 24px 48px; min-width: 0; max-width: 1240px; width: 100%; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h1 { margin: 0; font-family: var(--f-story); font-weight: 700; font-size: 2rem; line-height: 1.1; color: var(--lamp); text-wrap: balance; }
.view-head h1 span { font-weight: 400; font-style: italic; color: var(--foam-dim); font-size: 1rem; margin-left: 10px; }
.lede { margin: 6px 0 0; color: var(--foam-dim); max-width: 64ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading-view, .empty-view { padding: 40px 0; color: var(--foam-dim); }
.empty-view h1 { font-family: var(--f-story); color: var(--foam); }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; padding: 9px 18px; border: 1px solid #3A4A5E; background: #1E2A39; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--foam); line-height: 1.25; }
.btn:hover { border-color: #5A6B82; background: #243142; }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: #2A1A0C; font-weight: 600; }
.btn.primary:hover { background: #F6C46E; border-color: #F6C46E; }
.btn.small { padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn.danger { color: #F2A3A3; }
.btn:disabled { opacity: .45; cursor: default; }
.btn small { display: block; font-size: .66rem; font-weight: 500; opacity: .75; letter-spacing: .04em; }
.link-btn { background: none; border: 0; padding: 0; color: var(--lamp); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #F1B65366; }
.link-btn.dark { color: var(--pen-blue); text-decoration-color: #2B3F8C55; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-btn { background: #F1B6531a; border: 0; color: var(--foam); border-radius: 99px; padding: 3px 11px; font-size: .8rem; }
.chip-btn:hover { background: #F1B65326; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 6px; }
input:not([type="checkbox"]), select, textarea { background: #EEE7DB12; border: 0; border-radius: 10px; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lamp-dim); outline-offset: 0; }
textarea { width: 100%; resize: vertical; font-family: var(--f-ui); }
.notice { background: #F1B65324; border: 0; color: var(--foam); border-radius: 10px; padding: 10px 14px; font-size: .88rem; }
.notice.bad { background: #C0373A33; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--foam); color: var(--ink); padding: 9px 16px; border-radius: 10px; box-shadow: 0 14px 30px -10px #000c; font-size: .9rem; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- light panels: plain and solid, for easy reading ---------- */
.paper {
  color: var(--ink); border-radius: 10px; padding: 18px 20px;
  background: var(--paper);
}
.paper h2 { margin: 0 0 8px; font-family: var(--f-story); font-weight: 700; font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
.paper p { margin: 0 0 10px; }
.paper .muted, .paper .small.muted { color: var(--ink-soft); }
.paper .btn:not(.primary) { background: #1E25330f; color: var(--ink); }
.paper .btn:not(.primary):hover { background: #1E25331c; }
.paper input:not([type="checkbox"]), .paper select, .paper textarea { background: #E2E7EC; color: var(--ink); }
.paper a:not(.btn) { color: var(--pen-blue); }
.paper .chip-btn { background: #1E25330f; color: var(--ink); }
.paper .notice { color: var(--ink); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.empty-card { max-width: 620px; }

/* ---------- home ---------- */
.today { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; margin-bottom: 18px; }
.today-card { background: var(--night-2); border: 0; border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.today-card.urgent { background: #F1B65326; }
.today-kicker { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--foam-dim); }
.today-line { margin: 0; font-family: var(--f-story); font-size: 1.3rem; line-height: 1.25; flex: 1; }
.recent { max-width: 760px; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed #1E253322; }
.mini-row:last-child { border-bottom: 0; }
.w-uk { font-family: var(--f-story); font-size: 1.1rem; }
.w-en { color: var(--ink-soft); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.w-pos { color: var(--ink-soft); font-size: .76rem; font-style: italic; }
.stage-pill { font-size: .7rem; padding: 1px 8px; border-radius: 99px; border: 0; background: #1E25330f; white-space: nowrap; text-transform: lowercase; }
.stage-pill.drilling { background: #2B3F8C1f; color: var(--pen-blue); }
.stage-pill.review { background: #2F7A551f; color: var(--ok); }
.stage-pill.due { background: #F1B65366; color: #5C3F0C; }
.stage-pill.paused { color: var(--ink-soft); }

/* ---------- words ---------- */
.add-panel { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.panel-head { display: flex; align-items: center; gap: 12px; }
.panel-head h2 { margin: 0; }
.group-look .group-mark { display: flex; color: var(--g, var(--lamp)); }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; }
.add-row.wrap { flex-wrap: wrap; }
.add-row.wrap input { flex-basis: 220px; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.search { flex: 1 1 220px; min-width: 0; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-btn { background: #EEE7DB0f; border: 0; border-radius: 99px; padding: 4px 12px; font-size: .84rem; color: var(--foam-dim); font-variant-numeric: tabular-nums; }
.seg-btn[aria-pressed="true"] { background: var(--foam); color: var(--ink); }
.sort-pick { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--foam-dim); }
.sort-pick select { padding: 6px 10px; font-size: .88rem; color: var(--foam); }
.sort-pick option { background: #172130; color: #EEF0F2; }
.word-list { display: flex; flex-direction: column; background: var(--paper); border-radius: 6px; color: var(--ink); overflow: hidden; }
.word-list > .empty-block { padding: 22px; }
.word-list .muted { color: var(--ink-soft); }
.word-row { border-bottom: 1px solid var(--rule); }
.word-row:last-child { border-bottom: 0; }
.word-row.open { background: #fff; }
.word-main { width: 100%; background: none; border: 0; text-align: left; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, .9fr) 96px 80px; gap: 12px; align-items: center; padding: 10px 16px; color: var(--ink); }
.word-main:hover { background: #FFFFFF99; }
.dots { display: inline-flex; gap: 4px; }
.word-main .dots, .word-main .w-due, .word-main .stage-pill { justify-self: end; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #2B3F8C66; display: inline-block; }
.dot.l1 { background: linear-gradient(90deg, var(--pen-blue) 50%, transparent 50%); }
.dot.l2 { background: var(--pen-blue); border-color: var(--pen-blue); }
.w-due { font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.w-group { display: flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--g-ink, var(--pen-blue)); white-space: nowrap; overflow: hidden; }
.w-group span { overflow: hidden; text-overflow: ellipsis; }
.group-head .group-mark { color: var(--g-ink, var(--pen-blue)); display: flex; }
/* a word group's own colour: the shade for dark panels, and a darker ink for the paper pages */
.g-gold { --g: #F1B653; --g-ink: #8A6516; }
.g-sky { --g: #6FA8F5; --g-ink: #21529F; }
.g-mint { --g: #5FC48D; --g-ink: #1E7A4B; }
.g-coral { --g: #F09070; --g-ink: #A2452A; }
.g-rose { --g: #EE8FB0; --g-ink: #9E3763; }
.g-violet { --g: #A99BF0; --g-ink: #56409F; }
.g-teal { --g: #56BDBA; --g-ink: #12706E; }
.g-sand { --g: #D8B98A; --g-ink: #7A5A2A; }
.say-box .group-mark { color: var(--g, #B6BFCA); }
.word-detail { padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.word-detail p { margin: 0; }
.example { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ex-uk { font-family: var(--f-story); font-size: 1.05rem; }
.ex-en { color: var(--ink-soft); font-size: .86rem; font-style: italic; }
.forms, .notes { font-size: .88rem; }
.mode-progress { display: flex; gap: 6px; flex-wrap: wrap; }
.mp { font-size: .76rem; padding: 2px 9px; border-radius: 99px; border: 0; background: #2B3F8C14; color: var(--pen-blue); font-variant-numeric: tabular-nums; }
.mp.l2 { background: var(--pen-blue); color: #fff; }
.word-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; }
.word-edit .row-actions, .word-edit > p { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--ink-soft); }
.field input { color: var(--ink); background: #E2E7EC; border: 0; }
.field-label { font-size: .84rem; color: var(--ink-soft); }
.pick-list { display: flex; flex-direction: column; background: #fff; border-radius: 6px; margin-bottom: 10px; }
.pick { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--rule); }
.pick.have { opacity: .55; }
.pick input { width: 16px; height: 16px; accent-color: var(--pen-blue); }
.confirm { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px 8px; background: #1E25330d; border-bottom: 1px solid var(--rule); }
.group-head .w-uk { font-weight: 700; }
.group-head .btn, .group-head .confirm { align-self: center; }
.group-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.word-list { container-type: inline-size; }
/* a narrow list keeps its columns and puts the group under the meaning */
@container (max-width: 640px) {
  .word-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, .7fr) 96px 80px; row-gap: 2px; }
  .word-main > * { grid-row: 1; }
  .group-head .w-en { display: none; } /* a narrow list keeps the group's English name and its buttons on one line */
  .word-main .w-group { grid-column: 2 / -1; grid-row: 2; }
  .word-main .w-group:empty { display: none; }
}

/* ---------- drill & review ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.game-tile { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; border: 0; background: var(--night-2); color: var(--foam); min-height: 132px; }
.game-tile:hover:not(:disabled) { background: var(--night-3); }
.game-tile:disabled { opacity: .5; cursor: default; }
.game-tile.featured { grid-column: 1 / -1; background: linear-gradient(135deg, #F1B65326, var(--night-2) 55%); border-color: var(--lamp-dim); min-height: 0; }
.tile-kicker { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); }
.tile-title { font-family: var(--f-story); font-size: 1.25rem; line-height: 1.2; }
.game-tile.featured .tile-title { font-size: 1.6rem; }
.tile-blurb { color: var(--foam-dim); font-size: .88rem; flex: 1; }
.tile-count { font-size: .76rem; color: var(--lamp-dim); }
.progress-card { max-width: 760px; margin-bottom: 14px; }
.voice-help { max-width: 70ch; margin-bottom: 18px; }

.session { max-width: 720px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }
.session-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.session-mode { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--foam-dim); }
.progress { flex: 1 1 120px; height: 6px; border-radius: 99px; background: var(--night-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lamp); transition: width .3s; }
.session-count { font-variant-numeric: tabular-nums; font-size: .84rem; color: var(--foam-dim); }
.index-card {
  color: var(--ink); background: var(--card); border-radius: 10px; overflow: hidden;
  min-height: 340px; display: flex; flex-direction: column;
}
.card-body { padding: 24px 28px 22px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.card-body.center { align-items: center; justify-content: center; }
.card-foot { padding: 0 28px 22px; display: flex; justify-content: flex-end; }
.big-uk { font-family: var(--f-story); font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-en { font-family: var(--f-story); font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.15; }
.index-card .icon-btn { color: var(--pen-blue); }
.index-card .icon-btn:hover { background: #2B3F8C14; }
.index-card .muted { color: var(--ink-soft); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; text-align: left; padding: 11px 14px; border-radius: 10px; border: 0; background: #1E25330a; color: var(--ink); font-size: 1rem; }
.choice:hover:not(:disabled) { background: #1E253314; }
.choice kbd, .rate kbd { font-family: var(--f-ui); font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.choice.right { background: var(--ok-soft); color: var(--ok); }
.choice.wrong { background: var(--bad-soft); color: var(--pen-red); }
.choice:disabled { cursor: default; }
.answer-row { display: flex; gap: 8px; }
.answer { flex: 1; min-width: 0; font-family: var(--f-story); font-size: 1.35rem !important; background: #1E25330a !important; color: var(--ink) !important; border: 0 !important; border-bottom: 2px solid #1E253333 !important; border-radius: 8px 8px 0 0 !important; }
.answer.right { border-bottom-color: var(--ok) !important; background: var(--ok-soft) !important; }
.answer.wrong { border-bottom-color: var(--pen-red) !important; background: var(--bad-soft) !important; }
.answer.close { border-bottom-color: var(--lamp-dim) !important; background: var(--close-soft) !important; }
.under-answer { min-height: 1.2em; margin-top: -8px; }
.feedback { display: flex; flex-direction: column; gap: 6px; }
.feedback p { margin: 0; }
.good { color: var(--ok); font-family: var(--f-story); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.bad { color: var(--pen-red); font-family: var(--f-story); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.close-text { color: #8A5A12; font-family: var(--f-story); font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.reveal { display: flex; align-items: center; gap: 8px; font-family: var(--f-story); font-size: 1.5rem; }
.explain { color: var(--ink); font-size: .92rem; }
.listen-prompt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; }
.big-play { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--pen-blue); color: #fff; display: grid; place-items: center; }
.big-play:hover { background: #33499E; }
.gap-sentence { font-family: var(--f-story); font-size: clamp(1.4rem, 4.5vw, 2rem); line-height: 1.3; margin: 0; }
.blank { color: var(--pen-red); letter-spacing: .05em; }
.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--foam-dim); animation: dot 1.2s infinite; }
.typing.dark i { background: var(--ink-soft); }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.typing.dark:empty::before, .typing.dark:empty::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: dot 1.2s infinite; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 6px; border-radius: 10px; border: 0; background: #1E25330a; color: var(--ink); }
.rate-label { font-weight: 600; }
.rate-wait { font-size: .76rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rate.suggested { background: #2B3F8C24; }
.session-end { max-width: 640px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; }
.session-end h1 { margin: 0; font-family: var(--f-story); font-weight: 700; font-size: 1.8rem; color: var(--ink); line-height: 1.15; }
.grad b { font-family: var(--f-story); }
.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tally div { border-top: 1px solid #1E253322; padding-top: 6px; }
.tally b { display: block; font-family: var(--f-story); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.tally span { font-size: .75rem; color: var(--ink-soft); }

/* ---------- new conversation ---------- */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.scene-card { background: var(--night-2); border: 0; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.scene-thumb { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.sprite-thumb { aspect-ratio: 3 / 2; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 30%, #3A4A62, #1C2735 75%); }
.sprite-thumb img { position: absolute; left: 50%; top: 6%; width: 52%; max-width: none; transform: translateX(-50%); }
.person-thumb { aspect-ratio: 3 / 2; display: grid; place-items: center; font-family: var(--f-story); font-size: 4rem; color: var(--lamp); background: radial-gradient(circle at 50% 40%, #F1B65326, #1C2735 70%); }
.scene-text { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.scene-text h2 { margin: 0; font-family: var(--f-story); font-size: 1.4rem; color: var(--foam); }
.scene-text p { margin: 0; color: var(--foam-dim); }
.scene-text > .btn { align-self: flex-start; margin-top: auto; }
.scene-form { display: flex; flex-direction: column; gap: 8px; }
.scene-form .field-label { color: var(--foam-dim); }

/* ---------- conversation ---------- */
.talk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.scene { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: var(--scene-ar, 8 / 5); background: var(--walnut); }
.frame { position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 3 / 2; transform: translate(-50%, -50%); }
.frame img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.shot { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .35s ease; }
.shot.prev { opacity: 1; z-index: 1; transition: none; }
.shot.on { opacity: 1; z-index: 2; }
.art-sprites { background: radial-gradient(ellipse at 50% 35%, #4A5A72 0%, #26344A 55%, #182230 100%); }
.art-sprites .shot.sprite { inset: auto; left: 50%; bottom: -40%; height: 128%; width: auto; transform: translateX(-50%); }
.card-scene { background: radial-gradient(ellipse at 50% 30%, #3B4A60, #17212E 75%); }
.portrait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8%; text-align: center; }
.portrait-initial { width: 22%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-story); font-weight: 700; font-size: clamp(2rem, 7vw, 4.5rem); color: #2A1A0C; background: radial-gradient(circle at 35% 30%, #F8D38A, var(--lamp) 60%, #B98335); }
.portrait-name { font-family: var(--f-story); font-weight: 700; font-size: clamp(1.4rem, 3.4vw, 2.2rem); color: var(--foam); }
.portrait-about { color: var(--foam-dim); font-size: clamp(.8rem, 1.6vw, 1rem); max-width: 46ch; }
.portrait-mood { font-family: var(--f-story); font-style: italic; font-size: clamp(1rem, 2vw, 1.3rem); color: var(--lamp); min-height: 1.2em; }
.place { position: absolute; left: 14px; top: 12px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--foam); background: #000A; padding: 3px 9px; border-radius: 99px; z-index: 3; }
.clock { position: absolute; right: 14px; top: 12px; font-size: .75rem; color: var(--foam); background: #000A; padding: 3px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; z-index: 3; }
.dialogue { position: relative; background: var(--night-2); border: 0; border-radius: 14px; padding: 16px 22px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 170px; }
.you-said { font-size: .88rem; color: #A9B8EA; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.you-said b { font-weight: 600; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--foam-dim); }
.you-said q { font-family: var(--f-story); font-size: 1.05rem; quotes: "«" "»"; }
.moment { align-self: flex-start; font-family: var(--f-story); font-style: italic; font-size: 1.02rem; line-height: 1.3; color: var(--lamp); }
.moment::before { content: "✦ "; font-size: .9rem; vertical-align: middle; }
.heard { align-self: flex-start; background: #C46F8633; color: #F0B9C7; border: 0; border-radius: 8px; padding: 4px 10px; font-size: .82rem; }
.speaker { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.speaker strong { font-family: var(--f-story); font-weight: 700; font-size: 1.05rem; color: var(--lamp); }
.speaker em { font-family: var(--f-story); color: var(--foam-dim); font-size: .95rem; }
.line { font-family: var(--f-story); font-size: 1.5rem; line-height: 1.35; color: var(--foam); margin: 0; text-wrap: pretty; }
.line.narration { font-style: italic; font-size: 1.15rem; color: var(--foam-dim); }
.w { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; border-bottom: 1.5px dotted #EEE7DB55; cursor: help; }
.w:hover, .w[aria-expanded="true"] { border-bottom-color: var(--lamp); color: #fff; }
.gloss { position: absolute; z-index: 5; background: var(--foam); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: .85rem; box-shadow: 0 10px 24px -8px #000c; max-width: 240px; pointer-events: none; }
.gloss b { font-family: var(--f-story); font-size: 1rem; margin-right: 6px; }
.line-tools { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; }
/* the translate icon beside a spoken line; lit while the English shows */
.trans-btn { width: 30px; height: 30px; margin-left: -5px; color: var(--lamp); }
.trans-btn:hover { background: #F1B6531f; }
.trans-btn[aria-expanded="true"] { background: #F1B65333; }
.translation { color: var(--foam-dim); font-size: .92rem; font-style: italic; font-family: var(--f-story); }
.composer { display: flex; flex-direction: column; gap: 6px; }
.say-row { display: flex; gap: 8px; }
#say { flex: 1; min-width: 0; padding: 12px 14px; font-family: var(--f-story); font-size: 1.15rem; }
#say::placeholder { color: #8791A0; font-style: italic; }
.under { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; font-size: .82rem; color: var(--foam-dim); min-height: 1.5em; }
.preview { font-family: var(--f-story); font-size: 1rem; color: var(--foam); }
.preview span { color: var(--foam-dim); font-family: var(--f-ui); font-size: .78rem; margin-right: 6px; }
.hints { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { text-align: left; background: #F1B6531a; border: 0; border-radius: 10px; padding: 7px 12px; max-width: 100%; }
.hint:hover { background: #F1B65326; }
.hint .uk { font-family: var(--f-story); font-size: 1.05rem; display: block; }
.hint .en { font-size: .78rem; color: var(--foam-dim); }
.hint .tip { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--lamp-dim); display: block; }
.ending { position: absolute; inset: 0; display: grid; place-items: center; background: #0F151DCC; padding: 16px; z-index: 4; }
.ending-card { background: var(--foam); color: var(--ink); border-radius: 6px; width: min(480px, 100%); padding: 20px 22px; box-shadow: 0 24px 60px -18px #000; display: flex; flex-direction: column; gap: 12px; max-height: 100%; overflow: auto; }
.ending-card h2 { margin: 0; font-family: var(--f-story); font-size: 1.45rem; line-height: 1.2; text-wrap: balance; }
.ending-card p { margin: 0; color: var(--ink-soft); }
.ending-card .btn.ghost-ink { background: transparent; color: var(--ink); border-color: #1E253333; }

.notebook {
  position: sticky; top: 16px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; color: var(--ink);
  background: var(--paper);
  border-radius: 10px;
  overflow: hidden;
}
.nb-head { padding: 14px 16px 10px; position: relative; background: #E8ECF0; border-bottom: 1px solid #D5DCE3; display: flex; flex-direction: column; gap: 8px; }
.nb-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nb-title h2 { margin: 0; font-family: var(--f-story); font-weight: 700; font-size: 1.3rem; line-height: 1.1; color: var(--ink); }
.nb-title span { font-size: .72rem; color: var(--ink-soft); }
.stat { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; font-size: .8rem; }
.stat > span:first-child { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.pips { display: flex; gap: 3px; align-items: center; position: relative; }
.pips i { flex: 1; height: 10px; max-width: 20px; border-radius: 3px; background: #1E253318; transition: background .3s; }
.pips i.on { background: var(--plum); }
.pips i.on.hi { background: #A84A66; }
.mood-label { font-size: .8rem; color: var(--ink); line-height: 1.3; }
.mood-label em { color: var(--ink-soft); font-style: normal; }
.delta { position: absolute; right: 0; top: -14px; font-weight: 600; font-size: .8rem; animation: rise 1.6s ease-out forwards; }
.delta.up { color: #A84A66; } .delta.down { color: var(--ink-soft); }
@keyframes rise { from { opacity: 1; transform: translateY(4px); } to { opacity: 0; transform: translateY(-10px); } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { font-size: .75rem; border: 0; border-radius: 99px; padding: 1px 9px; background: #1E25330f; font-variant-numeric: tabular-nums; }
.chip.ty { color: #8E3A55; background: #C46F8624; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 2px 4px; font-size: .82rem; color: var(--ink-soft); font-weight: 500; }
.tab[aria-selected="true"] { color: var(--pen-blue); border-bottom-color: var(--pen-blue); }
.nb-body { position: relative; overflow-y: auto; padding: 14px 16px 20px; flex: 1; min-height: 0; }
.nb-body > div { display: flex; flex-direction: column; gap: 14px; }
.entry { display: flex; flex-direction: column; gap: 4px; }
.entry .who { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.entry .mine { font-family: var(--f-story); font-size: 1.08rem; color: var(--pen-blue); line-height: 1.3; }
.entry .hers { font-family: var(--f-story); font-size: 1.05rem; color: var(--ink); line-height: 1.3; }
.entry .en { font-size: .8rem; color: var(--ink-soft); font-style: italic; }
.verdict { font-family: var(--f-ui); font-weight: 600; font-size: .86rem; line-height: 1.3; color: var(--pen-red); }
.verdict.good { color: var(--ok); }
.pending { font-size: .78rem; color: var(--ink-soft); font-style: italic; }
.fix { font-size: .84rem; line-height: 1.35; }
.fix s { color: var(--ink-soft); text-decoration-color: var(--pen-red); text-decoration-thickness: 1.5px; }
.fix .to { font-family: var(--f-story); font-weight: 700; font-size: 1.02rem; color: var(--pen-red); margin-left: 6px; }
.fix .why { display: block; color: var(--ink-soft); font-size: .78rem; }
.better { font-size: .84rem; }
.better b { font-family: var(--f-story); font-size: 1.02rem; font-weight: 700; color: var(--ok); }
.thought { font-size: .78rem; color: var(--ink-soft); display: flex; gap: 6px; align-items: baseline; }
.thought b { font-variant-numeric: tabular-nums; color: #A84A66; }
.thought b.zero, .thought b.neg { color: var(--ink-soft); }
.rule { border: 0; border-top: 1px dashed #1E253326; margin: 0; }
.nb-moment { font-family: var(--f-story); font-size: 1rem; line-height: 1.35; color: var(--ink); background: #F1B65329; border-radius: 8px; padding: 6px 10px; }
.nb-moment b { display: block; font-family: var(--f-ui); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.phrase { display: grid; grid-template-columns: 1fr; gap: 0; }
.phrase b { font-family: var(--f-story); font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.phrase span { font-size: .8rem; color: var(--ink-soft); }
.nb-section { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.notebook .empty { color: var(--ink-soft); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  .shot, .toast, .progress i { transition: none; }
  .typing i, .delta { animation: none; }
  .game-tile:hover:not(:disabled) { transform: none; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 1280px) {
  .talk { grid-template-columns: minmax(0, 1fr); }
  .notebook { position: relative; top: 0; max-height: none; }
  .nb-body { max-height: 520px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: #141D29; border-bottom: 1px solid #F1B6531A; padding-block: 8px; padding-inline: 12px; }
  .topbar-brand { font-family: var(--f-story); font-weight: 700; font-size: 1.2rem; color: var(--lamp); text-decoration: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 60px #000a; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: #0009; z-index: 35; }
  .view { padding-inline: 16px; padding-block: 16px 40px; }
  .view-head h1 { font-size: 1.6rem; }
  .view-head h1 span { display: block; margin-left: 0; }
  .word-main { grid-template-columns: minmax(0, 1fr) auto; }
  .word-main .w-en { grid-column: 1; grid-row: 2; }
  .word-main .w-pos { display: none; }
  .word-main .w-group { grid-column: 1 / -1; grid-row: 3; }
  .word-main .w-group:empty { display: none; }
  .word-main .dots, .word-main .w-due { grid-column: 2; grid-row: 1; justify-self: end; }
  .word-main .stage-pill { grid-column: 2; grid-row: 2; justify-self: end; }
  .line { font-size: 1.3rem; }
  .card-body { padding: 18px; }
  .rate-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .say-row, .answer-row, .add-row { flex-wrap: wrap; }
  #say, .answer, .add-row input { flex-basis: 100%; }
  .say-row .btn { flex: 1; }
  .dialogue { padding: 14px 16px; }
  .mini-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mini-row .w-en { grid-column: 1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Daryna's classroom: painted board, chalk writing, Daryna in front, her dialogue box ---------- */
.classroom { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; margin-inline: auto; width: 100%; }
.classroom.compact { max-width: 820px; margin-bottom: 18px; }
.board-stage { position: relative; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; background: #F2E6D2; }
.stage-frame { position: absolute; inset: 0; container-type: inline-size; background: url("../art/chalkboard_bg.webp") 0 0 / 100% 100% no-repeat; }
/* the green surface of the painting: 3.2% in from the sides, 8.1% from the top, 16.6% from the bottom */
.board { position: absolute; left: 3.2%; right: 3.3%; top: 8.1%; bottom: 16.6%; }
.board-heading { position: absolute; top: 4%; left: 38%; right: 3%; text-align: center; font-size: 2.5cqw; line-height: 1.25; opacity: .9; }
.board-main { position: absolute; left: 38%; right: 3%; top: 20%; bottom: 5%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1cqw; text-align: center; }
.chalk { font-family: var(--f-hand); color: #F3F0E6; text-shadow: 0 0 1px #fff9, 0 0 10px #ffffff22; overflow-wrap: anywhere; }
.chalk-big { font-size: 7.6cqw; font-weight: 700; line-height: 1; }
.chalk-mid { font-size: 4.2cqw; font-weight: 600; line-height: 1.15; }
.chalk-small { font-size: 2.5cqw; line-height: 1.2; opacity: .88; }
.chalk-answer, .chalk .chalk-answer { color: #FFE39A; }
.chalk-blank { letter-spacing: .08em; color: #F3F0E6aa; }
/* a word on the board shows its meaning on hover, like the words of a spoken line, but with nothing drawn under it */
.chalk-w { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; text-shadow: inherit; cursor: help; }
.board-stage > .gloss { position: absolute; z-index: 6; max-width: 260px; }
.chalk-line { width: 42%; height: .32cqw; min-height: 2px; border-radius: 3px; background: #F3F0E6cc; transform: rotate(-1.2deg); }
.chalk-play { width: 15cqw; aspect-ratio: 1; border-radius: 50%; border: .45cqw solid #F3F0E6dd; background: #ffffff0d; color: #F3F0E6; display: grid; place-items: center; }
.chalk-play:hover { background: #ffffff1f; }
.chalk-play .icon svg { width: 7.5cqw; height: 7.5cqw; }
.daryna-wrap { position: absolute; inset: 0; pointer-events: none; filter: drop-shadow(0 10px 18px #0004); transform-origin: 20% 100%; }
.daryna-wrap.pop { animation: daryna-pop .24s ease-out; }
@keyframes daryna-pop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-1.2%) scale(1.008); } 100% { transform: translateY(0) scale(1); } }
.daryna { position: absolute; left: 0; bottom: -34%; height: 122%; width: auto; max-width: none; visibility: hidden; }
.daryna.on { visibility: visible; }
/* Olena Petrivna gives lessons; she holds her chalk out to the left, so she stands a little further in */
.teacher-olena .daryna { left: 5%; }

/* her dialogue box: avatar and name, her line, then the controls */
.say-box { background: #151E2A; border: 1px solid #2B3746; border-radius: 18px; padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.say-head { display: flex; gap: 16px; align-items: flex-start; }
.say-avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--lamp); color: #1A222D; display: grid; place-items: center; }
.say-avatar.pic { overflow: hidden; background: #1F2C3B; box-shadow: 0 0 0 2px #F1B65359; }
.say-avatar.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.say-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.say-who { font-family: var(--f-ui); font-weight: 600; font-size: 1.02rem; color: var(--lamp); }
.say-line { margin: 0; font-family: var(--f-ui); font-weight: 500; font-size: 1.2rem; line-height: 1.4; color: #F4F2EE; }
/* her line's "Show translation", as in conversations */
.say-text .line-tools { margin-top: 6px; }
.say-text .translation { color: #A9B2BE; }
.say-dock { display: flex; flex-direction: column; gap: 12px; }
/* ⋯ in the dialogue box's corner, and its menu */
.say-box { position: relative; }
.say-more { position: absolute; top: 12px; right: 12px; color: #C9D0D8; }
.say-box.has-more .say-head { padding-right: 34px; }
.say-more-menu { position: absolute; top: 48px; right: 12px; z-index: 5; min-width: 220px; display: flex; flex-direction: column; padding: 4px; background: #1F2A38; border: 1px solid #2B3746; border-radius: 10px; box-shadow: 0 12px 30px -10px #000c; }
.say-more-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 6px; background: none; color: #EEF0F2; text-align: left; font-size: .95rem; }
.say-more-item:hover { background: #2A3747; }
.say-more-check { width: 1em; color: var(--lamp); font-weight: 700; }

/* answer choices sit two to a row in the corner panel */
@media (min-width: 761px) { .classroom.full .say-box .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* where to go next: short choices as buttons (side by side, or a compact grid), long ones as rows with arrows */
.act-menu { display: flex; flex-direction: column; gap: 14px; }
.act { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 10px; background: none; color: #D5DBE2; font-size: 1rem; font-weight: 500; text-align: left; }
.act .icon { flex: none; color: #B6BFCA; }
.act:hover:not(:disabled), .act:focus-visible { background: #1F2A38; color: #fff; }
.act.primary { background: var(--lamp); color: #1A222D; font-weight: 600; }
.act.primary .icon { color: #1A222D; }
.act.primary:hover, .act.primary:focus-visible { background: #F6C46C; color: #1A222D; }
.act:disabled { opacity: .45; }
.act-row { display: flex; align-items: center; flex-wrap: wrap; row-gap: 8px; }
.act-row .act.primary { min-width: 164px; }
.act-row .act + .act { margin-left: 17px; }
.act-row .act + .act::before { content: ""; position: absolute; left: -9px; top: 11px; bottom: 11px; width: 1px; background: #2B3746; }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.act-grid .act { min-height: 44px; padding: 8px 14px; border: 1px solid #2B3746; background: #172130; line-height: 1.25; }
.act-grid .act:hover:not(:disabled), .act-grid .act:focus-visible { border-color: #3F4E62; }
.act-grid .act.primary { border-color: var(--lamp); background: var(--lamp); }
.act-grid .act.primary:hover, .act-grid .act.primary:focus-visible { border-color: #F6C46C; background: #F6C46C; }
.act-menu > .act-list:not(:first-child) { border-top: 1px solid #2B3746; }
.act-list { display: flex; flex-direction: column; }
.act-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 52px; padding: 0 6px 0 4px; border: 0; background: none; color: #E6EAF0; text-align: left; font-size: 1rem; border-radius: 0; }
.act-item + .act-item { border-top: 1px solid #2B3746; }
.act-item:hover:not(:disabled), .act-item:focus-visible { background: #1B2532; }
.act-item > .icon:first-child, .act-noicon { flex: none; width: 22px; color: #B6BFCA; }
.act-item > .icon.group-mark:first-child { color: var(--g, #B6BFCA); } /* a word group keeps its own colour */
.act-item > .icon:last-child { flex: none; color: #9AA4B0; }
.act-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.act-title { flex: none; max-width: 75%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-sub { min-width: 0; font-size: .86rem; color: #9AA4B0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-item:disabled { opacity: .5; }
@media (max-width: 760px) {
  .act-row { gap: 8px; }
  .act-row .act.primary { flex: 1 1 100%; justify-content: center; }
  .act-row .act + .act { margin-left: 0; }
  .act-row .act + .act::before { display: none; }
  .act-row .act:not(.primary) { flex: 1 1 0; justify-content: center; padding: 0 10px; border: 1px solid #2B3746; }
  .act-text { flex-direction: column; gap: 0; }
  .act-title { max-width: 100%; }
}
.say-dock:empty, .say-dock > .feedback:empty, .say-dock > .row-actions:not(:has(> :not([hidden]))) { display: none; }
.row-actions.end { justify-content: flex-end; }
.say-dock > .row-actions > .link-btn + .link-btn, .say-dock > .row-actions > .link-btn + .bored, .say-dock > .row-actions > .bored + .link-btn { margin-left: 12px; }
.say-box .bored { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
/* "Ask about this": a small chat about the question, with actions to press */
.say-box .repair { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid #3A4658; border-radius: 12px; background: #172130; color: #EEF0F2; }
.say-box .repair p { margin: 0; line-height: 1.45; }
.say-box .repair-log { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.say-box .repair-log:empty { display: none; }
.say-box .repair-you { align-self: flex-end; max-width: 85%; background: #243142; border-radius: 12px 12px 4px 12px; padding: 6px 12px; }
.say-box .repair-reply { display: flex; flex-direction: column; gap: 8px; max-width: 95%; }
.say-box .repair-error { color: #F2A3A3; }
.say-box .repair-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #3A4658; border-radius: 10px; background: #111923; }
.say-box .repair-action .btn:disabled { opacity: .7; }
.say-box .repair-note { width: 100%; resize: vertical; background: #111923; color: #EEF0F2; border: 1px solid #3A4658; border-radius: 10px; padding: 8px 10px; font: inherit; }
.say-box .repair-changes { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.say-box .repair-changes s { color: #A9B2BE; }
.grow { flex: 1; }

.say-box .choices { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.say-box .choice { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 16px; border-radius: 12px; border: 1px solid #3A4658; background: #172130; color: #EEF0F2; font-size: 1.1rem; }
.say-box .choice .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #34404F; color: #E6EAF0; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.say-box .choice:hover:not(:disabled), .say-box .choice:focus-visible { outline: none; border-color: #4D8FE8; box-shadow: inset 0 0 0 1px #4D8FE8; background: #1B2C44; }
.say-box .choice:hover:not(:disabled) .num, .say-box .choice:focus-visible .num { background: #4D8FE8; color: #fff; }
.say-box .choice.right { border-color: #4CAF7D; box-shadow: inset 0 0 0 1px #4CAF7D; background: #17352A; }
.say-box .choice.right .num { background: #4CAF7D; color: #fff; }
.say-box .choice.wrong { border-color: #E06C6C; box-shadow: inset 0 0 0 1px #E06C6C; background: #3A1D22; }
.say-box .choice.wrong .num { background: #E06C6C; color: #fff; }
.say-box .choice:disabled:not(.right):not(.wrong) { opacity: .55; }

.say-box .answer-row { gap: 12px; }
.say-box .answer { min-height: 58px; padding: 0 18px !important; font-family: var(--f-ui); font-size: 1.25rem !important; background: #172130 !important; color: #EEF0F2 !important; border: 1px solid #3A4658 !important; border-radius: 12px !important; }
.say-box .answer:focus { outline: none; border-color: #4D8FE8 !important; box-shadow: inset 0 0 0 1px #4D8FE8; }
.say-box .answer.right { border-color: #4CAF7D !important; box-shadow: inset 0 0 0 1px #4CAF7D; background: #17352A !important; }
.say-box .answer.wrong { border-color: #E06C6C !important; box-shadow: inset 0 0 0 1px #E06C6C; background: #3A1D22 !important; }
.say-box .answer.close { border-color: var(--lamp) !important; box-shadow: inset 0 0 0 1px var(--lamp); background: #3A3018 !important; }
.say-box .answer-row .btn { min-height: 58px; padding-inline: 28px; border-radius: 12px; font-size: 1.05rem; }
.say-box .example .ex-uk { color: #EEF0F2; }
.say-box .example .ex-en, .say-box .muted { color: #A9B2BE; }
.say-box .rate-row { gap: 12px; }
.say-box .rate { border: 1px solid #3A4658; background: #172130; color: #EEF0F2; border-radius: 12px; padding: 10px 6px; }
.say-box .rate:hover { border-color: #4D8FE8; background: #1B2C44; }
.say-box .rate kbd { color: #A9B2BE; }
.say-box .rate-wait { color: #A9B2BE; }
.say-box .rate.suggested { border-color: #4D8FE8; box-shadow: inset 0 0 0 1px #4D8FE8; background: #1B2C44; }
.mini-list.dark .mini-row { border-bottom-color: #2B3746; }
.mini-list.dark .w-en { color: #A9B2BE; }
.mini-list.dark .dot { border-color: #EEE7DB66; }
.mini-list.dark .dot.l1 { background: linear-gradient(90deg, var(--lamp) 50%, transparent 50%); }
.mini-list.dark .dot.l2 { background: var(--lamp); border-color: var(--lamp); }

/* the top bar over a full stage */
.stage-hud { position: absolute; top: 14px; right: 28px; z-index: 3; }
.stage-hud:empty { display: none; }
/* no bar above the picture, only the few buttons a page needs (End, a lesson's Notes); the board says what's going on */
.stage-buttons { display: flex; gap: 8px; }
.hud-end { flex: none; border: 1px solid #3F4E62; background: #1E2A39; color: #EEF0F2; font-weight: 600; font-size: .95rem; border-radius: 10px; padding: 8px 26px; }
.hud-end:hover { border-color: #5A6B82; background: #243142; }
.hud-end.hud-back { padding: 8px 12px; display: grid; place-items: center; }
.stage-hud:has(> .stage-buttons.left) { left: 28px; right: auto; } /* the way back sits in the other corner */
/* paging through a long list: a page at a time, with a way back */
.pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pager-arrow { display: grid; place-items: center; padding: 6px 10px; }
/* a card's tools: an icon and a short label; the speaker sits at the end of the text it reads */
.tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--lamp); font-size: .86rem; }
.tool-btn:hover, .tool-btn:focus-visible { background: #F1B6531f; }
.speak-btn { width: 28px; height: 28px; color: inherit; opacity: .75; vertical-align: middle; }
.speak-btn:hover, .speak-btn:focus-visible { opacity: 1; background: #F1B6531f; }
.chalk .speak-btn { width: .9em; height: .9em; opacity: .55; }
.chalk .speak-btn svg { width: 100%; height: 100%; }
.say-dock > .row-actions > .tool-btn + .tool-btn, .lesson-tools .tool-btn + .tool-btn { margin-left: 0; }

/* full stage: the classroom fills the view, with the HUD and the dialogue box floating over it */
.view.fullstage { max-width: none; padding: 0; }
.classroom.full { max-width: none; margin: 0; height: 100vh; }
.classroom.full .board-stage { height: 100%; aspect-ratio: auto; border-radius: 0; }
.classroom.full .stage-frame { inset: auto; left: 50%; top: 0; transform: translateX(-50%); width: 100%; aspect-ratio: 3 / 2; }
.classroom.full .board-heading { top: 5%; }
.classroom.full .board-main { top: 17%; bottom: 34%; }
/* the dialogue box: a panel in the bottom-right corner, only as wide as what's in it, not a bar across the whole scene */
.classroom.full .say-box { position: absolute; right: max(24px, 2%); bottom: max(24px, 5%); min-width: min(440px, calc(100% - 48px)); max-width: min(680px, calc(100% - 48px)); z-index: 3; max-height: 58%; overflow-y: auto; padding: 20px 24px 18px; background: #151E2AF5; box-shadow: 0 20px 50px -20px #000d; }

@media (prefers-reduced-motion: reduce) { .daryna-wrap.pop { animation: none; } }
@media (max-width: 760px) {
  .classroom.full { height: auto; }
  .classroom.full .board-stage { height: auto; overflow: visible; background: none; display: flex; flex-direction: column; }
  .classroom.full .stage-frame { position: relative; left: 0; transform: none; width: 100%; }
  .classroom.full .board-main { top: 6%; bottom: 5%; }
  .stage-hud { top: 10px; left: 10px; right: auto; }
  .hud-end { padding: 6px 16px; }
  .classroom.full .say-box { position: relative; right: auto; bottom: auto; width: auto; min-width: 0; max-width: none; margin: 10px 12px 16px; max-height: none; box-shadow: none; }
  .say-line { font-size: 1.12rem; }
  .say-box .choices { grid-template-columns: 1fr; }
  .view.fullstage { padding-bottom: 24px; }
}

/* ---------- settings ---------- */
.settings-group { max-width: 820px; background: #151E2A; border: 1px solid #2B3746; border-radius: 16px; padding: 18px 22px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; }
.group-title { margin: 0; font-family: var(--f-ui); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #AEB6C1; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #222D3A; }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting-text { flex: 1 1 320px; }
.setting h2 { margin: 0 0 2px; font-family: var(--f-ui); font-size: 1rem; font-weight: 600; color: #EEF0F2; }
.setting p { margin: 0; color: #A9B2BE; font-size: .9rem; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.toggle input { width: 18px; height: 18px; accent-color: var(--lamp); }
.volume { display: inline-flex; align-items: center; gap: 12px; color: #A9B2BE; }
.volume input { width: 180px; accent-color: #4D8FE8; padding: 0; background: none; }
.sound-list { display: flex; flex-direction: column; }
.sound-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid #222D3A; }
.sound-row label { color: #DDE2E8; }
.sound-row select { background: #172130; border: 1px solid #3A4658; color: #EEF0F2; border-radius: 10px; padding: 7px 10px; }
.credit { margin: 0; font-size: .8rem; color: #8C96A2; }
@media (max-width: 560px) { .sound-row { grid-template-columns: 1fr auto; } .sound-row label { grid-column: 1 / -1; } }

/* "what do you want to do?" menus in the dialogue box */
.say-box .choices.menu { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.say-box .menu-choice { align-items: center; text-align: left; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-title { font-size: 1.08rem; line-height: 1.25; }
.choice-sub { font-size: .8rem; line-height: 1.3; color: #A9B2BE; overflow: hidden; text-overflow: ellipsis; }
.say-box .menu-choice:first-child:not(:disabled) .num { background: var(--lamp); color: #1A222D; }
.say-box .menu-choice:first-child:hover:not(:disabled) .num, .say-box .menu-choice:first-child:focus-visible .num { background: #4D8FE8; color: #fff; }
.say-box .choices.menu.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .say-box .choices.menu.many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .say-box .choices.menu.many { grid-template-columns: 1fr; } }
.setting-note { margin: 0; padding-top: 10px; border-top: 1px solid #222D3A; color: #A9B2BE; font-size: .9rem; line-height: 1.5; }
.rate-value { color: #A9B2BE; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.sound-row input[type="range"] { accent-color: #4D8FE8; padding: 0; background: none; }

/* ---------- lessons with Daryna ---------- */
.avatar.tutor { background: var(--lamp); color: #1A222D; }
.board-main.rules { gap: .8cqw; }
.board-main.rules .chalk-mid { font-size: 3.8cqw; }
.chalk-rule { font-size: 3.1cqw; font-weight: 600; line-height: 1.2; }
.board-main.dense { gap: .5cqw; }
.board-main.dense .chalk-rule { font-size: 2.6cqw; }
.say-line.plain { font-size: 1.05rem; font-weight: 400; line-height: 1.5; }
.say-you { margin: 0; display: flex; gap: 10px; align-items: baseline; font-size: .95rem; }
.say-you b { flex: none; font-weight: 600; color: #8FB6F0; }
.say-you q { quotes: none; color: #D7DEE8; overflow-wrap: anywhere; }
.beat-row { justify-content: flex-end; align-items: center; gap: 16px; }
.beat-count { color: #A9B2BE; font-size: .9rem; font-variant-numeric: tabular-nums; }
.say-box .beat-row .btn { min-width: 140px; min-height: 48px; font-size: 1.02rem; }
.lesson-tools { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.say-box .lesson-tools .link-btn { font-size: .92rem; }
.thinking-row { justify-content: space-between; align-items: center; }
.thinking-dots { display: inline-flex; gap: 6px; padding-left: 4px; }
.thinking-dots i { width: 8px; height: 8px; border-radius: 50%; background: #A9B2BE; animation: think 1.2s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.lesson-log { position: absolute; z-index: 4; top: 88px; right: max(24px, 4.5%); bottom: 26px; width: min(600px, calc(100% - 48px)); display: flex; flex-direction: column; background: #151E2AF8; border: 1px solid #2B3746; border-radius: 18px; box-shadow: 0 20px 50px -20px #000d; }
.lesson-log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 10px 20px; border-bottom: 1px solid #2B3746; }
.lesson-log-head h2 { margin: 0; font-family: var(--f-ui); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: #BAC2CC; font-weight: 600; }
.lesson-log-head .icon-btn { color: #EEF0F2; }
.lesson-log-list { flex: 1; overflow-y: auto; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.log-you, .log-daryna { display: flex; flex-direction: column; gap: 4px; }
.log-you b, .log-daryna b { font-size: .85rem; font-weight: 600; }
.log-you b { color: #8FB6F0; }
.log-daryna b { color: var(--lamp); }
.lesson-log p { margin: 0; color: #EEF0F2; line-height: 1.45; overflow-wrap: anywhere; }
.log-uk { display: block; font-weight: 600; }
.log-en { display: block; color: #C3CAD3; }
.lesson-log .log-board { font-size: .88rem; color: #A9B2BE; }
.lesson-log .log-board span { color: #F3F0E6; }
.lesson-log .log-empty { color: #A9B2BE; }
@media (prefers-reduced-motion: reduce) { .thinking-dots i { animation: none; opacity: .7; } }
@media (max-width: 760px) {
  .lesson-log { position: fixed; inset: 0; width: auto; border-radius: 0; z-index: 35; background: #151E2A; }
  .say-line.plain { font-size: 1.08rem; }
}
.board-main { transform-origin: 50% 50%; }
/* answer choices: no card stands out, so none looks like the answer */
.say-box .choices.quiz .menu-choice:first-child:not(:disabled) .num { background: #34404F; color: #E6EAF0; }
.say-box .choices.quiz .menu-choice:first-child:hover:not(:disabled) .num, .say-box .choices.quiz .menu-choice:first-child:focus-visible .num { background: #4D8FE8; color: #fff; }
.say-box .choices.quiz .menu-choice { min-height: 54px; }

/* lesson side panel: tabs, and Daryna's study notes */
.log-tabs { display: flex; gap: 4px; }
.log-tab { border: 0; background: none; color: #A9B2BE; font-family: var(--f-ui); font-size: .86rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; border-radius: 10px; }
.log-tab:hover { color: #EEF0F2; }
.log-tab[aria-selected="true"] { background: #243142; color: #EEF0F2; }
.lesson-transcript { display: flex; flex-direction: column; gap: 16px; }
.lesson-notes { display: flex; flex-direction: column; gap: 18px; }
.lesson-notes section { display: flex; flex-direction: column; gap: 10px; }
.lesson-notes h3 { margin: 0; font-family: var(--f-ui); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); font-weight: 600; }
.notes-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.lesson-log .notes-empty p { color: #C3CAD3; }
.notes-doc p { margin: 0; color: #EEF0F2; line-height: 1.45; overflow-wrap: anywhere; }
.notes-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: #A9B2BE; }
.notes-stale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #3A3018; border: 1px solid #6B5526; color: #F3E3BD; font-size: .9rem; }
.lesson-log .notes-summary, .notes-doc .notes-summary { font-size: 1.02rem; line-height: 1.5; }
.note-rule { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #1A2533; border: 1px solid #2B3746; }
.note-rule h4 { margin: 0; font-family: var(--f-ui); font-size: 1rem; font-weight: 600; color: #EEF0F2; }
.lesson-log .note-rule p, .notes-doc .note-rule p { color: #D7DEE8; }
.table-wrap { overflow-x: auto; }
.note-table { border-collapse: collapse; font-size: .95rem; color: #EEF0F2; }
.note-table th, .note-table td { padding: 5px 16px 5px 0; border-bottom: 1px solid #2B3746; text-align: left; vertical-align: top; }
.note-table th { font-size: .8rem; font-weight: 600; color: #A9B2BE; }
.note-table tr:last-child td { border-bottom: 0; }
.note-ex, .note-list, .note-words { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.note-ex li, .note-words li { display: flex; flex-direction: column; }
.note-ex .uk, .note-words .uk { font-weight: 600; color: #EEF0F2; }
.note-ex .en, .note-words .en { font-size: .9rem; color: #A9B2BE; }
.note-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.note-list li { color: #D7DEE8; line-height: 1.45; }
.note-list:not(:has(.note-mistake)) li::before { content: "•"; color: var(--lamp); margin-right: 8px; }
.note-mistake { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid #2B374680; }
.note-mistake:last-child { border-bottom: 0; }
.note-said { color: #F2A3A3; text-decoration-color: #F2A3A399; }
.note-arrow { color: #A9B2BE; }
.note-fix { color: #8FD9B0; font-weight: 600; }
.note-why { font-size: .9rem; color: #A9B2BE; }
mark.hl { background: none; color: #FFE39A; font-weight: 700; }
.note-said mark.hl { color: inherit; }
.copy-buffer { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ---------- the Notes page ---------- */
.notes-page { display: flex; flex-direction: column; gap: 12px; max-width: 920px; }
.notes-card { background: var(--night-2); border: 1px solid #2B3746; border-radius: 14px; overflow: hidden; }
.notes-card.open { border-color: #3A4A5E; }
.notes-card-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: none; border: 0; text-align: left; color: var(--foam); }
.notes-card-head:hover { background: #FFFFFF08; }
.notes-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nc-title { font-family: var(--f-story); font-weight: 700; font-size: 1.25rem; line-height: 1.2; color: #F4F2EE; overflow-wrap: anywhere; }
.nc-meta { font-size: .82rem; color: #A9B2BE; }
.nc-chevron { flex: none; color: #A9B2BE; transition: transform .15s ease; }
.notes-card.open .nc-chevron { transform: rotate(180deg); }
.nc-summary { margin: -4px 0 0; padding: 0 18px 14px; color: #C3CAD3; }
.notes-doc { display: flex; flex-direction: column; gap: 18px; padding: 16px 18px 18px; border-top: 1px solid #2B3746; }
.notes-doc section { display: flex; flex-direction: column; gap: 10px; }
.notes-doc h3 { margin: 0; font-family: var(--f-ui); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); font-weight: 600; }
.notes-card-actions { gap: 8px; }
.notes-none { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; }
.notes-none p { margin: 0; }
.notes-without { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.notes-without h2, .notebook-lede { margin: 0; }
.notes-without h2 { font-family: var(--f-ui); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--foam-dim); font-weight: 600; }
.notes-without ul, .notebook-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notes-without li, .nb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--night-2); border: 1px solid #2B3746; }
.nw-text, .nb-main { min-width: 0; overflow-wrap: anywhere; }
.nb-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nb-text { color: #EEF0F2; line-height: 1.4; }
.nb-row.confirming { border-color: #6B3A3A; background: #2A1F24; flex-wrap: wrap; }
.nb-delete { color: #A9B2BE; }
.nb-delete:hover { color: #F2A3A3; background: #FFFFFF0d; }
.notebook-lede { max-width: 72ch; }
@media (prefers-reduced-motion: reduce) { .nc-chevron { transition: none; } }

/* drills: a short reason, only when asked */
.why { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.why-text { margin: 0; padding: 10px 14px; border-radius: 12px; background: #1A2533; border: 1px solid #2B3746; color: #D7DEE8; line-height: 1.45; }
.say-box .why .row-actions { gap: 16px; }

/* settings: pick one */
.setting-choices { margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid #222D3A; display: flex; flex-direction: column; gap: 8px; }
.setting-choices legend { padding: 0; margin-bottom: 8px; font-weight: 600; color: #EEF0F2; float: left; width: 100%; }
.choice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid #2B3746; background: #172130; cursor: pointer; }
.choice-row.on { border-color: #4D8FE8; box-shadow: inset 0 0 0 1px #4D8FE8; background: #1B2C44; }
.choice-row input { margin-top: 4px; accent-color: #4D8FE8; flex: none; }
.choice-row-text { display: flex; flex-direction: column; gap: 2px; }
.choice-row-text b { font-weight: 600; color: #EEF0F2; }
.choice-row-text span { color: #A9B2BE; font-size: .9rem; line-height: 1.45; }
.say-box .feedback > .link-btn { align-self: flex-start; }

/* drills: pausing listening when you can't play sound */

/* the board's lettering: chalk handwriting, or plain letters for anyone still learning cursive.
   The switch is chalked on the board in the lettering it switches to, beside the date heading (classroom.js places it). */
.board-font { position: absolute; top: 2.5%; right: 1%; z-index: 2; display: grid; place-items: center;
  min-width: clamp(38px, 4.6cqw, 58px); min-height: clamp(30px, 3.4cqw, 44px); padding: 0 8px;
  border: 2px solid #F3F0E633; border-radius: 8px; background: none;
  color: #F3F0E6; text-shadow: 0 0 1px #fff9, 0 0 10px #ffffff22; opacity: .85;
  font-family: var(--f-ui); font-weight: 600; font-size: clamp(14px, 1.7cqw, 22px); line-height: 1; }
.board-font:hover, .board-font:focus-visible { opacity: 1; border-color: #F3F0E6a6; }
.board-print .board-font { font-family: var(--f-hand); font-weight: 700; font-size: clamp(18px, 2.3cqw, 28px); }
.board-print .chalk { font-family: var(--f-ui); font-weight: 500; letter-spacing: .01em; }
.board-print .chalk-big { font-size: 5.4cqw; font-weight: 600; }
.board-print .chalk-mid { font-size: 3.2cqw; }
.board-print .chalk-small { font-size: 2cqw; }
.board-print .chalk-rule { font-size: 2.4cqw; }
.board-print .board-main.dense .chalk-rule { font-size: 2cqw; }
.board-print .board-main.rules .chalk-mid { font-size: 2.9cqw; }
.board-print .board-heading { font-size: 2cqw; }

/* lessons: her Ukrainian words carry their meaning, and the translation can be put away */
.say-w { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: help; }
.say-w:hover, .say-w[aria-expanded="true"] { color: var(--lamp); }
.say-box { position: relative; }
.say-box .gloss, .scene-panel .gloss { position: absolute; z-index: 6; max-width: 260px; }

/* ---------- home: Daryna greets you, and every card shows where it takes you ---------- */
.home-hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; gap: 18px; min-height: 250px; margin-bottom: 18px;
  border-radius: 16px; border: 1px solid #2B3746; background: #16202C url("../art/chalkboard_bg.webp") center / cover; }
.home-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #0F1720F2 0%, #0F1720D9 42%, #0F172066 70%, #0F172033 100%); }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 28px; max-width: 60%; }
.hero-text h1 { margin: 0; font-family: var(--f-story); font-weight: 700; font-size: 2.1rem; line-height: 1.1; color: var(--lamp); }
.hero-text h1 span { display: block; font-weight: 400; font-style: italic; font-size: .95rem; color: var(--foam-dim); margin-top: 4px; }
.hero-line { margin: 6px 0 0; font-family: var(--f-ui); font-weight: 600; font-size: 1.35rem; color: #F4F2EE; }
.hero-en { margin: 0; color: #B9C2CD; max-width: 46ch; }
.hero-art { position: absolute; right: 0; bottom: 0; top: 0; width: 46%; pointer-events: none; }
.hero-art img { position: absolute; right: 2%; top: 0; height: 215%; width: auto; max-width: none; filter: drop-shadow(0 12px 22px #0006); }

.today-card { padding: 0; overflow: hidden; gap: 0; }
.today-art { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #16202C url("../art/chalkboard_bg.webp") center / 190% auto; }
.today-art img { position: absolute; left: 50%; top: 4%; width: 62%; max-width: none; transform: translateX(-50%); }
.today-art.scene img { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; transform: none; }
.today-card.urgent .today-art { background-color: #3A2E14; }
.today-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 18px 18px; flex: 1; }
@media (max-width: 860px) {
  .home-hero { min-height: 210px; }
  .hero-text { max-width: 64%; padding: 20px; }
  .hero-text h1 { font-size: 1.7rem; }
  .hero-line { font-size: 1.15rem; }
}
@media (max-width: 560px) {
  .home-hero { min-height: 260px; align-items: stretch; }
  .hero-text { max-width: 100%; }
  .hero-art { width: 52%; opacity: .85; }
  .hero-art img { top: 0; height: 150%; right: -6%; }
}
.stage-note { margin: 0; font-size: .88rem; line-height: 1.45; color: #A9B2BE; }
.stage-note.bad { color: #F2C0C0; }
/* the icon is punched out of a gold disc, so it never sits blue-on-blue */
.say-box .choice .num.glyph, .say-box .menu-choice:first-child:not(:disabled) .num.glyph { background: var(--lamp); color: #172130; }
.say-box .choice:hover:not(:disabled) .num.glyph, .say-box .choice:focus-visible .num.glyph,
.say-box .menu-choice:first-child:hover:not(:disabled) .num.glyph, .say-box .menu-choice:first-child:focus-visible .num.glyph { background: #F8CD7B; color: #141D29; }
.say-box .choice:disabled .num.glyph { background: #6B7686; color: #1B242F; }

/* ---------- a page that happens somewhere: the place fills the view, the content sits on it ---------- */
.view.scenepage { max-width: none; padding: 0; }
.scene-page { position: relative; height: 100vh; overflow: hidden; }
.scene-art { position: absolute; inset: 0; background-position: 38% 62%; background-size: cover; }
.scene-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0C121866 0%, #0C12182E 26%, #0C1218B3 54%, #0C1218F0 100%); }
.scene-figure { position: absolute; left: -3%; bottom: -5%; height: 80%; width: auto; max-width: none; filter: drop-shadow(0 16px 26px #0007); }
.scene-panel { position: absolute; right: max(18px, 3%); top: 18px; bottom: 18px; width: min(760px, 64%); z-index: 2;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 20px;
  background: #121B26F2; border: 1px solid #2B3746; border-radius: 18px; box-shadow: 0 24px 60px -26px #000; }
.scene-panel .say-head { flex: none; }
.scene-panel .say-line { font-size: 1.3rem; }
.panel-tools { flex: none; display: flex; flex-direction: column; gap: 10px; }
.panel-tools .filter-bar, .panel-tools .head-actions { margin: 0; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.scene-panel .word-list, .scene-panel .notes-page { margin: 0; }
@media (max-width: 1100px) { .scene-panel { width: min(680px, 72%); } .scene-figure { left: -6%; height: 72%; } }
@media (max-width: 860px) {
  .scene-page { height: auto; min-height: 100vh; }
  .scene-art { position: fixed; }
  .scene-figure { display: none; }
  .scene-panel { position: relative; inset: auto; width: auto; margin: 14px 12px; min-height: calc(100vh - 28px); }
}

/* Scene pages: the panel scrolls, so its contents keep their own height instead of
   being squeezed to fit (a clipped list looks like a page that won't scroll). */
.panel-scroll > * { flex: none; }
@media (max-width: 860px) {
  /* narrow: the page itself scrolls, so nothing may be clipped to the viewport */
  .scene-page { overflow: visible; }
  .panel-scroll { overflow: visible; }
}

/* the conversation list shows the person's portrait where there is one */
.avatar.pic { padding: 0; overflow: hidden; background: #1F2C3B; box-shadow: 0 0 0 1px #F1B6532e; }
.avatar.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- the menu button: always in the top-left corner, on every page and at every width ---------- */
.nav-toggle { position: fixed; top: 18px; left: 20px; z-index: 45; width: 40px; height: 40px; border-radius: 10px; background: none; border: 0; color: var(--foam); }
.nav-toggle:hover { background: #1F2A38; }
body.nav-closed .nav-toggle { background: #131B26; border: 1px solid #2B3746; } /* over the page, it needs its own backing */
/* the brand row keeps a spot for the button, and stays put when the sidebar scrolls */
.sidebar { padding-top: 0; }
.sidebar .brand { position: sticky; top: 0; z-index: 1; background: #131B26; padding-top: 16px; padding-left: 58px; padding-right: 8px; gap: 14px; }
@media (min-width: 861px) {
  /* folded: the sidebar is gone and the page takes the full width; only the button stays */
  body.nav-closed .shell { grid-template-columns: minmax(0, 1fr); }
  body.nav-closed .sidebar { display: none; }
  /* nothing sits under the button: ordinary pages step right of it; full-bleed pages keep their art edge to edge and move only their top bar */
  body.nav-closed .view:not(.fullstage):not(.scenepage) { padding-left: 76px; }
}
@media (max-width: 860px) {
  /* the top bar stays above the open menu, so the same button closes it */
  .topbar { min-height: 52px; padding-left: 60px; }
  .nav-toggle { top: 6px; left: 10px; }
  .sidebar { top: 52px; height: auto; }
  .sidebar .brand { position: static; padding-left: 12px; gap: 16px; }
  body.nav-open .scrim { top: 52px; }
}
@media (max-width: 760px) {
  /* the lesson transcript opens full screen here: under the top bar, so the button isn't lost */
  .lesson-log { top: 52px; }
}

/* ---------- XP ---------- */
/* "+N XP" when you earn some */
.xp-pop { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 74px); right: 28px; z-index: 60; background: var(--lamp); color: #1A222D; font-weight: 700; font-size: .95rem; padding: 6px 14px; border-radius: 99px; box-shadow: 0 10px 24px -8px #000c; pointer-events: none; animation: xp-pop 1.5s ease-out forwards; }
.xp-pop.still { animation: xp-fade 1.5s linear forwards; }
@keyframes xp-pop { 0% { opacity: 0; transform: translateY(8px) scale(.92); } 14% { opacity: 1; transform: none; } 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-12px); } }
@keyframes xp-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 860px) { .xp-pop { top: calc(env(safe-area-inset-top, 0px) + 62px); right: 14px; } }

/* the week on the Progress board: one chalk column a day, today in yellow chalk */
.xp-chart { display: flex; flex-direction: column; align-items: center; margin-block: .6cqw; }
.xp-bars { display: flex; align-items: flex-end; gap: 1.4cqw; height: 11cqw; border-bottom: .22cqw solid #F3F0E699; padding-inline: 1cqw; }
.xp-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 4cqw; height: 100%; border-radius: 4px; outline: none; }
.xp-col:focus-visible { box-shadow: 0 0 0 2px var(--lamp); }
.xp-val { font-size: 1.8cqw; line-height: 1.2; opacity: 0; transition: opacity .12s; }
.xp-val.shown, .xp-col:hover .xp-val, .xp-col:focus-visible .xp-val { opacity: 1; }
.xp-bar { width: 2.4cqw; max-height: calc(100% - 2.4cqw); background: #F3F0E6cc; border-radius: 4px 4px 0 0; box-shadow: 0 0 8px #ffffff1f; }
.xp-col.is-today .xp-bar { background: #FFE39A; }
.xp-days { display: flex; gap: 1.4cqw; padding-inline: 1cqw; margin-top: .4cqw; }
.xp-day { width: 4cqw; text-align: center; font-size: 1.7cqw; opacity: .85; }
.xp-day.is-today { color: #FFE39A; opacity: 1; }

/* ---------- phones: the teacher stays inside her picture, and the page's content isn't a card on top of it ---------- */
@media (max-width: 760px) {
  .classroom.full .stage-frame { overflow: hidden; }
  .classroom.full .say-box { margin: 0; padding: 18px 16px 20px; border: 0; border-radius: 0; background: none; }
}
@media (max-width: 860px) {
  .scene-panel { margin: 0; padding: 18px 16px 24px; border: 0; border-radius: 0; box-shadow: none; background: var(--night); min-height: calc(100vh - 52px); }
}
/* a word and the punctuation right after it wrap together */
.say-nw { white-space: nowrap; }

/* ---------- the way in, on the web ---------- */
body.signed-out .sidebar,
body.signed-out .nav-toggle,
body.signed-out .topbar { display: none; }
body.signed-out .shell { grid-template-columns: 1fr; }

.view-signin { display: grid; place-items: center; min-height: 100dvh; padding-block: 32px; }
.signin { width: 100%; max-width: 420px; }
.signin-card {
  background: var(--night-2); border: 1px solid var(--night-3); border-radius: 16px;
  padding: 26px 24px 22px; box-shadow: 0 18px 50px #0006;
}
.signin-card .say-head { margin-bottom: 20px; }
.signin-card .say-line { font-size: 1.15rem; margin: 2px 0 0; }
.signin-en { color: var(--foam-dim); font-style: italic; font-size: .95rem; margin-left: 6px; }

.signin-form { display: grid; gap: 14px; }
.signin-form .field { display: grid; gap: 5px; }
.signin-form .field > span { font-size: .84rem; color: var(--foam-dim); }
.signin-form input {
  width: 100%; padding: 11px 13px; border-radius: 10px; font: inherit;
  background: var(--night); border: 1px solid var(--night-4); color: var(--foam);
}
.signin-form input:focus-visible { border-color: var(--lamp); }
.signin-form .row-actions { margin-top: 2px; }
.signin-form .btn { width: 100%; padding-block: 11px; }

.signin-error {
  margin: 0; padding: 9px 12px; border-radius: 9px; font-size: .9rem;
  background: var(--bad-soft); color: #7A2224;
}
.signin-swap { margin: 2px 0 0; text-align: center; font-size: .9rem; color: var(--foam-dim); }

.signin-aside { margin: -6px 0 0; text-align: right; font-size: .88rem; }
.signin-form [hidden] { display: none; }
