@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-Italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

/* ============================================================================
   DEFAULT THEME: EVENING / DARK MODE (WCAG AA/AAA VERIFIED CONTRASTS)
   ============================================================================ */
:root {
  color-scheme: dark;
  --font-serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Dark Canvas & Surfaces */
  --canvas: #121210;
  --mat: #1A1916;
  --mat-border: rgba(242, 239, 233, 0.12);
  --surface: #22211D;
  --surface-elevated: #2B2924;
  --surface-subtle: #161513;

  /* High-Contrast Accessible Ink Tokens */
  --ink: #F3F0EA;
  --ink-secondary: #C2BCB2;
  --ink-muted: #9E988E;

  --hairline: rgba(243, 240, 234, 0.11);
  --hairline-strong: rgba(243, 240, 234, 0.22);

  --btn-bg: #F3F0EA;
  --btn-fg: #141311;
  --btn-hover: #FFFFFF;

  --accent-ribbon: #B83B2B;
  --focus-ring: #D6A96A;
  --spotlight-glow: rgba(214, 169, 106, 0.07);

  /* Book Paper Surface Tokens */
  --book-paper: #F4EFE4;
  --book-ink: #1F1C18;
  --book-muted: #665D50;
  --book-rule: rgba(31, 28, 24, 0.12);
  --book-stack: #CFC6B4;
  --book-stack-deep: #B0A795;
  --book-shadow: 0 32px 84px rgba(0, 0, 0, 0.72), 0 6px 22px rgba(0, 0, 0, 0.48);

  --highlight: rgba(212, 160, 62, 0.26);
  --highlight-border: #9E6E24;
}

/* ============================================================================
   DAYLIGHT THEME (WARM UNBLEACHED PAPER, WCAG AA/AAA VERIFIED CONTRASTS)
   ============================================================================ */
html[data-room="daylight"] {
  color-scheme: light;
  --canvas: #F6F3EC;
  --mat: #EAE5DA;
  --mat-border: rgba(28, 26, 23, 0.12);
  --surface: #FDFBF7;
  --surface-elevated: #FFFFFF;
  --surface-subtle: #E2DDD1;

  --ink: #191815;
  --ink-secondary: #4D4942;
  --ink-muted: #666158;

  --hairline: rgba(25, 24, 21, 0.11);
  --hairline-strong: rgba(25, 24, 21, 0.22);

  --btn-bg: #191815;
  --btn-fg: #F7F4EE;
  --btn-hover: #2E2C27;

  --focus-ring: #7C5A2B;
  --spotlight-glow: rgba(180, 130, 60, 0.06);

  --book-paper: #FAF6ED;
  --book-ink: #1E1B17;
  --book-muted: #655C4F;
  --book-rule: rgba(30, 27, 23, 0.11);
  --book-stack: #DFD8C8;
  --book-stack-deep: #C5BCA8;
  --book-shadow: 0 24px 60px rgba(28, 24, 18, 0.12), 0 4px 14px rgba(28, 24, 18, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  overflow-x: hidden;
}

/* React Bits Noise: a still, monochrome paper surface behind the headline. */
.hero-paper {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: clamp(640px, 60vw, 820px);
  overflow: hidden;
  pointer-events: none;
  background-color: var(--canvas);
  mask-image: linear-gradient(to bottom, #000 0%, #000 28%, rgba(0, 0, 0, 0.55) 65%, transparent 100%);
  transition: background-color 0.35s ease;
}

.hero-paper-grain {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 192px 192px;
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-paper.is-ready .hero-paper-grain { opacity: 0.27; }
html[data-room="daylight"] .hero-paper.is-ready .hero-paper-grain { opacity: 0.30; }

h1, h2, h3, h4, p, figure, blockquote, pre {
  margin: 0;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

kbd {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-secondary);
}

code {
  font-family: Consolas, 'SF Mono', monospace;
  font-size: 0.88em;
  color: var(--ink);
}

/* ============================================================================
   REACT BITS: BLUR TEXT & SPOTLIGHT CARD MICRO-INTERACTIONS
   ============================================================================ */
.blur-word {
  display: inline-block;
  animation: reactBitsBlurReveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--w, 0) * 55ms);
}

@keyframes reactBitsBlurReveal {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.spotlight-surface {
  position: relative;
  overflow: hidden;
}

.spotlight-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    560px circle at var(--spot-x, -999px) var(--spot-y, -999px),
    var(--spotlight-glow),
    transparent 65%
  );
  opacity: var(--spot-opacity, 0);
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* ============================================================================
   SYMMETRIC 3-COLUMN HEADER
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header-left {
  justify-self: start;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark-logo {
  display: block;
  width: 112px;
  height: auto;
  flex: none;
}

.wordmark:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 6px;
  border-radius: 2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: center;
}

.header-nav a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 14px;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.light-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.light-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}

