/* Recall · study app. Sizes are in rem so the text size control scales everything. */

:root {
  --bg: #f7f5f0;
  --surface: #fffdf9;
  --tint: #efece4;
  --ink: #1b2a26;
  --ink-2: #55615d;
  --line: rgb(27 42 38 / 0.11);
  --line-strong: rgb(27 42 38 / 0.22);
  --green: #17362f;
  --green-2: #23483f;
  --on-green: #f3efe6;
  --on-green-2: #b9c7c1;
  --coral: #e8705f;
  --coral-ink: #b3412e;
  --coral-bg: #fbe9e4;
  --good: #1f6b4f;
  --good-bg: #e2f1ea;
  --warn: #7a5200;
  --warn-bg: #fbf0d6;
  --r-s: 0.5rem;
  --r-m: 0.875rem;
  --r-l: 1.25rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --lh: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: var(--lh);
}
html[data-spacing="wide"] { --lh: 1.9; }
html[data-spacing="wide"] body { letter-spacing: 0.03em; word-spacing: 0.12em; }
html[data-spacing="wide"] li + li { margin-top: 0.6em; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--coral-ink); text-underline-offset: 0.2em; }
[hidden] { display: none !important; }

:focus-visible { outline: 0.1875rem solid var(--ink); outline-offset: 0.125rem; border-radius: 0.25rem; }
.side :focus-visible { outline-color: var(--on-green); }

.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--ink); color: var(--bg); padding: 0.75rem 1rem; border-radius: var(--r-s); }
.skip:focus { top: 1rem; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100dvh; }
.side {
  background: var(--green);
  color: var(--on-green);
  padding: 1.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.5rem; color: inherit; text-decoration: none; min-height: 2.75rem; }
.brand-mark { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--coral); display: grid; place-items: center; color: var(--green); flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.625rem; font-weight: 500; letter-spacing: -0.02em; }

.nav, .decks { list-style: none; display: grid; gap: 0.125rem; }
.nav a, .decks a {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 2.75rem; padding: 0.5rem 0.75rem;
  border-radius: var(--r-s);
  color: var(--on-green-2); text-decoration: none; font-weight: 500;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a:hover, .decks a:hover { background: rgb(255 255 255 / 0.06); color: var(--on-green); }
.nav a[aria-current], .decks a[aria-current] { background: var(--green-2); color: var(--on-green); }
.nav svg { flex: none; }
.side-label { font-size: 0.8125rem; font-weight: 600; color: var(--on-green-2); padding: 0 0.75rem 0.375rem; }
.decks a { font-weight: 400; font-size: 0.9375rem; }
.decks .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.decks .deck-group { font-size: 0.75rem; font-weight: 600; color: var(--on-green-2); padding: 0.75rem 0.75rem 0.25rem; }
.decks .n {margin-left: auto; font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--on-green-2); }
.side-foot { margin-top: auto; border-top: 1px solid rgb(255 255 255 / 0.12); padding-top: 1rem; display: grid; gap: 0.5rem; font-size: 0.875rem; }
.display-row { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.25rem; }
.display-row { gap: 0.25rem; }
.display-row span { margin-right: auto; color: var(--on-green-2); white-space: nowrap; }
.display-row output { min-width: 2.75rem; text-align: center; font-variant-numeric: tabular-nums; }
.side-btn {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.75rem;
  background: transparent; color: var(--on-green);
  border: 1px solid rgb(255 255 255 / 0.22); border-radius: var(--r-s);
}
.side-btn:hover { background: rgb(255 255 255 / 0.08); }
.side-btn[aria-pressed="true"] { background: var(--on-green); color: var(--green); }
.side-btn.wide { width: 100%; text-align: left; }
.home { color: var(--on-green-2); padding: 0.5rem 0.25rem; min-height: 2.75rem; display: flex; align-items: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1 1 auto; max-width: 26rem; display: flex; align-items: center; }
.search svg { position: absolute; left: 0.75rem; color: var(--ink-2); pointer-events: none; }
.search input {
  width: 100%; min-height: 2.75rem; padding: 0 0.75rem 0 2.5rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-s);
}
.search input::placeholder { color: var(--ink-2); }
#menu { display: none; }

