@font-face {
  font-family: 'New York';
  src: local('New York');
  font-weight: 100 900;
  font-style: normal;
}
@font-face {
  font-family: 'New York';
  src: local('New York Italic');
  font-weight: 100 900;
  font-style: italic;
}

/* DM Serif Display — the haiku face; bundled so it matches the share card. */
@font-face {
  font-family: 'DM Serif Display';
  src: url('assets/fonts/DMSerifDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Serif Display';
  src: url('assets/fonts/DMSerifDisplay-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #faf9f7;
  --text: #1a1a1a;
  --muted: #726d66;
  --rule: #e8e5e0;
  --badge-bg: #ede9e3;
  --badge-text: #888;
  --claude-text: #a95322;
  --claude-bg: #f7ece5;
  --codex-text: #2a7d62;
  --codex-bg: #e4f2ec;
  --agy-text: #4f5bd5;
  --agy-bg: #ece9f7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --text: #ede8e0;
    --muted: #8a857c;
    --rule: #2a2a28;
    --badge-bg: #242422;
    --badge-text: #666;
    --claude-text: #e07a45;
    --claude-bg: #2a1a12;
    --codex-text: #45a882;
    --codex-bg: #0e2420;
    --agy-text: #8b93e6;
    --agy-bg: #161430;
  }
}

/* dvh tracks the visible viewport on mobile (100vh is the taller URL-bar-hidden
   height, which overflows by a sliver and causes scroll/bounce even when the
   page fits). overscroll-behavior kills the iOS rubber-band. Pages that truly
   overflow (archive, small screens) still scroll normally. */
html, body { overscroll-behavior: none; }

/* The main page fits the viewport, so lock the root to it and hide overflow:
   this is what actually stops iOS Safari's document rubber-band bounce
   (overscroll-behavior alone is ignored for the top-level document there).
   Scoped to the main page via :has() — archive.html (.archive-layout) must
   still scroll normally. */
html:has(.main-layout), body:has(.main-layout) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'New York', ui-serif, 'Noto Serif', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Main page ── */

.main-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1.5rem;
}

#main-content {
  width: 100%;
  max-width: 640px;
}

/* A multi-haiku day can't render three readable columns inside 640px, so give
   the hero room when it shows a cycle. Single-haiku days keep the 640px column. */
#main-content:has(.main-cycle) {
  max-width: min(1120px, 92vw);
}

.haiku {
  text-align: center;
}

@keyframes haiku-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.haiku p {
  font-family: 'DM Serif Display', 'New York', ui-serif, 'Noto Serif', serif;
  font-size: clamp(0.85rem, 3vw, 1.9rem);
  line-height: 1.9;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  animation: haiku-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.haiku p:nth-child(1) { animation-delay: 0.12s; }
.haiku p:nth-child(2) { animation-delay: 0.28s; }
.haiku p:nth-child(3) { animation-delay: 0.44s; }

/* Reduced motion: keep a gentle staggered fade, drop the translateY movement. */
@keyframes haiku-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .haiku p { animation-name: haiku-fade; }
}

.haiku-kicker {
  display: block;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.haiku-rule {
  width: 1.25rem;
  height: 1px;
  background: var(--claude-text);
  margin: 1.25rem auto 0.75rem;
}

/* ── Cycle layout: 2–3 engines side by side (main + archive) ── */

.main-cycle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: center;
}
.main-cycle.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pair-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.main-cycle .pair-col {
  padding: 0 clamp(0.75rem, 2vw, 1.5rem);
}

/* Safety net: columns and their inner blocks never spill past the column,
   so a too-long line clips rather than overlapping a neighbour (the JS fit
   normally shrinks it to fit before that happens). */
.main-cycle .pair-col,
.haiku-entry-cycle .pair-col {
  min-width: 0;
  overflow: hidden;
}
.main-cycle .haiku {
  max-width: 100%;
}

.haiku-entry-cycle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.haiku-entry-cycle.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.haiku-entry-cycle .pair-col {
  align-items: flex-start;
}

.main-cycle .haiku p {
  font-size: clamp(0.8rem, 1.8vw, 1.4rem);
}

.haiku-entry-cycle p {
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
}

/* Cycle lines stay on one row (inherit nowrap); main.js shrinks any block
   whose lines would overflow a narrow column, keeping exactly three rows. */

@media (max-width: 680px) {
  .main-cycle {
    gap: 1.5rem;
  }
}

@media (max-width: 540px) {
  .main-cycle,
  .haiku-entry-cycle,
  .main-cycle.cols-3,
  .haiku-entry-cycle.cols-3 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .main-cycle .pair-col + .pair-col {
    border-left: none;
  }
}

/* ── ── */

.haiku-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.haiku-date {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: 1.25rem;
}

