/* Study Quest — css/study.css (V8 piece A, builder "view"; docs/V8-PLAN.md §1.1 "Lamplit + Vellum")
 * The readable study look, from the fusion research's mocks (work/v8/research/mocks/study.css + cards.html, the visual
 * spec): flashcard mode's own view on the game's cards ("the lectern", js/ui-study.js). (The deck window, the study chip
 * and the Deck tab were retired in V7.2.4, LATE-REQUESTS R12.)
 *   - Ember & Iron's frame (an iron band, a bronze hairline, thorned corners, one title plate) around a FLAT page: no
 *     texture, no gradient, no image behind text (DESIGN.md amendment, rule 6: parchment allowed on study pages).
 *   - macOS faces, nothing fetched (amendment, rule 9): Iowan Old Style (Charter, New York as comfort choices) for card
 *     text, Avenir Next for small meta, STIX Two Math for the MathML formulas (amendment, rule 5).
 *   - Sizes: question 30 px, answer 24 px, Extra Card Detail 19 px, meta 14 px; 26 / 21 / 17 / 13 below 860 px tall;
 *     compact (480x360): 20 / 17. Comfort size S / M / L scales them.
 *   - The rating plates sit at the same y in every state: the card area takes the free height and scrolls a long answer.
 * Tokens are --st-* on .st-root (the page theme is data-page on that element: lamplit | vellum), never on :root, so no
 * other screen changes.
 */

/* ------------------------------------------------------------------------------------------------ tokens */
.st-root {
  --st-read: "Iowan Old Style", Charter, Palatino, Georgia, serif;
  --st-ui: "Avenir Next", Avenir, "Helvetica Neue", system-ui, sans-serif;
  --st-math: "STIX Two Math", math;
  --st-q: 30px; --st-q-lh: 1.32;
  --st-a: 24px; --st-a-lh: 1.5;
  --st-x: 19px; --st-x-lh: 1.55;
  --st-meta-size: 14px;
  --st-iron: #1e1d1b;
  --st-iron-line: #3b3832;
  --st-bronze: #7a5229;
  --st-ember: #ff8a3d;
  --st-ember-deep: #e2541f;
  /* Lamplit (default): flat warm charcoal */
  --st-page: #1b1814;
  --st-page-2: #221e19;
  --st-text: #e8e1d3;
  --st-text-2: #c2baab;
  --st-meta: #a39c8f;
  --st-rule: #3a342c;
  --st-cloze: #f2d08e;
  --st-cloze-bg: rgba(255, 138, 61, .09);
  --st-good: #8fc2b3; --st-good-edge: #5f9a8a; --st-good-bg: rgba(95, 154, 138, .12);
  --st-bad: #ef7452; --st-bad-edge: #b53a24; --st-bad-bg: rgba(181, 58, 36, .13);
  --st-r1: #b53a24; --st-r2: #c9822e; --st-r3: #5f9a8a; --st-r4: #5b7fb8;
  --st-plate: #24201b; --st-plate-text: #e8e1d3;
  --st-kbd-bg: #2e2a24; --st-kbd-text: #e8e1d3;
  --st-hot: var(--st-ember);
  --st-hot-edge: rgba(255, 138, 61, .45);
}
.st-root[data-page="vellum"] {
  --st-page: #f4ecdb;
  --st-page-2: #ece2cc;
  --st-text: #211a12;
  --st-text-2: #4e4031;
  --st-meta: #625240;
  --st-rule: #d2c19f;
  --st-cloze: #7a1d10;
  --st-cloze-bg: rgba(226, 84, 31, .08);
  --st-good: #1f5e4f; --st-good-edge: #2f7a68; --st-good-bg: rgba(47, 122, 104, .10);
  --st-bad: #8a2414; --st-bad-edge: #a8321e; --st-bad-bg: rgba(168, 50, 30, .08);
  --st-r1: #a8321e; --st-r2: #b06a12; --st-r3: #2f7a68; --st-r4: #2f5a9a;
  --st-plate: #ebe0c8; --st-plate-text: #211a12;
  --st-kbd-bg: #dcccaa; --st-kbd-text: #211a12;
  --st-hot: #9a3a12;
  --st-hot-edge: rgba(154, 58, 18, .45);
}
.st-root[data-face="charter"] { --st-read: Charter, "Iowan Old Style", Palatino, Georgia, serif; }
.st-root[data-face="newyork"] { --st-read: "New York", ui-serif, "Iowan Old Style", Georgia, serif; }
.st-root[data-size="S"] { --st-q: 26px; --st-a: 21px; --st-x: 17px; }
.st-root[data-size="L"] { --st-q: 34px; --st-a: 27px; --st-x: 21px; }
@media (max-height: 860px) {
  .st-root { --st-q: 26px; --st-a: 21px; --st-x: 17px; --st-meta-size: 13px; }
  .st-root[data-size="S"] { --st-q: 23px; --st-a: 19px; --st-x: 15px; }
  .st-root[data-size="L"] { --st-q: 29px; --st-a: 24px; --st-x: 19px; }
}

