/* iBrainy — training-workbook editorial system */
:root {
  --bg: #FAF8F2;
  --text: #22212B;
  --accent: #F2CF3A;
  --primary: #5636A8;
  --surface: #FFFFFF;

  --primary-dark: #432888;
  --primary-tint: #EFEAFA;
  --muted: #55535F;
  --line: #E4DFD2;
  --outline: #85818F;
  --rule: rgba(86, 54, 168, 0.13);
  --error: #A3203A;
  --success: #2B6B3E;

  --font-head: "Lexend", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 680px;
  --radius: 6px;
  --gutter: clamp(16px, 5vw, 32px);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
@media (min-width: 768px) { body { font-size: 18px; } }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.18;
  margin: 0 0 0.5em;
  text-wrap: balance;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem); }
p { margin: 0 0 1em; }
p, li { max-width: var(--measure); }

a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* highlighter mark: dark ink text on yellow, never yellow text */
.hl {
  background: linear-gradient(transparent 52%, var(--accent) 52%, var(--accent) 92%, transparent 92%);
  color: inherit;
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 242, 0.97);
  border-bottom: 1px solid var(--line);
}
.header__in { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; margin-right: auto; padding: 4px 0; }
.brand img { height: 38px; width: auto; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 2px solid var(--text); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: 600 15px/1 var(--font-body); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.site-nav { display: none; }
.site-header.is-open .site-nav {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-bottom: 2px solid var(--primary);
  padding: 8px var(--gutter) 20px;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { max-width: none; border-bottom: 1px solid var(--line); }
.site-nav a:not(.btn) {
  display: flex; align-items: center; min-height: 52px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.site-nav a[aria-current="page"]:not(.btn) { color: var(--primary); }
.site-nav a[aria-current="page"]:not(.btn)::after {
  content: ""; width: 28px; height: 8px; margin-left: 10px; background: var(--accent); border-radius: 2px;
}
.site-nav .btn { margin-top: 16px; width: 100%; }

@media (min-width: 1080px) {
  .nav-toggle { display: none; }
  .site-nav, .site-header.is-open .site-nav {
    display: flex; align-items: center; gap: 20px;
    position: static; padding: 0; border: 0; background: none; max-height: none; overflow: visible;
  }
  .site-nav ul { display: flex; gap: 4px; }
  .site-nav li { border: 0; }
  .site-nav a:not(.btn) { min-height: 44px; padding: 0 10px; font-size: 16px; position: relative; }
  .site-nav a[aria-current="page"]:not(.btn)::after {
    position: absolute; left: 10px; right: 10px; bottom: 6px; width: auto; height: 5px; margin: 0; z-index: -1;
  }
  .site-nav .btn { margin: 0; width: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border-radius: 8px; border: 2px solid var(--primary);
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s ease-out, color .15s ease-out, transform .15s ease-out;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 3px 3px 0 var(--text); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn--primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--text); }
.btn--ghost { background: var(--surface); color: var(--primary); }
.btn--ghost:hover { background: var(--primary-tint); color: var(--primary-dark); }
.btn--quiet { background: transparent; border-color: var(--outline); color: var(--text); }
.btn--quiet:hover { border-color: var(--text); color: var(--text); }
.btn--sm { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.btn--danger { background: var(--surface); color: var(--error); border-color: var(--error); }
.btn[aria-disabled="true"] { border-style: dashed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.link-arrow { font-weight: 600; }
.link-arrow::after { content: " →"; }

/* ---------- Sections and editorial grid ---------- */
.section { padding-block: 48px; }
@media (min-width: 768px) { .section { padding-block: 72px; } }
@media (min-width: 1024px) { .section { padding-block: 96px; } }
.section--tight { padding-block: 32px; }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }

.ed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ed > * { min-width: 0; }
@media (min-width: 1024px) {
  .ed { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .ed__main { grid-column: 1 / span 7; }
  .ed__note { grid-column: 9 / span 4; align-self: start; }
  .ed__full { grid-column: 1 / -1; }
}

.kicker {
  display: inline-block; margin: 0 0 12px;
  font: 600 15px/1.3 var(--font-body); color: var(--primary);
}
.lead { font-size: 1.12em; line-height: 1.6; }
.small { font-size: 15px; line-height: 1.5; }
.muted { color: var(--muted); }

/* Margin note: the "Check:" column */
.note {
  border-left: 2px dashed var(--primary);
  padding: 4px 0 4px 18px;
  font-size: 16px;
}
.note p { margin-bottom: 0.6em; }
.note__check { font-weight: 600; }
.note__check b, .check b { color: var(--primary); font-family: var(--font-head); font-weight: 600; }

/* ---------- Lesson card (signature) ---------- */
.lcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 18px 46px;
  margin-top: 20px;
  min-width: 0;
  box-shadow: 4px 4px 0 -1px var(--bg), 4px 4px 0 0 var(--line);
}
.lcard::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 28px; width: 2px;
  background: var(--primary); opacity: .85;
}
.lcard__tab {
  position: absolute; top: -17px; left: 44px;
  background: var(--primary-tint); color: var(--primary);
  border: 1px solid #D8CDF3; border-bottom: 0;
  border-radius: 6px 6px 0 0;
  padding: 2px 12px 3px;
  font: 600 13px/1.4 var(--font-body); letter-spacing: .02em;
}
.lcard__head {
  margin: -22px -20px 14px -46px;
  padding: 22px 20px 10px 46px;
  border-radius: var(--radius) var(--radius) 0 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, var(--rule) 23px, var(--rule) 24px);
}
.lcard__head h3, .lcard__head h2 { margin-bottom: 4px; }
.lcard__head p { margin: 0; color: var(--muted); font-size: 16px; }
.lcard > p:last-child, .lcard > ul:last-child { margin-bottom: 0; }
.check {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px dashed var(--outline);
  font-size: 16px;
}
.check b { margin-right: 6px; }
.lcard .link-arrow { display: inline-block; margin-top: 10px; }

.ticks { list-style: none; padding: 0; margin: 0 0 4px; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 6px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.45em;
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary);
  transform: rotate(-45deg);
}

.cards-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 12px; }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---------- Stamp badge ---------- */
.stamp {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 2px solid var(--primary);
  outline: 1px solid var(--primary); outline-offset: 3px;
  border-radius: 4px;
  padding: 6px 12px;
  color: var(--primary);
  font: 600 13px/1.35 var(--font-head);
  letter-spacing: .06em; text-transform: uppercase;
  max-width: 100%;
  margin: 6px 4px;
}
.stamp__sep { opacity: .6; }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .stamp { transform: rotate(-2deg); }
}

