/* ---------- Tokens: one accent, quiet neutrals ---------- */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --muted: #6a6963;
  --line: #e8e6df;
  --accent: #2c5545;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ed;
  --danger: #b3402f;
  --spine-l: 44%;
  --shadow: 0 1px 2px rgb(20 20 15 / 0.04), 0 10px 30px rgb(20 20 15 / 0.06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1110;
  --surface: #151917;
  --ink: #ecebe5;
  --muted: #9b9b93;
  --line: #262b28;
  --accent: #93cdb5;
  --accent-ink: #0c1a14;
  --accent-soft: #18271f;
  --danger: #ef8a78;
  --spine-l: 62%;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

/* Same dark tokens when the visitor hasn't chosen and their system prefers dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1110; --surface: #151917; --ink: #ecebe5; --muted: #9b9b93; --line: #262b28;
    --accent: #93cdb5; --accent-ink: #0c1a14; --accent-soft: #18271f; --danger: #ef8a78;
    --spine-l: 62%;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
code { background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
svg { display: block; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
.wrap.narrow { max-width: 680px; }
.small { font-size: 0.875rem; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { white-space: nowrap; color: var(--muted); text-decoration: none; font-size: 0.94rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--ink); }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 1.8rem; line-height: 1; }
.icon-btn:hover { color: var(--ink); background: var(--accent-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 10px 22px; border-radius: 999px; font: 500 0.96rem var(--sans); text-decoration: none; cursor: pointer; text-align: center;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); opacity: 1; }
.btn-small { min-height: 38px; padding: 6px 18px; font-size: 0.9rem; }
.btn-lg { min-height: 52px; padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link-btn { display: inline-block; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 12px 10px; }
.link-btn:hover { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.hero h1 { max-width: 13em; margin: 0 auto; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 30em; margin: 22px auto 34px; }
.hero-search { display: flex; align-items: center; gap: 8px; max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow); transition: border-color 0.15s; }
.hero-search:focus-within { border-color: var(--accent); }
.hero-search svg, .search-field svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.hero-search input { border: 0; background: transparent; min-height: 44px; padding: 0 4px; flex: 1; min-width: 0; }
.hero-search input:focus-visible { outline: none; box-shadow: none; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-lead { color: var(--muted); max-width: 32em; margin: 12px 0 28px; }
.count { color: var(--muted); font-size: 0.9rem; margin: 0; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Catalog ---------- */
.notice { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-bottom: 10px; }
.search-field { position: relative; flex: 1 1 280px; }
.search-field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-field input { padding-left: 46px; border-radius: 999px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); min-height: 44px; cursor: pointer; }
.switch input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 5px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 500 0.9rem var(--sans); cursor: pointer; transition: all 0.15s; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%; min-height: 48px; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input.invalid { border-color: var(--danger); }

