/* ============================================================
   THE RED SPINE CHALLENGE — App Shell Stylesheet
   Mobile-first. Design target: 375x812.
   ============================================================ */

:root {
  /* Brand */
  --crimson: #8B1A1A;
  --crimson-hover: #6F1414;
  --crimson-deep: #5A0F0F;
  --cream: #F5F0E8;
  --cream-soft: #FBF7F0;
  --parchment: #EFE7D8;
  --walnut: #2C1810;
  --walnut-soft: #4A3328;
  --gold: #C9A84C;
  --gold-deep: #A88735;
  --gold-soft: #E8D69A;
  --gray: #8A8278;
  --gray-soft: #C8C2B8;
  --gray-line: rgba(44, 24, 16, 0.10);
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08);
  --shadow-md: 0 4px 14px rgba(44, 24, 16, 0.10);
  --shadow-lg: 0 12px 32px rgba(44, 24, 16, 0.14);

  /* Type */
  --serif: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --tabbar-h: 64px;
  --topbar-h: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --content-max: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--walnut); letter-spacing: -0.01em; margin: 0; }
.serif { font-family: var(--serif); }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.muted { color: var(--gray); }
em, .italic { font-style: italic; }

a { color: var(--crimson); text-decoration: none; }
a:hover { color: var(--crimson-hover); }

/* ---------- Top App Bar ---------- */
.appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--cream);
  border-bottom: 1px solid var(--gray-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 50;
}
.appbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 30%, var(--gold-soft) 70%, transparent);
  opacity: 0.6;
}
.appbar__left, .appbar__right {
  width: 64px;
  display: flex;
  align-items: center;
}
.appbar__right { justify-content: flex-end; }
.appbar__title {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--walnut);
  text-transform: uppercase;
}
.appbar__progress {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.iconbtn {
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--walnut);
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:active { background: rgba(44,24,16,0.06); }

/* ---------- Bottom Tab Bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--cream);
  border-top: 1px solid var(--gray-line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 50;
  box-shadow: 0 -2px 16px rgba(44, 24, 16, 0.04);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--gray);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  font-weight: 500;
  min-height: 44px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tab.is-active { color: var(--crimson); }
.tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 2px;
  background: var(--crimson);
  border-radius: 0 0 2px 2px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}
.section { margin-top: 28px; }
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  margin: 32px 0;
  border: 0;
}

/* ---------- Today Hero ---------- */
.hero {
  padding-top: 24px;
  text-align: center;
}
.hero__title {
  font-size: 48px;
  line-height: 1.05;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.hero__byline {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.04em;
}
.hero__tagline {
  margin: 22px auto 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--crimson);
  line-height: 1.3;
  position: relative;
  padding: 14px 0;
  max-width: 320px;
}
.hero__tagline::before, .hero__tagline::after {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.hero__tagline::before { top: 0; }
.hero__tagline::after { bottom: 0; }
.hero__image {
  width: calc(100% + 40px);
  margin: 0 -20px;
  display: block;
}
.hero__image img { width: 100%; height: auto; display: block; }

/* ---------- 5-day Progress Strip ---------- */
.progress-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 24px;
  padding: 4px 0;
}
.day-pill {
  display: block;
  text-decoration: none;
  padding: 12px 6px;
  background: var(--cream-soft);
  border: 1px solid var(--gray-line);
  border-radius: 10px;
  text-align: center;
  color: var(--walnut);
  transition: transform .15s ease, background .15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.day-pill:active { transform: scale(0.97); }
.day-pill__name {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray);
}
.day-pill__theme {
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.2;
  color: var(--walnut);
}
.day-pill__num {
  font-family: var(--serif);
  font-size: 18px;
  margin-top: 2px;
  color: var(--gold-deep);
}
.day-pill.is-current {
  background: var(--crimson);
  border-color: var(--crimson);
}
.day-pill.is-current .day-pill__name { color: var(--gold-soft); }
.day-pill.is-current .day-pill__theme,
.day-pill.is-current .day-pill__num { color: var(--cream); }
.day-pill.is-done {
  background: var(--cream-soft);
  border-color: var(--gold-soft);
}
.day-pill.is-done .day-pill__num::after {
  content: '\2713';
  display: inline-block;
  margin-left: 4px;
  color: var(--gold-deep);
  font-weight: 700;
}
.day-pill.is-future { opacity: 0.7; }
.day-pill.is-friday .day-pill__num { font-size: 20px; }
.day-pill.is-friday::after {
  content: '\2605';
  position: absolute;
  top: 4px; right: 6px;
  color: var(--gold);
  font-size: 11px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 16px 24px;
  min-height: 52px;
  border-radius: 10px;
  background: var(--crimson);
  color: var(--cream);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.btn:active { transform: scale(0.99); }
.btn:hover { background: var(--crimson-hover); color: var(--cream); }
.btn--ghost {
  background: transparent;
  color: var(--crimson);
  border: 1px solid var(--crimson);
}
.btn--ghost:hover { background: rgba(139, 26, 26, 0.06); color: var(--crimson); }
.btn--gold {
  background: var(--gold-deep);
  color: var(--walnut);
}
.btn--gold:hover { background: var(--gold); color: var(--walnut); }
.cta-block {
  margin-top: 26px;
}
.reassure {
  margin-top: 14px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--gray);
}

/* ---------- Day Page ---------- */
.day-header {
  padding-top: 18px;
  padding-bottom: 16px;
  text-align: center;
}
.day-chip {
  display: inline-block;
  padding: 5px 14px;
  background: var(--crimson);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
}
.day-theme {
  font-size: 36px;
  line-height: 1.1;
  margin-top: 12px;
  font-style: italic;
}
.day-context {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.03em;
}
.day-hero {
  width: calc(100% + 40px);
  margin: 16px -20px 0;
}
.day-hero img { width: 100%; height: auto; display: block; }
.read-chip {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 12px;
  background: var(--gold-soft);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 999px;
}

/* ---------- Audio Card ---------- */
.audio-card {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #F4ECDC 0%, #EFE5D2 100%);
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.audio-card__btn {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--crimson);
  color: var(--cream);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.audio-card__btn:hover { background: var(--crimson-hover); }
.audio-card__btn svg { width: 18px; height: 18px; fill: currentColor; }
.audio-card__text { flex: 1; min-width: 0; }
.audio-card__label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
}
.audio-card__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--walnut);
  margin-top: 2px;
}

