/* Story reader: grouped archive + long-form reading. */
.story-page {
  --story-width: 1120px;
  --story-ink: var(--ink, #243452);
  --story-soft: var(--ink-soft, rgba(36, 52, 82, 0.72));
  --story-line: var(--line, #d9e1ed);
  --story-panel: var(--panel, #fff);
  --story-accent: var(--seal, #c52b70);
  --story-lake: var(--lake, #18768c);
  background: var(--paper, #f7faff);
}

.story-page.story-dark {
  --paper: #11151d;
  --panel: #1a202b;
  --ink: #e8edf6;
  --ink-soft: rgba(232, 237, 246, 0.66);
  --line: #2c3543;
  --sleeve: #232b39;
  --story-panel: #1a202b;
  --story-line: #2c3543;
  --story-ink: #e8edf6;
  --story-soft: rgba(232, 237, 246, 0.66);
  background: #11151d;
}

.story-page a {
  color: inherit;
}

.story-shell,
.reader-shell {
  width: min(var(--story-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.story-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--story-line);
}

.story-intro h1 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.story-lead {
  max-width: 40rem;
  margin: 0;
  color: var(--story-soft);
  line-height: 1.8;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.story-continue {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: var(--story-panel);
  color: var(--story-ink);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.story-continue {
  border-color: var(--story-accent);
  color: var(--story-accent);
}

.story-continue:hover {
  border-color: var(--story-lake);
  color: var(--story-lake);
}

.story-controls {
  position: relative;
  top: 0;
  z-index: 8;
  margin: 18px 0 24px;
  padding: 12px 0 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--story-line);
}

.story-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.story-tabs a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: var(--story-panel);
  color: var(--story-soft);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.story-tabs a[aria-current="page"] {
  border-color: var(--story-ink);
  background: var(--story-ink);
  color: var(--paper);
}

.story-tabs small {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.story-search-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.story-search {
  flex: 1 1 auto;
}

.story-search input {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--story-line);
  border-radius: 10px;
  background: var(--story-panel);
  color: var(--story-ink);
  font: inherit;
}

.story-search input:focus-visible {
  outline: 3px solid var(--story-accent);
  outline-offset: 2px;
}

.story-count {
  flex: 0 0 auto;
  color: var(--story-soft);
  font-size: 0.82rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.story-filter {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--story-line);
}

.story-bands {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.story-band {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--story-line);
  border-radius: 10px;
  background: var(--story-panel);
  cursor: pointer;
}

.story-band img {
  display: block;
  width: 44px;
  height: 32px;
  object-fit: contain;
}

.story-band[aria-pressed="true"] {
  border-color: var(--story-ink);
  background: color-mix(in srgb, var(--story-ink) 8%, var(--story-panel));
  box-shadow: inset 0 0 0 1px var(--story-ink);
}

.story-clear {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--story-accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.story-characters {
  display: grid;
  grid-template-columns: repeat(5, 44px);
  grid-auto-rows: 44px;
  gap: 8px;
  height: 66px;
  padding: 2px 0 0;
  align-content: start;
  overflow: visible;
}

.story-char {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--story-panel);
  cursor: pointer;
}

.story-char img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.story-char[aria-pressed="true"] {
  border-color: var(--story-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--story-accent) 18%, transparent);
}

.story-char span {
  position: absolute;
  left: 50%;
  bottom: -1.1rem;
  transform: translateX(-50%);
  color: var(--story-soft);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.story-filter-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.story-mode {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.story-mode button {
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: var(--story-panel);
  color: var(--story-soft);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.story-mode button[aria-pressed="true"] {
  border-color: var(--story-lake);
  color: var(--story-lake);
  background: color-mix(in srgb, var(--story-lake) 8%, var(--story-panel));
}

.story-results {
  display: grid;
  gap: 16px;
}

.story-results.grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
}

.story-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--story-line);
  border-radius: 14px;
  background: var(--story-panel);
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.story-card:hover {
  border-color: var(--story-lake);
  transform: translateY(-2px);
}

.story-card-visual {
  position: relative;
  display: block;
  aspect-ratio: 3 / 1;
  min-height: 94px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--story-lake) 16%, var(--sleeve)), color-mix(in srgb, var(--story-accent) 12%, var(--sleeve)));
  overflow: hidden;
}

.story-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-card-visual .period {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 22, 32, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.story-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px 14px;
}

.story-card-body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.story-card-meta {
  margin: 0;
  color: var(--story-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.story-card-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--story-soft);
  font-size: 0.82rem;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.story-card-chars {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
}

.story-card-chars img,
.story-owner img,
.story-pair img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sleeve);
}

.story-card-chars img {
  border: 1px solid var(--story-panel);
  margin-left: -6px;
}

.story-card-chars img:first-child {
  margin-left: 0;
}

.story-list {
  display: grid;
  gap: 10px;
}

.story-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--story-line);
  border-radius: 12px;
  background: var(--story-panel);
}

.story-row:hover {
  border-color: var(--story-lake);
}

.story-row-main {
  min-width: 0;
}

.story-row-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.story-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--story-soft);
  font-size: 0.78rem;
}

