:root {
  --grey: #252528;
  --grey-soft: #2d2d31;
  --grey-card: #36363b;
  --red: #b07a85;
  --red-bright: #c9959f;
  --red-dim: #8f6a73;
  --red-glow: rgba(176, 122, 133, 0.28);
  --ink: #ebe9ec;
  --ink-muted: #a8a4ab;
  --border: rgba(176, 122, 133, 0.2);
  --radius: 8px;
  --radius-lg: 14px;
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-display: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--grey);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}

a {
  color: var(--red-bright);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--ink);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--grey-soft);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.logo:hover {
  color: var(--red-bright);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.tab:hover {
  color: var(--ink);
  background: rgba(176, 122, 133, 0.15);
}
.tab.active {
  color: var(--ink);
  background: var(--red-dim);
  box-shadow: 0 0 20px var(--red-glow);
}

.tab-text-short {
  display: none;
}

/* Content panels */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.panel {
  display: none;
}
.panel.active {
  display: block;
}

.panel h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.tag-selector-wrap {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tag-selector-label {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.tag-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--grey-card);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 10rem;
}

.tag-select:hover,
.tag-select:focus {
  border-color: var(--red-dim);
  outline: none;
}

/* Stories grid */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.story-card {
  cursor: pointer;
  background: var(--grey-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--red-glow);
  border-color: var(--red-dim);
}

.story-cover-wrap {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--grey-soft);
}

.story-state-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.story-state-badge--soon {
  background: rgba(30, 80, 140, 0.95);
  color: #fff;
}

.story-state-badge--new {
  background: rgba(25, 120, 55, 0.95);
  color: #fff;
}

.story-state-badge-star {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  fill: currentColor;
}

.story-state-badge-text {
  white-space: nowrap;
}

/* Row copy of badge: hidden on desktop (cover badge only) */
.story-state-badge--in-row {
  display: none;
}

.story-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.story-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card:hover .story-cover {
  transform: scale(1.03);
}

.story-card-title {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* Characters grid */
.characters-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.characters-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.characters-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
}

.character-card {
  cursor: pointer;
  background: var(--grey-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  text-align: center;
}

.character-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--red-glow);
  border-color: var(--red-dim);
}

.character-avatar-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--grey-soft);
}

.character-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.character-card:hover .character-avatar {
  transform: scale(1.03);
}

.character-card-name {
  display: block;
  padding: 0.75rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* About */
.about-content {
  color: var(--ink-muted);
  max-width: 56ch;
}

.other-authors-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25em 0 0.5em;
  color: var(--ink);
}
.other-authors-subtitle:first-of-type {
  margin-top: 0.5em;
}

.other-authors-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.other-authors-list li {
  margin-bottom: 0.5em;
}
.other-authors-list a {
  color: inherit;
}
.other-authors-list a:hover {
  text-decoration: underline;
}

/* Flyout */
.flyout {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition:
    visibility 0.25s ease,
    opacity 0.25s ease;
}

.flyout.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.flyout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.flyout-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--grey-soft);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px var(--red-glow);
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.flyout.open .flyout-panel {
  transform: translateX(0);
}

body.flyout-open,
body.story-reader-open {
  overflow: hidden;
}

.story-reader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--grey);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    visibility 0.2s ease,
    opacity 0.2s ease;
}

.story-reader.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.story-reader-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-top: max(0.65rem, env(safe-area-inset-top));
  background: var(--grey-soft);
  border-bottom: 1px solid var(--border);
}

.story-reader-back {
  flex-shrink: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--grey-card);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.story-reader-back:hover {
  color: var(--ink);
  border-color: var(--red-dim);
  background: rgba(176, 122, 133, 0.12);
}