/* ---------- Essentials / Full-text toggle ---------- */
.modetoggle {
  display: inline-flex;
  background: var(--cream-soft);
  border: 1px solid var(--gray-line);
  border-radius: 999px;
  padding: 4px;
  margin: 18px 0 8px;
}
.modetoggle__btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--gray);
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.modetoggle__btn.is-active {
  background: var(--walnut);
  color: var(--cream);
  position: relative;
}
.modetoggle__btn.is-active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 1px;
  background: var(--gold);
  opacity: 0.8;
}

/* ---------- Section content ---------- */
.subsection { margin-top: 36px; }
.subsection__eyebrow { color: var(--gold-deep); }
.subsection__title {
  font-size: 26px;
  font-style: italic;
  margin-top: 6px;
  line-height: 1.2;
}
.subsection__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray);
}
.summary {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--walnut-soft);
  font-style: italic;
  padding-left: 14px;
  border-left: 2px solid var(--gold);
}
.pullquote {
  margin: 22px 0;
  position: relative;
  padding: 22px 18px 22px 36px;
  background: var(--cream-soft);
  border-radius: 12px;
  border-left: 3px solid var(--crimson);
}
.pullquote::before {
  content: '\201C';
  position: absolute;
  top: 6px; left: 10px;
  font-family: var(--serif);
  font-size: 56px;
  color: var(--gold);
  line-height: 1;
}
.pullquote__quote {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  color: var(--walnut);
  font-style: italic;
}
.pullquote__note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}
.fulltext p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--walnut);
  margin: 14px 0;
}
.fulltext p:first-letter {
  /* keep simple, no drop cap to avoid layout weirdness on short paragraphs */
}

