/* ─── Tokens ───────────────────────────────────── */

:root {
  /* Palette matched to gravity7.com — slightly cooler, more refined cream */
  --bg:           #fafaf7;   /* paper (matches gravity7's --paper) */
  --bg-deep:      #f0eee6;   /* card / inset (matches --paper-2) */
  --bg-card:      #fdfdfa;   /* slightly lighter than --bg for show card surfaces */
  --ink:          #1a1814;   /* ink */
  --ink-soft:     #3b362d;   /* secondary type (gravity7's --ink-2) */
  --ink-muted:    #74695a;   /* tertiary (gravity7's --muted) */
  --ink-faint:    #a8a08e;
  --accent:       oklch(0.62 0.19 45);   /* terracotta (gravity7's --accent-2) */
  --accent-soft:  oklch(0.78 0.10 55);
  --accent-bg:    oklch(0.95 0.04 70);   /* gravity7's --hl */
  --rule:         #e6e1d2;   /* (gravity7's --rule-2) */
  --rule-strong:  #d9d4c4;   /* (gravity7's --rule) */
  --shadow:       0 2px 18px -8px rgba(26, 24, 20, 0.12);
  --shadow-deep:  0 16px 48px -20px rgba(26, 24, 20, 0.32);
  --high-fg:      #1a1814;
  --high-bg:      #f0eee6;
  --high-plus-fg: #fafaf7;
  --high-plus-bg: oklch(0.62 0.19 45);
  --present-fg:  #74695a;
  --present-bg:  transparent;

  --serif-display: 'Fraunces', 'Iowan Old Style', 'Times New Roman', serif;
  --serif-body:    'Newsreader', 'Iowan Old Style', Georgia, serif;
  --mono:          'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─── Reset ─────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, select { font: inherit; color: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

html { font-size: 17px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-feature-settings: "kern", "liga", "onum";
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Dot-grid texture matching gravity7.com */
  background-image: radial-gradient(rgba(26, 24, 20, 0.025) 1px, transparent 1.2px);
  background-size: 5px 5px;
  background-position: 0 0;
}

/* ─── Masthead ──────────────────────────────────── */

.masthead {
  padding: 2.4rem 0 0;
}
.masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}
.masthead-brand-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.masthead-logo {
  display: inline-block;
  width: 64px;
  flex-shrink: 0;
  transition: opacity 180ms ease;
  opacity: 0.85;
}
.masthead-logo:hover { opacity: 1; }
.masthead-logo img {
  width: 100%;
  height: auto;
  display: block;
}
.masthead-brand .masthead-title {
  display: block;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-style: normal;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  letter-spacing: -0.025em;
  line-height: 0.92;
  margin-bottom: 0.4rem;
  color: var(--ink);
  position: relative;
}
.masthead-brand .masthead-title::first-letter {
  font-style: italic;
}
.masthead-brand .masthead-subtitle {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.masthead-brand .masthead-tag {
  font-family: var(--serif-body);
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 540px;
  line-height: 1.5;
  font-style: normal;
}
.masthead-brand .masthead-tag em {
  color: var(--ink-muted);
  font-style: italic;
}
.masthead-nav {
  display: flex;
  gap: 1.6rem;
  align-items: baseline;
}
.mode-btn {
  font-family: var(--serif-body);
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
  letter-spacing: 0.01em;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.masthead-rule {
  margin-top: 1.6rem;
  height: 1px;
  background: var(--rule-strong);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.masthead-rule::after {
  content: "";
  position: absolute;
  top: 4px; left: 0; right: 0;
  height: 1px; background: var(--rule);
  opacity: 0.6;
}

/* ─── Vessel & mode panels ────────────────────── */

.vessel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.2rem 2.5rem 6rem;
}
.mode-panel { animation: fadeUp 600ms ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mode-header {
  margin-bottom: 2.4rem;
  max-width: 760px;
}
.mode-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.mode-title {
  font-family: var(--serif-display);
  font-weight: 350;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--ink);
  text-wrap: balance;
}
.mode-title #totalShows {
  font-style: normal;
  font-feature-settings: "lnum";
  color: var(--accent);
}
.mode-lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.55;
}

/* ─── Filters ──────────────────────────────────── */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.4rem 1.6rem;
  align-items: end;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.4rem;
}
.filter-group { display: flex; flex-direction: column; gap: 0.45rem; }
.filter-group--align-right { align-items: flex-end; }
.filter-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.filter-select, .filter-input {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-strong);
  padding: 0.35rem 0.05rem 0.45rem;
  font-family: var(--serif-body);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
  cursor: pointer;
}
.filter-input { cursor: text; }
.filter-select:hover, .filter-input:hover { border-bottom-color: var(--accent); }
.filter-select:focus, .filter-input:focus { border-bottom-color: var(--accent); }
.filter-result-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ─── Poster image (multi-size) ─────────────────── */

