/* Shared components in C's language (docs/design/language.md 7, 8, 10, 12 to 15): buttons with the
   lip, cards and tiled corners, chips, the answer option, question furniture, the rule card, the
   segmented switch, form controls, sheets and dialogs, toasts, states, the step line and step tiles,
   medallions, part emblems, the tile wall, tutor note, feedback card. Only pressable things have a lip. */

/* ================================================================ buttons: the lip (7.2) */
.btn {
  --btn-lip-c: var(--line);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-block-size: var(--btn-h); padding: 0 24px; border-radius: var(--r-btn); border: 0; cursor: pointer;
  font: 700 17px/1.1 var(--f-ui); text-decoration: none; text-align: center; touch-action: manipulation;
  background: var(--card); color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 var(--lip) 0 var(--btn-lip-c);
  transition: transform 80ms var(--ease-out);   /* the press collapse moves; the lip goes at once (transform only, 1.7.4) */
  -webkit-tap-highlight-color: transparent;
}
.btn .ico { inline-size: 20px; block-size: 20px; }
[dir="rtl"] .btn .ico.arrow { transform: scaleX(-1); }
.btn.primary { --btn-lip-c: var(--acc-d); background: var(--acc); color: var(--on-acc); box-shadow: 0 var(--lip) 0 var(--acc-d), var(--shadow-btn); }
.btn.cobalt { --btn-lip-c: var(--btn-cobalt-lip); background: var(--btn-cobalt); color: var(--fix-glaze); box-shadow: 0 var(--lip) 0 var(--btn-cobalt-lip), var(--shadow-btn); }
.btn.onacc { --btn-lip-c: var(--acc-d); background: var(--fix-glaze); color: var(--fix-ink); box-shadow: 0 var(--lip) 0 var(--acc-d), var(--shadow-drop); }
.btn.cream { --btn-lip-c: var(--acc-d); background: var(--fix-glaze); color: var(--fix-ink); box-shadow: 0 var(--lip) 0 var(--acc-d), var(--shadow-drop); }
.btn.ghost-w { --btn-lip-c: var(--wall-ghost-lip); background: var(--wall-chip); color: var(--on-wall); box-shadow: 0 var(--lip) 0 var(--wall-ghost-lip); }
.btn.big { min-block-size: var(--btn-h-big); font-size: 19px; border-radius: var(--r-big); }
.btn.wide { inline-size: 100%; }
.btn.sm { min-block-size: 44px; font-size: 15px; padding: 0 16px; }
@media (hover: hover) { .btn:hover:not([disabled]) { background-image: linear-gradient(var(--hover), var(--hover)); } }
.btn.pressed, .btn:active:not([disabled]) { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--btn-lip-c), inset 0 0 0 1.5px var(--line); }
.btn.primary.pressed, .btn.cobalt.pressed, .btn.onacc.pressed, .btn.cream.pressed, .btn.ghost-w.pressed,
.btn.primary:active, .btn.cobalt:active, .btn.onacc:active, .btn.cream:active, .btn.ghost-w:active { box-shadow: 0 0 0 var(--btn-lip-c); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; box-shadow: inset 0 0 0 1.5px var(--line); cursor: default; transform: none; }
.btn[aria-busy="true"]::after { content: "..."; letter-spacing: .1em; }
.btn-reason { font-size: 14px; color: var(--text-2); }
.kbd { font: 700 12px/1 var(--f-ui); padding: 4px 8px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .8; }
/* a key badge only where a keyboard is likely: a mouse or trackpad, and not after a finger tap (app.js) */
@media (hover: none), (pointer: coarse), (pointer: none) { .kbd { display: none; } }
html[data-input="touch"] .kbd { display: none; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.acts.col { flex-direction: column; align-items: stretch; }
.acts.end { justify-content: flex-end; }

/* the icon button (7.2) */
.ib {
  inline-size: 44px; block-size: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ib-dark); color: inherit; border: 0; cursor: pointer; text-decoration: none;
}
.ib .ico { inline-size: 20px; block-size: 20px; }
.ib.plain { background: transparent; color: var(--text-2); }

/* ================================================================ cards and tiles (7.3) */
.card {
  position: relative; background: var(--card); color: var(--text); border-radius: var(--r); box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding: 16px;
}
.card.flat { box-shadow: none; }
.tiled { padding: 24px; }
.tiled::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--corner); opacity: .9; border-radius: inherit;
  -webkit-mask: url(../img/c/corner.webp) top left / 30px no-repeat, url(../img/c/corner-tr.webp) top right / 30px no-repeat, url(../img/c/corner-br.webp) bottom right / 30px no-repeat, url(../img/c/corner-bl.webp) bottom left / 30px no-repeat;
  mask: url(../img/c/corner.webp) top left / 30px no-repeat, url(../img/c/corner-tr.webp) top right / 30px no-repeat, url(../img/c/corner-br.webp) bottom right / 30px no-repeat, url(../img/c/corner-bl.webp) bottom left / 30px no-repeat;
}
.tiled.small-corners::after { -webkit-mask-size: 18px, 18px, 18px, 18px; mask-size: 18px, 18px, 18px, 18px; }
.tiled.acc-corners { --corner: var(--acc); }
.tiled.amber-corners { --corner: var(--amber-d); }
.tiled.tulip-corners { --corner: var(--tulip); }
.sec { margin-block-start: 24px; }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-block-end: 8px; }
.sec-h h2 { font-size: 22px; }
.brushed { position: relative; display: inline-block; padding-block-end: 8px; }
.brushed::after {
  content: ""; position: absolute; inset-inline: 0 -6px; inset-block-end: -2px; block-size: 9px; background: var(--acc);
  -webkit-mask: url(../img/c/underline.webp) center / 100% 100% no-repeat; mask: url(../img/c/underline.webp) center / 100% 100% no-repeat;
}