.story-reader-heading {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-reader-toolbar-actions {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.story-reader-meta-link {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  background: transparent;
}

.story-reader-meta-link:hover {
  color: var(--ink);
  border-color: var(--red-dim);
}

.story-reader-share-menu {
  position: relative;
}

.story-reader-share-summary {
  position: relative;
  list-style: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1.6rem 0.45rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.story-reader-share-summary::-webkit-details-marker {
  display: none;
}

.story-reader-share-summary::marker {
  content: "";
}

.story-reader-share-summary::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
  pointer-events: none;
}

.story-reader-share-menu[open] .story-reader-share-summary::after {
  margin-top: 0;
  transform: rotate(225deg);
}

.story-reader-share-summary:hover {
  color: var(--ink);
  border-color: var(--red-dim);
}

.story-reader-share-menu[open] .story-reader-share-summary {
  color: var(--ink);
  border-color: var(--red-dim);
  background: rgba(176, 122, 133, 0.08);
}

.story-reader-share-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.4rem;
  min-width: 9.5rem;
  background: var(--grey-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.story-reader-share-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.story-reader-share-link:hover {
  color: var(--ink);
  background: rgba(176, 122, 133, 0.12);
  border-color: var(--border);
}

.story-reader-share-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.story-reader-share-label {
  color: inherit;
  white-space: nowrap;
}

.story-reader-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.story-reader-chapters {
  display: none;
}

@media (min-width: 56rem) {
  .story-reader-chapters:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: min(12.75rem, 30vw);
    border-right: 1px solid var(--border);
    background: var(--grey-soft);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0.6rem 1.5rem;
    padding-left: max(0.6rem, env(safe-area-inset-left));
  }
}

.story-reader-chapters-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.story-reader-chapters-item--h3 .story-reader-chapters-link {
  padding-left: 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.story-reader-chapters-link {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: none;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.story-reader-chapters-link:hover {
  color: var(--ink);
  background: rgba(176, 122, 133, 0.1);
}

.story-reader-chapters-link.is-active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--red-bright);
  background: rgba(176, 122, 133, 0.14);
}

.story-reader-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.25rem 2.5rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

.story-reader-status {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.story-reader-article {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(1rem, 2.8vw, 1.125rem);
  line-height: 1.65;
}

.story-reader-article .story-reader-chapter {
  scroll-margin-top: 0.25rem;
}

.story-reader-article h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.story-reader-article h2:first-child {
  margin-top: 0;
}

.story-reader-article h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.35rem 0 0.5rem;
  color: var(--ink);
  line-height: 1.3;
}

.story-reader-article p {
  margin: 0 0 1rem;
}

.story-reader-article em {
  font-style: italic;
}

.story-reader-article strong {
  font-weight: 700;
}

.story-reader-article .story-reader-inline-link {
  color: var(--red-bright);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.story-reader-article .story-reader-inline-link:hover {
  color: var(--ink);
}

.story-reader-error {
  max-width: 40rem;
  margin: 2rem auto 0;
  text-align: center;
}

.story-reader-error-text {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.story-reader-retry {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--red-dim);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.story-reader-retry:hover {
  background: var(--red);
}

.flyout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--grey-card);
  color: var(--ink-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.flyout-close:hover {
  color: var(--ink);
  background: var(--red-dim);
}

.flyout-cover-wrap {
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--grey-card);
  border: 1px solid var(--border);
}

.flyout-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flyout-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.flyout-title--with-cta {
  margin-bottom: 0.5rem;
}

.flyout-full-story-wrap {
  width: 100%;
  margin: 0 0 1.15rem;
}

.flyout-full-story-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  min-height: 3.35rem;
  padding: 0.95rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  color: #f6fff8;
  background: linear-gradient(180deg, #2ea043 0%, #1f7a32 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 16px rgba(34, 160, 67, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    color 0.2s ease;
}

.flyout-full-story-cta:hover {
  color: #fff;
  background: linear-gradient(180deg, #3fb950 0%, #2ea043 100%);
  box-shadow:
    0 6px 22px rgba(46, 200, 90, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.flyout-full-story-cta:focus {
  outline: none;
}

.flyout-full-story-cta:focus-visible {
  outline: 2px solid #56d364;
  outline-offset: 3px;
}

.flyout-summary {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.flyout-release-date {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.flyout-release-date em {
  font-style: italic;
}

.flyout-subtitle {
  margin: 0 0 1.25rem;
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-muted);
  opacity: 0.85;
}

.flyout-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.flyout-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--ink-muted);
  background: var(--grey-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flyout-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.flyout-link {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--red-dim);
  color: var(--ink);
  border: 1px solid var(--border);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.flyout-link:hover {
  background: var(--red);
  border-color: var(--red-bright);
  box-shadow: 0 0 16px var(--red-glow);
}

#flyout-body {
  padding-top: 2.5rem;
}

.flyout-mode-story .flyout-cover-wrap {
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--grey-card);
  border: 1px solid var(--border);
}

.flyout-links {
  margin-bottom: 1.25rem;
}

.flyout-section {
  margin-top: 1.25rem;
}

.flyout-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.flyout-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flyout-list li {
  margin: 0.25rem 0;
}

.flyout-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--red-bright);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}
.flyout-inline-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.flyout-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.flyout-profile-wrap {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--grey-card);
  border: 1px solid var(--border);
}

.flyout-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flyout-mode-character .flyout-title {
  margin-top: 0;
}

.flyout-character-meta {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Ko-fi tip jar – bottom right */
.floatingchat-container-wrap {
  left: auto !important;
  right: 1rem !important;
  top: auto !important;
  bottom: 1rem !important;
}
.floating-chat-kofi-popup-iframe {
  left: auto !important;
  right: 1rem !important;
  top: auto !important;
  bottom: 4rem !important;
}

/* Mobile / small screens */
@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .logo {
    font-size: 1.2rem;
    flex: 1 1 100%;
  }

  .tabs {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.2rem;
    justify-content: stretch;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.35rem 0.25rem;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
    border-radius: 6px;
  }

  .tab .tab-text-full {
    display: none;
  }
  .tab .tab-text-short {
    display: inline;
  }

  .content {
    padding: 1.25rem 1rem;
  }

  .panel h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* Stories: vertical list with miniature portrait covers (like character avatars) */
  .stories-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .story-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
  }
  .story-card:last-child {
    border-bottom: none;
  }
  .story-card:hover {
    transform: none;
  }

  .story-cover-wrap {
    width: 48px;
    min-width: 48px;
    flex-shrink: 0;
    aspect-ratio: 2 / 3;
    height: auto;
    border-radius: 6px;
    overflow: hidden;
    align-self: center;
  }

  /* Row badge carries state; pill on tiny thumb would be illegible */
  .story-cover-wrap .story-state-badge--on-cover {
    display: none;
  }

  .story-card:hover .story-cover {
    transform: none;
  }

  /* Title + row badge (same row as character names + meta) */
  .story-card-body {
    flex: 1;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0;
    min-height: 0;
  }

  .story-state-badge--in-row {
    display: inline-flex;
    position: static;
    flex-shrink: 0;
    margin-left: auto;
    top: auto;
    left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }

  .story-card-title {
    flex: 1;
    min-width: 0;
    padding: 0;
    font-size: 1rem;
  }

  /* Characters: vertical list for consistency */
  .characters-grid-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .character-card {
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }
  .character-card:last-child {
    border-bottom: none;
  }
  .character-card:hover {
    transform: none;
  }

  .character-avatar-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    aspect-ratio: 1;
  }

  .character-card-name {
    padding: 1rem 1rem 1rem 0;
  }

  /* Flyout full width on small screens */
  .flyout-panel {
    max-width: 100%;
  }
}

/* Optional: link Google Fonts for DM Sans + Cormorant Garamond */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");
