/* =========================================================
   ZimBooks — Zimbabwean Stories. Global Readers.
   Design system
   ========================================================= */

:root {
  --green-950: #0a2119;
  --green-900: #0e2a1f;
  --green: #163a2b;
  --green-700: #1f4f3b;
  --green-100: #e4ebe5;
  --ivory: #f8f4ec;
  --cream: #f1eadb;
  --paper: #fffdf9;
  --gold: #a8873a;
  --gold-600: #7a5f22;
  --gold-btn: #8c6f2c;
  --gold-200: #e5d3a8;
  --ink: #1a1a18;
  --ink-2: #45433d;
  --ink-3: #736f67;
  --line: #e3d9c6;
  --line-2: #d2c5ad;
  --red: #a8322a;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 3px;
  --radius-lg: 4px;
  --shadow-sm: 0 1px 2px rgba(28, 28, 26, .06), 0 2px 8px rgba(28, 28, 26, .04);
  --shadow: 0 2px 6px rgba(28, 28, 26, .06), 0 12px 32px rgba(28, 28, 26, .08);
  --shadow-book: 0 1px 1px rgba(0,0,0,.08), 0 6px 14px rgba(28,28,26,.14), 0 18px 36px rgba(28,28,26,.10);
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13 L14 1 L28 13' fill='none' stroke='%23b8913f' stroke-width='1.4' stroke-opacity='.55'/%3E%3C/svg%3E");
  --chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13 L14 1 L28 13' fill='none' stroke='%23ead9b0' stroke-width='1.2' stroke-opacity='.22'/%3E%3C/svg%3E");
  --chequer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect width='8' height='8' fill='%23b8913f' fill-opacity='.10'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23b8913f' fill-opacity='.10'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 15.5px/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-200); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.7rem, 6vw, 5rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: 1.5rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 820px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section--cream { background: var(--cream); }
.section--paper { background: var(--paper); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 .7rem/1 var(--sans);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-3); }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 8px 0 0; color: var(--ink-3); }
.link-arrow { font-weight: 600; color: var(--green); display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.link-arrow::after { content: "→"; transition: transform .2s; }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--green); --b-fg: var(--ivory); --b-bd: var(--green);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  background: var(--b-bg); color: var(--b-fg);
  border: 1px solid var(--b-bd); border-radius: 2px;
  font: 500 .74rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  transition: transform .15s, background .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--b-hover, var(--green-700)); border-color: var(--b-hover, var(--green-700)); }
.btn:active { transform: translateY(0); }
.btn--gold { --b-bg: var(--gold-btn); --b-fg: #fff; --b-bd: var(--gold-btn); --b-hover: var(--gold-600); }
.btn--gold:hover { --b-bg: var(--gold-600); --b-bd: var(--gold-600); }
.btn--ghost { --b-bg: transparent; --b-fg: var(--green); --b-bd: var(--green); --b-hover: var(--green); }
.btn--ghost:hover { color: var(--ivory); }
.btn--light { --b-bg: transparent; --b-fg: var(--ivory); --b-bd: rgba(250,246,238,.5); --b-hover: var(--ivory); }
.btn--light:hover { color: var(--green); }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: .68rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Announcement + Header ---------- */
.announce {
  background: var(--green-950); color: var(--gold-200);
  font-size: .8rem; letter-spacing: .02em; text-align: center;
  padding: 9px var(--gutter);
}
.announce a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.flag-rule { display: flex; height: 3px; }
.flag-rule span { flex: 1; }
.flag-rule span:nth-child(1) { background: var(--green); }
.flag-rule span:nth-child(2) { background: var(--gold); }
.flag-rule span:nth-child(3) { background: var(--red); }
.flag-rule span:nth-child(4) { background: var(--ink); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 238, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo__mark { width: 38px; height: 38px; }
.logo__word { font: 600 1.7rem/1 var(--serif); letter-spacing: -.01em; color: var(--green); }
.logo__word em { font-style: normal; color: var(--gold); }
.logo__tld { display: block; font: 500 .58rem/1 var(--sans); letter-spacing: .22em; color: var(--ink-3); margin-top: 4px; text-transform: uppercase; }

.header-search { flex: 1; max-width: 440px; position: relative; }
.header-search input {
  width: 100%; height: 44px; padding: 0 16px 0 44px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 2px;
  font-size: .9rem; transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184,145,63,.15); }
.header-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); }

.main-nav { display: flex; gap: 26px; align-items: center; }
.main-nav a { font-size: .92rem; font-weight: 500; color: var(--ink-2); position: relative; padding: 6px 0; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--gold); transform: scaleX(0); transition: transform .25s; transform-origin: left; }
.main-nav a:hover, .main-nav a.is-active { color: var(--green); }
.main-nav a:hover::after, .main-nav a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.currency-select {
  height: 36px; padding: 0 28px 0 12px; border: 1px solid var(--line-2); border-radius: 2px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2375716a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
}
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--ink-2);
  position: relative; transition: background .2s;
}
.icon-btn:hover { background: var(--cream); color: var(--green); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge {
  position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: .65rem; font-weight: 700; display: grid; place-items: center;
}
.menu-toggle { display: none; }

.mobile-drawer {
  position: fixed; inset: 0; z-index: 100; display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer__scrim { position: absolute; inset: 0; background: rgba(15,46,34,.45); animation: fade .2s; }
.mobile-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 360px);
  background: var(--ivory); padding: 22px 24px; overflow-y: auto;
  animation: slideIn .25s ease-out; display: flex; flex-direction: column; gap: 6px;
}
.mobile-drawer__panel a.m-link { font: 500 1.4rem/1.2 var(--serif); padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--green); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-grid; }
}
@media (max-width: 720px) {
  .header-inner { height: 64px; gap: 12px; }
  .header-search { display: none; }
  .logo__tld { display: none; }
  .currency-select { display: none; }
  .header-actions .btn { display: none; }
}