/* ================================================================ chips and dots (7.4) */
.pdot { display: inline-block; inline-size: 12px; block-size: 12px; border-radius: 3px; background: var(--acc); box-shadow: 0 2px 0 var(--acc-d); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding-block: 2px; padding-inline: 8px; border-radius: var(--r-sm); font: 700 14px/1.3 var(--f-ui); background: var(--acc-s); color: var(--text); }
.chip .pdot { inline-size: 9px; block-size: 9px; box-shadow: none; }
.nexttag { font: 700 14px/1 var(--f-ui); font-style: normal; color: var(--on-acc); background: var(--acc); padding: 3px 8px; border-radius: var(--r-xs); vertical-align: 3px; margin-inline-start: 8px; }

/* ================================================================ the answer option (7.5) */
.opts { display: grid; gap: 12px; }
.opt {
  --lip: 4px; --opt-lip-c: var(--line);
  position: relative; display: flex; align-items: center; gap: 12px; inline-size: 100%; min-block-size: 56px; padding-block: 8px; padding-inline: 12px;
  border-radius: var(--r-opt); border: 0; text-align: start; font: 400 18px/1.4 var(--f-nl); color: var(--text); cursor: pointer;
  background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line), 0 var(--lip) 0 var(--opt-lip-c);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 80ms var(--ease-out);
}
.opt .l { flex: none; display: grid; place-items: center; inline-size: 30px; block-size: 30px; border-radius: var(--r-sm); background: var(--wash); color: var(--text); font: 800 14px/1 var(--f-ui); }
.opt .l .ico { inline-size: 18px; block-size: 18px; stroke-width: 3; }
.opt .tx { flex: 1; min-inline-size: 0; }
.opt .tag { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1.2 var(--f-ui); white-space: nowrap; }
.opt.pressed { transform: translateY(var(--lip)); box-shadow: inset 0 0 0 1.5px var(--line), 0 0 0 var(--opt-lip-c); }
.opt.sel { box-shadow: inset 0 0 0 2.5px var(--text), 0 var(--lip) 0 var(--text); }
.opt.sel .l { background: var(--text); color: var(--bg); }
.opt.right { background: var(--acc-s); box-shadow: inset 0 0 0 2px var(--acc), 0 var(--lip) 0 var(--acc-d); }
.opt.right .l { background: var(--acc); color: var(--on-acc); animation: pop 420ms var(--ease-stamp) 150ms both; }
.opt.right .tag { color: var(--text); }
.opt.wrong { background: var(--amber); color: var(--text); box-shadow: inset 0 0 0 2px var(--amber-d); transform: translateY(var(--lip)); }
.opt.wrong .l { background: var(--amber-d); color: var(--bg); }
.opt.wrong .tag { color: var(--amber-d); }
.wrongmark { display: inline-block; inline-size: 10px; block-size: 3px; border-radius: 2px; background: currentColor; flex: none; }
/* A dimmed option (not the answer, or struck out by a hint) keeps 4.5:1 (rule zero: all text, whatever
   the size): text-3 on the card, no opacity, and a line through the text says it is out (#175). */
.opt.dim { color: var(--text-3); }
.opt.dim .tx { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.opt.dim .l { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text-3); }
.opt[disabled] { cursor: default; box-shadow: inset 0 0 0 1.5px var(--line); }
.opt.right[disabled] { box-shadow: inset 0 0 0 2px var(--acc); }
.opt.wrong[disabled] { box-shadow: inset 0 0 0 2px var(--amber-d); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: none; } }

/* ================================================================ question furniture (7.6) */
.qcount { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 700 14px/1 var(--f-ui); color: var(--text-3); margin-block: 0 12px; }
.qcount > span { margin-inline-end: 4px; }
.qcount i { inline-size: 22px; block-size: 6px; border-radius: 3px; background: var(--line); }
.qcount i.r { background: var(--acc); }
.qcount i.w { background: var(--amber-d); }
.qcount i.n { background: var(--text); }
.qcount i.a { background: var(--text-3); }
.qnum { display: inline-grid; place-items: center; inline-size: 22px; block-size: 22px; border-radius: 5px; background: var(--btn-cobalt); color: var(--fix-glaze); font: 700 14px/1 var(--f-ui); margin-inline-end: 8px; vertical-align: 2px; }
.stem { font: 600 19px/1.45 var(--f-nl); margin-block-end: 4px; }
.stem-en { font-size: 14.5px; line-height: 1.4; color: var(--text-2); font-style: italic; margin-block-end: 12px; }
mark.where {
  color: inherit; padding: 1px 2px; border-radius: var(--r-xs); background: var(--hl);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  text-decoration: underline 2px solid var(--hl-line); text-underline-offset: 5px;
}
.her { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-block-end: 12px; }
.her s { font: 400 15px/1.3 var(--f-nl); color: var(--text-2); text-decoration-color: var(--amber-d); text-decoration-thickness: 2px; }