/* ------------------------------------------------------------------------------------------------ the layer */
.st-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.st-layer.hidden { display: none; }
body.qc-open .st-layer { display: none; }          /* the quest card (Q) takes the digits: the lectern steps aside */
/* the scene dims behind the lectern (the chat, the tracker and the XP bar stay readable around it: the kill, the XP);
   the XP bar under the lectern is never covered */
.st-dim { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--xp-h, 17px) + var(--xp-bottom, 5px) + 3px); background: rgba(8, 7, 6, .68); pointer-events: none; }
.st-root[data-page="vellum"] .st-dim { background: rgba(8, 7, 6, .74); }

/* ------------------------------------------------------------------------------------------------ the lectern */
.st-lectern {
  position: absolute; left: 50%; top: 60px; bottom: calc(var(--xp-h, 17px) + var(--xp-bottom, 5px) + 14px);
  width: min(1000px, calc(100vw - 40px)); transform: translateX(-50%);   /* V7.2.4 (A2): the bigger practice window (was 820 px) */
  display: flex; flex-direction: column; pointer-events: auto;
  font-family: var(--st-read); color: var(--st-text); -webkit-font-smoothing: antialiased;
  background: var(--st-page);
  border: 6px solid var(--st-iron); border-radius: 3px;
  box-shadow: 0 0 0 1px #050505, inset 0 0 0 1px var(--st-bronze), 0 24px 70px rgba(0, 0, 0, .65);
  text-align: left; letter-spacing: normal;
}
.st-root[data-page="vellum"] .st-lectern { box-shadow: 0 0 0 1px #050505, inset 0 0 0 1px var(--st-bronze), inset 0 0 40px rgba(110, 70, 20, .10), 0 24px 70px rgba(0, 0, 0, .65); }
.st-lectern::before, .st-lectern::after { content: ""; position: absolute; width: 34px; height: 34px; pointer-events: none; z-index: 3; }
.st-lectern::before { left: -11px; top: -11px; background: var(--cx-orn-corner-tl) left top / 34px 34px no-repeat; }
.st-lectern::after { right: -11px; top: -11px; background: var(--cx-orn-corner-tr) right top / 34px 34px no-repeat; }
.st-corner-b { position: absolute; left: -11px; right: -11px; bottom: -11px; height: 34px; pointer-events: none; z-index: 3;
  background: var(--cx-orn-corner-bl) left bottom / 34px 34px no-repeat, var(--cx-orn-corner-br) right bottom / 34px 34px no-repeat; }
.st-plate { position: absolute; top: -21px; left: 50%; transform: translateX(-50%); z-index: 4; white-space: nowrap; }

/* small type */
.st-meta { font: 500 var(--st-meta-size)/1.35 var(--st-ui); color: var(--st-meta); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.st-tag { display: inline-block; font: 600 12px/1 var(--st-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--st-meta);
  border: 1px solid var(--st-rule); border-radius: 2px; padding: 5px 7px 4px; margin-left: 6px; }
.st-tag--hot { color: var(--st-hot); border-color: var(--st-hot-edge); }
.st-kbd { display: inline-block; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 3px; text-align: center;
  font: 700 13px/22px var(--st-ui); color: var(--st-kbd-text); background: var(--st-kbd-bg);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .35); vertical-align: 1px; }
.st-lectern .st-src { font: 600 12px/1 var(--st-ui); letter-spacing: .04em; color: var(--st-text-2); background: transparent; cursor: pointer;
  border: 1px solid var(--st-rule); border-radius: 2px; padding: 5px 8px 4px; margin-left: 6px; }
.st-lectern .st-src::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; transform: rotate(45deg); background: var(--st-good-edge); vertical-align: 1px; }
.st-lectern .st-src:hover { color: var(--st-text); border-color: var(--st-bronze); }