.story-row em {
  color: var(--story-soft);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.story-owner,
.story-pair {
  display: flex;
  align-items: center;
}

.story-pair img + img {
  margin-left: -8px;
  border: 2px solid var(--story-panel);
}

.story-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  color: var(--story-soft);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.story-badge.ai {
  border-color: color-mix(in srgb, var(--story-lake) 50%, var(--story-line));
  color: var(--story-lake);
}

.story-badge.jp {
  border-color: color-mix(in srgb, var(--story-accent) 45%, var(--story-line));
  color: var(--story-accent);
}

.story-empty,
.story-footnote,
.reader-loading {
  color: var(--story-soft);
  font-size: 0.82rem;
}

.story-footnote {
  margin: 34px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--story-line);
}

.story-load-more {
  justify-self: center;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: var(--story-panel);
  color: var(--story-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

/* v2.2: quiet archive typography; card art, not decorative chrome, carries colour. */
.story-page { font-size: 16px; }
.story-page h1, .story-page h2, .story-page h3 { font-weight: 700; letter-spacing: normal; overflow-wrap: anywhere; }
.story-page button, .story-tabs a, .reader-back, .reader-pager a, .line-speaker,
.story-card-meta, .story-count, .reader-kicker, .episode-cap { font-weight: 600; }
.story-page button, .story-tabs a, .story-clear { min-height: 44px; }
.story-page button { cursor: pointer; }
.story-page button:disabled { cursor: not-allowed; opacity: .6; }
.story-tabs a { font-size: 16px; }
.story-intro h1 { font-size: clamp(2rem, 3vw, 2.5rem); }
.story-continue { white-space: normal; font-weight: 600; }
.story-page [hidden] { display: none !important; }
.story-page :focus-visible { outline: 3px solid var(--story-accent); outline-offset: 3px; }
.story-card:hover { transform: none; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card-grid .story-load-more { grid-column: 1 / -1; }
.card-art { position: relative; aspect-ratio: 4 / 3; width: 100%; display: grid; place-items: center; background: var(--sleeve); color: var(--story-ink); font-size: 14px; text-align: center; overflow: hidden; }
.card-art img { display: block; width: 100%; height: auto; object-fit: contain; align-self: start; }
.card-art button { font: inherit; color: inherit; }
.card-art-label { position: absolute; right: 6px; bottom: 6px; background: var(--story-panel); color: var(--story-ink); border: 1px solid var(--story-line); border-radius: 4px; padding: 2px 6px; font-size: 12px; }
#gacha-region { min-height: 44px; font: inherit; color: var(--story-ink); background: var(--story-panel); border: 1px solid var(--story-line); border-radius: 6px; }
[data-gacha-id] { margin-top: 24px; }
[data-relation="gacha_period_only"] p { overflow-wrap: anywhere; }
.card-tile .story-card-body { margin: 0; overflow-wrap: anywhere; }
.card-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: 24px 0; }
.card-detail > * { min-width: 0; }
.card-detail h2 { margin: 0; }
.card-detail p { margin: 8px 0; }
.image-variants { display: flex; gap: 8px; padding-top: 8px; }
.image-variants button { border: 1px solid var(--story-line); border-radius: 8px; background: var(--story-panel); color: var(--story-ink); font: inherit; padding: 4px 12px; }
.image-variants [aria-pressed="true"] { border-color: var(--story-accent); box-shadow: inset 0 0 0 1px var(--story-accent); }
.card-story-link { display: block; padding: 10px 0; border-bottom: 1px solid var(--story-line); color: var(--story-accent) !important; }
.episode-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 24px 0; font-size: 14px; font-weight: 500; }
.episode-toc a { padding: 8px 0; min-height: 44px; overflow-wrap: anywhere; }
.episode { scroll-margin-top: 130px; }
.source-details { margin-top: 8px; color: var(--story-soft); font-size: 14px; }
.source-details summary { cursor: pointer; min-height: 44px; padding: 8px 0; }
.source-details a { display: inline-block; padding: 8px 12px 8px 0; text-decoration: underline; }
.reader-bilingual .reader-shell { --story-width: 960px; }
.story-dark { color-scheme: dark; --seal: #f48eb9; --story-accent: #f48eb9; --lake: #75c5d8; --story-lake: #75c5d8; }
.related-cards { margin-top: 32px; }
.related-cards > section { margin-top: 24px; }
@media (max-width: 760px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-detail, .episode-toc { grid-template-columns: 1fr; }
  .card-detail { gap: 16px; }
  .card-tile .story-card-body { padding: 10px; }
  .card-tile .story-card-meta { font-size: 14px; }
}

/* Shared archive rhythm: restrained 400/600/700 hierarchy, 8/16/24/32 spacing. */
.story-shell { --story-width: 1040px; }
.story-card { border-radius: 8px; }
.story-card-body { padding: 16px; gap: 8px; }
.story-card-meta { font-weight: 400; font-size: 14px; line-height: 1.6; }
.story-tabs a { border-radius: 6px; }
.card-filters { margin: 24px 0; }
.card-filters fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.card-filters legend { font-weight: 600; padding: 0 0 16px; margin: 0; }
.card-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 16px; }
.card-filters label { display: grid; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; color: var(--story-soft); }
.card-filters button { margin-top: 0; white-space: nowrap; padding: 8px 12px; }
.card-filters input { margin: 0; }
.card-filters select, .card-filters input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--story-line); background: var(--story-panel); color: var(--story-ink); border-radius: 6px; padding: 8px; font: inherit; font-size: 16px; }
.card-filter-foot { display: flex; gap: 16px; align-items: end; margin-top: 8px; }
.cards-page .story-intro { gap: 8px; }
.cards-page .story-lead { font-size: 16px; }
.card-filter-foot label { max-width: 240px; }
.card-results-heading { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--story-soft); }
.date-note { font-size: 14px; color: var(--story-soft); margin: 0 0 24px; max-width: 44rem; }
.date-note summary { cursor: pointer; min-height: 44px; padding: 8px 0; }
.date-note p { line-height: 1.8; }
@media (max-width:760px) {
 .card-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
 .card-filter-foot { align-items: center; }
 .card-results-heading { flex-direction: column; gap: 0; }
 .card-results-heading p { margin-bottom: 8px; }
 .cards-page .story-intro { gap: 8px; padding-bottom: 16px; }
 .cards-page .story-lead { margin-bottom: 0; }
 .cards-page .card-filter-grid { gap: 8px 12px; }
 .cards-page .date-note { margin-bottom: 12px; }
}
@media (prefers-reduced-motion:reduce) {
 .story-page *, .story-page *::before, .story-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* ── Reader ── */
.reader-page .reader-shell { --story-width: 1040px; display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 32px; align-items: start; }
.reader-content { min-width: 0; grid-column: 2; }
.reader-shell:has(> .chapter-sidebar[hidden]) { grid-template-columns: minmax(0, 720px); justify-content: center; }
.reader-shell:has(> .chapter-sidebar[hidden]) > .reader-content { grid-column: 1; }
.chapter-sidebar { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; border-right: 1px solid var(--story-line); padding-right: 16px; }
.chapter-sidebar summary { font-size: 16px; font-weight: 600; min-height: 44px; cursor: pointer; }
.chapter-sidebar .episode-toc { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; font-size: 14px; }
.chapter-sidebar .episode-toc a { display: block; padding: 8px; border-left: 2px solid transparent; text-decoration: none; }
.chapter-sidebar a[aria-current="location"] { border-left-color: var(--story-accent); color: var(--story-accent); background: var(--story-panel); }
.chapter-sidebar summary:focus-visible { outline: 3px solid var(--story-accent); outline-offset: -3px; }
@media (min-width: 1001px) { .chapter-sidebar summary { list-style: none; cursor: default; } .chapter-sidebar summary::-webkit-details-marker { display: none; } }
@media (max-width: 1000px) {
 .reader-page .reader-shell { display: block; --story-width: 720px; }
 .chapter-sidebar { position: relative; top: 0; max-height: none; padding: 0; border-right: 0; border-bottom: 1px solid var(--story-line); margin-bottom: 12px; }
 .chapter-sidebar .episode-toc { max-height: 45dvh; overflow-y: auto; }
}

.reader-page {
  --story-font: 1rem;
}

.reader-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 3px;
  background: transparent;
}