.poster {
  background: var(--bg-deep);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--rule);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poster--fallback {
  padding: 0.5rem;
  text-align: center;
}
.poster-fallback-text {
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 30, "SOFT" 80;
  font-size: 0.78rem;
  line-height: 1.15;
  color: var(--ink-muted);
  font-weight: 350;
}
.poster--card {
  width: 84px;
  height: 126px;
}
.poster--card .poster-fallback-text { font-size: 0.7rem; }
.poster--row {
  width: 56px;
  height: 84px;
}
.poster--row .poster-fallback-text { font-size: 0.62rem; }
.poster--voice {
  width: 38px;
  height: 57px;
}
.poster--voice .poster-fallback-text { font-size: 0.55rem; line-height: 1.05; }
.poster--shelf {
  width: 52px;
  height: 78px;
}
.poster--shelf .poster-fallback-text { font-size: 0.58rem; }
.poster--detail {
  width: 220px;
  height: 330px;
  flex-shrink: 0;
  box-shadow: var(--shadow-deep);
}
.poster--detail .poster-fallback-text { font-size: 1.1rem; line-height: 1.3; }

/* Anchor-only: show is in the library as an entry point but not personally
   recommended. Faded posters + corner mark signal "yes this is here, but it's
   not from the curator's personal canon." */
.poster--anchor-only {
  opacity: 0.55;
  transition: opacity 220ms ease;
}
.poster--anchor-only:hover { opacity: 1; }
.poster--detail.poster--anchor-only { opacity: 1; }
.poster-anchor-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  font-weight: 500;
  pointer-events: none;
}
.poster--detail .poster-anchor-mark {
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 22px;
  top: 8px;
  right: 8px;
}

/* Chan's pick — Adrian's personal favorites. Warm-gold border + AC monogram. */
.poster--chans-pick {
  border-color: oklch(0.78 0.13 65);
  box-shadow: 0 0 0 1px oklch(0.78 0.13 65), 0 4px 14px -6px oklch(0.78 0.13 65 / 0.5);
  animation: pick-breathe 5s ease-in-out infinite;
}
@keyframes pick-breathe {
  0%, 100% { box-shadow: 0 0 0 1px oklch(0.78 0.13 65 / 0.5), 0 4px 14px -8px oklch(0.78 0.13 65 / 0.3); }
  50%      { box-shadow: 0 0 0 1px oklch(0.78 0.13 65), 0 6px 20px -6px oklch(0.78 0.13 65 / 0.6); }
}
.poster-pick-mark {
  position: absolute;
  bottom: 4px;
  right: 4px;
  min-width: 22px;
  height: 14px;
  padding: 0 4px;
  background: oklch(0.62 0.15 65);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  letter-spacing: 0.06em;
  border-radius: 2px;
  pointer-events: none;
  text-transform: uppercase;
}
.poster--detail .poster-pick-mark {
  min-width: 32px;
  height: 22px;
  font-size: 12px;
  line-height: 22px;
  bottom: 8px;
  right: 8px;
  letter-spacing: 0.1em;
}

/* Top result — the #1 ranked match in any current query.
   Highlighted rank, "TOP MATCH" eyebrow, accent left-border. */
.result-row--top {
  background: linear-gradient(to right, var(--accent-bg) 0%, transparent 60%);
  position: relative;
  padding-left: 1rem;
  margin-left: -1rem;
  padding-right: 1rem;
  margin-right: -1rem;
  animation: top-result-enter 600ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes top-result-enter {
  from { opacity: 0; transform: translateY(6px); background-position: -200px 0; }
  to   { opacity: 1; transform: translateY(0); background-position: 0 0; }
}
.result-row--top .result-rank {
  color: var(--accent);
  font-style: italic;
  font-weight: 350;
  font-variation-settings: "opsz" 80, "SOFT" 100;
}
.result-row--top .result-title {
  color: var(--ink);
}
.result-row--top:hover .result-title { color: var(--accent); }
.result-top-eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.result-top-eyebrow::before {
  content: "★";
  font-family: var(--serif-display);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0;
}

/* ─── Show grid ────────────────────────────────── */

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.show-card {
  background: var(--bg-card);
  padding: 1.4rem 1.4rem 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
  transition: background-color 200ms ease, transform 250ms ease;
  text-align: left;
  width: 100%;
  min-height: 200px;
}
.show-card:hover {
  background: var(--bg-deep);
}
.show-card-poster-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.show-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.show-card:hover .show-card-title {
  color: var(--accent);
}
.show-card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  background: var(--accent);
  transition: width 220ms ease;
}
.show-card:hover::before { width: 3px; }

.show-card-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.show-card-year { font-feature-settings: "lnum"; }
.popularity-dots {
  display: inline-flex;
  gap: 2px;
}
.popularity-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.popularity-dot.is-active { background: var(--accent); }