/* ================================================================ the rule card (7.7): stops the clock */
.rule { --corner: var(--amber-d); margin-block-start: 12px; animation: rule-in 320ms var(--ease-paper) both; }
.rule .k { display: flex; align-items: center; gap: 8px; font: 700 14px/1.3 var(--f-ui); color: var(--amber-d); }
.rule h3 { font-size: 22px; margin-block: 8px; }
.rule p { font-size: 16px; color: var(--text-2); }
.rule .why { color: var(--text); margin-block-end: 12px; }
.rule .ex { margin-block: 12px; padding: 12px; border-radius: var(--r); background: var(--wash); font: 400 17px/1.5 var(--f-nl); color: var(--text); }
.rule .ex b { font-weight: 600; text-decoration: underline 3px solid var(--acc); text-underline-offset: 4px; }
.rule .was s { font-family: var(--f-nl); text-decoration-color: var(--amber-d); text-decoration-thickness: 2px; color: var(--text); }
.rule .rule-look { margin-block: 12px 0; }
.rule .stopped { display: flex; align-items: center; gap: 8px; font: 700 14px/1.3 var(--f-ui); color: var(--text-3); margin-block: 12px; }
.rule .stopped .ico { inline-size: 20px; block-size: 20px; }
.rule .acts .btn { flex: 1 1 200px; }
@keyframes rule-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ================================================================ segmented switch (7.8) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: var(--r-opt); box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); padding: 3px; gap: 3px; }
.seg button { min-block-size: 44px; border: 0; border-radius: 8px; background: transparent; font: 700 15px/1.2 var(--f-ui); color: var(--text-2); cursor: pointer; padding: 0 12px; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--wash); color: var(--text); }

/* ================================================================ form controls (7.9) */
.field { display: grid; gap: 8px; }
.field > label, .field > .label { font: 700 15px/1.3 var(--f-ui); }
.field .help { font-size: 14px; color: var(--text-2); }
.field .error { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--amber-d); }
.input, .textarea {
  inline-size: 100%; border: 0; border-radius: var(--r-opt); background: var(--card); color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line); padding: 12px; font: 400 17px/1.45 var(--f-ui);
}
.textarea { min-block-size: 110px; resize: vertical; }
.input.nl, .textarea.nl, .textarea[lang="nl"] { font: 400 18px/1.55 var(--f-nl); }
.input:focus, .textarea:focus { box-shadow: inset 0 0 0 2px var(--focus); }
.choices { display: grid; gap: 12px; border: 0; padding: 0; margin: 0; }
.choices legend { font: 700 15px/1.3 var(--f-ui); margin-block-end: 8px; padding: 0; }
.choice {
  --lip: 4px; position: relative; display: flex; align-items: center; gap: 12px; min-block-size: 56px; padding: 8px 12px;
  border-radius: var(--r-opt); background: var(--card); cursor: pointer; font-size: 17px;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 var(--lip) 0 var(--line);
}
.choice input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.choice .mark { flex: none; inline-size: 22px; block-size: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--text-3); display: grid; place-items: center; }
.choice input:checked + .mark { box-shadow: inset 0 0 0 2px var(--text); }
.choice input:checked + .mark::after { content: ""; inline-size: 12px; block-size: 12px; border-radius: 50%; background: var(--text); }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2.5px var(--text), 0 var(--lip) 0 var(--text); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-block-size: 44px; }
.switch input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.switch .track { position: relative; inline-size: 52px; block-size: 32px; border-radius: 16px; background: var(--line); }
.switch .track::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; inline-size: 24px; block-size: 24px; border-radius: 50%; background: var(--fix-glaze); box-shadow: 0 2px 0 var(--fix-ink-3); transition: transform 120ms var(--ease-out); }
.switch input:checked + .track { background: var(--acc); }
.switch input:checked + .track::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch .state { font: 700 15px/1 var(--f-ui); color: var(--text-2); }

