/* Vertex Learn's own header, footer and look (learn_header() and LEARN_FOOTER in
   curriculum-scraper/generate_seo_pages.py, copied into the hand-written Learn pages).

   THE DESIGN TOKENS (15 Nov 2026). Every Learn page's CSS uses only these; wiki/public-site.md has the rules.
   Colour: five tokens, plus white paper. Tints and hovers are mixed from them, never new hues.
   --ok and --bad exist for one job: a right or wrong answer and a form error. */
body:has(> .vh) {
  --ink: #0f1b2d;       /* headings and body text */
  --muted: #566273;     /* secondary text, 6.2:1 on white */
  --line: #e2e8f0;      /* card and divider borders (slate, 25 Nov 2026 look) */
  --surface: #fafafa;   /* the off-white page behind crisp white cards (25 Nov 2026 look) */
  --accent: #1a5fbd;    /* links, buttons, the current item; 6.2:1 on white */
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-hover: color-mix(in srgb, var(--accent) 78%, var(--ink));
  --line-strong: color-mix(in srgb, var(--muted) 78%, #fff); /* field borders, 3:1 on white */
  --ok: #1f7a3a; --ok-soft: color-mix(in srgb, var(--ok) 10%, #fff);
  --bad: #a12a3c; --bad-soft: color-mix(in srgb, var(--bad) 9%, #fff);
  /* Type: seven sizes. */
  --t-12: 12px; --t-14: 14px; --t-16: 16px; --t-20: 20px; --t-24: 24px; --t-32: 32px; --t-44: 44px;
  /* Space: eight steps. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --radius: 12px; --radius-sm: 8px; --tap: 44px;
  --page: 1168px; --read: 808px; --gutter: 24px; /* two content widths (index pages, reading pages), gutter included */
  --font-head: Figtree, system-ui, -apple-system, sans-serif;
  --font-body: Figtree, system-ui, -apple-system, sans-serif;
  /* The older names used by styles.css and the pages' own CSS, pointed at the tokens. */
  --blue: var(--accent); --blue-deep: var(--accent); --blue-bright: var(--accent); --blue-ink: var(--ink);
  --blue-soft: var(--accent-soft); --gold: var(--accent); --gold-deep: var(--muted); --gold-bright: var(--accent);
  --gold-soft: var(--accent-soft); --cream: var(--surface); --paper: #fff; --white: #fff;
  --teal: var(--accent); --teal-deep: var(--ink); --teal-700: var(--accent-hover); --green: var(--ok);
  --green-soft: var(--ok-soft); --green-bright: var(--accent); --lime: var(--accent); --mint: var(--accent-soft);
  --lightgreen: var(--surface); --sun: var(--accent); --sun-soft: var(--accent-soft); --accent-green: var(--ok);
  --accent-teal: var(--accent); --pink: var(--accent); --purple: var(--accent); --red: var(--bad);
  --muted-2: var(--muted); --border: var(--line); --border-soft: var(--line);
  --shadow-xs: none; --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  --r-sm: 8px; --r: 12px; --r-lg: 12px; --r-xl: 12px;
  background: var(--surface); font-family: var(--font-body); font-size: var(--t-16); line-height: 1.5; color: var(--ink);
}
/* Phones: the two display sizes step down one; nothing else changes. */
@media (max-width: 640px) { body:has(> .vh) { --t-44: 32px; --t-32: 24px; --gutter: 16px; } }
body:has(> .vh) :is(h1, h2, h3, h4) { font-family: var(--font-head); font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
/* One page title size on every Learn page. */
body:has(> .vh) h1 { font-size: var(--t-44); line-height: 1.1; }
body:has(> .vh) .btn { border-radius: var(--radius); box-shadow: none; min-height: var(--tap); }
body:has(> .vh) .btn:hover { transform: none; }
/* Cards (25 Nov 2026 look): softer corners on every Learn page. :where() adds no specificity, so a page's own card
   states (invites, finished sets, highlights, hovers) still win. */
:where(body:has(> .vh)) .card { border-radius: 16px; }
/* Focus: one ring everywhere, on anything that takes focus. */
body:has(> .vh) :is(a, button, input, select, textarea, summary, [tabindex], [role="button"]):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
/* Reduced motion: nothing slides, fades or spins for people who ask for that. */
@media (prefers-reduced-motion: reduce) {
  body:has(> .vh) *, body:has(> .vh) *::before, body:has(> .vh) *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.vh-skip { position: absolute; min-height: var(--tap); box-sizing: border-box; left: var(--s-2); top: var(--s-2); z-index: 100; padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm); background: var(--ink); color: #fff; font: 700 var(--t-16) var(--font-body); text-decoration: none; transform: translateY(-200%); }
.vh-skip:focus { transform: none; }
body:has(> .vh) main:focus { outline: none; }
.vh, .vf { font-family: var(--font-body); color: var(--ink); }
.vh-in, .vf-in { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); box-sizing: border-box; }
.vh { background: #fff; border-bottom: 1px solid var(--line); }
.vh-in { padding-top: var(--s-3); padding-bottom: var(--s-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); }
.vh-brand { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); font-weight: 800; font-size: var(--t-20); color: var(--ink); text-decoration: none; }
.vh-brand rect { fill: var(--accent); }
.vh-brand b { font-weight: 800; color: var(--accent); }
.vh-nav { display: flex; flex-wrap: wrap; gap: var(--s-1); flex: 1 1 auto; font-size: var(--t-16); font-weight: 500; }
.vh-nav a { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; box-sizing: border-box; }
.vh-nav a:hover { background: var(--surface); }
.vh-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lh-dot { min-width: 20px; height: 20px; padding: 0 var(--s-1); border-radius: 99px; background: var(--accent); color: #fff; font: 800 var(--t-12)/var(--t-20) var(--font-body); text-align: center; }
.vh-nav svg { width: 16px; height: 16px; }
/* Maths tools and Science tools (tool_menu() in generate_seo_pages.py; learn-shell.js opens them): a menu of
   every tool with its own icon, two columns, under its trigger; on phones it spans the screen under the header.
   learn-shell.js moves each menu to <body> and places it. */
.vh-dd { position: relative; display: flex; }
.vh-ddb svg { color: var(--accent); }
.vh-ddb .vh-chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.vh-ddb[aria-expanded="true"] { background: var(--accent-soft); }
.vh-ddb[aria-expanded="true"] .vh-chev { transform: rotate(180deg); }
.vh-panel { position: absolute; left: 0; top: 0; z-index: 60; width: 480px; max-width: calc(100vw - 32px); padding: var(--s-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ink) 35%, transparent);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.vh-panel[hidden] { display: none; }
.vh-col { display: flex; flex-direction: column; gap: 2px; }
.vh-col + .vh-col { border-left: 1px solid var(--line); padding-left: var(--s-2); }
.vh-panel a { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--radius-sm); font: 500 var(--t-14) var(--font-body);
  color: var(--ink); text-decoration: none; box-sizing: border-box; }
.vh-panel a:hover { background: var(--surface); }
.vh-panel a svg { flex: none; width: 20px; height: 20px; color: var(--accent); }
.vh-panel a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.vh-end { display: flex; align-items: center; gap: var(--s-3); margin-left: auto; }
/* Small laptops and tablets: the tool buttons lose their icon so the row stays on one line. */
@media (min-width: 641px) and (max-width: 1100px) {
  .vh-nav a { padding: 0 var(--s-2); }
  .vh-nav { font-size: var(--t-14); }
  .vh-ddb > svg:not(.vh-chev) { display: none; }
}
@media (min-width: 641px) and (max-width: 900px) { .vh-brand span, .vh-t { display: none; } .vh-in, .vh-nav { flex-wrap: nowrap; } }
.la-signin { white-space: nowrap; }
/* Phones: every link fits one row with no sideways scroll. The tool buttons show their first word
   ("Maths", "Science") and lose icon and arrow; the menus keep every tool. */
@media (max-width: 640px) {
  .vh-in { gap: 0 var(--s-4); padding-top: var(--s-2); padding-bottom: var(--s-1); }
  .vh-nav { order: 3; flex: 1 1 100%; gap: 0; justify-content: space-between; margin: 0 calc(var(--s-2) * -1); font-size: var(--t-14); }
  .vh-nav a { padding: 0 var(--s-2); white-space: nowrap; }
  .vh-nav .vh-ddb svg, .vh-t { display: none; }
  .vh-panel { left: 12px !important; right: 12px; width: auto; max-width: none; }
  /* Signed in: Classes (or Children) sits in the top row beside the account button, so the links stay one row. */
  .vh-in:has(#lh-classes) { position: relative; }
  #lh-classes { position: absolute; top: var(--s-2); right: calc(var(--s-4) + 36px + var(--s-2)); }
}
@media (max-width: 380px) { .vh-nav a { padding: 0 var(--s-1); } }
.vf { background: #fff; border-top: 1px solid var(--line); }
.vf-in { padding-top: var(--s-5); padding-bottom: var(--s-5); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-5); font-size: var(--t-14); color: var(--muted); }
.vf-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }
.vf a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); text-decoration: none; }
.vf a:hover { color: var(--accent-hover); text-decoration: underline; }
/* Account (learn-auth.js fills #lh-acct). */
.la-signin { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 700 var(--t-16) var(--font-body); cursor: pointer; }
.la-signin:hover { background: var(--accent); }
.la-me { position: relative; }
.la-me summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; border-radius: 12px; }
.la-me summary::-webkit-details-marker { display: none; }
.la-me summary i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 var(--t-16) var(--font-head); font-style: normal; }
.la-me summary span { display: none; min-width: 0; }
.la-me summary b { display: block; font-size:var(--t-14); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la-me summary small { display: block; font-size:var(--t-12); color: var(--muted); }
.la-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(20,52,107,.45); display: flex; flex-direction: column; gap: 8px; }
.la-menu p { margin: 2px 8px 8px; font-size:var(--t-14); color: var(--muted); overflow-wrap: anywhere; }
.la-menu button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 700 var(--t-14) var(--font-body); color: var(--ink); cursor: pointer; }
.la-menu button:hover { border-color: var(--accent); }
.la-menu .la-h { margin: 8px 8px 0; font-size:var(--t-12); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.la-menu .la-who { text-align: left; padding: 0 12px; }
.la-menu .la-who.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
/* The sign-in dialog. */
.la-dlg { width: min(420px, calc(100vw - 24px)); margin: auto; padding: 24px 24px 16px; border: 0; border-radius: 12px; box-shadow: 0 30px 60px -24px rgba(20,52,107,.5); font-family: var(--font-body); color: var(--ink); }
.la-dlg::backdrop { background: rgba(10,20,40,.55); }
.la-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size:var(--t-24); color: var(--muted); cursor: pointer; }
.la-x:hover { background: var(--accent-soft); }
.la-body { display: flex; flex-direction: column; gap: 12px; }
.la-body h2 { margin: 0 32px 4px 0; font: 600 var(--t-24)/1.15 var(--font-head); color: var(--ink); }
.la-field { display: flex; flex-direction: column; gap: 4px; font-size:var(--t-14); font-weight: 700; color: var(--muted); }
.la-field input, .la-field select { min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; font: 600 var(--t-16) var(--font-body); color: var(--ink); background: #fff; }
.la-field input:focus, .la-field select:focus { border-color: var(--accent); outline: none; }
.la-code { letter-spacing: 8px; font-size:var(--t-24) !important; text-align: center; }
.la-go, .la-google { min-height: 48px; border-radius: 12px; font: 700 var(--t-16) var(--font-body); cursor: pointer; }
.la-go { border: 0; background: var(--accent); color: #fff; }
.la-go:hover { background: var(--accent); }
.la-go:disabled { opacity: .6; cursor: default; }
.la-google { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.la-google svg { width: 20px; height: 20px; }
.la-google:hover { border-color: var(--accent); }
.la-or { display: flex; align-items: center; gap: 12px; font-size:var(--t-14); color: var(--muted); }
.la-or::before, .la-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.la-link { border: 0; background: none; color: var(--accent); font: 700 var(--t-14) var(--font-body); cursor: pointer; padding: 8px; }
.la-to { margin: -8px 0 0; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.la-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.la-kind { min-height: 52px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 700 var(--t-16) var(--font-body); color: var(--ink); cursor: pointer; }
.la-kind[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.la-young { margin: 0; padding: 12px 12px; border-radius: 8px; background: var(--accent-soft); font-size:var(--t-14); }
.la-status { min-height: 1.4em; margin: 12px 0 0; font-size:var(--t-14); color: var(--muted); }
.la-status.bad { color: var(--bad); font-weight: 700; }
.la-big { margin: 4px 0 0; font: 600 var(--t-44) var(--font-head); letter-spacing: 8px; color: var(--ink); background: var(--accent-soft); border-radius: 12px; text-align: center; padding: 8px 0; }
.la-small { margin: 0; font-size:var(--t-14); color: var(--muted); text-align: center; }
.la-prow { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-top: 1px solid var(--line); font-weight: 700; }
.la-check { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size:var(--t-16); cursor: pointer; }
.la-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.la-dlg [hidden], .vh [hidden] { display: none !important; }
@media print { .vh, .vf { display: none !important; } }
.la-check{display:flex;gap:8px;align-items:flex-start;font-size:var(--t-14);margin:4px 0 12px;line-height:1.35;}
.la-check input{margin-top:4px;}
.la-secret { display: flex; flex-direction: column; gap: 12px; }
.la-slots { display: flex; align-items: center; gap: 8px; }
.la-slots span { width: 56px; height: 56px; border: 2px dashed var(--line-strong); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size:var(--t-32); }
.la-again { margin-left: auto; width: 48px; height: 48px; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; font-size:var(--t-24); cursor: pointer; }
.la-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.la-pic { aspect-ratio: 1; min-height: 56px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size:var(--t-32); line-height: 1; cursor: pointer; }
.la-pic:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.la-pic:disabled { opacity: .55; cursor: default; }
/* No tutoring promotions for students (learn-auth.js sets lx-student; wiki/st4s.md). */
.lx-student .cur-cta, .lx-student .sk-help { display: none !important; }
/* Mastree (mastree.nz and its preview host; lx-early.js sets html.lx-mastree): pine green as the accent (#17734f,
   5.8:1 on white; Vakkas chose it 25 Nov 2026), its wordmark, no tutoring offers. */
html.lx-mastree body:has(> .vh) { --accent: #17734f; }
html.lx-mastree { --blue: #17734f; --blue-deep: #125c3f; --blue-ink: #0c3a28; }
.lx-mastree .cur-cta, .lx-mastree .sk-help { display: none !important; }
.lx-mastree .vh-brand img { border-radius: 8px; }
.lx-mastree .vh-brand .lx-wm { font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.lx-mastree .vh-brand .lx-wm b { font-weight: inherit; color: var(--accent); }
.la-check { display: flex; align-items: flex-start; gap: 12px; font-size:var(--t-14); font-weight: 600; color: var(--ink); line-height: 1.4; }
.la-check input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.la-check a { color: var(--accent); }
.la-mfa { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.la-qr { width: 180px; height: 180px; align-self: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.la-apps { margin: 0; text-align: center; font-size:var(--t-14); color: var(--muted); }
.la-key { align-self: center; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); font: 700 var(--t-14) ui-monospace, Consolas, monospace; letter-spacing: 1px; overflow-wrap: anywhere; text-align: center; }

/* ---- Shared parts (15 Nov 2026): buttons, chips, forms, tables, phone tap targets ------------------------- */
body:has(> .vh) .btn { font-size: var(--t-16); }
body:has(> .vh) .exam-bar { background: var(--accent) !important; }
body:has(> .vh) a { text-underline-offset: 2px; }

/* Forms. One column, the label above its field, 420px at most. learn-shell.js adds a visible label to any
   field that only had a placeholder, checks a field when it loses focus (never while typing), and marks
   the button that was pressed as busy while its request runs. */
body:has(> .vh) :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea):not(.lw *, .gcp *, .sheet *) {
  min-height: var(--tap); padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: 500 var(--t-16) var(--font-body); box-sizing: border-box; max-width: 100%;
}
body:has(> .vh) :is(input, select, textarea):not(.lw *, .gcp *)::placeholder { color: var(--muted); opacity: 1; }
body:has(> .vh) :is(input, select, textarea):not(.lw *, .gcp *):hover:not(:disabled, :focus) { border-color: var(--muted); }
body:has(> .vh) :is(input, select, textarea):not(.lw *, .gcp *):focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 2px; }
body:has(> .vh) :is(input, select, textarea, button, .btn):disabled { opacity: .55; cursor: not-allowed; }
body:has(> .vh) :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--bad); border-width: 2px; background: var(--bad-soft); }
.fl-l { display: block; margin: 0 0 var(--s-1); font: 700 var(--t-14) var(--font-body); color: var(--ink); }
.fl-e { display: flex; gap: var(--s-2); margin: var(--s-1) 0 0; font: 600 var(--t-14) var(--font-body); color: var(--bad); }
.fl-e::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 800; font-size: var(--t-12); line-height: 18px; text-align: center; }
body:has(> .vh) :is(.join, .tadd, .ln-report form, .meetbox .join) { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-2); max-width: 420px; }
body:has(> .vh) :is(.join, .tadd) > :is(input, select, textarea, .btn, button) { width: 100%; flex: none; }
body:has(> .vh) .tform .fl { flex: none; font-size: var(--t-14); font-weight: 700; color: var(--ink); }
body:has(> .vh) :is(.la-field, .la-field span) { color: var(--ink); font-size: var(--t-14); }
body:has(> .vh) :is(.la-status.bad, #status.bad, .bad[role="status"]) { color: var(--bad); font-weight: 700; }
/* Busy: the pressed button gains a spinner and cannot be pressed twice. */
body:has(> .vh) [aria-busy="true"]:is(button, .btn) { position: relative; opacity: 1; cursor: progress; }
body:has(> .vh) [aria-busy="true"]:is(button, .btn)::after { content: ""; flex: none; width: 16px; height: 16px; margin-left: var(--s-2); border-radius: 50%; display: inline-block; vertical-align: -3px;
  border: 2px solid currentColor; border-right-color: transparent; animation: fl-spin .7s linear infinite; }
@keyframes fl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body:has(> .vh) [aria-busy="true"]::after { animation: none !important; border-style: dotted; border-right-color: currentColor; } }

/* Tables under 768px become one card a row: learn-shell.js copies each column heading onto its cells.
   A table with no heading row wraps its cells inside the card. Nothing scrolls sideways. */
@media (max-width: 767px) {
  body:has(> .vh) table:is(.vt-stack, .vt-plain) { display: block; width: 100%; min-width: 0; border: 0; overflow: visible; background: none; }
  body:has(> .vh) :is(.vt-stack, .vt-plain) :is(tbody, tfoot) { display: block; }
  body:has(> .vh) .vt-stack thead, body:has(> .vh) .vt-stack tr.vt-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body:has(> .vh) :is(.vt-stack, .vt-plain) tr { display: block; margin: 0 0 var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
  body:has(> .vh) .vt-stack :is(td, th) { display: flex; justify-content: space-between; gap: var(--s-4); width: auto; min-width: 0; padding: var(--s-1) 0; border: 0; background: none; text-align: right; white-space: normal; position: static; overflow-wrap: anywhere; }
  body:has(> .vh) .vt-stack :is(td, th)[data-label]::before { content: attr(data-label); flex: none; max-width: 50%; font-weight: 700; color: var(--muted); text-align: left; }
  body:has(> .vh) .vt-stack :is(td, th):not([data-label]) { justify-content: flex-start; text-align: left; font-weight: 700; }
  body:has(> .vh) .vt-plain tr { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
  body:has(> .vh) .vt-plain :is(td, th) { display: block; width: auto; min-width: 0; padding: 0; border: 0; background: none; white-space: normal; overflow-wrap: anywhere; }
  body:has(> .vh) :is(.tq-tb, .ln-tablewrap) { overflow: visible; }
}
/* Tap targets: 44px for anything pressed, on phones, tablets and any touch screen. A laptop with a mouse keeps its layout. */
@media (max-width: 1024px), (pointer: coarse) {
  body:has(> .vh) :is(button, [role="button"], select, summary, a.btn, .btn, input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"])) { min-height: var(--tap); }
  body:has(> .vh) :is(button, [role="button"], a.btn, .btn) { min-width: var(--tap); }
  body:has(> .vh) summary { display: flex; align-items: center; }
  body:has(> .vh) :is(input[type="checkbox"], input[type="radio"]) { width: 24px; height: 24px; }
  body:has(> .vh) label:has(> input:is([type="checkbox"], [type="radio"])) { min-height: var(--tap); display: flex; align-items: center; gap: var(--s-2); }
  body:has(> .vh) :is(.ly-years, .years, .sk-tabs) :is(a, button) { min-width: var(--tap); min-height: var(--tap); }
  body:has(> .vh) :is(.sm-tool, .ly-book, .yl-pdf, .ly-acts a, .vx-list a, .lw-card, .tool-nav a, .sm-years a, .ext-years a, .sm-lessons a) { min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
  body:has(> .vh) .sm-lessons a { justify-content: flex-start; }
  body:has(> .vh) :is(.vf a, .ln-crumbs a, .vh-nav a) { min-width: var(--tap); justify-content: center; }
  body:has(> .vh) input[type="range"] { min-height: var(--tap); }
  body:has(> .vh) .sm-lessons input[type="checkbox"] { margin: 12px; }
}