/* ---------- Search (large) ---------- */
.search-xl { position: relative; max-width: 560px; }
.search-xl input {
  width: 100%; height: 60px; padding: 0 136px 0 54px;
  border-radius: 2px; border: 1px solid var(--line-2); background: var(--paper);
  font-size: 1rem;
}
.search-xl input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 5px rgba(184,145,63,.16); }
.search-xl > svg { position: absolute; left: 20px; top: 30px; transform: translateY(-50%); width: 20px; color: var(--ink-3); }
.search-xl .btn { position: absolute; right: 6px; top: 6px; min-height: 48px; border-radius: 1px; }
@media (max-width: 520px) {
  .search-xl input { padding-right: 20px; height: 54px; }
  .search-xl > svg { top: 27px; }
  .search-xl .btn { position: static; width: 100%; margin-top: 10px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(44px, 7vw, 96px) 0 clamp(56px, 8vw, 112px); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero h1 .accent { font-style: italic; color: var(--green); font-weight: 500; }
.hero .lead { margin-bottom: 32px; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero__trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; font-size: .86rem; color: var(--ink-3); }
.hero__trust span { display: inline-flex; gap: 8px; align-items: center; }
.hero__trust svg { width: 16px; color: var(--gold); }

.hero__stage {
  position: relative; aspect-ratio: 1 / 1.02; border-radius: 2px;
  background: var(--green) var(--chevron-light); background-size: 28px 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  display: grid; place-items: center; isolation: isolate;
}
.hero__stage::before {
  content: ""; position: absolute; inset: 16px; border: 1px solid rgba(234,217,176,.22);
}
.hero__stage::after {
  content: ""; position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,145,63,.38), transparent 68%); z-index: -1;
}
.hero__books { position: relative; width: 78%; height: 72%; }
.hero__books .cover { position: absolute; width: 46%; box-shadow: 0 30px 60px rgba(0,0,0,.35), 0 8px 18px rgba(0,0,0,.25); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.hero__books .cover:nth-child(1) { left: 0; top: 14%; transform: rotate(-9deg); }
.hero__books .cover:nth-child(2) { left: 27%; top: 0; z-index: 2; width: 50%; }
.hero__books .cover:nth-child(3) { right: 0; top: 16%; transform: rotate(8deg); }
.hero__stage:hover .cover:nth-child(1) { transform: rotate(-12deg) translateX(-10px); }
.hero__stage:hover .cover:nth-child(3) { transform: rotate(11deg) translateX(10px); }
.hero__stage:hover .cover:nth-child(2) { transform: translateY(-8px); }
.hero__tag {
  position: absolute; left: -18px; bottom: 12%; z-index: 3;
  background: var(--paper); border-radius: 2px; padding: 14px 18px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; max-width: 250px;
}
.hero__tag strong { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.1; }
.hero__tag small { color: var(--ink-3); font-size: .78rem; line-height: 1.35; display: block; }
.hero__tag .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; flex-shrink: 0; color: var(--green); }
.hero__tag .dot svg { width: 20px; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__stage { max-width: 520px; width: 100%; margin: 0 auto; aspect-ratio: 1.15 / 1; }
  .hero__tag { left: 12px; bottom: 12px; }
}

/* ---------- Chevron band ---------- */
.chevron-band { height: 14px; background: var(--chevron) repeat-x; background-size: 28px 14px; opacity: .9; }

/* ---------- Book cover (generated) ---------- */
.cover {
  --bg: var(--green); --fg: #f3e9d2; --ac: var(--gold);
  container-type: inline-size;
  position: relative; aspect-ratio: 2 / 3; width: 100%;
  background: var(--bg); color: var(--fg);
  border-radius: 3px 7px 7px 3px; overflow: hidden;
  box-shadow: var(--shadow-book);
  isolation: isolate;
}
.cover__in {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 11cqw 10cqw 9cqw 13cqw;
}
.cover::before { /* spine shading */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6cqw; z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,.22), rgba(255,255,255,.08) 55%, rgba(0,0,0,.08));
}
.cover::after { /* paper sheen */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.10), transparent 40%, rgba(0,0,0,.08));
}
.cover__art { position: absolute; inset: 0; z-index: -1; }
.cover--image { padding: 0; }
.cover--image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__kicker { font-family: var(--sans); font-weight: 600; font-size: 4.2cqw; line-height: 1; letter-spacing: .2em; text-transform: uppercase; color: var(--ac); }
.cover__title { font-family: var(--serif); font-weight: 600; font-size: 13cqw; line-height: 1; letter-spacing: -.005em; text-wrap: balance; }
.cover__author { font-family: var(--sans); font-weight: 500; font-size: 4.2cqw; line-height: 1.2; letter-spacing: .18em; text-transform: uppercase; }
.cover__rule { width: 18cqw; height: .8cqw; background: var(--ac); margin: 5cqw 0; }

