/* ABDI Publishing storefront — shared stylesheet. Colors come from per-vertical tokens set inline on :root. */
:root {
  --bg: #F6F4EF; --ink: #1C1C1A; --accent: #1F4D3A; --rule: #C9C4B8; --muted: #5E5B55; --tile: #E9E5DB;
  --surface: #FFFFFF; --on-accent: #FFFFFF; --accent-hover: #173D2E; --focus: #1F4D3A; --notice: #FFF7E0; --notice-ink: #5A4300;
  --serif: "Caladea", Georgia, "Times New Roman", serif;
  --sans: "Carlito", Calibri, "Segoe UI", system-ui, sans-serif;
  --wrap: 1120px; --gutter: clamp(16px, 4vw, 40px);
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141513; --ink: #ECE9E1; --accent: #7FB79A; --rule: #3A3C37; --muted: #A9A59B; --tile: #22241F;
    --surface: #1B1D1A; --on-accent: #0F1A14; --accent-hover: #9CCBB1; --focus: #9CCBB1; --notice: #2D2717; --notice-ink: #F1DFA6;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.125rem/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { color: var(--heading, inherit); font-family: var(--serif); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.eyebrow { font: 700 .82rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.bar { width: 72px; height: 6px; background: var(--accent); border: 0; margin: 0 0 1.4rem; }
.lede { font: italic 400 clamp(1.2rem, 2.2vw, 1.45rem)/1.45 var(--serif); color: var(--ink); max-width: 38em; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { font: 700 1.05rem/1 var(--serif); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 14px; height: 14px; background: var(--accent); border-radius: 2px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 10px 12px; border-radius: var(--r); min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--tile); }
/* Phone: the brand and nav wrap onto two lines; give the brand room and a full-size tap target. */
@media (max-width: 640px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 6px; row-gap: 2px; }
  .brand { min-height: 44px; }
}
.site-footer { border-top: 1px solid var(--rule); margin-top: 96px; padding: 48px 0 64px; font-size: .95rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font: 700 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--muted); }

/* buttons & price */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: var(--r);
  font: 700 1.05rem/1 var(--sans); text-decoration: none; cursor: pointer; border: 2px solid var(--accent); transition: background-color .18s, color .18s; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-soon { background: var(--tile); color: var(--ink); border-color: var(--rule); cursor: default; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--tile); }
.price { font: 700 2.6rem/1 var(--serif); }
.price s { font-size: 1.3rem; color: var(--muted); font-weight: 400; margin-left: 10px; }
.buy-box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 1.6rem 0 1rem; }
.buy-box form { margin: 0; }
/* Price on its own line; the buy button and the second button (sample / view cart) share the row below, same height. */
.buy-box .price { flex: 0 0 100%; }
.buy-box .btn { min-height: 52px; }
@media (max-width: 859px) {
  .buy-box { gap: 12px; }
  .buy-box .btn { flex: 1 1 0; min-width: 0; padding: 0 14px; text-align: center; white-space: normal; line-height: 1.2; }
}
.fine { font-size: .92rem; color: var(--muted); }

/* hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); }
.hero .wrap { display: grid; gap: clamp(32px, 6vw, 72px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.25fr .75fr; } }
.cover { box-shadow: 10px 12px 0 var(--tile), 0 1px 2px rgba(0,0,0,.08); border-radius: 2px; aspect-ratio: 2 / 3; background: var(--tile); }
.cover-wrap { max-width: 360px; justify-self: center; width: 100%; }
/* Phone and tablet: the cover comes first in the hero (people recognise the book from the ad), sized so the price
   and Buy button follow close behind. */
@media (max-width: 859px) {
  .hero { padding-top: 24px; }
  .hero .cover-wrap { order: -1; max-width: 170px; }
  /* Then title, price and Buy, and only after that the longer description. */
  .hero .wrap > div:not(.cover-wrap) { display: flex; flex-direction: column; }
  .hero .wrap > div:not(.cover-wrap) > * { order: 3; }
  .hero .wrap > div:not(.cover-wrap) > .notice { order: 0; }
  .hero .wrap > div:not(.cover-wrap) > .eyebrow, .hero .wrap > div:not(.cover-wrap) > h1, .hero .wrap > div:not(.cover-wrap) > h2 { order: 1; }
  .hero .wrap > div:not(.cover-wrap) > .buy { order: 2; }
  .hero .buy .buy-box { margin-top: .4rem; }
}
.cover-wrap a { display: block; }
.hero .wrap > *, .grid-2 > *, .grid-3 > * { min-width: 0; }

