/* Bittensor News — periódico digital moderno.
   Papel casi blanco, tinta cálida, un solo acento óxido, serif de titulares
   y lectura, sans para metadatos. Sin assets ni fuentes externas. */

:root {
  --paper: #fdfcf9;
  --paper-dim: #f4f1ea;
  --ink: #1b1a17;
  --ink-body: #34322d;
  --muted: #726c60;
  --line: #e5e1d5;
  --line-strong: #cfc9ba;
  --rule: #1b1a17;
  --accent: #9c3a1f;
  --accent-deep: #7c2c15;
  --accent-wash: #f7ece7;
  --ok: #2c6644;
  --alert: #9c3a1f;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --page-pad: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

html { height: 100%; scrollbar-gutter: stable; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

button { font: inherit; color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 30;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus-visible { top: 0; }

.eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* ── Mancheta ─────────────────────────────────────────────── */

.masthead-top {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem var(--page-pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1rem;
  font-size: 0.74rem;
  color: var(--muted);
}
.masthead-top p { margin: 0; min-width: 0; }

.masthead-left {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-width: 0;
}

.edition-label {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tao-ticker {
  font: 600 0.72rem/1.3 var(--mono);
  color: var(--accent-deep);
  white-space: nowrap;
}

.masthead-tag {
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.masthead-right {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.masthead-right .language-toggle {
  flex: none;
  min-height: 28px;
  min-width: 42px;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 700 0.68rem/1 var(--sans);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.masthead-right .language-toggle:hover { border-color: var(--accent); color: var(--accent-deep); }
.masthead-right .preferences-button {
  min-height: 28px;
  padding: 0.18rem 0.65rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font: 700 0.68rem/1 var(--sans);
  cursor: pointer;
}
.masthead-right .preferences-button.is-authenticated::before { content: '•'; margin-right: 0.35rem; color: #9bd3af; }
.masthead-right .preferences-button:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.status-line #status-label { font-weight: 600; color: var(--ink); white-space: nowrap; }

.status-detail {
  font: 400 0.7rem/1.3 var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.alert { background: var(--alert); }

.brand { padding: clamp(1.2rem, 3vw, 2rem) var(--page-pad) clamp(1rem, 2.5vw, 1.6rem); text-align: center; }

.wordmark {
  margin: 0;
  font: 800 clamp(2rem, 5vw, 3.4rem)/1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-seal {
  display: inline-grid;
  place-items: center;
  width: 0.88em;
  height: 0.88em;
  margin-right: 0.3em;
  vertical-align: -0.06em;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font: italic 600 0.55em/1 var(--serif);
}

.personal-edition {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Cinta de páginas (pegajosa) ──────────────────────────── */

.paper-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--line);
}

.paper-nav-inner {
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 2rem;
}

#page-links { display: contents; }

.paper-nav button {
  min-height: 46px;
  padding: 0 0.1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 700 0.74rem/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.paper-nav button:hover { color: var(--ink); }
.paper-nav button[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent-deep);
}


/* ── Pliego: lectura + hemeroteca ─────────────────────────── */

.paper-layout {
  flex: 1;
  width: 100%;
  padding: clamp(1.6rem, 3.5vw, 2.8rem) var(--page-pad) 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(15rem, 18vw, 19rem);
  column-gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.edition-canvas { min-width: 0; }

/* Hemeroteca (derecha) */

.edition-archive {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: clamp(1.2rem, 2.5vw, 1.8rem);
  position: sticky;
  top: 4.2rem;
}

.archive-head { padding-bottom: 0.5rem; }

.archive-head h2 {
  margin: 0.25rem 0 0;
  font: 700 1rem/1.2 var(--serif);
  color: var(--ink);
}

#edition-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#edition-list li { border-top: 1px solid var(--line); }

.edition-entry {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.4rem;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.edition-entry:hover { background: var(--paper-dim); }

.edition-date {
  display: block;
  font: 600 0.92rem/1.3 var(--serif);
  color: var(--ink);
}

.edition-count {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.edition-entry[aria-current="page"] { background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--accent); }
.edition-entry[aria-current="page"] .edition-date { color: var(--accent-deep); }

/* Fuentes: qué alimenta cada página, con su salud */

.sources-panel { margin-top: 2rem; padding-top: 0.9rem; border-top: 2px solid var(--rule); }

.sources-panel h2 {
  margin: 0.25rem 0 0.3rem;
  font: 700 1rem/1.2 var(--serif);
  color: var(--ink);
}

#sources-list { margin: 0; padding: 0; list-style: none; }

.source-entry { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.source-entry:first-child { border-top: 0; }

.source-head {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.source-name { font: 600 0.85rem/1.3 var(--serif); color: var(--ink); }

.source-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.source-note {
  margin: 0.2rem 0 0 1.05rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Portada ──────────────────────────────────────────────── */

.cover-head {
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
  border-bottom: 3px double var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1rem;
}

#cover-title {
  margin: 0;
  font: 700 1.15rem/1.3 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
}

#cover-deck {
  margin: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Franja de cifras del día bajo la cabecera de edición */
.cover-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1.8rem, 4vw, 3.5rem);
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.stat { display: flex; align-items: baseline; gap: 0.55rem; }

.stat-label {
  font: 700 0.62rem/1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font: 600 0.95rem/1.3 var(--mono);
  color: var(--ink);
}

.cover-pages { display: grid; grid-template-columns: minmax(0, 1fr); }

/* Con más de una página → titular + columna secundaria */
.cover-pages:has(.other-pages) {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  column-gap: clamp(1.8rem, 3.5vw, 3rem);
}

.other-pages {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: clamp(1.8rem, 3.5vw, 3rem);
}

.story { min-width: 0; padding: 1.6rem 0; }
.other-pages .story { border-bottom: 1px solid var(--line); }
.other-pages .story:last-child { border-bottom: 0; }

.story-kicker {
  margin: 0 0 0.75rem;
  font: 700 0.66rem/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.story-lead .story-kicker { color: var(--accent-deep); }

.story h2, .story h3 {
  margin: 0;
  font-family: var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.story h2 { font-size: clamp(1.9rem, 3.4vw, 3.6rem); line-height: 1.08; }
.story h3 { font-size: clamp(1.3rem, 1.6vw, 1.6rem); line-height: 1.25; }

/* En titulares, el código se lee como texto del titular, sin chip */
.story h2 code, .story h3 code, #page-title code {
  font: inherit;
  background: none;
  padding: 0;
  border: 0;
}

.story h2 a, .story h3 a { color: inherit; text-decoration: none; }
.story h2 a:hover, .story h3 a:hover { color: var(--accent-deep); }

.story-summary {
  margin: 0.85rem 0 0;
  max-width: 72ch;
  color: var(--ink-body);
  font: 1.02rem/1.6 var(--serif);
}
.story-lead .story-summary { font-size: clamp(1.14rem, 1.3vw, 1.3rem); line-height: 1.62; }
.story-summary strong { color: var(--ink); }

.story-details {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.8rem;
  margin-top: 1rem;
}

.quick-links-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-links-items { display: inline-flex; flex-wrap: wrap; gap: 0.45rem; }

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.34rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-body);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.quick-link svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-link:hover { border-color: var(--accent); color: var(--accent-deep); }

.page-head > .quick-links { margin-top: 0.8rem; }

.story-summary code {
  font: 0.85em var(--mono);
  color: inherit;
  background: var(--paper-dim);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

.story-summary a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}
.story-summary a:hover { text-decoration-color: var(--accent-deep); }

/* Ficha del despacho: pastillas legibles */

.badges {
  margin: 0.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 600 0.68rem/1.5 var(--sans);
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}

.badge.importance {
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-wash);
}

.read-page {
  margin-top: 1rem;
  padding: 0.2rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-deep);
  font: 700 0.76rem/1.3 var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.read-page:hover { color: var(--ink); }

/* ── Página de categoría: artículo ────────────────────────── */

#report-page { max-width: none; }

.back-link {
  margin: 0 0 1.4rem;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.76rem/1.3 var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.back-link:hover { color: var(--accent-deep); }

.page-head { padding-bottom: 1.2rem; border-bottom: 1px solid var(--line-strong); }

#page-title {
  margin: 0.55rem 0 0.7rem;
  font: 700 clamp(1.8rem, 4vw, 2.7rem)/1.12 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}

#page-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.article-body {
  max-width: none;
  padding-top: 1.6rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink-body);
  overflow-wrap: break-word;
}

/* Entradilla: primer párrafo con más cuerpo */
.article-body > p:first-child:not(.state-msg),
.article-body > section:first-child > p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--ink);
}

.article-body p { margin: 0 0 1.15rem; }

.article-body h1 {
  margin: 0 0 1.2rem;
  font: 700 1.5rem/1.25 var(--serif);
  letter-spacing: -0.015em;
  color: var(--ink);
}

.report-section { margin-top: 2.6rem; }

.report-section h2 {
  margin: 0 0 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-strong);
  font: 700 0.72rem/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.report-section h3, .article-body h3 {
  margin: 1.6rem 0 0.65rem;
  font: 700 1.1rem/1.35 var(--serif);
  color: var(--ink);
}

.article-body ul { margin: 0 0 1.15rem; padding-left: 1.3rem; }
.article-body li { margin-bottom: 0.55rem; }
.article-body li::marker { color: var(--accent); }

.article-body code {
  padding: 0.06em 0.3em;
  font: 0.82em var(--mono);
  color: inherit;
  background: var(--paper-dim);
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.article-body strong { color: var(--ink); font-weight: 700; }

.article-body a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.article-body a:hover { text-decoration-color: var(--accent-deep); }

.report-figure { margin: 1.8rem 0; }
.report-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.report-figure figcaption { margin-top: 0.5rem; color: var(--muted); font: 0.74rem/1.45 var(--sans); }

.state-msg { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
.state-error { color: var(--alert); }

/* ── Pie ──────────────────────────────────────────────────── */

.colophon {
  border-top: 1px solid var(--line-strong);
  padding: 1rem var(--page-pad);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Cuenta y preferencias ───────────────────────────────── */

.preferences-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(46rem, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 22px 70px rgb(27 26 23 / 24%);
}

.preferences-dialog::backdrop { background: rgb(27 26 23 / 42%); backdrop-filter: blur(3px); }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 { margin: 0.25rem 0 0; font: 700 1.65rem/1.1 var(--serif); }
.dialog-close { border: 0; background: none; color: var(--muted); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--ink); }
.dialog-intro { margin: 0; padding: 1.2rem 1.5rem 0; color: var(--ink-body); }

.auth-tabs { display: flex; gap: 0.4rem; padding: 1rem 1.5rem 0; }
.auth-tabs button {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.auth-tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }

.settings-form { display: grid; gap: 1rem; padding: 1.25rem 1.5rem 1.5rem; }
.settings-form > label { display: grid; gap: 0.35rem; color: var(--ink-body); font-size: 0.82rem; font-weight: 650; }
.settings-form input[type="email"], .settings-form input[type="password"], .settings-form input[type="text"] {
  width: 100%; min-height: 42px; padding: 0.55rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); font: 400 1rem var(--sans);
}

.usage-panel { margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.usage-head h3 { margin: .15rem 0 .5rem; font-family: var(--display); font-size: 1.35rem; }
.usage-table-wrap { overflow-x: auto; }
.usage-panel table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.usage-panel th, .usage-panel td { padding: .55rem .4rem; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.settings-form fieldset { margin: 0; padding: 0.8rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.55rem; border: 0; border-top: 1px solid var(--line); }
.settings-form legend { padding: 0 0.6rem 0 0; color: var(--ink); font-size: 0.82rem; font-weight: 700; }
.settings-form fieldset label { color: var(--ink-body); font-size: 0.85rem; }
.primary-button, .secondary-button { min-height: 40px; padding: 0.55rem 0.9rem; border-radius: 4px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
.secondary-button { border: 1px solid var(--line-strong); background: transparent; color: var(--ink-body); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.form-message, .account-email { margin: 0; color: var(--muted); font-size: 0.78rem; }
.form-message:not(:empty) { padding: 0.6rem; background: var(--paper-dim); border-radius: 4px; }

body[data-density="compact"] .story { padding-block: 1rem; }
body[data-density="compact"] .story-summary { font-size: 0.98rem; line-height: 1.48; }
body[data-density="compact"] .story-lead .story-summary { font-size: 1.05rem; line-height: 1.5; }
body[data-density="compact"] .article-body { font-size: 1.02rem; line-height: 1.62; }

/* ── Movimiento: solo transiciones funcionales ────────────── */

@media (prefers-reduced-motion: no-preference) {
  .paper-nav button, .edition-entry, .read-page, .back-link, .article-body a, .story-summary a {
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── ≤920px: hemeroteca como tira horizontal ──────────────── */

@media (max-width: 920px) {
  .paper-layout { display: block; }

  .edition-archive {
    position: static;
    border-left: 0;
    padding-left: 0;
    margin-top: 2.5rem;
    border-top: 2px solid var(--rule);
    padding-top: 1rem;
  }

  #edition-list {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.6rem 0 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  #edition-list li { flex: none; border-top: 0; }
  .edition-entry {
    min-width: 11rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
  }
  .edition-entry[aria-current="page"] { border-color: var(--accent); box-shadow: none; background: var(--accent-wash); }

  .cover-pages:has(.other-pages) { grid-template-columns: minmax(0, 1fr); }
  .other-pages { border-left: 0; padding-left: 0; border-top: 2px solid var(--rule); margin-top: 0.4rem; }
}

/* ── ≤640px: mancheta compacta ────────────────────────────── */

@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .masthead-top { grid-template-columns: minmax(0, 1fr); padding-inline: 1rem; }
  .masthead-left { display: none; }
  .masthead-tag { display: none; }
  .masthead-right .status-line { display: none; }
  .masthead-right { gap: 0.35rem; }
  .masthead-right .preferences-button { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand { padding: 1rem; }
  .wordmark { font-size: 1.72rem; white-space: nowrap; }
  .paper-nav-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0 1.4rem;
    padding-inline: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
  .paper-nav button { flex: none; }
  .paper-layout { padding: 1.35rem 1.25rem 3rem; }
  .article-body { font-size: 1.04rem; line-height: 1.7; }
  #cover-deck { margin-left: 0; }
}