.show-card-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  font-size: 1.6rem;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.005em;
  transition: color 180ms ease;
}
.show-card-prose {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.show-card-modules {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.module-pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 2px 7px 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.module-pill .pill-emoji { margin-right: 4px; font-size: 0.85rem; }

/* ─── Picker cards (anchor + module modes) ──── */

.picker-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.6rem;
  position: relative;
}
.picker-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
}
.picker-label-hint {
  font-family: var(--serif-body);
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  margin-left: 0.4rem;
}
.picker-redirect-hint {
  margin-top: 1rem;
  font-family: var(--serif-body);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.5;
}
.picker-redirect-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid var(--accent-soft);
  transition: color 160ms ease, border-color 160ms ease;
}
.picker-redirect-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.picker-suggestion--empty {
  padding: 1.1rem 1.2rem;
  cursor: default;
  background: var(--bg-deep);
}
.picker-suggestion--empty:hover { background: var(--bg-deep); }
.picker-empty-text {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--serif-body);
}
.picker-empty-text strong {
  font-family: var(--serif-display);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 30, "SOFT" 60;
  color: var(--ink);
}
.picker-empty-text span {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.picker-input-wrap { position: relative; margin-bottom: 1rem; }
.picker-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-strong);
  padding: 0.6rem 0;
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 350;
  font-variation-settings: "opsz" 24, "SOFT" 60;
  font-style: italic;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}
.picker-input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.picker-input:focus { border-bottom-color: var(--accent); }
.picker-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  margin-top: 4px;
  z-index: 10;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: none;
}
.picker-suggestions.is-open { display: block; }
.picker-suggestion {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: var(--serif-body);
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: background-color 120ms ease;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}
.picker-suggestion:hover, .picker-suggestion.is-selected {
  background: var(--accent-bg);
  color: var(--ink);
}
.picker-suggestion-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 1.6rem;
}
.picker-chip {
  background: var(--accent);
  color: #fbf3e2;
  font-family: var(--serif-body);
  font-size: 0.92rem;
  padding: 0.32rem 0.85rem 0.36rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-style: italic;
}
.picker-chip-remove {
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.65;
  transition: opacity 120ms ease;
  font-style: normal;
}
.picker-chip-remove:hover { opacity: 1; }

/* ─── Discovery slider ────────────────────────── */

.discovery-card { background: linear-gradient(180deg, var(--bg-card) 0%, var(--accent-bg) 220%); }
.discovery-explainer {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  font-style: italic;
}
.discovery-track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
}
.discovery-end {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.discovery-end--right { color: var(--accent); }
.discovery-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--rule-strong) 0%, var(--accent) 100%);
  outline: none;
  cursor: pointer;
}
.discovery-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow);
  transition: transform 160ms ease;
}
.discovery-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.discovery-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow);
}

/* ─── Module picker ───────────────────────────── */