.source-badge {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.1em 0.5em;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.source-claude {
  color: var(--claude-text);
  border-color: color-mix(in srgb, var(--claude-text) 35%, var(--bg));
  background: transparent;
}

.source-codex {
  color: var(--codex-text);
  border-color: color-mix(in srgb, var(--codex-text) 35%, var(--bg));
  background: transparent;
}

.source-agy {
  color: var(--agy-text);
  border-color: color-mix(in srgb, var(--agy-text) 35%, var(--bg));
  background: transparent;
}

.mood {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-left: 0.4em;
}

/* Low-confidence score (rests on <2 lexicon words) — reads as tentative.
   Italic alone: any fade here fails contrast, whatever --muted is. */
.mood-weak {
  font-style: italic;
}

/* Quiet per-haiku anchor to its /h/<slug>/ share page. */
.permalink {
  position: relative;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, scale 0.15s ease-out;
}
/* Expand the tap target past the small glyph without shifting layout. */
.permalink::after {
  content: "";
  position: absolute;
  inset: -12px -10px;
}
.permalink:active { scale: 0.96; }
.permalink:focus-visible { color: var(--text); }

/* Gate hover behind a real pointer — on touch, tap fires :hover and the
   darkened glyph would stick "on" after navigating back. */
@media (hover: hover) and (pointer: fine) {
  .permalink:hover { color: var(--text); }
}

.nav-link {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 0.9rem;   /* clears the 40px minimum tap target */
  display: inline-block;
  transition: color 0.15s, scale 0.15s ease-out;
}
.nav-link:active { scale: 0.97; }

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { color: var(--text); }
}

/* ── Live insights ── */

.insight {
  max-width: 30rem;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: clamp(0.66rem, 2vw, 0.78rem);
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.insight:empty {
  display: none;
}

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}
.stats-strip:empty {
  display: none;
}

.stat-cell {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stat-note {
  flex-basis: 100%;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Sentiment trend chart (archive) — shadcn/recharts-style card ── */

.trend {
  margin: -1rem 0 2.5rem;
}
.trend:empty {
  display: none;
}

.chart-card {
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--text) 2.5%, var(--bg));
  box-shadow: 0 1px 1px rgba(30, 27, 24, 0.04), 0 3px 8px rgba(30, 27, 24, 0.05);
  overflow: hidden;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem 0.5rem;
}
.chart-title {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-wrap: balance;
}
.chart-desc {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 0.2rem;
  text-wrap: pretty;
}

/* Sentiment source toggle: the word list (site's lexicon) or the model's scores. */
.chart-foot-sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mood-toggle {
  display: inline-flex;
  margin-top: 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  overflow: hidden;
}
.mood-toggle button {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.65rem;
  min-height: 1.75rem;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}
.mood-toggle button + button {
  border-left: 1px solid var(--rule);
}
.mood-toggle button[aria-pressed="true"] {
  color: var(--text);
  background: var(--badge-bg);
}
.mood-toggle button:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: -2px;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  color: var(--muted);
}
.trend-key {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  letter-spacing: 0.02em;
}
.trend-key i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  display: inline-block;
}

.chart-body {
  position: relative;
  padding: 0.25rem 1rem 0.5rem;
  cursor: crosshair;
}
.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
/* Vertical dashed line where an engine's model changed (from model.log). */
.model-marker {
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.45;
}

.tip-model b {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
}

.spark-zero {
  stroke: var(--muted);
  stroke-width: 0.75;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}
.spark-grid {
  stroke: var(--rule);
  stroke-width: 0.75;
}
.spark-glabel {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 8px;
  fill: var(--muted);
  opacity: 0.7;
}
.spark-xlabel {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 8px;
  fill: var(--muted);
}
.chart-cursor {
  stroke: var(--muted);
  stroke-width: 0.75;
  opacity: 0.5;
}

.chart-tip {
  position: absolute;
  top: 0.5rem;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(30, 27, 24, 0.06), 0 6px 16px rgba(30, 27, 24, 0.12);
  padding: 0.4rem 0.55rem;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  z-index: 2;
  min-width: 5.5rem;
}
.chart-tip[hidden] {
  display: none;
}
.tip-date {
  color: var(--muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}
.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text);
}
.tip-name {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.tip-row i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-right: 0.35em;
}
.tip-row b {
  font-weight: 600;
  flex: 0 0 auto;
}