.theme-icon {
  grid-area: 1 / 1;
  width: 19px;
  height: 19px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.theme-moon {
  opacity: 0;
  transform: rotate(-45deg) scale(0.6);
}

html[data-room="daylight"] .theme-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

html[data-room="daylight"] .theme-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-primary:hover {
  background: var(--btn-hover);
}

.btn-primary.btn-sm {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 99px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-secondary.btn-sm {
  height: 34px;
  padding: 0 15px;
  font-size: 12.5px;
}

.btn-secondary:hover {
  border-color: var(--ink-secondary);
}

.btn-full {
  width: 100%;
}

/* ============================================================================
   HERO
   ============================================================================ */
.hero { max-width: 1140px; margin: 0 auto; padding: 42px 32px 28px; }
.hero-running-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--hairline-strong); font-size: 9px; letter-spacing: .18em; color: var(--ink-muted); }
.hero-composition { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(260px,1fr); gap: 64px; padding: 45px 0 38px; }
.hero-title-block { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero-title { margin: 0; font: 400 clamp(56px,7.2vw,88px)/.99 var(--font-serif); letter-spacing: -.045em; color: var(--ink); }
.hero-title em { font-weight: 400; color: var(--ink-secondary); }
.hero-margin { padding-top: 4px; }
.hero-subtitle { margin: 0 0 28px; max-width: 34ch; font-size: 14px; line-height: 1.8; color: var(--ink-secondary); }
.hero-invitation { position: relative; padding: 26px 26px 22px; max-width: 320px; background: #eee5d3; color: #332f26; transform: rotate(-2deg); box-shadow: 3px 5px 0 #cfc5b0, 0 15px 30px rgba(0,0,0,.15); }
.hero-card-ribbon { position: absolute; top: 0; right: 24px; width: 16px; height: 31px; background: #984737; clip-path: polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }
.hero-card-label { margin: 0 0 18px; font-size: 8px; letter-spacing: .16em; color: #6c6253; }
.hero-card-title { margin: 0 0 15px; font: 400 35px/1.02 var(--font-serif); letter-spacing: -.025em; }
.hero-meta { margin: 0 0 20px; font-size: 11px; line-height: 1.7; color: #665c4e; }
.hero-signup { width: 100%; padding: 11px 8px; background: transparent; color: #332f26; border: 1px solid #8c806d; border-radius: 0; font: 500 12px var(--font-sans); cursor: pointer; }
.hero-signup:hover { background: #332f26; color: #eee5d3; }
.hero-card-note { display: block; margin-top: 10px; text-align: center; font: italic 13px var(--font-serif); color: #665c4e; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 19px 0 0; border-top: 1px solid var(--hairline-strong); }
.hero-page-note { font: italic 17px var(--font-serif); color: var(--ink-muted); }
.hero-bottom .demo-link { font-size: 12px; text-decoration: none; }
.hero-bottom .demo-link span { margin-left: 12px; }
@media (max-width: 800px) {
  .hero-composition { gap: 32px; grid-template-columns: 1.4fr 1fr; }
  .hero-title { font-size: clamp(45px,7.4vw,64px); }
  .hero-invitation { padding: 24px 20px 20px; }
}
@media (max-width: 600px) {
  .hero { padding: 28px 24px; }
  .hero-running-head { font-size: 8px; letter-spacing: .09em; }
  .hero-running-head span:last-child { max-width: 120px; text-align: right; }
  .hero-composition { grid-template-columns: 1fr; gap: 22px; padding: 32px 0; }
  .hero-title { font-size: clamp(49px,11.5vw,68px); }
  .hero-subtitle { max-width: 40ch; margin-bottom: 24px; }
  .hero-invitation { width: calc(100% - 8px); max-width: 100%; margin: 0 auto; transform: rotate(-1deg); }
  .hero-bottom { align-items: flex-start; flex-direction: column; gap: 12px; }
}

/* ============================================================================
   DESK & LIVING 3D BOOK STAGE
   ============================================================================ */
.desk-section,
.compare-section,
.principles-section,
.pricing-section {
  scroll-margin-top: 84px;
}

.desk-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

.reading-mat {
  position: relative;
  background: var(--mat);
  border: 1px solid var(--mat-border);
  border-radius: 20px;
  padding: 44px 60px 24px;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.book-stage,
.mat-bar {
  position: relative;
  z-index: 2;
}

.book-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-edge-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  transition: color 0.16s, border-color 0.16s, background 0.16s, transform 0.16s;
}

.page-edge-nav:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink-secondary);
  background: var(--surface-elevated);
  transform: translateY(-50%) scale(1.05);
}

.page-edge-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.page-edge-nav svg {
  width: 18px;
  height: 18px;
}

.prev-edge { left: -48px; }
.next-edge { right: -48px; }

.book-viewport {
  position: relative;
  width: 100%;
  max-width: 900px;
  perspective: 2400px;
}

.book-object {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 556px;
  border-radius: 6px;
  box-shadow:
    var(--book-shadow),
    -3px 0 0 var(--book-stack),
    -6px 2px 0 var(--book-stack-deep),
    3px 0 0 var(--book-stack),
    6px 2px 0 var(--book-stack-deep);
  transform-style: preserve-3d;
}

/* Book Paper Surface Tones */
.book-object[data-paper="warm"] {
  --book-paper: #F4EFE4;
  --book-ink: #1F1C18;
  --book-muted: #655C4F;
  --book-rule: rgba(31, 28, 24, 0.11);
}

.book-object[data-paper="ivory"] {
  --book-paper: #FCFBF8;
  --book-ink: #161614;
  --book-muted: #5C5953;
  --book-rule: rgba(22, 22, 20, 0.1);
}

.book-object[data-paper="dusk"] {
  --book-paper: #22211E;
  --book-ink: #EDE8DF;
  --book-muted: #A49D91;
  --book-rule: rgba(237, 232, 223, 0.12);
  --book-stack: #383631;
  --book-stack-deep: #2B2925;
  --highlight: rgba(214, 169, 106, 0.25);
  --highlight-border: #D6A96A;
}

/* Book Typography Settings */
.book-object[data-font="serif"] { --page-font: var(--font-serif); }
.book-object[data-font="georgia"] { --page-font: Georgia, serif; }
.book-object[data-font="sans"] { --page-font: var(--font-sans); }

.book-object[data-size="sm"] { --page-size: 15px; }
.book-object[data-size="md"] { --page-size: 16.5px; }
.book-object[data-size="lg"] { --page-size: 18px; }

.book-object[data-size="lg"] .page-content {
  line-height: 1.54;
}

.book-object[data-size="lg"] .page-content p {
  margin-bottom: 0.72em;
}

.book-object[data-font="sans"][data-size="sm"] { --page-size: 13.5px; }
.book-object[data-font="sans"][data-size="md"] { --page-size: 14.8px; }
.book-object[data-font="sans"][data-size="lg"] { --page-size: 16px; }

/* Silk Bookmark Ribbon */
.bookmark-ribbon {
  position: absolute;
  top: -4px;
  right: 48px;
  z-index: 12;
  width: 16px;
  height: 22px;
  padding: 0;
  border: 0;
  background: var(--accent-ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  opacity: 0.5;
  transition: height 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}

.bookmark-ribbon:hover {
  opacity: 0.85;
  height: 30px;
}

.bookmark-ribbon.is-marked {
  height: 44px;
  opacity: 1;
}

/* Individual Page Leaves */
.page-leaf {
  position: relative;
  height: 100%;
  background: var(--book-paper);
  color: var(--book-ink);
  padding: 42px 50px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.leaf-verso {
  border-radius: 6px 0 0 6px;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.025) 0%, transparent 6%, transparent 91%, rgba(30, 22, 12, 0.09) 100%);
}

.leaf-recto {
  border-radius: 0 6px 6px 0;
  background-image: linear-gradient(90deg, rgba(30, 22, 12, 0.09) 0%, transparent 9%, transparent 94%, rgba(0, 0, 0, 0.025) 100%);
}

.spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(34, 28, 20, 0.2);
  z-index: 6;
  pointer-events: none;
}

.page-running-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--book-rule);
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--book-muted);
  flex: none;
}

.page-content {
  flex: 1;
  font-family: var(--page-font, var(--font-serif));
  font-size: var(--page-size, 16.5px);
  line-height: 1.6;
  color: var(--book-ink);
  overflow: hidden;
}

.page-content h2, .page-content h3 {
  font-family: inherit;
  font-weight: 400;
  font-style: italic;
  font-size: 1.25em;
  line-height: 1.24;
  margin-bottom: 0.75em;
  color: var(--book-ink);
}

.page-content p {
  margin-bottom: 0.88em;
}

.page-content p:last-child {
  margin-bottom: 0;
}

.annotated-phrase {
  background: var(--highlight);
  border-bottom: 1.5px solid var(--highlight-border);
  padding: 1px 2px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.annotated-phrase:hover {
  background: rgba(212, 160, 62, 0.4);
}

/* Original PDF Simulation Layout */
.pdf-layout {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.4px;
  line-height: 1.44;
  column-count: 2;
  column-gap: 20px;
  text-align: justify;
}

.pdf-layout h4 {
  column-span: all;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--book-muted);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--book-rule);
}

.pdf-layout p {
  margin-bottom: 0.8em;
}

.page-folio {
  padding-top: 16px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: var(--book-muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ============================================================================
   SYNCHRONIZED 3D PAGE-TURNING LEAF
   ============================================================================ */
.turning-page {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  right: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
}

.turning-page.turn-forward {
  opacity: 1;
  right: 0;
  left: auto;
  transform-origin: left center;
  animation: leafTurnForward 0.52s cubic-bezier(0.33, 0.06, 0.22, 1) forwards;
}

.turning-page.turn-backward {
  opacity: 1;
  left: 0;
  right: auto;
  transform-origin: right center;
  animation: leafTurnBackward 0.52s cubic-bezier(0.33, 0.06, 0.22, 1) forwards;
}

.turning-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--book-paper);
  color: var(--book-ink);
  padding: 42px 50px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.turning-page.turn-forward .turning-front {
  border-radius: 0 6px 6px 0;
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.18);
}

.turning-page.turn-forward .turning-back {
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.18);
}

.turning-page.turn-backward .turning-front {
  border-radius: 6px 0 0 6px;
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.18);
}

.turning-page.turn-backward .turning-back {
  transform: rotateY(-180deg);
  border-radius: 0 6px 6px 0;
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.18);
}

@keyframes leafTurnForward {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}