/* the head: the trail, the tags, today's count */
.st-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 40px 0; flex: none; }
.st-crumb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 3px; }
.st-crumb b { color: var(--st-text-2); font-weight: 600; }
.st-tags { flex: none; white-space: nowrap; }
.st-progress { margin: 14px 40px 0; display: flex; align-items: center; gap: 12px; flex: none; }
.st-bar { flex: 1; height: 4px; background: var(--st-rule); border-radius: 2px; overflow: hidden; }
.st-bar > i { display: block; height: 100%; width: var(--v, 0%); background: linear-gradient(90deg, #d0601c, #f39433); }

/* the card: takes the free height; a long answer scrolls inside it (the plates never move) */
.st-card { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 28px 56px 10px; overscroll-behavior: contain; }
.st-q { font-size: var(--st-q); line-height: var(--st-q-lh); margin: 0; font-weight: 400; letter-spacing: -.003em; overflow-wrap: break-word; }
.st-hint { margin: 14px 0 0; font-size: var(--st-x); line-height: var(--st-x-lh); color: var(--st-text-2); font-style: italic; }
.st-hint .st-meta { font-style: normal; margin-right: 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.st-rule { height: 1px; margin: 26px 0 24px; background: var(--st-rule); position: relative; }
.st-rule::after { content: ""; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg);
  background: var(--st-page); border: 1px solid var(--st-bronze); }
.st-a { font-size: var(--st-a); line-height: var(--st-a-lh); margin: 0; overflow-wrap: break-word; }
.st-a + .st-a { margin-top: .4em; }
.st-extra { margin: 22px 0 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--st-bronze); font-size: var(--st-x); line-height: var(--st-x-lh); color: var(--st-text-2); }
.st-extra > .st-meta { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-bottom: 4px; }
.st-b { font-weight: 700; }
.st-i { font-style: italic; }
.st-u { text-decoration: underline; text-underline-offset: 3px; }
.st-s { text-decoration: line-through; }
.st-code { font-family: ui-monospace, Menlo, monospace; font-size: .86em; background: var(--st-page-2); padding: 0 .25em; border-radius: 2px; }
.st-hl { background: var(--st-cloze-bg); border-radius: 2px; padding: 0 .1em; }
/* cloze: the slot with an ember underline; revealed: the word in place, bold, gold (oxblood on parchment) */
.st-blank { display: inline-block; min-width: 5em; padding: 0 .45em; margin: 0 .1em; border-bottom: 2px solid var(--st-ember-deep); background: var(--st-cloze-bg);
  border-radius: 2px 2px 0 0; color: var(--st-meta); text-align: center; }
.st-fill { color: var(--st-cloze); font-weight: 700; border-bottom: 2px solid var(--st-ember-deep); background: var(--st-cloze-bg); padding: 0 .15em; border-radius: 2px 2px 0 0; }
/* lists: sets (all items) and numbered lists (one item per 1-4: hidden items are numbered blanks) */
.st-list { margin: .3em 0 0; padding: 0 0 0 1.4em; }
.st-list li { margin: .18em 0; padding-left: .2em; }
ul.st-list { list-style: none; padding-left: 1.3em; }
ul.st-list > li { position: relative; }
ul.st-list > li::before { content: ""; position: absolute; left: -1.05em; top: .62em; width: .36em; height: .36em; transform: rotate(45deg); background: var(--st-ember-deep); }
.st-root[data-page="vellum"] ul.st-list > li::before { background: #7a1d10; }
ol.st-list > li::marker { color: var(--st-meta); font-family: var(--st-ui); font-size: .8em; }
.st-list li.is-hidden { color: transparent; }
.st-list li.is-hidden::after { content: ""; display: inline-block; width: 7em; height: .9em; vertical-align: -.1em; border-bottom: 2px dotted var(--st-rule); }
.st-list li.is-new { color: var(--st-cloze); }
/* formulas (MathML, STIX Two Math); a formula alone on its line is a centred block */
.st-lectern math { font-family: var(--st-math); font-size: 1.1em; }
.st-lectern math[display="block"] { font-size: 1.18em; margin: .5em 0 .55em; }
.st-mathline { display: block; text-align: center; margin: .45em 0 .5em; }
.st-texchip { font-family: ui-monospace, Menlo, monospace; font-size: .8em; background: var(--st-page-2); border: 1px solid var(--st-rule); border-radius: 2px; padding: 0 .3em; }
.st-ans .st-mathline, .st-fill math { color: var(--st-cloze); }
/* multiple choice */
.st-opts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.st-opt { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 2px 14px; min-height: 56px; padding: 5px 18px 5px 14px;
  background: var(--st-page-2); border: 1px solid var(--st-rule); border-left: 4px solid var(--st-rule); border-radius: 3px; font-size: var(--st-a); line-height: 1.35; }
.st-opt .st-res { font: 600 14px/1.2 var(--st-ui); letter-spacing: .02em; white-space: nowrap; }
.st-opt.is-bad { border-left-color: var(--st-bad-edge); background: var(--st-bad-bg); }
.st-opt.is-bad .st-res { color: var(--st-bad); }
.st-opt.is-good { border-left-color: var(--st-good-edge); background: var(--st-good-bg); }
.st-opt.is-good .st-res { color: var(--st-good); }
.st-opt.is-dim { opacity: .72; }
/* V7.8 fixer r34 (items 13, 13b, 13c): mouse play is obvious: answer rows and the next list row look clickable (lift, outline,
   the pointer); the key stays beside them ("or press 2"); flat colours, no gradients */
.st-opt.is-pick { position: relative; cursor: pointer; transition: border-color .12s, background-color .12s, transform .12s; }
.st-opt.is-pick:hover .st-kbd { background: var(--st-ember-deep); color: #fff; }
.st-opt.is-pick:hover { border-color: var(--st-hot-edge); border-left-color: var(--st-ember); background: var(--st-cloze-bg); transform: translateY(-1px); }
.st-opt.is-pick:active { transform: none; }
.st-list li.is-next { cursor: pointer; border-radius: 3px; outline: 1px dashed var(--st-hot-edge); outline-offset: 3px; }
.st-list li.is-next::after { display: none; }
.st-list li.is-next .st-nextrow { color: var(--st-meta); font: 600 .62em/1.6 var(--st-ui); letter-spacing: .02em; }
.st-list li.is-next:hover { outline-style: solid; outline-color: var(--st-ember); background: var(--st-cloze-bg); }
.st-list li.is-next:hover .st-nextrow { color: var(--st-text-2); }
.st-pressbtn { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--st-rule); border-radius: 3px; background: var(--st-page-2); color: var(--st-text); font: 600 15px/1.2 var(--st-ui); }
.st-pressbtn:hover { border-color: var(--st-ember); background: var(--st-cloze-bg); }
.st-lbnote .st-pressbtn { margin: 0 0 0 12px; padding: 3px 9px; font-size: 13px; vertical-align: 1px; }
.st-opt math { font-size: 1.12em; }
.st-why-opt { grid-column: 2 / 4; font-size: var(--st-x); line-height: var(--st-x-lh); color: var(--st-text-2); margin: 2px 0 4px; }
.st-verdict { margin: 10px 0 0; font: 600 16px/1.4 var(--st-ui); }
.st-verdict.is-bad { color: var(--st-bad); }
.st-verdict.is-good { color: var(--st-good); }
/* the screens without a card: loading, done, paused */
.st-empty { padding-top: 8vh; text-align: center; }
.st-empty .st-q { font-size: calc(var(--st-q) * .9); }
.st-empty .st-a { color: var(--st-text-2); margin-top: 14px; font-size: var(--st-x); }
.st-lbnote { margin: 0 0 18px; font: 600 15px/1.4 var(--st-ui); color: var(--st-text-2); }
.st-lbnote b { color: var(--st-text); }

/* rating plates: flat iron, RemNote's words, the next interval under each */
.st-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 40px 0; flex: none; }
.st-r { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: center; padding: 9px 12px 8px; min-height: 58px;
  background: var(--st-plate); border: 1px solid var(--st-rule); border-top: 3px solid var(--c); border-radius: 3px; color: var(--st-plate-text); }
.st-r .st-kbd { grid-row: 1 / 3; }
.st-r b { font: 600 15px/1.18 var(--st-ui); overflow-wrap: break-word; }
.st-r .st-meta { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-r.is-was { box-shadow: inset 0 0 0 1px var(--c); }
.st-rate.is-wait .st-r { opacity: .42; }
.st-rate.is-off { visibility: hidden; }
.st-keys { padding: 12px 40px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex: none; min-height: 50px; }
.st-keys .st-keyline { white-space: nowrap; overflow: hidden; }
.st-keys .st-keyline > span { margin-right: 14px; }
.st-lectern .st-why-link { color: var(--st-meta); text-decoration: underline; text-decoration-color: var(--st-rule); text-underline-offset: 3px; cursor: pointer;
  background: none; border: 0; padding: 0; font: inherit; white-space: nowrap; }
.st-lectern .st-why-link:hover { color: var(--st-text-2); }
.st-whybox { position: absolute; right: 40px; bottom: 196px; max-width: 440px; z-index: 5; padding: 12px 14px; background: var(--st-page-2); border: 1px solid var(--st-bronze);
  border-radius: 3px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font: 500 14px/1.45 var(--st-ui); color: var(--st-text); }
.st-whybox.hidden { display: none; }
.st-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 40px 14px; border-top: 1px solid var(--st-rule); flex: none; min-height: 44px; }
.st-foot > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-kill::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; transform: rotate(45deg); background: var(--st-good-edge); vertical-align: 1px; }
.st-kill.is-away::before { background: var(--st-meta); }
.st-warn { color: var(--st-bad); }