.reader-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--story-accent);
  transition: width 0.08s linear;
}

.reader-shell {
  --story-width: 720px;
  padding-top: 26px;
}

.reader-back {
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

.reader-back a {
  color: var(--story-soft);
}

.reader-back a:hover {
  color: var(--story-accent);
}

.reader-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--story-line);
}

.reader-kicker {
  margin: 0 0 8px;
  color: var(--story-accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reader-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.reader-sub {
  margin: 0;
  color: var(--story-soft);
  line-height: 1.7;
}

.reader-sub a {
  color: var(--story-lake);
  font-weight: 600;
}

.reader-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.character-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--story-line);
  border-radius: 4px;
  background: var(--sleeve);
  font-size: 12px;
}

.reader-chars img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sleeve);
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -8px;
  padding: 10px 8px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--story-line);
}

.reader-lang,
.reader-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reader-toolbar button {
  min-height: 34px;
  padding: 4px 11px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: var(--story-panel);
  color: var(--story-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.reader-toolbar button[aria-pressed="true"] {
  border-color: var(--story-ink);
  background: var(--story-ink);
  color: var(--paper);
}

.reader-notice {
  margin: 16px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--story-accent);
  background: color-mix(in srgb, var(--story-accent) 7%, var(--story-panel));
  color: var(--story-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.reader-episodes {
  padding-top: 8px;
}

.episode {
  padding: 34px 0 10px;
  border-bottom: 1px solid var(--story-line);
}

.episode:last-child {
  border-bottom: 0;
}

.episode-head {
  margin-bottom: 18px;
}

.episode-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.35;
}

.episode-cap {
  display: inline-block;
  margin-right: 8px;
  color: var(--story-accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  vertical-align: 0.18em;
}

.episode-meta {
  margin: 0;
  color: var(--story-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.regional-dates { margin-block: 12px; }
.regional-dates > p { margin-block: 0; line-height: 1.6; }

.episode-notice {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-left: 3px solid var(--story-accent);
  background: color-mix(in srgb, var(--story-accent) 6%, var(--story-panel));
  color: var(--story-soft);
  font-size: 0.8rem;
}

.line {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 14px;
  padding: 8px 0;
  font-size: var(--story-font);
  line-height: 1.95;
}

.line-speaker {
  color: var(--story-soft);
  font-size: 0.82em;
  font-weight: 800;
  text-align: right;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.line-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line.narration .line-speaker {
  color: transparent;
}

.line.narration .line-text {
  color: var(--story-soft);
}

.line-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--story-line) 70%, transparent);
}

.line-pair:last-child {
  border-bottom: 0;
}

.line-pair .line {
  display: block;
  padding: 0;
  font-size: var(--story-font);
}

.line-pair .line-speaker {
  display: block;
  margin-bottom: 2px;
  text-align: left;
  font-size: 0.78em;
}

.line-pair .cell-label {
  display: none;
}

.line-pair .line-text {
  color: var(--story-ink);
}

.line-pair .line-text.jp {
  color: var(--story-soft);
}

.scene-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 12px;
  color: var(--story-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.scene-mark::before,
.scene-mark::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--story-line);
}

.reader-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--story-line);
}