/* ================================================================ sheets and dialogs (12) */
.scrim { position: fixed; inset: 0; z-index: var(--z-sheet); background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade-in 320ms var(--ease-out) both; }
.sheet {
  position: relative; inline-size: 100%; max-block-size: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--text); border-start-start-radius: 16px; border-start-end-radius: 16px;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow);
  animation: sheet-up 320ms var(--ease-paper) both;
}
.sheet .grab { inline-size: 36px; block-size: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 8px; }
.sheet-head h2 { font-size: 20px; }
.sheet .ib { background: transparent; color: var(--text-2); }
.sheet-foot { display: grid; gap: 12px; margin-block-start: 16px; }
.scrim.closing { animation: fade-out 200ms ease-in both; }
.scrim.closing .sheet { animation: sheet-down 200ms ease-in both; }
@media (min-width: 900px) {
  .scrim { align-items: center; }
  .sheet { max-inline-size: 520px; border-radius: var(--r-btn); padding: 16px 24px 24px; animation-name: fade-in; }
  .sheet .grab { display: none; }
}
.scrim.dialog { align-items: center; padding: 16px; }
.scrim.dialog .sheet { max-inline-size: 520px; border-radius: var(--r-btn); padding: 16px 24px 24px; animation-name: fade-in; }
.scrim.dialog .grab { display: none; }
body[data-surface="exam"] .scrim, body[data-surface="exam"] .sheet { animation: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes sheet-down { to { transform: translateY(40px); opacity: 0; } }

/* ================================================================ toast (7.10) */
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-inline-size: 520px;
  background: var(--text); color: var(--bg); border-radius: var(--r-opt); padding: 12px 16px; font-size: 15px;
  animation: toast-in 240ms var(--ease-out) both; box-shadow: var(--shadow);
}
.toast button { background: none; border: 0; color: inherit; font: 700 15px/1 var(--f-ui); text-decoration: underline; cursor: pointer; min-block-size: 44px; }
.toast.out { animation: fade-out 160ms ease-in both; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================================================================ states (15) */
.skel { display: grid; gap: 12px; }
.skel .card { display: grid; gap: 12px; }
.skel i { display: block; block-size: 12px; border-radius: 6px; background: var(--line); }
.skel i:nth-child(2) { inline-size: 80%; }
.skel i:nth-child(3) { inline-size: 55%; }
.waitline { font-size: 15px; color: var(--text-2); }
.state { display: grid; gap: 12px; justify-items: start; }
.state p { font-size: 16.5px; }
.state.error { --corner: var(--amber-d); }
.state-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.state .link { min-block-size: 44px; display: inline-flex; align-items: center; }
.state .cub-rest { inline-size: 96px; }
.unglazed { opacity: .72; }
.unglazed img { filter: grayscale(1); opacity: .4; }
.na { font: 700 14px/1.3 var(--f-ui); color: var(--text); }

/* ================================================================ the step line (8.1) */
.stepline { display: grid; gap: 8px; }
.sl-1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 700 15px/1.25 var(--f-ui); }
.sl-1 .part { display: inline-flex; align-items: center; gap: 8px; }
.sl-1 .sep { color: var(--text-3); }
.sl-2 { font-size: 15px; color: var(--text-2); }
.path7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-inline-size: 360px; }
.path7 i {
  position: relative; block-size: 14px; border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-3) 55%, transparent);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text-3) 60%, transparent) 1px, transparent 1.4px);
  background-size: 6px 6px; background-position: 1px 1px;
}
.path7 i.done { background: var(--acc); box-shadow: 0 2px 0 var(--acc-d); }
.path7 i.now { background: var(--acc-s); box-shadow: inset 0 0 0 2px var(--acc), 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
.path7 i.now[style]::after { content: ""; position: absolute; inset: 3px; inset-inline-end: calc(100% - var(--share, 0) * 100% + 3px); border-radius: 2px; background: var(--acc); }
.path7 i.skipped { opacity: .45; }
/* on an accent ground (lead card, room band) every colour switches to glaze */
.on-acc .sl-1, .on-acc .sl-2 { color: inherit; }
.on-acc .sl-1 .sep { color: inherit; opacity: .7; }
.on-acc .pdot { background: var(--on-acc); box-shadow: none; }
.on-acc .path7 i { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-acc) 55%, transparent); background-image: radial-gradient(circle, color-mix(in srgb, var(--on-acc) 60%, transparent) 1px, transparent 1.4px); }
.on-acc .path7 i.done { background: var(--on-acc); box-shadow: 0 2px 0 var(--acc-d); }
.on-acc .path7 i.now { background: color-mix(in srgb, var(--on-acc) 25%, transparent); box-shadow: inset 0 0 0 2px var(--on-acc); }
.on-acc .path7 i.now::after { background: var(--on-acc); }