.cover--chevron .cover__art { background: linear-gradient(transparent 62%, var(--ac) 62%, var(--ac) 63%, transparent 63%), var(--bg); }
.cover--chevron .cover__art::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background-image: linear-gradient(135deg, var(--ac) 25%, transparent 25%), linear-gradient(225deg, var(--ac) 25%, transparent 25%);
  background-size: 14cqw 14cqw; background-position: 0 0; opacity: .5;
}
.cover--sun .cover__art::before {
  content: ""; position: absolute; width: 92cqw; aspect-ratio: 1; border-radius: 50%;
  right: -32cqw; bottom: -22cqw; background: var(--ac); opacity: .9;
}
.cover--sun .cover__art::after {
  content: ""; position: absolute; width: 92cqw; aspect-ratio: 1; border-radius: 50%;
  right: -32cqw; bottom: -22cqw; border: .7cqw solid var(--fg); transform: translate(-8cqw, -8cqw); opacity: .35;
}
.cover--frame .cover__art::before { content: ""; position: absolute; inset: 6cqw 6cqw 6cqw 9cqw; border: .7cqw solid var(--ac); }
.cover--frame .cover__in { justify-content: center; text-align: center; align-items: center; padding: 16cqw; }
.cover--frame .cover__rule { margin: 6cqw auto; }
.cover--frame .cover__kicker { position: absolute; top: 12cqw; left: 0; right: 0; }
.cover--frame .cover__author { position: absolute; bottom: 12cqw; left: 0; right: 0; }
.cover--stripes .cover__art {
  background:
    repeating-linear-gradient(90deg, var(--ac) 0 1.4cqw, transparent 1.4cqw 4cqw) left 13cqw top 0 / 18cqw 100% no-repeat,
    var(--bg);
}
.cover--stripes .cover__in { padding-left: 38cqw; }
.cover--arch .cover__art::before {
  content: ""; position: absolute; left: 18cqw; right: 12cqw; top: 36cqw; bottom: -2cqw;
  background: var(--ac); border-radius: 60cqw 60cqw 0 0; opacity: .92;
}
.cover--arch .cover__art::after {
  content: ""; position: absolute; left: 28cqw; right: 22cqw; top: 50cqw; bottom: -2cqw;
  background: var(--bg); border-radius: 50cqw 50cqw 0 0;
}
.cover--mosaic .cover__art {
  background:
    conic-gradient(from 45deg at 50% 50%, var(--ac) 0 25%, transparent 0 50%, var(--ac) 0 75%, transparent 0) 0 0 / 16cqw 16cqw,
    var(--bg);
  -webkit-mask: linear-gradient(transparent 55%, #000 55%); mask: linear-gradient(transparent 55%, #000 55%);
  opacity: .55;
}
.cover--mosaic { background: var(--bg); }

/* ---------- Book card ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 40px 28px; }
@media (max-width: 520px) { .book-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; } }
.book-card { display: flex; flex-direction: column; gap: 14px; }
.book-card__cover { position: relative; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.book-card:hover .book-card__cover { transform: translateY(-4px); }
.book-card:hover .cover { box-shadow: 0 2px 2px rgba(0,0,0,.08), 0 14px 26px rgba(28,28,26,.18), 0 30px 50px rgba(28,28,26,.12); }
.book-card__tag {
  position: absolute; top: 10px; right: -6px; z-index: 5;
  background: var(--red); color: #fff; font: 700 .64rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 3px 3px 0 3px;
}
.book-card__tag::after { content: ""; position: absolute; right: 0; bottom: -5px; border: 3px solid transparent; border-top-color: #7a221c; border-left-color: #7a221c; }
.book-card__tag--new { background: var(--gold); }
.book-card__tag--new::after { border-top-color: var(--gold-600); border-left-color: var(--gold-600); }
.book-card__title { font: 600 1.28rem/1.15 var(--serif); margin: 0; }
.book-card__author { font-size: .84rem; color: var(--ink-3); margin: 4px 0 0; }
.book-card__meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; gap: 8px; }
.price { font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; font-size: .92rem; }
.chip-sm { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* horizontal shelf */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 196px); gap: 28px; overflow-x: auto; padding: 8px 4px 24px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.shelf > * { scroll-snap-align: start; }
.shelf-wrap { position: relative; }
.shelf-wrap::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 10px; background: linear-gradient(var(--line), transparent); border-radius: 50%; opacity: .7; pointer-events: none; }

