/* Shelter — design inspired by soft sage gradient blog templates */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap");

:root {
  --bg: #f7f4ef;
  --bg-soft: #f3efe8;
  --surface: #ffffff;
  --surface-warm: #faf6f0;
  /* Darker ink/muted = better contrast without changing typefaces */
  --ink: #1a221f;
  --muted: #4f5a55;
  --line: #e4ddd2;
  --sage: #9fb8a8;
  --mint: #c5ddd0;
  --mint-deep: #a8c9b8;
  --teal: #163d35;
  --teal-mid: #245a4c;
  --teal-soft: #e8f2ed;
  --blush: #d4b5a8;
  --ok: #1a5234;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 2px 8px rgba(30, 77, 66, 0.06), 0 12px 32px rgba(30, 77, 66, 0.07);
  --shadow-hover: 0 8px 28px rgba(30, 77, 66, 0.14);
  --font: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
  --header-h: 4.25rem;
  /* Readable type scale (same families) */
  --text-body: 1.0625rem;
  --text-meta: 0.98rem;
  --leading-body: 1.72;
  --leading-display: 1.22;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
  /* Morning light / open window + soft sage field */
  background:
    /* god-ray wash left (dawn) */
    linear-gradient(
      105deg,
      rgba(255, 244, 220, 0.55) 0%,
      rgba(255, 236, 200, 0.18) 12%,
      transparent 28%
    ),
    /* cool evening wash right */
    linear-gradient(
      255deg,
      rgba(197, 221, 208, 0.45) 0%,
      rgba(159, 184, 168, 0.12) 14%,
      transparent 32%
    ),
    radial-gradient(1200px 500px at 10% -10%, rgba(197, 221, 208, 0.55), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(212, 181, 168, 0.28), transparent 50%),
    radial-gradient(700px 380px at 50% 100%, rgba(232, 242, 237, 0.7), transparent 60%),
    var(--bg);
  line-height: var(--leading-body);
  /* Slightly stronger glyph edges for body on cream bg */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Display headings: same font, clearer weight + tracking */
h1,
h2,
h3,
.page-header h1,
.section-head h2,
.book-card h2,
.book-card h3,
.book-detail h1,
.author-detail h1,
.about-card h2,
.empty-state-title {
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: var(--leading-display);
  color: var(--teal);
}

p {
  margin-block: 0.65em;
}

p:first-child {
  margin-top: 0;
}

p:last-child {
  margin-bottom: 0;
}

/* Keep chrome above ambient vines (mobile wallpaper + desktop sides) */
.site-header,
.main,
.site-footer,
.toast-root,
.stack-modal,
.read-progress {
  position: relative;
  z-index: 2;
}

.site-header {
  z-index: 40;
}

.main {
  isolation: isolate;
}

/* ——— Side ambient (vine + verse + rays) ———
   Always on: mobile = soft background identity behind content;
   wide screens = classic side columns outside the content rail. */
.side-ambient {
  display: block;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Soft god rays — full wash on mobile, side-masked on desktop */
.side-rays {
  position: absolute;
  inset: 0;
  background:
    conic-gradient(
      from 210deg at 0% 0%,
      transparent 0deg,
      rgba(255, 248, 230, 0.22) 8deg,
      transparent 16deg,
      rgba(255, 244, 220, 0.14) 24deg,
      transparent 32deg,
      rgba(255, 250, 236, 0.1) 40deg,
      transparent 52deg
    ),
    conic-gradient(
      from 140deg at 100% 8%,
      transparent 0deg,
      rgba(197, 221, 208, 0.12) 10deg,
      transparent 20deg,
      rgba(168, 201, 184, 0.08) 30deg,
      transparent 42deg
    );
  opacity: 0.55;
}

/* —— Mobile / tablet: vines as soft wallpaper behind the page —— */
.side-column {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42vw;
  max-width: 11rem;
  padding: 0;
  opacity: 1;
}

.side-column-left {
  left: -8%;
}

.side-column-right {
  right: -10%;
}

.side-vine-stack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.side-vine-img {
  position: absolute;
  left: 50%;
  height: auto;
  max-width: none;
  opacity: 0.22;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
}

.side-vine-cartoon {
  width: min(13rem, 120%);
  mix-blend-mode: multiply;
  filter: saturate(0.75) brightness(1.05);
  transform: translateX(-50%) rotate(38deg);
}

/* Fewer segments on small screens (perf + cleaner) */
.side-vine-s1 { top: 4%; opacity: 0.2; }
.side-vine-s2 { top: 32%; opacity: 0.18; transform: translateX(-50%) rotate(38deg) scale(0.95); }
.side-vine-s3 { top: 60%; opacity: 0.16; transform: translateX(-50%) rotate(38deg) scale(0.92); }
.side-vine-s4,
.side-vine-s5 {
  display: none;
}

.side-vine-stack-mirror .side-vine-cartoon {
  transform: translateX(-50%) scaleX(-1) rotate(38deg);
}
.side-vine-stack-mirror .side-vine-s2 {
  transform: translateX(-50%) scaleX(-1) rotate(38deg) scale(0.95);
}
.side-vine-stack-mirror .side-vine-s3 {
  transform: translateX(-50%) scaleX(-1) rotate(38deg) scale(0.92);
}

/* Hide vertical verse under content on narrow viewports */
.side-verse {
  display: none;
}

/* Ensure page chrome stays above ambient vines */
.site-header,
.main,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  z-index: 40;
}

/* Mid-width: a bit more presence, still behind content */
@media (min-width: 721px) and (max-width: 1319px) {
  .side-column {
    width: 28vw;
    max-width: 12rem;
  }

  .side-column-left {
    left: -2%;
  }

  .side-column-right {
    right: -3%;
  }

  .side-vine-cartoon {
    width: min(14rem, 115%);
  }

  .side-vine-s1 { opacity: 0.26; }
  .side-vine-s2 { opacity: 0.22; }
  .side-vine-s3 { opacity: 0.2; display: block; }
  .side-vine-s4 {
    display: block;
    top: 78%;
    opacity: 0.16;
    transform: translateX(-50%) rotate(38deg) scale(0.9);
  }
  .side-vine-stack-mirror .side-vine-s4 {
    transform: translateX(-50%) scaleX(-1) rotate(38deg) scale(0.9);
  }

  .side-rays {
    opacity: 0.7;
  }
}

/* Wide desktop: classic side margins (outside content rail) */
@media (min-width: 1320px) {
  .side-rays {
    opacity: 0.85;
    mask-image: linear-gradient(
      90deg,
      #000 0%,
      #000 12%,
      transparent 26%,
      transparent 74%,
      #000 88%,
      #000 100%
    );
    -webkit-mask-image: linear-gradient(
      90deg,
      #000 0%,
      #000 12%,
      transparent 26%,
      transparent 74%,
      #000 88%,
      #000 100%
    );
  }

  .side-column {
    width: clamp(10rem, 14vw, 16rem);
    max-width: none;
  }

  .side-column-left {
    left: 0;
  }

  .side-column-right {
    right: 0;
  }

  .side-vine-cartoon {
    width: min(15.5rem, 118%);
    filter: saturate(0.88) brightness(1.02);
    transform: translateX(-50%) rotate(42deg);
  }

  .side-vine-s1 { top: -1%; opacity: 0.44; }
  .side-vine-s2 {
    display: block;
    top: 18%;
    opacity: 0.42;
    transform: translateX(-50%) rotate(42deg) scale(0.98);
  }
  .side-vine-s3 {
    display: block;
    top: 38%;
    opacity: 0.4;
    transform: translateX(-50%) rotate(42deg) scale(0.97);
  }
  .side-vine-s4 {
    display: block;
    top: 58%;
    opacity: 0.38;
    transform: translateX(-50%) rotate(42deg) scale(0.96);
  }
  .side-vine-s5 {
    display: block;
    top: 76%;
    opacity: 0.34;
    transform: translateX(-50%) rotate(42deg) scale(0.94);
  }

  .side-vine-stack-mirror .side-vine-cartoon {
    transform: translateX(-50%) scaleX(-1) rotate(42deg);
  }
  .side-vine-stack-mirror .side-vine-s2 {
    transform: translateX(-50%) scaleX(-1) rotate(42deg) scale(0.98);
  }
  .side-vine-stack-mirror .side-vine-s3 {
    transform: translateX(-50%) scaleX(-1) rotate(42deg) scale(0.97);
  }
  .side-vine-stack-mirror .side-vine-s4 {
    transform: translateX(-50%) scaleX(-1) rotate(42deg) scale(0.96);
  }
  .side-vine-stack-mirror .side-vine-s5 {
    transform: translateX(-50%) scaleX(-1) rotate(42deg) scale(0.94);
  }

  .side-verse {
    display: block;
    position: absolute;
    top: 46%;
    left: 50%;
    margin: 0;
    z-index: 5;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.05rem, 1.15vw, 1.3rem);
    letter-spacing: 0.06em;
    color: #102e28;
    opacity: 0.92;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    user-select: none;
    padding: 0.85rem 0.4rem;
    text-shadow:
      0 0 1px rgba(255, 255, 255, 0.95),
      0 1px 2px rgba(255, 255, 255, 0.9),
      0 0 10px rgba(247, 244, 239, 0.85);
    background: none;
    transform: translate(-50%, -50%);
  }

  .side-column-left .side-verse {
    transform: translate(-50%, -50%) rotate(180deg);
  }
}