/* ------------------------------------------------------------------------------------------------ 1280x800 and lower */
@media (max-height: 860px) {
  .st-lectern { top: 50px; width: min(760px, calc(100vw - 32px)); }
  .st-head { padding-top: 20px; }
  .st-progress { margin-top: 10px; }
  .st-card { padding: 20px 48px 14px; }
  .st-opt { min-height: 52px; }
  .st-opts { margin-top: 16px; gap: 7px; }
  .st-rate { padding-top: 10px; }
  .st-r { padding: 7px 10px 6px; min-height: 52px; }
  .st-keys { padding: 9px 40px 11px; min-height: 44px; }
  .st-foot { padding: 9px 40px 11px; min-height: 40px; }
  .st-rule { margin: 20px 0 18px; }
  .st-whybox { bottom: 176px; }
}

/* ------------------------------------------------------------------------------------------------ compact (480x360) */
.hud.compact .st-lectern, .st-root.is-compact .st-lectern { top: 4px; bottom: calc(var(--xp-h, 14px) + var(--xp-bottom, 3px) + 4px); width: calc(100vw - 8px); border-width: 3px; }
.hud.compact .st-lectern::before, .hud.compact .st-lectern::after, .hud.compact .st-corner-b, .hud.compact .st-plate,
.st-root.is-compact .st-lectern::before, .st-root.is-compact .st-lectern::after, .st-root.is-compact .st-corner-b, .st-root.is-compact .st-plate { display: none; }
.st-root.is-compact { --st-q: 20px; --st-a: 17px; --st-x: 15px; --st-meta-size: 12px; --st-q-lh: 1.28; --st-a-lh: 1.42; }
.st-root.is-compact[data-size="S"] { --st-q: 18px; --st-a: 15px; --st-x: 14px; }
.st-root.is-compact[data-size="L"] { --st-q: 22px; --st-a: 19px; --st-x: 16px; }
.st-root.is-compact .st-head { padding: 7px 12px 0; gap: 8px; }
.st-root.is-compact .st-crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-root.is-compact .st-tag { font-size: 10px; padding: 3px 5px 2px; margin-left: 4px; }
.st-root.is-compact .st-tag.st-kindtag, .st-root.is-compact .st-src { display: none; }
.st-root.is-compact .st-progress { margin: 4px 12px 0; gap: 8px; }
.st-root.is-compact .st-bar { height: 3px; }
.st-root.is-compact .st-card { padding: 8px 14px 6px; }
.st-root.is-compact .st-rule { margin: 9px 0 8px; }
.st-root.is-compact .st-hint { margin-top: 6px; }
.st-root.is-compact .st-extra { margin-top: 10px; padding-left: 10px; }
.st-root.is-compact .st-opts { margin-top: 8px; gap: 4px; }
.st-root.is-compact .st-opt { min-height: 30px; grid-template-columns: 24px 1fr auto; gap: 2px 8px; padding: 2px 8px 2px 6px; font-size: var(--st-a); }
.st-root.is-compact .st-opt .st-res { font-size: 11px; }
.st-root.is-compact .st-rate { padding: 5px 8px 0; gap: 4px; }
.st-root.is-compact .st-r { grid-template-columns: 18px 1fr; column-gap: 5px; min-height: 30px; padding: 3px 5px 3px; }
.st-root.is-compact .st-r .st-kbd { grid-row: auto; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 3px; }
.st-root.is-compact .st-r b { font-size: 12px; }
.st-root.is-compact .st-r .st-meta { display: none; }
.st-root.is-compact .st-r .st-full { display: none; }
.st-root:not(.is-compact) .st-r .st-first { display: none; }
.st-root.is-compact .st-keys { padding: 4px 10px 5px; min-height: 26px; }
.st-root.is-compact .st-keys .st-kbd { min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }
.st-root.is-compact .st-why-link, .st-root.is-compact .st-foot { display: none; }
.st-root.is-compact .st-whybox { right: 10px; bottom: 70px; }
.st-root.is-compact .st-dim { bottom: calc(var(--xp-h, 14px) + var(--xp-bottom, 3px) + 1px); }