/* topic grid motif from the cover */
.topics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 2rem 0 0; max-width: 560px; }
.topics span { font: 700 .72rem/1 var(--sans); letter-spacing: .12em; color: var(--muted); padding-bottom: 8px; }
.topics i { display: block; height: 14px; background: var(--tile); border-radius: 2px; }
.topics i.on { background: var(--accent); }

/* sections */
section.band { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--rule); }
.grid-2 { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stat { border-top: 3px solid var(--accent); padding-top: 14px; }
.stat b { display: block; font: 700 2.4rem/1 var(--serif); margin-bottom: 6px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; }
.parts { counter-reset: part; list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.parts > li { border-top: 1px solid var(--rule); padding: 18px 0; display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.parts > li .num { font: 700 .82rem/1.6 var(--sans); letter-spacing: .12em; color: var(--accent); }
.parts > li h3 { margin: 0 0 4px; font-size: 1.2rem; }
.parts > li p { margin: 0; color: var(--muted); font-size: 1rem; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { padding: 10px 0 10px 32px; border-top: 1px solid var(--rule); position: relative; }
.check li::before { content: ""; position: absolute; left: 2px; top: 18px; width: 14px; height: 14px; background: var(--accent); border-radius: 2px; }
.check.no li::before { background: transparent; border: 2px solid var(--muted); }
.faq details { border-top: 1px solid var(--rule); padding: 6px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font: 700 1.15rem/1.4 var(--serif); padding: 14px 32px 14px 0; list-style: none; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 1.5rem/1 var(--sans); color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink); max-width: 46em; }
.notice { background: var(--notice); color: var(--notice-ink); border-left: 4px solid currentColor; padding: 14px 18px; border-radius: 4px; margin: 0 0 24px; }
.draft-banner { background: var(--notice); color: var(--notice-ink); text-align: center; font-weight: 700; padding: 10px var(--gutter); font-size: .95rem; }
.prose { max-width: 46em; }
.prose h2 { font-size: 1.6rem; margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose li { margin: 4px 0; }
.catalog { display: grid; gap: 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.catalog a.book { text-decoration: none; color: var(--ink); display: block; }
.catalog a.book img { margin-bottom: 14px; }
.catalog a.book:hover h2 { text-decoration: underline; }
.catalog h2 { font-size: 1.3rem; }
.toc-list { columns: 2 260px; column-gap: 40px; padding-left: 1.2em; }
.toc-list li { break-inside: avoid; margin: 4px 0; }

/* forms */
form.stack { display: grid; gap: 18px; max-width: 520px; }
label { font-weight: 700; display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--r); padding: 12px 14px; min-height: 48px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }
.hint { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.error { color: #A1260D; font-weight: 700; font-size: .95rem; margin-top: 4px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* consent banner */
.consent { position: fixed; inset: auto 12px 12px 12px; max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 18px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 20; font-size: .98rem; }
.consent p { margin-bottom: 12px; }
.consent .row { display: flex; flex-wrap: wrap; gap: 10px; }
.consent .btn { min-height: 44px; padding: 0 18px; font-size: .95rem; }
/* Wide screens: a compact card at the bottom centre (owner, 2026-12-02). */
@media (min-width: 641px) {
  .consent { inset: auto 16px 16px 16px; max-width: 560px; margin: 0 auto; padding: 14px 16px; font-size: .86rem; line-height: 1.45; }
  .consent p { margin-bottom: 10px; }
  .consent .row { gap: 8px; }
  .consent .btn { min-height: 40px; padding: 0 12px; font-size: .85rem; }
}
/* Phone: a slim strip (one row of buttons) so the price and Buy button stay visible on the first screen. */
@media (max-width: 640px) {
  .consent { inset: auto 8px 8px 8px; padding: 12px 14px; font-size: .82rem; line-height: 1.4; }
  .consent p { margin-bottom: 8px; }
  .consent .row { flex-wrap: nowrap; gap: 6px; }
  .consent .btn { flex: 1 1 0; min-height: 40px; padding: 0 6px; font-size: .8rem; white-space: nowrap; }
}
.consent[hidden] { display: none; }

/* admin */
.admin table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin th, .admin td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin th { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin .table-wrap { overflow-x: auto; }
.tag { display: inline-block; font: 700 .75rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; background: var(--tile); color: var(--ink); }
.tag.ok { background: var(--accent); color: var(--on-accent); }
.tag.warn { background: var(--notice); color: var(--notice-ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .consent { display: none; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Excerpts and sample pages (shown only when a book's content module lists them) */
.excerpts { display: grid; gap: 24px; margin-top: 24px; }
.excerpt { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; }
.excerpt h3 { margin-top: 0; }
.excerpt blockquote { margin: 0 0 12px; padding-left: 16px; border-left: 3px solid var(--accent); white-space: pre-wrap; overflow-wrap: anywhere; }
.sample-pages { display: grid; gap: 20px; margin: 24px 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.sample-page { margin: 0; display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 18px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.sample-page h3 { font-size: 1.25rem; margin-bottom: .4em; }
.sample-page figcaption p { margin: 0 0 .6em; }
@media (max-width: 420px) { .sample-page { grid-template-columns: 1fr; } .sample-page a { max-width: 220px; } }
.sample-pages img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
.opt-in { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: .95rem; color: var(--muted); max-width: 620px; }
.opt-in input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }

/* Announcement bar above the header: owner's #B7492B with white text (5.2:1 contrast), dark pill. Still (no motion).
   Sticky: it stays at the top while the page scrolls; in-page links stop below it. */
html:has(.announce) { scroll-padding-top: 60px; }
.announce { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 6px var(--gutter); background: #B7492B; color: #FFFFFF; text-align: center; }
.announce-text { margin: 0; font: 800 .95rem/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.announce-detail { font-weight: 600; }
.announce-cta { flex: none; display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; border-radius: 999px; background: #0B0F19; color: #FFFFFF; font: 700 .85rem/1 var(--sans); text-decoration: none; white-space: nowrap; }
.announce-cta:hover { background: #000000; text-decoration: underline; text-underline-offset: 3px; }
.announce-cta:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
@media (max-width: 640px) {
  .announce { gap: 10px; min-height: 44px; }
  .announce-text { font-size: .8rem; }
  .announce-detail { display: none; }
  .announce-cta { min-height: 32px; padding: 0 12px; font-size: .78rem; }
}

/* Admin on phones: each table row becomes a card, each cell a "Label: value" line; long ids wrap instead of scrolling. */
.admin td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .admin h1 { font-size: 2rem; }
  .admin table.cards thead { display: none; }
  .admin table.cards, .admin table.cards tbody, .admin table.cards tr, .admin table.cards td { display: block; width: 100%; }
  .admin table.cards tr { border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 12px; margin-bottom: 12px; background: var(--surface); }
  .admin table.cards td { display: flex; gap: 12px; padding: 6px 0; border-bottom: 0; }
  .admin table.cards td[data-label]::before { content: attr(data-label); flex: 0 0 84px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
  .admin table.cards td:empty, .admin table.cards td[data-label="Notes"]:not(:has(.tag)) { display: none; }
  .admin form[action="/admin/orders"] > div, .admin form[action="/admin/orders"] input[type="text"], .admin form[action="/admin/orders"] select { width: 100%; }
  .admin form[action="/admin/orders"] label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; }
  .admin form[action="/admin/orders"] input[type="checkbox"] { width: 20px; height: 20px; margin: 0; }
}

/* Multi-book home: one hero per book, stacked; every other one puts the cover on the left on wide screens. */
.book-hero + .book-hero { border-top: 1px solid var(--rule); }
.book-hero h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; margin-top: 0; }
@media (min-width: 860px) {
  .book-hero.flip .wrap { grid-template-columns: .75fr 1.25fr; }
  .book-hero.flip .cover-wrap { order: -1; }
}

/* Cart. Wide screens: cart and recommendations on the left (about 65%), a sticky order summary on the right.
   Phones: cart, then summary, then recommendations; a compact checkout bar stays at the bottom until the summary is in view. */
.cart-page { padding-top: 40px; padding-bottom: 72px; }
.cart-layout { display: grid; gap: 32px 48px; align-items: start; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main" "summary" "recs"; }
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 65fr) minmax(300px, 35fr); grid-template-areas: "main summary" "recs summary"; }
  .cart-summary { position: sticky; top: 24px; }
}
.cart-main { grid-area: main; }
.cart-main h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0 0 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.cart-count { font-family: inherit; font-size: 1rem; font-weight: 400; color: var(--muted); }

/* Book covers keep their 2:3 shape and a tinted frame even if the image is missing. */
.cover-frame { display: block; aspect-ratio: 2 / 3; background: var(--tile); border-radius: 4px; overflow: hidden; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.cover-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cart-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cart-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.cart-item .cover-frame { width: 110px; }
.cart-item-title { font-size: 1.2rem; line-height: 1.25; margin: 0 0 6px; overflow-wrap: anywhere; }
.cart-item-title a { color: var(--ink); text-decoration: none; }
.cart-item-title a:hover { text-decoration: underline; }
.cart-item-sub { color: var(--muted); font-size: .92rem; line-height: 1.4; margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .85rem; color: var(--muted); }
.cart-item-meta li + li::before { content: "·"; margin: 0 8px; }
.cart-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.cart-item-end form { margin: 0; }
.cart-item-price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 6px 0; min-height: 32px; color: var(--muted); font: inherit; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.link-btn:disabled { opacity: .6; cursor: progress; }
.continue { display: inline-block; margin-top: 8px; padding: 6px 0; font-weight: 600; }
@media (max-width: 560px) {
  .cart-item { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
  .cart-item .cover-frame { width: 84px; grid-row: span 2; }
  .cart-item-end { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

/* Order summary */
.cart-summary { grid-area: summary; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; }
.cart-summary h2 { font-size: 1.25rem; margin: 0 0 16px; }
.summary-rows { margin: 0 0 20px; }
.summary-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary-rows dt { color: var(--muted); }
.summary-rows dd { margin: 0; font-weight: 600; }
.summary-discount dd { color: var(--accent); }
.summary-total { margin-top: 8px; padding-top: 14px !important; border-top: 1px solid var(--rule); font-size: 1.3rem; }
.summary-total dt { color: var(--ink); font-weight: 600; }
.summary-total dd { font-weight: 700; }
.cart-pay { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.btn-checkout { width: 100%; justify-content: center; text-align: center; min-height: 54px; padding: 0 12px; white-space: nowrap; font-size: clamp(.98rem, 1.4vw, 1.08rem); }
.btn-checkout:disabled, .cart-bar .btn:disabled { opacity: .75; cursor: progress; }
.assurance { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.assurance li { position: relative; padding-left: 22px; }
.assurance li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 9px; height: 5px; border-left: 2px solid var(--heading, var(--accent)); border-bottom: 2px solid var(--heading, var(--accent)); transform: rotate(-45deg); }
.consent-opt { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .92rem; cursor: pointer; }
.consent-opt input { width: 20px; height: 20px; margin: 1px 0 0; }
.consent-opt .small { display: block; margin-top: 2px; }

/* Recommendations: visually secondary to checkout. */
.cart-recs { grid-area: recs; margin-top: 8px; }
.cart-recs h2 { font-size: 1.35rem; margin: 0 0 4px; }
.cart-recs > p { margin: 0 0 20px; }
.rec-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.rec { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.rec .cover-frame { width: 120px; margin-bottom: 8px; }
.rec h3 { font-size: 1.05rem; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.rec h3 a { color: var(--ink); text-decoration: none; }
.rec h3 a:hover { text-decoration: underline; }
.rec-benefit { color: var(--muted); font-size: .9rem; line-height: 1.4; margin: 0; }
.rec-price { font-weight: 700; margin: 4px 0 0; }
.rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: auto; padding-top: 8px; }
.rec-actions form { margin: 0; }
.rec-view { font-weight: 600; font-size: .92rem; padding: 6px 0; }
.btn-small { padding: 8px 14px; min-height: 40px; font-size: .92rem; }

/* Empty cart */
.cart-empty { text-align: center; max-width: 520px; margin: 24px auto 48px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cart-empty-icon { color: var(--muted); }
.cart-empty h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 8px 0 0; }
.cart-empty p { margin: 0 0 12px; }
.cart-page > .cart-recs h2 { text-align: left; }

/* Phone checkout bar */
.cart-bar { display: none; }
@media (max-width: 899px) {
  .cart-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--rule); box-shadow: 0 -4px 14px rgb(0 0 0 / .08); }
  .cart-bar.is-hidden { display: none; }
  .cart-bar strong { font-size: 1.15rem; }
  .cart-bar .btn { min-height: 46px; }
  .cart-page:has(.cart-bar) { padding-bottom: 120px; }
}
.edition-pick { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 10px; }
.edition-pick select { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); }
/* Bullets inside a checklist item (the companion files on a book page). */
.check .sub-list { list-style: disc; margin: 8px 0 0; padding-left: 20px; }
.check .sub-list li { padding: 0; border-top: 0; margin: 4px 0; }
.check .sub-list li::before { content: none; }
.cover-frame img.is-missing { visibility: hidden; } /* a cover that failed to load leaves the tinted frame */