.module-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
  margin-bottom: 2.4rem;
}
.module-section {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 1.6rem 1.7rem 1.8rem;
}
.module-section-title {
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 350;
  font-variation-settings: "opsz" 60, "SOFT" 50;
  margin-bottom: 0.4rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
.module-section-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.module-section-sub {
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 1.2rem;
}
.module-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.module-chip {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.45rem 0.85rem 0.5rem;
  border-radius: 2px;
  font-family: var(--serif-body);
  font-size: 0.88rem;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.module-chip:hover {
  border-color: var(--accent-soft);
  color: var(--ink);
}
.module-chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fbf3e2;
}
.module-chip .chip-emoji { font-size: 1rem; }

/* ─── Results area ────────────────────────────── */

.results-area { margin-top: 2.5rem; }
.results-empty {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-muted);
  text-align: center;
  padding: 4rem 1rem;
  font-variation-settings: "opsz" 60, "SOFT" 80;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.8rem;
}
.results-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.results-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.result-row {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1.5rem;
  align-items: start;
  cursor: pointer;
  transition: background-color 200ms ease;
}
.result-row:hover { background: rgba(164, 68, 31, 0.025); }
.result-rank {
  font-family: var(--serif-display);
  font-size: 2rem;
  font-weight: 250;
  font-style: italic;
  font-variation-settings: "opsz" 80, "SOFT" 100;
  color: var(--ink-faint);
  line-height: 0.95;
  font-feature-settings: "lnum";
  min-width: 2.4rem;
}
.result-content { display: flex; flex-direction: column; gap: 0.5rem; }
.result-meta {
  display: flex;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.result-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  font-size: 1.7rem;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 0.3rem;
  letter-spacing: -0.005em;
}
.result-row:hover .result-title { color: var(--accent); }
.result-prose {
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 720px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-explanation {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.7;
}
.result-explanation .matched-label {
  font-style: italic;
  font-family: var(--serif-body);
  font-size: 0.85rem;
  margin-right: 0.5rem;
  color: var(--ink-soft);
}
.result-explanation .matched-module {
  background: var(--accent-bg);
  border: 1px solid var(--accent-soft);
  padding: 1px 7px 2px;
  border-radius: 2px;
  margin-right: 4px;
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  cursor: help;
}
.result-explanation .matched-module:hover { background: var(--accent); color: #fbf3e2; }

.result-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.result-score {
  font-family: var(--serif-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--accent);
  font-feature-settings: "lnum";
  font-variation-settings: "opsz" 60;
}
.result-score-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

/* Row-hover quote panel — richer, multi-quote, sits beside row */
.row-quote-panel {
  position: absolute;
  z-index: 250;
  background: var(--bg-card);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-deep);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 200ms ease, transform 240ms ease;
  max-width: 460px;
  font-family: var(--serif-body);
}
.row-quote-panel.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.row-quote-eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.row-quote {
  margin-bottom: 1.1rem;
  padding-left: 1.4rem;
  position: relative;
  border-left: 1px solid var(--rule);
}
.row-quote:last-child { margin-bottom: 0; }
.row-quote::before {
  content: """;
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-family: var(--serif-display);
  font-size: 2.2rem;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--accent-soft);
  line-height: 1;
}
.row-quote-text {
  font-family: var(--serif-display);
  font-size: 1.02rem;
  font-style: italic;
  font-weight: 350;
  font-variation-settings: "opsz" 30, "SOFT" 60;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.row-quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.row-quote-module {
  font-family: var(--mono);
  font-size: 0.64rem;
  background: var(--bg-deep);
  padding: 1px 5px 2px;
  border-radius: 2px;
  color: var(--ink-soft);
}
.row-quote-empty {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-muted);
  font-variation-settings: "opsz" 30;
  text-align: center;
  padding: 0.5rem 0;
}

/* Quote tooltip on matched module */
.quote-tip {
  position: absolute;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 0.95rem 0.8rem;
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 360px;
  z-index: 200;
  box-shadow: var(--shadow-deep);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  border-left: 2px solid var(--accent);
}
.quote-tip.is-visible { opacity: 1; }
.quote-tip-attr {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.7rem;
  margin-top: 0.45rem;
  color: var(--accent-soft);
  letter-spacing: 0.06em;
}

/* Module chip rollover tooltip (chip → description) */
.module-tip {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  color: var(--ink);
  padding: 0.7rem 0.95rem 0.8rem;
  font-family: var(--serif-body);
  font-size: 0.86rem;
  line-height: 1.5;
  max-width: 340px;
  z-index: 200;
  box-shadow: var(--shadow-deep);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}
.module-tip.is-visible { opacity: 1; }
.module-tip-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.module-tip-emoji { font-size: 1.05rem; }
.module-tip-label {
  font-family: var(--serif-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.module-tip-desc {
  display: block;
  color: var(--ink-soft);
  font-style: italic;
}

/* ─── Detail overlay ──────────────────────────── */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 14, 0.78);
  z-index: 500;
  overflow-y: auto;
  animation: fadeIn 250ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.detail-close {
  position: fixed;
  top: 1.4rem;
  right: 2rem;
  z-index: 510;
  font-family: var(--serif-display);
  font-size: 2.2rem;
  font-weight: 200;
  color: var(--bg);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 23, 14, 0.4);
  transition: background-color 180ms ease, transform 180ms ease;
}
.detail-close:hover { background: var(--accent); transform: rotate(90deg); }

.detail-article {
  background: var(--bg);
  max-width: 1080px;
  margin: 3rem auto;
  padding: 4rem 4rem 5rem;
  position: relative;
  animation: slideUp 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: var(--shadow-deep);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.detail-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  margin-bottom: 1.4rem;
  align-items: end;
}
.detail-hero-content {
  min-width: 0;
}
.detail-eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
.detail-title {
  font-family: var(--serif-display);
  font-weight: 350;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-bottom: 1.4rem;
  max-width: 14ch;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-bottom: 2.5rem;
}
.detail-meta strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  font-weight: 400;
  color: var(--ink-faint);
}
.detail-meta-item .meta-value {
  font-family: var(--serif-body);
  font-size: 0.95rem;
  color: var(--ink);
  font-style: italic;
}
.detail-meta-item .meta-value.is-link {
  color: var(--accent);
  font-style: normal;
  border-bottom: 1px solid var(--accent-soft);
}

.detail-body {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 3.6rem;
  margin-bottom: 3rem;
}
.detail-prose {
  font-family: var(--serif-body);
  font-size: 1.16rem;
  line-height: 1.7;
  color: var(--ink);
  font-feature-settings: "onum", "kern", "liga";
}
.detail-prose p:first-child::first-letter {
  font-family: var(--serif-display);
  font-size: 4.2rem;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  float: left;
  line-height: 0.85;
  margin: 0.04em 0.12em -0.05em -0.04em;
  color: var(--accent);
}
.detail-prose .negative {
  margin-top: 1.2rem;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule-strong);
}

.detail-side {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.detail-side-block { margin-bottom: 2rem; }
.detail-side-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.detail-side-value {
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 80;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.detail-side-value.is-mono {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-style: normal;
  color: var(--accent);
  font-feature-settings: "lnum";
}

/* Pull quote */
.detail-quotes {
  margin: 3rem 0;
  padding: 2.4rem 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.detail-quotes-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
.detail-quote {
  margin-bottom: 1.8rem;
  position: relative;
  padding-left: 3rem;
}
.detail-quote:last-child { margin-bottom: 0; }
.detail-quote::before {
  content: """;
  position: absolute;
  left: 0;
  top: -0.6rem;
  font-family: var(--serif-display);
  font-size: 4rem;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--accent-soft);
  line-height: 1;
}
.detail-quote-text {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 350;
  font-variation-settings: "opsz" 60, "SOFT" 80;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.detail-quote-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
}
.detail-quote-modules {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.detail-quote-modules .quote-module {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--bg-deep);
  padding: 1px 6px 2px;
  border-radius: 2px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.detail-quote-modules .quote-module.is-pivot:hover {
  background: var(--accent);
  color: #fbf3e2;
  border-color: var(--accent);
}
.detail-quote-modules .quote-module.is-pivot:hover::after {
  content: " →";
  font-style: normal;
}
.no-quotes {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-muted);
  font-variation-settings: "opsz" 60;
  text-align: center;
  padding: 1rem 0;
}

