/*
 * LongText reader styles (WEB-004/005/011, READER-WEB-004).
 *
 * - No external fonts or resources (WEB-011): system font stacks only.
 * - Light/dark/system theming via prefers-color-scheme (WEB-005); the forced
 *   themes are applied as classes on <html> by main.ts (CSP forbids inline
 *   style attributes, so everything is class-driven).
 * - Comfortable reading width (READER-WEB-004) with responsive typography.
 */

:root {
  --bg: #f6f3ec;
  --fg: #201d19;
  --muted: #6b655b;
  --accent: #16594e;
  --panel-bg: #fffdf8;
  --border: #ddd5c6;
  --mark-bg: #f5e373;
  --btn-bg: #efe9dc;
  --btn-fg: #201d19;
  --content-width: 40rem;
  --font-size: 18px;
  --line-height: 1.65;
  /* Fixed chrome bar height, safe-area aware (first env() use in file). */
  --chrome-h: calc(2.6rem + env(safe-area-inset-top, 0px));
  --serif-stack: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans-stack: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* System dark mode (default theme is "system"). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181f;
    --fg: #e7e2d9;
    --muted: #98a1ac;
    --accent: #7fc7ab;
    --panel-bg: #19212b;
    --border: #2b3542;
    --mark-bg: #6b5d1e;
    --btn-bg: #24303c;
    --btn-fg: #e7e2d9;
  }
}

/* Forced themes override the media query (WEB-005). */
html.theme-light {
  --bg: #f6f3ec;
  --fg: #201d19;
  --muted: #6b655b;
  --accent: #16594e;
  --panel-bg: #fffdf8;
  --border: #ddd5c6;
  --mark-bg: #f5e373;
  --btn-bg: #efe9dc;
  --btn-fg: #201d19;
}

html.theme-dark {
  --bg: #12181f;
  --fg: #e7e2d9;
  --muted: #98a1ac;
  --accent: #7fc7ab;
  --panel-bg: #19212b;
  --border: #2b3542;
  --mark-bg: #6b5d1e;
  --btn-bg: #24303c;
  --btn-fg: #e7e2d9;
}

/* Font-size and line-height levels (READER-WEB-005/007). */
.reader.fs-1 { --font-size: 16px; }
.reader.fs-2 { --font-size: 18px; }
.reader.fs-3 { --font-size: 21px; }
.reader.lh-1 { --line-height: 1.45; }
.reader.lh-2 { --line-height: 1.65; }
.reader.lh-3 { --line-height: 1.95; }

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans-stack);
  font-size: var(--font-size);
  line-height: var(--line-height);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 50; /* above the fixed chrome bar (45) so focus reveals it */
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 0 0 0.5rem 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.site-head {
  padding: 1.25rem 1.5rem 0.25rem;
}

.site-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app {
  /* Landing page padding (reader.html's #app.app clears the fixed chrome
     bar on top of this). */
  padding: 1rem 1.5rem 4rem;
}

#app.app {
  /* Reader-page only: top padding clears the fixed chrome bar in scroll
     mode (paged mode overrides its own padding below). */
  padding: calc(var(--chrome-h) + 1rem) 1.5rem 4rem;
}