/* ---------- Categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cat-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.cat-card:hover { border-color: var(--gold); }
.cat-card__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--green-100); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.cat-card__icon svg { width: 22px; }
.cat-card strong { display: block; font: 600 1.25rem/1.15 var(--serif); }
.cat-card small { color: var(--ink-3); font-size: .8rem; }

/* ---------- Featured (spotlight) ---------- */
.spotlight {
  display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 52px); position: relative; overflow: hidden;
}
.spotlight::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 120px; background: var(--chequer); background-size: 16px; opacity: .8; -webkit-mask: linear-gradient(90deg, transparent, #000); mask: linear-gradient(90deg, transparent, #000); }
.spotlight h3 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 500; margin-bottom: 8px; }
.spotlight .by { color: var(--ink-3); margin-bottom: 20px; }
.spotlight .by a { color: var(--green); font-weight: 600; border-bottom: 1px solid var(--gold-200); }
@media (max-width: 760px) { .spotlight { grid-template-columns: 1fr; } .spotlight > .spot-cover { max-width: 230px; } }

/* ranked list */
.ranked { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 40px; counter-reset: rank; }
.ranked a { display: grid; grid-template-columns: 44px 62px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ranked a::before { counter-increment: rank; content: counter(rank, decimal-leading-zero); font: italic 500 1.9rem/1 var(--serif); color: var(--gold); }
.ranked a:hover strong { color: var(--green); }
.ranked strong { font: 600 1.2rem/1.2 var(--serif); display: block; transition: color .2s; }
.ranked small { color: var(--ink-3); font-size: .82rem; }
@media (max-width: 400px) { .ranked a { grid-template-columns: 34px 52px 1fr; } .ranked .price { grid-column: 3; } }

/* ---------- Authors ---------- */
.avatar {
  --av: var(--green);
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: var(--av); color: var(--gold-200);
  display: grid; place-items: center; position: relative; overflow: hidden;
  font-family: var(--serif); font-weight: 500; font-style: italic; line-height: 1;
  container-type: inline-size;
}
.avatar span { font-size: 38cqw; position: relative; z-index: 1; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.avatar::before { content: ""; position: absolute; inset: 0; background: var(--chevron-light); background-size: 18px 9px; opacity: .9; }
.avatar::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 1px solid rgba(234,217,176,.35); }

.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.author-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 24px 24px; text-align: center; transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column; align-items: center;
}
.author-card:hover { border-color: var(--gold); }
.author-card .avatar { width: 104px; margin-bottom: 18px; }
.author-card h3 { font-size: 1.5rem; margin: 0 0 4px; }
.author-card .place { font-size: .82rem; color: var(--ink-3); margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }
.author-card .place svg { width: 13px; }
.author-card p { font-size: .9rem; color: var(--ink-2); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.author-card .count { margin-top: auto; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); }

/* ---------- Author invite band ---------- */
.invite {
  position: relative; overflow: hidden; color: var(--ivory);
  background: var(--green-900); border-radius: 2px;
  padding: clamp(36px, 6vw, 80px);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center;
}
.invite::before { content: ""; position: absolute; inset: 0; background: var(--chevron-light); background-size: 28px 14px; opacity: .7; -webkit-mask: linear-gradient(110deg, transparent 40%, #000); mask: linear-gradient(110deg, transparent 40%, #000); }
.invite > * { position: relative; }
.invite h2 { color: #fff; }
.invite h2 em { color: var(--gold-200); }
.invite p { color: rgba(250,246,238,.78); }
.invite .eyebrow { color: var(--gold-200); }
.split-card { background: rgba(255,255,255,.05); border: 1px solid rgba(234,217,176,.2); border-radius: 2px; padding: 28px; }
.split-card .row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed rgba(234,217,176,.22); font-variant-numeric: tabular-nums; }
.split-card .row:last-child { border: 0; }
.split-card .row strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.split-card .row.total strong { color: var(--gold-200); font-size: 2rem; }
.split-bar { display: flex; height: 6px; border-radius: 0; overflow: hidden; margin: 18px 0 8px; }
.split-bar span:first-child { background: var(--gold); flex: 80; }
.split-bar span:last-child { background: rgba(250,246,238,.25); flex: 20; }
.split-legend { display: flex; justify-content: space-between; font-size: .78rem; color: rgba(250,246,238,.7); }
@media (max-width: 860px) { .invite { grid-template-columns: 1fr; } }

/* ---------- Global reach ---------- */
.reach { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.reach div { background: var(--paper); padding: 26px 20px; }
.reach strong { display: block; font: 600 1.45rem/1.15 var(--serif); margin-bottom: 4px; }
.reach small { color: var(--ink-3); font-size: .84rem; line-height: 1.4; display: block; }
.reach .flagdot { width: 26px; height: 3px; margin-bottom: 18px; background: var(--gold); }
.reach div:first-child .flagdot { background: var(--red); }
@media (max-width: 900px) { .reach { grid-template-columns: repeat(2, 1fr); } .reach div:first-child { grid-column: 1 / -1; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.step { padding: 30px 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); position: relative; }
.step::before { counter-increment: step; content: counter(step, upper-roman) "."; font: italic 500 2.6rem/1 var(--serif); color: var(--gold); display: block; margin-bottom: 18px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: .94rem; margin: 0; }

/* ---------- Newsletter ---------- */
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; min-width: 0; height: 50px; padding: 0 18px; border: 1px solid var(--line-2); background: var(--paper); border-radius: 2px; }
.inline-form input:focus { outline: none; border-color: var(--gold); }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; } .inline-form { flex-direction: column; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-950); color: rgba(250,246,238,.72); margin-top: 0; position: relative; }
.site-footer .chev { height: 14px; background: var(--chevron) repeat-x; background-size: 28px 14px; opacity: .6; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding: 64px 0 48px; }
.site-footer h4, .site-footer .footer-heading { font: 600 .74rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-200); margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.site-footer .logo__word { color: #fff; }
.site-footer .logo__tld { color: rgba(250,246,238,.5); }
.footer-tag { font: italic 500 1.6rem/1.3 var(--serif); color: var(--ivory); margin: 20px 0 14px; }
.pay-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.pay-pill { font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(234,217,176,.25); color: var(--gold-200); }
.footer-bottom { border-top: 1px solid rgba(234,217,176,.14); padding: 22px 0 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Page header ---------- */
.page-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); background: linear-gradient(var(--cream), var(--ivory)); position: relative; }
.page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; background: var(--chevron) repeat-x; background-size: 28px 14px; opacity: .5; }
.page-hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 12px; }
.crumbs { font-size: .82rem; color: var(--ink-3); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--green); }
.crumbs span[aria-hidden] { color: var(--line-2); }