/* Ultra-wide: proportionally larger vines */
@media (min-width: 1500px) {
  .side-column {
    width: clamp(12rem, 15vw, 18rem);
  }

  .side-vine-cartoon {
    width: min(18rem, 120%);
    opacity: 0.48;
  }

  .side-vine-s2 { opacity: 0.45; }
  .side-vine-s3 { opacity: 0.42; }
  .side-vine-s4 { opacity: 0.4; }
  .side-vine-s5 { opacity: 0.36; }

  .side-verse {
    opacity: 0.94;
    font-size: clamp(1.1rem, 1.2vw, 1.35rem);
  }

  .side-rays {
    opacity: 0.95;
  }
}

/* Quiet hours: cooler, dimmer sides */
html.quiet-hours .side-rays {
  opacity: 0.45;
  filter: saturate(0.75) brightness(0.9);
}

html.quiet-hours .side-vine-img {
  opacity: 0.28;
  filter: saturate(0.65) brightness(0.95);
}

html.quiet-hours .side-verse {
  opacity: 0.85;
}

/* Dark theme: vines soft-glow on deep green */
html.theme-dark .side-vine-img,
html.quiet-room .side-vine-img {
  mix-blend-mode: screen;
  opacity: 0.35;
  filter: saturate(0.7) brightness(1.15) hue-rotate(-8deg);
}

html.theme-dark .side-verse,
html.quiet-room .side-verse {
  color: #f0faf5;
  opacity: 0.92;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  background: none;
}

html.theme-dark .side-rays,
html.quiet-room .side-rays {
  opacity: 0.35;
  filter: hue-rotate(20deg) brightness(0.7);
}

@media (prefers-reduced-motion: reduce) {
  .side-rays {
    opacity: 0.5;
  }
}

a {
  color: var(--teal-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: var(--teal);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(228, 221, 210, 0.9);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  flex-wrap: wrap;
  position: relative;
}

/* —— Mobile nav toggle —— */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  z-index: 5;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--teal);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--mint-deep);
  outline-offset: 2px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.72rem;
  font-style: italic;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand span {
  font-style: normal;
  font-weight: 500;
  color: var(--sage);
  margin-left: 0.12em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-size: 0.94rem;
  font-weight: 600;
}

/* Nav lettering: clean tracking, soft pill hover */
.nav .nav-link,
.nav a.nav-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.72rem;
  border-radius: var(--radius-pill);
  border-bottom: none;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.nav .nav-link:hover,
.nav .nav-link:focus-visible,
.nav a.nav-link.is-active {
  color: var(--teal);
  background: rgba(232, 242, 237, 0.9);
  border-bottom-color: transparent;
  outline: none;
}

.nav .nav-link:focus-visible {
  box-shadow: 0 0 0 2px rgba(36, 90, 76, 0.28);
}

.nav .nav-login {
  color: var(--teal-mid);
  font-weight: 600;
}

/* Primary header CTA */
.btn-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0.52rem 1.2rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(165deg, #1f5247 0%, var(--teal) 55%, #102e28 100%);
  color: #fff !important;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  text-decoration: none !important;
  line-height: 1.2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 4px 14px rgba(30, 77, 66, 0.28);
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-nav-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 8px 20px rgba(30, 77, 66, 0.34);
}