.panel {
  max-width: var(--content-width);
  margin: 3rem auto 0;
  padding: 2rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.panel-note {
  margin: 0 0 1rem;
  color: var(--muted);
}

.reader {
  max-width: 56rem;
  margin: 0 auto;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.toolbar-group {
  display: inline-flex;
  gap: 0.25rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 0.4rem;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.progress {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  color: var(--muted);
}

.progress-pct {
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  text-align: right;
}

progress.progress-bar {
  width: 8rem;
  height: 0.6rem;
  accent-color: var(--accent);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.search-row input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}

.search-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.reader-content {
  /* Comfortable reading width (READER-WEB-004). */
  max-width: var(--content-width);
  margin: 0 auto;
  font-size: var(--font-size);
  line-height: var(--line-height);
  /* Preserve the plaintext exactly as decrypted (PROTOCOL §6.1): single
     newlines inside a paragraph stay visible. */
  white-space: pre-wrap;
  /* break-word (not `anywhere`): a long token may split ONLY when it cannot
     fit on a line by itself — normal words never break mid-word. Hyphenation
     does the rest on supported engines (needs lang="en" on <html>). */
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.reader.serif .reader-content {
  font-family: var(--serif-stack);
}

.reader-content p {
  margin: 0 0 1.1em;
}

.reader-content p:last-child {
  margin-bottom: 0;
}

/* Client-side markdown blocks (MARKDOWN-WEB-001): headings, code, lists,
   quotes, rules, and links share the reading theme. Code stays monospaced
   even in serif mode because pre/code declare their own font stack. */
.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4,
.reader-content h5,
.reader-content h6 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
}

.reader-content h1 { font-size: 1.7em; }
.reader-content h2 { font-size: 1.45em; }
.reader-content h3 { font-size: 1.25em; }
.reader-content h4 { font-size: 1.1em; }
.reader-content h5 { font-size: 1em; }
.reader-content h6 {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reader-content pre {
  margin: 0 0 1.1em;
  padding: 0.75rem 0.9rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  white-space: pre; /* fence content must not soft-wrap like prose */
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

.reader-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--panel-bg);
  border-radius: 0.2em;
  padding: 0.05em 0.25em;
}

.reader-content pre code {
  padding: 0;
  background: none;
}

.reader-content blockquote {
  margin: 0 0 1.1em;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.reader-content blockquote p {
  margin: 0 0 0.5em;
}

.reader-content blockquote p:last-child {
  margin-bottom: 0;
}

.reader-content ul,
.reader-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

.reader-content li {
  margin: 0 0 0.35em;
}

.reader-content hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.reader-content a {
  color: var(--accent);
  text-decoration: underline;
}

mark {
  background: var(--mark-bg);
  color: inherit;
  border-radius: 0.15em;
}

.share-warning {
  max-width: var(--content-width);
  margin: 2.5rem auto 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.copy-status {
  display: block;
  max-width: var(--content-width);
  margin: 0.75rem auto 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

/* Responsive typography and layout (WEB-004). */
@media (max-width: 640px) {
  body {
    font-size: calc(var(--font-size) * 0.95);
  }

  .app {
    padding: 0.5rem 0.75rem 3rem; /* landing */
  }

  #app.app {
    /* Mobile reader: keep clearing the fixed chrome (header is fixed at
       every width). */
    padding: calc(var(--chrome-h) + 0.5rem) 0.75rem 3rem;
  }

  .panel {
    margin-top: 1.5rem;
    padding: 1.25rem;
  }

  .reader-toolbar {
    gap: 0.375rem;
  }

  .progress {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  progress.progress-bar {
    flex: 1;
  }
}

@media print {
  .reader-toolbar,
  .search-row,
  .share-warning,
  .site-head {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
/* ------------------------------------------------------------------ */
/* Paged reading mode (html.paged): Kindle-style fixed viewport with
   horizontal page columns. Class-driven — no inline styles (CSP). */

.paged-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 30;
}

.paged-zone-prev {
  left: 0;
  width: 33.334vw;
}

.paged-zone-next {
  right: 0;
  width: 33.334vw;
}

.paged-zone-chrome {
  left: 33.334vw;
  width: 33.334vw;
}

.page-indicator {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  min-width: 3.4rem;
  text-align: center;
}

.page-stats {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.page-stats-sep {
  color: var(--muted);
}

html.paged {
  overflow: hidden;
}

html.paged body {
  height: 100dvh;
  overflow: hidden;
}

/* Immersed reading: header and the trailing notes collapse away. */
html.paged .site-head {
  display: none;
}

html.paged .share-warning,
html.paged .copy-status {
  display: none;
}

html.paged .app {
  height: 100dvh;
  padding: calc(var(--chrome-h) + 0.4rem) 0.75rem 3.2rem;
  display: flex;
  flex-direction: column;
}

html.paged .reader {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* The content element becomes the page scroller: one CSS column = one
   page, stepped by exactly clientWidth + gap. column-width needs a
   definite length (no percentages), so the same min() expression sets
   both the element width and the column width — they must match or the
   page stepping drifts. */
html.paged .reader-content {
  flex: 1 1 auto;
  min-height: 0;
  width: min(100vw - 1.5rem, 40rem);
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  column-width: min(100vw - 1.5rem, 40rem);
  column-gap: 3rem;
  column-fill: auto;
  padding-bottom: 1.75rem;
}

html.paged .reader-content::-webkit-scrollbar {
  display: none;
}

/* Controls overlay open: zones yield the pointer so selection/copy works. */
html.paged.chrome-open .paged-zone {
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Unified chrome (both modes): one fixed header (icon + quick search +
   hamburger) and two dropdown panels (hamburger menu, quick search)
   hanging from it. Scroll mode slides the whole header away on sustained
   down-scroll (html.chrome-autohide); paged mode never carries that
   class. Slide-out is transform-only: no layout shift, content never
   reflows. */

.top-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--chrome-h);
  padding: env(safe-area-inset-top, 0) 0.6rem 0;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}

/* Icon stays top-left; the actions hug the right edge. */
.top-chrome #search-quick {
  margin-left: auto;
}

.brand-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  border-radius: 0.5rem;
  padding: 0.2rem;
  line-height: 0;
  cursor: pointer;
}

.brand-chip img {
  display: block;
  border-radius: 0.35rem;
}

.menu-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.menu-btn svg {
  display: block; /* icon fills the line box like the hamburger glyph */
}

.top-chrome,
.search-row {
  transition: transform 0.25s ease;
}

/* Scroll mode only: sustained downward scroll slides the entire header
   (icon, search, hamburger) away; the quick-search dropdown slides out
   with it. */
html:not(.paged).chrome-autohide .top-chrome {
  transform: translateY(-100%);
  pointer-events: none;
}

html:not(.paged).chrome-autohide .search-row {
  transform: translateY(calc(-100% - var(--chrome-h)));
}

/* The hamburger menu: one dropdown panel for both modes. Fixed below the
   header, centered, and always smaller than the viewport — oversize
   content scrolls inside the panel (user requirement). */
#reader-toolbar {
  position: fixed;
  top: calc(var(--chrome-h) + 0.4rem);
  left: 0;
  right: 0;
  margin: 0; /* override the base rule's margin-bottom; auto inline margins below center it */
  margin-inline: auto;
  width: min(94vw, 56rem);
  max-height: calc(100dvh - var(--chrome-h) - 0.8rem);
  overflow-y: auto;
  z-index: 40;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.25);
}

/* Quick search: same dropdown treatment, above the paged tap zones. */
#search-row {
  position: fixed;
  top: calc(var(--chrome-h) + 0.4rem);
  left: 0;
  right: 0;
  margin: 0; /* override the base rule's margin-bottom; auto inline margins below center it */
  margin-inline: auto;
  width: min(94vw, 56rem);
  z-index: 40;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.25);
}

/* Compact chrome gaps on narrow screens. */
@media (max-width: 640px) {
  .top-chrome {
    gap: 0.375rem;
  }
}

/* ------------------------------------------------------------------ */
/* First-time paged-mode onboarding (READER-WEB-017): a one-shot modal
   explaining the tap zones, shown when paged mode first starts. Renders
   above the paged chrome (zones 30, toolbar 40, quick pair 45) at every
   viewport width. Class-driven — CSP forbids inline styles. */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 0.45);
}

