/* app.css — INHSA Spelling Trainer brand tokens + components (SPEC §1.5). Tokens copied from the INHSA Wix kit
   (wix-sites/inhsa/_shared/shared-block.html v1.2). Self-hosted fonts (SIL OFL, see /fonts/OFL-*.txt).
   No inline styles anywhere (CSP style-src 'self'): pages use these classes only. Light theme only. */

/* ---------- Fonts (variable woff2, latin + latin-ext subsets) ---------- */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/nunito-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/nunito-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  --forest: #1f4a3a; --forest-2: #2b6450; --pine: #173a2d; --ink: #1d2a24; --muted: #5d6b64;
  --cream: #fbf6ec; --cream-2: #f4ecdc; --sage: #ebf2ec; --mint: #e3efe8;
  --sun: #f4b740; --sun-deep: #c98f17; --sun-soft: #fdeec9;
  --berry: #d4573b; --berry-ink: #b23f25;
  --card: #fff; --line: #e7dfcd; --line-strong: #7b8c82;
  --r-sm: 12px; --r: 16px; --r-lg: 24px;
  --tile-shadow: 0 3px 0 rgba(23, 58, 45, .18);
  --max: 1040px; --gutter: clamp(16px, 4vw, 24px);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--cream);
  font-family: var(--text); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }
body.kid { font-size: 1.125rem; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--forest); font-weight: 700; text-underline-offset: 2px; }
a:hover { color: var(--pine); }
h1, h2, h3 { font-family: var(--display); color: var(--pine); margin: 0 0 .5em; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 2.75rem); font-weight: 800; line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.85rem); font-weight: 800; line-height: 1.12; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.22; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nw { white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: var(--r-sm); background: var(--pine); color: #fff; }
.skip:focus { top: 12px; color: #fff; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; } /* moved there by the page, not by the keyboard */
.on-dark :focus-visible { outline-color: var(--sun); }

.eyebrow { display: inline-flex; align-items: center; gap: .6em; margin: 0 0 .75rem; font-size: .78rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--forest-2); }
.eyebrow::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--sun); transform: rotate(8deg); }
.hl { -webkit-box-decoration-break: clone; box-decoration-break: clone; background: linear-gradient(transparent 56%, var(--sun) 56% 88%, transparent 88%); padding: 0 .06em; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: 640px; }
.wrap.mid { max-width: 820px; }
main { flex: 1 0 auto; padding-block: clamp(24px, 5vw, 48px); }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* ---------- Header / footer ---------- */
.app-header { background: var(--cream); border-bottom: 1px solid var(--line); }
.app-header .wrap { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pine); }
.brand img { width: 32px; height: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-org { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--forest-2); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.user-menu .who { color: var(--muted); font-weight: 700; }
.app-footer { border-top: 1px solid var(--line); background: var(--cream-2); color: var(--muted); font-size: .92rem; }
.app-footer .wrap { padding-block: 20px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.app-footer a { color: var(--forest); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .7em 1.3em;
  border: 2px solid transparent; border-radius: var(--r-sm); font-family: var(--text); font-weight: 800; font-size: 1rem;
  line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, background-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sun { background: var(--sun); color: var(--pine); box-shadow: 0 4px 0 var(--sun-deep); }
.btn-sun:hover { box-shadow: 0 5px 0 var(--sun-deep); color: var(--pine); }
.btn-forest { background: var(--forest); color: #fff; box-shadow: 0 4px 0 var(--pine); }
.btn-forest:hover { box-shadow: 0 5px 0 var(--pine); color: #fff; }
.btn-line { background: transparent; color: var(--pine); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--forest); background: rgba(255, 255, 255, .7); color: var(--pine); }
.btn-danger { background: #fff; color: var(--berry-ink); border-color: var(--berry); }
.btn-small { min-height: 38px; padding: .4em .9em; font-size: .92rem; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--forest); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
@media (max-width: 480px) { .actions .btn { flex: 1 1 100%; } }
.actions + .hint, .actions + p { margin-top: 18px; }

/* ---------- Cards, chips, banners ---------- */
.card { padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.card.sage { background: var(--sage); border-color: #d6e4d9; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.chip { display: inline-block; padding: .15em .7em; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--mint); border-color: #c5ddcd; color: var(--pine); }
.chip.wait { background: var(--sun-soft); border-color: #f1d796; color: #6b4b06; }
.chip.stop { background: #fbe4dd; border-color: #f0c0b2; color: var(--berry-ink); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; }
.banner::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: .55em; border-radius: 3px; background: var(--forest-2); transform: rotate(8deg); }
.banner.info { background: var(--sage); border-color: #d6e4d9; }
.banner.wait { background: var(--sun-soft); border-color: #f1d796; }
.banner.wait::before { background: var(--sun-deep); }
.banner.stop { background: #fbe4dd; border-color: #f0c0b2; }
.banner.stop::before { background: var(--berry); }
.banner p { margin: 0; }
.tile-hex { display: grid; place-items: center; width: 46px; height: 52px; border-radius: var(--r-sm); background: #fff; color: var(--pine); font: 800 1.5rem/1 var(--display); box-shadow: var(--tile-shadow); }

/* ---------- Forms ---------- */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .field + .check, .check + .field, .check + .check { margin-top: 16px; }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 16px; }
.field-row > .field + .field { margin-top: 0; }
label, .label { font-weight: 800; color: var(--pine); }
.optional { font-weight: 600; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 1.0625rem; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); outline: 3px solid rgba(31, 74, 58, .25); outline-offset: 0; }
/* Edge's built-in reveal "eye" would sit next to our own Show button: keep only ours. */
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--berry); }
.hint { font-size: .92rem; color: var(--muted); margin: 0; }
.field-error { font-size: .92rem; font-weight: 700; color: var(--berry-ink); margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--forest); }
.check label { font-weight: 600; color: var(--ink); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--sage); color: var(--pine); font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer; }
.caps-warn { font-size: .88rem; font-weight: 800; color: #6b4b06; margin: 0; }
.form-error { padding: 12px 16px; border-radius: var(--r-sm); background: #fbe4dd; border: 1px solid #f0c0b2; color: var(--berry-ink); font-weight: 700; }
.form-ok { padding: 12px 16px; border-radius: var(--r-sm); background: var(--mint); border: 1px solid #c5ddcd; color: var(--pine); font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */
.rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: .92rem; }
.rules li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.rules li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); }
.rules li.met { color: var(--pine); font-weight: 700; }
.rules li.met::before { background: var(--forest); border-color: var(--forest); }

/* ---------- Tabs and steps ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: var(--r); background: var(--cream-2); border: 1px solid var(--line); }
.tab { flex: 1; min-height: 48px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--pine); font: inherit; font-weight: 800; cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; box-shadow: var(--tile-shadow); }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: step; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 800; color: var(--muted); }
.steps li::before { content: ""; height: 6px; border-radius: 3px; background: var(--line); }
.steps li.done::before, .steps li.current::before { background: var(--forest); }
.steps li.current { color: var(--pine); }
@media (max-width: 520px) { .steps li span { display: none; } }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--cream); }
.table tr:last-child td { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 800; color: var(--pine); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv + .hint, .kv + p { margin-top: 14px; }

.rule-list { margin: 0; padding-left: 1.2em; }
.rule-list li + li { margin-top: 8px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset > h2 { margin-bottom: .75em; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Speller cards (parent) ---------- */
.speller { display: flex; flex-direction: column; gap: 10px; }
.speller-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.speller-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--pine); }

/* ---------- Dialogs ---------- */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; color: var(--ink); box-shadow: 0 20px 60px rgba(23, 58, 45, .25); }
dialog::backdrop { background: rgba(23, 58, 45, .45); }
.dialog-body { padding: clamp(20px, 4vw, 28px); }
.dialog-body h2 { font-size: 1.5rem; }
.secret-box { padding: 14px 16px; border-radius: var(--r-sm); background: var(--cream); border: 1px dashed var(--line-strong); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; overflow-wrap: anywhere; }
.codes { columns: 2; padding-left: 1.2em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ---------- Welcome ---------- */
.hero { display: grid; gap: clamp(24px, 5vw, 48px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: center; }
.hero-mark { width: clamp(120px, 22vw, 200px); margin-inline: auto; }
.welcome-points { margin-top: clamp(32px, 6vw, 56px); }
.welcome-points .card p { margin: 0; }
.choice { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Documents (privacy, help) ---------- */
.doc h2 { margin-top: 1.6em; }
.doc h3 { margin-top: 1.2em; margin-bottom: .3em; }
.doc ul { padding-left: 1.2em; }

/* ---------- Admin ---------- */
.admin-nav { background: var(--pine); }
.admin-nav .wrap { display: flex; flex-wrap: wrap; gap: 4px; padding-block: 6px; }
.admin-nav a { padding: 8px 14px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: .95rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-nav a[aria-current="page"] { background: var(--sun); color: var(--pine); }
.admin-nav :focus-visible { outline-color: var(--sun); }
.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: var(--forest); transform: translateY(-1px); }
.stat-num { font-family: var(--display); font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--pine); }
.stat-label { font-size: .92rem; color: var(--muted); font-weight: 700; }
.msg { display: flex; flex-direction: column; gap: 8px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 180px; }

/* ---------- Clue block (Learning mode; admin "student preview") ---------- */
.clues { display: flex; flex-direction: column; gap: 10px; }
.clues p { margin: 0; }
.clue-meta { font-weight: 800; color: var(--forest-2); }
.clue-pos { font-style: italic; }
.clue-def { font-size: 1.08rem; }
.clue-sentence { padding: 12px 14px; border-radius: var(--r-sm); background: var(--sage); }
.clue-blank { display: inline-block; min-width: 4.5em; border-bottom: 3px solid var(--pine); color: transparent; line-height: 1; }
/* The Merriam-Webster source line (shared/credits.js): small, quiet, plain text. */
.clue-credit { margin: 0; font-size: .78rem; font-weight: 600; line-height: 1.35; color: var(--muted); }
.clues .clue-credit { margin-top: -2px; }
.p-listen .clue-credit, .p-stage > .clue-credit { text-align: center; }

/* ---------- Parent area ---------- */
.speller-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.materials-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.materials-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.materials-list a { font-size: 1.05rem; }
.danger-zone { border-color: #f0c0b2; }
.event-card { border-color: #f1d796; background: linear-gradient(180deg, var(--sun-soft), #fff 70%); }
.kv.event-facts { grid-template-columns: minmax(70px, max-content) 1fr; }
.reg-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.reg-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pre-line { white-space: pre-line; }
.strong { font-weight: 800; }
.picks { gap: 12px; }
.picks legend { margin-bottom: 8px; }
.pick { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--cream); }
.pick > .check label { font-weight: 800; color: var(--pine); font-size: 1.1rem; }
.pick-details { margin-top: 12px; }
.confirm-card { border-color: #c5ddcd; background: linear-gradient(180deg, var(--mint), #fff 60%); }

/* ---------- Rules pop-up (lib/rules-modal.js): header, scrolling pages, affirmation at the bottom ---------- */
dialog.rules-dialog { width: min(920px, calc(100vw - 32px)); max-width: none; height: calc(100vh - 32px); height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
dialog.rules-dialog[open] { display: flex; flex-direction: column; }
.rules-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 3vw, 24px); border-bottom: 1px solid var(--line); background: var(--cream); }
.rules-head .eyebrow { margin-bottom: .15rem; }
.rules-head h2 { margin: 0; font-size: clamp(1.1rem, .95rem + .8vw, 1.45rem); }
.rules-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.rules-meta { margin: 0; }
.rules-zoom { display: inline-flex; align-items: center; gap: 6px; }
.rules-zoom-btn { min-width: 38px; min-height: 34px; padding: 0 .6em; font-size: 1.1rem; }
.rules-zoom-label { min-width: 3.2em; text-align: center; font-size: .88rem; font-weight: 800; color: var(--pine); }
.rules-close { flex: none; width: 44px; height: 44px; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--pine); font: 800 1.6rem/1 var(--text); cursor: pointer; }
.rules-close:hover { border-color: var(--forest); }
.rules-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px clamp(10px, 3vw, 24px) 28px; background: var(--cream-2); }
.rules-scroll:focus-visible { outline: 2px solid var(--forest-2); outline-offset: -2px; }
.rules-note { margin-bottom: 16px; }
.rules-pages { display: flex; flex-direction: column; gap: 16px; min-width: 100%; }
.rules-page { position: relative; width: 100%; margin: 0; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(23, 58, 45, .12); }
.rules-page canvas { display: block; width: 100%; height: 100%; }
.rules-page figcaption { position: absolute; right: 8px; bottom: 6px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); }
.rules-page:not(.is-rendered)::before { content: "Loading page…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .92rem; }
.rules-page.is-failed::before { content: "This page could not be shown. Use “Open the PDF in a new tab” above."; padding: 16px; text-align: center; }
.rules-status-row { justify-content: center; }
.rules-status { margin: 12px 0; color: var(--muted); font-weight: 700; text-align: center; }
.rules-affirm { margin-top: 24px; padding: clamp(16px, 3vw, 24px); border: 2px solid var(--forest-2); border-radius: var(--r); background: #fff; }
.rules-affirm h3 { margin: 0; }
.rules-affirm .actions { margin-top: 8px; }
.rules-check label { font-weight: 800; color: var(--pine); font-size: 1.08rem; }
.rules-check input[aria-invalid="true"] { outline: 3px solid var(--berry); outline-offset: 2px; }
.rules-prompt { padding: 10px 14px; border-radius: var(--r-sm); background: #fbe4dd; border: 1px solid #f0c0b2; }
@media (max-width: 640px) {
  dialog.rules-dialog { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .rules-head { padding: 8px 12px 8px 16px; }
  .rules-head .eyebrow { display: none; }
  .rules-head h2 { font-size: 1.02rem; }
  .rules-close { width: 40px; height: 40px; font-size: 1.4rem; }
  .rules-note p { font-size: .88rem; }
}
/* Privacy Notice pop-up (lib/privacy-modal.js): reuses the rules pop-up's header and close button. */
dialog.privacy-dialog { width: min(820px, calc(100vw - 32px)); max-width: none; height: calc(100vh - 32px); height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
dialog.privacy-dialog[open] { display: flex; flex-direction: column; }
.privacy-frame { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: #fff; }
.privacy-foot { flex: none; display: flex; justify-content: flex-end; padding: 10px clamp(16px, 3vw, 24px); border-top: 1px solid var(--line); background: var(--cream); }
@media (max-width: 640px) {
  dialog.privacy-dialog { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
}
/* /privacy shown inside that pop-up (pages/static.js adds .embedded): no site header, footer or skip link. */
.embedded .app-header, .embedded .app-footer, .embedded .skip { display: none; }
.embedded main { padding-top: 8px; }
.danger-zone h2 { color: var(--berry-ink); }
.placeholder-note { border-style: dashed; background: var(--cream-2); }

/* ---------- Login card: business-card size (3.5 × 2 in), INHSA colors, same on screen and paper ----------
   Sizes inside use cqw (1cqw = 1% of the card's width) so the on-screen card can shrink on phones and still
   look exactly like the printed one. Built by lib/speller-dialogs.js card(). */
.login-card { container-type: inline-size; position: relative; box-sizing: border-box; width: 3.5in; max-width: 100%;
  aspect-ratio: 7 / 4; display: flex; flex-direction: column; overflow: hidden; border-radius: .1in; margin-inline: auto;
  background: var(--cream); color: var(--ink); box-shadow: 0 6px 20px rgba(23, 58, 45, .18);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.login-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6cqw; background: var(--sun); }
.lc-band { flex: none; display: flex; align-items: center; gap: 3cqw; height: 18cqw; padding: 0 4.5cqw; background: var(--forest); }
.lc-mark { flex: none; width: 11cqw; height: auto; }
.lc-brand { margin: 0; display: flex; flex-direction: column; line-height: 1.05; }
.lc-org { font-family: var(--text); font-weight: 800; font-size: 2.8cqw; letter-spacing: .16em; color: var(--sun); }
.lc-app { font-family: var(--display); font-weight: 800; font-size: 5.8cqw; letter-spacing: -.01em; color: var(--cream); }
.lc-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 2.4cqw; padding: 2cqw 5cqw 3.6cqw; }
.lc-name { margin: 0; font-family: var(--display); font-size: 5.8cqw; line-height: 1.1; color: var(--pine); }
.lc-name strong { font-weight: 800; }
.lc-rows { margin: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 1.4cqw 3.5cqw; }
.lc-rows dt { font-weight: 800; font-size: 2.9cqw; letter-spacing: .08em; text-transform: uppercase; color: var(--forest-2); }
.lc-rows dd { margin: 0; min-width: 0; font-size: 4.1cqw; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; line-height: 1.25; }
.lc-rows dd.mono { font-size: 4.5cqw; }
.lc-blank { display: inline-block; width: 100%; height: 4.6cqw; border-bottom: .35cqw solid var(--ink); }

/* ---------- Print: login cards and Word Explorer lists (only while body.printing-cards is set) ---------- */
.print-only { display: none; }
.print-root { display: none; }
@media print {
  body.printing-cards > *:not(.print-root) { display: none !important; }
  body.printing-cards .print-root, .print-only { display: block !important; }
  /* Cards side by side, two per row; a thin grey dashed cut line around each. */
  body.printing-cards .print-root { display: grid !important; grid-template-columns: repeat(2, 3.5in); justify-content: center; align-content: start; gap: .3in .25in; }
  .login-card { width: 3.5in; max-width: none; box-shadow: none; outline: .5pt dashed #9aa5a0; outline-offset: 0; break-inside: avoid; }
  .print-list { color: #000; background: #fff; font-size: 10pt; }
  .print-list h1 { font-size: 14pt; margin: 0 0 4pt; }
  .print-list p { margin: 0 0 8pt; }
  .print-list table { width: 100%; border-collapse: collapse; }
  .print-list th, .print-list td { border: 1px solid #000; padding: 3pt 5pt; text-align: left; vertical-align: top; }
  .print-list thead { display: table-header-group; }
  .print-list tr { break-inside: avoid; }
  .print-list .pl-word { font-weight: 800; white-space: nowrap; }
  body.printing-cards .print-root.print-list { display: block !important; } /* a list is one column, not the card grid */
  .print-list .pl-mark { font-weight: 400; margin-left: 1pt; }
  .print-list .pl-credit { margin: 6pt 0 0; font-size: 8pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .btn:hover, .btn:active { transform: none; }
}
@media (forced-colors: active) {
  .btn, .tab, .chip, .card, .banner { border: 2px solid ButtonText; }
  .hl { background: none; text-decoration: underline; }
}