.reader-pager a {
  color: var(--story-lake);
  font-size: 0.9rem;
  font-weight: 800;
}

.reader-pager a[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .story-shell,
  .reader-shell {
    width: min(100% - 32px, var(--story-width));
    padding-top: 26px;
  }

  .story-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .story-actions {
    justify-content: flex-start;
  }

  .story-controls {
    margin-top: 12px;
  }

  .story-results.grid {
    grid-template-columns: 1fr;
  }

  .story-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .story-row em {
    display: none;
  }

  .line {
    grid-template-columns: 3.7rem minmax(0, 1fr);
    gap: 10px;
  }

  .line-pair {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }

  .line-pair .cell-label {
    display: inline-block;
    margin-right: 6px;
    color: var(--story-accent);
    font-size: 0.7rem;
    font-weight: 850;
  }

  .reader-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .reader-tools {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .story-intro h1 {
    font-size: 2rem;
  }

  .story-tabs a {
    min-height: 44px;
    padding: 6px 11px;
    font-size: 0.84rem;
  }

  .line {
    grid-template-columns: 3.2rem minmax(0, 1fr);
    font-size: var(--story-font);
  }
}

@media (max-width: 760px) {
  .story-page .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .story-page .topbar-side {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .story-page .topbar nav {
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .story-page .topbar a {
    min-height: 36px;
  }

  .story-page .account-entry {
    min-height: 36px;
  }
}


@media (max-width: 760px) {
  .story-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 8px;
  }

  .story-tabs a {
    justify-content: center;
    min-width: 0;
    padding: 7px 2px;
    font-size: 1rem;
    white-space: nowrap;
  }

  .story-tabs small {
    display: none;
  }

  .story-bands {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .story-band {
    height: 44px;
    padding: 2px;
  }

  .story-band img {
    width: 44px;
    height: 32px;
  }
}