.onboarding-card {
  width: min(24rem, 100%);
  padding: 1.5rem;
  text-align: center;
  background: var(--panel-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
}

.onboarding-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.onboarding-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.onboarding-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  overflow: hidden;
}

.onboarding-col {
  padding: 0.85rem 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--btn-bg);
}

.onboarding-col + .onboarding-col {
  border-left: 1px solid var(--border);
}

.onboarding-card .btn {
  min-width: 6rem;
}

/* The welcome sheet is locally authored decoration, not fetched document data. */
#state-welcome {
  background: var(--bg);
}

.welcome-preview {
  position: absolute;
  width: min(44rem, calc(100% - 2rem));
  height: min(32rem, calc(100% - 2rem));
  overflow: hidden;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--panel-bg);
  color: var(--fg);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.12);
  opacity: 0.72;
  transform: rotate(-4deg);
  pointer-events: none;
  user-select: none;
}

.welcome-preview-heading {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.welcome-preview-glyphs {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.welcome-preview-glyphs span {
  white-space: nowrap;
}

#state-welcome .onboarding-card {
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .welcome-preview {
    height: min(36rem, calc(100% - 1.5rem));
    padding: 1.5rem;
  }
}

/* ------------------------------------------------------------------ */
/* Static landing page (served at / by the server). */

.landing-hero {
  text-align: center;
}

.landing-mark {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 22%;
  box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.25);
}