main { flex: 1; width: 100%; max-width: 66rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
main:focus { outline: none; }
.view > header { margin-bottom: 1.5rem; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--coral-ink); }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 2.5vw + 1.25rem, 3rem); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
h1:focus { outline: none; }
.lede { color: var(--ink-2); margin-top: 0.5rem; max-width: 42rem; text-wrap: pretty; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.5rem 1rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-s);
  font-weight: 600; text-decoration: none; text-align: center;
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--tint); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--coral-ink); border-color: var(--coral-ink); color: #fff; }
.btn.primary:hover { background: #9c3626; }
.btn.quiet { border-color: transparent; background: transparent; font-weight: 500; }
.btn.quiet:hover { background: var(--tint); }
.btn kbd { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; opacity: 0.75; border: 1px solid currentColor; border-radius: 0.25rem; padding: 0 0.3rem; }
.icon-btn { min-width: 2.75rem; padding: 0; }
.btn svg, .nav svg, .search svg { width: 1.25em; height: 1.25em; flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ── Flashcards ────────────────────────────────────────────────────────── */
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 1.25rem; align-items: start; }
.study-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; color: var(--ink-2); font-size: 0.9375rem; }
.study-bar b { color: var(--ink); font-variant-numeric: tabular-nums; }
.card {
  position: relative;
  height: clamp(17rem, 46vh, 24rem);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-l);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
}
.card:focus { outline: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; border-radius: 99rem; background: var(--coral-bg); color: var(--coral-ink); font-weight: 600; }
.card[data-face="answer"] .pill { background: var(--good-bg); color: var(--good); }
.pill i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.card-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-items: center; padding: 0.75rem 0; }
.card-text {
  font-family: var(--serif); font-size: clamp(1.25rem, 1vw + 1rem, 1.875rem); line-height: 1.3;
  text-align: center; white-space: pre-line; text-wrap: balance; max-width: 36rem; margin: 0 auto;
  animation: rise 0.22s var(--ease) both;
}
.card[data-face="answer"] .card-text { font-size: clamp(1.125rem, 0.6vw + 1rem, 1.5rem); line-height: 1.4; text-wrap: pretty; }
.card-hint { text-align: center; font-size: 0.875rem; color: var(--ink-2); }
@keyframes rise { from { opacity: 0; transform: translateY(0.5rem); } }

.card-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; margin-top: 0.75rem; }
.rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.rate .btn, #reveal { width: 100%; min-height: 3.5rem; }
.rate .again { background: var(--coral-bg); border-color: rgb(179 65 46 / 0.35); color: var(--coral-ink); }
.rate .almost { background: var(--warn-bg); border-color: rgb(122 82 0 / 0.35); color: var(--warn); }
.rate .got { background: var(--good-bg); border-color: rgb(31 107 79 / 0.35); color: var(--good); }
.card-tools { margin-top: 0.5rem; justify-content: center; }

.session { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 1.25rem; display: grid; gap: 1rem; justify-items: center; }
.session h2 { font-size: 0.9375rem; font-weight: 600; justify-self: start; }
.ring { width: 7rem; height: 7rem; }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--tint); }
.ring .bar { stroke: var(--coral); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.4s var(--ease); }
.ring text { font-family: var(--serif); font-size: 1.5rem; fill: var(--ink); }
.tally { list-style: none; width: 100%; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.tally li { display: flex; justify-content: space-between; }
.tally b { font-variant-numeric: tabular-nums; }
.session .btn { width: 100%; }

.panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 1.5rem; }
.panel h2 { font-family: var(--serif); font-weight: 500; font-size: 1.625rem; letter-spacing: -0.015em; }
.panel > * + * { margin-top: 0.75rem; }