/* ================================================================ step tiles (8.2) */
.steps { list-style: none; display: grid; position: relative; }
.st { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding-block: 8px; }
.st::before { content: ""; position: absolute; inset-inline-start: 31px; inset-block: 0; inline-size: 2px; background: var(--line); }
.st:first-child::before { inset-block-start: 50%; }
.st:last-child::before { inset-block-end: 50%; }
.st.done::before { background: var(--acc); }
.stile {
  position: relative; z-index: 1; inline-size: 64px; block-size: 64px; border-radius: var(--r-sm); display: grid; place-items: center;
  font: 800 26px/1 var(--f-d); background: var(--card); color: var(--text-3);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-3) 45%, transparent);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text-3) 45%, transparent) 1px, transparent 1.5px); background-size: 7px 7px;
}
.st.done .stile { background: var(--acc); color: var(--on-acc); box-shadow: 0 4px 0 var(--acc-d); }
.st.done .stile::after, .st.now .stile::after {
  content: ""; position: absolute; inset: 0; background: currentColor; opacity: .5;
  -webkit-mask: url(../img/c/corner.webp) top left / 18px no-repeat, url(../img/c/corner-tr.webp) top right / 18px no-repeat, url(../img/c/corner-br.webp) bottom right / 18px no-repeat, url(../img/c/corner-bl.webp) bottom left / 18px no-repeat;
  mask: url(../img/c/corner.webp) top left / 18px no-repeat, url(../img/c/corner-tr.webp) top right / 18px no-repeat, url(../img/c/corner-br.webp) bottom right / 18px no-repeat, url(../img/c/corner-bl.webp) bottom left / 18px no-repeat;
}
.st.now .stile { background: var(--fix-glaze); color: var(--fix-ink); box-shadow: inset 0 0 0 3px var(--acc), 0 4px 0 var(--acc-d), 0 0 0 6px color-mix(in srgb, var(--acc) 22%, transparent); }
.st .t b { display: block; font: 700 18px/1.2 var(--f-d); }
.st .t span { font-size: 14px; color: var(--text-2); }
.st.ahead .t b { color: var(--text-2); }
.nowcard { --corner: var(--acc); margin-block: 8px 12px; margin-inline-start: 78px; }
.nowcard h3 { font-size: 18px; margin-block-end: 4px; }
.checks { list-style: none; margin-block-start: 12px; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; font-size: 15px; }
.ck { inline-size: 28px; block-size: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--acc-s); }
.ck i { inline-size: 16px; block-size: 14px; background: var(--acc-icon); -webkit-mask: url(../img/c/tick.webp) center / contain no-repeat; mask: url(../img/c/tick.webp) center / contain no-repeat; }
.ck.no { background: var(--amber); }
.ck.no i { background: var(--amber-d); -webkit-mask: none; mask: none; inline-size: 10px; block-size: 3px; border-radius: 2px; }
.ck.todo { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.ck.todo i { display: none; }
/* the value says its unit ("1 of 3 blocks"), so it goes under the line it measures, never squeezing it */
.checks .v { grid-column: 2 / -1; font: 700 14px/1.3 var(--f-ui); color: var(--text-2); }
.checks .v:empty { display: none; }

/* ================================================================ game medallion (1.6, 10.1) */
/* A glaze disc with the game's emblem (img/games/emblems.svg, one <use>) as one silhouette in its
   room's --room-mark (the [data-room] tokens: at least 4.5:1 on the disc in light and dark, checked by
   tools/check-emblems.mjs). The emblem's marks (--em-g) take the disc's colour, so they read as holes.
   A ring and a lip in the room's colours carry the identity; no filter. */
/* A game's name (decision 0021, #760): the Dutch name keeps the font of the heading or row it is in
   (it is marked lang="nl" for its order on an Arabic screen, ADR 0019), and its meaning in the screen
   language sits on its own line under it, in a row, a tile and a screen title alike (#780). In a row or
   tile each takes at most 2 lines, then it is clamped, so every tile keeps one size. */
.gname[lang="nl"] { font-family: inherit; }
.gname-l, .gname-mean { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.gname-l { font-size: inherit; color: inherit; }
[dir="rtl"] .gname-l { text-align: end; }
/* the name in the screen language alone (#791): it reads in its own direction, from its start */
.gname-own, [dir="rtl"] .gname-l.gname-own { text-align: start; }
.gname-mean { font-family: var(--f-ui); font-weight: 500; font-size: 0.875em; line-height: 1.3; }
.hall-row .gname-mean, .today-t .gname-mean, .today-tg-name .gname-mean, .words-game-name .gname-mean { color: var(--text-2); }
.gname-sub { display: block; font: 600 16px/1.3 var(--f-ui); margin-block-start: 4px; }
.end-top .gname-sub { font-size: 14px; margin-block-start: 0; }

.gmed {
  --size: 62px; --em-g: var(--fix-glaze); position: relative; flex: none; inline-size: var(--size); block-size: var(--size); border-radius: 50%;
  display: grid; place-items: center; background: var(--fix-glaze); color: var(--room-mark, var(--fix-ink));
  box-shadow: 0 0 0 2px var(--room, var(--deep)), 0 4px 0 2px var(--room-2, var(--wall-lip));
}
.gmed svg { inline-size: 64%; block-size: 64%; overflow: visible; }
.gmed .tk { position: absolute; inset-block-start: -2px; inset-inline-start: -2px; inline-size: 20px; block-size: 20px; border-radius: 50%; background: var(--room-mark, var(--fix-ink)); box-shadow: 0 0 0 2px var(--fix-glaze); display: grid; place-items: center; }
.gmed .tk i { inline-size: 13px; block-size: 11px; background: var(--fix-glaze); -webkit-mask: url(../img/c/tick.webp) center / contain no-repeat; mask: url(../img/c/tick.webp) center / contain no-repeat; }
.gmed .newdot { position: absolute; inset-block-start: 0; inset-inline-end: 0; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tulip); box-shadow: 0 0 0 2px var(--fix-glaze); }
.gmed.off { color: var(--fix-ink-3); box-shadow: 0 0 0 2px var(--line); }
.gmed.off svg { opacity: .4; }

/* The giant wall shape (1.6): the same symbol in two tones, --room-2 with its marks in --room-3; its
   gaps take the wall. Decoration only, never behind text; the engine places it (#333). */
.gwall-em { --em-a: var(--room-2); --em-d: var(--room-3); --em-g: var(--room); display: block; inline-size: 280px; block-size: 330px; pointer-events: none; }
.gwall-em svg { inline-size: 100%; block-size: 100%; }
@media (min-width: 900px) { .gwall-em { inline-size: 380px; block-size: 440px; } }

/* part emblem on a glaze tile with corners (10.2) */
.pem {
  --size: 56px; position: relative; flex: none; inline-size: var(--size); block-size: var(--size); border-radius: var(--r-sm);
  background: var(--fix-glaze); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--joint), 0 3px 0 var(--joint);
}
.pem img { inline-size: 84%; block-size: 84%; object-fit: contain; }
.pem.off img { filter: grayscale(1); opacity: .4; }