@keyframes leafTurnBackward {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

/* Floating Selection Pill */
.selection-pill {
  position: absolute;
  z-index: 26;
  background: #181715;
  color: #F4EFE4;
  border: 1px solid rgba(244, 239, 228, 0.22);
  padding: 4px 6px;
  border-radius: 99px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pill-action-btn {
  border: 0;
  background: transparent;
  color: #F4EFE4;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
}

.pill-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mirrors src/theme.css and src/reader-panels.css in the desktop app.
   Keep the overlay out of flow: neither the spread nor its type can move. */
@font-face {
  font-family: 'Quiet Plex';
  src: url('fonts/IBMPlexSans-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Quiet Plex';
  src: url('fonts/IBMPlexSans-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

.margin-notes-sheet {
  --notes-panel: #1c1e19;
  --notes-raised: #292c23;
  --notes-hover: #363a2e;
  --notes-input: #12140f;
  --notes-ink: #e9e6de;
  --notes-muted: #aaa79f;
  --notes-line: #3b3d33;
  --notes-border: #4b4f40;
  --notes-border-hover: #858875;
  --notes-paper: #e8e3d6;
  --notes-on-paper: #25271f;
  --focus-ring: #dd916d;
  color-scheme: dark;
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 12px;
  width: 400px;
  max-width: calc(100% - 24px);
  z-index: 24;
  padding: 20px 24px;
  border: 1px solid var(--notes-border);
  border-radius: 12px;
  background: var(--notes-panel);
  color: var(--notes-ink);
  box-shadow: 0 16px 56px #0009;
  font-family: 'Quiet Plex', 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--notes-border) transparent;
}

.book-viewport:has(.margin-notes-sheet:not([hidden])) { z-index: 20; }

.notes-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.notes-sheet-title { font: 500 20px/1.3 'Quiet Plex', 'Segoe UI', sans-serif; letter-spacing: -0.3px; }
.notes-tip { color: var(--notes-muted); font-size: 12px; margin: 14px 0 24px; line-height: 1.6; }
.sheet-close { border: 0; background: transparent; color: var(--ink-secondary); width: 28px; height: 28px; border-radius: 6px; font-size: 13px; }
.sheet-close:hover { background: var(--surface-elevated); color: var(--ink); }
.margin-notes-sheet .sheet-close { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border-radius: 7px; color: var(--notes-muted); }
.margin-notes-sheet .sheet-close svg { width: 16px; height: 16px; }
.margin-notes-sheet .sheet-close:hover { background: var(--notes-raised); color: var(--notes-ink); }

.notes-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 12px; border: 1px solid var(--notes-border); border-radius: 7px; background: var(--notes-raised); color: var(--notes-ink); font-size: 12px; line-height: 1.4; }
.notes-button:hover:not(:disabled) { background: var(--notes-hover); border-color: var(--notes-border-hover); }
.notes-button:disabled { opacity: 0.4; cursor: default; }
.notes-button.accent { min-height: 40px; padding: 9px 14px; background: var(--notes-paper); border-color: var(--notes-paper); color: var(--notes-on-paper); font-weight: 500; }
.notes-button.accent:hover:not(:disabled) { background: #fff9eb; border-color: #fff9eb; }
.notes-text-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--notes-muted); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.notes-text-btn:hover:not(:disabled) { background: var(--notes-raised); color: var(--notes-ink); }
.notes-text-btn:disabled { opacity: 0.4; cursor: default; }
.note-context-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 28px; font-size: 12px; font-weight: 500; }
.note-context-heading .notes-text-btn { font-size: 11px; font-weight: 400; }
.note-composer { margin-top: 18px; }
.note-entry .note-composer { margin-top: 14px; }
.note-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12px; color: var(--notes-muted); }
.note-form-heading label { display: flex; align-items: center; gap: 10px; }
.note-page-input { width: 56px; height: 28px; padding: 4px 6px; border: 1px solid var(--notes-border); border-radius: 6px; background: var(--notes-input); color: var(--notes-ink); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; appearance: textfield; }
.note-page-input::-webkit-inner-spin-button,
.note-page-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.note-page-input[readonly] { color: var(--notes-muted); }
.margin-notes-sheet blockquote { border-left: 2px solid var(--notes-border-hover); margin: 14px 0; padding: 4px 12px; color: var(--notes-muted); font: 12px/1.65 'Quiet Plex', 'Segoe UI', sans-serif; max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-composer textarea { display: block; width: 100%; resize: vertical; min-height: 150px; padding: 12px; border: 1px solid var(--notes-border); border-radius: 6px; background: var(--notes-input); color: var(--notes-ink); font: 13px/1.65 'Quiet Plex', 'Segoe UI', sans-serif; }
.note-composer textarea:hover { border-color: var(--notes-border-hover); }
.note-composer textarea::placeholder { color: var(--notes-muted); opacity: 1; }
.note-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 11px; }
.note-save-state { color: var(--notes-muted); }
.notes-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--notes-line); margin-top: 20px; padding-bottom: 12px; font-size: 11px; color: var(--notes-muted); }
.notes-list-heading .notes-text-btn { font-size: 11px; }
.note-entry { border-bottom: 1px solid var(--notes-line); padding: 18px 0; }
.note-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-page-link { color: var(--notes-ink); }
.note-tools { display: flex; gap: 2px; }
.note-tools [data-delete-note] { color: #e8aa90; }
.note-entry p { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.65 'Quiet Plex', 'Segoe UI', sans-serif; margin: 12px 0 0; }
.notes-empty { color: var(--notes-muted); font-size: 12px; margin: 14px 0 24px; }
.notes-sheet-status { color: var(--notes-muted); font-size: 11px; margin-top: 16px; }
.notes-sheet-status:empty { display: none; }
@media (max-width: 640px) {
  .margin-notes-sheet { top: 8px; bottom: 8px; right: -16px; width: calc(100% + 32px); max-width: none; padding: 18px; }
}

/* Reading Style Popover (Aa) */
.type-popover {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 290px;
}

.type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.type-label {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.type-choices {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--hairline);
  padding: 2px;
  border-radius: 7px;
}

.choice-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.14s, color 0.14s;
}

.choice-btn:hover {
  color: var(--ink);
}

.choice-btn.is-selected {
  background: var(--surface-elevated);
  color: var(--ink);
  font-weight: 500;
}

/* ============================================================================
   MAT BOTTOM CONTROL BAR (HIGH CONTRAST, SINGLE LINE)
   ============================================================================ */
.mat-bar {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.book-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}

.book-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 14.5px;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.book-tab:hover {
  color: var(--ink);
  background: var(--surface);
}

.book-tab.is-active {
  color: var(--ink);
  background: var(--surface-elevated);
  border-color: var(--hairline-strong);
  font-style: normal;
}

.mat-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-switch {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--hairline-strong);
  padding: 2px;
  border-radius: 99px;
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.mode-btn:hover {
  color: var(--ink);
}

.mode-btn.is-active {
  background: var(--surface-elevated);
  color: var(--ink);
  font-weight: 500;
}

.mat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12.5px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.mat-pill:hover, .mat-pill[aria-expanded="true"] {
  background: var(--surface-elevated);
  color: var(--ink);
  border-color: var(--ink-secondary);
}

.note-badge {
  font-size: 11.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   CHROME PDF VIEWER VS. REPAGED (WORKING SCROLLABLE PDF & FULL-SCREEN)
   ============================================================================ */
.compare-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 32px 96px;
}

.compare-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.compare-header h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}

.compare-header p {
  max-width: 58ch;
  font-size: 15.5px;
  color: var(--ink-secondary);
}

.compare-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compare-viewport {
  position: relative;
  height: 720px;
  border-radius: 16px;
  border: 1px solid var(--mat-border);
  overflow: hidden;
  background: #0D0D0B;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

/* Full-screen state */
.compare-viewport.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  border-radius: 0;
  border: 0;
}

/* Top-Right Fullscreen Control */
.fs-top-controls {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 19, 17, 0.92);
  backdrop-filter: blur(8px);
  padding: 4px 6px 4px 6px;
  border-radius: 99px;
  border: 1px solid rgba(243, 240, 234, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.fs-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  border: 0;
  background: transparent;
  color: #F3F0EA;
  font-size: 12px;
}