/* Taxonomy table */
.detail-taxonomy {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-strong);
}
.detail-taxonomy-title {
  font-family: var(--serif-display);
  font-size: 1.7rem;
  font-style: italic;
  font-variation-settings: "opsz" 80, "SOFT" 80;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.detail-taxonomy-sub {
  font-family: var(--serif-body);
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-bottom: 1.6rem;
  font-style: italic;
}
.detail-taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem 2.4rem;
}
.tax-col-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.tax-list { display: flex; flex-direction: column; gap: 0.45rem; }
.tax-item {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.92rem;
  cursor: help;
  position: relative;
  background: transparent;
  border: none;
  padding: 0.25rem 0.4rem 0.3rem 0;
  text-align: left;
  font-family: inherit;
  border-radius: 2px;
  transition: background-color 140ms ease, transform 140ms ease;
  width: 100%;
}
.tax-item.is-pivot { cursor: pointer; }
.tax-item.is-pivot::after {
  content: "→";
  position: absolute;
  right: -0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif-display);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 140ms ease, right 200ms ease;
}
.tax-item.is-pivot:hover {
  background: var(--accent-bg);
  padding-left: 0.4rem;
}
.tax-item.is-pivot:hover::after {
  opacity: 1;
  right: -0.95rem;
}
.tax-item.is-pivot:hover .tax-item-name {
  color: var(--ink);
}
.tax-item-emoji { font-size: 0.95rem; }
.tax-item-name { color: var(--ink-soft); }
.tax-item-score {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 1px 6px 2px;
  border-radius: 2px;
  white-space: nowrap;
}
.tax-item-score--high-plus {
  background: var(--high-plus-bg);
  color: var(--high-plus-fg);
}
.tax-item-score--high {
  background: var(--high-bg);
  color: var(--high-fg);
  font-weight: 500;
}
.tax-item-score--present {
  border: 1px solid var(--rule);
  color: var(--present-fg);
}
.tax-item--has-justification:hover .tax-item-name {
  color: var(--ink);
}

.detail-anchors {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-strong);
}
.detail-anchors-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.anchor-chip {
  font-family: var(--serif-body);
  font-size: 0.95rem;
  font-style: italic;
  background: var(--bg-deep);
  padding: 0.4rem 0.95rem 0.45rem;
  border-radius: 999px;
  color: var(--ink);
  transition: background-color 160ms ease;
  cursor: pointer;
}
.anchor-chip.is-clickable:hover {
  background: var(--accent);
  color: #fbf3e2;
}
.anchor-chip.is-external::after {
  content: " ↗";
  font-style: normal;
  opacity: 0.5;
  font-size: 0.85em;
}

/* ─── Detail pivot CTA ────────────────────────── */

.detail-pivot {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-strong);
  text-align: center;
}
.pivot-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.4rem 3rem;
  border: 1px solid var(--rule-strong);
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
  position: relative;
  overflow: hidden;
}
.pivot-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 0;
}
.pivot-cta:hover { border-color: var(--accent); }
.pivot-cta:hover::before { transform: scaleX(1); }
.pivot-cta:hover .pivot-cta-eyebrow,
.pivot-cta:hover .pivot-cta-arrow {
  color: #fbf3e2;
  position: relative;
  z-index: 1;
}
.pivot-cta:hover .pivot-cta-arrow em { color: #fbf3e2; }
.pivot-cta-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
  z-index: 1;
  transition: color 220ms ease;
}
.pivot-cta-arrow {
  font-family: var(--serif-display);
  font-size: 1.7rem;
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 80;
  color: var(--ink);
  position: relative;
  z-index: 1;
  transition: color 220ms ease;
}
.pivot-cta-arrow em {
  font-style: normal;
  color: var(--accent);
  font-family: var(--serif-display);
  margin-left: 0.4rem;
  display: inline-block;
  transition: transform 240ms ease;
}
.pivot-cta:hover .pivot-cta-arrow em {
  transform: translateX(8px);
}

