:root {
  --paper: #f6f5f0;
  --surface: #ffffff;
  --ink: #21323b;
  --muted: #65757d;
  --line: #e3e8e7;
  --coral: #d95d45;
  --coral-dark: #aa3f2e;
  --teal: #246e78;
  --teal-pale: #e5f0ed;
  --teal-chart-pale: #a8cacc;
  --blue: #4b87c0;
  --shadow: 0 18px 48px rgba(26, 49, 58, 0.055);
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
a:hover { color: var(--coral-dark); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(36, 110, 120, .55); outline-offset: 3px; }
.page-width { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.story-section { scroll-margin-top: 100px; }

.site-header { position: sticky; z-index: 100; top: 0; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); font-size: .78rem; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.brand-mark { flex: none; display: block; width: 31px; height: 31px; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.site-nav a { font-size: .88rem; font-weight: 650; color: #53666d; white-space: nowrap; }
.site-nav a:hover { color: var(--coral-dark); }

.d3-dashboard { padding-bottom: 100px; }
.opening-section { padding-top: 10px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr); }
.hero-copy { position: relative; z-index: 1; padding: 26px clamp(16px, 3vw, 38px) 26px 0; align-self: start; }
.eyebrow { margin: 0 0 14px; color: var(--coral-dark); font-size: .72rem; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
.eyebrow-line { display: inline-block; width: 23px; height: 2px; margin: 0 7px 4px 0; background: currentColor; }
.hero h1, .section-heading h2, .panel-heading h2, .panel-heading h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.038em; }
.hero h1 { max-width: 670px; margin: 0 0 22px; font-size: clamp(2.8rem, 5vw, 4.9rem); line-height: 1.05; font-weight: 600; }
.hero h1 em { color: var(--coral-dark); font-style: normal; }
.hero-lead { max-width: 570px; margin: 0; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; font-weight: 530; }
.hero-art { position: absolute; top: 0; right: 0; width: 44%; height: 430px; pointer-events: none; }
.hero-art::before { position: absolute; top: 50%; left: 52%; width: min(92%, 410px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 68% 40%, #f9d4b6 0, #f2c6a5 48%, #efb38f 100%); content: ""; transform: translate(-50%, -50%); }
.hero-brick { position: absolute; box-sizing: border-box; width: 210px; height: 185px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; padding: 24px; border-radius: 2px; transform: rotate(-18deg); }
.hero-brick i { display: block; width: 78%; aspect-ratio: 1; align-self: start; justify-self: center; margin-top: 2px; border-radius: 50%; }
.brick-back { top: 60px; right: 30px; background: #e2835f; box-shadow: 0 29px 0 #ba6049, 0 42px 32px rgba(119, 54, 39, .25); transform: rotate(17deg); }
.brick-back i { background: #ea9674; box-shadow: 0 12px 0 #c36a4f, inset 0 -4px 0 rgba(150,64,44,.22), 0 16px 6px rgba(118,52,38,.18); }
.brick-front { top: 170px; left: 10%; background: #db5d45; box-shadow: 0 30px 0 #ac4639, 0 45px 34px rgba(113,49,37,.32); }
.brick-front i { background: #e9775b; box-shadow: 0 12px 0 #ba4f3e, inset 0 -4px 0 rgba(147,50,38,.28), 0 16px 6px rgba(105,41,35,.2); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 3.2vw, 3.1rem); line-height: 1.16; font-weight: 600; }
.section-heading > p, .section-heading > div > p:not(.eyebrow) { max-width: 590px; margin: 0; color: var(--muted); line-height: 1.65; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { position: relative; min-height: 155px; padding: 23px 24px; background: #f6f8f7; border: 1px solid var(--line); border-radius: 15px; }
.metric-index { position: absolute; top: 24px; right: 26px; color: #c0cdcc; font-size: .76rem; font-weight: 800; letter-spacing: .13em; }
.metric-value { margin: 10px 0 6px; color: var(--teal); font-family: Georgia, serif; font-size: clamp(2.4rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -.05em; }
.metric-card h3 { margin: 0 0 5px; font-size: .99rem; font-weight: 750; }
.metric-note { margin: 0; color: var(--muted); font-size: .83rem; }

.chart-panel { margin-top: 24px; padding: clamp(22px, 3vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.trend-panel { position: relative; z-index: 1; margin-top: 8px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-bottom: 26px; }
.panel-heading .eyebrow { margin-bottom: 10px; }
.panel-heading h2 { margin: 0 0 9px; font-size: clamp(1.8rem, 2.5vw, 2.6rem); font-weight: 600; }
.panel-heading h3 { margin: 0 0 9px; font-size: clamp(1.5rem, 2vw, 2.15rem); font-weight: 600; }
.panel-heading p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding: 21px; margin-bottom: 16px; border: 1px solid #e7eceb; border-radius: 15px; background: #f6f8f7; }
.filter-field label, .filter-label { display: block; margin: 0 0 8px; color: #42555c; font-size: .8rem; font-weight: 750; }
.filter-field select { box-sizing: border-box; width: 100%; height: 43px; padding: 0 32px 0 12px; appearance: none; -webkit-appearance: none; border: 1px solid #cbd8d7; border-radius: 9px; background-color: #fff; color: var(--ink); font-size: .87rem; cursor: pointer; }
.filter-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36,110,120,.15); }
.filter-field:not(.year-filter-field) { position: relative; }
.filter-field:not(.year-filter-field)::after { position: absolute; right: 13px; bottom: 17px; width: 8px; height: 8px; border-right: 1.5px solid #52676c; border-bottom: 1.5px solid #52676c; content: ""; transform: translateY(-2px) rotate(45deg); pointer-events: none; }
.year-filter-field { position: relative; }
.year-filter summary { display: flex; align-items: center; justify-content: space-between; height: 43px; padding: 0 12px; border: 1px solid #cbd8d7; border-radius: 9px; background: #fff; color: var(--ink); font-size: .87rem; cursor: pointer; list-style: none; }
.year-filter summary::-webkit-details-marker { display: none; }
.year-filter summary::after { content: ""; width: 8px; height: 8px; margin-left: 12px; border-right: 1.5px solid #52676c; border-bottom: 1.5px solid #52676c; transform: translateY(-2px) rotate(45deg); }
.year-filter[open] summary { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36,110,120,.15); }
.year-filter[open] summary::after { transform: translateY(2px) rotate(225deg); }
.year-filter-menu { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 340px; max-width: calc(100vw - 60px); padding: 21px; border: 1px solid #cbd8d7; border-radius: 13px; background: #fff; box-shadow: 0 16px 38px rgba(26,49,58,.17); }
.year-range-values { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: .8rem; }
.year-range-values span { display: grid; gap: 4px; }
.year-range-values span:last-child { text-align: right; }
.year-range-values output { color: var(--ink); font-size: 1rem; font-weight: 750; }
.year-range-track { position: relative; height: 40px; margin: 0 12px; touch-action: none; cursor: pointer; }
.year-range-track::before, .year-range-selected { position: absolute; top: 17px; right: 0; left: 0; height: 6px; border-radius: 99px; background: #dce6e5; content: ""; }
.year-range-selected { left: var(--start-position, 0%); right: calc(100% - var(--end-position, 100%)); background: var(--teal); }
.year-range-thumb { position: absolute; z-index: 1; top: 2px; left: var(--position); width: 18px; height: 36px; padding: 0; border: 3px solid var(--teal); background: #fff; box-shadow: 0 2px 5px rgba(26,49,58,.17); cursor: grab; touch-action: none; }
#year-start { border-radius: 18px 0 0 18px; transform: translateX(-100%); }
#year-end { border-radius: 0 18px 18px 0; }
.year-range-thumb:active { cursor: grabbing; }
.year-range-thumb:focus-visible { outline: 3px solid #82b9bd; outline-offset: 3px; }
.year-range-bounds { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: #87999d; font-size: .72rem; }
.chart-caption { display: flex; align-items: start; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.caption-key { flex: none; width: 28px; height: 2px; margin-top: 9px; background: var(--teal); box-shadow: 0 4px 0 var(--teal-chart-pale); }
.chart-note { margin: 6px 0 0 38px; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.data-status { margin: 12px 0 0; color: #9b3e31; font-weight: 650; }
.data-status:empty { display: none; }

.story-transition { max-width: 570px; margin: 62px 0 0; }

.reasons-section { position: relative; margin-top: 55px; padding: clamp(28px, 4vw, 52px) clamp(22px, 3vw, 38px) 66px; border-radius: 27px; background: #e7eeeb; overflow: hidden; }
.reasons-heading { position: relative; align-items: start; }
.reasons-heading h2 { max-width: 690px; }
.reasons-heading .section-lead { margin-top: 18px !important; max-width: 730px !important; color: #344d54 !important; font-size: 1.17rem; }
.question-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 34px; }
.question-card { display: block; width: 100%; min-height: 195px; padding: 26px; border: 1px solid rgba(36,110,120,.13); border-radius: 16px; background: rgba(255,255,255,.7); color: var(--ink); text-align: left; cursor: pointer; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.question-card:hover { border-color: rgba(217,93,69,.5); background: #fff; transform: translateY(-2px); }
.question-card[aria-selected="true"] { border-color: var(--coral); background: #fff7f4; box-shadow: 0 10px 24px rgba(217,93,69,.14); }
.question-card[aria-selected="true"] .question-kicker { color: var(--coral-dark); }
.question-icon { width: 47px; height: 42px; display: flex; align-items: end; gap: 4px; margin-bottom: 24px; }
.question-icon i { display: block; width: 12px; border-radius: 3px 3px 0 0; background: #6a9a96; }
.icon-death-star { background: var(--teal); -webkit-mask: url("death-star-svgrepo-com.svg") center / 42px 42px no-repeat; mask: url("death-star-svgrepo-com.svg") center / 42px 42px no-repeat; }
.question-card[aria-selected="true"] .icon-death-star { background: var(--coral); }
.icon-tree { align-items: center; color: var(--teal); }
.icon-tree svg { display: block; width: 47px; height: 42px; }
.question-card[aria-selected="true"] .icon-tree { color: var(--coral); }
.icon-price-tag { align-items: center; }
.icon-price-tag svg { display: block; width: 47px; height: 42px; }
.icon-price-tag path { fill: var(--coral); }
.icon-price-tag text { fill: #fff; font-size: 22px; font-weight: 800; }
.icon-high-cost { align-items: center; }
.icon-high-cost svg { display: block; width: 47px; height: 42px; }
.icon-high-cost path { fill: var(--teal); }
.icon-high-cost .icon-box-seams { fill: none; stroke: #fff; stroke-width: 1.5; }
.question-card[aria-selected="true"] .icon-high-cost path:not(.icon-box-seams) { fill: var(--coral); }
.question-kicker { margin: 0 0 9px; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.question-card .question-kicker { display: block; }
.question-title { display: block; max-width: 230px; margin: 0; font-family: Georgia, serif; font-size: 1.27rem; line-height: 1.3; font-weight: 600; }
.reason-charts:not(:empty) { display: grid; gap: 20px; margin-top: 24px; }
.reason-chart-card { min-width: 0; padding: clamp(22px, 3vw, 34px); border: 1px solid rgba(36,110,120,.12); border-radius: 20px; background: #fff; box-shadow: 0 12px 35px rgba(27,61,63,.07); }
.reason-chart-placeholder { display: flex; min-height: 360px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.reason-chart-placeholder h3 { margin: 0 0 9px; font-family: Georgia, serif; font-size: clamp(1.55rem, 2.6vw, 2.1rem); font-weight: 600; }
.reason-chart-placeholder > p:last-child { margin: 0; color: var(--muted); }
.reason-chart-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.reason-chart-heading h3 { margin: 0 0 9px; font-family: Georgia, serif; font-size: clamp(1.55rem, 2.6vw, 2.1rem); font-weight: 600; line-height: 1.2; }
.reason-chart-heading p:last-child { max-width: 590px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.advent-calendar-heading { align-items: end; }
.advent-calendar-select-label { display: grid; flex: 0 0 min(250px, 35%); gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .04em; }
.advent-calendar-select-label select { box-sizing: border-box; width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid #cbd8d7; border-radius: 9px; background: #fff; color: var(--ink); font-size: .91rem; font-weight: 550; cursor: pointer; }
.advent-calendar-latest { margin: 30px 0 11px; color: var(--ink); font-size: .88rem; font-weight: 700; }
.advent-calendar-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.advent-calendar-metrics > div { display: grid; gap: 5px; min-width: 0; padding: 17px 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.advent-calendar-metrics span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.advent-calendar-metrics strong { color: var(--ink); font-size: clamp(1.3rem, 2vw, 1.75rem); line-height: 1.1; }
.advent-calendar-legend { display: flex; flex-wrap: wrap; gap: 11px 24px; margin: 24px 0 8px; color: #40565d; font-size: .82rem; font-weight: 650; }
.advent-calendar-legend span { display: inline-flex; align-items: center; gap: 8px; }
.advent-calendar-legend i { display: inline-block; width: 22px; flex: none; }
.advent-key-price { border-top: 3px solid var(--coral); }
.advent-key-pieces { border-top: 3px solid var(--teal); }
.advent-calendar-legend .advent-key-minifigs { width: 12px; height: 12px; background: var(--blue); opacity: .65; }
#advent-calendar-chart { min-height: 460px; overflow-x: auto; }
#advent-calendar-chart svg { width: max(100%, 820px); }
.d3-chart .advent-minifig-bar { fill: var(--blue); opacity: .36; cursor: crosshair; }
.d3-chart .advent-minifig-bar:hover { opacity: .62; }
.d3-chart .advent-minifig-bar.is-missing { fill: #fff; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 3 2; opacity: 1; }
.d3-chart .advent-minifig-missing-label { fill: var(--blue); font-size: 12px; font-weight: 800; pointer-events: none; }
.d3-chart .advent-combined-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.d3-chart .advent-combined-line.advent-price { stroke: var(--coral); }
.d3-chart .advent-combined-line.advent-pieces { stroke: var(--teal); }
.d3-chart .advent-combined-point { stroke: #fff; stroke-width: 1.5; cursor: crosshair; }
.d3-chart .advent-combined-point:hover { stroke: var(--ink); stroke-width: 2; }
.d3-chart .advent-price-point { fill: var(--coral); }
.d3-chart .advent-pieces-point { fill: var(--teal); }
.d3-chart .axis-advent-price text { fill: var(--coral-dark); }
.d3-chart .axis.axis-advent-pieces text { fill: var(--teal); }
.d3-chart .axis.axis-advent-minifigs text { fill: var(--blue); }
.advent-calendar-note { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.price-comparison-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px 24px; margin: 24px 8px 10px; color: #40565d; font-size: .82rem; font-weight: 650; }
.price-comparison-legend span { display: inline-flex; align-items: center; gap: 8px; }
.price-comparison-legend .legend-mac-entry { margin-left: auto; text-align: right; }
.price-comparison-legend i { display: inline-block; flex: none; }
.legend-sets { width: 13px; height: 13px; border-radius: 2px; background: var(--coral); }
.legend-mac { width: 23px; border-top: 3px solid var(--teal); }
#top-five-price-chart { min-height: 390px; overflow-x: auto; }
#top-five-price-chart svg { width: max(100%, 560px); }
.d3-chart .top-five-price-bar { fill: var(--coral); opacity: .82; }
.d3-chart .top-five-price-bar:hover { opacity: 1; }
.d3-chart .big-mac-price-line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linejoin: round; }
.d3-chart .big-mac-price-point { fill: var(--teal); stroke: #fff; stroke-width: 1; }
.d3-chart .axis-big-mac path, .d3-chart .axis-big-mac line { stroke: var(--teal); }
.d3-chart .axis-big-mac text { fill: var(--teal); }
.high-cost-legend { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 24px 8px 10px; color: #40565d; font-size: .82rem; font-weight: 650; }
.high-cost-legend span { display: inline-flex; align-items: center; gap: 8px; }
.high-cost-legend i { display: inline-block; flex: none; }
.legend-high-cost-count { width: 13px; height: 13px; background: var(--coral); }
.legend-high-cost-share { width: 23px; border-top: 3px solid var(--teal); }
#high-cost-chart { min-height: 410px; overflow-x: auto; }
#high-cost-chart svg { width: max(100%, 760px); }
.d3-chart .high-cost-bar { fill: var(--coral); opacity: .82; }
.d3-chart .high-cost-share-line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.d3-chart .high-cost-share-point { fill: var(--teal); stroke: #fff; stroke-width: 1; }
.d3-chart .high-cost-year-hit { fill: transparent; cursor: crosshair; }
.d3-chart .axis-high-cost-count text { fill: var(--coral-dark); }
.d3-chart .axis-high-cost-share text { fill: var(--teal); }
.high-cost-note { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.star-wars-legend { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 24px 8px 10px; color: #40565d; font-size: .82rem; font-weight: 650; }
.star-wars-legend span { display: inline-flex; align-items: center; gap: 8px; }
.star-wars-legend i { display: inline-block; flex: none; }
.legend-star-wars-range { width: 19px; height: 11px; background: rgba(36,110,120,.19); }
.legend-star-wars-median { width: 23px; border-top: 3px solid var(--coral); }
#star-wars-value-chart { min-height: 390px; overflow-x: auto; }
#star-wars-value-chart svg { width: max(100%, 640px); }
.d3-chart .star-wars-range { fill: rgba(36,110,120,.19); }
.d3-chart .star-wars-median-line { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.d3-chart .star-wars-median-point { fill: var(--coral); stroke: #fff; stroke-width: 1.5; }
.d3-chart .star-wars-hit-area { fill: transparent; cursor: crosshair; }
.annual-top-five-section { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--line); }
.annual-top-five-section > p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
#annual-top-five-price-chart { min-height: 520px; overflow-x: auto; }
#annual-top-five-price-chart svg { width: max(100%, 760px); }
.d3-chart .annual-top-five-bar.star-wars { fill: var(--coral); }
.d3-chart .annual-top-five-bar.other-theme { fill: var(--teal); }
.d3-chart .annual-top-five-bar:hover { filter: brightness(.9); }
.d3-chart .annual-top-five-year-axis text { fill: var(--ink); font-size: 12px; font-weight: 650; }
.reason-chart-note { margin: 12px 0 0; padding: 15px 0 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.55; }
.reason-chart-note li + li { margin-top: 4px; }

.explore-section { margin-top: 92px; padding: clamp(28px, 4vw, 52px) clamp(22px, 3vw, 38px); border: 1px solid var(--line); border-radius: 27px; background: var(--surface); box-shadow: var(--shadow); }
.explore-heading { margin-bottom: 34px; }
.explore-heading .section-lead { margin-top: 16px !important; }
.explore-section .chart-panel { margin-top: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.explore-section .detail-panel:not([hidden]) { margin-top: 28px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #f6f8f7; }
.explore-section .table-panel { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.chart-viewport { width: 100%; overflow-x: auto; }
.d3-chart { width: 100%; min-height: 360px; }
.d3-chart svg { display: block; width: 100%; overflow: visible; }
.d3-chart .axis path, .d3-chart .axis line { stroke: #8ba0a3; }
.d3-chart .axis text, .d3-chart .axis-label, .d3-chart .grid line, .d3-chart .chart-legend text { fill: #53676e; font-size: 12px; }
.d3-chart .grid line { stroke: #e2e9e8; }
.d3-chart .grid path { display: none; }
.d3-chart .line-release { fill: none; stroke: var(--teal-chart-pale); stroke-width: 1.5; }
.d3-chart .line-annual { fill: none; stroke: var(--teal); stroke-width: 2.5; }
.d3-chart .scatter-point { stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.d3-chart .scatter-point:hover { stroke: var(--ink); stroke-width: 2.5; }
.outline-button { flex: none; padding: 9px 14px; border: 1px solid #9db9b9; border-radius: 9px; color: var(--teal); background: #fff; font-size: .83rem; font-weight: 700; cursor: pointer; }
.outline-button:hover { background: var(--teal-pale); }

.d3-table-controls, .d3-table-footer, .d3-table-footer nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.d3-table-controls { margin-bottom: 18px; padding: 17px 20px; border-radius: 13px; background: #f6f8f7; }
.d3-table-controls label { margin: 0; color: #42555c; font-size: .84rem; font-weight: 700; }
.d3-table-controls select, .d3-table-controls input { min-height: 38px; margin: 0 7px; padding: 6px 9px; border: 1px solid #cbd8d7; border-radius: 8px; background: #fff; color: var(--ink); }
.d3-table-controls input { min-width: 220px; }
.d3-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
#data-table { width: 100%; table-layout: fixed; margin-bottom: .5rem; color: var(--ink); font-size: .84rem; }
#data-table th, #data-table td { vertical-align: top; border-color: #e2e9e8; }
#data-table th { cursor: pointer; background: #edf3f1; color: #31545b; font-size: .77rem; letter-spacing: .025em; }
#data-table tbody tr:nth-of-type(odd) { background: #fafbf9; }
#data-table tbody tr:hover { background: #f2f7f5; }
#data-table .raw-data-compact { white-space: nowrap; }
#data-table .raw-data-theme, #data-table .raw-data-set-name { white-space: normal; overflow-wrap: anywhere; }
.d3-table-footer { flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: .85rem; }
.d3-table-footer button, .d3-table-footer .page-button { padding: 6px 10px; border: 1px solid #d1dedd; border-radius: 8px; background: #fff; color: var(--teal); font-size: .82rem; font-weight: 650; cursor: pointer; }
.d3-table-footer button:hover:not(:disabled) { background: var(--teal-pale); }
.d3-table-footer button:disabled { color: #9caead; cursor: default; }
.d3-table-footer .page-button[aria-current="page"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.d3-tooltip { position: fixed; z-index: 10; max-width: min(320px, calc(100vw - 16px)); padding: .6rem .75rem; border-radius: 9px; background: rgba(27,46,54,.95); color: #fff; font-size: .85rem; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: 0 10px 25px rgba(0,0,0,.2); }
.annual-top-five-tooltip-heading { font-weight: 700; }
.annual-top-five-tooltip-list { margin: .4rem 0 0; padding-left: 1.5rem; white-space: normal; }
.annual-top-five-tooltip-list li + li { margin-top: .25rem; }
.annual-top-five-tooltip-list .star-wars-set-name { color: #ff9b89; }
.site-footer { padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 320px; }
  .hero-copy { padding-right: 28px; }
  .hero-art { min-height: 430px; }
  .question-card { padding: 21px; }
  .question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d3-scatter { min-width: 660px; }
}
@media (max-width: 700px) {
  .page-width { width: min(100% - 28px, 580px); }
  .header-inner { min-height: 68px; flex-wrap: wrap; padding: 14px 0; }
  .site-nav { width: 100%; justify-content: space-between; gap: 8px; }
  .site-nav a { font-size: .74rem; }
  .opening-section { padding-top: 10px; }
  .hero { display: block; min-height: 0; }
  .hero-copy { padding: 18px 0; }
  .hero h1 { font-size: clamp(2.7rem, 11vw, 4rem); }
  .hero-art { position: relative; top: auto; right: auto; width: 100%; height: 170px; min-height: 0; overflow: hidden; }
  .trend-panel { margin-top: -35px; }
  .hero-art::before { top: 53%; width: min(70%, 160px); }
  .hero-brick { width: 135px; height: 115px; gap: 10px; padding: 15px; }
  .brick-back { top: 20px; right: 18%; box-shadow: 0 17px 0 #ba6049, 0 23px 20px rgba(119,54,39,.2); }
  .brick-front { top: 70px; left: 17%; box-shadow: 0 17px 0 #ac4639, 0 25px 22px rgba(113,49,37,.23); }
  .brick-back i { box-shadow: 0 8px 0 #c36a4f, inset 0 -3px 0 rgba(150,64,44,.22); }
  .brick-front i { box-shadow: 0 8px 0 #ba4f3e, inset 0 -3px 0 rgba(147,50,38,.28); }
  .section-heading { display: block; }
  .metrics-grid, .question-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 145px; }
  .filter-grid { grid-template-columns: 1fr; padding: 15px; }
  .year-filter-menu { width: 100%; max-width: none; }
  .panel-heading { display: block; }
  .story-transition { margin-top: 42px; }
  .reasons-section { margin-top: 40px; padding: 30px 22px 43px; }
  .question-grid { margin-top: 25px; }
  .question-card { min-height: 140px; }
  .question-icon { margin-bottom: 14px; }
  .reason-chart-card { padding: 22px 16px; }
  .reason-chart-heading { display: block; }
  .advent-calendar-select-label { margin-top: 19px; }
  .advent-calendar-metrics { gap: 7px; }
  .advent-calendar-metrics > div { padding: 12px 10px; }
  .explore-section { margin-top: 65px; padding: 30px 22px 34px; border-radius: 20px; }
  .panel-heading-with-action .outline-button { margin-top: 14px; }
  .d3-table-controls, .d3-table-footer { align-items: flex-start; flex-direction: column; }
  .d3-table-controls label { display: block; width: 100%; }
  .d3-table-controls input { min-width: 0; width: 100%; margin: 7px 0 0; }
  #data-table { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