/* ---------- Hero ---------- */
.hero { padding-block: 32px 48px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; }
.hero__grid > * { min-width: 0; }
.hero h1 { margin-bottom: 18px; }
.hero__status {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 20px; font-size: 15px; color: var(--muted); max-width: 560px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 12px;
  font: 600 13px/1.5 var(--font-body); white-space: nowrap;
  border: 1px solid transparent;
}
.chip--early { background: var(--accent); color: var(--text); }
.chip--free { background: var(--surface); color: var(--success); border-color: var(--success); }
.chip--soon { background: var(--surface); color: var(--muted); border: 1px dashed var(--outline); }
.hero__art {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; position: relative;
}
.hero__art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
@media (min-width: 1024px) {
  .hero { padding-block: 56px 72px; }
  .hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .hero__text { grid-column: 1 / span 6; }
  .hero__art { grid-column: 7 / span 6; }
}

/* ---------- Figures ---------- */
.figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.figure img { width: 100%; border-radius: 4px; }
.figure--band img { aspect-ratio: 12 / 5; object-fit: cover; }
.figure--square img { aspect-ratio: 1 / 1; object-fit: cover; }
.figure--wide img { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; counter-reset: step; }
.steps li { max-width: none; position: relative; padding-left: 60px; min-width: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--accent); color: var(--text);
  border: 2px solid var(--text); border-radius: 6px 6px 2px 2px;
  font: 700 18px/1 var(--font-head);
}
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .steps li { padding-left: 0; padding-top: 58px; }
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; top: 20px; left: 56px; right: -12px;
    border-top: 2px dashed var(--primary); opacity: .5;
  }
}