/* ---------- Quiz ---------- */
.quiz {
  margin-top: 40px;
  padding: 22px 18px 24px;
  background: var(--cream-soft);
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
}
.quiz__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.quiz__title {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
}
.quiz__progress {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gold-deep);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.quiz__q {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 16px;
  color: var(--walnut);
}
.quiz__opts { display: flex; flex-direction: column; gap: 10px; }
.quiz__opt {
  font-family: var(--sans);
  font-size: 15px;
  text-align: left;
  padding: 14px 16px;
  min-height: 52px;
  background: var(--cream);
  border: 1px solid var(--gray-line);
  border-radius: 10px;
  color: var(--walnut);
  cursor: pointer;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.quiz__opt:hover:not(:disabled) { border-color: var(--crimson); background: #FAF4EA; }
.quiz__opt:disabled { cursor: default; }
.quiz__opt.is-correct {
  background: #E8F1E6;
  border-color: #7B9F70;
  color: #355A2C;
}
.quiz__opt.is-incorrect {
  background: #F5E0DE;
  border-color: #A85A5A;
  color: var(--crimson-deep);
}
.quiz__opt.is-revealed { opacity: 0.65; }
.quiz__opt.is-correct.is-revealed { opacity: 1; }
.quiz__explainer {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--cream);
  border-left: 2px solid var(--gold);
  font-size: 14px;
  line-height: 1.55;
  color: var(--walnut-soft);
  border-radius: 0 8px 8px 0;
}
.quiz__nextbtn { margin-top: 16px; }
.quiz__result {
  text-align: center;
  padding: 14px 0;
}
.quiz__result-score {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--crimson);
  margin-bottom: 6px;
}
.quiz__result-msg {
  font-family: var(--serif);
  font-style: italic;
  color: var(--walnut-soft);
  font-size: 16px;
  margin-bottom: 18px;
}

/* ---------- Friday Capstone ---------- */
.capstone-headline {
  font-size: 44px;
  line-height: 1.05;
  text-align: center;
  margin-top: 10px;
  color: var(--gold-deep);
  font-style: italic;
}
.review {
  margin-top: 28px;
  font-family: var(--serif);
}
.review p {
  font-size: 18px;
  line-height: 1.65;
  margin: 16px 0;
  color: var(--walnut);
}
.review p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--crimson);
  float: left;
  line-height: 0.85;
  padding-right: 8px;
  padding-top: 4px;
  font-weight: 600;
}

