:root {
  color-scheme: light;
  --paper: #faf9f3; --surface: #fffef9; --ink: #242720; --muted: #62675c;
  --rule: #d8dcd0; --soft: #eff1e9; --accent: #65723f; --accent-soft: #e7ecdb;
  --map-water: #edf1ef; --map-land: #fafaf6; --top1: #254762; --top2: #637746;
  --selection: #e8bd19; --halo: #fffdf4;
  --guided-fill: #B8945A; --guided-stroke: #7B6237; --guided-core: #5B4321;
  --serif: Georgia, 'Times New Roman', serif; --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1d1d1b; --surface: #252621; --ink: #f0f1e8; --muted: #bcc3b1;
  --rule: #444a3c; --soft: #303629; --accent: #bdcc8d; --accent-soft: #343e29;
  --map-water: #232a28; --map-land: #343b31; --top1: #a7c9df; --top2: #c1cf93;
  --selection: #f1ce3e; --halo: #1e2521;
  --guided-fill: #C3A26A; --guided-stroke: #D4B680; --guided-core: #E4C58C;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .3; }
button, input, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button { touch-action: manipulation; }
a { color: var(--accent); text-underline-offset: 3px; }
[hidden] { display: none !important; }
p { margin: 0 0 15px; }
strong { font-weight: 650; }
h1, h2, h3, h4 { margin: 0; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 34% 66%; grid-template-rows: minmax(0,1fr); overflow: hidden; }
.story-panel { display: grid; grid-template-rows: 76px minmax(0, 1fr) 76px; background: var(--paper); border-right: 1px solid var(--rule); min-width: 0; min-height: 0; }
.story-nav { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); align-items: center; padding: 0 32px; gap: 12px; }
.arrow-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; font-size: 23px; line-height: 1; transition: background .2s, border-color .2s; }
.arrow-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.story-nav-down .arrow-button { border-color: var(--accent); background: var(--accent); color: var(--paper); }
.story-nav-down .arrow-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); color: var(--paper); opacity: .9; }
.brand { color: var(--ink); font-size: 14px; text-decoration: none; font-weight: 650; letter-spacing: -.02em; }
.mode-caption, .step-count { text-align: right; font-size: 12px; color: var(--muted); }
.nav-label { font-size: 12px; line-height: 1.3; color: var(--muted); }
.story-middle { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; padding: 4px clamp(24px,2.7vw,42px) 10px; }
.progress { display: flex; gap: 5px; height: 24px; margin-bottom: 5px; }
.progress button { flex:1; position:relative; top:-7px; height:28px; border:0; padding:0; background:transparent; border-radius:0; color:var(--muted); }
.progress button::after { content:''; position:absolute; top:1px; left:0; width:100%; height:3px; background:var(--rule); transition:background .15s,height .15s; }
.progress-label { display:block; margin-top:9px; font-size:10px; line-height:12px; }
.progress button.active .progress-label { color:var(--accent); font-weight:700; }
.progress button.past::after { background:var(--accent); opacity:.45; }
.progress button.active::after { background:var(--accent); }
.progress button:hover:not(:disabled)::after { background:var(--accent); height:5px; opacity:.75; }
.progress button.active:hover::after { opacity:1; }
.progress button:disabled { opacity:1; }
.story-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; padding: 0 4px 14px 0; display: flex; flex-direction: column; }
.story-content { margin: auto 0; transition: opacity .28s, transform .28s; }
.story-content.is-changing { opacity: .3; transform: translateY(3px); }
.eyebrow, .story-kicker { display: block; font-size: 12px; letter-spacing: .065em; color: var(--accent); line-height: 1.5; }
.story-kicker { margin-bottom: 13px; }
.story-content h1, .story-content h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(29px,2.55vw,40px); line-height: 1.12; letter-spacing: -.027em; margin-bottom: 21px; text-wrap: balance; }
.story-content h1 { font-size: clamp(29px,2.5vw,36px); }
@media (min-width: 761px) {
  .story-content:has(.frequency-chart) h2 { font-size: clamp(29px,2.25vw,34px); }
}
.story-content p { font-size: 16px; line-height: 1.55; }
.story-content .lede { color: var(--muted); }
.key-result { margin: 22px 0 19px; padding-top: 17px; border-top: 1px solid var(--rule); }
.key-number { font-family: var(--serif); font-size: clamp(39px,4vw,58px); line-height: 1; letter-spacing: -.045em; display: block; }
.key-caption { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 8px; }
.key-note { font-size: 12px !important; color: var(--muted); line-height: 1.5 !important; margin: 14px 0 0; }
.story-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; padding-top: 14px; }
.simple-button { font-size: 14px; min-height: 40px; background: transparent; border: 1px solid var(--rule); border-radius: 5px; padding: 9px 12px; }
.simple-button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.text-button { color: var(--muted); background: transparent; border: 0; padding: 7px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--ink); }
.next-hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
.simple-reading p { font-size: 18px; line-height: 1.5; margin-bottom: 15px; }
.simple-reading .falc-note { font-size: 12px; color: var(--muted); margin-top: 25px; }
.glossary { margin-top: 14px; font-size: 13px; color: var(--muted); }
.glossary summary { cursor: pointer; }
.glossary dt { margin: 14px 0 5px; color: var(--ink); font-weight: 650; }
.glossary dd { margin: 0; line-height: 1.5; }
.narrative-ab { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.narrative-ab th, .narrative-ab td { text-align: right; padding: 9px 2px 9px 8px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.narrative-ab th:first-child, .narrative-ab td:first-child { padding-left: 0; text-align: left; color: var(--muted); font-weight: 400; }
.narrative-ab caption { text-align: left; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.letter { display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1px solid currentColor; border-radius: 50%; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 700; }
.quartile-schema { margin: 15px 0 20px; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.quartile-schema span { padding: 8px 4px; text-align: center; background: var(--soft); color: var(--muted); font-size: 14px; }
.quartile-schema .extreme { background: var(--accent-soft); color: var(--ink); border-bottom: 2px solid var(--accent); }
.quartile-schema small { grid-column: 1/-1; color: var(--muted); margin-top: 3px; font-size: 12px; }
.res-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 10px; }
.res-tabs button { background: transparent; border: 1px solid var(--rule); border-radius: 4px; font-size: 12px; padding: 9px 10px; }
.res-tabs button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.paired-comparison { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 18px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; gap: 10px; }
.paired-comparison span { font-size: 13px; color: var(--muted); }
.paired-comparison strong { display: block; font-size: 22px; margin-top: 5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.frequency-chart { margin: 15px 0 10px; }
.frequency-chart figcaption { font-size: 14px; line-height: 1.45; margin-bottom: 14px; font-weight: 600; }
.bar-row { margin-bottom: 13px; }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bar-label strong { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; background: var(--soft); border-radius: 1px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-row.baseline .bar-fill { background: var(--muted); }
.bar-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 5px; }
.causality-note { font-size: 13px !important; padding-left: 12px; border-left: 2px solid var(--accent); margin-top: 17px !important; }

.map-panel { min-width: 0; min-height: 0; position: relative; isolation: isolate; background: var(--map-water); overflow: hidden; }
.map-canvas { position: absolute; inset: 0; }
.maplibregl-map { font-family: var(--sans); }
.map-header { position: absolute; left: 28px; right: 28px; top: 28px; display: flex; justify-content: space-between; gap: 15px; pointer-events: none; z-index: 4; }
.map-heading { background: color-mix(in srgb,var(--paper) 92%,transparent); padding: 10px 14px; border-left: 2px solid var(--accent); max-width: 58%; }
.map-overline { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); margin-bottom: 4px; }
.map-heading h2 { font-weight: 500; font-size: 17px; line-height: 1.3; }
.map-actions { display: flex; gap: 8px; align-items: start; pointer-events: auto; }
.map-button { background: var(--paper); border: 1px solid var(--rule); font-size: 13px; padding: 10px 12px; border-radius: 4px; min-height: 40px; }
.map-hint { position: absolute; left: 42px; top: 118px; font-size: 13px; line-height: 1.45; color: var(--muted); max-width: 290px; z-index: 3; pointer-events: none; background: color-mix(in srgb,var(--paper) 90%,transparent); }
.map-annotations { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.map-annotations line { stroke: var(--selection); stroke-width: 1.5px; }
.map-annotations .group-ring { fill: transparent; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .6; }
.ab-annotations { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.ab-card { position: absolute; width: 168px; padding: 10px 12px; background: color-mix(in srgb,var(--paper) 96%,transparent); border-top: 2px solid var(--selection); color: var(--ink); }
.ab-card .ab-card-title { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ab-card strong { display: block; font-size: 24px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.ab-card .ab-card-note { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.ab-letter-marker { width: 28px; height: 28px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); font-size: 15px; border-radius: 50%; font-weight: 700; pointer-events: none; }
.island-name-marker { font-size: 12px; line-height: 1.2; color: var(--muted); text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 4px var(--paper); pointer-events: none; white-space: nowrap; }
.map-legend { position: absolute; bottom: 52px; left: 28px; padding: 12px 14px; max-width: 330px; background: color-mix(in srgb,var(--paper) 96%,transparent); z-index: 4; font-size: 12px; line-height: 1.45; pointer-events: none; }
.iris-ramp,.iris-class-labels { display:grid;grid-template-columns:repeat(5,1fr);gap:2px;width:280px;max-width:100%; }
.iris-ramp { height:10px;margin:8px 0 5px; }
.iris-class-labels { text-align:center;font-size:12px; }
.no-data-symbol { display:inline-block;width:12px;height:10px;background:#e5e7dd;border:1px solid #bcc2b3;vertical-align:middle; }
.guided-symbol { display:inline-block;flex:none;width:11px;height:11px;border:1px solid var(--guided-stroke);border-radius:50%;background:color-mix(in srgb,var(--guided-fill) 40%,transparent);position:relative; }
.guided-symbol.core::after { content:'';position:absolute;width:4.5px;height:4.5px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:50%;background:var(--guided-core); }
.guided-symbol.top1-only { width:4.5px;height:4.5px;border:0;background:var(--guided-core); }
.group-envelope-symbol { display:inline-block;flex:none;width:25px;height:17px;background:color-mix(in srgb,var(--guided-fill) 12%,transparent);border:1.2px solid var(--guided-stroke);border-radius:7px 10px 6px 8px; }
.mosaic-stats { display:grid;grid-template-columns:1fr 1fr;gap:20px;padding-top:20px;margin:22px 0 13px;border-top:1px solid var(--rule); }
.mosaic-stats strong { display:block;font:clamp(38px,4vw,55px) var(--serif);line-height:1.1; }
.mosaic-stats span { color:var(--muted);font-size:14px;line-height:1.5; }
@media (min-width:761px) { .guided .map-hint { max-width:250px; } }
.map-legend .legend-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.legend-ramp { display: grid; grid-template-columns: repeat(4,1fr); height: 8px; margin-bottom: 5px; }
.legend-labels { display: flex; justify-content: space-between; gap: 20px; }
.legend-note { color: var(--muted); margin-top: 8px; }
.legend-symbol-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.ring-symbol { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--top2); flex: none; }
.ring-symbol.top1 { border: 2.5px solid var(--top1); position: relative; }
.ring-symbol.top1::after { content:''; width: 4px; height: 4px; border-radius: 50%; background: var(--top1); position: absolute; top: 3px; left: 3px; }
.line-symbol { display: inline-block; width: 24px; height: 0; border-top: 3px solid var(--selection); }
.guided-filters { position: absolute; right: 28px; top: 118px; background: var(--paper); z-index: 5; padding: 11px; border: 1px solid var(--rule); }
.filter-caption { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.segmented button { padding: 9px 10px; font-size: 13px; border: 0; background: transparent; min-height: 38px; white-space: nowrap; }
.segmented button + button { border-left: 1px solid var(--rule); }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.map-tooltip { position: absolute; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); padding: 10px 12px; font-size: 13px; line-height: 1.4; max-width: 260px; pointer-events: none; z-index: 9; }
.iris-tooltip { max-width:240px; }
.iris-tooltip strong,.iris-tooltip span,.iris-tooltip small { display:block; }
.iris-tooltip .tooltip-commune { color:var(--muted); }
.iris-tooltip .tooltip-income { font-weight:650; margin-top:6px; font-variant-numeric:tabular-nums; }
.iris-tooltip small { color:var(--muted); font-size:11px; margin-top:3px; }
.base-notice { position: absolute; bottom: 32px; left: 28px; right: 16px; margin: 0; color: var(--muted); font-size: 12px; z-index: 4; background: var(--paper); width: fit-content; padding: 3px 5px; }
.map-credit { position: absolute; bottom: 10px; left: 28px; right: 12px; display: flex; gap: 16px; align-items: center; pointer-events: none; font-size: 12px; color: var(--muted); z-index: 3; }
.map-zoom { position: absolute; right: 28px; bottom: 60px; display: grid; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; z-index: 5; }
.map-zoom button { width: 42px; height: 42px; border: 0; background: transparent; font-size: 22px; }
.map-zoom button + button { border-top: 1px solid var(--rule); }
.maplibregl-ctrl-bottom-right { bottom: 29px; right: 8px; }
.maplibregl-ctrl-attrib { font-size: 10px; color: #444; background: rgba(250,249,243,.9); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--map-water); z-index: 10; font-size: 16px; }
.failure { position: absolute; inset: 0; background: var(--paper); padding: 40px; z-index: 15; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.failure h2 { font: 28px var(--serif); }
.failure p { line-height: 1.5; }
.failure button { align-self: start; padding: 12px 18px; border: 1px solid var(--rule); background: var(--accent-soft); }

.app.exploring { grid-template-columns: 66% 34%; }
.app.exploring .story-panel { display: none; }
.app.exploring .map-panel { grid-column: 1; grid-row: 1; }
.explore-panel { grid-column: 2; grid-row: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--rule); }
.explore-header { padding: 23px 26px 18px; display: flex; gap: 15px; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--rule); }
.explore-header h1 { font-family: var(--serif); font-size: 25px; font-weight: 400; line-height: 1.12; letter-spacing: -.025em; margin-top: 4px; }
.explore-header .text-button { white-space: nowrap; }
.filter-panel { padding: 18px 26px 15px; }
.filter-panel > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.search-field { position: relative; margin-bottom: 12px; }
.search-field input { display: block; width: 100%; min-height: 42px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); padding: 10px 35px 10px 12px; font-size: 14px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field button { position: absolute; right: 3px; top: 3px; width: 34px; height: 34px; border: 0; background: transparent; font-size: 22px; }
.filter-note { margin: 9px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.additional-filters { display: flex; flex-wrap: wrap; gap: 10px 15px; font-size: 13px; }
.additional-filters label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.additional-filters input { margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 26px 9px; }
.list-heading h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.interface-list { min-height: 92px; height: 20vh; max-height: 180px; flex: 0 0 clamp(125px,20vh,180px); overflow-y: auto; scrollbar-width: thin; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.interface-row { display: grid; grid-template-columns: 19px minmax(0,1fr) auto; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 13px 26px; background: transparent; border: 0; border-bottom: 1px solid var(--rule); }
.interface-row:hover, .interface-row.hovered { background: var(--soft); }
.interface-row[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.row-place { font-size: 14px; line-height: 1.4; display: block; overflow-wrap: anywhere; }
.row-subtitle { font-size: 12px; color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }
.row-score { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.empty-state { padding: 22px 26px; font-size: 14px; line-height: 1.5; }
.selection-notice { font-size: 12px; line-height: 1.4; padding: 8px 26px; background: var(--soft); border-bottom: 1px solid var(--rule); }
.detail-panel { padding: 22px 26px; min-height: 100px; max-height: none; overflow-y: auto; flex: 1 1 0; scrollbar-width: thin; }
.detail-panel.no-selection { color: var(--muted); font-size: 15px; line-height: 1.6; }
.detail-panel h2 { font-family: var(--serif); font-size: 25px; line-height: 1.15; font-weight: 400; margin: 5px 0 7px; overflow-wrap: anywhere; }
.detail-place { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.badge { display: inline-block; padding: 4px 6px; font-size: 12px; border: 1px solid var(--rule); border-radius: 3px; }
.badge.focal { color: var(--accent); border-color: var(--accent); }
.ab-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; margin: 16px 0; }
.ab-table caption { text-align: left; color: var(--muted); font-size: 12px; line-height: 1.5; padding-bottom: 10px; }
.ab-table th, .ab-table td { padding: 9px 0 9px 7px; text-align: right; border-bottom: 1px solid var(--rule); }
.ab-table th { font-weight: 500; }
.ab-table th:first-child, .ab-table td:first-child { text-align: left; padding-left: 0; width: 47%; color: var(--muted); }
.ab-table thead th { border-top: 1px solid var(--rule); }
.ab-table .value-row td:not(:first-child) { font-size: 16px; font-weight: 600; white-space: nowrap; }
.detail-panel h3 { font-size: 14px; font-weight: 600; margin: 22px 0 10px; line-height: 1.4; }
.detail-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 13px; }
.quartile-position { display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; margin: 10px 0; }
.quartile-slot { background: var(--soft); padding: 8px 2px 9px; min-height: 59px; text-align: center; font-size: 12px; }
.quartile-slot .position-letters { display: block; min-height: 24px; font-weight: 650; font-size: 16px; margin-top: 6px; color: var(--accent); }
.detail-deltas { display: flex; flex-wrap: wrap; justify-content: space-between; font-size: 13px; line-height: 1.6; margin-top: 12px; }
.exception-summary { padding-top: 13px; border-top: 1px solid var(--rule); }
.exception-summary strong { font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
.exception-summary .detail-note { margin-top: 8px; }
.cell-identifiers { margin-top: 22px; color: var(--muted); font-size: 12px; }
.cell-identifiers summary { cursor: pointer; }
.cell-identifiers code { display: block; overflow-wrap: anywhere; font-size: 12px; margin: 7px 0 13px; }
.explore-footer { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 26px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); flex: none; }
.mobile-tabs { display: none; }
.method-dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--rule); padding: 0; width: min(700px,calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 7px; }
.method-dialog::backdrop { background: rgba(24,30,22,.5); }
.method-dialog header { padding: 24px 30px; border-bottom: 1px solid var(--rule); display: flex; gap: 20px; justify-content: space-between; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.method-dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin-top: 5px; }
.close-button { flex: none; border: 1px solid var(--rule); background: transparent; width: 38px; height: 38px; border-radius: 50%; font-size: 25px; }
.method-content { padding: 24px 30px 30px; font-size: 15px; line-height: 1.65; }
.method-content h3 { font-size: 17px; margin: 23px 0 9px; }
.method-content h3:first-child { margin-top: 0; }
.method-content ul { padding-left: 20px; }
.method-content .formula { font-family: var(--sans); background: var(--soft); padding: 15px; overflow-wrap: anywhere; font-size: 15px; }
.method-content .method-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 15px 0; }
.method-table th, .method-table td { padding: 7px; border-bottom: 1px solid var(--rule); text-align: right; }
.method-table th:first-child, .method-table td:first-child { text-align: left; }
.method-content small { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 761px) and (max-width: 1120px) {
  .app { grid-template-columns: 38% 62%; }
  .app.exploring { grid-template-columns: 62% 38%; }
  .story-nav { padding: 0 22px; }
  .story-middle { padding-right: 24px; padding-left: 24px; }
  .story-content h1 { font-size: 33px; }
  .story-content h2 { font-size: 30px; }
  .story-content p { font-size: 15px; }
  .map-header { left: 20px; right: 20px; top: 20px; }
  .map-heading { max-width: 67%; }
  .guided-filters { top: 112px; right: 20px; }
  .map-hint { left: 34px; top: 112px; max-width: 230px; }
  .ab-card { width: 147px; }
  .ab-card strong { font-size: 21px; }
  .explore-header, .filter-panel, .detail-panel { padding-left: 20px; padding-right: 20px; }
  .explore-header h1 { font-size: 22px; }
  .list-heading, .interface-row, .explore-footer { padding-left: 20px; padding-right: 20px; }
  .additional-filters { gap: 10px; font-size: 12px; }
}
@media (min-width: 761px) and (max-height: 730px) {
  .story-panel { grid-template-rows: 62px minmax(0,1fr) 62px; }
  .story-middle { padding-top: 0; }
  .progress { margin-bottom: 0; }
  .story-content h1, .story-content h2 { font-size: 29px; margin-bottom: 14px; }
  .story-content p { font-size: 15px; line-height: 1.45; margin-bottom: 12px; }
  .key-number { font-size: 40px; }
  .key-result { margin-top: 15px; padding-top: 12px; }
  .story-actions { padding-top: 7px; }
  .next-hint { margin-top: 10px; padding-top: 10px; }
  .detail-panel { max-height: 42vh; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 53% 47%; }
  .map-panel { grid-column: 1; grid-row: 1; }
  .story-panel { grid-column: 1; grid-row: 2; border-right: 0; border-top: 1px solid var(--rule); grid-template-rows: 47px minmax(0,1fr) 47px; }
  .story-nav { padding: 0 20px; grid-template-columns: minmax(0,1fr) 36px minmax(0,1fr); }
  .arrow-button { width: 36px; height: 36px; font-size: 21px; }
  .brand { font-size: 12px; }
  .story-middle { padding: 0 22px 0; }
  .progress { margin-bottom: 0; gap: 4px; }
  .story-kicker { margin-bottom: 8px; font-size: 12px; }
  .story-content { margin: 0; }
  .story-content h1, .story-content h2 { font-size: 27px; line-height: 1.1; margin-bottom: 13px; }
  .story-content p { font-size: 15px; line-height: 1.5; margin-bottom: 12px; }
  .key-result { margin: 15px 0; padding-top: 12px; }
  .key-number { font-size: 43px; }
  .key-caption { font-size: 13px; }
  .story-actions { gap: 13px; padding: 8px 0; }
  .simple-button { min-height: 33px; padding: 7px 9px; font-size: 12px; }
  .next-hint { display: none; }
  .story-scroll { padding-bottom: 4px; }
  .simple-reading p { font-size: 16px; }
  .map-header { left: 15px; right: 15px; top: 15px; }
  .map-heading { padding: 7px 10px; max-width: 77%; }
  .map-overline { font-size: 12px; margin-bottom: 2px; }
  .map-heading h2 { font-size: 15px; }
  .map-hint { left: 27px; top: 86px; font-size: 12px; max-width: 270px; }
  .map-legend { left: 15px; bottom: 43px; padding: 8px 10px; font-size: 12px; max-width: 270px; }
  .map-legend .legend-title { font-size: 12px; margin-bottom: 5px; }
  .map-legend .legend-note { display: none; }
  .map-credit { left: 15px; bottom: 8px; right: 10px; gap: 8px; font-size: 10px; }
  .map-credit span:last-child { margin-left: auto; }
  .maplibregl-ctrl-bottom-right { bottom: 24px; right: 5px; }
  .maplibregl-ctrl-attrib { font-size: 10px; }
  .guided-filters { top: auto; right: 15px; bottom: 115px; padding: 7px; }
  .guided-filters .segmented button { font-size: 12px; padding: 7px 9px; min-height: 32px; }
  .guided-filters .filter-caption { display: none; }
  .ab-card { width: 109px; padding: 7px 8px; }
  .ab-card strong { font-size: 18px; margin-top: 6px; }
  .ab-card .ab-card-title { gap: 5px; font-size: 12px; }
  .ab-card .ab-card-note { font-size: 12px; line-height: 1.3; }
  .ab-card .letter { width: 20px; height: 20px; font-size: 12px; }
  .ab-letter-marker { width: 25px; height: 25px; font-size: 13px; }
  .base-notice { left: 15px; bottom: 25px; font-size: 10px; max-width: 72%; }
  .app.exploring { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) 54px; }
  .app.exploring .map-panel { grid-column: 1; grid-row: 1; }
  .app.exploring .explore-panel { grid-column: 1; grid-row: 1; border-left: 0; min-height: 0; }
  .app.exploring[data-mobile-view="map"] .explore-panel { display: none; }
  .app.exploring[data-mobile-view="list"] .map-panel,
  .app.exploring[data-mobile-view="detail"] .map-panel { visibility: hidden; pointer-events: none; }
  .app.exploring[data-mobile-view="list"] .map-panel *,
  .app.exploring[data-mobile-view="detail"] .map-panel * { visibility: hidden !important; }
  .app.exploring[data-mobile-view="detail"] .filter-panel,
  .app.exploring[data-mobile-view="detail"] .list-heading,
  .app.exploring[data-mobile-view="detail"] .interface-list,
  .app.exploring[data-mobile-view="detail"] .selection-notice { display: none !important; }
  .app.exploring[data-mobile-view="list"] .detail-panel { display: none; }
  .app.exploring .detail-panel { max-height: none; flex: 1; min-height: 0; padding: 24px; }
  .app.exploring .interface-list { max-height: none; height: auto; flex: 1; min-height: 0; }
  .mobile-tabs { display: grid; grid-template-columns: repeat(3,1fr); grid-column: 1; grid-row: 2; background: var(--paper); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-tabs button { background: transparent; border: 0; font-size: 14px; }
  .mobile-tabs button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 3px var(--accent); font-weight: 650; }
  .explore-header { padding: 20px 22px 16px; }
  .explore-header h1 { font-size: 23px; }
  .filter-panel { padding: 17px 22px; }
  .list-heading { padding-left: 22px; padding-right: 22px; }
  .interface-row { padding-left: 22px; padding-right: 22px; }
  .explore-footer { padding-left: 22px; padding-right: 22px; }
  .map-actions { flex-direction: column; gap: 5px; }
  .map-button { font-size: 12px; padding: 8px 10px; min-height: 36px; }
  .app.exploring .map-heading { max-width: 63%; }
  .app.exploring .map-hint { max-width: 225px; }
  .map-zoom { right: 16px; bottom: 51px; }
  .method-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); }
  .method-dialog header { padding: 20px; }
  .method-dialog h2 { font-size: 26px; }
  .method-content { padding: 20px; font-size: 15px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .app { grid-template-rows: 49% 51%; }
  .story-content h1, .story-content h2 { font-size: 25px; }
  .map-hint { display: none; }
  .map-heading h2 { font-size: 14px; }
  .map-legend { bottom: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* V1.3 consolidation: existing palette, explicit entry and adaptive panel. */
.story-panel[data-intro="true"] { grid-template-rows: 76px minmax(0,1fr) 103px; }
.story-panel[data-intro="true"] .story-nav-down { display:flex;justify-content:center;padding:6px 28px 15px; }
.start-journey { position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;width:100%;min-height:82px;border:1px solid var(--accent);border-radius:5px;background:var(--accent);color:var(--paper);padding:11px 18px; }
.start-journey strong { font-size:16px; }
.start-journey small { font-size:12px;opacity:.9; }
.start-journey > span { font-size:21px;line-height:1.1; }
.start-journey:hover:not(:disabled) { filter:brightness(1.06); }
.start-cue > span { animation:start-arrow .65s ease-in-out 1s 2; }
@keyframes start-arrow { 0%,100%{transform:translateY(0)}50%{transform:translateY(4px)} }
.story-panel[data-step="0"] .story-content h1 { font-size:32px; }
.story-panel[data-step="0"] .story-content p { font-size:15px;line-height:1.5; }
.story-panel[data-step="0"] .next-hint { color:var(--ink); }
.story-nav-down .nav-label { font-size:12px; }
.exploration-invite { display:block;font:23px var(--serif);color:var(--ink);margin-bottom:7px; }
.welcome-glint::after { content:'';position:absolute;top:0;bottom:0;left:-40%;width:30%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.14),transparent);transform:skewX(-20deg);animation:welcome-glint 1.4s ease-in-out 1s 2; }
@keyframes welcome-glint { from{transform:translateX(0) skewX(-20deg)}to{transform:translateX(535%) skewX(-20deg)} }
.filter-disclosure { flex:none;border-bottom:1px solid var(--rule); }
.filter-disclosure > summary { padding:12px 26px;font-size:13px;color:var(--muted);cursor:pointer; }
.filter-disclosure[open] > summary { padding-bottom:0; }
.explore-panel[data-panel-view="list"] .filter-disclosure > summary { display:none; }
.explore-panel[data-panel-view="list"] .interface-list { flex:1;min-height:0;height:auto;max-height:none; }
.explore-panel[data-panel-view="detail"] .interface-list { flex:0 0 110px;min-height:0;height:110px;max-height:110px; }
.explore-panel[data-panel-view="detail"] .list-heading { padding-top:10px; }
.explore-panel[data-panel-view="detail"] #resetFilters { display:none; }
.explore-panel[data-panel-view="detail"] .detail-panel { min-height:0;flex:1;padding-top:17px; }
.detail-navigation { flex:none;display:flex;justify-content:space-between;gap:12px;padding:8px 26px 0; }
.detail-navigation button { border:0;background:transparent;color:var(--muted);font-size:12px;padding:6px 0; }
@media (min-width:761px) and (max-height:820px) {
  .story-panel[data-step="0"] .story-content h1 { font-size:30px;margin-bottom:17px; }
  .story-panel[data-step="0"] .story-content p { font-size:14px;line-height:1.48;margin-bottom:12px; }
}
@media (max-width:760px) {
  .story-panel[data-intro="true"] { grid-template-rows:47px minmax(0,1fr) 84px; }
  .story-panel[data-intro="true"] .story-nav-down { padding:5px 20px; }
  .start-journey { min-height:74px;padding:7px 12px;gap:2px; }
  .start-journey strong { font-size:14px; }
  .story-panel[data-step="0"] .story-content h1 { font-size:27px; }
  .story-panel[data-step="0"] .story-content p { font-size:14px; }
  .filter-disclosure > summary { padding-left:22px;padding-right:22px; }
  .app.exploring[data-mobile-view="detail"] .filter-disclosure { display:none; }
  .detail-navigation { padding:12px 22px 0; }
}
@media (prefers-reduced-motion:reduce) {
  .start-cue > span,.welcome-glint::after { animation:none !important; }
}
@media(max-width:760px){
  .app.exploring[data-mobile-view="list"] .interface-list { flex:1;min-height:0;height:auto;max-height:none; }
}
.story-panel[data-step="0"] .story-content p { margin-bottom:11px; }
.story-panel[data-step="6"] .story-kicker { margin-bottom:7px; }
.story-panel[data-step="6"] .causality-note { line-height:1.4; margin:8px 0 !important; }
.story-panel[data-step="6"] .res-tabs { margin:8px 0 6px; }
.story-panel[data-step="6"] .paired-comparison { margin-bottom:8px;padding:6px 0; }
@media(min-width:761px) and (max-height:820px){
  .story-panel[data-step="6"] h2 { font-size:28px;margin-bottom:14px; }
  .story-panel[data-step="6"] .res-tabs { gap:5px;margin:12px 0 8px; }
  .story-panel[data-step="6"] .res-tabs button { padding:8px 6px; }
  .story-panel[data-step="6"] .paired-comparison { margin-bottom:12px;padding:8px 0; }
  .story-panel[data-step="6"] .frequency-chart { margin:10px 0; }
  .story-panel[data-step="6"] .frequency-chart figcaption { font-size:13px;margin-bottom:9px; }
  .story-panel[data-step="6"] .bar-row { margin-bottom:9px; }
  .story-panel[data-step="6"] .next-hint { font-size:12px;line-height:1.4;margin-top:10px;padding-top:9px; }
  .story-panel[data-step="6"] .exploration-invite { font-size:22px;margin-bottom:5px; }
}

@media(min-width:761px) and (max-height:820px){
  .story-panel[data-step="6"] .causality-note { margin-top:8px !important;margin-bottom:8px !important; }
  .story-panel[data-step="6"] .res-tabs { margin-top:8px; }
  .story-panel[data-step="6"] .paired-comparison { padding-top:6px;padding-bottom:6px; }
}

@media(min-width:761px){
  .story-panel[data-step="0"] .story-content > div > p { margin-bottom:10px; }
  .story-panel[data-step="6"] .story-content h2 { font-size:28px;margin-bottom:10px; }
  .story-panel[data-step="6"] .res-tabs { margin:6px 0; }
  .story-panel[data-step="6"] .paired-comparison { margin-bottom:6px; }
  .story-panel[data-step="6"] .frequency-chart { margin-top:6px; }
  .story-panel[data-step="6"] .bar-row { margin-bottom:6px; }
  .story-panel[data-step="6"] .simple-reading p { margin-bottom:12px; }
  .story-panel[data-step="6"] .simple-reading .falc-note { margin-top:12px; }
}
@media(min-width:761px) and (max-height:820px){
  .story-panel[data-step="0"] .story-content h1 { font-size:29px; }
  .story-panel[data-step="0"] .story-content > div > p { margin-bottom:8px; }
}