.fs-exit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Browser PDF sample: fixed paper geometry and Windows browser chrome. */
.chrome-viewer-mock {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background: #525659; color: #e8eaed; color-scheme: dark;
  font-family: 'Segoe UI', Arial, sans-serif; container-type: inline-size;
}
.chrome-viewer-mock svg {
  width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.chrome-tabs-bar {
  height: 40px; flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding-left: 8px; background: #202124; font-size: 12px;
}
.chrome-tab-search {
  height: 28px; width: 28px; align-self: center; display: grid; place-items: center;
  border-radius: 6px; background: #303134;
}
.chrome-tab {
  width: 278px; height: 34px; min-width: 0; padding: 0 12px; display: flex;
  align-items: center; gap: 9px; background: #35363a; border-radius: 10px 10px 0 0;
}
.chrome-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome-tab .chrome-doc-icon { color: #f28b82; width: 16px; height: 16px; }
.chrome-tab .chrome-tab-close { width: 16px; height: 16px; margin-left: auto; }
.chrome-new-tab { height: 34px; display: grid; place-items: center; padding: 0 5px; }
.chrome-window-controls { margin-left: auto; align-self: stretch; display: flex; }
.chrome-window-controls span { width: 42px; display: grid; place-items: center; }
.chrome-window-controls svg { width: 19px; height: 19px; stroke-width: 1.2; }
.chrome-url-bar {
  height: 46px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: #35363a; border-bottom: 1px solid #202124;
}
.chrome-nav-icons { display: flex; align-items: center; gap: 18px; color: #c4c7c5; }
.chrome-forward { opacity: .4; }
.chrome-omnibox {
  flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; background: #202124; border-radius: 20px; font-size: 12px; color: #bdc1c6;
}
.chrome-file-pill { flex: none; border-right: 1px solid #5f6368; padding-right: 12px; }
.chrome-url-path { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chrome-omnibox svg { width: 16px; height: 16px; }
.chrome-profile { width: 26px; height: 26px; border-radius: 50%; background: #687c71; color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }
.chrome-pdf-toolbar {
  height: 56px; flex: none; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(40px,1fr);
  align-items: center; gap: 16px; padding: 0 16px; background: #323639;
  box-shadow: 0 2px 5px #0005; position: relative; z-index: 4; font-size: 13px;
}
.pdf-tb-left, .pdf-tb-center, .pdf-tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pdf-tb-right { justify-content: flex-end; }
.pdf-tb-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pdf-tb-icon {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #e8eaed; padding: 6px;
}
.pdf-page-readout, .pdf-zoom-box {
  display: inline-flex; align-items: center; justify-content: center;
  height: 24px; width: 42px; border: 1px solid transparent; border-radius: 2px;
  background: #202124; color: #f1f3f4; text-align: center; padding: 2px 4px;
  font: 12px 'Segoe UI', Arial, sans-serif; font-variant-numeric: tabular-nums;
}
.pdf-zoom-box { width: 52px; }
.pdf-page-total { color: #d6d7d8; white-space: nowrap; font-size: 12px; }
.pdf-tb-sep { width: 1px; height: 20px; flex: none; margin: 0 7px; background: #5f6368; }
.chrome-pdf-body { flex: 1; display: grid; grid-template-columns: 192px minmax(0,1fr); min-height: 0; overflow: hidden; }
.chrome-thumb-rail {
  background: #323639; border-right: 1px solid #202124; padding: 24px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 22px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #777b7e #323639; overscroll-behavior: contain;
}
.chrome-thumb {
  flex: none; border: 0; background: none; padding: 4px; border-radius: 2px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #e8eaed; font: 12px 'Segoe UI', Arial, sans-serif;
}
.chrome-thumb .thumb-sheet {
  width: 98px; height: 127px; position: relative; overflow: hidden; background: white;
  box-shadow: 0 2px 5px #0007; outline: 3px solid transparent; outline-offset: 2px;
}
.chrome-thumb.is-current .thumb-sheet { outline-color: #8ab4f8; }
.chrome-thumb.is-current .thumb-num { color: #aecbfa; }
.chrome-thumb .pdf-sheet { position: absolute; inset: 0; transform: scale(.1441176471); transform-origin: top left; pointer-events: none; box-shadow: none; }
.chrome-canvas-well {
  min-width: 0; background: #525659; padding: 24px; overflow: auto; position: relative;
  scrollbar-color: #b8babc #424649; scrollbar-width: auto; overscroll-behavior: contain;
}
.chrome-pages-stack { display: flex; flex-direction: column; align-items: center; gap: 18px; width: max-content; min-width: 100%; }
.pdf-page-frame { position: relative; flex: none; width: 680px; height: 880px; box-shadow: 0 2px 7px #0006; }
.pdf-page-frame > .pdf-sheet { position: absolute; inset: 0; transform-origin: top left; }
.pdf-sheet {
  width: 680px; height: 880px; flex: none; padding: 48px 54px 44px; background: #fff; color: #111;
  font-family: 'Times New Roman', Times, serif; display: flex; flex-direction: column; overflow: hidden;
}
@container (max-width: 840px) {
  .chrome-pdf-toolbar { grid-template-columns: 32px 1fr 32px; gap: 10px; padding: 0 10px; }
  .pdf-tb-filename { display: none; }
  .pdf-tb-center { justify-content: center; gap: 4px; }
  .chrome-pdf-body { grid-template-columns: 140px minmax(0,1fr); }
}
@container (max-width: 540px) {
  .chrome-window-controls span { width: 26px; }
  .chrome-tab { width: 190px; }
  .chrome-nav-icons { gap: 10px; }
  .chrome-nav-icons svg { width: 16px; }
  .chrome-profile, .chrome-browser-menu, .chrome-tab-search { display: none; }
  .chrome-url-bar { gap: 10px; padding: 0 10px; }
  .chrome-pdf-toolbar { grid-template-columns: 26px 1fr 26px; gap: 4px; padding: 0 6px; }
  .pdf-tb-icon { width: 26px; height: 30px; padding: 3px; }
  .pdf-tb-center { gap: 2px; }
  .pdf-tb-sep { margin: 0 3px; }
  .pdf-page-readout { width: 32px; }
  .pdf-zoom-box { width: 42px; }
  .chrome-pdf-body { grid-template-columns: 112px minmax(0,1fr); }
  .chrome-thumb-rail { padding: 18px 6px; }
  .chrome-thumb .thumb-sheet { width: 74px; height: 96px; }
  .chrome-thumb .pdf-sheet { transform: scale(.1088235294); }
}

.pdf-sheet-head {
  font-family: Arial, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: #555555;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #CCCCCC;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

.pdf-sheet-cols {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  font-size: 14px;
  line-height: 1.48;
  text-align: justify;
}

.pdf-sheet-cols h5 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111111;
}

.pdf-sheet-cols p {
  margin-bottom: 10px;
}

.pdf-sheet-figure {
  border: 1px solid #BBBBBB;
  padding: 12px;
  margin-bottom: 12px;
  background: #FAFAFA;
  text-align: left;
}

.pdf-fig-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
  font-family: Arial, sans-serif;
  font-size: 10px;
  text-align: center;
  align-items: start;
}

.pdf-fig-deep, .pdf-fig-shallow {
  border: 1.5px solid #222222;
  background: #FFFFFF;
}

.pdf-fig-top {
  display: block;
  background: #E8EAED;
  border-bottom: 1px solid #222222;
  padding: 3px 4px;
  font-weight: 700;
}

.pdf-fig-deep .pdf-fig-body {
  padding: 18px 6px;
}

.pdf-fig-shallow .pdf-fig-body {
  padding: 6px;
}

.pdf-fig-caption {
  font-size: 10.5px;
  line-height: 1.35;
  color: #333333;
}

.pdf-sheet-code {
  margin: 8px 0 10px;
  padding: 8px 10px;
  background: #F4F5F7;
  border: 1px solid #D0D4DC;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
  text-align: left;
}

.pdf-sheet-list {
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: 11.8px;
  line-height: 1.38;
}

.pdf-sheet-list li {
  margin-bottom: 5px;
}

.pdf-sheet-foot {
  font-family: Arial, sans-serif;
  font-size: 9.5px;
  color: #666666;
  border-top: 1px solid #DDDDDD;
  padding-top: 8px;
  margin-top: 16px;
}

/* VIEW B: Repaged Full-Screen Spread */
.quiet-fullscreen-mock {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0C0C0A;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 64px;
}

.qf-edge-prev { left: 16px; }
.qf-edge-next { right: 16px; }

.qf-book-spread {
  position: relative;
  width: min(860px, 100%);
  height: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 6px;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.78),
    -3px 0 0 #CFC6B4,
    -6px 2px 0 #B0A795,
    3px 0 0 #CFC6B4,
    6px 2px 0 #B0A795;
  overflow: hidden;
}

.compare-viewport.is-fullscreen .qf-book-spread {
  width: min(1040px, 88vw);
  height: min(700px, 84vh);
}

.qf-page {
  background: #F4EFE4;
  color: #1F1C18;
  padding: 34px 44px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.qf-left {
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.025) 0%, transparent 6%, transparent 91%, rgba(30, 22, 12, 0.09) 100%);
}

.qf-right {
  background-image: linear-gradient(90deg, rgba(30, 22, 12, 0.09) 0%, transparent 9%, transparent 94%, rgba(0, 0, 0, 0.025) 100%);
}

.qf-body {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.58;
  overflow: hidden;
}

.compare-viewport.is-fullscreen .qf-body {
  font-size: 18px;
  line-height: 1.62;
}

.qf-body h3 {
  font-weight: 400;
  font-style: italic;
  font-size: 1.24em;
  margin-bottom: 0.65em;
}

.qf-body p {
  margin-bottom: 0.8em;
}

.qf-body pre {
  margin: 0.6em 0 0.8em;
  padding: 10px 12px;
  background: #E8DFCC;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.42;
  overflow-x: auto;
}

/* ============================================================================
   DESIGN PRINCIPLES: LOCKED SPECIMEN HEIGHTS (ZERO SHIFT ON TOGGLE!)
   ============================================================================ */
.principles-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 32px 96px;
  border-top: 1px solid var(--hairline);
}

.editorial-row {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 64px;
  align-items: center;
  padding: 64px 0;
}

.editorial-divider {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

.chapter-num {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.editorial-text h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 18px;
}

.editorial-text p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

.editorial-text p:last-child {
  margin-bottom: 0;
}

.specimen-frame {
  background: var(--mat);
  border: 1px solid var(--mat-border);
  border-radius: 16px;
  padding: 28px 28px 18px;
}

/* Strictly locked 256px height so toggling Part 02 never shifts by even 1px */
#interest-turnstile { margin: 16px 0; min-height: 65px; }
.interest-submit:disabled { opacity: .55; cursor: not-allowed; }

.specimen-page {
  position: relative;
  background: var(--book-paper);
  color: var(--book-ink);
  border-radius: 6px;
  padding: 28px 34px 22px;
  height: 256px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}

.specimen-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--book-rule);
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--book-muted);
  flex: none;
}

.specimen-body-lock {
  flex: 1;
  overflow: hidden;
}

.spec-book-heading,
#reflow-spec-body h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18.5px;
  margin-bottom: 8px;
  color: var(--book-ink);
}

.specimen-passage,
#reflow-spec-body p {
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.56;
  color: var(--book-ink);
}

.specimen-page[data-spec-mode="raw"] {
  background: #FFFFFF;
  color: #181818;
}

.specimen-page[data-spec-mode="raw"] .spec-book-heading,
#reflow-specimen-page[data-spec-mode="raw"] #reflow-spec-body h2 {
  font-family: 'Times New Roman', Times, serif;
  font-style: normal;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.specimen-page[data-spec-mode="raw"] .specimen-passage,
#reflow-specimen-page[data-spec-mode="raw"] #reflow-spec-body p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12px;
  line-height: 1.38;
  column-count: 2;
  column-gap: 18px;
  text-align: justify;
}

.specimen-folio {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--book-muted);
  padding-top: 10px;
  flex: none;
}

.specimen-nav-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #1A1916;
  color: #F3F0EA;
  border: 1px solid rgba(243, 240, 234, 0.2);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.specimen-frame.is-revealed .specimen-nav-overlay {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spec-nav-divider {
  width: 1px;
  height: 13px;
  background: rgba(243, 240, 234, 0.2);
}

.spec-nav-action {
  color: #C2BCB2;
}

.specimen-footer {
  position: relative;
  z-index: 2;
  margin-top: 16px;
  min-height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.specimen-status {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.specimen-toggle-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 99px;
  transition: background 0.15s, border-color 0.15s;
}

.specimen-toggle-btn:hover {
  background: var(--surface-elevated);
  border-color: var(--ink-secondary);
}

/* Row 03: Markdown Box */
.markdown-preview-box {
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  overflow: hidden;
  height: 256px;
  display: flex;
  flex-direction: column;
}

.md-file-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}

.md-filename {
  font-weight: 500;
  color: var(--ink);
}

.md-path {
  color: var(--ink-muted);
}

.md-content {
  padding: 18px 22px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ink);
  white-space: pre-wrap;
}

.md-h {
  color: var(--ink);
  font-weight: 500;
}

.md-q {
  color: var(--ink-secondary);
  font-style: italic;
}

/* ============================================================================
   PRICING: CLEAN STACKED LIST ITEMS (ZERO DASHES)
   ============================================================================ */
.pricing-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 32px 112px;
  border-top: 1px solid var(--hairline);
}