/* ---------- Browse / filters ---------- */
.browse { display: grid; grid-template-columns: 250px 1fr; gap: 48px; align-items: start; }
.filters { position: sticky; top: 98px; display: grid; gap: 28px; }
.filter-group h4 { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .94rem; cursor: pointer; }
.check input { appearance: none; width: 17px; height: 17px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--paper); display: grid; place-items: center; margin: 0; flex-shrink: 0; transition: all .15s; }
.check input:checked { background: var(--green); border-color: var(--green); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check .n { margin-left: auto; font-size: .78rem; color: var(--ink-3); }
.range-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
input[type=range] { width: 100%; accent-color: var(--green); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.toolbar .count { color: var(--ink-3); font-size: .92rem; }
.select { height: 42px; padding: 0 36px 0 14px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2375716a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; font-size: .9rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 2px; background: var(--green-100); color: var(--green); font-size: .82rem; font-weight: 600; border: 0; }
.pill button { border: 0; background: none; padding: 0; color: inherit; font-size: 1rem; line-height: 1; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 2px; border: 1px solid var(--line-2); background: var(--paper); font-size: .86rem; font-weight: 500; transition: all .15s; display: inline-flex; align-items: center; }
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.is-active { background: var(--green); border-color: var(--green); color: var(--ivory); }
.filters-toggle { display: none; }
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); color: var(--ink-3); }
.empty h3 { color: var(--ink); }
@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; display: none; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .filters.is-open { display: grid; }
  .filters-toggle { display: inline-flex; }
}