.steps--stack { margin-top: 20px; gap: 14px; }
.steps--stack h3 { font-size: 1.05rem; }
@media (min-width: 900px) {
  .steps--stack { grid-template-columns: minmax(0, 1fr); }
  .steps--stack li { padding-left: 60px; padding-top: 0; }
  .steps--stack li:not(:last-child)::after { display: none; }
}

/* ---------- Privacy strip ---------- */
.privacy-strip { background: var(--primary); color: #fff; padding-block: 40px; }
.privacy-strip .stamp { color: #fff; border-color: #fff; outline-color: #fff; }
.privacy-strip h2 { color: #fff; margin-top: 14px; }
.privacy-strip p { color: #fff; }
.privacy-strip a { color: #fff; }
.privacy-strip :focus-visible { outline-color: var(--accent); }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 12px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.plan { display: flex; flex-direction: column; }
.plan .btn { margin-top: auto; align-self: flex-start; }
.plan .ticks { margin-bottom: 18px; }
.plan__status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.plan--first { border-color: var(--primary); }

/* ---------- Roadmap ---------- */
.roadmap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 12px; }
@media (min-width: 900px) { .roadmap { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; min-width: 0; }
.field label, .label {
  display: block; font-weight: 600; margin-bottom: 6px; font-size: 16px;
}
.field .hint { display: block; color: var(--muted); font-size: 15px; margin: -2px 0 8px; font-weight: 400; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; max-width: 100%;
  font: 400 17px/1.5 var(--font-body); color: var(--text);
  background: var(--surface);
  border: 1px solid var(--outline); border-radius: var(--radius);
  padding: 11px 12px; min-height: 48px;
}
textarea { resize: vertical; min-height: 120px; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
.field--error input, .field--error select, .field--error textarea { border: 2px solid var(--error); }
.field-error { color: var(--error); font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.field-error::before { content: "! "; }

input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 3px 0 0; }

.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.status { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.status--ok { color: var(--success); }
.status--err { color: var(--error); }

.error-summary {
  border: 3px solid var(--error); border-radius: var(--radius); background: var(--surface);
  padding: 16px 18px; margin-bottom: 20px;
}
.error-summary h2 { font-size: 1.15rem; margin-bottom: 8px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 600; }

/* Early-access block */
.ea { max-width: 820px; margin-inline: auto; }
.ea__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 8px; }
@media (min-width: 640px) { .ea__form { grid-template-columns: minmax(0, 1fr) auto; } }
.ea__form .field { margin: 0; }
.ea__consent { font-size: 15px; color: var(--muted); margin: 10px 0 0; }
.ea--compact .lcard__head h2 { font-size: 1.35rem; }

/* FAQ */
.faq { margin-top: 12px; border-top: 1px solid var(--line); max-width: 820px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item h3 { margin: 0; font-size: 1.05rem; }
.faq__q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; padding: 12px 0;
  background: none; border: 0; color: var(--text); text-align: left; cursor: pointer;
  font: 600 17px/1.4 var(--font-head);
}
.faq__q::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
  transform: rotate(45deg); transition: transform .15s ease-out; margin-right: 6px;
}
.faq__q[aria-expanded="true"]::after { transform: rotate(-135deg); }
.faq__a { padding: 0 0 16px; }
.faq__a p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 3px solid var(--primary); margin-top: 0; padding-top: 40px; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.footer__grid > * { min-width: 0; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.footer__brand img { height: 40px; width: auto; margin-bottom: 10px; }
.footer__brand p { color: var(--muted); font-size: 16px; }
.footer__h { font: 600 15px/1.4 var(--font-head); margin: 0 0 8px; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; font-size: 16px; }
.site-footer li a { display: inline-block; padding: 4px 0; overflow-wrap: anywhere; }
.footer__base {
  margin-top: 28px; padding-block: 18px 28px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  font-size: 15px; color: var(--muted);
}
.footer__base p { margin: 0; }

/* ---------- Page headers ---------- */
.page-head { padding-block: 32px 24px; }
.page-head__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
.page-head__grid > * { min-width: 0; }
@media (min-width: 1024px) {
  .page-head { padding-block: 56px 32px; }
  .page-head__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .page-head__text { grid-column: 1 / span 7; }
  .page-head__art { grid-column: 8 / span 5; }
  .page-head__art--sm { grid-column: 9 / span 4; }
}
.crumbs { font-size: 15px; margin-bottom: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- Tool workbook ---------- */
.workbook { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 40px; }
.workbook > * { min-width: 0; }
@media (min-width: 1024px) {
  .workbook { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
  .workbook--wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 18px 18px; position: relative; margin-top: 20px; }
.step__tab {
  position: absolute; top: -15px; left: 16px;
  background: var(--accent); color: var(--text); border: 2px solid var(--text);
  border-radius: 6px 6px 2px 2px; padding: 1px 10px;
  font: 700 13px/1.5 var(--font-head); letter-spacing: .04em;
}
.step h2 { font-size: 1.2rem; margin-bottom: 6px; }
.step > p.hint { color: var(--muted); font-size: 15px; }

.lines { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; max-height: 520px; overflow-y: auto; }
.lines li { max-width: none; min-width: 0; }
.line-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; min-height: 48px;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-size: 16px; line-height: 1.45;
  background: var(--surface);
}
.line-row:hover { border-color: var(--outline); }
.line-row.is-picked { background: var(--accent); border-color: var(--text); }
.line-row span { min-width: 0; overflow-wrap: anywhere; }

.counter {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: 15px;
  background: var(--primary-tint); color: var(--primary);
}
.counter.is-out { background: #FBE9EC; color: var(--error); }
.sample-note { font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.textlink { background: none; border: 0; padding: 4px 0; color: var(--primary); font: 600 15px/1.4 var(--font-body); text-decoration: underline; cursor: pointer; min-height: 32px; }

.msg { border-radius: var(--radius); padding: 10px 14px; margin: 12px 0 0; font-size: 15px; font-weight: 600; }
.msg:empty { display: none; }
.msg--err { background: #FBE9EC; color: var(--error); border: 1px solid #E8B6C0; }
.msg--info { background: var(--primary-tint); color: var(--primary-dark); border: 1px solid #D8CDF3; }
.msg--ok { background: #E7F3EA; color: var(--success); border: 1px solid #B9D9C2; }

/* Output sheet */
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  padding: 22px 18px 22px 48px;
  min-width: 0;
}
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 30px; width: 2px; background: var(--primary); }
.sheet__head {
  margin: -22px -18px 16px -48px; padding: 22px 18px 12px 48px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, var(--rule) 23px, var(--rule) 24px);
  border-bottom: 1px solid var(--line);
}
.sheet__label { font: 600 13px/1.4 var(--font-body); color: var(--primary); letter-spacing: .04em; margin: 0 0 4px; }
.sheet h2 { font-size: 1.45rem; margin-bottom: 2px; }
.sheet h3 { font-size: 1.05rem; margin: 20px 0 8px; color: var(--primary); }
.sheet .meta { font-size: 15px; color: var(--muted); margin: 0; }
.sheet ol, .sheet ul { padding-left: 22px; margin: 0; }
.sheet li { margin-bottom: 8px; }
.sheet .ghost { color: var(--muted); }
.edit {
  border-radius: 4px; padding: 2px 4px; margin: 0 -4px;
  outline: 1px dashed transparent;
}
.edit:hover { outline-color: var(--outline); }
.edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pair { margin: 0; }
.pair dt { font-weight: 700; display: inline; }
.pair dd { margin: 0 0 4px; display: inline; }
.sheet-hint { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
@media (min-width: 1024px) {
  .sheet--sticky { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
}

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 2px solid var(--primary);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 8px;
}
.action-bar .btn { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; font-size: 15px; }
.tool-page { padding-bottom: 128px; }
.tool-page.is-typing .action-bar { display: none; }
@media (min-width: 1024px) {
  .tool-page { padding-bottom: 0; }
  .action-bar, .tool-page.is-typing .action-bar {
    display: flex; position: static; border: 0; padding: 0; margin: 0 0 18px; background: none;
  }
  .action-bar .btn { flex: 0 1 auto; }
}

.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; z-index: 80; max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }
@media (min-width: 1024px) { .toast { bottom: 32px; } }

/* Quiz */
.mode-switch { display: inline-flex; border: 2px solid var(--primary); border-radius: 8px; overflow: hidden; margin: 8px 0 4px; max-width: 100%; flex-wrap: wrap; }
.mode-switch button {
  min-height: 46px; padding: 8px 18px; border: 0; background: var(--surface); color: var(--primary);
  font: 600 16px/1.2 var(--font-body); cursor: pointer;
}
.mode-switch button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 30px; }
.qlist > li { max-width: none; min-width: 0; }
.qcard fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.qcard legend { font-weight: 600; font-size: 16px; padding: 0; margin-bottom: 6px; }
.opt { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.opt input[type="text"] { flex: 1 1 auto; min-width: 0; }
.opt__letter { font: 700 15px/1 var(--font-head); width: 18px; flex: none; color: var(--primary); }
.issues { list-style: none; padding: 0; margin: 0 0 12px; font-size: 15px; }
.issues li { padding: 2px 0; }
.issues .err { color: var(--error); font-weight: 600; }
.issues .err::before { content: "! "; }
.issues .soft { color: var(--primary-dark); }
.issues .ok { color: var(--success); font-weight: 600; }
.qcard__tools { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px dashed var(--outline); padding-top: 12px; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; background: #FBE9EC; border-radius: var(--radius); }
.confirm p { margin: 0; font-weight: 600; color: var(--error); flex-basis: 100%; }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; margin: 14px 0; }
.preview { max-width: 760px; margin-inline: auto; }
.preview .opt-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; min-height: 48px; }
.preview .opt-row:hover { border-color: var(--outline); }
.preview .opt-row.is-sel { background: var(--accent); border-color: var(--text); }
.feedback { border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.feedback--ok { background: #E7F3EA; border: 1px solid #B9D9C2; }
.feedback--no { background: #FBE9EC; border: 1px solid #E8B6C0; }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback--ok strong { color: var(--success); }
.feedback--no strong { color: var(--error); }
.scenario-box { background: var(--primary-tint); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 12px; }

/* Practice cards */
.picker { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.picker legend { font: 600 1.2rem/1.3 var(--font-head); margin-bottom: 10px; padding: 0; }
.pick {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; min-height: 56px; background: var(--surface);
  border: 1px solid var(--outline); border-radius: var(--radius); cursor: pointer; min-width: 0;
}
.pick:hover { border-color: var(--text); }
.pick.is-sel { background: var(--accent); border-color: var(--text); }
.pick__name { font-weight: 600; display: block; }
.pick__desc { font-size: 15px; color: var(--muted); display: block; }
.pick.is-sel .pick__desc { color: var(--text); }
.pick-wrap { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.pick-wrap .pick { flex: 1 1 auto; }
.opening { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 0 0 8px; font-style: italic; }
.instr {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 16px 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, var(--rule) 23px, var(--rule) 24px);
  font-size: 16px;
}
.checklist { list-style: none; padding: 0 !important; margin: 0 0 14px; }
.checklist li { margin-bottom: 6px; max-width: none; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-height: 48px; }
.check-row.is-ticked { background: var(--accent); border-color: var(--text); }
.score { font: 700 1.25rem/1.3 var(--font-head); margin: 14px 0 4px; }
.tips li { margin-bottom: 10px; }

/* Prose pages */
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

.email-list { list-style: none; padding: 0; margin: 0; }
.email-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.email-list li:last-child { border-bottom: 0; }
.email-list a { font-weight: 600; overflow-wrap: anywhere; }
.email-list span { display: block; font-size: 15px; color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.contact-grid > * { min-width: 0; }
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: start; }
  .contact-grid aside { position: sticky; top: calc(var(--header-h) + 24px); }
}
.success-panel { background: #E7F3EA; border: 1px solid #B9D9C2; border-radius: var(--radius); padding: 20px; }
.success-panel h2 { color: var(--success); font-size: 1.3rem; }

.print-only { display: none; }

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

@media print {
  .site-header, .site-footer, .no-print, .skip, .action-bar, .toast { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; padding: 0 !important; }
  .sheet { border: 0; padding: 0 0 0 28px; position: static; max-height: none; overflow: visible; }
  .sheet::before { left: 8px; }
  .sheet__head { margin: 0 0 12px -28px; padding: 0 0 8px 28px; }
  .workbook { display: block; padding: 0; }
  .wrap { padding: 0; max-width: none; }
  .print-only { display: block; }
  .print-break { break-before: page; }
  .edit { outline: none !important; }
  a { color: #000; }
}
