:root {
  --bg: #f5efe4;
  --bg-deep: #ead8c4;
  --panel: rgba(255, 249, 240, 0.76);
  --panel-strong: #fffaf2;
  --text: #17120e;
  --muted: #6d5f53;
  --border: rgba(23, 18, 14, 0.1);
  --accent: #b44d28;
  --accent-soft: #e7c8b2;
  --secondary: #234650;
  --shadow: 0 24px 60px rgba(67, 42, 21, 0.12);
  --font-display: "DM Sans", "Inter", "Avenir Next", sans-serif;
  --font-body: "DM Sans", "Inter", "Avenir Next", sans-serif;
  --radius: 28px;
}

body.dark-mode {
  --bg: #0d1114;
  --bg-deep: #151b20;
  --panel: rgba(18, 24, 28, 0.82);
  --panel-strong: #12181c;
  --text: #f4efe9;
  --muted: #b6a79b;
  --border: rgba(244, 239, 233, 0.1);
  --accent: #ff8d5c;
  --accent-soft: #4a2d21;
  --secondary: #88ced5;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  background:
    radial-gradient(circle at top left, rgba(255, 166, 111, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(35, 70, 80, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f8f1e8 44%, var(--bg-deep) 100%);
}

body.dark-mode {
  background:
    radial-gradient(circle at top left, rgba(255, 141, 92, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(136, 206, 213, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #11161a 46%, var(--bg-deep) 100%);
}

button {
  font: inherit;
}

.top-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 8px;
}

.ghost-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.language-button {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

body.dark-mode .ghost-button {
  background: rgba(255, 255, 255, 0.06);
}

.ghost-button:hover,
.tabs button:hover {
  transform: translateY(-1px);
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 80px 0 56px;
}

.tabs,
.app-state,
#insights-view,
#venues-view,
#timeline-view,
#history-view,
#raw-view {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tabs,
.app-state,
#insights-view,
#venues-view,
#timeline-view,
#history-view,
#raw-view,
.metric-card,
.insight-card,
.venue-card,
.timeline-item,
.hall-row,
.raw-table-wrap {
  border-radius: var(--radius);
}

.tabs {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
}

.tabs button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.tabs button.is-active {
  background: var(--panel-strong);
  color: var(--text);
}

.tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.app-state {
  margin-top: 18px;
  padding: 28px;
}

.app-state h2 {
  margin-bottom: 10px;
}

.app-state p:last-child {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
}

.app-state.is-error {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
}

#insights-view,
#venues-view,
#timeline-view,
#raw-view {
  margin-top: 18px;
  padding: 24px;
}

#history-view {
  margin-top: 18px;
  overflow: clip;
}

.history-header {
  padding: 24px 28px 0;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 72ch);
  justify-content: center;
  gap: clamp(32px, 6vw, 78px);
  padding: 36px clamp(24px, 5vw, 64px) 72px;
}

.history-contents {
  align-self: start;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
  padding-top: 9px;
}

.history-contents > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.history-contents ol,
.history-contents-mobile ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-contents a,
.history-contents-mobile a {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 140ms ease;
}

.history-contents a:hover,
.history-contents-mobile a:hover {
  color: var(--accent);
}

.history-toc-period {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.history-toc-period-link {
  display: grid !important;
  gap: 2px;
}

.history-toc-period-link span {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.history-toc-period-link strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.25;
}

.history-toc-period > ol {
  gap: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.history-toc-period > ol a {
  font-size: 0.72rem;
  line-height: 1.28;
}

.history-contents-mobile {
  display: none;
}

.history-article {
  min-width: 0;
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.12rem);
  line-height: 1.78;
  letter-spacing: -0.006em;
}

.history-article h1,
.history-article h2,
.history-article h3,
.history-article h4,
.history-article h5,
.history-article h6 {
  scroll-margin-top: 32px;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.08;
  text-wrap: balance;
}

.history-article h1 {
  max-width: 18ch;
  margin: 0 0 12px;
  font-size: clamp(2.65rem, 5.8vw, 5.15rem);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.history-subtitle {
  margin: 0 0 58px !important;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.history-period {
  scroll-margin-top: 24px;
  margin-top: 78px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.history-period span {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 6vw, 5.2rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.history-period p {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.history-period + h2 {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.history-article h2 {
  margin: 76px 0 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  letter-spacing: -0.035em;
}

.history-article h3 {
  margin: 50px 0 18px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.history-article h4,
.history-article h5,
.history-article h6 {
  margin: 38px 0 14px;
  font-size: 1.15rem;
}

.history-article p {
  margin: 0 0 1.45em;
}

.history-article strong {
  font-weight: 700;
}

.history-article a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.history-article a:hover {
  text-decoration-color: currentColor;
}

.history-article blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: color-mix(in srgb, var(--panel-strong) 76%, var(--accent-soft));
  font-size: 1.08em;
  font-style: italic;
}

.history-article blockquote p:last-child {
  margin-bottom: 0;
}

.history-article ul,
.history-article ol {
  margin: 0 0 1.6em;
  padding-left: 1.4em;
}

.history-article li {
  padding-left: 0.3em;
  margin-bottom: 0.55em;
}

.history-article hr {
  width: 78px;
  margin: 52px auto;
  border: 0;
  border-top: 1px solid var(--border);
}

.history-article figure {
  margin: 42px 0;
}

.history-article figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
}

.history-article figcaption,
.history-reference-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.history-article pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
}

.history-citation {
  margin-left: 0.12em;
  font-size: 0.68em;
  line-height: 0;
}

.history-citation a {
  display: inline-grid;
  min-width: 1.45em;
  height: 1.45em;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  font-weight: 700;
  text-decoration: none;
}

.history-references {
  margin-top: 76px;
  padding-top: 6px;
}

.history-references ol {
  padding-left: 2.2em;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.history-references li {
  padding-left: 0.45em;
  margin-bottom: 0.85em;
  scroll-margin-top: 24px;
}

.history-references code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.88em;
}

.history-reference-back {
  margin-left: 0.25em;
  font-weight: 700;
  text-decoration: none !important;
}

.history-missing-image {
  display: block;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.history-image {
  max-width: 100%;
  min-width: 0;
  margin: 42px 0;
}

.history-image figcaption {
  overflow-wrap: anywhere;
}

.history-image--inline {
  width: min(100%, 42rem);
  margin-inline: auto;
}

.history-image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 42px 0;
}

.history-image-pair .history-image {
  margin: 0;
}

.history-image-meta {
  display: block;
  margin-top: 4px;
}

.history-image-credit,
.history-image-year {
  color: var(--muted);
}

.history-map {
  max-width: 100%;
  min-width: 0;
  scroll-margin-top: 24px;
  margin-top: 82px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.history-map-header h2 {
  margin: 8px 0 16px;
  padding: 0;
  border: 0;
}

.history-map-header > p:last-child {
  max-width: 58ch;
  color: var(--muted);
}

.history-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 12px;
}

.history-map-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.history-map-filter:hover,
.history-map-filter.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--text);
}

.history-map-summary {
  margin-bottom: 14px !important;
  color: var(--muted);
  font-size: 0.78rem;
}

.history-map-plot {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(color-mix(in srgb, var(--border) 34%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 34%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--panel-strong) 92%, var(--accent-soft));
  background-size: 32px 32px;
}

.history-map-plot.is-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.history-map-plot.is-empty p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-map-marker {
  position: absolute;
  left: var(--map-x);
  top: var(--map-y);
  width: 20px;
  height: 20px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 3px solid var(--panel-strong);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 48%, var(--border));
  cursor: pointer;
}

.history-map-marker.is-selected {
  width: 26px;
  height: 26px;
}

.history-map-browser {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.history-map-sites {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: 420px;
  margin: 0 !important;
  padding: 0 6px 0 0 !important;
  overflow-y: auto;
  list-style: none;
}

.history-map-sites li {
  margin: 0;
  padding: 0;
}

.history-map-sites button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.history-map-sites button:hover,
.history-map-sites button.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
}

.history-map-sites button strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.history-map-sites button span {
  color: var(--muted);
  font-size: 0.7rem;
}

.history-map-detail {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  overflow-wrap: anywhere;
}

.history-map-detail h3 {
  margin: 9px 0 12px;
  font-size: 1.35rem;
}

.history-map-detail p {
  margin-bottom: 0.8em;
  font-size: 0.84rem;
  line-height: 1.55;
}

.history-map-lineage {
  color: var(--accent);
  font-weight: 650;
}

.history-map-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-map-periods {
  display: grid;
  gap: 6px;
  margin: 16px 0;
}

.history-map-periods div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.history-map-periods dt,
.history-map-periods dd {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

.history-map-periods dd {
  color: var(--muted);
}

.primary-metrics,
.insight-cloud {
  display: grid;
  gap: 16px;
}

.primary-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.insight-card,
.venue-card,
.hall-row,
.timeline-item {
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.metric-card {
  padding: 18px 20px 22px;
}

.metric-card span,
.insight-card span,
.insight-card small,
.section-kicker,
.section-note,
.timeline-date span,
.timeline-copy p,
.movie-subtitle,
.movie-native-title,
.movie-meta,
.venue-head p,
.venue-meta,
.hall-count,
.hall-visit span,
.empty-state,
.empty-row {
  color: var(--muted);
  font-weight: 500;
}

.movie-title {
  display: grid;
  gap: 4px;
}

.movie-title-main {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.movie-title-text,
.movie-release-year {
  min-width: 0;
}

.movie-release-year {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 700;
}

.movie-subtitle,
.movie-native-title,
.movie-meta {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}

.movie-native-title {
  font-size: 0.72rem;
  opacity: 0.82;
}

.archive-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}

.metric-card span {
  display: block;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.95;
}

.metric-xl strong {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
}

.metric-lg strong {
  font-size: clamp(2rem, 3.8vw, 3.3rem);
}

.metric-md strong {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.insight-cloud {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 18px;
}

.insight-card {
  display: grid;
  gap: 9px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: color-mix(in srgb, var(--accent) 66%, transparent);
  opacity: 0.7;
}

.insight-card small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.insight-card p {
  margin: 0;
  line-height: 1.2;
}

.insight-card.strong {
  grid-column: span 6;
}

.insight-card.strong p {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  font-family: var(--font-display);
  font-weight: 700;
}

.insight-card.medium {
  grid-column: span 4;
}

.insight-card.medium p {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

.insight-card.soft,
.insight-card.faint {
  grid-column: span 3;
}

.insight-card.soft p,
.insight-card.faint p {
  font-size: 1.05rem;
}

.insight-card.poster-insight {
  grid-column: span 3;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

.insight-poster,
.insight-poster-fallback {
  width: 58px;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 12px;
  object-fit: cover;
}

.insight-poster-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.category-money::before {
  background: #5f8f5a;
}

.category-time::before {
  background: var(--accent);
}

.category-venue::before {
  background: var(--secondary);
}

.category-social::before {
  background: #c8943d;
}

.category-content::before {
  background: #8e6fba;
}

.category-pattern::before {
  background: #b85d68;
}

.heatmap {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.heatmap-head,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.section-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section-note {
  margin: 0;
}

.heatmap-frame {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  margin-top: 22px;
  align-items: start;
}

.heatmap-years {
  display: grid;
  grid-template-rows: repeat(var(--row-count, 1), minmax(18px, 1fr));
  gap: 6px;
  padding-top: 28px;
  text-align: right;
  font-size: 0.76rem;
  line-height: 18px;
  color: var(--muted);
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(var(--column-count), minmax(0, 1fr));
  grid-template-rows: repeat(var(--row-count, 1), minmax(18px, 1fr));
  gap: 4px;
  min-width: 520px;
}

.heatmap-cell {
  width: 100%;
  min-width: 4px;
  min-height: 18px;
  border-radius: 4px;
  background: color-mix(
    in srgb,
    var(--panel-strong) calc(86% - (var(--intensity) * 32%)),
    var(--secondary) calc(14% + (var(--intensity) * 32%))
  );
}

.month-labels {
  display: grid;
  grid-template-columns: repeat(var(--column-count), minmax(0, 1fr));
  gap: 4px;
  min-width: 520px;
  margin-bottom: 10px;
}

.month-label {
  font-size: 0.72rem;
  color: transparent;
  white-space: nowrap;
}

.month-label.visible {
  color: var(--muted);
}

.venues-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.venue-card {
  padding: 20px;
}

.venue-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.venue-title-block {
  display: grid;
  gap: 8px;
}

.venue-logo-mark {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--muted);
}

.venue-logo-mark .ticket-logo {
  width: 58px;
  height: 22px;
}

.venue-logo-mark .ticket-logo-fallback {
  width: auto;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
}

.venue-head h3 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.venue-head p {
  margin: 8px 0 0;
}

.venue-stat {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.venue-stat strong {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 700;
  line-height: 0.9;
}

.venue-stat span,
.venue-meta,
.hall-count,
.hall-visit span {
  font-size: 0.86rem;
}

.venue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.venue-meta span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent-soft));
}

.venue-trivia {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
}

.venue-trivia p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hall-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.hall-row {
  overflow: hidden;
}

.hall-row summary {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 13px 14px;
  list-style: none;
  cursor: pointer;
}

.hall-row summary::-webkit-details-marker {
  display: none;
}

.hall-name {
  font-weight: 700;
}

.hall-bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 52%, transparent);
}

.hall-bar span {
  display: block;
  width: calc(var(--hall-share) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.hall-visits {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.hall-row.is-unresolved {
  border-style: dashed;
}

.hall-alias-list {
  display: grid;
  gap: 6px;
  padding: 10px 0 4px;
}

.hall-alias-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.86rem;
}

.hall-alias-row span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.hall-alias-row strong {
  color: var(--text);
}

.hall-alias-row small,
.hall-resolution-note {
  color: var(--muted);
  font-size: 0.76rem;
}

.hall-resolution-note {
  margin: 4px 0;
  line-height: 1.4;
}

.hall-visit {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.timeline-stream {
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.timeline-year {
  display: grid;
  gap: 14px;
}

.year-marker span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  color: var(--accent);
}

.timeline-items {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
}

.timeline-item.has-poster {
  grid-template-columns: 180px 54px minmax(0, 1fr);
}

.poster-thumb {
  width: 54px;
  margin: 0;
  align-self: start;
}

.poster-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.timeline-date strong,
.timeline-copy h3 {
  display: block;
}

.timeline-date strong {
  font-size: 1rem;
}

.timeline-copy h3 {
  font-size: 1.5rem;
}

.timeline-copy p {
  margin: 8px 0 0;
}

.imdb-link {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  vertical-align: middle;
}

.raw-record-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  max-width: 100%;
  min-width: 0;
}

.raw-record-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel-strong);
}

.raw-record-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  min-width: 0;
  align-items: start;
}

.raw-record-main > div,
.raw-record-meta {
  min-width: 0;
}

.raw-record-main strong,
.raw-record-main span,
.raw-record-meta span {
  overflow-wrap: anywhere;
}

.raw-record-main > div > span,
.raw-record-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.raw-record-seat {
  text-align: right;
}

.raw-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.raw-record-meta span {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent-soft));
}

.raw-record-meta .raw-flag {
  border-style: dashed;
}

@media (max-width: 980px) {
  .primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-card.strong,
  .insight-card.medium,
  .insight-card.soft,
  .insight-card.faint,
  .insight-card.poster-insight {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1160px);
    padding-top: 74px;
  }

  .tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
  }

  .tabs button {
    flex: 0 0 auto;
    padding: 10px 12px;
  }

  .primary-metrics,
  .insight-cloud {
    grid-template-columns: 1fr;
  }

  .insight-card.strong,
  .insight-card.medium,
  .insight-card.soft,
  .insight-card.faint,
  .insight-card.poster-insight {
    grid-column: span 1;
  }

  .heatmap-head,
  .section-header {
    flex-direction: column;
  }

  .venue-head,
  .hall-grid,
  .raw-record-main {
    grid-template-columns: 1fr;
  }

  .venue-stat {
    justify-items: start;
  }

  .raw-record-seat {
    text-align: left;
  }

  .heatmap-frame {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
  }

  .heatmap {
    padding: 16px;
  }

  .heatmap-years {
    font-size: 0.66rem;
  }

  .heatmap-grid,
  .month-labels {
    min-width: 500px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item.has-poster {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .timeline-item.has-poster .timeline-date {
    grid-column: 1 / -1;
  }

  .history-header {
    padding: 20px 18px 0;
  }

  .history-layout {
    display: block;
    padding: 28px 18px 52px;
  }

  .history-contents {
    display: none;
  }

  .history-contents-mobile {
    display: block;
    margin: 20px 18px 0;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-strong);
  }

  .history-contents-mobile summary {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
  }

  .history-contents-mobile nav {
    padding: 14px 2px 4px;
  }

  .history-article {
    font-size: 1rem;
    line-height: 1.72;
  }

  .history-article h1 {
    margin-bottom: 10px;
    font-size: clamp(2.25rem, 12vw, 3.5rem);
  }

  .history-subtitle {
    margin-bottom: 42px !important;
    font-size: 1.1rem;
  }

  .history-article h2 {
    margin-top: 58px;
  }

  .history-period {
    margin-top: 58px;
    padding-top: 22px;
  }

  .history-period span {
    font-size: clamp(2.9rem, 14vw, 4.25rem);
  }

  .history-period + h2 {
    margin-top: 16px;
  }

  .history-article blockquote {
    margin: 28px 0;
    padding: 18px 20px;
  }

  .history-image-pair,
  .history-map-browser {
    grid-template-columns: 1fr;
  }

  .history-map {
    margin-top: 62px;
  }

  .history-map-plot {
    min-height: 220px;
  }

  .history-map-sites {
    max-height: 310px;
  }
}