.landing-hero h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.landing-cta {
  margin: 1.5rem 0 0;
  font-weight: 600;
  color: var(--accent);
}

.landing-grid {
  display: grid;
  /* min(14rem, 100%) keeps the track below the container width at 200%
     zoom on narrow viewports, so the grid stacks instead of overflowing. */
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 1.5rem;
}

.landing-grid h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

/* Before/after demo pair on the landing page (landing.html): the wall of
   text in Messages next to the same words as LongText pages. Pair is wider
   than a regular panel (56rem matches .reader) so both screenshots stay
   legible; images stack on narrow screens. */
.landing-demo {
  max-width: 56rem;
  text-align: center;
}

.demo-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.demo-figure {
  margin: 0;
}

.demo-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.demo-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 700px) {
  .demo-pair {
    grid-template-columns: 1fr;
  }
}

/* Store listing pending — honest status text, no dead badge. */
.store-badge {
  display: block;
  margin: 1.25rem auto 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Landing section rhythm: keep every landing panel evenly spaced (scoped
   to the landing page's own section classes; reader panels untouched). */
.landing-why,
.landing-demo,
.landing-grid-panel,
.landing-faq {
  margin-top: 1.5rem;
}

/* Zoom safety: at 200% zoom the viewport is effectively half as wide, and
   grid/flex children must shrink rather than push horizontal overflow. */
.landing-hero,
.landing-why,
.landing-demo,
.landing-grid-panel,
.landing-faq,
.demo-figure {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Native FAQ disclosures: bordered, chevron-armed, keyboard-visible. */
.landing-faq details {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg);
}

.landing-faq summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* hide the browser marker; we draw the chevron */
}

.landing-faq summary::-webkit-details-marker {
  display: none;
}

.landing-faq summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.55em;
  height: 0.55em;
  margin-top: 0.15em;
  border-right: 0.18em solid var(--muted);
  border-bottom: 0.18em solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.12s ease;
}

.landing-faq details[open] > summary::before {
  transform: rotate(225deg);
}

.landing-faq summary:focus-visible {
  outline: 0.15rem solid var(--accent);
  outline-offset: 0.25rem;
  border-radius: 0.25rem;
}

.landing-faq details p {
  margin: 0.6rem 0 0;
}

.landing-faq h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.1rem;
}

.landing-faq code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* Scroll-mode reading footer: fixed words/time-left bar. Paged mode hides
   it ([hidden]) in favor of the page indicator. */
.reading-left {
  position: fixed;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  z-index: 15;
  pointer-events: none;
}

html.paged .reading-left {
  display: none;
}

/* Keep the bar from covering the end of the text. */
html:not(.paged) .app {
  padding-bottom: 5.5rem;
}

/* ------------------------------------------------------------------ */
/* Paged-mode bottom bar: explicit page turns + indicator. The top bar is
   the unified fixed chrome (icon + search + hamburger), shared with
   scroll mode above. */

.pager-bar {
  display: none;
}

html.paged .pager-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.8rem;
  background: var(--panel-bg);
  border-top: 1px solid var(--border);
  z-index: 45;
}

html.paged .pager-bar .pager-btn {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 1rem;
}
@media (max-width: 640px) {
  html.paged .pager-bar {
    gap: 0.6rem;
  }
}