/* A book is a quiet card with a coloured spine */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.book { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 18px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.2s, transform 0.2s; }
.book::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: hsl(var(--h) 36% var(--spine-l)); }
@media (hover: hover) { .book:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); transform: translateY(-2px); } }
.book-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.book-id { font: 0.76rem ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); }
.book-title { flex: 1; }
.book h3 { font-size: 1.22rem; line-height: 1.25; }
.author { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--muted); margin: 0; }
.meta svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.book .btn { width: 100%; }
.is-out h3 { color: var(--muted); }
.empty { grid-column: 1 / -1; padding: 40px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.pill { font-size: 0.76rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.pill.ok { color: var(--accent); }
.pill.busy { color: var(--muted); }
.pill.bad { color: var(--danger); }

/* ---------- How it works ---------- */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.steps li { border-top: 1px solid var(--line); padding-top: 18px; }
.num { display: block; font: 400 1.5rem var(--serif); color: var(--accent); margin-bottom: 14px; }
.steps p { color: var(--muted); font-size: 0.95rem; margin: 6px 0 0; }

/* ---------- Share a book ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.guide { max-width: 380px; }
.guide p { color: var(--muted); }
.guide strong { color: var(--ink); font-weight: 500; }
.guide-title { margin: 26px 0 8px; font: 500 0.82rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.guide-list { margin: 0; padding-left: 20px; color: var(--muted); }
.guide-list li { margin-bottom: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field span, .field .label { font-size: 0.88rem; color: var(--muted); }
.field .small { margin: 4px 0 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; font-size: 0.92rem; color: var(--muted); cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--accent); }
.check-row.invalid { color: var(--danger); }
.form-error { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); font-size: 0.92rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--accent-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgb(0 0 0 / 0.65); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.thumb button:hover { background: rgb(0 0 0 / 0.85); }

/* ---------- FAQ ---------- */
.faq { border-bottom: 1px solid var(--line); }
.faq:first-of-type { margin-top: 24px; border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; font-weight: 300; color: var(--muted); }
.faq[open] summary::after { content: "–"; }
.faq-body { padding: 0 0 22px; color: var(--muted); }
.faq-body strong { color: var(--ink); font-weight: 500; }
.checklist { margin: 0; padding-left: 20px; }
.checklist li { margin-bottom: 8px; }
.grid.hubs { grid-template-columns: repeat(auto-fill, minmax(190px, 320px)); gap: 12px; margin-top: 16px; }
.grid.hubs:empty { display: none; }
.hub { padding: 16px 18px; border-radius: 14px; box-shadow: none; }
.hub h3 { color: var(--ink); margin-bottom: 4px; }
.hub p { font-size: 0.88rem; margin: 6px 0 0; }
.hub .day { display: inline-block; font-size: 0.78rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.report-title { margin: 20px 0 14px; color: var(--ink); font: 500 1rem var(--sans); letter-spacing: 0; }
.bars { display: grid; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 5px; color: var(--ink); }
.bar-label span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar-row.reserve .bar i { background: var(--muted); }

/* ---------- Terms of Service ---------- */
.legal { padding-top: 56px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 8px; }
.legal section { margin-top: 44px; scroll-margin-top: 84px; }
.legal h2 { font-size: 1.3rem; margin-bottom: 10px; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--ink); font-weight: 500; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 8px; }
.summary { margin: 28px 0; padding: 20px 24px; background: var(--accent-soft); border-radius: var(--radius); }
.summary strong { display: block; margin-bottom: 8px; color: var(--ink); }
.summary ul { margin: 0; }
.summary li { color: var(--ink); }
.toc { margin: 0 0 8px; }
.toc ol { columns: 2; column-gap: 32px; margin: 0; padding-left: 22px; font-size: 0.95rem; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.terms-note { margin: 18px 0 0; }

/* ---------- Join + footer ---------- */
.join { text-align: center; }
.join .section-lead { margin-left: auto; margin-right: auto; }
.join .cta-row { justify-content: center; }
.site-footer { padding: 40px 0 56px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.site-footer p { margin: 0 0 6px; }

/* ---------- Account + dialogs ---------- */
.account-btn { gap: 8px; flex: none; white-space: nowrap; }
.join-btn { flex: none; white-space: nowrap; }
.account-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.account-btn.signed-in { padding: 4px 16px 4px 5px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--accent); color: var(--accent-ink); font: 500 0.8rem var(--sans); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.who .avatar { width: 52px; height: 52px; font-size: 1.1rem; }
.who strong { display: block; line-height: 1.3; font-weight: 500; }
.who div span { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.gsi-wrap { display: flex; justify-content: center; align-items: center; min-height: 44px; margin: 4px 0 18px; color: var(--muted); font-size: 0.92rem; text-align: center; }
.auth-foot { margin-top: 4px; }
.estimate { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; font-size: 0.92rem; margin: 0 0 18px; }
.estimate.warn { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.activity-title { font: 500 0.82rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.activity { list-style: none; margin: 0 0 18px; padding: 0; }
.act { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.act strong { display: block; font-size: 0.95rem; font-weight: 500; line-height: 1.3; }
.act div span { font-size: 0.82rem; color: var(--muted); }
.act .pill { flex: none; text-align: right; }
.owner-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin: 0 0 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 0.9rem; color: var(--muted); }
.nowrap { white-space: nowrap; }
.owner-note strong { color: var(--ink); font-weight: 500; }
.owner-note svg, .contact.masked svg { flex: none; width: 15px; height: 15px; margin-top: 4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act { flex-wrap: wrap; }
.contact { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.88rem; padding: 2px 0 4px; }
.contact strong { width: 100%; font-weight: 500; font-size: 0.82rem; color: var(--muted); }
.contact a { color: var(--accent); overflow-wrap: anywhere; }
.contact.masked { color: var(--muted); align-items: flex-start; gap: 8px; flex-wrap: nowrap; }
.act-actions { display: flex; flex: none; gap: 8px; }
.confirm { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; margin-top: 4px; border-radius: 12px; background: var(--accent-soft); font-size: 0.88rem; }
.banner { position: relative; z-index: 15; background: color-mix(in srgb, var(--danger) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); padding: 12px 0; font-size: 0.95rem; }
.banner[hidden] { display: none; }
.banner a { color: var(--ink); }
.stars-note { display: flex; gap: 10px; align-items: baseline; margin: -8px 0 16px; font-size: 0.88rem; color: var(--muted); }
.stars-note[hidden] { display: none; }
.star-row { flex: none; letter-spacing: 0.1em; font-size: 1.05rem; color: var(--ink); }
.handover { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 0 2px; font-size: 0.88rem; color: var(--muted); }
.handover-hint { flex-basis: 100%; margin: 0 0 2px; }
.handover.overdue { color: var(--danger); }
.admin-h { font: 500 0.82rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.admin-card { display: grid; gap: 8px; padding: 14px 16px; margin: 0 0 10px; background: var(--accent-soft); border-radius: 12px; }
.admin-card p { margin: 0; }
.admin-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.admin-card input { min-height: 44px; padding: 6px 12px; font-size: 1rem; }
.empty-note { color: var(--muted); font-size: 0.9rem; padding: 6px 0; }

dialog { border: 1px solid var(--line); border-radius: 22px; padding: 28px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / 0.25); }
dialog[open] { animation: pop 0.2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
dialog::backdrop { background: rgb(14 17 16 / 0.5); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.book-line { color: var(--muted); margin-bottom: 20px; }
.done { text-align: center; }
.done h3 { font-size: 1.3rem; margin: 8px 0; }
.done p { color: var(--muted); margin-bottom: 18px; }
.done-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.done-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 18px; font-size: 0.92rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (min-width: 1200px) {
  .wrap { max-width: 1120px; }
  .wrap.narrow { max-width: 680px; }
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .guide { max-width: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
/* The header's links and buttons need about 830px, so below that it collapses to the brand and an account button. */
@media (max-width: 860px) {
  .nav, .join-btn { display: none; }
  .account-btn, .account-btn.signed-in { margin-left: auto; width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .account-btn .lbl { display: none; }
  .account-btn .avatar { width: 34px; height: 34px; }
  .header-inner { gap: 8px; }
}
@media (max-width: 680px) {
  .brand { font-size: 1rem; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .toc ol { columns: 1; }
  .cta-row .btn { flex: 1 1 100%; }
  .chip { min-height: 40px; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .wrap { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .card { padding: 18px; border-radius: 16px; }
  dialog { padding: 20px; border-radius: 18px; }
  .summary { padding: 16px 18px; }
  .admin-row { grid-template-columns: 1fr; }
  .act-actions { flex: 1 1 100%; }
  .act-actions .btn { flex: 1; }
  .hero-search { flex-wrap: wrap; border-radius: 26px; padding: 6px; }
  .hero-search svg { margin-left: 10px; }
  .hero-search input { flex: 1 1 0; }
  .hero-search .btn { flex: 1 1 100%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 32px 0 24px; }
  .site-header { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
