/* Kerri University — shared styles. Phone first; wider layouts in min-width queries. */

:root {
  color-scheme: light;
  --navy: #F3EDEE;
  --navy-2: #E9E0E3;          /* hover on navy */
  --on-navy: #231A1D;
  --on-navy-2: #4A3A40;
  --gold: #C2185B;
  --gold-hover: #9E1450;
  --on-gold: #FFFFFF;
  --gold-ink: #8C1147;
  --paper: #E9E4E5;
  --surface: #FAF7F8;
  --ink: #231A1D;
  --ink-2: #4A3A40;
  --line: #D6CACE;
  --line-strong: #9C8C92;
  --ok-bg: #E2F1E8;
  --ok-ink: #17492F;
  --thumb: #E5D8DC;
  --thumb-ink: #4A3A40;
  --focus: #1B5FD6;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --radius: 4px;
  --fast: 120ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #1A1919; --navy-2: #2C2B2B; --on-navy: #F5F5F5; --on-navy-2: #D0D0D0;
    --gold: #E2557D; --gold-hover: #EA7395; --on-gold: #1A0A0F; --gold-ink: #F07FA0;
    --paper: #121212; --surface: #1C1B1B; --ink: #F5F5F5; --ink-2: #D0D0D0;
    --line: #333232; --line-strong: #5C5A5A; --ok-bg: #123526; --ok-ink: #B9E6CB;
    --thumb: #262525; --thumb-ink: #C4C4C4; --focus: #7FB0FF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #1A1919; --navy-2: #2C2B2B; --on-navy: #F5F5F5; --on-navy-2: #D0D0D0;
  --gold: #E2557D; --gold-hover: #EA7395; --on-gold: #1A0A0F; --gold-ink: #F07FA0;
  --paper: #121212; --surface: #1C1B1B; --ink: #F5F5F5; --ink-2: #D0D0D0;
  --line: #333232; --line-strong: #5C5A5A; --ok-bg: #123526; --ok-ink: #B9E6CB;
  --thumb: #262525; --thumb-ink: #C4C4C4; --focus: #7FB0FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.header :focus-visible, .hero :focus-visible, .access-head :focus-visible { outline-color: var(--gold); }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.35em;
  font: 700 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  border-radius: var(--radius); border: 2px solid transparent;
  transition: background-color var(--fast), border-color var(--fast), color var(--fast);
}
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-ghost { border-color: var(--on-navy); color: var(--on-navy); background: transparent; }
.btn-ghost:hover { background: var(--navy-2); }
.btn-navy { background: var(--navy); color: var(--on-navy); }
.btn-navy:hover { background: var(--navy-2); }
.btn-line { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-line:hover { border-color: var(--ink-2); }
.btn-block { width: 100%; }
.btn:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.header { background: var(--navy); color: var(--on-navy); border-bottom: 1px solid var(--navy-2); position: relative; z-index: 20; }
.header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand .crest { width: 40px; height: 40px; color: var(--gold); }
.brand-name { font: 700 1.05rem/1.05 var(--serif); letter-spacing: .14em; text-transform: uppercase; }
.brand-name small { display: block; font-size: .62rem; letter-spacing: .32em; color: var(--on-navy-2); margin-top: 3px; }
.nav { display: none; }
.nav a, .signin { text-decoration: none; color: var(--on-navy); padding: 8px 2px; border-bottom: 2px solid transparent; transition: border-color var(--fast); }
.nav a:hover, .signin:hover { border-bottom-color: var(--gold); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions .btn { display: none; }
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  background: transparent; color: var(--on-navy); border: 1px solid var(--navy-2); border-radius: var(--radius); cursor: pointer;
}
.menu-btn .icon { width: 24px; height: 24px; }
.drawer { background: var(--navy); color: var(--on-navy); border-top: 1px solid var(--navy-2); }
.drawer ul { list-style: none; margin: 0; padding: 8px 0 20px; }
.drawer a:not(.btn) { display: block; padding: 14px 0; text-decoration: none; font-size: 1.125rem; border-bottom: 1px solid var(--navy-2); }
.drawer .btn { margin-top: 16px; }

@media (min-width: 960px) {
  .header .wrap { min-height: 80px; gap: 40px; }
  .brand .crest { width: 48px; height: 48px; }
  .brand-name { font-size: 1.3rem; }
  .nav { display: flex; gap: 32px; margin-right: auto; }
  .brand { margin-right: 0; }
  .header-actions .btn { display: inline-flex; }
  .menu-btn, .drawer { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: var(--on-navy); }
.hero .wrap { display: grid; gap: 28px; padding-block: 36px 0; }
.hero h1 { font-size: clamp(2.5rem, 9vw, 4.75rem); line-height: 1.02; letter-spacing: -0.025em; }
.hero h1 .gold { color: var(--gold-ink); display: block; }
.hero-lede { font-size: 1.125rem; color: var(--on-navy); max-width: 34ch; margin-top: 18px; }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.hero-art { margin-inline: calc(var(--gutter) * -1); }
.hero-art .ph { aspect-ratio: 4 / 3; border-radius: 0; }
@media (min-width: 560px) {
  .hero-ctas { flex-direction: row; flex-wrap: wrap; }
}
@media (min-width: 960px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; align-items: stretch; gap: 48px; padding-block: 0; }
  .hero-copy { padding-block: 72px 80px; align-self: center; }
  .hero-lede { font-size: 1.25rem; }
  .hero-art { margin: 0 calc((100vw - min(100vw, var(--max))) / -2 - var(--gutter)) 0 0; }
  .hero-art .ph { height: 100%; aspect-ratio: auto; min-height: 420px; }
  .hero-art .ph .art-illustration { object-fit: contain; }
}

/* ---------- Photo placeholders (flat; swap for real photos) ---------- */
.ph {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: var(--thumb); color: var(--thumb-ink); border-radius: var(--radius);
}
.ph .icon { width: 44px; height: 44px; opacity: .9; }
.ph.art-placeholder { isolation: isolate; }
.ph .art-illustration { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ph figcaption, .ph .ph-note {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  font-size: .78rem; line-height: 1.3; color: var(--thumb-ink);
}
.hero .ph { background: #E5D8DC; color: #4A3A40; }
.hero .ph .ph-note { color: #4A3A40; }
.hero .ph.art-hero .ph-note { z-index: 1; right: auto; width: fit-content; max-width: calc(100% - 32px); padding: 8px 10px; background: #FAF7F8; color: #231A1D; border-left: 3px solid #8C1147; }
:root[data-theme="dark"] .hero .ph { background: #262525; color: #D0D0D0; } :root[data-theme="dark"] .hero .ph .ph-note { color: #D0D0D0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .ph { background: #262525; color: #D0D0D0; } :root:not([data-theme="light"]) .hero .ph .ph-note { color: #D0D0D0; } }
.hero .ph.art-hero { background: #E5D8DC; }
:root[data-theme="dark"] .hero .ph.art-hero { background: #E5D8DC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .ph.art-hero { background: #E5D8DC; } }

/* ---------- Value props ---------- */
.props { background: var(--surface); border-bottom: 1px solid var(--line); }
.props ul { list-style: none; margin: 0; padding: 0; display: grid; }
.props li { display: grid; grid-template-columns: 40px 1fr; gap: 4px 16px; padding-block: 22px; border-top: 1px solid var(--line); }
.props li:first-child { border-top: 0; }
.props .icon { width: 36px; height: 36px; color: var(--gold-ink); grid-row: span 2; }
.props h2 { font-size: 1.25rem; }
.props p { color: var(--ink-2); }
@media (min-width: 800px) {
  .props ul { grid-template-columns: repeat(3, 1fr); }
  .props li { border-top: 0; border-left: 1px solid var(--line); padding: 30px 28px; }
  .props li:first-child { border-left: 0; padding-left: 0; }
  .props .icon { width: 44px; height: 44px; }
  .props li { grid-template-columns: 48px 1fr; }
}

/* ---------- Section heads ---------- */
.section { padding-block: 48px; }
.section-head { display: grid; gap: 12px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(2rem, 6vw, 2.9rem); }
.section-head .rule { width: 56px; height: 3px; background: var(--gold); border: 0; margin: 4px 0 0; }
.section-head p { color: var(--ink-2); max-width: 44ch; font-size: 1.0625rem; }
.label { font: 700 .78rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }

/* ---------- Course list (rows on phone, columns on desktop) ---------- */
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.course {
  display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  position: relative;
}
.course .ph { aspect-ratio: 1; }
.course .ph .icon { width: 32px; height: 32px; }
.course h3 { font-size: 1.2rem; line-height: 1.2; margin-top: 4px; }
.course h3 a { text-decoration: none; }
.course h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link */
.course:hover { border-color: var(--line-strong); }
.course-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; white-space: nowrap; margin-top: 8px; color: var(--ink-2); font-size: .95rem; }
.course-meta .price { font: 700 1.3rem/1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.course .view { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.course .tag { display: flex; width: fit-content; margin-top: 6px; font-size: .75rem; padding: 2px 8px; }
.course .tag::before { display: none; }

@media (min-width: 760px) {
  .featured { display: grid; grid-template-columns: 1fr; gap: 32px; }
  .courses { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .course { grid-template-columns: 1fr; padding: 0; gap: 0; overflow: hidden; }
  .course .ph { aspect-ratio: 16 / 10; border-radius: 0; }
  .course .ph .icon { width: 44px; height: 44px; }
  .course-body { padding: 18px 20px 20px; }
  .course-meta { justify-content: space-between; align-items: center; margin-top: 14px; }
  .course h3 { min-height: 2.4em; }
  .course .view { display: flex; flex-basis: 100%; min-height: 44px; font-size: .95rem; }
  .course .tag { position: absolute; top: 12px; right: 12px; margin: 0; font-size: .8rem; padding: 3px 9px; }
  .course .tag::before { display: block; }
}
@media (min-width: 1100px) {
  .featured { grid-template-columns: 300px 1fr; align-items: start; }
  .featured .section-head { position: sticky; top: 24px; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--ink-2); font-size: .95rem; }
.footer .wrap { display: grid; gap: 18px; }
.footer .brand { color: var(--ink); }
.footer .brand .crest { width: 32px; height: 32px; color: var(--gold-ink); }
.footer .brand-name { font-size: .95rem; }
.footer .brand-name small { color: var(--ink-2); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer nav a { text-decoration: none; padding-block: 6px; }
.footer nav a:hover { text-decoration: underline; }
@media (min-width: 760px) {
  .footer .wrap { grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; }
  .footer nav { justify-content: center; }
}

/* =========================================================
   Course page
   ========================================================= */
.crumbs { font-size: .92rem; color: var(--ink-2); padding-block: 16px 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.cp { display: grid; gap: 32px; padding-block: 16px 120px; }
.cp-title { font-size: clamp(2.3rem, 8.5vw, 4.25rem); line-height: 1.02; letter-spacing: -0.025em; margin-top: 10px; }
.cp-title .gold { display: block; color: var(--gold-ink); }
.cp-lede { font-size: 1.15rem; color: var(--ink-2); max-width: 40ch; margin-top: 14px; }
.cp-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; color: var(--ink-2); font-size: .95rem; }
.cp-facts b { color: var(--ink); }

.player-ph { aspect-ratio: 16 / 9; margin-top: 24px; margin-inline: calc(var(--gutter) * -1); border-radius: 0; background: #2C2B2B; color: #D0D0D0; }
.player-ph .badge { position: absolute; top: 12px; left: 12px; background: var(--navy); color: var(--on-navy); font: 700 .75rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 8px 10px; border-radius: 3px; }
.player-ph .bigplay { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #C2185B; color: #fff; border: 3px solid #fff; cursor: pointer; transition: background-color var(--fast); }
.player-ph .bigplay:hover { background: #9E1450; }
.player-ph .bigplay .icon { width: 30px; height: 30px; margin-left: 4px; opacity: 1; }
.player-ph .ph-note { text-align: center; left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; background: rgba(18,18,18,.82); color: #F3F5F9; padding: 6px 12px; border-radius: 3px; font-size: .9rem; white-space: nowrap; }
@media (min-width: 700px) { .player-ph { margin-inline: 0; border-radius: var(--radius); } }

.lessons h2 { font-size: 1.75rem; margin-bottom: 14px; }
.lesson-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lesson-list li { border-top: 1px solid var(--line); }
.lesson-list .row { display: grid; grid-template-columns: 3.9rem 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; text-decoration: none; }
a.row:hover { background: var(--paper); }
.lesson-list li:first-child { border-top: 0; }
.lesson-list .n { white-space: nowrap; font: 600 1.05rem/1 var(--serif); color: var(--gold-ink); font-variant-numeric: tabular-nums; border-right: 1px solid var(--line); padding-right: 10px; }
.lesson-list .t { font-size: 1.05rem; }
.lesson-list .t small { display: block; color: var(--ink-2); font-size: .88rem; }
.lesson-list .end { display: flex; align-items: center; gap: 10px; color: var(--gold-ink); }
.lesson-list .end .icon { width: 26px; height: 26px; }
.lesson-list a.row .end { color: var(--ink); }
.lesson-list .end .done { color: var(--ok-ink); }
.lesson-list .tag::before { display: none; }

/* Access panel */
.access { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 16px; }
.access-head { background: var(--navy); color: var(--on-navy); padding: 22px 24px; }
.access-head h2 { font-size: 2rem; }
.access-body { padding: 24px; display: grid; gap: 18px; }
.price-big { font: 700 3.6rem/1 var(--serif); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price-note b { display: block; font-size: 1.15rem; }
.price-note span { color: var(--ink-2); }
.paywith { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .92rem; color: var(--ink-2); }
.paywith span { display: inline-flex; align-items: center; gap: 6px; }
.paywith .icon { width: 18px; height: 18px; color: var(--ok-ink); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.access h3 { font-size: 1.6rem; }
.access .sub { color: var(--ink-2); margin-top: 6px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: .92rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.field { position: relative; display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field .icon { position: absolute; left: 14px; bottom: 14px; width: 20px; height: 20px; color: var(--ink-2); pointer-events: none; }
.field input {
  width: 100%; min-height: 50px; padding: 12px 48px 12px 44px;
  font: 400 1.0625rem var(--sans); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color var(--fast);
}
.field input::placeholder { color: var(--ink-2); }
.field input:hover { border-color: var(--ink-2); }
.field input:focus-visible { outline-offset: 1px; }
.reveal { position: absolute; right: 4px; bottom: 3px; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--ink-2); cursor: pointer; border-radius: var(--radius); }
.reveal .icon { position: static; width: 22px; height: 22px; }
.fine { font-size: .92rem; color: var(--ink-2); text-align: center; }
.fine a { color: var(--ink); font-weight: 700; }

/* Phone order: intro, lessons, then the access panel the buy bar jumps to */
.lessons { order: 1; }
.access { order: 2; }
.has-buybar { padding-bottom: 76px; }

/* Sticky buy bar — phones only */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px;
}
.buybar .p { font: 700 1.5rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.buybar .p small { display: block; font: 400 .8rem/1.3 var(--sans); color: var(--ink-2); }
.buybar .btn { margin-left: auto; flex: 1; max-width: 240px; }

@media (min-width: 1000px) {
  .cp { grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; align-items: start; padding-bottom: 72px; }
  .access { position: sticky; top: 24px; grid-row: 1 / span 2; grid-column: 2; }
  .buybar { display: none; }
  .has-buybar { padding-bottom: 0; }
}

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


/* ===== Shared additions ===== */
.demo-bar { background: var(--gold); color: var(--on-gold); font-size: .88rem; }
.demo-bar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding-block: 6px; }
.linkish { background: none; border: 0; padding: 6px 0; font: 700 .88rem var(--sans); color: inherit; text-decoration: underline; cursor: pointer; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); font: 700 1.1rem var(--serif); text-decoration: none; }
.stack { display: grid; gap: 12px; }
.form-error { color: #9B1C1C; background: #FDECEC; border-left: 4px solid #B42318; padding: 8px 12px; font-size: .95rem; }
:root[data-theme="dark"] .form-error { color: #FFD4D4; background: #3A1414; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-error { color: #FFD4D4; background: #3A1414; } }
.btn-big { min-height: 56px; font-size: 1.1rem; }
.btn-sm { min-height: 38px; padding: .4em .9em; font-size: .9rem; }
.btn-danger { border-color: #B42318; color: #B42318; }
.tag-own { background: var(--gold); color: var(--on-gold); }
.tag-own::before { display: none; }
.tag-muted { background: var(--thumb); color: var(--ink-2); }
.tag-muted::before { display: none; }
.fine .icon { width: 1em; height: 1em; vertical-align: -2px; }
.fine.left { text-align: left; }
.narrow { max-width: 560px; padding-block: 24px 56px; }
.narrow-wide { max-width: 880px; }
.site-tour {
  position: fixed; inset: auto 24px 24px auto; z-index: 50;
  width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
  overflow: auto; margin: 0; padding: 28px 24px 24px; border: 2px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.site-tour[open] { display: block; }
.site-tour .tour-art { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line); background: var(--thumb); color: var(--gold-ink); }
.site-tour .tour-art .icon { width: 34px; height: 34px; }
.site-tour-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.site-tour-close .icon { width: 20px; height: 20px; }
.site-tour .tour-progress { margin-top: 18px; color: var(--ink-2); font-size: .92rem; font-weight: 700; }
.site-tour h2 { margin-top: 6px; padding-right: 36px; font-size: clamp(1.7rem, 5vw, 2.15rem); }
.site-tour h2:focus { outline: none; }
.site-tour .tour-description { max-width: 60ch; margin-top: 12px; }
.site-tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.site-tour-actions .btn { flex: 0 1 auto; }
.site-tour-actions [data-tour-skip] { border-color: transparent; background: transparent; color: var(--ink); text-decoration: underline; }
.site-tour [hidden] { display: none !important; }
.tour-replay { margin-block: 16px 24px; }
.tour-replay .btn { min-height: 44px; }
@media (max-width: 420px) {
  .site-tour { inset: auto 16px 16px; padding: 22px 18px 18px; }
  .site-tour .tour-art { width: 56px; height: 56px; }
  .site-tour-actions { justify-content: flex-start; }
  .site-tour-actions [data-tour-skip] { margin-left: auto; }
}
@media (max-width: 959px) {
  .has-tabbar .site-tour { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
.page-title { font-size: clamp(2.1rem, 7vw, 3.4rem); letter-spacing: -0.02em; }
.page-lede { color: var(--ink-2); font-size: 1.1rem; margin-top: 8px; max-width: 60ch; }
.block { margin-top: 40px; }
.block > h2 { font-size: 1.65rem; margin-bottom: 16px; }
.bar { height: 8px; background: var(--thumb); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.progress-row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); font-size: .95rem; margin-bottom: 8px; }
.empty { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; justify-items: start; }
.tabbar { display: none; }
@media (max-width: 959px) {
  .has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; text-decoration: none; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
  .tabbar a .icon { width: 24px; height: 24px; }
  .tabbar a[aria-current] { color: var(--ink); box-shadow: inset 0 3px 0 var(--gold); }
}

/* course page preview now a link with poster */
.player-ph { text-decoration: none; }
.player-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-ph .bigplay { position: relative; }
.player-ph:hover .bigplay { background: #9E1450; }

/* sign in */
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 22px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 2.4rem; }
.auth-card .sub { color: var(--ink-2); }

/* ===== Checkout ===== */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; padding-block: 6px; margin-bottom: 8px; }
.back:hover { color: var(--ink); text-decoration: underline; }
#co h1 { font-size: clamp(2rem, 7vw, 2.8rem); margin-bottom: 20px; }
#co h1:focus { outline: none; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; display: grid; gap: 14px; }
.sum-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.sum-item b { display: block; font: 700 1.15rem/1.25 var(--serif); }
.sum-item span { color: var(--ink-2); font-size: .95rem; }
.sum-thumb { aspect-ratio: 1; }
.sum-thumb .icon { width: 28px; height: 28px; }
.summary dl { margin: 0; display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.summary dl div { display: flex; justify-content: space-between; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary .total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-weight: 700; font-size: 1.2rem; }
.summary .total dt { color: var(--ink); }
.methods { border: 0; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.methods legend { font: 700 1.3rem var(--serif); margin-bottom: 12px; padding: 0; }
.method { position: relative; display: block; cursor: pointer; }
.method input { position: absolute; opacity: 0; inset: 0; }
.m-body { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 16px; border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); transition: border-color var(--fast); }
.m-body .icon { width: 32px; height: 32px; color: var(--gold-ink); }
.m-body b { display: block; }
.m-body small { color: var(--ink-2); font-size: .93rem; line-height: 1.45; display: block; }
.method:hover .m-body { border-color: var(--ink-2); }
.method input:checked + .m-body { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft, var(--surface)); }
.method input:focus-visible + .m-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.sim { display: flex; gap: 10px; align-items: flex-start; background: var(--ok-bg); color: var(--ok-ink); padding: 12px 14px; border-radius: var(--radius); margin-bottom: 20px; font-size: .97rem; }
.sim .icon { margin-top: 2px; }
.invoice { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.qr { aspect-ratio: 1; border: 2px dashed var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--ink-2); }
.qr .icon { width: 40px; height: 40px; }
.inv-amt { font: 700 1.6rem var(--serif); font-variant-numeric: tabular-nums; }
.addr { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: .85rem; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.status { display: grid; gap: 16px; justify-items: start; padding-top: 16px; }
.status p { max-width: 52ch; }
.st-icon { width: 56px; height: 56px; color: var(--gold-ink); }
.status.ok .st-icon { color: var(--ok-ink); }
.status.bad .st-icon { color: #B42318; }
.status .btn { justify-self: stretch; }

/* ===== My learning ===== */
.owned { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.own-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.own-card .ph { aspect-ratio: 16 / 7; border-radius: 0; }
.badge-own { position: absolute; top: 10px; left: 10px; background: var(--gold); color: var(--on-gold); font-weight: 700; font-size: .8rem; padding: 3px 9px; border-radius: 3px; }
.own-body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.own-body h3 { font-size: 1.3rem; }
.own-body h3 a { text-decoration: none; }
.own-body h3 a:hover { text-decoration: underline; }
.own-body .progress-row { margin: 0; }
.more { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.more-item { display: grid; grid-template-columns: 88px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.more-item .ph { aspect-ratio: 1; }
.more-item .ph .lk { width: 28px; height: 28px; }
.more-item h3 { font-size: 1.15rem; }
.more-item h3 a { text-decoration: none; }
.more-item p { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }
.more-item .course-meta { justify-content: space-between; align-items: center; }
.more-item .btn { min-height: 42px; padding: .45em 1.1em; }
@media (min-width: 760px) {
  .owned, .more { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* ===== Account ===== */
.kv { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kv div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.kv div:first-child { border-top: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.orders { width: 100%; border-collapse: collapse; min-width: 620px; }
.orders th, .orders td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.orders thead th { border-top: 0; font-size: .9rem; color: var(--ink-2); }
.orders td small { display: block; color: var(--ink-2); font-size: .82rem; }
.orders .num { text-align: right; font-variant-numeric: tabular-nums; }
.devices { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.devices li:first-child { border-top: 0; }
.devices small { display: block; color: var(--ink-2); }
.acct-actions { margin-top: 32px; justify-items: start; }

/* ===== Lesson page ===== */
.lp { padding-bottom: 48px; }
.lp-title { font-size: clamp(1.9rem, 6vw, 3rem); margin: 8px 0 18px; }
.lp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.player { position: relative; background: #000; margin-inline: calc(var(--gutter) * -1); overflow: hidden; user-select: none; -webkit-user-select: none; }
.player:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; margin: 0; }
.player:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; margin: 0; }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player:fullscreen { display: flex; flex-direction: column; justify-content: center; }
.player:fullscreen video { flex: 1; min-height: 0; aspect-ratio: auto; height: auto; }
.player.is-locked { aspect-ratio: 16 / 9; }
.player video::cue { background: rgba(18, 18, 18, .86); color: #fff; font-family: var(--sans); font-size: 1.05rem; line-height: 1.4; }
.wm { position: absolute; z-index: 2; pointer-events: none; color: rgba(255, 255, 255, .34); font: 700 .85rem var(--sans); letter-spacing: .04em; white-space: nowrap; }
.p-big { position: absolute; z-index: 3; left: 50%; top: calc(50% - 26px); transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; border: 3px solid #fff; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color var(--fast); }
.p-big:hover { background: #3A3939; }
.p-big .icon { width: 32px; height: 32px; margin-left: 4px; }
.p-big[hidden] { display: none !important; }
.p-bar { position: relative; z-index: 4; height: 52px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: #121212; color: #F3F5F9; }
.p-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: inherit; border-radius: var(--radius); cursor: pointer; font: 700 .9rem var(--sans); transition: background-color var(--fast); }
.p-btn:hover { background: #3A3939; }
.p-btn .icon { width: 22px; height: 22px; }
.p-btn:focus-visible, .p-seek:focus-visible, .p-vol:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.p-cc.on { background: var(--gold); color: var(--on-gold); }
.p-cc.on:hover { background: #E7BD62; }
.p-time { flex: none; font-size: .85rem; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.p-seek, .p-vol { -webkit-appearance: none; appearance: none; height: 44px; background: transparent; cursor: pointer; margin: 0; }
.p-seek { flex: 1; min-width: 60px; }
.p-vol { width: 72px; display: none; }
.p-seek::-webkit-slider-runnable-track, .p-vol::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #DDAE4A var(--fill, 0%), #5C5A5A var(--fill, 0%)); }
.p-seek::-moz-range-track, .p-vol::-moz-range-track { height: 6px; border-radius: 99px; background: #5C5A5A; }
.p-seek::-moz-range-progress, .p-vol::-moz-range-progress { height: 6px; border-radius: 99px; background: #DDAE4A; }
.p-seek::-webkit-slider-thumb, .p-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #DDAE4A; border: 2px solid #121212; margin-top: -6px; }
.p-seek::-moz-range-thumb, .p-vol::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #DDAE4A; border: 2px solid #121212; }
.p-speed-wrap { position: relative; flex: none; }
.p-speed { width: auto; min-width: 48px; padding: 0 8px; }
.p-menu { position: absolute; right: 0; bottom: 50px; list-style: none; margin: 0; padding: 6px; background: #121212; border: 1px solid #5C5A5A; border-radius: var(--radius); min-width: 96px; }
.p-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #F3F5F9; font: 400 .95rem var(--sans); padding: 10px 12px; border-radius: 3px; cursor: pointer; }
.p-menu button:hover, .p-menu button:focus-visible { background: #3A3939; outline: none; }
.p-menu button[aria-checked="true"] { color: #DDAE4A; font-weight: 700; }
.player.is-locked { background: var(--navy); }
.p-locked { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px; text-align: center; color: var(--on-navy); }
.p-locked .lk-big { width: 44px; height: 44px; color: var(--gold); }
@media (max-width: 420px) {
  .demo-who { display: none; }
  .p-mute-hide, #p-mute { display: none; }
  .p-time { font-size: .78rem; padding: 0 2px; }
  .p-bar { gap: 0; padding: 0 2px; }
}
@media (min-width: 700px) {
  .player { margin-inline: 0; border-radius: var(--radius); }
  .p-vol { display: block; }
}

.lp-head { display: grid; gap: 14px; margin-top: 22px; }
.lp-head h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-top: 4px; }
.lp-head .btn { justify-self: stretch; }
@media (min-width: 700px) {
  .lp-head { grid-template-columns: 1fr auto; align-items: end; }
  .lp-head .btn { justify-self: end; }
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 24px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; font: 700 1rem var(--sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: color var(--fast), border-color var(--fast); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tabpanel { padding-top: 18px; max-width: 68ch; }
.res { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.res .icon { color: var(--ink-2); }
.res .btn { min-height: 40px; padding: .4em .9em; font-size: .9rem; }
.tr { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; }
.tr button { background: none; border: 0; padding: 2px 0; color: var(--gold-ink); font: 700 .95rem var(--sans); text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; }

.lp-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 18px 10px; }
.side-head h2 { font-size: 1.5rem; }
.side-head span { color: var(--ink-2); font-size: .92rem; }
.side-bar { margin: 0 18px 14px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-top: 1px solid var(--line); }
.side-list a, .side-list .row { display: grid; grid-template-columns: 2.4rem 1fr; gap: 10px; padding: 14px 18px; text-decoration: none; border-left: 4px solid transparent; }
.side-list a:hover { background: var(--paper); }
.side-list .current a { border-left-color: var(--gold); background: var(--paper); }
.side-list .n { font: 600 1rem var(--serif); color: var(--gold-ink); padding-top: 2px; }
.side-list .tt { display: block; font-weight: 700; line-height: 1.35; }
.side-list .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.side-list .meta .icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.side-list .now { color: var(--gold-ink); font-weight: 700; }
.side-list .ok { color: var(--ok-ink); font-weight: 700; }
@media (min-width: 1000px) {
  .lp-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 40px; }
  .lp-side { position: sticky; top: 24px; }
}

/* =========================================================
   Admin
   ========================================================= */
.wrap-wide { padding-inline: var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding-block: 6px; }
.demo-links { display: inline-flex; gap: 18px; }
.adm { display: grid; min-height: 100vh; }
.adm-side { background: var(--navy); color: var(--on-navy); padding: 12px var(--gutter) 0; display: grid; gap: 8px; }
.adm-side .brand .crest { width: 36px; height: 36px; color: var(--gold); }
.adm-nav { display: flex; gap: 4px; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.adm-nav a { flex: none; color: var(--on-navy); text-decoration: none; padding: 12px 12px; border-bottom: 3px solid transparent; font-weight: 700; transition: border-color var(--fast), background-color var(--fast); }
.adm-nav a:hover { background: var(--navy-2); }
.adm-nav a[aria-current] { border-bottom-color: var(--gold); }
.adm-side :focus-visible { outline-color: var(--gold); }
.adm-main { padding: 24px var(--gutter) 64px; min-width: 0; }
.adm-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 22px; }
.adm-top h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.adm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 960px) {
  .adm { grid-template-columns: 240px minmax(0, 1fr); }
  .adm-side { align-content: start; padding: 24px 0; position: sticky; top: 0; height: 100vh; }
  .adm-side .brand { padding: 0 20px 18px; border-bottom: 1px solid var(--navy-2); }
  .adm-nav { flex-direction: column; margin: 12px 0 0; padding: 0; overflow: visible; gap: 0; }
  .adm-nav a { border-bottom: 0; border-left: 4px solid transparent; padding: 12px 20px; }
  .adm-nav a[aria-current] { border-left-color: var(--gold); background: var(--navy-2); }
  .adm-main { padding: 36px 40px 80px; }
}
.adm-main .page-lede { font-size: 1rem; margin: 0 0 16px; }
.adm-main .tabs { margin-top: 8px; }
.tabpanel.wide { max-width: 820px; }
.tabs .count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--thumb); color: var(--ink); font-size: .8rem; }
.tabs button:disabled { opacity: .55; cursor: not-allowed; }

.chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--thumb); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: #FBEBC8; color: #5E4208; }
.chip.bad { background: #FDE2E0; color: #8A1C12; }
:root[data-theme="dark"] .chip.warn { background: #3A2C0B; color: #F3D48C; }
:root[data-theme="dark"] .chip.bad { background: #3A1414; color: #FFC9C4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip.warn { background: #3A2C0B; color: #F3D48C; }
  :root:not([data-theme="light"]) .chip.bad { background: #3A1414; color: #FFC9C4; }
}

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; }
.t-label { color: var(--ink-2); font-size: .92rem; }
.t-value { font: 700 2rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.t-note { color: var(--ink-2); font-size: .85rem; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.adm-cols { display: grid; gap: 24px; }
@media (min-width: 1100px) { .adm-cols { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { font-size: 1.35rem; }
.panel-head a { font-weight: 700; }
.panel .table-scroll { border: 0; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl thead th { border-top: 0; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.tbl td small { display: block; color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.orders-tbl { min-width: 760px; background: var(--surface); }
.orders-tbl .act small { max-width: 16ch; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 11px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.feed li:first-child { border-top: 0; }
.f-meta { color: var(--ink-2); font-size: .9rem; }

.adm-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.adm-row { border-top: 1px solid var(--line); }
.adm-row:first-child { border-top: 0; }
.adm-row:not(.stu) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 16px 18px; }
.ar-main { display: grid; gap: 2px; min-width: 0; }
.ar-main a { text-decoration: none; }
.ar-main a:hover { text-decoration: underline; }
.ar-meta { color: var(--ink-2); font-size: .92rem; overflow-wrap: anywhere; }
.ar-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ar-num { display: grid; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ar-num small { color: var(--ink-2); font-size: .8rem; }
.stu summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 16px 18px; cursor: pointer; list-style: none; }
.stu summary::-webkit-details-marker, .les-list summary::-webkit-details-marker { display: none; }
.stu details[open] summary, .les-list details[open] summary { background: var(--paper); }
.ls-body { padding: 16px 18px 20px; display: grid; gap: 16px; border-top: 1px solid var(--line); }
.plain-list { margin: 6px 0 0; padding-left: 20px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form .field { flex: 1 1 220px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 16px; }
.search { flex: 1 1 260px; max-width: 420px; }
.seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { background: var(--surface); border: 0; border-left: 1px solid var(--line); padding: 10px 14px; min-height: 44px; font: 700 .92rem var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.seg button:focus-visible { outline-offset: -3px; }
.hint { color: var(--ink-2); font-size: .88rem; font-weight: 400; }

/* forms */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.field.plain input, .field.plain select, .field.plain textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1rem/1.5 var(--sans); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius); transition: border-color var(--fast);
}
.field.plain textarea { resize: vertical; }
.field.plain input:disabled { background: var(--paper); color: var(--ink-2); }
.field.plain input:hover, .field.plain select:hover, .field.plain textarea:hover { border-color: var(--ink-2); }
.radios { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radios legend { font-weight: 700; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.radios label, .check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; cursor: pointer; }
.radios input, .check input { width: 20px; height: 20px; accent-color: var(--navy); margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.push-right { margin-left: auto; }
.sticky-save { position: sticky; bottom: 0; background: var(--paper); padding-block: 12px; border-top: 1px solid var(--line); margin-top: 8px; }
.settings { display: grid; gap: 20px; max-width: 820px; }
.settings > * { min-width: 0; }   /* wide tables scroll inside their panel instead of widening the page */

/* lessons editor */
.les-list { list-style: none; margin: 0 0 16px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.les-list > li { border-top: 1px solid var(--line); }
.les-list > li:first-child { border-top: 0; }
.les-list > li.empty { border: 0; margin: 12px; }
.les-list summary { display: grid; grid-template-columns: 2.6rem 1fr; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.les-list summary .n { font: 600 1.05rem var(--serif); color: var(--gold-ink); padding-top: 1px; }
.ls-main { display: grid; gap: 4px; min-width: 0; }
.ls-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink-2); font-size: .9rem; }
.upl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.upl > div { flex: 1 1 200px; }
.upl p { margin-top: 2px; }
.file-btn { cursor: pointer; position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--radius); font-weight: 700; max-width: calc(100vw - 32px); }
.p-missing { position: absolute; inset: 0 0 52px; display: grid; place-items: center; padding: 20px; text-align: center; color: #F3F5F9; margin: 0; }
.orders-tbl td:first-child b { white-space: nowrap; }

/* =========================================================
   Server-rendered additions
   ========================================================= */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 16px; font-weight: 700; border-radius: var(--radius); }
.skip:focus { top: 12px; }
.flash { padding-block: 12px; font-weight: 700; border-bottom: 1px solid var(--line); }
.flash-ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash-bad { background: #FDE2E0; color: #8A1C12; }
:root[data-theme="dark"] .flash-bad { background: #3A1414; color: #FFC9C4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flash-bad { background: #3A1414; color: #FFC9C4; } }
.adm-flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; border: 0; }
.demo-bar .linkish { color: inherit; }

/* segmented links + tab links */
.seg a { display: inline-flex; align-items: center; background: var(--surface); border-left: 1px solid var(--line); padding: 10px 14px; min-height: 44px; font: 700 .92rem var(--sans); color: var(--ink-2); text-decoration: none; }
.seg a:first-child { border-left: 0; }
.seg a[aria-current] { background: var(--navy); color: var(--on-navy); }
.seg a:focus-visible { outline-offset: -3px; }
.filters-top { margin: 20px 0 24px; }
.tabs a { border-bottom: 3px solid transparent; padding: 12px 14px; font: 700 1rem var(--sans); color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: color var(--fast), border-color var(--fast); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }

/* course cover images inside placeholders */
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* long-form pages */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin: 32px 0 8px; }
.prose p, .prose li { max-width: 68ch; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; display: grid; gap: 8px; }
.prose .sim { margin-top: 16px; }
.faq { display: grid; gap: 10px; margin-top: 28px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { padding: 16px 18px; font-weight: 700; cursor: pointer; min-height: 48px; }
.faq details p { padding: 0 18px 18px; }
.news li { padding-block: 14px; }

.co-title { margin-bottom: 20px; }
.narrow-form { max-width: 440px; }
.kv-form { display: grid; gap: 16px; }
.refund-form { display: grid; gap: 8px; }
.addr-input { min-height: 40px; padding: 6px 10px; font: 400 .9rem var(--sans); border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%; min-width: 190px; }
.mono { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: .85rem; overflow-wrap: anywhere; }
code { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: .9em; background: var(--thumb); padding: 1px 5px; border-radius: 3px; }
.plain-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.plain-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.plain-rows li:first-child { border-top: 0; }
.plain-rows small { display: block; color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; }
.cover-panel { margin-top: 28px; }
.cover-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.cover-prev { width: 200px; aspect-ratio: 16 / 10; max-width: 100%; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.warn-box { background: #FBEBC8; color: #5E4208; }
:root[data-theme="dark"] .warn-box { background: #3A2C0B; color: #F3D48C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warn-box { background: #3A2C0B; color: #F3D48C; } }
.up-bar { margin-top: 8px; }
.upl form { display: contents; }
.form-actions form { display: contents; }
.form-actions form.push-right { display: block; margin-left: auto; }
.mail summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .95rem/1.6 var(--sans); margin: 14px 0 0; }
.mail-body a { color: var(--gold-ink); font-weight: 700; }
.mail + .mail { margin-top: 12px; }
.status .page-title { font-size: clamp(1.9rem, 6vw, 2.6rem); }
.orders-tbl .act > * + * { margin-top: 6px; }
.orders-tbl .act small { display: block; }
.mode-switch { justify-self: start; }
.codes { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; background: var(--paper); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.codes code { background: none; padding: 0; font-size: 1.02rem; letter-spacing: .04em; }
@media (max-width: 360px) { .codes { grid-template-columns: 1fr; } }
.final-check { align-items: flex-start; margin: -6px 0 18px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; }
.final-check input { margin-top: 3px; flex: none; }

/* mock: five class tabs scroll inside their own row on narrow screens */
.seg.filters-top { max-width: 100%; overflow-x: auto; }
.seg.filters-top a { white-space: nowrap; flex: none; }

/* mock "Raspberry Stone": light header, so primary dark buttons and selected tabs use deep wine */
.btn-navy, .seg button[aria-pressed="true"], .seg a[aria-current] { background: #8C1147; color: #FFFFFF; }
.btn-navy:hover { background: #6E0D38; }
.player.is-locked { background: #2C2B2B; }
.player-ph .badge { background: #FFFFFF; color: #231A1D; }
.demo-links .linkish { white-space: nowrap; }
.demo-links { flex-wrap: wrap; gap: 4px 14px; }
.p-big { background: #C2185B; color: #FFFFFF; }
.p-big:hover { background: #9E1450; }

/* Admin edit mode on the course page: reorder and rename lessons in place */
.lessons-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.btn-sm { min-height: 44px; padding: .45em .9em; font-size: .95rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.edit-hint { max-width: 65ch; line-height: 1.6; color: var(--ink); }
.lesson-edit li { scroll-margin-top: 90px; }
.lesson-edit li:target { outline: 3px solid var(--gold); outline-offset: -3px; }
.edit-row { display: grid; grid-template-columns: 4.2rem 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; }
.edit-row input { width: 100%; min-height: 44px; padding: .5em .7em; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius); }
.edit-row .pos input { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.edit-row .moves { display: flex; gap: 6px; }
.edit-row .save { order: 3; }   /* first in the form so Enter saves, shown last */
@media (max-width: 560px) {
  .edit-row { grid-template-columns: 4.2rem 1fr; }
  .edit-row .moves { grid-column: 1 / -1; justify-content: flex-end; }
}
.lp-admin { margin: 0 0 12px; }