/* ---------- Badge Ceremony ---------- */
.ceremony {
  text-align: center;
  padding: 40px 16px;
}
.ceremony__msg {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.seal {
  margin: 22px auto 18px;
  width: 220px; height: 220px;
  position: relative;
}
.seal__svg {
  width: 100%; height: 100%;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(139, 26, 26, 0.25));
  opacity: 0;
  transform: scale(0.4) rotate(-12deg);
}
.seal__svg.is-animating {
  animation: sealReveal 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes sealReveal {
  0% { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  60% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.ceremony__added {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--walnut);
  margin-top: 6px;
}
.ceremony__score {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* ---------- Rebate Card ---------- */
.rebate {
  margin: 28px auto 12px;
  padding: 24px 22px;
  background: linear-gradient(160deg, var(--crimson) 0%, var(--crimson-deep) 100%);
  color: var(--cream);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.rebate::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at top right, rgba(201, 168, 76, 0.35) 0%, transparent 60%);
  pointer-events: none;
}
.rebate__eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.rebate__title {
  font-family: var(--serif);
  font-size: 30px;
  margin-top: 8px;
  font-style: italic;
  line-height: 1.1;
  color: var(--cream);
}
.rebate__code {
  margin-top: 18px;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 14px 16px;
  background: rgba(245, 240, 232, 0.12);
  border: 1.5px dashed var(--gold);
  border-radius: 10px;
  text-align: center;
  color: var(--gold-soft);
}
.rebate__valid {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(245, 240, 232, 0.75);
  text-align: center;
}
.rebate__cta {
  margin-top: 18px;
  width: 100%;
  background: var(--gold);
  color: var(--walnut);
  border: 0;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  display: block;
  text-decoration: none;
}
.rebate__cta:hover { background: var(--gold-soft); color: var(--walnut); }

/* ---------- Library ---------- */
.library-feature {
  margin-top: 22px;
  padding: 18px;
  background: var(--cream-soft);
  border: 2px solid var(--crimson);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.library-feature__badge {
  position: absolute;
  top: 14px; right: -32px;
  background: var(--gold);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 38px;
  transform: rotate(35deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.library-feature__img {
  width: 100%;
  border-radius: 10px;
  display: block;
  margin-bottom: 14px;
}
.library-feature__title {
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
}
.library-feature__author {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.library-feature__tagline {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--crimson);
}

.library-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.library-card {
  background: var(--cream-soft);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.library-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.library-card__body { padding: 12px; }
.library-card__title {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.15;
}
.library-card__author {
  font-size: 11px;
  color: var(--gray);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.library-coming {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.library-coming__spine {
  width: 18px;
  height: 90px;
  background: linear-gradient(to bottom, var(--gray-soft), #B0AAA0);
  border-radius: 2px;
  opacity: 0.5;
}

/* ---------- Passport ---------- */
.passport-stat {
  text-align: center;
  margin-top: 18px;
  padding: 24px 16px;
  background: var(--cream-soft);
  border-radius: 16px;
  border: 1px solid var(--gold-soft);
}
.passport-stat__num {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--gold-deep);
  font-style: italic;
  line-height: 1;
}
.passport-stat__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 6px;
}
.shelf {
  margin-top: 28px;
}
.shelf__row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 0 18px;
  border-bottom: 4px solid #7A5A3F;
  background: linear-gradient(to bottom, transparent 0%, transparent 92%, rgba(0,0,0,0.06) 100%);
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.shelf__row::-webkit-scrollbar { display: none; }
.spine {
  flex-shrink: 0;
  width: 40px;
  height: 170px;
  background: linear-gradient(to right, var(--crimson-deep), var(--crimson) 30%, var(--crimson-hover) 100%);
  border-radius: 2px 2px 0 0;
  position: relative;
  cursor: pointer;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.08), inset -1px 0 0 rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.15);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14px;
  -webkit-tap-highlight-color: transparent;
}
.spine__title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--cream);
  letter-spacing: 0.06em;
  white-space: nowrap;
  line-height: 1.1;
  padding: 8px 0;
}
.spine__seal {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
}
.spine.is-empty {
  background: linear-gradient(to right, #B0AAA0, #C8C2B8 30%, #B0AAA0 100%);
  opacity: 0.55;
}
.spine.is-empty .spine__title { color: rgba(44,24,16,0.0); }
.spine.is-progress {
  background: linear-gradient(to right, #6E5A40, #846B4D 30%, #6E5A40 100%);
  opacity: 0.7;
}
.spine.is-progress .spine__title { color: rgba(245, 240, 232, 0.55); font-size: 11px; }
.passport-footer {
  text-align: center;
  margin-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gray);
}

/* Spine detail modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-bg.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--cream);
  border-radius: 18px;
  padding: 28px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  position: relative;
}
.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray);
  font-size: 20px;
}

/* ---------- About ---------- */
.about-hero {
  text-align: center;
  margin-top: 20px;
}
.about-hero__title { font-size: 38px; line-height: 1.1; }
.about-hero__tag {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--walnut-soft);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.steps { margin-top: 32px; display: grid; gap: 18px; }
.step {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--cream-soft);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
}
.step__num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--crimson);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
}
.step__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
}
.step__body {
  font-size: 14px;
  color: var(--walnut-soft);
  margin-top: 4px;
  line-height: 1.5;
}

.curator-card {
  margin-top: 32px;
  padding: 22px;
  background: var(--cream-soft);
  border-radius: 14px;
  border: 1px solid var(--gold-soft);
  text-align: center;
}
.curator-card__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
}
.curator-card__role {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: 4px;
}
.curator-card__body {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--walnut-soft);
  line-height: 1.55;
}

/* ---------- Install banner ---------- */
.install-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  background: var(--walnut);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  transform: translateY(120%);
  transition: transform .25s ease;
}
.install-banner.is-visible { transform: translateY(0); }
.install-banner__text { flex: 1; }
.install-banner__btn {
  background: var(--gold);
  color: var(--walnut);
  border: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.install-banner__close {
  background: transparent;
  border: 0;
  color: var(--cream);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.install-banner__close:active { opacity: 1; }
.install-banner__btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  margin-top: 40px;
  padding: 24px 0 8px;
  text-align: center;
  border-top: 1px solid var(--gray-line);
}
.footer a {
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.footer__build {
  font-size: 10px;
  color: var(--gray-soft);
  margin-top: 8px;
  letter-spacing: 0.08em;
}

/* ---------- Tablet/desktop responsive ---------- */
@media (min-width: 720px) {
  .hero__title { font-size: 64px; }
  .hero__image { width: 100%; margin: 0; border-radius: 14px; overflow: hidden; }
  .day-hero { width: 100%; margin: 16px 0 0; border-radius: 14px; overflow: hidden; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  body { padding-top: calc(var(--topbar-h) + 8px); }
}