.btn-nav-cta:focus-visible {
  outline: 2px solid var(--mint-deep);
  outline-offset: 3px;
}

.nav-cart {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--teal-mid);
  cursor: pointer;
  text-decoration: none;
  border-bottom: none;
}

.link-button:hover {
  color: var(--teal);
}

button.link-button.nav-link {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ——— Main ——— */
.main {
  flex: 1;
  padding: 2rem 0 3.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.05rem, 4.2vw, 2.7rem);
  color: var(--teal);
  letter-spacing: 0.005em;
  line-height: var(--leading-display);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.25rem 0 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--teal);
}

.section-head a {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(125deg, rgba(30, 77, 66, 0.88) 0%, rgba(45, 106, 90, 0.72) 42%, rgba(159, 184, 168, 0.55) 100%),
    linear-gradient(160deg, #7fa896 0%, #c5ddd0 55%, #e8d5c8 100%);
  color: #fff;
  box-shadow: var(--shadow);
  min-height: 280px;
  display: grid;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.22), transparent 28%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.12), transparent 30%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-pill);
  text-shadow: 0 1px 1px rgba(12, 32, 28, 0.15);
}

/* Psalm verse — handwritten ink reveal (not a typewriter) */
.hero-kicker.hero-kicker-verse {
  position: relative;
  display: block;
  max-width: min(38rem, 100%);
  padding: 0.7rem 1rem 0.85rem;
  font-family: var(--font-hand);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.38;
  text-transform: none;
  border-radius: var(--radius-sm);
  background: rgba(16, 40, 34, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 1px rgba(12, 32, 28, 0.2);
}

.hero-kicker-verse .handwrite-ink {
  display: inline;
}

.hero-kicker-verse .handwrite-ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em) rotate(-4deg) scale(0.92);
  filter: blur(1.2px);
  will-change: opacity, transform, filter;
}

.hero-kicker-verse .handwrite-ch.is-written {
  opacity: 1;
  transform: translateY(0) rotate(0deg) scale(1);
  filter: blur(0);
  transition:
    opacity 0.16s ease-out,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.2s ease-out;
}

/* Soft “wet ink” settle after the pen passes */
.hero-kicker-verse .handwrite-ch.is-written.is-settled {
  text-shadow:
    0 0 0.5px rgba(255, 255, 255, 0.35),
    0 1px 1px rgba(12, 32, 28, 0.18);
}

.hero-kicker-verse .handwrite-space {
  display: inline-block;
  width: 0.28em;
}