/* ---------- Book detail ---------- */
.book-detail { display: grid; grid-template-columns: 360px 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.book-detail__cover { position: sticky; top: 100px; }
.book-detail__cover .cover-wrap { padding: 36px; background: var(--cream); border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.book-detail__cover .cover-wrap::before { content: ""; position: absolute; inset: 0; background: var(--chequer); background-size: 16px; opacity: .6; }
.book-detail__cover .cover { position: relative; }
.book-detail h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 10px; }
.book-detail .by { font-size: 1.05rem; color: var(--ink-3); margin-bottom: 24px; }
.book-detail .by a { color: var(--green); font-weight: 600; border-bottom: 1px solid var(--gold-200); }
.buy-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; margin: 28px 0; display: grid; gap: 16px; }
.buy-box .big-price { font: 600 2.6rem/1 var(--serif); color: var(--green); font-variant-numeric: lining-nums tabular-nums; }
.buy-box .alt { font-size: .82rem; color: var(--ink-3); }
.buy-box .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.assure { display: grid; gap: 8px; font-size: .86rem; color: var(--ink-2); }
.assure span { display: flex; gap: 10px; align-items: center; }
.assure svg { width: 16px; color: var(--gold); flex-shrink: 0; }
.meta-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 28px 0; }
.meta-table div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.meta-table small { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.meta-table strong { font-weight: 600; font-size: .95rem; }
.prose { font-family: var(--serif); font-size: 1.28rem; line-height: 1.6; color: var(--ink-2); }
.prose p:first-of-type::first-letter { font: 500 3.6em/0.78 var(--serif); float: left; padding: 6px 10px 0 0; color: var(--green); }
.author-strip { display: grid; grid-template-columns: 84px 1fr auto; gap: 22px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.author-strip .avatar { width: 84px; }
@media (max-width: 860px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail__cover { position: static; max-width: 340px; }
  .author-strip { grid-template-columns: 64px 1fr; }
  .author-strip .avatar { width: 64px; }
  .author-strip .btn { grid-column: 1 / -1; }
}

/* ---------- Author profile ---------- */
.profile-head { display: grid; grid-template-columns: 180px 1fr; gap: 44px; align-items: center; }
.profile-head .avatar { width: 180px; }
@media (max-width: 680px) { .profile-head { grid-template-columns: 1fr; gap: 24px; } .profile-head .avatar { width: 120px; } }
.stats-inline { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 20px; }
.stats-inline strong { display: block; font: 600 2.1rem/1 var(--serif); color: var(--green); font-variant-numeric: lining-nums; }
.stats-inline small { color: var(--ink-3); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field label, .field .label { font-size: .78rem; font-weight: 500; letter-spacing: .04em; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 2px; background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184,145,63,.14); }
.field .hint { font-size: .78rem; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--ivory); color: var(--ink-3); font-size: .9rem; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover { border-color: var(--gold); background: var(--cream); }
.dropzone strong { color: var(--green); display: block; margin-bottom: 4px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 34px); }

.tabs { display: inline-flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tabs button, .tabs a { border: 0; background: transparent; height: 42px; padding: 0; font-weight: 500; font-size: .86rem; color: var(--ink-3); border-bottom: 1.5px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; }
.tabs button.is-active, .tabs a.is-active { color: var(--green); border-color: var(--gold); }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 120px); }
.auth__art { background: var(--green) var(--chevron-light); background-size: 28px 14px; color: var(--ivory); padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__art blockquote { font: italic 500 clamp(2rem, 3.2vw, 2.9rem)/1.15 var(--serif); margin: 0; max-width: 16ch; }
.auth__art .covers { display: flex; gap: 16px; margin-top: 40px; }
.auth__art .covers .cover { width: 110px; }
.auth__form { padding: clamp(32px, 6vw, 80px); display: flex; align-items: center; justify-content: center; }
.auth__form .inner { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__art { display: none; } }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 77px); }
.dash__side { background: var(--green-900); color: rgba(250,246,238,.75); padding: 28px 18px; position: sticky; top: 77px; height: calc(100vh - 77px); overflow-y: auto; }
.dash__side .who { display: flex; gap: 12px; align-items: center; padding: 0 10px 22px; border-bottom: 1px solid rgba(234,217,176,.14); margin-bottom: 18px; }
.dash__side .who .avatar { width: 44px; font-size: .9rem; }
.dash__side .who strong { color: #fff; display: block; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.1; }
.dash__side .who small { font-size: .74rem; color: var(--gold-200); letter-spacing: .08em; text-transform: uppercase; }
.dash__nav { display: grid; gap: 2px; }
.dash__nav button, .dash__nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 2px; border: 0; background: transparent; color: inherit; font-size: .92rem; text-align: left; width: 100%; }
.dash__nav button:hover, .dash__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.dash__nav button.is-active, .dash__nav a.is-active { background: rgba(168,135,58,.16); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.dash__nav svg { width: 18px; opacity: .85; }
.dash__nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 2px 7px; }
.dash__main { padding: clamp(24px, 4vw, 48px); min-width: 0; }
.dash__head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.dash__head h1 { font-size: clamp(2.2rem, 3.6vw, 3rem); margin: 0; }
.dash__head p { margin: 6px 0 0; color: var(--ink-3); }
.dash-panel { display: none; }
.dash-panel.is-active { display: block; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { position: static; height: auto; padding: 14px; }
  .dash__side .who { display: none; }
  .dash__nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .dash__nav button, .dash__nav a { white-space: nowrap; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; position: relative; overflow: hidden; }
.kpi small { display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 12px; }
.kpi strong { font: 600 2.3rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.kpi .sub { font-size: .8rem; color: var(--ink-3); margin-top: 8px; }
.kpi--accent { background: var(--green); border-color: var(--green); color: var(--ivory); }
.kpi--accent small, .kpi--accent .sub { color: var(--gold-200); }
.kpi--accent strong { color: #fff; }
.kpi--accent::after { content: ""; position: absolute; right: -10px; bottom: -10px; width: 120px; height: 60px; background: var(--chevron-light); background-size: 18px 9px; }
.up { color: #2f7a4f; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.card h3 { font-size: 1.5rem; margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head p { margin: 0; color: var(--ink-3); font-size: .86rem; }

.chart { width: 100%; height: 240px; }
.chart .bar { fill: var(--green); transition: opacity .2s; }
.chart .bar:hover { opacity: .8; }
.chart .bar.net { fill: var(--gold); }
.chart text { font: 500 11px var(--sans); fill: var(--ink-3); }
.chart line { stroke: var(--line); }
.legend { display: flex; gap: 18px; font-size: .8rem; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.donut-wrap { display: grid; place-items: center; position: relative; }
.donut-wrap .center { position: absolute; text-align: center; }
.donut-wrap .center strong { display: block; font: 600 2rem/1 var(--serif); }
.donut-wrap .center small { color: var(--ink-3); font-size: .78rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.data th { text-align: left; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 14px 16px; background: var(--ivory); border-bottom: 1px solid var(--line); }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .title-cell { display: flex; gap: 12px; align-items: center; }
table.data .title-cell .cover { width: 38px; padding: 0; }
table.data .title-cell .cover > * { display: none; }
table.data .title-cell strong { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 2px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--ok { background: #e3efe6; color: #2a6b45; }
.status--wait { background: #f6ecd3; color: #8a6a1f; }
.status--off { background: #efe9e0; color: var(--ink-3); }
.status--bad { background: #f5e1de; color: var(--red); }

/* ---------- Library ---------- */
.lib-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 24px; align-items: center; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.lib-item + .lib-item { margin-top: 14px; }
.lib-item h3 { margin: 0 0 4px; font-size: 1.6rem; }
.lib-item .meta { font-size: .84rem; color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.lib-item .dl { display: grid; gap: 8px; justify-items: end; text-align: right; }
.lib-item .dl small { font-size: .78rem; color: var(--ink-3); max-width: 220px; }
@media (max-width: 640px) {
  .lib-item { grid-template-columns: 72px 1fr; }
  .lib-item .dl { grid-column: 1 / -1; justify-items: stretch; text-align: left; }
}
.notice { display: flex; gap: 14px; padding: 16px 20px; background: var(--cream); border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; font-size: .9rem; color: var(--ink-2); }
.notice svg { width: 20px; flex-shrink: 0; color: var(--gold-600); margin-top: 2px; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }
.pay-options { display: grid; gap: 12px; }
.pay-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; }
.pay-opt:hover { border-color: var(--line-2); }
.pay-opt input { accent-color: var(--green); width: 18px; height: 18px; margin: 0; }
.pay-opt:has(input:checked) { border-color: var(--green); background: #f6faf6; }
.pay-opt strong { display: block; font-size: .98rem; }
.pay-opt small { color: var(--ink-3); font-size: .82rem; }
.pay-logos { display: flex; gap: 6px; }
.pay-logos span { font-size: .64rem; font-weight: 800; letter-spacing: .04em; padding: 5px 8px; border-radius: 5px; background: var(--ivory); border: 1px solid var(--line); color: var(--ink-2); }
.summary .line { display: flex; justify-content: space-between; padding: 10px 0; font-size: .94rem; font-variant-numeric: tabular-nums; }
.summary .line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-weight: 700; font-size: 1.1rem; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { font: 600 1.4rem/1.3 var(--serif); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 1.4rem; color: var(--gold); transition: transform .2s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; color: var(--ink-2); max-width: 70ch; }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.calc output, output.big { font: 600 3rem/1 var(--serif); color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------- Two col & misc ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.value { padding: 28px; border-top: 2px solid var(--gold); background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }
.value h3 { margin-bottom: 8px; }
.value p { color: var(--ink-2); margin: 0; font-size: .95rem; }
.pull { font: italic 500 clamp(1.8rem, 3.4vw, 2.7rem)/1.25 var(--serif); color: var(--green); border-left: 3px solid var(--gold); padding-left: 28px; margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 200;
  background: var(--ink); color: var(--ivory); padding: 14px 22px; border-radius: 2px; font-size: .9rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}


/* =========================================================
   Laravel app additions
   ========================================================= */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-left: 2px solid var(--gold); background: var(--cream); font-size: .92rem; margin-bottom: 22px; }
.flash svg { width: 18px; flex-shrink: 0; margin-top: 2px; color: var(--gold-600); }
.flash--ok { border-color: #2f7a4f; background: #e9f2eb; }
.flash--ok svg { color: #2f7a4f; }
.flash--error { border-color: var(--red); background: #f7e6e3; }
.flash--error svg { color: var(--red); }
.flash-wrap { padding-top: 22px; }
.error { color: var(--red); font-size: .8rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.form-stack { display: grid; gap: 16px; }
.inline { display: inline; }
.link { color: var(--green); font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold-200); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--gold); }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); font-size: .86rem; background: var(--paper); }
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .is-current { background: var(--green); color: var(--ivory); border-color: var(--green); }
.pagination .is-disabled { color: var(--line-2); }
.cover-preview { width: 140px; }
.file-current { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.dash__main .card + .card { margin-top: 20px; }
.toolbar-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-inline .select, .toolbar-inline input[type=search] { height: 40px; }
.toolbar-inline input[type=search] { padding: 0 14px; border: 1px solid var(--line-2); background: var(--paper); border-radius: 2px; min-width: 220px; }
.ornament { display: flex; align-items: center; gap: 16px; color: var(--gold); justify-content: center; margin: 0 auto 18px; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 60px; background: var(--gold-200); }
.quote-band { text-align: center; padding: clamp(56px, 8vw, 96px) 0; }
.quote-band blockquote { font: italic 500 clamp(1.9rem, 3.8vw, 3.1rem)/1.2 var(--serif); max-width: 24ch; margin: 0 auto 18px; color: var(--green); }
.quote-band cite { font-style: normal; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.legal h2 { font-size: 1.9rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--ink-2); }
.waiting { text-align: center; padding: 40px 20px; }
.spinner { width: 42px; height: 42px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 22px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.danger { --b-bg: transparent; --b-fg: var(--red); --b-bd: var(--red); --b-hover: var(--red); }
.danger:hover { color: #fff; }
.mini-cover { width: 44px; flex-shrink: 0; }
.mini-cover .cover__in > * { display: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.muted-sm { font-size: .8rem; color: var(--ink-3); }
svg.i { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.ornament svg { width: 26px; height: 26px; }
.spot-price { font: 600 2.1rem/1 var(--serif); color: var(--green); font-variant-numeric: lining-nums; }
.btn svg.i { width: 16px; height: 16px; }

/* =========================================================
   Refinement pass: forms, sign-in, polish
   ========================================================= */
.field input, .field select, .field textarea { min-height: 52px; font-size: .95rem; transition: border-color .2s, box-shadow .2s, background .2s; }
.field input::placeholder, .field textarea::placeholder { color: #a8a294; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #bfb196; }
.field select { appearance: none; padding-right: 40px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2375716a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 16px center; }
.field.has-error input, .field.has-error select, .field.has-error textarea { background: #fdf7f6; }
.field .error { display: flex; gap: 6px; align-items: center; }
.field .error::before { content: "!"; width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: #fff; font: 700 .62rem/15px var(--sans); text-align: center; flex-shrink: 0; }

.input-wrap { position: relative; }
.input-wrap > svg.i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; transition: color .2s; }
.input-wrap > input { padding-left: 46px; width: 100%; }
.input-wrap:focus-within > svg.i { color: var(--gold-600); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); border-radius: 2px; }
.pw-toggle:hover { color: var(--green); background: var(--cream); }
.pw-toggle svg { width: 19px; height: 19px; }
.has-toggle > input { padding-right: 50px; }
.caps-warn { font-size: .76rem; color: var(--gold-600); display: none; }
.caps-warn.is-on { display: block; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength span { height: 3px; background: var(--line); transition: background .25s; }
.strength[data-score="1"] span:nth-child(-n+1) { background: var(--red); }
.strength[data-score="2"] span:nth-child(-n+2) { background: #c98a2c; }
.strength[data-score="3"] span:nth-child(-n+3) { background: var(--gold); }
.strength[data-score="4"] span { background: #2f7a4f; }
.strength-label { font-size: .74rem; color: var(--ink-3); }

.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* Sign-in / register */
.auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: calc(100vh - 110px); }
.auth__art { justify-content: flex-start; gap: 40px; }
.auth__art::after { content: ""; position: absolute; width: 520px; aspect-ratio: 1; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(168,135,58,.32), transparent 65%); pointer-events: none; }
.auth__art blockquote { font-size: clamp(2.2rem, 3.4vw, 3.2rem); }
.auth__art cite { display: block; margin-top: 16px; font: 500 .7rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-200); font-style: normal; }
.auth__fan { position: relative; height: 250px; margin-top: auto; max-width: 420px; }
.auth__fan .cover { position: absolute; width: 150px; bottom: 0; box-shadow: 0 30px 60px rgba(0,0,0,.4), 0 8px 18px rgba(0,0,0,.25); }
.auth__fan .cover:nth-child(1) { left: 0; transform: rotate(-8deg); }
.auth__fan .cover:nth-child(2) { left: 120px; z-index: 2; bottom: 24px; }
.auth__fan .cover:nth-child(3) { left: 240px; transform: rotate(7deg); }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: .9rem; color: rgba(248,244,236,.82); position: relative; z-index: 1; }
.auth__points li { display: flex; gap: 12px; align-items: center; }
.auth__points svg { width: 18px; height: 18px; color: var(--gold-200); }
.auth__form { background: var(--paper); }
.auth__form .inner { max-width: 440px; }
.auth__card h1 { font-size: clamp(2.6rem, 4vw, 3.3rem); margin-bottom: 6px; }
.auth__card .sub { color: var(--ink-3); margin-bottom: 28px; }
.auth__secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--ink-3); }
.auth__secure svg { width: 15px; height: 15px; color: #2f7a4f; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); margin-bottom: 30px; }
.segmented a { text-align: center; padding: 12px; font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); transition: background .2s, color .2s; }
.segmented a.is-active { background: var(--green); color: var(--ivory); }
.segmented a:not(.is-active):hover { background: var(--cream); color: var(--green); }
.divider-text { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: .78rem; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Header shadow once scrolled */
.site-header { transition: box-shadow .25s; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(26,26,24,.05); }

/* Notification bell */
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--ivory); }
.notif-list { display: grid; gap: 0; }
.notif { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.notif.is-unread .notif__title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 8px; vertical-align: middle; }
.notif__icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green-100); color: var(--green); display: grid; place-items: center; }
.notif__icon svg { width: 18px; height: 18px; }
.notif__title { font: 600 1.2rem/1.2 var(--serif); margin: 0 0 4px; }
.notif__body { margin: 0; color: var(--ink-2); font-size: .9rem; }
.notif time { font-size: .76rem; color: var(--ink-3); white-space: nowrap; }
.push-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Trust strip (footer) */
.trust-strip { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: rgba(248,244,236,.65); }
.trust-strip span { display: inline-flex; gap: 8px; align-items: center; }
.trust-strip svg { width: 16px; height: 16px; color: var(--gold-200); }

@media (max-width: 860px) {
  .auth__form { padding: 40px 20px 56px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
}
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { white-space: nowrap; flex-shrink: 0; }

/* Subject landing pages */
.subject-intro { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.5; color: var(--ink-2); max-width: 62ch; margin: 0; }
.subject-links { display: flex; flex-wrap: wrap; gap: 8px; }
