:root {
  color-scheme: light;
  --bg: #f0ece3;
  --surface: #fbf8f2;
  --ink: #262b23;
  --muted: #626659;
  --accent: #46563d;
  --accent-dark: #34432e;
  --accent-soft: #e5eadc;
  --border: #ded9cc;
  --radius: 24px;
  --feature-radius: 32px;
  --control-radius: 15px;
  --pill-radius: 999px;
  --edge-radius: calc(var(--radius) - 1px);
  --feedback-duration: 160ms;
  --gutter: clamp(16px, 4vw, 32px);
  --frame: 1080px;
  --title: clamp(27px, 3.5vw, 36px);
  --heading: clamp(19px, 2.4vw, 23px);
  --body: 16px;
  --label: 14px;
  --caption: 13px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: var(--body)/1.5 var(--font); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { font-weight: 650; }
h1 { font-size: var(--title); line-height: 1.13; letter-spacing: -.035em; }
h2 { font-size: var(--heading); line-height: 1.24; letter-spacing: -.022em; }
h3 { font-size: var(--body); line-height: 1.32; letter-spacing: -.012em; }
p + p { margin-top: 8px; }
img { display: block; width: 100%; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 2px solid #687952; outline-offset: 3px; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--label);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
button { cursor: pointer; }
button:hover, .button:hover { background: #ebe7db; }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { border-color: var(--accent); border-radius: var(--pill-radius); background: var(--accent); color: #fffdf6; }
.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fffdf6; }
button:not(:disabled):active, .button:active { box-shadow: inset 0 0 0 2px #262b2326; }
.primary:not(:disabled):active { background: #293825; }
.light { background: var(--surface); color: var(--accent); }
button.small, .button.small { padding-inline: 12px; font-size: var(--caption); }
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: var(--label);
}
.muted { color: var(--muted); }
small, .small-text { font-size: var(--caption); }
.eyebrow { color: var(--muted); font-size: var(--caption); font-weight: 600; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row, .actions, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid, .course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.skip { position: fixed; z-index: 100; left: 16px; top: -100px; padding: 10px 14px; background: var(--surface); }
.skip:focus { top: 10px; }

.topbar { border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-inner, .container, .preview-inner {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.topbar-inner { min-height: 64px; display: flex; align-items: center; gap: 20px; }
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.desktop-nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.desktop-nav a, .admin-entry, .header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: var(--control-radius);
  color: var(--muted);
  font-size: var(--label);
  text-decoration: none;
}
.desktop-nav svg { width: 18px; height: 18px; }
.desktop-nav a.selected { background: var(--accent-soft); color: var(--accent-dark); font-weight: 650; }
.admin-entry, .header-back, .topbar .button.small { margin-left: auto; }
.admin-entry, .header-back { padding-right: 0; }
.bottom-nav { display: none; }
.container { padding-block: 32px 56px; }
.container.narrow { max-width: 670px; }
.page-top, .space-heading { margin-bottom: 20px; }
.page-top .row, .section-heading { align-items: flex-start; }
.page-top p { margin-top: 8px; }
.back-row { margin: -8px 0 10px; }
.back-link {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.preview { border-bottom: 1px solid var(--border); background: #e4e9dc; color: var(--muted); }
.preview-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 6px; font-size: 12px; }
.preview button { min-height: 28px; padding: 3px 8px; font-size: 11px; }
.preview .row { gap: 6px; }

.entry-container { padding-top: clamp(20px, 5vw, 56px); }
.entry-board {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--feature-radius);
  background: var(--surface);
}
.entry-copy {
  min-width: 0;
  align-self: center;
  padding: clamp(24px, 5.2vw, 58px);
}
.entry-credit { margin-bottom: 14px; color: var(--accent); font-size: var(--label); font-weight: 600; }
.welcome-copy h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.12; text-wrap: balance; }
.entry-intro { max-width: 33ch; margin: 14px 0 24px; color: var(--muted); }
.entry-art { position: relative; min-height: 390px; background: #a49782; }
.entry-art img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.welcome-art img { object-position: 58% 47%; }
.login-art img { object-position: 55% 8%; }
.entry-button { min-height: 48px; border-radius: var(--control-radius); }
.welcome-cta {
  justify-content: space-between;
  min-width: min(100%, 228px);
}
.welcome-login { display: block; width: fit-content; margin-top: 14px; font-size: var(--label); }
.login-board { grid-template-columns: minmax(0, 1.23fr) minmax(0, .77fr); }
.login-copy form { max-width: 440px; }
.login-copy .notice { margin-bottom: 12px; }
.login-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: #f5f2e9;
  cursor: pointer;
}
.login-choice:has(input:checked) { border-color: #cbd3bf; background: var(--accent-soft); }
.login-choice:has(input:focus-visible) { background: #d8e2cd; }
.login-choice input, .login-check { grid-area: 1 / 1; width: 22px; height: 22px; }
.login-choice input { z-index: 1; margin: 0; opacity: 0; outline: none; cursor: inherit; }
.login-check {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #7c826e;
  color: #fffdf6;
  pointer-events: none;
}
.login-check::after {
  content: "";
  width: 11px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.login-choice input:checked + .login-check { background: var(--accent); }
.login-choice input:checked + .login-check::after { opacity: 1; }
.login-choice-copy { grid-area: 1 / 2; }
.login-choice strong { display: block; font-size: var(--label); font-weight: 650; }
.login-choice small { display: block; margin-top: 4px; line-height: 1.4; color: var(--muted); }
.login-submit { width: 100%; margin-top: 16px; }
.login-submit.is-updating-choice:disabled { opacity: 1; cursor: wait; }
.login-status {
  min-height: 3em;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--caption);
  line-height: 1.5;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: calc(var(--control-radius) + 5px);
  background: #e9e4d8;
}
.segmented a {
  display: grid;
  place-items: center;
  min-height: 40px;
  min-width: 125px;
  padding: 6px 14px;
  border-radius: var(--control-radius);
  color: var(--ink);
  font-size: var(--label);
  text-decoration: none;
}
.segmented a.selected { background: var(--accent); color: #fffdf6; font-weight: 600; }
.course-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.course-cover { display: grid; min-width: 0; border-radius: inherit; text-decoration: none; color: var(--ink); }
.course-cover:hover { color: var(--ink); background: #f5f2e8; }
.course-thumb { overflow: hidden; border-radius: var(--edge-radius) var(--edge-radius) 0 0; background: #a59881; }
.course-thumb img { aspect-ratio: 2 / 1; object-fit: cover; object-position: 60% 42%; }
.course-copy { padding: 16px 18px; }
.course-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.course-copy > p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--label);
}
.course-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); }
.cover-arrow {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.course-edit { display: flex; justify-content: flex-end; padding: 0 16px; border-top: 1px solid var(--border); }
.coming-card, .space-empty, .course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .55fr);
  overflow: hidden;
  position: relative;
  border: 1px solid #d4d9cb;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.coming-card > img, .space-empty > img, .course-hero > img {
  position: absolute;
  inset: 0 0 0 auto;
  width: 27.5%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}
.coming-card > div, .space-empty > div, .course-hero > div { padding: clamp(18px, 4vw, 32px); }
.coming-card p, .space-empty p, .course-hero p { margin-top: 9px; color: #505a49; }
.coming-card .button, .space-empty .button { margin-top: 16px; }
.course-hero { min-height: 153px; align-items: center; }
.course-hero p { max-width: 39ch; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 6px 16px;
  flex-wrap: wrap;
  margin: 24px 0 12px;
}
.section-heading > span { align-self: center; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.category-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.category-card:hover { color: var(--ink); border-color: #b4bea7; background: #f5f2e8; }
.category-card > img { aspect-ratio: 2 / 1; object-fit: cover; object-position: 64% 44%; border-radius: var(--edge-radius) var(--edge-radius) 0 0; }
.category-hero > img { object-position: center 6%; }
.category-chair > img { object-position: center 45%; }
.category-mat > img { object-position: center 55%; }
.category-copy { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px 13px; }
.category-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: var(--muted); font-size: var(--caption); }
.category-meta svg { color: var(--accent); }
.all-lessons-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid #cdd6c3;
  border-radius: var(--control-radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: var(--label);
  font-weight: 600;
  text-decoration: none;
}
.all-lessons-link > span { flex: 1; }
.course-renew { margin-top: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
  margin-bottom: 16px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--muted);
}
.search:focus-within { outline: 2px solid #687952; outline-offset: 2px; }
.search input[type="search"] { border: 0; padding-inline: 0; background: transparent; outline: 0; }
.lesson-list { gap: 8px; }
.lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.lesson .body { flex: 1; min-width: 0; }
.lesson h3 a { color: var(--ink); text-decoration: none; }
.lesson p { margin-top: 4px; color: var(--muted); font-size: var(--caption); }
.lesson-thumb { position: relative; flex: 0 0 84px; overflow: hidden; border-radius: calc(var(--radius) - 10px); background: #a49782; }
.lesson-thumb > img { aspect-ratio: 1.22; object-fit: cover; object-position: 72% 38%; }
.play-dot {
  position: absolute;
  bottom: 5px;
  left: 5px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
}
.play-dot svg { fill: currentColor; }
.icon-button { flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); }
.icon-button:hover, .favorite-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.favorite-button svg { fill: transparent; }
.favorite-button[aria-pressed="true"] svg { fill: #667c5540; }
.lesson-check { flex-shrink: 0; color: var(--accent); }
.viewed-word { color: var(--accent); }
.lesson-number { width: 28px; flex-shrink: 0; text-align: center; color: var(--muted); }
.admin-lesson { padding: 12px; flex-wrap: wrap; }
.admin-lesson .body { flex-basis: 130px; }

.player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.player-top > span { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: var(--label); }
.video-layout { display: grid; grid-template-columns: minmax(0, 1.64fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.video-wrap { display: grid; place-items: center; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #262b23; color: #fffdf6; }
.video-wrap video { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.video-wrap > p { padding: 16px; }
.lesson-details { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.lesson-meta > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--pill-radius); background: #eeeae1; color: var(--muted); font-size: var(--caption); }
.lesson-meta > .playback-label { display: none; }
.lesson-meta > .is-viewed { display: inline-flex; background: var(--accent-soft); color: var(--accent-dark); }
.lesson-about { margin-bottom: 12px; }
.repeat-button { width: 100%; margin-top: 14px; }

.profile-heading, .contact-row, .profile-menu, .notification-card, .subscription-card, .card, .expired-screen, .favorites-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.profile-heading { display: flex; align-items: center; flex-direction: column; gap: 5px; padding: 20px 16px; margin-bottom: 14px; text-align: center; }
.profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: var(--heading); font-weight: 650; }
.profile-menu { margin-block: 14px; }
.contact-row, .menu-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; font-size: var(--label); }
.menu-row { border-radius: var(--control-radius); color: var(--ink); text-decoration: none; }
.menu-row:hover { background: var(--accent-soft); color: var(--accent-dark); }
.profile-menu .menu-row { border-radius: 0; }
.profile-menu .menu-row:first-child { border-radius: var(--edge-radius) var(--edge-radius) 0 0; }
.profile-menu .menu-row:last-child { border-radius: 0 0 var(--edge-radius) var(--edge-radius); }
.profile-menu .menu-row:only-child { border-radius: var(--edge-radius); }
.menu-row > span { flex: 1; }
.menu-row > svg:last-child { transform: rotate(180deg); color: var(--muted); }
.profile-menu .menu-row + .menu-row { border-top: 1px solid var(--border); }
.notification-card, .subscription-card { padding: 16px; }
.notification-card > p { margin-top: 8px; }
.notification-card .button, .notification-card .subtle { margin-top: 12px; }
.logout-button { display: flex; width: 100%; margin-top: 14px; }
.subscription-card .course-cover { grid-template-columns: clamp(80px, 23%, 124px) minmax(0, 1fr); }
.subscription-card .course-thumb { border-radius: var(--edge-radius) 0 0 var(--edge-radius); }
.subscription-card .course-thumb img { height: 100%; aspect-ratio: auto; }
.subscription-card .course-copy > p, .subscription-card .course-edit, .subscription-card .course-card-bottom { display: none; }
.subscription-details { display: grid; gap: 8px; padding-top: 14px; }
.stack + .menu-row { margin-top: 14px; }
.expired-screen, .favorites-empty, .empty { display: grid; justify-items: center; gap: 10px; padding: clamp(22px, 5vw, 42px); text-align: center; }
.expired-screen > svg, .favorites-empty > svg { color: var(--accent); }
.expired-screen > .button, .favorites-empty > .button { margin-top: 6px; }
.expired-screen > p, .favorites-empty > p { max-width: 40ch; }
.access-offer > p { margin-top: 8px; }
.access-offer > .button { width: 100%; margin-top: 16px; }
.access-offer > .text-link { display: flex; }
.offer-prices, .preview-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.offer-prices > div, .preview-sections > div { padding: 12px; border: 1px solid var(--border); border-radius: var(--control-radius); font-size: var(--label); overflow-wrap: anywhere; }
.offer-prices > div { display: grid; gap: 4px; }

.card { min-width: 0; padding: clamp(14px, 3.2vw, 24px); }
.card > h2 { margin-bottom: 14px; }
.card > p + .actions, .card > p + .field { margin-top: 14px; }
.field { display: grid; gap: 6px; min-width: 0; margin-bottom: 14px; }
.field label { font-size: var(--label); font-weight: 600; }
.field small { color: var(--muted); }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: #fffdf8;
  color: var(--ink);
}
textarea { min-height: 100px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: var(--label); }
.check input { flex-shrink: 0; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
form > .primary { width: 100%; }
[data-form="checkout"] > * + .field, [data-form="checkout"] > p, [data-form="checkout"] > button { margin-top: 14px; }
[data-form="checkout"] label.card { padding: 12px; }
[data-form="checkout"] label.card:has(:checked) { border-color: #aab89b; background: var(--accent-soft); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--pill-radius); background: #eeeae0; color: #585b50; font-size: var(--caption); overflow-wrap: anywhere; }
.badge.ok, .notice { background: var(--accent-soft); color: var(--accent-dark); }
.badge.warn, .notice.warn { background: #efe5ce; color: #66542c; }
.badge.error, .notice.error { background: #f0e2dc; color: #783f2e; }
.notice { padding: 11px 13px; border-radius: var(--control-radius); font-size: var(--label); }
.empty { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 540px; border-collapse: collapse; }
th, td { padding: 12px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: var(--label); }
th { color: var(--muted); font-weight: 600; }
.breadcrumbs { font-size: var(--label); }
.stats .value { font-size: var(--title); font-weight: 650; line-height: 1.15; }
.stats span { font-size: var(--caption); }
.dropzone { display: grid; justify-items: center; gap: 5px; width: 100%; padding: 25px 14px; border: 1px dashed #8e9b82; background: var(--accent-soft); }
.dropzone.dragover { border-color: var(--accent-dark); background: #d8e2cf; }
.upload-item { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--control-radius); overflow-wrap: anywhere; }
.upload-item progress { width: 100%; accent-color: var(--accent); }
.upload-state { font-size: var(--caption); }
.subtle { border: 0; background: transparent; color: var(--muted); text-decoration: underline; }
.admin-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
.sidebar { display: flex; flex-direction: column; gap: 4px; }
.sidebar a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 9px; border-radius: var(--control-radius); color: var(--muted); font-size: var(--label); text-decoration: none; }
.sidebar a.selected { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sidebar > p { margin-top: 10px; font-size: var(--caption); color: var(--muted); }
.admin-content > .page-top { margin: 0; }
#toast {
  position: fixed;
  z-index: 50;
  bottom: 22px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: var(--control-radius);
  background: var(--ink);
  color: #fffdf6;
  font-size: var(--label);
  opacity: 0;
  pointer-events: none;
}
#toast.visible { opacity: 1; }

:is(.desktop-nav a, .bottom-nav a, .sidebar a, .segmented a, .course-cover, .category-card, .menu-row, .back-link):active {
  background-color: var(--accent-soft);
}
.segmented a.selected:active { background: var(--accent-dark); }
.all-lessons-link:active { background: #d6e0cb; }

@media (prefers-reduced-motion: no-preference) {
  :is(button, .button, .desktop-nav a, .bottom-nav a, .sidebar a, .segmented a,
      .course-cover, .category-card, .menu-row, .back-link, .all-lessons-link,
      .login-choice, [data-form="checkout"] label.card) {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: var(--feedback-duration);
    transition-timing-function: ease-out;
  }
  .favorite-button svg { transition: fill var(--feedback-duration) ease-out; }
  .login-check { transition: background-color var(--feedback-duration) ease-out; }
  .login-check::after { transition: opacity var(--feedback-duration) ease-out; }
  #toast { transition: opacity var(--feedback-duration) ease-out; }
}

@media (forced-colors: active) {
  .login-check { forced-color-adjust: none; background: CanvasText; color: Canvas; }
  .login-choice input:checked + .login-check { background: Highlight; color: HighlightText; }
  .login-choice:has(input:focus-visible) { outline: 2px solid Highlight; outline-offset: 2px; }
}

@media (max-width: 800px) {
  .desktop-nav a { padding-inline: 7px; }
  .desktop-nav svg, .admin-entry > span { display: none; }
  .video-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sidebar { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar > .eyebrow, .sidebar > p { display: none; }
}

@media (max-width: 650px) {
  .topbar-inner { min-height: 54px; gap: 8px; }
  .container { padding-block: 20px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .entry-container { padding-bottom: 24px; }
  .desktop-nav { display: none; }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 49px;
    min-width: 0;
    border-radius: var(--control-radius);
    color: var(--muted);
    font-size: clamp(9px, 2.8vw, 11px);
    line-height: 1.2;
    text-decoration: none;
  }
  .bottom-nav a.selected { background: var(--accent-soft); color: var(--accent-dark); font-weight: 650; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .preview-inner { flex-wrap: wrap; }
  .entry-board { grid-template-columns: minmax(0, 1fr); border-radius: var(--radius); }
  .entry-copy { padding: 20px; }
  .welcome-art { order: -1; min-height: clamp(183px, 53vw, 275px); }
  .welcome-art img { object-position: 50% 43%; }
  .welcome-copy h1 { max-width: 19ch; font-size: clamp(29px, 7.5vw, 40px); }
  .entry-credit { margin-bottom: 8px; }
  .entry-intro { margin: 10px 0 18px; }
  .welcome-cta { width: 100%; }
  .login-art { display: none; }
  .segmented { display: grid; margin-bottom: 16px; }
  .segmented a { min-width: 0; }
  .course-grid { grid-template-columns: minmax(0, 1fr); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-copy { padding: 9px 10px; }
  .category-card h3 { font-size: 15px; }
  .category-meta { font-size: 12px; }
  .course-hero, .coming-card, .space-empty { grid-template-columns: minmax(0, 1.42fr) minmax(0, .58fr); }
  .coming-card > img, .space-empty > img, .course-hero > img { width: 29%; }
  .lesson-thumb { flex-basis: 64px; }
  .lesson { gap: 8px; }
  .lesson-check { display: none; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid:not(.three) { gap: 8px; }
  .admin-content > .grid:not(.three) { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 6px; }
  .stats .card { padding: 9px; }
  #toast { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 360px) {
  .course-hero, .coming-card, .space-empty { grid-template-columns: minmax(0, 1.56fr) minmax(0, .44fr); }
  .coming-card > img, .space-empty > img, .course-hero > img { width: 22%; }
}
