:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --surface: #fffdfa;
  --surface-2: #eee7dc;
  --surface-3: #e4d8ca;
  --ink: #202431;
  --muted: #616474;
  --brand: #842f43;
  --brand-strong: #642133;
  --brand-soft: #f1dfe3;
  --accent: #b6873d;
  --line: #d9cec1;
  --focus: #1769aa;
  --success: #2f7352;
  --danger: #a33a3a;
  --shadow: 0 18px 50px rgba(50, 32, 35, 0.10);
  --shadow-small: 0 8px 24px rgba(50, 32, 35, 0.08);
  --radius: 1.35rem;
  --radius-small: .8rem;
  --shell: min(1180px, calc(100% - 2rem));
  --header-height: 78px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14151b;
  --surface: #1e2029;
  --surface-2: #282a34;
  --surface-3: #333541;
  --ink: #f5f0e9;
  --muted: #b9b7bf;
  --brand: #d88398;
  --brand-strong: #f0a1b4;
  --brand-soft: #3e2931;
  --accent: #e0b465;
  --line: #3f414d;
  --focus: #73b8f2;
  --success: #78c6a0;
  --danger: #ee9292;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-small: 0 8px 24px rgba(0, 0, 0, .28);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #14151b;
    --surface: #1e2029;
    --surface-2: #282a34;
    --surface-3: #333541;
    --ink: #f5f0e9;
    --muted: #b9b7bf;
    --brand: #d88398;
    --brand-strong: #f0a1b4;
    --brand-soft: #3e2931;
    --accent: #e0b465;
    --line: #3f414d;
    --focus: #73b8f2;
    --success: #78c6a0;
    --danger: #ee9292;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    --shadow-small: 0 8px 24px rgba(0, 0, 0, .28);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); line-height: 1.6; }
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.08; letter-spacing: -.025em; }
h1 { font-size: clamp(2.7rem, 7vw, 5.7rem); }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

.shell { width: var(--shell); margin-inline: auto; }
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section--compact { padding-top: 1rem; }
.section--tint { background: var(--surface-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.2rem; }
.section-head > div { max-width: 760px; }
.section-head p:last-child { color: var(--muted); font-size: 1.05rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.fine-print, .source-note { color: var(--muted); font-size: .86rem; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.icon { width: 1.2em; height: 1.2em; flex: 0 0 auto; }

.skip-link { position: fixed; z-index: 9999; top: .75rem; left: .75rem; transform: translateY(-160%); padding: .75rem 1rem; background: var(--ink); color: var(--bg); border-radius: .6rem; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.offline-banner { position: sticky; z-index: 90; top: 0; display: flex; justify-content: center; align-items: center; gap: .55rem; padding: .55rem 1rem; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 700; }
.site-header { position: sticky; z-index: 80; top: 0; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 20%); background: color-mix(in srgb, var(--bg), transparent 8%); backdrop-filter: blur(16px); }
.site-header__inner { min-height: var(--header-height); display: flex; align-items: center; gap: 1.2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .9rem; background: var(--brand); color: #fff; transform: rotate(-3deg); }
.brand__mark .icon { width: 1.55rem; height: 1.55rem; }
.brand span:last-child { display: grid; line-height: 1.02; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.brand small { margin-top: .28rem; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.brand--footer { margin-bottom: 1rem; }
.primary-nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.primary-nav a { display: flex; align-items: center; gap: .35rem; padding: .65rem .78rem; border-radius: .65rem; color: var(--muted); font-size: .91rem; font-weight: 750; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--surface); color: var(--brand); }
.nav-count { min-width: 1.35rem; padding: .08rem .35rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); text-align: center; font-size: .72rem; }
.header-actions { display: flex; gap: .35rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.7rem; height: 2.7rem; padding: 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); color: var(--ink); }
.icon-button:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.menu-button { display: none; margin-left: auto; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3rem; padding: .75rem 1rem; border: 1px solid transparent; border-radius: .75rem; font-weight: 800; line-height: 1.1; text-decoration: none; }
.button--primary { background: var(--brand); color: var(--bg); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand), transparent 72%); }
.button--primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.button--secondary { border-color: var(--ink); background: transparent; color: var(--ink); }
.button--secondary:hover { background: var(--ink); color: var(--bg); }
.button--ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button--ghost:hover { border-color: var(--brand); color: var(--brand); }
.button-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--brand); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 1rem; }