/* V7.2.4 R12 (v724-late): the study chip, the Deck tab and the deck window are retired (the Nauka is the one place for cards) */

/* fixer round 1 (critic finding 2): fit before scrolling, then a scrollbar you can always see and a "more below" cue */
.st-card.is-tight .st-q { font-size: calc(var(--st-q) * .87); }
.st-card.is-tight .st-a, .st-card.is-tight .st-opt { font-size: calc(var(--st-a) * .875); }
.st-card.is-tight .st-extra, .st-card.is-tight .st-hint, .st-card.is-tight .st-why-opt { font-size: calc(var(--st-x) * .9); }
.st-card.is-tight .st-rule { margin: 18px 0 16px; }
.st-card.is-tight .st-opts { margin-top: 12px; gap: 5px; }
.st-card.is-tight .st-opt { min-height: 44px; }
.st-card.is-tighter .st-q { font-size: calc(var(--st-q) * .78); }
.st-card.is-tighter .st-a, .st-card.is-tighter .st-opt { font-size: calc(var(--st-a) * .8); }
.st-card.is-tighter .st-extra, .st-card.is-tighter .st-hint, .st-card.is-tighter .st-why-opt { font-size: calc(var(--st-x) * .84); }
.st-card.is-tighter .st-opt { min-height: 38px; }
.st-root.is-compact .st-card.is-tight .st-opts { margin-top: 5px; gap: 3px; }
.st-root.is-compact .st-card.is-tight .st-opt { min-height: 24px; padding: 1px 6px 1px 4px; line-height: 1.25; }
.st-root.is-compact .st-card.is-tight .st-rule { margin: 6px 0 5px; }
.st-root.is-compact .st-card.is-tighter .st-opt { min-height: 20px; padding: 0 5px 0 4px; line-height: 1.2; }
.st-card::-webkit-scrollbar { width: 9px; }
.st-card::-webkit-scrollbar-track { background: transparent; }
.st-card::-webkit-scrollbar-thumb { background: var(--st-bronze); border-radius: 5px; border: 2px solid var(--st-page); }
.st-more { position: relative; height: 0; flex: none; z-index: 2; pointer-events: none; }
.st-more.hidden { display: none; }
.st-more > span { position: absolute; left: 6px; right: 12px; bottom: 0; height: 38px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px;
  background: linear-gradient(rgba(27, 24, 20, 0), var(--st-page) 72%); font: 600 12px/1.2 var(--st-ui); letter-spacing: .04em; color: var(--st-meta); }
