:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --paper-deep: #ece7dc;
  --surface: #fffdf9;
  --surface-muted: #f1eee7;
  --ink: #173247;
  --ink-soft: #375064;
  --muted: #657785;
  --line: #d9d9ce;
  --line-strong: #c8ccc3;
  --teal: #0f776f;
  --teal-dark: #0b5e5a;
  --teal-pale: #e3f0ed;
  --coral: #d66d55;
  --coral-pale: #f9e7df;
  --gold: #d7a73c;
  --gold-pale: #fbf1d4;
  --blue-pale: #e4edf4;
  --success: #37846f;
  --shadow-sm: 0 8px 22px rgba(28, 47, 57, .07);
  --shadow-md: 0 18px 48px rgba(28, 47, 57, .1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max: 1200px;
  --focus: 0 0 0 3px rgba(15, 119, 111, .18), 0 0 0 1px var(--teal);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(215, 167, 60, .08), transparent 28rem),
    var(--paper);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::selection { color: var(--surface); background: var(--teal); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, var(--max));
  min-height: 76px;
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}
.site-header--quiet { border-bottom-color: rgba(217, 217, 206, .72); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 700 17px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--surface);
  background: var(--teal);
  border-radius: 9px 9px 9px 4px;
  box-shadow: 0 4px 10px rgba(15, 119, 111, .2);
}
.brand-mark svg { width: 18px; height: 18px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 8px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-muted); }
.site-nav a[aria-current="page"] { color: var(--teal-dark); }
.header-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.header-tag::before { width: 6px; height: 6px; content: ""; background: var(--teal); border-radius: 50%; }