.hero { padding-block: clamp(3rem, 7vw, 6.5rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: center; gap: clamp(2rem, 6vw, 5.5rem); }
.hero__copy h1 span { color: var(--brand); }
.hero__lede { max-width: 700px; margin-block: 1.4rem 1.8rem; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.35rem); }
.hero__proof { display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; margin-top: 1.6rem; list-style: none; color: var(--muted); font-size: .9rem; font-weight: 750; }
.hero__proof li { display: flex; align-items: center; gap: .35rem; }
.hero__proof .icon { color: var(--success); }
.hero-art { position: relative; }
.hero-art img { width: 100%; filter: drop-shadow(0 20px 30px rgba(58, 37, 40, .16)); }
.hero-art__badge { position: absolute; display: grid; min-width: 9.8rem; padding: .8rem 1rem; border: 1px solid color-mix(in srgb, var(--line), transparent 10%); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow-small); }
.hero-art__badge strong { color: var(--brand); font-family: Georgia, serif; font-size: 1.55rem; }
.hero-art__badge span { color: var(--muted); font-size: .75rem; }
.hero-art__badge--one { left: -1rem; bottom: 15%; }
.hero-art__badge--two { right: -1rem; top: 13%; }

.trust-strip { border-block: 1px solid var(--line); background: var(--surface); }
.trust-strip__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.trust-strip__grid > div { display: flex; align-items: center; gap: .75rem; padding: 1.15rem 1.5rem; border-right: 1px solid var(--line); }
.trust-strip__grid > div:last-child { border-right: 0; }
.trust-strip .icon { color: var(--brand); font-size: 1.25rem; }
.trust-strip span { display: grid; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.trust-strip strong { color: var(--ink); font-size: .9rem; }

.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.book-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.book-card__cover { position: relative; display: block; aspect-ratio: 2 / 2.7; overflow: hidden; background: var(--surface-3); }
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.book-card:hover .book-card__cover img { transform: scale(1.025); }
.book-card__body { min-width: 0; display: flex; flex: 1; flex-direction: column; padding: 1.15rem; }
.book-card__meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-bottom: .65rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.book-card h3 { font-size: 1.3rem; }
.book-card h3 a { text-decoration: none; }
.book-card h3 a:hover { color: var(--brand); }
.book-card__author { color: var(--brand); font-size: .86rem; font-weight: 750; }
.book-card__body > p:not(.book-card__author) { color: var(--muted); font-size: .91rem; }
.book-card__footer { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-top: auto; padding-top: .8rem; }
.book-card--compact .book-card__body { padding: 1rem; }

.workflow-grid, .split-feature { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; gap: clamp(2.5rem, 7vw, 6rem); }
.workflow-grid > div > p:last-child, .split-feature > div > p { color: var(--muted); }
.step-list { display: grid; gap: .8rem; list-style: none; }
.step-list li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.step-list li > span { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .8rem; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.step-list p { margin: .35rem 0 0; color: var(--muted); }
.cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--radius); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.cta-panel .eyebrow { color: var(--bg); }
.cta-panel .button--secondary { border-color: var(--bg); color: var(--bg); }
.cta-panel .button--secondary:hover { background: var(--bg); color: var(--ink); }
.cta-panel p:last-child { max-width: 700px; margin: .65rem 0 0; color: color-mix(in srgb, var(--bg), transparent 25%); }

.page-hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) 2.4rem; }
.page-hero > p:last-child { max-width: 760px; margin-top: 1rem; color: var(--muted); font-size: 1.15rem; }
.search-field { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus), transparent 80%); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-field--large { min-height: 4rem; padding-inline: 1rem; }
.search-field--large input { font-size: 1.18rem; }
.discover-form { display: grid; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .8rem; align-items: end; }
.filter-row label, .goal-form label, .dialog-surface label { display: grid; gap: .35rem; color: var(--muted); font-size: .82rem; font-weight: 800; }
select, input[type="number"], textarea, .dialog-surface input:not([type="hidden"]) { width: 100%; min-height: 3rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); color: var(--ink); }
textarea { resize: vertical; }
.search-status { min-height: 3.2rem; padding: 1rem 0; color: var(--muted); }
.search-status.is-error { color: var(--danger); }
.search-status.is-success { color: var(--success); }
.search-skeleton { display: grid; gap: 1rem; }
.skeleton-card { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: 1rem; border-radius: 1rem; background: var(--surface); }
.skeleton-card > span, .skeleton-card i { display: block; border-radius: .5rem; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-card > span { aspect-ratio: 2 / 3; }
.skeleton-card div { display: grid; align-content: center; gap: .65rem; }
.skeleton-card i { height: 1rem; }
.skeleton-card i:nth-child(2) { width: 70%; }
.skeleton-card i:nth-child(3) { width: 45%; }
.live-results { display: grid; gap: 1rem; }
.live-book { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.live-book__cover { display: grid; place-items: center; aspect-ratio: 2 / 3; overflow: hidden; border-radius: .7rem; background: var(--surface-2); }
.live-book__cover img { width: 100%; height: 100%; object-fit: cover; }
.live-book__cover span { padding: .7rem; color: var(--muted); text-align: center; font-size: .78rem; }
.live-book__content { min-width: 0; }
.live-book__content h2 { font-size: 1.5rem; }
.live-book__content > p { color: var(--muted); }
.live-book__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.pagination-row { display: flex; justify-content: center; padding-top: 1.2rem; }

.path-stack { display: grid; gap: 2rem; }
.reading-path { display: grid; grid-template-columns: minmax(250px, .65fr) minmax(0, 1.35fr); gap: 2rem; padding: clamp(1.4rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.reading-path__intro { align-self: center; }
.reading-path__intro > p:not(.eyebrow) { color: var(--muted); }
.path-number { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-bottom: 1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-family: Georgia, serif; font-size: 1.4rem; }

.book-detail { display: grid; grid-template-columns: minmax(260px, .55fr) minmax(0, 1.45fr); gap: clamp(2rem, 7vw, 6rem); padding-block: clamp(3rem, 8vw, 7rem); }
.book-detail__cover { position: sticky; top: calc(var(--header-height) + 2rem); align-self: start; }
.book-detail__cover img { width: min(100%, 420px); margin-inline: auto; border-radius: .7rem; box-shadow: var(--shadow); }
.book-detail__author { margin-top: .7rem; color: var(--brand); font-size: 1.1rem; font-weight: 800; }
.book-detail__lede { margin-block: 1.4rem; color: var(--muted); font-size: 1.18rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.tag { padding: .38rem .65rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 800; }
.why-read { margin-block: 1.5rem; padding: 1.3rem; border-left: 4px solid var(--accent); border-radius: 0 1rem 1rem 0; background: var(--surface); }
.why-read h2 { font-size: 1.7rem; }
.why-read p:last-child { margin: .6rem 0 0; }

.shelf-overview { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 2rem; align-items: end; padding: 1.5rem; border-radius: var(--radius); background: var(--ink); color: var(--bg); }
.shelf-overview h2 { font-size: 2rem; }
.shelf-overview p:last-child { color: color-mix(in srgb, var(--bg), transparent 30%); }
.shelf-overview .eyebrow, .shelf-overview .goal-form label { color: var(--bg); }
.shelf-overview .button--secondary { border-color: var(--bg); color: var(--bg); }
.shelf-overview .button--secondary:hover { background: var(--bg); color: var(--ink); }
.progress-track { height: .75rem; margin-block: 1rem .7rem; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--bg), transparent 85%); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.goal-form { display: grid; gap: .7rem; }
.goal-form input { background: color-mix(in srgb, var(--surface), transparent 4%); color: var(--ink); }
.shelf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block: 1.2rem; }
.shelf-tabs { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .82rem; font-weight: 800; }
.chip.is-active, .chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip span { margin-left: .25rem; }
.shelf-status { min-height: 1.5rem; color: var(--muted); }
.shelf-grid { display: grid; gap: .9rem; }
.shelf-item { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.shelf-item__cover { aspect-ratio: 2 / 3; overflow: hidden; border-radius: .55rem; background: var(--surface-2); }
.shelf-item__cover img { width: 100%; height: 100%; object-fit: cover; }
.shelf-item__content { min-width: 0; }
.shelf-item h3 { font-size: 1.28rem; }
.shelf-item__author { color: var(--muted); font-size: .85rem; }
.shelf-item__meta { display: flex; flex-wrap: wrap; gap: .4rem .75rem; color: var(--muted); font-size: .78rem; }
.shelf-item__note { margin-top: .55rem; padding: .55rem .7rem; border-radius: .6rem; background: var(--surface-2); color: var(--muted); font-size: .84rem; white-space: pre-wrap; }
.shelf-item__actions { display: flex; gap: .45rem; }
.empty-state { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 2rem; padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-state img { width: min(100%, 440px); margin-inline: auto; }
.empty-state p:not(.eyebrow) { color: var(--muted); }
.data-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.data-tools > div:first-child { max-width: 700px; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.privacy-grid, .feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.privacy-grid article, .fact-card, .notice-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.privacy-grid p, .fact-card p { color: var(--muted); }
.fact-card { display: flex; gap: .85rem; }
.fact-card > .icon { flex: 0 0 auto; color: var(--brand); font-size: 1.35rem; }
.check-list { display: grid; gap: .7rem; list-style: none; }
.check-list li { display: flex; gap: .55rem; align-items: flex-start; }
.check-list .icon { margin-top: .25rem; color: var(--success); }
.architecture-flow { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.architecture-flow span { padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); font-weight: 800; }

.not-found { min-height: 68vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 3rem; align-items: center; padding-block: 3rem; }
.not-found > * { min-width: 0; }
.not-found p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 1.1rem; }

.site-footer { padding-block: 4rem 1.2rem; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; }
.site-footer h2 { margin-bottom: .8rem; font-family: inherit; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer p, .footer-links { color: var(--muted); font-size: .88rem; }
.footer-links { display: grid; gap: .55rem; list-style: none; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }

.command-dialog, .book-preview-dialog, .shelf-dialog { width: min(720px, calc(100% - 1.5rem)); max-width: none; max-height: min(88vh, 800px); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 90px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(12, 13, 18, .7); backdrop-filter: blur(5px); }
.command-dialog__surface, .dialog-surface { display: grid; gap: 1rem; padding: 1.2rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dialog-head h2 { font-size: 1.8rem; }
.command-results { display: grid; gap: .35rem; max-height: 360px; overflow: auto; }
.command-results a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border-radius: .65rem; text-decoration: none; }
.command-results a:hover, .command-results a.is-active { background: var(--brand-soft); color: var(--brand); }
.command-hint { margin: 0; color: var(--muted); font-size: .78rem; }
kbd { padding: .15rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem; background: var(--surface-2); }
.book-preview-dialog .dialog-surface { overflow: auto; max-height: inherit; }
.preview-grid { display: grid; grid-template-columns: 150px 1fr; gap: 1.2rem; }
.preview-cover { min-height: 210px; display: grid; place-items: center; overflow: hidden; border-radius: .7rem; background: var(--surface-2); }
.preview-cover img { width: 100%; height: 100%; object-fit: cover; }
.preview-content p { color: var(--muted); }
.toast-region { position: fixed; z-index: 110; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; width: min(360px, calc(100% - 2rem)); pointer-events: none; }
.toast { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: toast-in .2s ease; }
.form-status { min-height: 1.4rem; margin: .5rem 0 0; color: var(--muted); }
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--success); }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1020px) {
  .hero__grid { grid-template-columns: 1fr 380px; gap: 2rem; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reading-path { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: repeat(3, 1fr); }
  .filter-row .button { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  :root { --header-height: 70px; }
  .menu-button { display: inline-grid; }
  .site-header__inner { flex-wrap: wrap; gap: .5rem; padding-block: .6rem; }
  .primary-nav { order: 3; display: none; width: 100%; flex-direction: column; align-items: stretch; margin: .4rem 0 0; padding: .55rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: var(--shadow-small); }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { justify-content: space-between; }
  .header-actions { margin-left: 0; }
  .hero__grid, .workflow-grid, .split-feature, .book-detail, .not-found { grid-template-columns: 1fr; }
  .hero-art { max-width: 560px; margin-inline: auto; }
  .hero-art__badge--one { left: 0; }
  .hero-art__badge--two { right: 0; }
  .trust-strip__grid { grid-template-columns: 1fr; }
  .trust-strip__grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-strip__grid > div:last-child { border-bottom: 0; }
  .book-detail__cover { position: static; }
  .book-detail__cover img { max-height: 520px; width: auto; }
  .shelf-overview, .data-tools { grid-template-columns: 1fr; }
  .book-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .not-found img { order: -1; width: min(100%, 420px); max-width: 100%; margin-inline: auto; }
}

@media (max-width: 620px) {
  :root { --shell: min(100% - 1rem, 1180px); }
  h1 { font-size: clamp(2.45rem, 14vw, 4rem); }
  .section { padding-block: 3.5rem; }
  .site-header__inner { min-height: 64px; }
  .brand small { display: none; }
  .brand strong { font-size: 1.15rem; }
  .header-actions .icon-button, .menu-button { width: 2.5rem; height: 2.5rem; }
  .hero { padding-top: 2.5rem; }
  .hero-art__badge { position: static; display: inline-grid; margin: .4rem; }
  .hero-art { display: flex; flex-wrap: wrap; justify-content: center; }
  .hero-art img { flex-basis: 100%; }
  .section-head, .cta-panel, .site-footer__bottom, .shelf-toolbar { align-items: stretch; flex-direction: column; }
  .book-grid, .book-grid--three { grid-template-columns: 1fr; }
  .filter-row { grid-template-columns: 1fr; }
  .filter-row .button { grid-column: auto; }
  .live-book { grid-template-columns: 82px 1fr; }
  .live-book__actions { grid-column: 1 / -1; }
  .reading-path { padding: 1rem; }
  .shelf-item { grid-template-columns: 64px 1fr; }
  .shelf-item__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .empty-state { grid-template-columns: 1fr; padding: 1rem; }
  .privacy-grid, .feature-grid { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .button-row > .button { width: 100%; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-cover { max-width: 180px; margin-inline: auto; }
}

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