/* ─── Reviewer-voice mode ─────────────────────── */

.voice-card .picker-input {
  font-size: 1.7rem;
  font-style: italic;
}
.voice-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
  margin-top: 0.4rem;
}
.voice-suggestions-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-right: 0.4rem;
}
.voice-suggestion-chip {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.35rem 0.85rem 0.4rem;
  border-radius: 999px;
  font-family: var(--serif-body);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.voice-suggestion-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fbf3e2;
}

.voice-results {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.voice-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.8rem 2rem 1.6rem;
  transition: background-color 200ms ease, border-color 200ms ease;
}

/* Semantic-search loading status (above the voice input) */
.semantic-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
  padding: 0.55rem 0.85rem;
  background: var(--accent-bg);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: opacity 300ms ease;
}
.semantic-status.is-ready {
  background: transparent;
  border-color: var(--rule);
  border-left-color: var(--accent-soft);
  color: var(--ink-muted);
}
.semantic-status.is-fading { opacity: 0; }
.semantic-status-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: semantic-spin 800ms linear infinite;
  flex-shrink: 0;
}
.semantic-status.is-ready .semantic-status-spinner {
  border: 2px solid var(--accent);
  background: var(--accent);
  animation: none;
  position: relative;
}
.semantic-status.is-ready .semantic-status-spinner::after {
  content: "✓";
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.semantic-status-text { color: var(--ink); }
.semantic-status-progress {
  margin-left: auto;
  color: var(--accent);
  font-feature-settings: "lnum" 1, "tnum" 1;
}
@keyframes semantic-spin {
  to { transform: rotate(360deg); }
}
.voice-card:hover {
  background: var(--bg);
  border-left-color: var(--ink);
}
.voice-card-quote {
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 1.2rem;
}
.voice-card-quote::before {
  content: """;
  position: absolute;
  left: 0;
  top: -0.3rem;
  font-family: var(--serif-display);
  font-size: 3.2rem;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--accent-soft);
  line-height: 1;
}
.voice-card-text {
  font-family: var(--serif-display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 350;
  font-variation-settings: "opsz" 80, "SOFT" 80;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.voice-card-text mark {
  background: var(--accent);
  color: #fbf3e2;
  padding: 0 4px 1px;
  border-radius: 2px;
  font-style: italic;
}
.voice-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.voice-card-modules {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.voice-card-module {
  font-family: var(--mono);
  font-size: 0.66rem;
  background: var(--bg-deep);
  padding: 1px 6px 2px;
  border-radius: 2px;
  color: var(--ink-soft);
}

.voice-card-show-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.voice-card-show {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--serif-display);
  font-size: 1.45rem;
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 60;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-align: left;
  transition: color 160ms ease;
}
.voice-card-show:hover { color: var(--accent); }
.voice-card-show-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.voice-card-show-row .shelf-btn {
  margin-left: auto;
}

/* ─── Shelf trigger (in masthead nav) ─────────── */

.shelf-trigger {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem 0.45rem;
  font-family: var(--serif-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  margin-left: 0.6rem;
}
.shelf-trigger:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.shelf-trigger.has-items {
  border-color: var(--accent);
  background: var(--accent);
  color: #fbf3e2;
}
.shelf-trigger.has-items:hover { background: #8a3818; }
.shelf-trigger .shelf-icon {
  font-family: var(--serif-display);
  font-size: 0.78rem;
  font-style: italic;
}
.shelf-trigger .shelf-label {
  letter-spacing: 0.01em;
}
.shelf-trigger .shelf-count {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding-left: 0.3rem;
  border-left: 1px solid currentColor;
  opacity: 0.7;
}
.shelf-trigger.has-items .shelf-count { opacity: 1; }

/* ─── Save-to-shelf buttons (compact, icon, wide) ── */

.shelf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  padding: 0.25rem 0.55rem 0.3rem;
  border-radius: 2px;
}
.shelf-btn:hover { border-color: var(--accent); color: var(--accent); }
.shelf-btn.is-on-shelf {
  background: var(--accent);
  border-color: var(--accent);
  color: #fbf3e2;
}
.shelf-btn.is-on-shelf:hover {
  background: #8a3818;
  border-color: #8a3818;
}
.shelf-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}
.shelf-btn .shelf-icon--on { display: none; }
.shelf-btn.is-on-shelf .shelf-icon--off { display: none; }
.shelf-btn.is-on-shelf .shelf-icon--on { display: block; }

/* Icon variant (browse cards) hides the label */
.shelf-btn--icon {
  padding: 0;
  border-radius: 50%;
  width: 28px; height: 28px;
  justify-content: center;
  border: 1px solid var(--rule);
}
.shelf-btn--icon .shelf-btn-label { display: none; }
.shelf-btn--icon .shelf-icon { width: 14px; height: 14px; }

/* Wide variant for detail-view CTA */
.shelf-btn--wide {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px dashed var(--rule-strong);
}
.shelf-btn--wide .shelf-icon { width: 16px; height: 16px; }

.show-card-shelf-slot {
  margin-left: auto;
}
.result-shelf-slot {
  margin-top: 0.4rem;
}
.detail-shelf-cta {
  margin-top: 1rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Glossary overlay ────────────────────────── */

.glossary-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-left: 0.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  vertical-align: middle;
  position: relative;
  top: -0.35em;
}
.glossary-trigger:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}

.glossary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 14, 0.78);
  z-index: 500;
  overflow-y: auto;
  animation: fadeIn 250ms ease;
}
.glossary-close {
  position: fixed;
  top: 1.4rem;
  right: 2rem;
  z-index: 510;
}
.glossary-article {
  background: var(--bg);
  max-width: 920px;
  margin: 3rem auto;
  padding: 4rem 4rem 5rem;
  position: relative;
  animation: slideUp 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: var(--shadow-deep);
}
.glossary-eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
.glossary-title {
  font-family: var(--serif-display);
  font-weight: 350;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1rem;
  letter-spacing: -0.012em;
}
.glossary-lede {
  font-family: var(--serif-body);
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 2.4rem;
  max-width: 600px;
}
.glossary-section {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.glossary-section:first-of-type { border-top: none; padding-top: 0; }
.glossary-section-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 1.65rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.glossary-section-sub {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin-bottom: 1.4rem;
}
.glossary-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
.glossary-item {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--rule);
}
.glossary-item:last-child { border-bottom: none; }
.glossary-item-emoji {
  font-size: 1.3rem;
  line-height: 1.4;
  text-align: center;
}
.glossary-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.glossary-item-label {
  font-family: var(--serif-body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.glossary-item-desc {
  font-family: var(--serif-body);
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ─── Shelf overlay ───────────────────────────── */

.shelf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 14, 0.78);
  z-index: 500;
  overflow-y: auto;
  animation: fadeIn 250ms ease;
}
.shelf-close {
  position: fixed;
  top: 1.4rem;
  right: 2rem;
  z-index: 510;
}
.shelf-article {
  background: var(--bg);
  max-width: 920px;
  margin: 3rem auto;
  padding: 4rem 4rem 5rem;
  position: relative;
  animation: slideUp 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: var(--shadow-deep);
}
.shelf-eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
.shelf-title {
  font-family: var(--serif-display);
  font-weight: 350;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1rem;
  letter-spacing: -0.012em;
}
.shelf-title-count {
  font-style: normal;
  color: var(--accent);
  font-feature-settings: "lnum";
}
.shelf-lede {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 2rem;
  max-width: 520px;
}
.shelf-empty-prose {
  font-size: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 540px;
}

.shelf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.shelf-action-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 1.15rem 0.85rem;
  border: 1px solid var(--rule-strong);
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.shelf-action-btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.shelf-action-btn--danger:hover {
  border-color: #8a3818;
  background: rgba(138, 56, 24, 0.08);
}
.shelf-action-eyebrow {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.shelf-action-label {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.05rem;
  font-variation-settings: "opsz" 30, "SOFT" 60;
  color: var(--ink);
}

.shelf-list { margin-bottom: 2rem; }
.shelf-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1.2rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.shelf-row:last-child { border-bottom: none; }
.shelf-row-num {
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 100;
  font-size: 1.6rem;
  color: var(--ink-faint);
  font-feature-settings: "lnum";
  min-width: 2.4rem;
}
.shelf-row-content { display: flex; flex-direction: column; gap: 0.35rem; }
.shelf-row-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 60;
  font-size: 1.4rem;
  line-height: 1.05;
  color: var(--ink);
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 160ms ease;
}
.shelf-row-title:hover { color: var(--accent); }
.shelf-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.shelf-row-imdb {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
}
.shelf-row-prose {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-top: 0.15rem;
}
.shelf-footer {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ─── Print styles for the shelf ──────────────── */

@media print {
  body::before { display: none; }
  body { background: white; }
  .masthead, .vessel, .footer, .detail-overlay,
  .shelf-close, .no-print, .shelf-empty-prose,
  .shelf-row-actions, .shelf-row-num,
  .shelf-overlay { background: white !important; }
  .shelf-overlay { position: static !important; overflow: visible; padding: 0; }
  .shelf-article {
    box-shadow: none !important;
    margin: 0; padding: 1.5cm 1.5cm 1cm; max-width: none;
    background: white !important;
  }
  body > *:not(.shelf-overlay) { display: none !important; }
  .shelf-overlay[hidden] { display: block !important; }
  .shelf-eyebrow { color: #555 !important; }
  .shelf-title-count { color: #000 !important; }
  .shelf-row { page-break-inside: avoid; padding: 0.6cm 0; }
  .shelf-row .poster { display: none !important; }
  .shelf-row { grid-template-columns: auto 1fr auto !important; }
  .shelf-row-title { color: #000 !important; }
  .shelf-row-meta, .shelf-row-prose { color: #333 !important; }
  .shelf-row-imdb { color: #000 !important; border-bottom: 1px solid #888 !important; }
  .shelf-row-imdb::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #777; }
}

/* ─── Reviewer voice (per-show bar chart) ──────── */

.detail-reviewer-voice {
  margin: 3rem 0 2.5rem;
  padding: 1.6rem 1.8rem 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-soft);
}
.rv-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.rv-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.rv-explainer {
  font-family: var(--serif-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
.rv-tribe-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  padding: 0;
  font: inherit;
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease;
}
.rv-tribe-link:hover { border-bottom-color: var(--accent); }
.rv-chart { display: flex; flex-direction: column; gap: 0.55rem; }
.rv-row {
  display: grid;
  grid-template-columns: 200px 1fr 48px;
  align-items: center;
  gap: 0.85rem;
}
.rv-label {
  font-family: var(--serif-body);
  font-size: 0.88rem;
  color: var(--ink);
  text-align: right;
}
.rv-bar-track {
  height: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.rv-bar-fill {
  height: 100%;
  transition: width 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.rv-value {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: right;
  font-feature-settings: "tnum" 1;
}
@media (max-width: 720px) {
  .rv-row { grid-template-columns: 110px 1fr 40px; }
  .rv-label { font-size: 0.8rem; }
}

/* ─── Find your tribe mode ─────────────────────── */

.tribe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.4rem;
  margin: 1.5rem 0 3rem;
}
.tribe-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--style-color, var(--accent));
  padding: 1.5rem 1.6rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.tribe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tribe-card.is-active {
  border-color: var(--style-color);
  background: var(--bg);
  box-shadow: var(--shadow-deep);
}
.tribe-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.tribe-card-name {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tribe-card-share {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.tribe-card-desc {
  font-family: var(--serif-body);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.tribe-card-samples {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tribe-sample {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-deep);
  border-left: 2px solid var(--style-color);
  font-family: var(--serif-body);
  font-size: 0.82rem;
  line-height: 1.45;
}
.tribe-sample-score {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.tribe-sample-head {
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
}
.tribe-sample-body {
  color: var(--ink-soft);
}
.tribe-sample-show {
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}
.tribe-card-cta {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--style-color);
  color: var(--style-color);
  padding: 0.5rem 0.95rem;
  font-family: var(--serif-body);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.tribe-card-cta:hover {
  background: var(--style-color);
  color: var(--bg);
}
.tribe-card.is-active .tribe-card-cta {
  background: var(--style-color);
  color: var(--bg);
}

.tribe-results { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.5rem; }
.tribe-result-row {
  display: grid;
  grid-template-columns: 32px 56px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  transition: background 160ms ease;
}
.tribe-result-row:hover { background: var(--bg); }
.tribe-result-rank {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}
.tribe-result-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.tribe-result-title {
  font-family: var(--serif-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 160ms ease;
}
.tribe-result-title:hover { color: var(--accent); }
.tribe-result-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.tribe-result-stat { display: flex; flex-direction: column; align-items: flex-end; }
.tribe-result-pct {
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-feature-settings: "lnum";
}
.tribe-result-n {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}
@media (max-width: 720px) {
  .tribe-result-row { grid-template-columns: 28px 48px 1fr auto; }
  .tribe-result-stat { grid-column: 2 / -1; align-items: flex-start; flex-direction: row; gap: 0.6rem; }
}

/* ─── Footer ──────────────────────────────────── */

.footer {
  margin-top: 6rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  font-family: var(--serif-body);
  font-size: 0.86rem;
  color: var(--ink-muted);
  line-height: 1.7;
}
.footer-meta {
  font-style: italic;
  margin-top: 0.3rem;
  color: var(--ink-faint);
}
.footer-attribution {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.footer-attribution a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-strong);
  transition: color 160ms ease, border-color 160ms ease;
}
.footer-attribution a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.footer-copyright {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.footer-copyright a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
}
.footer-copyright a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 880px) {
  .masthead-inner { grid-template-columns: 1fr; }
  .masthead-nav { justify-content: flex-start; flex-wrap: wrap; }
  .vessel { padding: 2rem 1.5rem 3rem; }
  .detail-article { padding: 2.5rem 1.6rem 3rem; }
  .detail-hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .poster--detail { width: 160px; height: 240px; }
  .detail-body { grid-template-columns: 1fr; gap: 2rem; }
  .detail-side { display: flex; flex-wrap: wrap; gap: 1.4rem; }
  .detail-side-block { margin-bottom: 0; flex-basis: calc(50% - 0.7rem); }
  .module-picker { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: auto auto 1fr; gap: 1rem; }
  .result-side {
    grid-column: 1 / -1;
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    gap: 1rem;
    border-top: 1px solid var(--rule);
    padding-top: 0.6rem;
  }
  .result-rank { font-size: 1.4rem; }
  .poster--row { width: 44px; height: 66px; }
  .poster--card { width: 64px; height: 96px; }
  .shelf-row { grid-template-columns: auto auto 1fr; }
  .shelf-row-actions { grid-column: 1 / -1; }
}
