:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #242424;
  --muted: #606060;
  --rule: #d1d1d1;
  --native: #f3f3f3;
  --shared: #e4e4e4;
  --selected: #bcbcbc;
  --focus: #111111;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1640px; margin: 0 auto; padding: 28px 36px 24px; }
button, select, input { font: inherit; color: inherit; }
button, select { border: 1px solid #aaa; border-radius: 2px; background: #fff; min-height: 36px; }
button { cursor: pointer; padding: 7px 12px; }
button:hover:not(:disabled), select:hover { background: #f1f1f1; border-color: #666; }
button:active:not(:disabled) { background: #dedede; }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
select { padding: 5px 26px 5px 8px; cursor: pointer; }
::selection { background: #d4d4d4; color: #111; }
a { color: inherit; text-underline-offset: 3px; }

.page-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.page-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.columnar-brand { display: block; width: 160px; line-height: 0; transform: translateY(4px); }
.columnar-brand img { display: block; width: 160px; height: 40px; }
h1 { margin: 0; font-size: 21px; font-weight: 600; }
.page-header p { margin: 0; font-size: 14px; color: var(--muted); }
.timeline { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; gap: 24px; align-items: start; margin: 26px 0 28px; }
.playback-buttons { display: flex; gap: 6px; }
.play-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 88px; font-size: 14px; }
.play-button svg { fill: currentColor; }
.step-button { width: 36px; padding: 8px; display: grid; place-items: center; }
.step-button svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.seek-control { padding-top: 1px; }
#year-seek { --progress: 0%; appearance: none; width: 100%; height: 32px; margin: 0; cursor: pointer; background: transparent; }
#year-seek::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, #444 var(--progress), #d5d5d5 var(--progress)); }
#year-seek::-webkit-slider-thumb { appearance: none; width: 12px; height: 18px; margin-top: -7.5px; background: #444; border: 2px solid #fff; border-radius: 2px; }
#year-seek::-moz-range-track { height: 3px; background: #d5d5d5; }
#year-seek::-moz-range-progress { height: 3px; background: #444; }
#year-seek::-moz-range-thumb { width: 8px; height: 14px; background: #444; border: 2px solid #fff; border-radius: 2px; }
.timeline-ticks { position: relative; height: 15px; margin: 0 6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline-ticks span { position: absolute; left: var(--position); transform: translateX(-50%); }
.timeline-ticks span:first-child { transform: none; }
.timeline-ticks span:last-child { transform: translateX(-100%); }
.speed-control { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); transform: translateY(8px); }
.speed-control select { font-size: 13px; color: var(--ink); min-width: 64px; }

.year-header { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; min-height: 48px; }
#year { font-size: 36px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; margin: 0; }
.year-context { flex: 1; min-width: 0; display: grid; }
.year-caption-measure { display: grid; grid-area: 1 / 1; visibility: hidden; pointer-events: none; }
.year-caption, .year-caption-sample { grid-area: 1 / 1; }
#year-title, .year-caption-title { margin: 0; font-size: 14px; line-height: 1.4; min-height: 1.4em; }
#year-title-text { user-select: none; }
#year-phase, .year-caption-phase { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.engine-control { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.engine-control select { max-width: 230px; width: 188px; font-size: 13px; color: var(--ink); }
.chart-container { width: 100%; }
#stack-chart { display: block; width: 100%; height: 630px; overflow: visible; }
.layer-label, .layer-subtitle, .scale-label { fill: var(--muted); font-size: 12px; }
.layer-label { font-weight: 600; fill: var(--ink); }
.layer-subtitle { text-anchor: start; }
.scale-label { font-size: 10px; text-anchor: middle; }
.layer-rule { stroke: #e0e0e0; stroke-width: 1; }
.box { fill: #fff; stroke: #707070; stroke-width: .85; }
.segment[data-kind="native"] .box, .segment[data-kind="vendor"] .box { fill: var(--native); }
.segment[data-kind="legacy"] .box { fill: #fafafa; stroke: #aaa; }
.segment[data-kind="residual"] .box { fill: #fafafa; }
.segment[data-kind="table"] .box { fill: var(--shared); }
.segment[data-id="iceberg"] .box { fill: #d0d0d0; }
.segment[data-id="delta"] .box { fill: #e9e9e9; }
.segment { cursor: pointer; outline: none; }
.segment:hover .box, .segment.is-related .box { stroke: #242424; stroke-width: 1.3; }
.segment.is-selected .box { fill: var(--selected); stroke: #111; stroke-width: 1.7; }
.segment:focus-visible .box { stroke: #111; stroke-width: 2.5; }
.segment.is-muted .box { fill: #fafafa; stroke: #cecece; }
.segment.is-muted .box-label, .segment.is-muted .box-percent, .segment.is-muted .box-vertical { fill: #686868; }
.box-label { fill: #222; font-size: 12px; text-anchor: middle; pointer-events: none; }
.box-percent { fill: #4c4c4c; font-size: 11px; font-variant-numeric: tabular-nums; text-anchor: middle; pointer-events: none; }
.box-vertical { fill: #222; font-size: 11px; font-variant-numeric: tabular-nums; text-anchor: middle; pointer-events: none; }
.adbc-callout { pointer-events: none; }
.adbc-callout text { fill: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; text-anchor: end; }
.adbc-callout path { fill: none; stroke: var(--muted); stroke-width: .7; }
.management-part { pointer-events: none; }
.management-box { fill: #f6f6f6; stroke: #808080; stroke-width: .6; }
.management-part[data-management="managed"] .management-box { fill: #c4c4c4; }
.management-label, .management-percent { fill: #242424; font-size: 10px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.segment.is-muted .management-box { fill: #f8f8f8; stroke: #c4c4c4; }
.segment.is-muted .management-part[data-management="managed"] .management-box { fill: #e2e2e2; }
.storage-link, .access-link { fill: #bcbcbc; fill-opacity: .24; stroke: #8a8a8a; stroke-opacity: .36; stroke-width: .6; pointer-events: none; }
.storage-link[data-engine="legacy"], .access-link[data-engine="legacy"] { fill-opacity: .04; stroke-opacity: .08; }
.trace-link, .access-trace-link { fill: #a4a4a4; fill-opacity: .48; stroke: #555; stroke-width: .7; pointer-events: none; }
.trace-link.is-native, .access-trace-link.is-native { fill-opacity: .32; }
.chart-instructions { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.text-button { font: inherit; color: inherit; padding: 0; min-height: 0; border: 0; border-radius: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.inspection { padding: 17px 0 14px; min-height: 74px; }
.inspection:empty { padding: 0; min-height: 16px; }
.inspection-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 6px; }
.inspection h3 { font-size: 15px; margin: 0; font-weight: 600; }
.inspection-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.clear-selection { margin-left: auto; min-height: 28px; padding: 2px 8px; font-size: 12px; }
.inspection-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 6px 0 0; max-width: 86ch; }
.routes-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; }
.routes-list li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.routes-list small { color: var(--muted); font-size: 12px; }
.routes-list strong { font-weight: 500; font-variant-numeric: tabular-nums; }

.breakdown { border-top: 1px solid var(--rule); padding: 14px 0; font-size: 13px; }
.breakdown summary { cursor: pointer; width: fit-content; padding: 4px 0; }
.breakdown-tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
caption { text-align: left; font-weight: 600; padding-bottom: 8px; font-size: 13px; }
th, td { text-align: left; vertical-align: top; padding: 5px 0; border-bottom: 1px solid #e8e8e8; }
th { font-weight: 500; }
td:last-child, th:last-child { text-align: right; white-space: nowrap; padding-left: 8px; font-variant-numeric: tabular-nums; }
.data-select { border: 0; border-radius: 0; background: none; min-height: 0; padding: 0; text-align: left; font-size: inherit; text-decoration: underline; text-decoration-color: #aaa; text-underline-offset: 3px; }
.management-detail td { text-align: left; white-space: normal; padding: 2px 0 8px 10px; color: var(--muted); line-height: 1.5; }
.management-detail span { display: block; }
tfoot th { padding-top: 8px; }
.has-modal { overflow: hidden; }
.methodology-dialog { width: min(920px, calc(100% - 48px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--rule); color: var(--ink); background: var(--paper); overflow: hidden; }
.methodology-dialog[open] { display: flex; flex-direction: column; }
.methodology-dialog::backdrop { background: rgb(0 0 0 / .32); }
.methodology-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 28px; border-bottom: 1px solid var(--rule); }
.methodology-header h2 { margin: 0; font-size: 21px; font-weight: 600; }
.methodology-header button { min-height: 44px; font-size: 14px; }
.methodology-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #aaa var(--paper); }
.methodology-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.methodology-content { max-width: 76ch; margin: 0 auto; padding: 26px 28px 36px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.methodology-content p { margin: 0 0 14px; }
.methodology-content .methodology-intro { font-size: 16px; }
.methodology-content h3 { margin: 30px 0 10px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.methodology-sources { border-top: 1px solid var(--rule); margin-top: 30px; }
.methodology-sources p { font-size: 12px; color: var(--muted); }
.methodology-sources ul { padding: 0; margin: 14px 0 0; list-style: none; columns: 2; column-gap: 24px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.methodology-sources li { margin: 0 0 8px; break-inside: avoid; }
.methodology-source-domain { display: block; font-size: 10px; }
.methodology-content .methodology-credit { margin: 30px 0 0; font-size: 12px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  main { padding: 22px 20px; }
  .timeline { gap: 18px; }
  .speed-control { flex-direction: column; gap: 2px; align-items: flex-end; }
  .speed-control > select { min-height: 30px; }
  .year-header { flex-wrap: wrap; }
  .engine-control { flex-basis: 100%; justify-content: flex-end; }
  .engine-control select { width: 190px; }
  .breakdown-tables { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  main { padding: 20px 14px; }
  h1 { font-size: 20px; }
  .page-header { align-items: start; gap: 12px; }
  .page-heading { display: block; }
  .page-header p { margin-top: 5px; font-size: 12px; }
  .timeline { grid-template-columns: 1fr auto; gap: 12px; margin: 22px 0 25px; }
  .seek-control { grid-row: 2; grid-column: 1 / -1; }
  .speed-control { flex-direction: row; align-items: center; }
  .play-button, .step-button { min-height: 40px; }
  .year-header { gap: 12px; align-items: flex-start; margin-bottom: 10px; }
  #year { font-size: 32px; }
  #year-title, .year-caption-title { font-size: 12px; }
  #year-phase, .year-caption-phase { font-size: 12px; }
  .engine-control { justify-content: space-between; }
  .engine-control select { width: min(220px, 66vw); }
  .routes-list { display: grid; gap: 9px; }
  .chart-instructions { font-size: 12px; }
  .clear-selection { min-height: 36px; }
  .methodology-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .methodology-header { padding: 12px 18px; }
  .methodology-content { padding: 20px 18px 28px; }
  .methodology-sources ul { columns: 1; }
}

@media (width < 450px) {
  .columnar-brand, .columnar-brand img { width: 40px; }
}

@media (max-width: 360px) {
  .timeline { column-gap: 4px; }
  .playback-buttons { gap: 4px; }
  .speed-control { gap: 4px; }
  .timeline-ticks span:nth-last-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