.st-root[data-page="vellum"] .st-more > span { background: linear-gradient(rgba(244, 236, 219, 0), var(--st-page) 72%); }
.st-root.is-compact .st-more > span { height: 26px; font-size: 10px; padding-bottom: 1px; }

/* V7.2.4 fixer: the front's "Show answer" bar over the plates; the plates click like their keys on the answer side */
.st-rate { position: relative; }
.st-show { position: absolute; left: 40px; right: 40px; top: 14px; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid #5b80bd; border-radius: 6px; background: #2a4f86; color: #fff; font: 600 17px/1 var(--st-ui, inherit); cursor: pointer; z-index: 2; }
.st-show:hover { background: #335d9c; }
.st-show.hidden { display: none; }
.st-root.is-compact .st-show { left: 8px; right: 8px; top: 5px; font-size: 13px; }
.st-rate:not(.is-wait):not(.is-off) .st-r { cursor: pointer; }

/* ------------------------------------------------------------------------------------------------ V7.3 lane P: the window sizes (item 35)
   Small = a low window straight above the hotbar (the fight in front of you), Middle = half the screen on the right (the fight
   beside it), Full = the whole screen. js/ui-practice.js sets pr-win-<size> on .st-layer and, for Small and Middle, the
   lectern's bottom just above the hotbar. Compact (480x360) and the Hermit's Hood keep their own looks. */
.st-layer.pr-win-full:not(.is-compact):not(.pr-hood) .st-lectern { width: calc(100vw - 40px); }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-lectern { left: auto; right: 22px; transform: none; width: clamp(min(560px, calc(100vw - 40px)), 50vw, 980px); }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-lectern { top: auto; height: clamp(270px, 45vh, 470px); width: min(940px, calc(100vw - 40px)); }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-plate { display: none; }
/* Small: the card's type and the paddings a step down, so the card keeps its room; the foot (the kill line) goes: the fight is in view */
.st-layer.pr-win-small:not(.is-compact) { --st-q: 22px; --st-a: 18px; --st-x: 15px; --st-meta-size: 12.5px; }
.st-layer.pr-win-small:not(.is-compact)[data-size="S"] { --st-q: 20px; --st-a: 16px; --st-x: 14px; }
.st-layer.pr-win-small:not(.is-compact)[data-size="L"] { --st-q: 25px; --st-a: 20px; --st-x: 16px; }
.st-layer.pr-win-small:not(.is-compact) .pr-bar { padding: 8px 14px 0 26px; }
.st-layer.pr-win-small:not(.is-compact) .st-head { padding: 8px 26px 0; }
.st-layer.pr-win-small:not(.is-compact) .st-progress { margin: 6px 26px 0; }
.st-layer.pr-win-small:not(.is-compact) .st-card { padding: 10px 34px 6px; }
.st-layer.pr-win-small:not(.is-compact) .st-rule { margin: 12px 0 10px; }
.st-layer.pr-win-small:not(.is-compact) .st-rate { padding: 8px 26px 0; gap: 8px; }
.st-layer.pr-win-small:not(.is-compact) .st-r { min-height: 46px; padding: 6px 10px 5px; }
.st-layer.pr-win-small:not(.is-compact) .st-show { left: 26px; right: 26px; top: 8px; }
.st-layer.pr-win-small:not(.is-compact) .st-keys { padding: 6px 26px 8px; min-height: 34px; }
.st-layer.pr-win-small:not(.is-compact) .st-foot { display: none; }
.st-layer.pr-win-small:not(.is-compact) .st-whybox { right: 26px; bottom: 96px; }
/* item 40: in Small and Middle the world around the window is only lightly dimmed (the fight stays in view); Full keeps today's dark */
.st-layer.pr-win-small:not(.pr-hood) .st-dim, .st-layer.pr-win-middle:not(.pr-hood) .st-dim { background: rgba(8, 7, 6, .14); }
.st-root.st-layer.pr-win-small[data-page="vellum"]:not(.pr-hood) .st-dim, .st-root.st-layer.pr-win-middle[data-page="vellum"]:not(.pr-hood) .st-dim { background: rgba(8, 7, 6, .18); }
.st-layer.is-compact .st-dim { background: rgba(8, 7, 6, .68); }
/* the three size buttons on the top bar (mouse only) */
.pr-sizes { display: inline-flex; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--st-rule); border-radius: 6px; }
.pr-sizes .pr-b.pr-win { width: 28px; height: 24px; padding: 0; border-color: transparent; background: transparent; color: var(--st-meta); }
.pr-sizes .pr-b.pr-win svg { width: 18px; height: 14px; }
.pr-sizes .pr-b.pr-win:hover { color: var(--st-text); border-color: var(--st-rule); }
.pr-sizes .pr-b.pr-win.is-on { background: var(--st-page-2); color: var(--st-text); border-color: var(--st-bronze); }
.st-root.is-compact .pr-sizes, .st-layer.pr-hood .pr-sizes { display: none; }

/* ------------------------------------------------------------------------------------------------ V7.3 lane P: the 5-second rule (items 38-39)
   While the card on screen is not 5 s old the plates hold: a quiet fill runs across them (from when its front appeared) and
   an early 1-4 only nudges them with "Not yet · 3 s"; the loud "Not yet!" (a red line at the top, as a spell that is not ready). */
.st-r { position: relative; overflow: hidden; }
.st-hold { position: absolute; left: 0; right: 0; bottom: 0; top: 0; pointer-events: none; transform-origin: left center; transform: scaleX(0); opacity: 0;
  background: linear-gradient(to top, var(--c) 0, var(--c) 3px, rgba(255, 255, 255, .045) 3px); }
.st-root[data-page="vellum"] .st-hold { background: linear-gradient(to top, var(--c) 0, var(--c) 3px, rgba(60, 40, 10, .05) 3px); }
.st-rate.is-hold .st-hold { opacity: 1; }
.st-rate.is-hold:not(.is-wait) .st-r { opacity: .74; cursor: default; }
/* V7.3 fixer B: over the middle of the plates (they wait anyway), never on the exam note's line above them */
.st-holdhint { position: absolute; left: 50%; top: calc(50% + 7px); transform: translate(-50%, -50%); z-index: 3; pointer-events: none; white-space: nowrap;
  font: 600 13px/1 var(--st-ui); color: var(--st-text); background: var(--st-page-2); border: 1px solid var(--st-bronze); border-radius: 12px; padding: 5px 11px 4px; }
.st-holdhint.hidden { display: none; }
.st-holdhint.is-bump { animation: stHoldBump .22s ease-out; }
@keyframes stHoldBump { from { transform: translate(-50%, -50%) scale(.92); opacity: .4; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.st-rate.is-nudge .st-r { animation: stNudge .18s ease-out; }
@keyframes stNudge { 0% { transform: translateX(0); } 35% { transform: translateX(-2px); } 70% { transform: translateX(2px); } 100% { transform: none; } }
.st-redline { position: absolute; left: 0; right: 0; top: 13vh; z-index: 9; pointer-events: none; text-align: center; padding: 0 16px;
  font: 700 18px/1.3 var(--cx-font-label, "Avenir Next", sans-serif); letter-spacing: .02em; color: #ff2020;
  text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 1px 1px 0 #000, -1px 1px 0 #000, 0 2px 4px rgba(0, 0, 0, .9);
  animation: errIn .14s ease-out; }
.st-redline.hidden { display: none; }
.st-redline.fade { opacity: 0; transition: opacity 1.1s ease-in; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-redline { right: 50vw; }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-redline { top: max(96px, 10.5vh); }
/* an occlusion picture in Middle and Small: library.css caps it for a full-height window (100vh - 580px); these windows end
   above the hotbar (--pr-lift, set by ui-practice.js), so the cap drops by that much and the answer stays in view under it */
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-occl-fr img { max-height: clamp(120px, calc(100vh - 580px - var(--pr-lift, 0px)), 44vh); }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-occl-fr img { max-height: clamp(80px, calc(min(45vh, 470px) - 290px), 200px); }
/* V7.7 fixer (the user's point 6, bigger pictures in practice): in Middle and Small a picture card takes the window's free width and
   height (ui-study.js fitPic() sizes it; the caps above stay for the moment before the picture has loaded): the room around it is
   tighter (the question at the answer's size, a short rule, the mask line beside the answer, the picture out to 16-20 px from the
   edges); Middle leaves out the foot's quiet line under a picture card (never a warning); Small grows upwards for a picture card
   (the screen's free height above the hotbar, never above the top bar). At 1440 x 900 a two-panel book figure's labels then read
   at about 17 px in both (were 9 and 6 px). */
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic { padding: 14px 56px 6px; }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic { padding: 8px 34px 4px; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-q, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-q { font-size: var(--st-a); line-height: 1.32; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-occl { margin: 6px -40px 4px; }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-occl { margin: 4px -14px 4px; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-rule, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-rule { margin: 8px 0; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-a, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-a { line-height: 1.3; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-occl-meta, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-occl-meta { display: inline; margin: 0 0 0 14px; }
/* the answer's line and the card's own row (Fix later, Skip) side by side, so the answer never sits under the "more below" cue */
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-a, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .st-a { float: left; max-width: 70%; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .pr-extras, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .pr-extras { display: flow-root; margin-top: 2px; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-card.is-pic .pr-extras .pr-row, .st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-card.is-pic .pr-extras .pr-row { justify-content: flex-end; }
.st-layer.pr-win-middle:not(.is-compact):not(.pr-hood) .st-lectern.st-has-pic .st-foot:not(:has(.st-warn)) { display: none; }
.st-layer.pr-win-small:not(.is-compact):not(.pr-hood) .st-lectern.st-has-pic { height: clamp(270px, 66vh, calc(100vh - var(--pr-lift, 0px) - 60px)); }
.st-root.is-compact .st-redline { top: 4px; left: 8px; right: 8px; margin: 0 auto; width: -webkit-fit-content; width: fit-content; max-width: calc(100% - 16px);
  box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; padding: 3px 9px 2px;
  background: rgba(10, 8, 6, .94); border: 1px solid #5a1a0e; border-radius: 3px; }   /* over the head row for a moment: its own dark plate so it reads;
  centred by margins, not a transform (errIn's transform would undo that while it runs and push the plate off a 480 px screen) */
.st-root.is-compact .st-holdhint { font-size: 11px; padding: 3px 7px 2px; }
@media (prefers-reduced-motion: reduce) { .st-rate.is-nudge .st-r, .st-holdhint.is-bump, .st-redline { animation: none; } }
body.reduced-motion .st-rate.is-nudge .st-r, body.reduced-motion .st-holdhint.is-bump, body.reduced-motion .st-redline { animation: none; }
/* V7.3 lane P (item 37): one quiet line over the plates when a rating's next date lands past the exam */
.st-examnote { margin: 4px 40px -4px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--st-text-2); }
.st-examnote.hidden { display: none; }
.st-examnote::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; transform: rotate(45deg); border: 1px solid var(--st-bronze); vertical-align: 1px; }
.st-layer.pr-win-small:not(.is-compact) .st-examnote { margin: 2px 26px -4px; }
.st-root.is-compact .st-examnote { display: none; }

/* fixer r56 (the lead: the rating plates were 3-4 lines, "again in 10 …" cut, Fix later / Skip pushed below the fold): a compact plate
 * of two lines, the rating's name and the interval; the exam's word is a small tag after the interval (examplan.css's has-ex no
 * longer breaks the line). A narrow plate (the middle size, a docked page) shows the short name ("Partially"; the hover has it all). */
.st-rate { container-type: inline-size; }
.st-r { padding: 7px 9px 6px; column-gap: 8px; min-height: 0; }
.st-r b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-r .st-meta.st-iv, .st-r .st-meta.st-iv.has-ex { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.st-r .st-ex { display: inline-block; margin-left: 1px; padding: 0 4px; font: 600 10px/14px var(--st-ui); letter-spacing: 0.02em; color: var(--c); border: 1px solid var(--c); border-radius: 2px; vertical-align: 1px; }
@container (max-width: 760px) {
  .st-root:not(.is-compact) .st-rate .st-r .st-full { display: none; }
  .st-root:not(.is-compact) .st-rate .st-r .st-first { display: inline; }
}

/* V7.24 Cards that work everywhere (js/engine-cardbar.js): the lectern's own buttons for ← → and leaving, under the plates */
.st-nav { display: flex; align-items: center; gap: 10px; padding: 10px 40px 0; flex: none; }
.st-nav-sp { flex: 1; }
.st-nav .st-navbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px; cursor: pointer;
  border: 1px solid var(--st-rule); border-radius: 3px; background: var(--st-page-2); color: var(--st-text-2); font: 600 13.5px/1.2 var(--st-ui); }
.st-nav .st-navbtn:hover { border-color: var(--st-ember); background: var(--st-cloze-bg); color: var(--st-text); }
.st-nav .st-navbtn.hidden { display: none; }
.st-navbtn .st-kbd { font-size: 11px; }
.st-root.is-compact .st-nav { padding: 4px 8px 0; gap: 6px; }
.st-root.is-compact .st-navbtn { min-height: 24px; padding: 2px 7px; font-size: 12px; }
.st-root.is-compact .st-navbtn .st-kbd { display: none; }   /* the key line under them names the keys */
.st-layer.pr-win-small:not(.is-compact) .st-nav { padding: 8px 26px 0; }

/* V7.24: on a touch screen every card button is at least 48 px high (SQ.CardBar.TOUCH_MIN); the Mac's mouse layout stays as it is */
@media (pointer: coarse) {
  .st-r, .st-root.is-compact .st-r { min-height: 48px; }
  .st-show { min-height: 48px; }
  .st-nav .st-navbtn, .st-root.is-compact .st-navbtn, .st-pressbtn, .st-lbnote .st-pressbtn { min-height: 48px; padding-left: 14px; padding-right: 14px; }
  .st-opt, .st-list li.is-next { min-height: 48px; }
  .pr-ico, .st-root.is-compact .pr-ico, .pr-edit { min-height: 48px; }   /* taller only: wider icons would push Edit off the bar */
  .st-rate, .st-nav { touch-action: manipulation; }   /* no double-tap zoom on the buttons */
  .st-lectern .pr-bar { flex-wrap: wrap; row-gap: 6px; }   /* the taller icons wrap to a second row, never off the edge (the middle window on an iPad) */
}