/* ================================================================ the tile wall (9.8) */
.tilewall { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r-xs); overflow: hidden; box-shadow: 0 0 0 1px var(--joint), var(--shadow); background: var(--joint); }
@media (min-width: 900px) { .tilewall { grid-template-columns: repeat(6, 1fr); } }
.tw { position: relative; aspect-ratio: 1; box-shadow: inset 0 0 0 .5px var(--joint); background: var(--fix-glaze-lo); border: 0; padding: 0; cursor: pointer; }
.tw img { inline-size: 100%; block-size: 100%; }
.tw .lbl { position: absolute; inset-inline: 6px; inset-block-end: 6px; display: flex; justify-content: center; }
/* the caption is the only words that say what a tile is: 14 px, the floor for text she reads (rule zero) */
.tw .lbl span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-xs); font: 700 14px/1.2 var(--f-ui); background: color-mix(in srgb, var(--fix-glaze) 90%, transparent); color: var(--fix-ink); box-shadow: inset 0 0 0 1px var(--joint); text-align: center; }
.tw .lbl span::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 2px; background: var(--acc); flex: none; }
.tw.locked .lbl span { color: var(--fix-ink-2); }   /* the glaze plate stays: words never sit on the drawing (rule zero) */
.tw.locked .lbl span::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fix-ink-3); }
.tw.new::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 4px var(--tulip); pointer-events: none; }
.tw .newtag { position: absolute; inset-block-start: 8px; inset-inline-start: 50%; transform: translateX(-50%) rotate(-3deg); padding: 4px 8px; border-radius: var(--r-xs); background: var(--tulip); color: var(--on-tulip); font: 800 14px/1 var(--f-ui); box-shadow: 0 3px 0 var(--tulip-deep); }

/* ================================================================ the tutor note with the cub (7.10, 17) */
.tutor { display: grid; gap: 12px; padding: 16px; }
.tutor .who { display: flex; align-items: center; gap: 8px; font: 700 14px/1 var(--f-ui); color: var(--text-3); }
.tutor .who img { inline-size: 30px; block-size: 30px; border-radius: var(--r-xs); }
/* her mark: the small figure (under 48 px: the brand, the tutor line, a note's host) is cobalt ink with no
   ground of its own, so it stands on a glaze plate like the badge; on the dark theme it was lost (#276) */