.main-shell { width: min(100% - 40px, var(--max)); margin: 0 auto; padding: 52px 0 80px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { width: 24px; height: 1px; content: ""; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.04em; }
h1 { margin-bottom: 15px; font: 600 clamp(38px, 5.2vw, 64px)/.99 Georgia, "Times New Roman", serif; }
h2 { margin-bottom: 12px; font: 600 clamp(28px, 3vw, 42px)/1.08 Georgia, "Times New Roman", serif; }
h3 { margin-bottom: 6px; font-size: 19px; line-height: 1.2; }
.lede { max-width: 610px; margin-bottom: 0; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
.muted { color: var(--muted); }
.micro { color: var(--muted); font-size: 12px; line-height: 1.45; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.button:hover { background: var(--surface-muted); border-color: #adb9b5; transform: translateY(-1px); }
.button--primary { color: var(--surface); background: var(--teal); border-color: var(--teal); }
.button--primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button--quiet { color: var(--teal-dark); background: var(--teal-pale); border-color: transparent; }
.button--quiet:hover { background: #d2e7e1; }
.button--icon { width: 40px; padding: 0; }
.button svg { width: 16px; height: 16px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--teal-dark); }
.crumbs .sep { color: #a7afa9; }
.status-pill, .meta-pill, .level-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
}
.level-pill { color: var(--teal-dark); background: var(--teal-pale); }
.meta-pill { color: var(--muted); background: var(--surface-muted); }
.status-pill { color: var(--success); background: #e5f1eb; }
.status-pill--pending { color: #8a691a; background: var(--gold-pale); }
.status-pill--coral { color: #a44b38; background: var(--coral-pale); }

/* overview */
.overview-hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 64px; padding-bottom: 58px; }
.overview-hero .lede { max-width: 560px; }
.asset-stack { position: relative; min-height: 280px; }
.asset-stack__card { position: absolute; width: 47%; overflow: hidden; background: var(--surface); border: 8px solid var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); }
.asset-stack__card img { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; }
.asset-stack__card:nth-child(1) { top: 14px; left: 12%; transform: rotate(-5deg); }
.asset-stack__card:nth-child(2) { top: 0; right: 5%; transform: rotate(7deg); }
.asset-stack__label { position: absolute; right: 2%; bottom: 0; padding: 10px 13px; color: var(--teal-dark); background: var(--gold-pale); border-radius: 8px; font-size: 11px; font-weight: 750; transform: rotate(-2deg); }
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.overview-card { display: flex; min-height: 190px; flex-direction: column; padding: 20px; background: rgba(255,253,249,.78); border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.overview-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.overview-card__index { color: var(--coral); font-size: 12px; font-weight: 800; }
.overview-card h3 { margin-top: 38px; }
.overview-card p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.overview-card__arrow { margin-top: auto; color: var(--teal); font-weight: 800; }
.spec-section { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.spec-card { padding: 18px; background: var(--surface-muted); border-radius: var(--radius-md); }
.spec-card h3 { margin-bottom: 10px; font: 700 13px/1.25 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.token-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13px; }
.token-list li { display: flex; align-items: center; gap: 9px; }
.swatch { width: 15px; height: 15px; flex: 0 0 15px; border: 1px solid rgba(23,50,71,.15); border-radius: 5px; }
.swatch--paper { background: var(--paper); }
.swatch--ink { background: var(--ink); }
.swatch--teal { background: var(--teal); }
.swatch--coral { background: var(--coral); }
.swatch--gold { background: var(--gold); }
.spec-note { margin-top: 24px; padding: 16px 18px; color: var(--ink-soft); background: var(--gold-pale); border-left: 3px solid var(--gold); border-radius: 8px; font-size: 13px; }

/* library */
.library-intro { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 34px; }
.library-intro__stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.stat-card { min-width: 118px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stat-card strong { display: block; color: var(--ink); font: 700 21px/1 Georgia, serif; }
.stat-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.library-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.search-field { display: flex; flex: 1; align-items: center; gap: 10px; min-height: 44px; padding: 0 13px; color: var(--muted); background: var(--surface-muted); border: 1px solid transparent; border-radius: 10px; }
.search-field:focus-within { border-color: var(--teal); box-shadow: var(--focus); }
.search-field svg { width: 18px; height: 18px; }
.search-field input { width: 100%; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.search-field input::placeholder { color: #85919a; }
.toolbar-note { padding-right: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.library-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 32px; margin-top: 30px; }
.filter-panel { align-self: start; position: sticky; top: 22px; padding: 18px; background: rgba(255,253,249,.82); border: 1px solid var(--line); border-radius: var(--radius-md); }
.filter-panel h2 { margin-bottom: 18px; font: 750 13px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.filter-group { padding: 16px 0; border-top: 1px solid var(--line); }
.filter-group:first-of-type { padding-top: 0; border-top: 0; }
.filter-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-options label { display: inline-flex; align-items: center; }
.filter-options input { position: absolute; opacity: 0; }
.filter-options span { display: inline-flex; min-height: 31px; align-items: center; padding: 0 10px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 99px; font-size: 12px; font-weight: 700; }
.filter-options input:checked + span { color: var(--teal-dark); background: var(--teal-pale); border-color: #a7d2c8; }
.filter-options input:focus-visible + span { box-shadow: var(--focus); }
.filter-select { width: 100%; height: 36px; padding: 0 8px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.filter-caption { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.catalog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.catalog-head h2 { margin-bottom: 0; font: 650 20px/1.1 Georgia, serif; letter-spacing: -.02em; }
.catalog-head__meta { color: var(--muted); font-size: 12px; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.lesson-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.lesson-card.is-hidden { display: none; }
.lesson-card__art { position: relative; overflow: hidden; background: var(--surface-muted); }
.lesson-card__art img { width: 100%; aspect-ratio: 1.26 / 1; object-fit: cover; object-position: center 20%; }
.lesson-card__art .status-pill { position: absolute; top: 11px; left: 11px; box-shadow: 0 3px 8px rgba(23,50,71,.12); }
.lesson-card__body { display: flex; min-height: 151px; flex: 1; flex-direction: column; padding: 15px 16px 14px; }
.lesson-card__number { color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.lesson-card h3 { margin: 6px 0 4px; font-size: 18px; letter-spacing: -.03em; }
.lesson-card__topic { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.lesson-card__footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 13px; }
.card-link { margin-left: auto; color: var(--teal-dark); font-size: 12px; font-weight: 750; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.lesson-card--pending .lesson-card__art { display: grid; min-height: 158px; place-items: center; border-bottom: 1px dashed var(--line-strong); }
.pending-art { display: grid; width: 68px; height: 68px; place-items: center; color: #9ba9a4; background: #f8f7f2; border: 1px solid var(--line); border-radius: 20px; }
.pending-art svg { width: 31px; height: 31px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.pagination__label { color: var(--muted); font-size: 12px; }
.pagination__buttons { display: flex; gap: 7px; }
.pagination .button { min-height: 34px; font-size: 12px; }

/* reader */
.reader-page { width: min(100% - 40px, 1100px); margin: 0 auto; padding: 35px 0 76px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 25px; color: var(--teal-dark); font-size: 13px; font-weight: 750; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 16px; height: 16px; }
.reader-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.reader-head h1 { margin-bottom: 9px; font-size: clamp(35px, 5vw, 54px); }
.reader-head__copy { max-width: 620px; }
.reader-head__copy p { margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.reader-head__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.reader-head__actions { display: flex; flex: 0 0 auto; gap: 8px; }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 325px; gap: 26px; align-items: start; }
.art-panel { min-width: 0; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--ink); border-radius: 14px 14px 0 0; }
.reader-toolbar__label { display: inline-flex; align-items: center; gap: 8px; color: #eaf1ef; font-size: 12px; font-weight: 750; }
.reader-toolbar__label span { width: 7px; height: 7px; background: #8fd2bd; border-radius: 50%; }
.reader-toolbar__status { min-width: 0; flex: 1 1 auto; color: #c4d4d0; font-size: 11px; line-height: 1.35; }
.reader-controls { display: flex; align-items: center; gap: 5px; }
.reader-controls .button { min-height: 30px; color: #ecf2ee; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); border-radius: 7px; }
.reader-controls .button:hover { background: rgba(255,255,255,.16); }
.reader-controls .button--zoom { width: 30px; padding: 0; font-size: 18px; line-height: 1; }
.zoom-readout { min-width: 46px; color: #c4d4d0; font-size: 11px; text-align: center; }
.image-stage { height: clamp(430px, 75vh, 760px); display: block; overflow: auto; padding: 28px; background: #e7e4dc; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; overscroll-behavior: contain; }
.poster-frame { width: 100%; max-width: none; margin: 0 auto; background: var(--surface); box-shadow: 0 14px 35px rgba(23,50,71,.16); transition: width .2s ease; }
.poster-frame img { display: block; width: 100%; height: auto; }
.viewer-note { display: flex; align-items: flex-start; gap: 9px; margin: 11px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.viewer-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--teal); }
.side-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.side-card + .side-card { margin-top: 14px; }
.side-card h2 { margin-bottom: 5px; font: 750 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.side-card__intro { margin-bottom: 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.variant-list { display: grid; gap: 10px; }
.variant-button { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 10px; width: 100%; padding: 6px; color: var(--ink); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.variant-button:hover { border-color: #a9c9c1; background: #fbfdfb; }
.variant-button.is-selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15,119,111,.14); }
.variant-thumb { overflow: hidden; aspect-ratio: 2/3; border-radius: 7px; background: var(--surface-muted); }
.variant-thumb img { width: 100%; height: 100%; object-fit: cover; }
.variant-copy { align-self: center; min-width: 0; }
.variant-copy strong { display: block; font-size: 12px; line-height: 1.25; }
.variant-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.variant-button__check { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: var(--teal-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.variant-button__check svg { width: 12px; height: 12px; }
.variant-button__check[hidden], .selected-mark[hidden] { display: none; }
.reader-detail { display: grid; gap: 10px; margin: 0; }
.reader-detail div { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.reader-detail div:last-child { padding-bottom: 0; border-bottom: 0; }
.reader-detail dt { color: var(--muted); font-size: 11px; }
.reader-detail dd { margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.text-alt-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 12px; font-weight: 750; text-decoration: none; }
.text-alt-link:hover { text-decoration: underline; }
.text-alt-link svg { width: 14px; height: 14px; }
.reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.reader-nav a { display: flex; min-height: 62px; flex-direction: column; justify-content: center; gap: 2px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.reader-nav a:last-child { align-items: end; text-align: right; }
.reader-nav a:hover { border-color: #a9c9c1; }
.reader-nav span { color: var(--muted); font-size: 11px; }
.reader-nav strong { color: var(--teal-dark); font-size: 13px; }

/* design switcher */
.switcher-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 25px; }
.switcher-intro h1 { max-width: 600px; }
.switcher-intro__meta { min-width: 180px; padding: 15px 17px; background: var(--gold-pale); border-radius: 12px; }
.switcher-intro__meta strong { display: block; font: 700 20px/1 Georgia, serif; }
.switcher-intro__meta span { display: block; margin-top: 4px; color: #78601f; font-size: 11px; }
.switcher-layout { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 26px; align-items: start; }
.switcher-preview { padding: 20px; background: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.switcher-preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: #d6e7e1; font-size: 12px; }
.switcher-preview__bar strong { color: #fff; font-size: 13px; }
.switcher-preview__image { display: grid; min-height: 690px; place-items: start center; padding: 17px; background: #dfe2dc; border-radius: 12px; }
.switcher-preview__image img { width: min(100%, 470px); background: var(--surface); box-shadow: 0 12px 28px rgba(0,0,0,.19); }
.switcher-panel { display: grid; gap: 15px; }
.switcher-panel__card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.switcher-panel__card h2 { margin-bottom: 7px; font: 750 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.switcher-panel__card p { margin-bottom: 15px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.variant-option { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 12px; width: 100%; padding: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.variant-option + .variant-option { margin-top: 9px; }
.variant-option:hover { border-color: #a9c9c1; }
.variant-option.is-selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15,119,111,.14); }
.variant-option__thumb { overflow: hidden; aspect-ratio: 2/3; border-radius: 8px; }
.variant-option__thumb img { width: 100%; height: 100%; object-fit: cover; }
.variant-option__copy { align-self: center; }
.variant-option__copy strong { display: block; font-size: 13px; }
.variant-option__copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.selected-mark { display: inline-flex; align-items: center; gap: 4px; margin-top: 11px; color: var(--teal-dark); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.selected-mark svg { width: 13px; height: 13px; }
.share-row { display: flex; align-items: center; gap: 8px; }
.share-url { min-width: 0; flex: 1; overflow: hidden; padding: 10px 11px; color: var(--muted); background: var(--surface-muted); border-radius: 8px; font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.switcher-note { display: flex; gap: 9px; padding: 13px; color: var(--ink-soft); background: var(--teal-pale); border-radius: 10px; font-size: 12px; }
.switcher-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--teal); }

/* missing artwork */
.missing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.missing-stage { display: grid; min-height: 630px; place-items: center; padding: 42px; background: #eeece5; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.missing-message { max-width: 360px; text-align: center; }
.missing-icon { display: grid; width: 100px; height: 100px; margin: 0 auto 22px; place-items: center; color: var(--teal); background: var(--teal-pale); border: 1px solid #b7d7cf; border-radius: 28px; }
.missing-icon svg { width: 46px; height: 46px; }
.missing-message h2 { margin-bottom: 10px; font-size: 30px; }
.missing-message p { color: var(--ink-soft); font-size: 14px; }
.missing-message .button { margin-top: 10px; }
.text-alternative { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.text-alternative h2 { margin-bottom: 7px; font: 750 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.text-alternative > p { margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.alt-section { padding: 15px 0; border-top: 1px solid var(--line); }
.alt-section:first-of-type { padding-top: 0; border-top: 0; }
.alt-section h3 { margin-bottom: 8px; font: 700 14px/1.25 Georgia, serif; }
.alt-section p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.vocab-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.vocab-list li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px dotted var(--line-strong); font-size: 12px; }
.vocab-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.vocab-list strong { color: var(--teal-dark); }
.vocab-list span { color: var(--muted); text-align: right; }
.missing-callout { margin-top: 14px; padding: 13px 14px; color: #795d1c; background: var(--gold-pale); border-radius: 10px; font-size: 12px; }

@media (max-width: 980px) {
  .lesson-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reader-layout, .switcher-layout, .missing-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .switcher-preview__image, .missing-stage { min-height: 560px; }
}

@media (max-width: 760px) {
  .site-header { width: min(100% - 28px, var(--max)); min-height: 66px; }
  .site-nav a { display: none; }
  .site-nav a[aria-current="page"] { display: inline-flex; }
  .header-tag { margin-left: 2px; }
  .main-shell, .reader-page { width: min(100% - 28px, var(--max)); padding-top: 34px; }
  .overview-hero { grid-template-columns: 1fr; gap: 30px; padding-bottom: 38px; }
  .asset-stack { width: min(100%, 360px); min-height: 240px; margin: 0 auto; }
  .overview-grid, .spec-grid { grid-template-columns: 1fr; }
  .overview-card { min-height: 150px; }
  .overview-card h3 { margin-top: 22px; }
  .library-intro, .switcher-intro, .reader-head { display: block; }
  .library-intro__stats { justify-content: flex-start; margin-top: 20px; }
  .library-toolbar { display: block; padding: 11px; }
  .toolbar-note { display: block; padding: 10px 2px 1px; }
  .library-layout { display: block; margin-top: 18px; }
  .filter-panel { position: static; margin-bottom: 22px; padding: 15px; }
  .filter-panel h2 { margin-bottom: 14px; }
  .filter-panel__top { display: flex; align-items: center; justify-content: space-between; }
  .filter-group { padding: 12px 0; }
  .lesson-grid { grid-template-columns: 1fr; gap: 12px; }
  .lesson-card__art img { aspect-ratio: 2.15 / 1; object-position: center 23%; }
  .lesson-card--pending .lesson-card__art { min-height: 110px; }
  .catalog-head { align-items: flex-start; display: block; }
  .catalog-head__meta { display: block; margin-top: 5px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .reader-page { padding-bottom: 52px; }
  .reader-head__actions { margin-top: 17px; }
  .reader-layout, .switcher-layout, .missing-layout { display: block; }
  .reader-toolbar { align-items: flex-start; flex-direction: column; }
  .reader-toolbar__status { width: 100%; }
  .reader-controls { width: 100%; justify-content: flex-end; }
  .image-stage { height: clamp(430px, 70vh, 560px); padding: 16px 9px 26px; }
  .poster-frame { width: min(100%, 470px); }
  .reader-layout > .reader-side, .switcher-panel, .text-alternative { margin-top: 16px; }
  .reader-nav { margin-top: 18px; }
  .switcher-intro__meta { width: fit-content; margin-top: 18px; }
  .switcher-preview { padding: 11px; border-radius: 17px; }
  .switcher-preview__bar { padding: 0 3px; }
  .switcher-preview__image { min-height: 470px; padding: 10px; }
  .missing-stage { min-height: 420px; padding: 28px 16px; border-radius: var(--radius-md); }
  .missing-message h2 { font-size: 28px; }
  .missing-icon { width: 82px; height: 82px; }
}

@media (max-width: 430px) {
  h1 { font-size: 40px; }
  .header-tag { display: none; }
  .stat-card { min-width: 108px; }
  .reader-head h1 { font-size: 39px; }
}

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

/* Published application additions. The core palette and layout above follow
   the reviewed visual reference; these rules cover data-driven states that
   do not appear in the static mockups. */
.app-loading, .error-state, .empty-state, .not-found {
  padding: 34px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.error-state { color: #8c4336; background: var(--coral-pale); }
.empty-state { margin-top: 14px; text-align: center; }
.empty-state h2 { margin-bottom: 8px; font-size: 28px; }
.empty-state p { margin-bottom: 0; color: var(--muted); }
.not-found { max-width: 720px; margin: 52px auto 80px; }
.not-found h1 { font-size: clamp(38px, 5vw, 58px); }
.not-found p { color: var(--ink-soft); }
.button[disabled] { cursor: not-allowed; opacity: .48; transform: none; }
.catalog-head__meta strong { color: var(--ink); }
.filter-reset { min-height: 30px; padding: 0 10px; font-size: 11px; }
.filter-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lesson-card__art--pending { display: grid; min-height: 158px; place-items: center; border-bottom: 1px dashed var(--line-strong); }
.lesson-card__art--pending .status-pill { top: auto; left: auto; bottom: 12px; }
.lesson-card__art a, .lesson-card__art img { width: 100%; }
.lesson-card__art > a { display: block; text-decoration: none; }
.lesson-card__art img { height: 240px; object-fit: cover; }
.lesson-card__art .pending-art { margin-bottom: 28px; }
.lesson-card__body a { position: relative; z-index: 1; }
.card-link { display: inline-flex; align-items: center; gap: 4px; }
.card-link svg { width: 16px; height: 16px; }
.reader-toolbar { flex-wrap: wrap; }
.reader-controls { flex-wrap: wrap; }
.reader-controls .button--text { min-width: 62px; }
.image-stage { cursor: grab; touch-action: pan-x pan-y pinch-zoom; }
.image-stage.is-panning { cursor: grabbing; user-select: none; touch-action: pan-x pan-y pinch-zoom; }
.poster-frame { will-change: width; }
.poster-frame img { user-select: none; -webkit-user-drag: none; }
.viewer-note { max-width: 760px; }
.long-description { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.long-description summary { color: var(--teal-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.long-description__body { margin-top: 12px; color: var(--ink-soft); font-size: 12px; }
.long-description__body h1, .long-description__body h2, .long-description__body h3 { margin: 14px 0 6px; font: 700 14px/1.25 Georgia, serif; letter-spacing: -.01em; }
.long-description__body h1:first-child, .long-description__body h2:first-child { margin-top: 0; }
.long-description__body p { margin: 0 0 8px; }
.long-description__body ul, .long-description__body ol { margin: 0 0 9px; padding-left: 18px; }
.long-description__body li + li { margin-top: 3px; }
.reading-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.reading-card h2 { margin-bottom: 7px; font: 750 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.reading-card > p { margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.reading-body { color: var(--ink-soft); font-size: 13px; line-height: 1.62; }
.reading-body h1, .reading-body h2, .reading-body h3, .reading-body h4 { margin: 22px 0 8px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.reading-body h1 { font-size: 27px; }
.reading-body h2 { font-size: 22px; }
.reading-body h3 { font-size: 17px; }
.reading-body h4 { font-size: 15px; }
.reading-body h1:first-child, .reading-body h2:first-child { margin-top: 0; }
.reading-body p { margin: 0 0 12px; }
.reading-body ul, .reading-body ol { margin: 0 0 14px; padding-left: 22px; }
.reading-body li + li { margin-top: 4px; }
.reading-body strong { color: var(--ink); }
.reading-body code { padding: .08em .28em; color: var(--teal-dark); background: var(--teal-pale); border-radius: 4px; font-size: .93em; }
.reading-body pre { overflow: auto; margin: 0 0 14px; padding: 12px 14px; color: #edf5f1; background: var(--ink); border-radius: 9px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.reading-body pre code { padding: 0; color: inherit; background: transparent; }
.reading-body table { width: 100%; margin: 0 0 16px; border-collapse: collapse; font-size: 12px; }
.reading-body th, .reading-body td { padding: 8px 9px; text-align: left; vertical-align: top; border: 1px solid var(--line); }
.reading-body th { color: var(--ink); background: var(--surface-muted); font-weight: 750; }
.reading-body blockquote { margin: 0 0 14px; padding: 9px 13px; color: var(--ink-soft); background: var(--gold-pale); border-left: 3px solid var(--gold); }
.reading-body hr { margin: 19px 0; border: 0; border-top: 1px solid var(--line); }
.reading-card--below { margin-top: 20px; }
.missing-layout .reading-card { min-width: 0; }
.missing-layout .text-alternative { min-width: 0; }
.missing-layout--compact { display: block; }
.missing-layout--compact .missing-stage { min-height: 420px; }
.lesson-status-line { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.lesson-topic { margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.design-count { color: var(--muted); }
.subject-switch { color: var(--teal-dark); font-size: 12px; font-weight: 750; text-decoration: none; }
.subject-switch:hover { text-decoration: underline; }
.site-footer { width: min(100% - 40px, var(--max)); margin: 0 auto; padding: 20px 0 28px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.site-footer a { color: var(--teal-dark); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 760px) {
  .site-footer { width: min(100% - 28px, var(--max)); }
  .app-loading, .error-state, .empty-state { padding: 25px 18px; }
  .reader-controls { justify-content: flex-start; }
  .reader-controls .button--text { min-width: 0; }
  .reading-card { padding: 17px; }
  .lesson-card__art img { height: 160px; }
  .reading-body table { display: block; overflow-x: auto; white-space: nowrap; }
  .reading-body td, .reading-body th { white-space: normal; min-width: 105px; }
}