.pricing-intro {
  max-width: 560px;
  margin: 0 auto 48px;
  text-align: center;
}

.pricing-intro h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 3.8vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--ink);
}

.pricing-intro p {
  font-size: 16px;
  color: var(--ink-secondary);
}

.pricing-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.price-card {
  background: var(--mat);
  border: 1px solid var(--mat-border);
  border-radius: 16px;
  padding: 36px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price-card-plus {
  background: var(--surface);
  border-color: var(--hairline-strong);
}

.price-card-top,
.price-card-bottom {
  position: relative;
  z-index: 2;
}

.price-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.price-tier-header h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  color: var(--ink);
}

.price-amount-group {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.price-amount {
  font-family: var(--font-serif);
  font-size: 34px;
  color: var(--ink);
}

.price-period {
  font-size: 13px;
  color: var(--ink-muted);
}

.price-tagline {
  margin-top: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14.5px;
  color: var(--ink-secondary);
}

.muted-inline {
  color: var(--ink-muted);
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.price-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-list strong {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}

.price-list span {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.price-card-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.price-note {
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* ============================================================================
   FOOTER & DIALOG
   ============================================================================ */
.contact-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 64px 32px;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  scroll-margin-top: 32px;
}
.contact-eyebrow { margin: 0 0 16px; font-size: 10px; letter-spacing: .16em; color: var(--ink-muted); }
.contact-heading h2 { margin: 0; font: 400 36px/1.15 var(--font-serif); letter-spacing: -.02em; }
.contact-copy { align-self: center; font-size: 14px; line-height: 1.7; color: var(--ink-secondary); }
.contact-copy p { margin: 0 0 14px; }
.contact-email { display: inline-block; margin: 0 0 16px; color: var(--ink); font-size: 16px; text-decoration-thickness: 1px; text-underline-offset: 5px; overflow-wrap: anywhere; }
.interest-privacy-body a { color: inherit; overflow-wrap: anywhere; text-underline-offset: 3px; }
.contact-copy .contact-note { margin-bottom: 0; font-size: 12px; color: var(--ink-muted); }
@media (max-width: 640px) {
  .contact-section { grid-template-columns: 1fr; gap: 24px; padding: 40px 24px; }
}
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 32px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-links a, .footer-dl-link {
  text-decoration: none;
  color: var(--ink-secondary);
  background: none;
  border: 0;
  padding: 0;
}

.footer-links a:hover, .footer-dl-link:hover {
  color: var(--ink);
}

/* A compact invitation, set like a page rather than a settings panel. */
.quiet-dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--hairline-strong); border-radius: 8px;
  background: var(--canvas); color: var(--ink);
  box-shadow: 0 32px 100px rgba(0,0,0,.4);
}
.quiet-dialog::backdrop { background: rgba(10,10,8,.64); backdrop-filter: blur(6px); }
.dialog-inner { position: relative; padding: 36px 32px 24px; }
.interest-close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--ink-muted);
}
.interest-close svg { width: 18px; height: 18px; }
.interest-close:hover { color: var(--ink); background: var(--surface); }
.interest-eyebrow { margin: 0 0 18px; color: var(--ink-muted); font-size: 10px; font-weight: 500; letter-spacing: .15em; }
#dialog-title { margin: 0; font: 400 32px/1.15 var(--font-serif); letter-spacing: -.025em; }
.dialog-copy { margin: 12px 0 24px; max-width: 100%; font-size: 14px; line-height: 1.65; color: var(--ink-secondary); }
.interest-label { display: block; margin-bottom: 9px; font-size: 12px; color: var(--ink-secondary); }
.interest-fields input {
  display: block; width: 100%; height: 50px; padding: 0 14px; border-radius: 4px;
  border: 1px solid var(--hairline-strong); background: var(--surface-subtle);
  color: var(--ink); font: 400 16px var(--font-sans); transition: border-color .15s;
}
.interest-fields input::placeholder { color: var(--ink-muted); opacity: .7; }
.interest-fields input:focus { outline: none; border-color: var(--ink-secondary); }
.interest-consent { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 22px; font-size: 11px; line-height: 1.65; color: var(--ink-muted); }
.interest-consent input { flex: 0 0 14px; width: 14px; height: 14px; margin: 2px 0 0; accent-color: var(--ink-secondary); }
.interest-submit {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 48px;
  padding: 0 16px; border: 0; border-radius: 4px; background: var(--btn-bg); color: var(--btn-fg);
  font: 500 13px var(--font-sans); cursor: pointer;
}
.interest-submit:hover { background: var(--btn-hover); }
.interest-submit span { font-size: 20px; font-weight: 400; }
.interest-submit:disabled { opacity: .6; cursor: wait; }
.interest-status { margin: 16px 0 0; font-size: 13px; line-height: 1.6; }
.interest-status:empty { display: none; }
.interest-status[data-state="error"] { border-left: 2px solid var(--accent-ribbon); padding-left: 12px; }
.interest-privacy { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); font-size: 11px; line-height: 1.7; color: var(--ink-muted); }
.interest-privacy summary { cursor: pointer; }
.interest-privacy p { margin: 12px 0 0; }
.interest-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 480px) {
  .dialog-inner { padding: 34px 26px 22px; }
  #dialog-title { font-size: 30px; }
  .header-actions .btn-sm { padding-inline: 12px; }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 980px) {
  .reading-mat {
    padding: 28px 24px 22px;
  }
  .prev-edge { left: 8px; }
  .next-edge { right: 8px; }
  .book-object,
  .qf-book-spread {
    grid-template-columns: 1fr;
  }
  .leaf-verso, .qf-left, .spine-shadow {
    display: none;
  }
  .leaf-recto {
    border-radius: 6px;
  }
  .turning-page {
    width: 100%;
  }
  .mat-bar {
    flex-direction: column;
    gap: 16px;
  }
  .editorial-row,
  .pricing-pair {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }
  .header-nav {
    display: none;
  }
  .page-leaf {
    padding: 32px 26px;
  }
  .book-switcher {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep the demo invitation and controls visible before the book. */
.demo-link { color: var(--ink-secondary); font-size: 14px; text-underline-offset: 5px; }
.demo-link:hover { color: var(--ink); }
.demo-hint { position: relative; z-index: 2; color: var(--ink-secondary); font-size: 13px; margin: 0 0 14px; }
.mat-bar { flex-wrap: wrap; }
.mat-controls { flex-wrap: wrap; }
.type-popover { top: 14px; bottom: auto; }
.footer-inner { justify-content: center; }
.footer-links { flex-wrap: wrap; justify-content: center; }
.qf-page { min-width: 0; min-height: 0; }
.qf-body { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.qf-body h5 { font-size: 1.16em; font-weight: 400; margin: 0 0 .65em; }
.qf-body .pdf-sheet-list { font-size: inherit; line-height: inherit; }
.qf-body .pdf-sheet-foot { font-size: 11px; }
.qf-body .pdf-sheet-figure { break-inside: avoid; }
@media (max-width: 980px) {
  .qf-left { display: flex; }
  .qf-right { display: none; }
}
@media (max-width: 640px) {
  .quiet-fullscreen-mock { padding: 24px 36px; }
  .qf-page { padding: 24px 20px; }
  .qf-edge-prev { left: 2px; }
  .qf-edge-next { right: 2px; }
  .mat-controls { justify-content: center; }
}

.price-pending { font-size: 25px; white-space: nowrap; }
.cloud-plan { padding: 18px 0; border-top: 1px solid var(--hairline); color: var(--ink-secondary); font-size: 13px; line-height: 1.6; }
.cloud-plan strong { color: var(--ink); font-weight: 500; }

/* PDF content stays fixed when zooming; only the paper is scaled. */
.chrome-viewer-mock .pdf-sheet-cols { flex: 1; align-content: start; }
.chrome-viewer-mock .pdf-sheet-code { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; font-size: 9px; }
.chrome-viewer-mock .pdf-sheet-list { font-size: 13px; line-height: 1.45; }
.chrome-viewer-mock .pdf-sheet-head { margin-bottom: 28px; }

/* A paper library card, independent of the room's light setting. */
#interest-dialog {
  --ink: #302d26; --ink-secondary: #59554a; --ink-muted: #6c665a;
  --hairline: rgba(59,48,31,.18); --hairline-strong: rgba(59,48,31,.36);
  --surface: #e9e1d0; --surface-subtle: transparent;
  --btn-bg: #333a30; --btn-fg: #f8f3e7; --btn-hover: #454e40;
  color-scheme: light; background: #f1eadb; border: 0; border-radius: 3px;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(69,53,25,.018) 3px 4px);
}
#interest-dialog .dialog-inner { padding: 42px 36px 26px; overflow: hidden; }
.interest-bookmark { position: absolute; top: 0; right: 68px; width: 22px; height: 44px; background: #984737; clip-path: polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }
#interest-dialog .interest-eyebrow { font-size: 9px; letter-spacing: .17em; margin-bottom: 26px; }
#interest-dialog #dialog-title { font-size: 52px; line-height: .98; margin: 0 0 30px; letter-spacing: -.035em; }
#interest-dialog #dialog-title em { font-weight: 400; }
#interest-dialog .interest-label { font-size: 11px; }
#interest-dialog .interest-fields input { padding: 0 0 6px; height: 42px; border: 0; border-bottom: 1px solid var(--hairline-strong); border-radius: 0; font-family: var(--font-serif); font-size: 22px; }
#interest-dialog .interest-fields input:focus { border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
#interest-dialog .interest-consent { margin: 18px 0 22px; font-size: 11px; }
#interest-dialog .interest-submit { justify-content: center; height: 44px; border-radius: 2px; }
#interest-dialog .interest-privacy { margin-top: 22px; padding-top: 17px; }
#interest-dialog .interest-privacy summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 24px; list-style: none; font-size: 11px;
}
#interest-dialog .interest-privacy summary::-webkit-details-marker { display: none; }
.interest-colophon { font: italic 16px/1.4 var(--font-serif); color: var(--ink-secondary); }
.interest-privacy-toggle { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; }
.interest-privacy-mark { position: relative; width: 9px; height: 9px; }
.interest-privacy-mark::before, .interest-privacy-mark::after { content: ''; position: absolute; background: currentColor; }
.interest-privacy-mark::before { top: 4px; left: 0; width: 9px; height: 1px; }
.interest-privacy-mark::after { top: 0; left: 4px; height: 9px; width: 1px; }
.interest-privacy[open] .interest-privacy-mark::after { display: none; }
#interest-dialog .interest-privacy summary:hover .interest-privacy-toggle { color: var(--ink); }
#interest-dialog .interest-privacy summary:focus-visible { outline: 1px solid var(--ink-secondary); outline-offset: 4px; }
.interest-privacy-body { margin-top: 16px; padding-top: 3px; max-width: 36em; }
#interest-dialog .interest-privacy-body p { margin: 0 0 10px; font-size: 12px; line-height: 1.7; }
#interest-dialog .interest-privacy-body p:last-child { margin-bottom: 0; }
#interest-dialog .interest-close:focus-visible, #interest-dialog .interest-submit:focus-visible { outline: 2px solid #984737; outline-offset: 3px; }
@media (max-width: 480px) {
  #interest-dialog .dialog-inner { padding: 38px 28px 24px; }
  #interest-dialog #dialog-title { font-size: 46px; }
}

/* Mobile reading and browsing: compact controls, natural text height, swipe plans. */
.mobile-book-picker, .pricing-mobile-nav { display: none; }
@media (max-width: 640px) {
  .header-inner { height: 60px; padding: 0 20px; }
  .wordmark { font-size: 20px; }
  .wordmark-logo { width: 100px; }
  .header-actions { gap: 8px; }
  .header-actions .btn-sm { height: 36px; font-size: 12px; }
  .hero { padding: 24px 20px 20px; }
  .hero-composition { padding: 26px 0 24px; gap: 18px; }
  .hero-subtitle { font-size: 13px; line-height: 1.65; margin-bottom: 20px; }
  .hero-invitation { padding: 20px; }
  .hero-card-title { font-size: 30px; margin-bottom: 12px; }
  .hero-card-label { margin-bottom: 12px; }
  .hero-meta { margin-bottom: 14px; }
  .hero-bottom { padding-top: 15px; gap: 8px; }
  .hero-page-note { font-size: 15px; }
  .desk-section { padding: 0 16px 32px; }
  .reading-mat { padding: 16px 14px 12px; border-radius: 12px; }
  .demo-hint { font-size: 11px; line-height: 1.5; margin-bottom: 12px; }
  .mat-bar { align-items: stretch; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; }
  .book-switcher { display: none; }
  .mobile-book-picker { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--ink-muted); }
  .mobile-book-picker select { min-width: 0; flex: 1; min-height: 36px; padding: 6px 8px; border: 1px solid var(--hairline-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font: 14px var(--font-serif); }
  .mat-controls { justify-content: space-between; flex-wrap: nowrap; gap: 5px; }
  .mode-btn { font-size: 11px; padding: 6px 8px; }
  .book-stage { padding-bottom: 48px; }
  .book-object { height: 420px; min-width: 0; }
  .page-leaf { padding: 24px 20px 18px; min-height: 0; }
  .page-running-header { font-size: 10px; margin-bottom: 14px; padding-bottom: 12px; gap: 16px; }
  .page-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .page-edge-nav, .page-edge-nav:hover:not(:disabled) { top: auto; bottom: 0; transform: none; width: 36px; height: 36px; }
  .prev-edge { left: calc(50% - 44px); }
  .next-edge { right: calc(50% - 44px); }
  .compare-section { padding: 24px 20px 32px; }
  .compare-header { gap: 16px; margin-bottom: 18px; }
  .compare-header h2 { font-size: 29px; margin-bottom: 10px; }
  .compare-header p { font-size: 13px; }
  .compare-actions { gap: 8px; }
  .compare-viewport:not(.is-fullscreen) { height: 440px; border-radius: 10px; }
  .principles-section { padding: 0 20px 8px; }
  .editorial-row { padding: 28px 0; gap: 20px; }
  .chapter-num { font-size: 13px; margin-bottom: 8px; }
  .editorial-text h2 { font-size: 28px; margin-bottom: 12px; }
  .editorial-text p { font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
  .editorial-visual { min-width: 0; }
  .specimen-frame { padding: 12px; border-radius: 10px; }
  .markdown-preview-box { height: auto; min-width: 0; }
  .md-file-bar { padding: 10px 12px; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; }
  .md-content { margin: 0; padding: 14px 12px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
  .pricing-section { padding: 28px 20px 32px; }
  .pricing-intro { margin: 0 0 20px; text-align: left; }
  .pricing-intro h2 { font-size: 30px; margin-bottom: 10px; }
  .pricing-intro p { font-size: 13px; line-height: 1.65; }
  .pricing-mobile-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
  .pricing-mobile-nav button { min-height: 36px; padding: 7px 11px; border: 1px solid var(--hairline-strong); border-radius: 5px; font-size: 11px; color: var(--ink-secondary); background: transparent; }
  .pricing-mobile-nav button[aria-pressed="true"] { color: var(--btn-fg); background: var(--btn-bg); border-color: var(--btn-bg); }
  .pricing-mobile-nav span { margin-left: auto; font-size: 10px; color: var(--ink-muted); }
  .pricing-pair { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 0 0 10px; align-items: flex-start; }
  .price-card { flex: 0 0 calc(100% - 16px); min-width: 0; padding: 20px 18px; border-radius: 10px; scroll-snap-align: start; }
  .pricing-pair::after { content: ''; flex: 0 0 4px; }
  .price-tier-header { gap: 10px; flex-wrap: wrap; }
  .price-tier-header h3 { font-size: 24px; }
  .price-amount, .price-pending { font-size: 25px; }
  .price-period { font-size: 11px; }
  .price-tagline { font-size: 12px; line-height: 1.6; margin-top: 8px; padding-bottom: 14px; }
  .price-list { margin: 14px 0 20px; gap: 10px; }
  .price-list strong { font-size: 12px; }
  .price-list span { font-size: 11px; line-height: 1.5; }
  .cloud-plan { font-size: 11px; padding: 12px 0; }
  .price-card-bottom { gap: 8px; }
  .price-card-bottom button { height: 38px; font-size: 12px; }
  .price-note { font-size: 10px; }
  .contact-section { padding: 28px 20px; gap: 18px; }
  .contact-heading h2 { font-size: 28px; }
  .contact-copy { font-size: 13px; }
  .site-footer { padding: 24px 20px; }
  .footer-links { gap: 14px 20px; font-size: 12px; }
}

@media (max-width: 640px) {
  .page-running-header { padding-right: 34px; }
  .pricing-pair { overflow-y: hidden; overflow-anchor: none; }
}

/* Touch layouts retain the full reader and PDF content. */
.price-card[hidden] { display: none !important; }
@media (max-width: 640px) {
  body { overflow-anchor: none; }
  #reading-mat, .compare-section { display: block; }
  .desktop-key-hint, .fs-top-controls kbd { display: none; }
  .hero-page-note, .hero-card-note { display: none; }
  .pricing-shell { padding: 16px 20px 22px; background: var(--mat); border: 1px solid var(--mat-border); border-radius: 14px; }
  .pricing-mobile-nav { display: flex; gap: 0; padding: 4px; margin: 0 0 22px; background: var(--surface-subtle); border: 1px solid var(--hairline); border-radius: 999px; }
  .pricing-mobile-nav button { flex: 1; min-height: 38px; border: 0; border-radius: 999px; font-size: 12px; background: transparent; }
  .pricing-mobile-nav button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); }
  .pricing-pair { display: block; overflow: visible; height: auto !important; padding: 0; }
  .pricing-pair::after { display: none; }
  .price-card { width: 100%; padding: 0; border: 0; background: transparent; border-radius: 0; }
  .price-tier-header { flex-wrap: wrap; }
  .price-tier-header h3 { font-size: 25px; }
  .price-tagline { display: block; font-size: 13px; }
  .plan-details { display: block; }
  .price-list { margin: 16px 0 22px; gap: 12px; }
  .price-list strong { font-size: 13px; }
  .price-list span { font-size: 12px; }
  .price-card-bottom button { height: 42px; }
  .price-note { font-size: 11px; }
  .cloud-plan { font-size: 12px; }
  .book-object { height: clamp(430px, 60svh, 530px); }
  .page-content { scrollbar-width: none; }
  .page-content::-webkit-scrollbar { display: none; }
  .specimen-footer { flex-wrap: wrap; gap: 10px; }
  .specimen-toggle-btn { min-height: 40px; }
  .specimen-status { font-size: 11px; }
  .chrome-tabs-bar, .chrome-url-bar, .chrome-thumb-rail { display: none; }
  .chrome-viewer-mock .chrome-pdf-body { grid-template-columns: minmax(0, 1fr); }
  .chrome-viewer-mock .chrome-pdf-toolbar { height: 46px; }
  .chrome-canvas-well { padding: 12px; scrollbar-width: none; }
  .chrome-canvas-well::-webkit-scrollbar { display: none; }
  .chrome-pages-stack { width: 100%; min-width: 0; gap: 12px; }
  .compare-viewport:not(.is-fullscreen) { height: 500px; }
  .quiet-fullscreen-mock { padding: 20px 30px; }
  .qf-body { scrollbar-width: none; }
  .qf-body::-webkit-scrollbar { display: none; }
}

/* Source notes and policy pages follow the site's quiet editorial typography. */
.sample-credit { margin: -8px 0 24px; font-size: 11px; line-height: 1.6; color: var(--ink-muted); text-align: center; }
.sample-credit a { color: inherit; text-underline-offset: 3px; }
.chrome-viewer-mock .pdf-sheet-cols { grid-template-columns: 1fr; font-size: 17px; line-height: 1.7; }
.pdf-sheet-cols h2 { font: 700 21px/1.3 'Times New Roman', serif; margin: 0 0 18px; }
.legal-page { max-width: 760px; margin: 0 auto; padding: 64px 28px 96px; color: var(--ink-secondary); font-size: 16px; line-height: 1.8; }
.legal-page h1 { margin: 32px 0 20px; font: 400 48px/1.15 var(--font-serif); color: var(--ink); }
.legal-page h2 { margin: 32px 0 12px; font: 400 27px/1.3 var(--font-serif); color: var(--ink); }
.legal-page p, .legal-page ul { margin-bottom: 18px; }
.legal-page a { color: inherit; text-underline-offset: 4px; }
.legal-page li { margin-bottom: 12px; }
.legal-page .policy-date { font-size: 12px; color: var(--ink-muted); }

@media (max-width: 980px) {
  .qf-left { display: flex; }
  .qf-right { display: none; }
}
/* Review refinements: compact controls, clear invitations, and pages that fit. */
.header-left { display: flex; align-items: center; align-self: stretch; }
.wordmark { height: 100%; line-height: 1; }
.wordmark-logo { transform: translateY(1px); }
.hero-signup { background: #333a30; color: #fffaf0; border-color: #333a30; border-radius: 3px; padding: 13px 12px; box-shadow: 0 2px 4px #302b2020; }
.hero-signup:hover { background: #454e40; color: #fffaf0; }
.hero-signup:focus-visible { outline: 2px solid #333a30; outline-offset: 4px; }
.reader-intro { margin: 0 0 24px; text-align: left; max-width: 40em; }
.reader-intro h2 { margin: 0 0 8px; font: 400 25px/1.2 var(--font-serif); color: var(--ink); }
.reader-intro p { margin: 0 0 7px; font-size: 13px; line-height: 1.6; color: var(--ink-secondary); }
.reader-intro a { font-size: 11px; color: var(--ink-muted); text-underline-offset: 3px; }
.reader-tools { display: flex; align-items: center; gap: 8px; }
.mat-controls { gap: 12px; }
.bookmark-ribbon { right: 18px; width: 14px; }
.bookmark-ribbon.is-marked { height: 34px; }
.leaf-recto .page-running-header { padding-right: 28px; }
.page-content { min-height: 0; overflow: hidden; overflow-wrap: anywhere; }
.pdf-layout { column-count: 1; font-size: var(--page-size, 16.5px); line-height: 1.6; text-align: left; }
.book-stage { touch-action: pan-y pinch-zoom; }
.chrome-viewer-mock .pdf-sheet-cols { min-height: 0; overflow: hidden; }
.chrome-canvas-well { overscroll-behavior: none; touch-action: pan-x pan-y pinch-zoom; }
.qf-body { overflow: hidden; }
.back-to-top { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--hairline-strong); border-radius: 5px; }
@media (max-width: 640px) {
  .reader-intro { margin-bottom: 20px; }
  .reader-intro h2 { font-size: 22px; }
  .reader-intro p { font-size: 12px; }
  .reader-intro a { font-size: 10px; }
  .mobile-book-picker { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .mobile-book-picker select { appearance: none; width: 100%; padding: 9px 38px 9px 12px; min-height: 40px; background-image: linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%); background-position: calc(100% - 17px) 17px,calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
  .mat-controls { justify-content: flex-start; gap: 8px; }
  .reader-tools { margin-left: auto; gap: 6px; }
  .mat-pill { padding-inline: 10px; }
  .book-object { height: clamp(430px, 66svh, 580px); }
  .page-content { overflow: hidden; }
  .page-running-header { padding-right: 0; }
  .leaf-recto .page-running-header { padding-right: 28px; }
}
@media (max-width: 640px) {
  .mat-bar, .mat-controls, .mobile-book-picker { min-width: 0; max-width: 100%; }
  .mobile-book-picker { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .mat-controls { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .reader-tools { margin-left: 0; }
  .mat-controls { gap: 10px; }
  .leaf-recto .page-running-header { gap: 10px; }
  .page-running-header span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-running-header span:last-child { flex-shrink: 0; }
}
/* Running heads occupy a fixed line so titles never change the text capacity. */
.page-running-header { height: 36px; min-height: 36px; line-height: 1.3; }
.page-running-header span { min-width: 0; max-width: 54%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-running-header span:last-child { max-width: 44%; flex-shrink: 1; }
.page-folio { height: 36px; min-height: 36px; }
/* Keep comparison navigation together, below the paper, at every screen size. */
.quiet-fullscreen-mock { flex-direction: column; gap: 14px; padding: 24px 36px 16px; }
.qf-book-spread { flex: 1; min-height: 0; max-height: 520px; }
.qf-navigation { display: flex; justify-content: center; align-items: center; gap: 12px; flex: none; min-height: 36px; }
.qf-navigation .page-edge-nav, .qf-navigation .page-edge-nav:hover:not(:disabled) { position: static; inset: auto; transform: none; width: 36px; height: 36px; }
.qf-page-counter { min-width: 40px; text-align: center; font-size: 11px; color: #b8b5ac; font-variant-numeric: tabular-nums; }
.compare-viewport.is-fullscreen .qf-book-spread { flex: 1; height: auto; max-height: min(700px, calc(100dvh - 130px)); }
/* The controls specimen shows a whole reading page and a separate tray below it. */
#tab-demo-card .specimen-page { height: 400px; }
#controls-specimen-body { min-height: 0; overflow: hidden; }
#controls-specimen-body .specimen-passage { margin: 0 0 .8em; }
#controls-specimen-body .specimen-passage:last-child { margin-bottom: 0; }
.specimen-navigation-slot { display: flex; justify-content: center; align-items: center; height: 54px; padding-top: 12px; }
#tab-demo-card .specimen-nav-overlay { position: static; bottom: auto; left: auto; transform: translateY(5px); padding: 9px 14px; }
#tab-demo-card.is-revealed .specimen-nav-overlay { transform: translateY(0); }
#tab-demo-card .specimen-footer { margin-top: 12px; }
@media (max-width: 640px) {
  .quiet-fullscreen-mock { padding: 20px 30px 12px; gap: 12px; }
  #tab-demo-card .specimen-page { height: clamp(380px, 52svh, 460px); padding: 24px 22px 18px; }
  #tab-demo-card .specimen-header { gap: 12px; }
  #tab-demo-card .specimen-header span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #tab-demo-card .specimen-header span:last-child { flex-shrink: 0; }
}
/* A custom, keyboard-accessible book list rather than the platform select menu. */
.mobile-book-picker { position: relative; }
.book-picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--hairline-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: 15px var(--font-serif); text-align: left; }
.book-picker-trigger > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.book-picker-trigger > svg { width: 18px; height: 18px; flex: none; transition: transform .15s; }
.book-picker-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); }
.book-picker-trigger[aria-expanded="true"] { border-color: var(--ink-muted); }
.book-picker-options { position: absolute; z-index: 50; top: calc(100% + 7px); left: 0; right: 0; padding: 5px; border: 1px solid var(--hairline-strong); border-radius: 8px; background: var(--mat); box-shadow: 0 12px 32px #0007; }
.book-picker-options[hidden] { display: none; }
.book-picker-options > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 62px; padding: 10px; border: 0; border-radius: 4px; color: var(--ink-secondary); background: transparent; text-align: left; }
.book-picker-options strong { display: block; font: 400 16px/1.25 var(--font-serif); }
.book-picker-options small { display: block; margin-top: 5px; font: 10px/1.3 var(--font-sans); color: var(--ink-muted); }
.book-picker-options svg { width: 18px; height: 18px; flex: none; opacity: 0; }
.book-picker-options [aria-selected="true"] { background: var(--surface); color: var(--ink); }
.book-picker-options [aria-selected="true"] svg { opacity: 1; }
.book-picker-options > button:hover, .book-picker-options > button:focus-visible { background: var(--surface); outline: 1px solid var(--hairline-strong); outline-offset: -1px; }
.mat-bar { position: relative; z-index: 25; }
.book-picker-options[data-side="above"] { top: auto; bottom: calc(100% + 7px); }
#reading-mat:has(#sample-book-options:not([hidden])) { overflow: visible; z-index: 40; }
/* Newsreader's visible letterforms sit above its line-box centre. */
.book-picker-trigger { min-height: 42px; padding: 0 12px; line-height: 1.4; }
.book-picker-trigger > span { display: block; transform: translateY(2px); }