img.cub-head { background-color: var(--fix-glaze); }
.tutor p { font-size: 16.5px; }
.tutor.pose { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
/* Lale Off (character.md 4.5, #441): no badge and no speaker name; the line shows as a plain system line */
html[data-cub="off"] .tutor .who { display: none; }
html[data-cub="off"] .tutor.pose { grid-template-columns: minmax(0, 1fr); }
.cubp { display: grid; place-items: end center; background: var(--fix-glaze); border-radius: 48% 52% 44% 56% / 54% 48% 52% 46%; padding: 4px 8px; box-shadow: 0 5px 0 var(--acc-d); }
.cubp img { inline-size: 100%; block-size: 100%; object-fit: contain; }
/* the mark fades in with an intro note (core/cub.js cubMark; fade only, 3.6) */
.cub-mark-in { animation: cub-mark-fade 240ms var(--ease-paper) both; }
@keyframes cub-mark-fade { from { opacity: 0; } to { opacity: 1; } }
html[data-less-motion] .cub-mark-in, body[data-surface="exam"] .cub-mark-in { animation: none; }
@media (prefers-reduced-motion: reduce) { .cub-mark-in { animation: none; } }

/* ================================================================ Lale (character.md 3, 4; ADR 0016; docs/design/lale1/app-assets.md)
   core/cub.js draws her: .cub > .cub-fig > the still (.cub-pic) and, where a move plays, its patch box
   (.cub-mvb, at the move's patch of the 240 x 264 canvas) holding the strip (.cub-mv, its frames side by
   side). The strip is decoded before it shows; then the patch is cut out of the still (inline clip-path)
   and the strip steps through its frames once with the move's keyframes (css/cub-moves.css: transform in
   steps, on the compositor) and holds its last frame. Nothing loops (Tom, 2026-10-28). */
.cub { position: relative; display: inline-block; vertical-align: bottom; }
button.cub { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.cub:not(.cubp) { border-radius: var(--r-sm); }
button.cub:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; }
/* the figure's box keeps the canvas's own left-to-right coordinates (the patch's place); RTL mirrors the whole figure */
/* contain: what changes inside her figure (the cut still, the strip, the end still swapped in) lays out and
   paints only her box, never the page around her */
.cub-fig { position: relative; display: block; inline-size: 100%; aspect-ratio: 240 / 264; direction: ltr; contain: layout paint; }
.cub-fig > img.cub-pic { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
[dir="rtl"] .cub-fig { scale: -1 1; }
.cub-mvb { position: absolute; overflow: hidden; visibility: hidden; contain: strict; }
.cub-on .cub-mvb { visibility: visible; }
.cub .cub-fig .cub-mv { position: absolute; inset-block-start: 0; max-inline-size: none; block-size: 100%; object-fit: fill; }
html[data-cub="off"] .cub-any { display: none !important; }
/* the dark theme: where she stands with no plaque or glaze tile of her own (the pause card), her cobalt ink
   gets the plaque's glaze shape behind her (#276); on a glaze tile it is the same colour and does not show */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cub-any:not(.cubp) .cub-fig { background: var(--fix-glaze); border-radius: 48% 52% 44% 56% / 54% 48% 52% 46%; }
}
:root[data-theme="dark"] .cub-any:not(.cubp) .cub-fig { background: var(--fix-glaze); border-radius: 48% 52% 44% 56% / 54% 48% 52% 46%; }
/* Lale's one line: her Dutch with the English beside it, always visible (language.md 1.11) */
.lale-say { display: grid; gap: 2px; justify-items: start; margin: 0; text-align: start; }
.lale-say .lale-nl { font: 400 17px/1.35 var(--f-nl); color: var(--text); }
.lale-say .lale-en { font-size: 15px; line-height: 1.35; color: var(--text-2); }
/* a paired line in the screen language keeps the interface font in the large place too (#785, i18n.js pairHtml) */
:root [data-pair="own"] { font-family: var(--f-ui); }
/* her line with a Dutch idiom: the info button beside it, a 44 px target round a small "i" (#857, core/idiom.js) */
.lale-say.has-idiom { grid-template-columns: minmax(0, 1fr) 44px; column-gap: 4px; }
.lale-say.has-idiom > [data-pair] { grid-column: 1; }
.lale-say.has-idiom > .idiom-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.idiom-btn {
  inline-size: 44px; block-size: 44px; display: inline-grid; place-items: center; flex: none; padding: 0;
  background: transparent; border: 0; border-radius: 50%; color: inherit; cursor: pointer;
}
.idiom-i {
  inline-size: 24px; block-size: 24px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid currentColor; font: 700 italic 14px/1 var(--f-nl); opacity: .8;
}
.idiom-btn:hover .idiom-i, .idiom-btn:focus-visible .idiom-i { opacity: 1; background: var(--ib-dark); }
/* the card: the Dutch idiom large, then word for word, what it means and the example */
.idiom-card { display: grid; gap: 4px; max-inline-size: 44ch; }
.idiom-phrase { font: 400 21px/1.3 var(--f-nl); color: var(--text); margin: 0 0 8px; }
.idiom-h { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 8px 0 0; }
.idiom-p, .idiom-ex { margin: 0; line-height: 1.45; }
.idiom-ex { display: grid; gap: 2px; }
.idiom-ex .idiom-ex-nl { font: 400 17px/1.4 var(--f-nl); }
.idiom-ex .idiom-ex-own { color: var(--text-2); font-size: 15px; }

/* enter (340 ms, 1.4 x v2's 240): she fades in and rises 4 px; the only move with no strip */
.cub-mo-enter .cub-fig { animation: cub-enter 340ms var(--ease-paper) both; }
/* a move's end still fades in over its held last frame (core/cub.js swapStill, #276): the same drawing,
   coded apart, so a swap in one frame showed the grain change */
.cub-fig > img.cub-pic-in { animation: cub-pic-in 180ms linear both; }
@keyframes cub-pic-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cub-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* she stands still: reduced motion, Less movement, the exam surface (cub.js draws the end-state still;
   these hold if a mode changes while she is on screen) */
html[data-less-motion] .cub *, body[data-surface="exam"] .cub * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cub * { animation: none !important; transition: none !important; }
}

/* ================================================================ feedback card (end screen, walkthrough) */
.fb { display: grid; gap: 8px; }
.fb .q { font: 600 18px/1.45 var(--f-nl); }
.fb .lab { display: flex; align-items: center; gap: 8px; font: 700 14px/1.3 var(--f-ui); }
.fb .yours { color: var(--amber-d); }
.fb .yours + p s { text-decoration-color: var(--amber-d); text-decoration-thickness: 2px; }
.fb .ans { font: 400 18px/1.4 var(--f-nl); padding: 8px 12px; border-radius: var(--r-opt); }
.fb .ans.w { background: var(--amber); }
.fb .ans.r { background: var(--acc-s); }
.fb .tickm { display: inline-block; inline-size: 14px; block-size: 12px; background: currentColor; -webkit-mask: url(../img/c/tick.webp) center / contain no-repeat; mask: url(../img/c/tick.webp) center / contain no-repeat; }
.fb .whyl { font-size: 15.5px; color: var(--text-2); }