.chart-foot {
  padding: 0.6rem 1.25rem 1rem;
  border-top: 1px solid var(--rule);
  text-wrap: pretty;
}
.chart-foot-main {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  color: var(--text);
}
.chart-foot-sub {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.trend-icon {
  width: 0.95em;
  height: 0.95em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Archive page ── */

.archive-layout {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.archive-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.archive-header-right {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}

.haiku-count {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.archive-header h1 {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}

.date-group {
  margin-bottom: 2.5rem;
}

.date-label {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.haiku-entry {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}

.haiku-entry:last-child {
  border-bottom: none;
}

.haiku-entry p,
.haiku-entry-cycle p {
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  line-height: 1.2;
  font-style: italic;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.month-group {
  margin-bottom: 4rem;
}

.month-heading {
  font-family: 'DM Serif Display', 'New York', ui-serif, 'Noto Serif', serif;
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.3rem;
  font-style: normal;
  text-wrap: balance;
}

.month-count {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-bottom: 1.25rem;
}

.month-entries {
  border-top: 1px solid var(--rule);
}

.entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Never split the date across lines — if the row runs out of room the badge
   group wraps under it instead. */
.haiku-entry .time {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Experimental: the free-model bench (experimental.html) ── */

.nav-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bench-intro {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

/* Up to ~45 models in one list, no per-page font fitting: let a long line wrap
   rather than be cut off in a narrow viewport. */
.bench .haiku-entry p {
  white-space: normal;
}

.bench-model {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.bench-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--rule);
}

.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.bench-table th {
  text-align: left;
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 0.6rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.bench-table td {
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

/* Model ids run to 40+ characters; the name column wraps so the table fits
   the 740px column instead of scrolling sideways. */
.bench-table td:first-child {
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Phones: drop the date column and let the provider wrap too, so the model
   name keeps about half the row instead of breaking every few letters. */
@media (max-width: 540px) {
  .bench-table th:last-child,
  .bench-table td:last-child {
    display: none;
  }
  .bench-table td:first-child {
    width: 50%;
  }
  .bench-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.bench-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bench-dead {
  margin-top: 1.25rem;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--muted);
}

.bench-dead summary {
  cursor: pointer;
  letter-spacing: 0.04em;
}

.bench-dead p {
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
}

/* Experimental word cloud: each family's [light, dark] text colour comes inline from
   FAMILY_COLOURS in experimental.js as --fam-l / --fam-d. */
.fam-c { --fam: var(--fam-l); }
@media (prefers-color-scheme: dark) {
  .fam-c { --fam: var(--fam-d); }
}
.fam-other { --fam: var(--muted); }
.fam-shared { --fam: var(--text); }

.cloud-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.1rem;
  margin-bottom: 1.25rem;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.68rem;
  color: var(--muted);
}

/* Buttons: hover or focus previews a family's words, a click or tap pins it. */
.cloud-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cloud-key[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cloud-key:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}
@media (hover: hover) {
  .cloud-key:hover { color: var(--text); }
}

.cloud-key i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--fam);
}

.bench-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.15rem 0.7rem;
  padding: 1rem 0 0.5rem;
  line-height: 1.15;
}

.cloud-word {
  font-family: 'DM Serif Display', 'New York', ui-serif, 'Noto Serif', serif;
  font-style: italic;
  color: var(--fam);
  overflow-wrap: anywhere;
  cursor: default;
  border-radius: 2px;
}
/* A picked family: its words at full strength (a grey family's in ink), the rest
   faded right back. */
.cloud-word.dim { opacity: 0.15; }
.cloud-word.lit.fam-other { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .cloud-word { transition: opacity 0.15s, color 0.15s; }
}
.cloud-word:focus-visible {
  outline: 1px solid var(--fam);
  outline-offset: 2px;
}

.cloud-detail {
  min-height: 1.7em;
  margin: 0.75rem 0 0.5rem;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}

.bench-fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.bench-fold + .bench-fold {
  margin-top: -4rem;   /* .month-group's bottom margin; consecutive folds read as one list */
}
.bench-fold > summary::-webkit-details-marker {
  display: none;
}
.bench-fold > summary .month-count {
  display: inline;
  margin-bottom: 0;
}

.bench-fold-title {
  font-family: 'DM Serif Display', 'New York', ui-serif, 'Noto Serif', serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  color: var(--text);
}
.bench-fold-title::before {
  content: "▸ ";
  color: var(--muted);
}
.bench-fold[open] .bench-fold-title::before {
  content: "▾ ";
}

@media (hover: hover) and (pointer: fine) {
  .bench-fold > summary:hover .bench-fold-title { color: var(--muted); }
}

.bench-empty {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Scroll index rails: month·year + the active month's days ──
   Fixed in the right margin beside the 740px column; desktop-only. */
.rails {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
}

.rails .col {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail-months a {
  display: block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0.2rem 0.1rem;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}

.rail-months a .m {
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-months a .y {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.7;
  margin-left: 0.35em;
}

.rail-months a:hover { opacity: 0.9; }
.rail-months a.active { opacity: 1; }
.rail-months a.active .m { color: var(--claude-text); font-weight: 600; }
.rail-months a.active .y { color: var(--claude-text); }

.rail-dates {
  text-align: center;
  min-width: 34px;
}

.rail-dates a {
  display: block;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0.45;
  padding: 0.12rem 0;
  transition: opacity 0.15s, color 0.15s;
}

.rail-dates a:hover { opacity: 0.85; }
.rail-dates a.active { opacity: 1; color: var(--claude-text); font-weight: 600; }

@media (max-width: 1024px) {
  .rails { display: none; }
}

@media (max-width: 480px) {
  .archive-layout {
    padding: 2rem 1rem 3rem;
  }

  .archive-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* Mood comparison (experimental page): the archive's word list beside the model. */
.mood-scores {
  gap: 0.75rem;
  flex-wrap: wrap;
}
.mood-pair {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mood-tag {
  opacity: 0.65;
  margin-right: 0.15rem;
}
.mood-conf {
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}
.mood-head {
  font-size: 1rem;
  font-weight: normal;
  margin: 1.75rem 0 0.25rem;
}
.mood-head:first-of-type { margin-top: 1.25rem; }