@media (prefers-reduced-motion: reduce) {
  .hero-kicker-verse .handwrite-ch {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 5vw, 3.05rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(12, 32, 28, 0.28);
}

.hero .lede {
  color: rgba(255, 255, 255, 0.96);
  max-width: 32rem;
  margin: 0 0 1.35rem;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(12, 32, 28, 0.2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-orbs {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 0.85rem;
  z-index: 1;
}

@media (min-width: 900px) {
  .hero-orbs {
    display: flex;
  }
}

.orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(30, 77, 66, 0.25);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
}

.orb:nth-child(1) { background: linear-gradient(145deg, #e8f2ed, #c5ddd0); }
.orb:nth-child(2) { background: linear-gradient(145deg, #faf6f0, #e4d5c8); margin-top: 1.5rem; }
.orb:nth-child(3) { background: linear-gradient(145deg, #dfeee6, #9fb8a8); }
.orb:nth-child(4) { background: linear-gradient(145deg, #f3e8e2, #d4b5a8); margin-top: 1.5rem; }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--teal);
  color: #fff !important;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.35rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(30, 77, 66, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 77, 66, 0.28);
}

.btn-small {
  padding: 0.4rem 0.95rem;
  font-size: 0.88rem;
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: none;
  backdrop-filter: blur(4px);
}

.btn-secondary {
  background: #5c6b66;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--teal) !important;
  border: 1.5px solid var(--mint-deep);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--teal-soft);
}

/* ——— Book grid & cards ——— */
.book-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.book-card-cover {
  height: 200px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(145deg, var(--mint) 0%, var(--sage) 100%);
  overflow: hidden;
}

.book-card-cover:not(.has-image)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 50%);
}

.book-card-cover.has-image {
  background: #1c2a26;
}

.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.book-card:hover .book-card-cover img {
  transform: scale(1.04);
}

.book-card-cover .cover-initial {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal);
  box-shadow: 0 6px 16px rgba(30, 77, 66, 0.15);
}

.card-actions {
  padding: 0 1.15rem 1rem;
}

/* category tint variants */
.cover-theology { background: linear-gradient(145deg, #b8d4c8, #6f9a88); }
.cover-devotional { background: linear-gradient(145deg, #e8d5c8, #c4a090); }
.cover-biography { background: linear-gradient(145deg, #c9d8e4, #7f9bb0); }
.cover-church { background: linear-gradient(145deg, #d5e4d0, #8aab82); }
.cover-default { background: linear-gradient(145deg, #c5ddd0, #9fb8a8); }

.book-card-body {
  padding: 1.05rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.book-card h2,
.book-card h2,
.book-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.book-card .meta {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.book-card a.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-card a.card-link:hover h2,
.book-card a.card-link:hover h3 {
  color: var(--teal);
}

.card-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-mid);
  background: var(--teal-soft);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.meta,
.subtitle,
.hint,
.help {
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 500;
  margin: 0;
}

.subtitle {
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #3d4a45;
  letter-spacing: 0.015em;
}

.lede {
  color: var(--muted);
  max-width: 40rem;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.7;
}

/* ——— Filters ——— */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
  margin: 0 0 1.75rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filters label,
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--teal);
}

.filters input,
.filters select,
.auth-form input {
  font: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filters input:focus,
.filters select:focus,
.auth-form input:focus {
  outline: none;
  border-color: var(--mint-deep);
  box-shadow: 0 0 0 3px rgba(159, 184, 168, 0.35);
}

.auth-form {
  max-width: 26rem;
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  max-width: 28rem;
  margin: 0 auto;
  padding: 0.5rem 0 1rem;
}

.auth-panel .page-header {
  text-align: center;
}

.field-error {
  color: #8b1e1e;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: normal;
}

.help {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.help ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

/* ——— Detail ——— */
.book-detail,
.author-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .detail-layout {
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-width: 220px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(145deg, var(--mint), var(--sage));
}

.detail-cover.has-image {
  background: #1c2a26;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.detail-cover .cover-initial {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
}

.book-detail h1,
.author-detail h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  color: var(--teal);
  line-height: 1.15;
}

.book-detail .description,
.author-detail .description {
  margin: 1.25rem 0;
  max-width: 42rem;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.78;
}

.book-detail .description p,
.author-detail .description p {
  margin-bottom: 0.9em;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.breadcrumb a {
  text-decoration: none;
  font-weight: 600;
}

.badge {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-right: 0.35rem;
  vertical-align: middle;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* ——— Pagination ——— */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  color: var(--muted);
}

.pagination a {
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
}

.pagination a:hover {
  background: var(--teal-soft);
  border-color: var(--mint-deep);
}

/* ——— Empty / messages ——— */
.empty {
  color: var(--muted);
  padding: 1.35rem 1.25rem;
  background: var(--surface);
  border: 1.5px dashed var(--mint-deep);
  border-radius: var(--radius);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.message {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  border: 1px solid var(--mint);
  margin-bottom: 0.5rem;
}

.message-success {
  background: #e8f5ee;
  border-color: #b7dcc7;
  color: var(--ok);
}

.message-info {
  background: #eef6f3;
}

code {
  font-size: 0.9em;
  background: var(--teal-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--teal);
}

/* ——— Watercolor ivy ornaments (hero style, not side margins / not on nav) ——— */

/* Hero — main ivy (right) + softer accent (left, behind kicker text) */
.hero-ivy {
  display: block;
  position: absolute;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.hero-ivy-main {
  right: -1.25rem;
  bottom: -1.5rem;
  width: min(9rem, 42vw);
  z-index: 1;
  opacity: 0.55;
  transform: rotate(-8deg);
  filter: drop-shadow(0 6px 14px rgba(20, 50, 40, 0.18));
}

/* Sits near the kicker — keep very light so “Gospel publishing catalog” stays readable */
.hero-ivy-accent {
  left: -1.5rem;
  top: -1.1rem;
  width: min(5.5rem, 28vw);
  z-index: 0;
  opacity: 0.22;
  transform: rotate(16deg) scaleX(-1);
  filter: saturate(0.9) brightness(1.05);
}

.hero-inner {
  position: relative;
  z-index: 2;
}

@media (min-width: 720px) {
  .hero-ivy-main {
    width: min(12.5rem, 28%);
    right: 1.25rem;
    bottom: -1.5rem;
    opacity: 0.88;
    z-index: 2;
    transform: rotate(-6deg);
  }

  .hero-ivy-accent {
    width: min(8.25rem, 18%);
    left: -0.35rem;
    top: -1.5rem;
    opacity: 0.26;
  }
}

@media (min-width: 900px) {
  .hero-ivy-main {
    width: min(13.5rem, 26%);
    right: 2.5rem;
  }

  .hero-ivy-accent {
    width: min(9rem, 17%);
    left: -0.5rem;
    opacity: 0.24;
  }
}

/* Page headers (Books, Your Shelter, …) */
.page-header-ivy {
  position: relative;
  overflow: visible;
  padding-right: 4.5rem;
}

.page-header-ivy-img {
  display: block;
  position: absolute;
  right: -0.75rem;
  top: -0.65rem;
  width: 4.25rem;
  height: auto;
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  transform: rotate(-8deg);
  filter: drop-shadow(0 6px 12px rgba(30, 77, 66, 0.1));
  z-index: 0;
}

.page-header-ivy h1,
.page-header-ivy .lede {
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .page-header-ivy-img {
    width: 6.5rem;
    right: 0;
    opacity: 0.7;
  }
}

/* Book detail card corner */
.detail-ivy {
  display: block;
  position: absolute;
  right: -0.5rem;
  bottom: -0.75rem;
  width: 5.5rem;
  height: auto;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  transform: rotate(-10deg);
  mix-blend-mode: multiply;
  z-index: 0;
  filter: drop-shadow(0 6px 12px rgba(30, 77, 66, 0.1));
}

.book-detail {
  position: relative;
}

.book-detail > *:not(.detail-ivy) {
  position: relative;
  z-index: 1;
}

@media (min-width: 720px) {
  .detail-ivy {
    width: 8.5rem;
    right: -0.5rem;
    bottom: -1rem;
    opacity: 0.5;
  }
}

/* Side CTA ivy */
.side-cta {
  position: relative;
  overflow: hidden;
}

.side-cta-ivy {
  position: absolute;
  right: -1.1rem;
  bottom: -1.4rem;
  width: 5.25rem;
  height: auto;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  transform: rotate(-14deg);
  filter: brightness(1.25) saturate(0.85);
  z-index: 0;
}

.side-cta h3,
.side-cta p,
.side-cta .btn {
  position: relative;
  z-index: 1;
}

.tonight-ivy {
  display: block;
  position: absolute;
  left: -1.5rem;
  bottom: -1.35rem;
  width: 5rem;
  height: auto;
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  transform: rotate(12deg) scaleX(-1);
  mix-blend-mode: multiply;
  z-index: 0;
}

@media (min-width: 720px) {
  .tonight-ivy {
    width: 6.5rem;
    left: -1.25rem;
    bottom: -1.5rem;
    opacity: 0.55;
  }
}

/* ——— Footer vines (organic layer behind text, all breakpoints) ——— */
.footer-vines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.footer-vine {
  position: absolute;
  height: auto;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

/* On dark teal: screen blend so leaves read as soft light */
.footer-vine-cartoon {
  mix-blend-mode: screen;
  filter: brightness(1.55) saturate(0.55) contrast(0.95);
  opacity: 0.28;
}

.footer-vine-ivy {
  mix-blend-mode: screen;
  filter: brightness(1.5) saturate(0.65);
  opacity: 0.34;
}

/* Mobile — loose, cropped sprigs (not mirrored pillars) */
.footer-vine-c1 {
  left: -18%;
  top: -40%;
  width: min(14rem, 70vw);
  transform: rotate(28deg);
  opacity: 0.26;
}

.footer-vine-i1 {
  right: -12%;
  top: -58%;
  width: min(8.5rem, 46vw);
  transform: rotate(-18deg);
  opacity: 0.38;
}

.footer-vine-i2 {
  left: 18%;
  bottom: -62%;
  width: min(7rem, 40vw);
  transform: rotate(42deg) scaleX(-1);
  opacity: 0.32;
}

.footer-vine-c2 {
  right: -22%;
  bottom: -48%;
  width: min(12rem, 62vw);
  transform: scaleX(-1) rotate(-24deg);
  opacity: 0.24;
}

@media (min-width: 720px) {
  .footer-vine-c1 {
    left: -8%;
    top: -52%;
    width: min(16rem, 36vw);
    transform: rotate(32deg);
    opacity: 0.28;
  }

  .footer-vine-i1 {
    right: 6%;
    top: -48%;
    width: min(10rem, 22vw);
    transform: rotate(-22deg);
    opacity: 0.36;
  }

  .footer-vine-i2 {
    left: 28%;
    bottom: -55%;
    width: min(8.5rem, 18vw);
    transform: rotate(36deg) scaleX(-1);
    opacity: 0.3;
  }

  .footer-vine-c2 {
    right: -6%;
    bottom: -42%;
    width: min(15rem, 32vw);
    transform: scaleX(-1) rotate(-28deg);
    opacity: 0.26;
  }
}

@media (min-width: 1100px) {
  .footer-vine-c1 {
    left: 4%;
    top: -58%;
    width: min(17rem, 22vw);
    opacity: 0.3;
  }

  .footer-vine-i1 {
    right: 12%;
    top: -52%;
    width: min(11rem, 14vw);
    opacity: 0.34;
  }

  .footer-vine-i2 {
    left: 38%;
    bottom: -58%;
    width: min(9rem, 12vw);
    opacity: 0.28;
  }

  .footer-vine-c2 {
    right: 2%;
    bottom: -48%;
    width: min(16rem, 20vw);
    opacity: 0.28;
  }
}

/* ——— Footer ——— */
.site-footer {
  margin-top: auto;
  background:
    radial-gradient(ellipse 80% 120% at 10% 120%, rgba(197, 221, 208, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 100% at 90% -20%, rgba(255, 255, 255, 0.08), transparent 50%),
    var(--teal);
  color: rgba(255, 255, 255, 0.92);
  padding: 2.35rem 0 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  position: relative;
  overflow: hidden;
}

.site-footer .footer-inner {
  position: relative;
  z-index: 1;
}

.site-footer a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  opacity: 0.85;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: #fff;
  margin: 0 0 0.25rem;
}

.footer-brand-link {
  color: #fff !important;
  text-decoration: none !important;
  font: inherit;
  font-style: italic;
}

.footer-brand-link:hover {
  opacity: 0.9;
}

.site-footer p {
  margin: 0.2rem 0;
}

/* ——— Sidebar strip (home extras) ——— */
.home-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .home-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.side-panel {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.side-panel h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--teal);
}

.side-panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-list a {
  display: inline-block;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
}

.chip-list a:hover {
  background: var(--teal-soft);
  border-color: var(--mint-deep);
}

.side-cta {
  margin-top: 1.25rem;
  padding: 1.1rem;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
}

.side-cta h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.side-cta p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}

.side-cta .btn {
  background: #fff;
  color: var(--teal) !important;
  box-shadow: none;
  width: 100%;
}

/* ——— Empty states ——— */
.empty-state {
  text-align: center;
  padding: 2rem 1.35rem;
  background: var(--surface);
  border: 1.5px dashed var(--mint-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 1.5rem;
}

.empty-state-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--teal);
}

.empty-state-lede {
  margin: 0 0 1.1rem;
  color: var(--muted);
  max-width: 28rem;
  margin-inline: auto;
}

.empty-state .btn {
  margin-top: 0.25rem;
}

/* ——— About page ——— */
.about-page {
  max-width: 48rem;
}

.about-grid {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.75rem;
}

@media (min-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.about-card h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--teal);
}

.about-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.about-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
}

.about-list li {
  margin: 0.35rem 0;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer-meta {
  font-size: 0.92rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ——— Responsive ——— */
@media (max-width: 720px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.65rem 0;
    min-height: auto;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav {
    display: none;
    width: 100%;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--line);
    margin-top: 0.35rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav .nav-link,
  .nav a.nav-link,
  .nav .link-button {
    padding: 0.7rem 0.55rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.035em;
  }

  .nav .btn-nav-cta,
  .nav .btn-small {
    width: 100%;
    margin: 0.45rem 0 0;
    padding: 0.72rem 1.2rem;
    letter-spacing: 0.07em;
  }
}

/* —— Manage panel (same visual language as public site) —— */
.nav-manage {
  background: var(--teal-soft) !important;
  color: var(--teal) !important;
  padding: 0.25rem 0.7rem !important;
  border-radius: var(--radius-pill) !important;
  border-bottom: none !important;
  font-weight: 700 !important;
}

.nav-manage:hover {
  background: var(--mint) !important;
  color: var(--teal) !important;
}

.manage-wrap {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .manage-wrap {
    grid-template-columns: 220px 1fr;
    align-items: start;
    gap: 2rem;
  }
}

.manage-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
}

.manage-side-label {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

.manage-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.manage-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
}

.manage-nav a:hover,
.manage-nav a.is-active {
  background: var(--teal-soft);
  color: var(--teal);
}

.manage-side-footer {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.manage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.manage-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.manage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 0 0 2rem;
}

.manage-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.manage-stat.is-warn {
  background: #fff9ef;
  border-color: #e0b35a;
}

.manage-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.1;
}

.manage-stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manage-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.manage-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.manage-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}

.manage-action-card strong {
  color: var(--teal);
  font-size: 1.05rem;
}

.manage-action-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.manage-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.manage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.manage-table th,
.manage-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.manage-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--surface-warm);
}

.manage-table tr:last-child td {
  border-bottom: 0;
}

.manage-table tbody tr:hover {
  background: var(--teal-soft);
}

.manage-thumb {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.manage-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 56px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--mint), var(--sage));
  color: var(--teal);
  font-family: var(--font-display);
  font-weight: 700;
}

.manage-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  white-space: nowrap;
}

.manage-row-actions a {
  font-weight: 700;
  text-decoration: none;
}

.manage-row-actions a.is-danger {
  color: #8b1e1e;
}

.manage-form {
  max-width: 40rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.manage-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}

.manage-field input[type="text"],
.manage-field input[type="url"],
.manage-field input[type="date"],
.manage-field textarea,
.manage-field select {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
}

.manage-field input:focus,
.manage-field textarea:focus,
.manage-field select:focus {
  outline: none;
  border-color: var(--mint-deep);
  box-shadow: 0 0 0 3px rgba(159, 184, 168, 0.35);
}

.manage-field ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.manage-field ul label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
  margin: 0;
}

.manage-check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  cursor: pointer;
}

.manage-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.btn-danger {
  background: #8b1e1e !important;
  box-shadow: none;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.manage-cover-preview {
  max-width: 160px;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  background: var(--surface-warm);
  display: block;
}

.manage-field.is-cover .cover-preview-panel {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cover-preview-label {
  margin: 0 0 0.55rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.cover-preview-frame {
  min-height: 6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.cover-preview-empty,
.cover-preview-error {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.cover-preview-error {
  color: #8b1e1e;
}

.message-error {
  background: #fdecec;
  border-color: #e8b4b4;
  color: #8b1e1e;
}

.manage-card-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.manage-card-block h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--teal);
}

.manage-card-block .manage-form {
  box-shadow: none;
  border: 0;
  padding: 0;
  max-width: none;
  background: transparent;
}

.manage-perm-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.manage-perm-list li {
  font-weight: 600;
  color: var(--ink);
}

/* ========== Interactive + easter eggs ========== */

/* Toasts */
.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: min(22rem, calc(100vw - 2rem));
}

.toast {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-hover);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: var(--ok); }
.toast-info { background: var(--teal-mid); }

.messages.is-toastified {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Card tilt */
.book-card.has-tilt .book-card-cover {
  transition: transform 0.18s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

.book-card.shelf-saving {
  animation: shelf-save 0.55s ease;
}

.book-card.shelf-leaving,
.book-detail.shelf-leaving {
  animation: shelf-leave 0.45s ease forwards;
}

@keyframes shelf-save {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-hover); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes shelf-leave {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* —— Dark mode (same dark-green palette; brighter type for readability) ——
   .theme-dark = toggle · .quiet-room = easter egg alias (same look) */
html.theme-dark,
html.quiet-room {
  /* Body text: high contrast on deep green */
  --ink: #f3faf6;
  --muted: #c9d9d1;
  --surface: #1c2e29;
  --surface-warm: #243832;
  --line: #3d564d;
  --bg: #152420;
  --bg-soft: #1a2a26;
  --teal-soft: #2a4038;
  /* Headings/links use light mint (not the deep teal fill color) */
  --teal: #d8eee4;
  --teal-mid: #b7dccb;
  --sage: #a8c4b4;
  --mint: #c5ddd0;
  --mint-deep: #8fbfa8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

html.theme-dark body,
html.quiet-room body {
  background:
    radial-gradient(1000px 420px at 20% -10%, rgba(30, 77, 66, 0.35), transparent 55%),
    radial-gradient(800px 360px at 100% 10%, rgba(20, 40, 36, 0.45), transparent 50%),
    #152420;
  color: var(--ink);
}

html.theme-dark .site-header,
html.quiet-room .site-header {
  background: rgba(21, 36, 32, 0.94);
  border-bottom-color: #3d564d;
}

html.theme-dark .brand,
html.quiet-room .brand {
  color: #e2f3eb;
}
html.theme-dark .brand span,
html.quiet-room .brand span {
  color: #9fb8a8;
}

html.theme-dark .nav .nav-link,
html.theme-dark .nav a,
html.quiet-room .nav .nav-link,
html.quiet-room .nav a {
  color: #e8f4ee;
}
html.theme-dark .nav .nav-link:hover,
html.theme-dark .nav .nav-link:focus-visible,
html.quiet-room .nav .nav-link:hover {
  background: rgba(45, 78, 68, 0.95);
  color: #ffffff;
}
html.theme-dark .nav .nav-login,
html.quiet-room .nav .nav-login,
html.theme-dark .link-button,
html.quiet-room .link-button {
  color: #c5e0d4;
}

/* Solid dark-green buttons (teal token is light for text) */
html.theme-dark .btn,
html.quiet-room .btn,
html.theme-dark .btn-nav-cta,
html.quiet-room .btn-nav-cta {
  background: linear-gradient(165deg, #2f6b5a 0%, #1a453c 55%, #12332c 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
html.theme-dark .btn-outline,
html.quiet-room .btn-outline {
  background: transparent;
  color: #d8eee4 !important;
  border-color: #8fbfa8;
}
html.theme-dark .btn-outline:hover,
html.quiet-room .btn-outline:hover {
  background: rgba(42, 64, 56, 0.9);
}
html.theme-dark .btn-secondary,
html.quiet-room .btn-secondary {
  background: #3d524a;
  color: #f3faf6 !important;
}
html.theme-dark .btn-ghost,
html.quiet-room .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff !important;
}

html.theme-dark .book-card,
html.quiet-room .book-card,
html.theme-dark .manage-card-block,
html.quiet-room .manage-card-block,
html.theme-dark .cart-summary,
html.theme-dark .checkout-form-card,
html.theme-dark .order-confirm-card,
html.theme-dark .tonight-pick,
html.quiet-room .tonight-pick {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

html.theme-dark .book-card h2,
html.theme-dark .book-card h3,
html.theme-dark .page-header h1,
html.theme-dark .section-head h2,
html.theme-dark .section-head a,
html.theme-dark .lede,
html.theme-dark .meta,
html.theme-dark .subtitle,
html.theme-dark .empty-state-title,
html.theme-dark .empty-state-lede,
html.theme-dark .description,
html.theme-dark .about-card,
html.theme-dark .about-card h2,
html.theme-dark .about-list,
html.theme-dark .manage-stat-label,
html.theme-dark .manage-stat-num,
html.theme-dark .manage-table,
html.theme-dark .footer-brand,
html.theme-dark .footer-inner,
html.theme-dark .footer-links a,
html.theme-dark .category-pill,
html.theme-dark .price-tag,
html.quiet-room .book-card h2,
html.quiet-room .book-card h3,
html.quiet-room .page-header h1,
html.quiet-room .section-head h2,
html.quiet-room .lede,
html.quiet-room .meta,
html.quiet-room .subtitle,
html.quiet-room .description {
  color: var(--ink);
}

html.theme-dark .meta,
html.theme-dark .subtitle,
html.theme-dark .lede,
html.theme-dark .empty-state-lede,
html.theme-dark .footer-meta,
html.theme-dark .help,
html.quiet-room .meta,
html.quiet-room .lede,
html.quiet-room .subtitle {
  color: var(--muted);
}

html.theme-dark .page-header h1,
html.theme-dark .section-head h2,
html.theme-dark .book-card h2,
html.theme-dark .book-card h3,
html.theme-dark .hero h1,
html.theme-dark .manage-header h1,
html.quiet-room .page-header h1,
html.quiet-room .section-head h2,
html.quiet-room .book-card h3,
html.quiet-room .hero h1 {
  color: #e5f6ee;
}

a,
html.theme-dark a,
html.quiet-room a {
  color: var(--teal-mid);
}
html.theme-dark a:hover,
html.quiet-room a:hover {
  color: #f0faf5;
}

html.theme-dark .category-pill,
html.quiet-room .category-pill {
  background: rgba(197, 221, 208, 0.16);
  color: #e2f3eb;
  border-color: rgba(197, 221, 208, 0.28);
}

html.theme-dark .badge,
html.quiet-room .badge {
  background: rgba(143, 191, 168, 0.25);
  color: #eef8f3;
}

html.theme-dark .site-footer,
html.quiet-room .site-footer {
  background: #0f1a17;
  color: var(--muted);
  border-top-color: var(--line);
}
html.theme-dark .footer-brand-link,
html.quiet-room .footer-brand-link {
  color: #e2f3eb;
}
html.theme-dark .footer-links a,
html.quiet-room .footer-links a {
  color: #c5e0d4;
}

html.theme-dark .side-verse,
html.quiet-room .side-verse {
  color: #f0faf5;
  opacity: 0.92;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
html.quiet-room input,
html.quiet-room select,
html.quiet-room textarea {
  background: #152420;
  color: var(--ink);
  border-color: var(--line);
}
html.theme-dark input::placeholder,
html.quiet-room input::placeholder {
  color: #8aa398;
}

html.theme-dark .manage-side,
html.quiet-room .manage-side {
  background: #152420;
  border-color: var(--line);
}
html.theme-dark .manage-nav a,
html.quiet-room .manage-nav a {
  color: #dceee6;
}
html.theme-dark .manage-nav a:hover,
html.theme-dark .manage-nav a.is-active,
html.quiet-room .manage-nav a:hover,
html.quiet-room .manage-nav a.is-active {
  color: #ffffff;
  background: rgba(45, 78, 68, 0.9);
}

html.theme-dark .manage-table th,
html.quiet-room .manage-table th {
  color: #e5f6ee;
}
html.theme-dark .manage-table td,
html.quiet-room .manage-table td {
  color: var(--ink);
  border-color: var(--line);
}

html.theme-dark .demo-banner,
html.quiet-room .demo-banner {
  background: rgba(42, 64, 56, 0.85);
  border-color: var(--line);
  color: var(--ink);
}

html.theme-dark .hero-kicker,
html.quiet-room .hero-kicker {
  color: #ffffff;
  background: rgba(16, 40, 34, 0.45);
  border-color: rgba(255, 255, 255, 0.28);
}

html.theme-dark .messages .message,
html.quiet-room .messages .message {
  color: var(--ink);
}

/* Theme toggle control */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.25rem;
  padding: 0.2rem 0.35rem 0.2rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(30, 77, 66, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--mint-deep);
  background: var(--teal-soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--mint-deep);
  outline-offset: 2px;
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 2.55rem;
  height: 1.35rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8f2ed, #d5e4dc);
  box-shadow: inset 0 1px 2px rgba(30, 77, 66, 0.12);
}

.theme-toggle.is-dark .theme-toggle-track {
  background: linear-gradient(180deg, #2a453c, #1a322c);
}

.theme-toggle-icon {
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0.85;
  z-index: 1;
}

.theme-toggle-sun { color: #b8860b; }
.theme-toggle-moon { color: #c5ddd0; }

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  transition: left 0.18s ease;
  z-index: 2;
}

.theme-toggle.is-dark .theme-toggle-thumb {
  left: calc(100% - 1.22rem);
  background: #d8eee4;
}

.theme-toggle-text {
  min-width: 2.4rem;
  padding-right: 0.2rem;
  text-align: left;
}

html.theme-dark .theme-toggle,
html.quiet-room .theme-toggle {
  background: #1c2e29;
  border-color: #3d564d;
  color: #e8f4ee;
}
html.theme-dark .theme-toggle:hover,
html.quiet-room .theme-toggle:hover {
  background: #243832;
}

@media (max-width: 720px) {
  .theme-toggle {
    width: 100%;
    justify-content: center;
    margin: 0.35rem 0 0;
    padding: 0.55rem 0.75rem;
  }
}

/* Orbs interactive */
.hero-orbs .orb {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  user-select: none;
}

.hero-orbs .orb:hover,
.hero-orbs .orb:focus-visible {
  transform: translateY(-4px) scale(1.05);
  outline: none;
}

.hero-orbs .orb.orb-lit {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 10px 24px rgba(30, 77, 66, 0.35);
  transform: scale(1.08);
}

/* Dark mode: keep pastel orbs + deep green letters (readable on the hero) */
html.theme-dark .hero-orbs .orb,
html.quiet-room .hero-orbs .orb {
  color: #14352e;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(20, 53, 46, 0.15),
    0 10px 24px rgba(0, 0, 0, 0.4);
  opacity: 1;
  filter: none;
}
html.theme-dark .hero-orbs .orb:nth-child(1),
html.quiet-room .hero-orbs .orb:nth-child(1) {
  background: linear-gradient(145deg, #f2faf6, #c5ddd0);
}
html.theme-dark .hero-orbs .orb:nth-child(2),
html.quiet-room .hero-orbs .orb:nth-child(2) {
  background: linear-gradient(145deg, #fff8f1, #e8d0c0);
}
html.theme-dark .hero-orbs .orb:nth-child(3),
html.quiet-room .hero-orbs .orb:nth-child(3) {
  background: linear-gradient(145deg, #eef7f1, #b5cfbe);
}
html.theme-dark .hero-orbs .orb:nth-child(4),
html.quiet-room .hero-orbs .orb:nth-child(4) {
  background: linear-gradient(145deg, #faf0ea, #dfc0b2);
}
html.theme-dark .hero-orbs .orb.orb-lit,
html.quiet-room .hero-orbs .orb.orb-lit {
  box-shadow:
    0 0 0 3px rgba(232, 246, 238, 0.95),
    0 12px 28px rgba(0, 0, 0, 0.45);
  color: #0f2923;
}

/* Hidden shelf panel */
.hidden-shelf {
  display: none;
  margin: 0 0 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(30, 77, 66, 0.12), rgba(212, 181, 168, 0.15)),
    var(--surface);
  border: 1.5px dashed var(--mint-deep);
  box-shadow: var(--shadow);
}

.hidden-shelf.is-open {
  display: block;
  animation: fade-up 0.4s ease;
}

.hidden-shelf h2 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  color: var(--teal);
  font-size: 1.75rem;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Tonight's pick */
.tonight-pick {
  position: relative;
  overflow: hidden;
  margin: 0 0 2.25rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tonight-pick-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tonight-pick-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--teal);
}

.tonight-pick-stage {
  position: relative;
  z-index: 1;
  min-height: 7.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px dashed var(--line);
  padding: 1rem;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.tonight-pick-stage.is-flipping {
  opacity: 0.35;
  transform: rotateY(12deg) scale(0.98);
}

.tonight-pick-stage.is-revealed {
  border-style: solid;
  border-color: var(--mint-deep);
  background: var(--surface);
}

.tonight-placeholder {
  margin: 1.25rem 0;
  text-align: center;
  color: var(--muted);
}

.tonight-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.tonight-card h3 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--teal);
}

.tonight-cover {
  width: 88px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--mint), var(--sage));
  box-shadow: var(--shadow);
}

.tonight-cover.has-image { background: #1c2a26; }
.tonight-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reading mode */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--mint-deep), var(--teal));
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

html.reading-mode .read-progress {
  opacity: 1;
}

html.reading-mode .site-header,
html.reading-mode .site-footer,
html.reading-mode .breadcrumb,
html.reading-mode .detail-actions .btn-outline[href] {
  /* keep header for nav, soft hide chrome */
}

html.reading-mode .site-footer {
  opacity: 0.4;
}

html.reading-mode .main {
  max-width: 42rem;
}

html.reading-mode .book-detail {
  border: none;
  box-shadow: none;
  background: transparent;
  padding-inline: 0;
}

html.reading-mode .book-detail h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

html.reading-mode .description {
  font-size: 1.2rem;
  line-height: 1.88;
  max-width: 36rem;
  font-weight: 500;
}

html.reading-mode .detail-layout {
  grid-template-columns: 120px 1fr;
}

html.reading-mode body {
  background: var(--bg-soft);
}

/* 404 */
.not-found {
  max-width: 34rem;
  padding: 2rem 0 3rem;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--teal);
  margin: 0.5rem 0 0.75rem;
  line-height: 1.15;
}

.not-found-kicker {
  background: var(--teal-soft) !important;
  color: var(--teal) !important;
  border-color: var(--mint) !important;
}

/* Stack modal */
.stack-easter {
  cursor: help;
  user-select: none;
}

.stack-modal {
  border: none;
  border-radius: calc(var(--radius) + 2px);
  padding: 0;
  max-width: min(28rem, calc(100vw - 2rem));
  box-shadow: var(--shadow-hover);
  background: var(--surface);
  color: var(--ink);
}

.stack-modal::backdrop {
  background: rgba(30, 50, 45, 0.45);
  backdrop-filter: blur(3px);
}

.stack-modal-inner {
  padding: 1.5rem 1.6rem 1.65rem;
}

.stack-modal h2 {
  margin: 0.4rem 0 0.85rem;
  font-family: var(--font-display);
  color: var(--teal);
  font-size: 1.75rem;
}

.stack-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--ink);
}

.stack-list li {
  margin: 0.35rem 0;
}

.keyboard-hint {
  margin-top: 1.25rem;
  font-size: 0.82rem;
}

kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--teal);
  box-shadow: 0 1px 0 var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .book-card.has-tilt .book-card-cover,
  .tonight-pick-stage,
  .toast,
  .hidden-shelf.is-open {
    transition: none !important;
    animation: none !important;
  }
}


/* —— Cart / checkout (demo USD) —— */
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.32rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: middle;
}

.price-tag {
  font-weight: 700;
  color: var(--teal);
  font-size: 0.92rem;
}

.price-tag-lg {
  font-size: 1.25rem;
}

.detail-price {
  margin: 0.35rem 0 0.75rem;
}

.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (max-width: 800px) {
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  align-items: start;
}

.cart-line-cover {
  width: 5rem;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-warm);
  text-decoration: none;
}

.cart-line-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-body h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.cart-line-body h2 a {
  color: inherit;
  text-decoration: none;
}

.cart-line-body h2 a:hover {
  color: var(--teal);
}

.cart-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.65rem;
}

.cart-qty-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.cart-qty-input {
  width: 3.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
}

.cart-line-total {
  margin: 0;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.cart-summary,
.checkout-form-card,
.order-confirm-card {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.cart-summary h2,
.checkout-form-card h2,
.order-confirm-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  color: var(--teal);
  font-size: 1.35rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 1.05rem;
}

.cart-summary .btn,
.checkout-form-card .btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.cart-demo-note {
  margin: 0 0 1rem;
}

.demo-banner {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--teal-soft, #e7f1ed);
  border: 1px solid var(--line);
  color: var(--ink);
}

.checkout-mini-lines {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.checkout-mini-lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.checkout-form .form-field {
  margin-bottom: 1rem;
}

.checkout-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.checkout-form input[type="text"],
.checkout-form input[type="email"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
}

.checkout-form .help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkout-form .field-error {
  display: block;
  margin-top: 0.3rem;
  color: var(--danger, #a33);
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .cart-line {
    grid-template-columns: 4rem minmax(0, 1fr);
  }
  .cart-line-total {
    grid-column: 2;
  }
}