/* ================================================================ small parts (7.10) */
.time-note { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text-2); }
.time-note .ico { color: var(--text); }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word { display: inline-grid; padding: 8px 12px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 0 var(--line); border: 0; text-align: start; cursor: pointer; }
.word b { font: 600 18px/1.3 var(--f-nl); }
.word span { font-size: 14px; color: var(--text-2); }
.tags { display: grid; gap: 12px; }
.tagrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.tagrow .n b { font: 600 16px/1.25 var(--f-nl); display: block; }
.tagrow .n span { font-size: 14px; color: var(--text-2); }
.tagrow .v { font: 700 15px/1 var(--f-ui); white-space: nowrap; }
.tagrow .meter { grid-column: 1 / -1; display: flex; gap: 3px; }
.tagrow .meter i { flex: 1; block-size: 8px; border-radius: 2px; background: var(--line); }
.tagrow .meter i.r { background: var(--acc); }
.tagrow .meter i.w { background: var(--amber-d); opacity: .7; }

/* the report sheet (12, issue 177): Send stays in sight in a sticky foot, also on a short screen (under 600 px high) */
.report-kinds .choice { min-block-size: 48px; scroll-margin-block: 8px calc(88px + env(safe-area-inset-bottom, 0px)); }
/* the sheet scrolls a focused reason (or the note) clear of the sticky foot, not under it */
.sheet:has(.report-form) { scroll-padding-block-end: calc(88px + env(safe-area-inset-bottom, 0px)); }
.report-about { margin-block: -4px 12px; }
.report-form .field textarea { min-block-size: 64px; }
.report-form .field .small { margin-block-start: 4px; scroll-margin-block-end: 96px; }
.report-foot {
  position: sticky; inset-block-end: calc(-24px - env(safe-area-inset-bottom, 0px)); z-index: 1;
  margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--card); box-shadow: 0 -1px 0 var(--line);
}
@media (max-height: 600px) {
  .report-kinds { gap: 8px; }
  .report-kinds .choice { min-block-size: 44px; padding-block: 8px; }
}
@media (min-width: 900px) {
  .report-foot { inset-block-end: -24px; margin-inline: -24px; padding-inline: 24px; }
}

/* "How this app is made" and the AI label (core/about.js, ADR 0008) */
.about { display: grid; gap: 12px; max-inline-size: 64ch; }
.about-sec h2 { font-size: 20px; margin-block-end: 8px; }
.about-sec p { margin: 0; }
.about-sec p + p { margin-block-start: 8px; }
/* "About Lale" (#370): the story in Dutch with the English beside it, stacked on a phone */
.about-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 16px; }
.about-two .about-lang { margin-block-end: 4px; }
.about-two .about-lang + p { margin-block-start: 0; }
.about-lale-set { margin-block-start: 12px; padding: 0; list-style: none; }
.about-lale-set .today-srow-in { padding-inline: 0; }
.ai-note { margin-block: 8px 0; }
/* the AI tile beside Play (core/about.js aiTile, ADR 0008, #213): the EU icon on a small Delft-blue tile,
   quieter than Play (no lip), a fixed size so nothing moves when it loads, and a 44 px target (the ::after);
   the mini tile in the first line and the sheet is a picture of it */
.ai-tile {
  position: relative; flex: none; display: inline-grid; place-items: center; inline-size: 64px; block-size: 36px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: var(--ai-tile); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ai-tile::after { content: ""; position: absolute; inset: -4px -2px; }
.ai-tile:active { transform: translateY(1px); }
.ai-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ai-tile-icon { display: block; inline-size: 54px; block-size: auto; pointer-events: none; }
.ai-tile-mini { inline-size: 56px; block-size: 30px; flex: none; cursor: default; vertical-align: middle; }
.ai-tile-mini::after { content: none; }
.ai-tile-mini .ai-tile-icon { inline-size: 46px; }
.ai-first, .ai-sheet-mark { display: flex; align-items: center; gap: 12px; margin-block: 12px 0; color: var(--text-2); }
.ai-sheet { display: grid; gap: 12px; }
.ai-sheet:focus { outline: none; }
.ai-sheet p { margin: 0; }

/* ---- the word sheet and word taps (language.md 12, #186; core/lookup.js): a dictionary entry for
   any Dutch word of a text, task or game card. Fits 390 x 844 and 360 x 800 with Add to my words in view. */
.lezen-w { cursor: pointer; border-radius: 3px; }
.lezen-w:hover { background: var(--wash); }
.lezen-w:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.lezen-sheet { display: grid; gap: 4px; }
.lezen-word { font: 600 22px/1.25 var(--f-nl); }
.lookup-entry { font: 400 17px/1.35 var(--f-nl); color: var(--text-2); }
.lezen-mean { font-size: 17px; color: var(--text); margin-block-end: 4px; }
.lookup-here { font-size: 15px; color: var(--text); }
.lezen-from { font: 400 16px/1.45 var(--f-nl); padding: 8px 12px; border-radius: var(--r); background: var(--wash);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.lookup-sheet .sheet-foot { margin-block-start: 12px; }
@media (max-height: 520px) {
  .lookup-sheet .lezen-from { -webkit-line-clamp: 2; line-clamp: 2; }
}
.lang-note { margin-block-start: 12px; }
/* each language in its own name, in the screen face (not the Dutch reading face) */
.lang-choice [lang] { font-family: inherit; }
.lang-q { padding: 0; margin-block-end: 8px; font: 600 15px/1.3 var(--f-ui); color: var(--text); }