/* ── Guide ─────────────────────────────────────────────────────────────── */
.banner { background: var(--green); color: var(--on-green); border-radius: var(--r-l); padding: 1.25rem 1.5rem; display: grid; gap: 0.75rem; }
.banner-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.banner .side-btn { white-space: nowrap; }
.meter { height: 0.5rem; background: rgb(255 255 255 / 0.16); border-radius: 99rem; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--coral); border-radius: inherit; transition: width 0.4s var(--ease); }
.stepnav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.stepnav button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.25rem 0.875rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99rem; font-size: 0.9375rem;
}
.stepnav button[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stepnav .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.fmt { background: var(--warn-bg); border-radius: var(--r-m); padding: 0.25rem 1rem; margin-bottom: 1rem; }
.fmt summary { min-height: 2.75rem; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.fmt ul { padding: 0 0 0.75rem 1.25rem; }

.step { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 1.5rem; animation: rise 0.3s var(--ease) both; }
.step + .step { margin-top: 1rem; }
.step > h2 { font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.75rem; }
.step > h2:focus { outline: none; }
.step > h2 .n { flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: var(--r-s); background: var(--coral-bg); color: var(--coral-ink); font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.step-sum { background: var(--tint); border-radius: var(--r-m); padding: 0.75rem 1rem; margin-top: 1rem; font-weight: 500; }
.step-sum small { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.875rem; }
.step h3 { font-size: 1.0625rem; font-weight: 600; margin-top: 1.5rem; }
.step p, .step ul, .step ol, .step .tablewrap, .step pre, .step .grid2 { margin-top: 0.75rem; }
.step p, .step li { max-width: 46rem; text-wrap: pretty; }
.step ul, .step ol { padding-left: 1.25rem; }
.step li + li { margin-top: 0.35em; }
.step li::marker { color: var(--coral-ink); }
.box { background: var(--tint); border-radius: var(--r-m); padding: 1rem; margin-top: 1rem; }
.box h3 { margin-top: 0; }
.box.key { background: var(--good-bg); }
.box.flag { background: var(--warn-bg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.grid2 .box { margin-top: 0; }
.gelrow { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; margin-top: 0.75rem; }
.gelrow svg { flex: 0 0 12rem; max-width: 100%; height: auto; }
.gelrow > div { flex: 1 1 16rem; }
.seq { font-family: var(--mono); font-size: 0.9375rem; }
pre.seq { background: var(--ink); color: var(--bg); padding: 1rem; border-radius: var(--r-m); overflow-x: auto; line-height: 1.6; }
.box pre.seq { margin-bottom: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption { text-align: left; padding: 0.75rem 1rem; font-weight: 600; }
th, td { text-align: left; vertical-align: top; padding: 0.625rem 1rem; border-top: 1px solid var(--line); }
th { font-weight: 600; background: var(--tint); }
.num { font-variant-numeric: tabular-nums; }
.drill { margin-top: 1rem; }
.step-foot { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
#guide-steps.all .step-foot .next { display: none; }

/* ── Quiz ──────────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: var(--tint); border-radius: var(--r-m); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { min-height: 2.75rem; padding: 0 1rem; border: 0; background: transparent; border-radius: var(--r-s); font-weight: 500; }
.tabs button[aria-pressed="true"] { background: var(--surface); font-weight: 600; box-shadow: 0 0 0 1px var(--line-strong); }
.q-count { color: var(--ink-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.q-text { font-family: var(--serif); font-size: 1.5rem; line-height: 1.3; text-wrap: pretty; }
.q-text:focus { outline: none; }
.opts { list-style: none; display: grid; gap: 0.5rem; }
.opt {
  width: 100%; min-height: 3rem; padding: 0.625rem 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-s);
}
.opt:not([disabled]):hover { background: var(--tint); }
.opt[disabled] { cursor: default; color: var(--ink); }
.opt em { font-style: normal; font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.opt.right { background: var(--good-bg); border-color: var(--good); }
.opt.right em { color: var(--good); }
.opt.wrong { background: var(--coral-bg); border-color: var(--coral-ink); }
.opt.wrong em { color: var(--coral-ink); }
.explain { background: var(--tint); border-radius: var(--r-m); padding: 0.75rem 1rem; }
.model { padding-left: 1.25rem; }
.model li + li { margin-top: 0.35em; }
.missed { list-style: none; display: grid; gap: 0.75rem; }
.missed li { border-top: 1px solid var(--line); padding-top: 0.75rem; }

/* ── Progress and search ───────────────────────────────────────────────── */
.prog { list-style: none; display: grid; gap: 1rem; }
.prog a { color: var(--ink); font-weight: 600; }
.prog-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.prog-head span { color: var(--ink-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 0.625rem; border-radius: 99rem; overflow: hidden; background: var(--tint); margin-top: 0.375rem; }
.bar i { display: block; height: 100%; }
.bar .got { background: var(--good); }
.bar .almost { background: #d9a021; }
.bar .again { background: var(--coral); }
.stack > * + * { margin-top: 1rem; }
.results { list-style: none; display: grid; gap: 0.5rem; }
.results details { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: 0 1rem; }
.results summary { min-height: 3rem; padding: 0.5rem 0; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; font-weight: 500; }
.results summary small { margin-left: auto; color: var(--ink-2); white-space: nowrap; font-weight: 400; }
.results p { padding: 0 0 1rem; white-space: pre-line; }

/* ── Dialog ────────────────────────────────────────────────────────────── */
dialog { border: 0; border-radius: var(--r-l); padding: 1.5rem; width: min(34rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(23 54 47 / 0.55); }
dialog h2 { font-family: var(--serif); font-weight: 500; font-size: 1.625rem; }
dialog form { display: grid; gap: 1rem; margin-top: 1rem; }
.field { display: grid; gap: 0.375rem; font-weight: 600; font-size: 0.9375rem; }
.field input, .field select, .field textarea {
  font-weight: 400; font-size: 1rem; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-s); width: 100%;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.form-note { font-size: 0.9375rem; color: var(--good); font-weight: 500; min-height: 1.5em; }
dialog .row { justify-content: flex-end; }

/* ── Source viewer: the slide a card came from, with its lines marked ─── */
.source-btn { gap: 0.5rem; text-align: left; }
.src-dialog { width: min(52rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.25rem; }
.src-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.src-head h2 { font-size: 1.375rem; }
.src-note { margin-top: 0.5rem; color: var(--ink-2); font-size: 0.9375rem; }
.src-figs { display: grid; gap: 1.25rem; margin-top: 1rem; }
.src-figs figure { display: grid; gap: 0.375rem; }
.src-figs figcaption { font-size: 0.8125rem; color: var(--ink-2); }
.src-slide { position: relative; border: 1px solid var(--line-strong); border-radius: var(--r-s); overflow: hidden; background: #fff; }
.src-slide img { display: block; width: 100%; height: auto; }
/* ── Upload notes ─────────────────────────────────────────────────────── */
#up-form { display: grid; gap: 1rem; }
#up-form > * + * { margin-top: 0; }
.up-status { min-height: 1.5em; font-weight: 500; }
.up-bar { height: 0.5rem; }
.up-head { font-family: var(--serif); font-weight: 500; font-size: 1.375rem; margin: 0.5rem 0 0.75rem; }
.up-item + .up-item { margin-top: 0.75rem; }
.up-item summary { display: flex; align-items: baseline; gap: 0.75rem; cursor: pointer; min-height: 2.75rem; padding: 0.25rem 0; }
.up-item summary small { margin-left: auto; color: var(--ink-2); white-space: nowrap; }
.up-name { font-family: var(--serif); font-size: 1.25rem; }
.up-notes h3 { font-size: 1rem; font-weight: 600; margin-top: 0.5rem; }
.up-notes ul { margin: 0.375rem 0 0 1.25rem; display: grid; gap: 0.375rem; }
.src-chip { font: inherit; font-size: 0.8125rem; font-weight: 500; color: var(--coral-ink); background: var(--tint); border: 0; border-radius: 999px; padding: 0.125rem 0.625rem; min-height: 1.75rem; cursor: pointer; white-space: nowrap; }
.src-chip:hover { text-decoration: underline; }
.src-mark { position: absolute; background: rgb(250 204 21 / 0.38); outline: 2px solid rgb(217 119 6 / 0.85); border-radius: 2px; mix-blend-mode: multiply; }

/* ── Narrow layout: the sidebar becomes a drawer. Set from JS in rem so it
      also kicks in when the text size is turned up. ──────────────────────── */
html[data-nav="drawer"] .app { grid-template-columns: minmax(0, 1fr); }
html[data-nav="drawer"] .side {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(18rem, 86vw);
  transform: translateX(-100%); visibility: hidden;
  transition: transform 0.3s var(--ease), visibility 0s 0.3s;
}
html[data-nav="drawer"] .side.open { transform: none; visibility: visible; transition: transform 0.3s var(--ease); }
html[data-nav="drawer"] #menu { display: inline-flex; }
html[data-nav="drawer"] .top { padding-inline: 1rem; }
html[data-nav="drawer"] main { padding: 1.25rem 1rem 3rem; }
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgb(23 54 47 / 0.55); }

/* Width of the content column, set from JS in rem (data-w: m, s or xs). Plain
   attribute selectors, so it works on older iPads and follows the text size. */
html:not([data-w="m"]) .study-grid { grid-template-columns: minmax(0, 1fr); }
html:not([data-w="m"]) .session { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; align-items: center; column-gap: 1.25rem; }
html:not([data-w="m"]) .session h2 { grid-column: 1 / -1; }
html:not([data-w="m"]) .session .ring { width: 5rem; height: 5rem; }
html:not([data-w="m"]) .session .btn { grid-column: 1 / -1; }

html[data-w="xs"] #add-btn span { display: none; }
html[data-w="xs"] #v-study .eyebrow { display: none; }
html[data-w="xs"] .view > header { margin-bottom: 1rem; }
html[data-w="xs"] .card { padding: 1rem; height: clamp(15rem, 40vh, 24rem); }
html[data-w="xs"] .card-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
html[data-w="xs"] .card-actions .mid { grid-column: 1 / -1; grid-row: 1; }
html[data-w="xs"] .rate .btn { flex-direction: column; gap: 0.125rem; padding-inline: 0.25rem; }
html[data-w="xs"] .step { padding: 1rem; }
html[data-w="xs"] .step > h2 { font-size: 1.5rem; }
html[data-w="xs"] .opt { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Print: the whole study pack, built on demand into #print ──────────── */
#print { display: none; }
@media print {
  .app, dialog, .skip { display: none !important; }
  #print { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  #print h1 { font-size: 22pt; }
  #print h2 { font-family: var(--serif); font-size: 16pt; margin-top: 18pt; break-after: avoid; }
  #print h3 { font-size: 12pt; margin-top: 10pt; break-after: avoid; }
  #print p, #print ul, #print ol, #print table, #print pre, #print dl { margin-top: 6pt; }
  #print ul, #print ol { padding-left: 16pt; }
  #print dt { font-weight: 600; margin-top: 8pt; break-after: avoid; }
  #print dd { white-space: pre-line; margin-left: 12pt; }
  #print .step { border: 0; padding: 0; animation: none; }
  #print .step-foot, #print .drill, #print .step-sum small { display: none; }
  #print pre.seq { background: #fff; color: #000; border: 1px solid #000; }
  #print .box, #print .step-sum { background: #fff; border: 1px solid #999; }
  #print table, #print dt, #print li { break-inside: avoid; }
  #print th { background: #eee; }
}
