:root {
  color-scheme: dark;
  --ink: #f4f1e8;
  --muted: #a8ada8;
  --faint: #6c736f;
  --bg: #0d1517;
  --panel: #131d1f;
  --panel-2: #192426;
  --line: #2b3839;
  --line-soft: rgba(168, 173, 168, 0.16);
  --person: #f5b63d;
  --person-soft: #6a5224;
  --org: #42c6b4;
  --org-soft: #1d5a54;
  --accent: #ff7557;
  --accent-soft: #4b2a24;
  --max: 1680px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% -10%, rgba(66, 198, 180, 0.08), transparent 30rem),
    var(--bg);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button, select, input { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 2.4vw, 40px);
  background: rgba(13, 21, 23, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { position: relative; width: 21px; height: 18px; display: inline-block; }
.brand-mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--person); }
.brand-mark i:nth-child(1) { left: 0; top: 7px; }
.brand-mark i:nth-child(2) { right: 0; top: 0; background: var(--org); }
.brand-mark i:nth-child(3) { right: 2px; bottom: 0; background: var(--accent); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; height: 1px; background: var(--faint); transform-origin: left; left: 5px; top: 8px; width: 13px; }
.brand-mark::before { transform: rotate(-28deg); }
.brand-mark::after { transform: rotate(25deg); }
.topbar-meta { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; }
.district-pill { color: var(--ink); padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-weight: 700; }

main { width: min(var(--max), 100%); margin: 0 auto; padding: 0 clamp(14px, 2.4vw, 42px) 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 26px; align-items: end; padding: 22px 0 16px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-label { display: block; margin: 0 0 8px; color: var(--person); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 4vw, 48px); line-height: .96; letter-spacing: -0.045em; font-weight: 500; }
.hero-copy { max-width: 780px; margin: 9px 0 0; color: #cdd0ca; font-size: clamp(11px, 1vw, 13px); }
.hero-note { padding: 10px 13px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.hero-note p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.hero-note strong { color: var(--ink); }
.note-kicker { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.metrics article { padding: 10px 14px 10px 0; border-right: 1px solid var(--line); }
.metrics article:not(:first-child) { padding-left: 24px; }
.metrics article:last-child { border-right: 0; }
.metrics span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { display: block; margin-top: 2px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(21px, 2.1vw, 30px); font-weight: 500; letter-spacing: -0.035em; }
.metric-money strong { color: var(--person); }

.view-tabs { display: flex; gap: 5px; padding: 11px 0 8px; }
.view-tab, .text-button, .icon-button { border: 0; background: transparent; }
.view-tab { padding: 9px 15px; color: var(--muted); border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 700; }
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { color: var(--ink); border-color: var(--line); background: var(--panel-2); }

.workspace { display: grid; grid-template-columns: 260px minmax(430px, 1fr) 330px; min-height: max(620px, calc(100vh - 270px)); border: 1px solid var(--line); background: var(--panel); }
.filters, .details { padding: 22px; background: var(--panel); overflow: auto; }
.filters { border-right: 1px solid var(--line); }
.details { border-left: 1px solid var(--line); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 23px; }
.panel-heading-actions { display: flex; align-items: center; gap: 12px; }
.panel-heading h2, .details h2, .ranking-intro h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.text-button { padding: 2px 0; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--faint); }
.text-button:hover { color: var(--ink); }
.field-label { display: block; margin: 17px 0 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); background: var(--bg); }
.search-field span { color: var(--faint); font-size: 20px; }
.search-field input { width: 100%; padding: 11px 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); font-size: 12px; }
.municipality-filter { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.municipality-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.municipality-heading legend { padding: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.municipality-actions { display: flex; gap: 8px; }
.municipality-actions button { padding: 0; color: var(--org); background: transparent; border: 0; border-bottom: 1px solid transparent; font-size: 9px; }
.municipality-actions button:hover { border-bottom-color: var(--org); }
.municipality-options { max-height: 154px; overflow: auto; border: 1px solid var(--line); background: var(--bg); scrollbar-color: var(--faint) transparent; }
.municipality-option { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; gap: 7px; align-items: center; min-height: 29px; padding: 5px 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 10px; }
.municipality-option:last-child { border-bottom: 0; }
.municipality-option:hover { background: var(--panel-2); }
.municipality-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--person); }
.municipality-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.municipality-option small { color: var(--faint); font-size: 9px; }
.municipality-summary { margin: 5px 0 0; color: var(--faint); font-size: 9px; }
.range-label { display: flex; justify-content: space-between; margin: 22px 0 8px; color: var(--muted); font-size: 11px; }
.range-label strong { color: var(--ink); font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--person); }
.switch-row { display: grid; grid-template-columns: auto auto 1fr; gap: 9px; align-items: start; margin: 24px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { width: 32px; height: 18px; border: 1px solid var(--faint); border-radius: 999px; position: relative; transition: .2s ease; }
.switch::after { content: ""; position: absolute; width: 12px; height: 12px; top: 2px; left: 3px; border-radius: 50%; background: var(--muted); transition: .2s ease; }
.switch-row input:checked + .switch { background: var(--person-soft); border-color: var(--person); }
.switch-row input:checked + .switch::after { left: 15px; background: var(--person); }
.switch-row strong { display: block; font-size: 12px; }
.switch-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.legend { display: grid; gap: 9px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.person-dot { background: var(--person); }
.organization-dot { background: #f39a3e; }
.organization-color-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; margin: -2px 0 3px 18px; }
.organization-color-legend i { grid-column: 1 / -1; height: 7px; background: linear-gradient(90deg, #b8e186 0%, #f5d95b 38%, #f39a3e 68%, #d94841 100%); }
.organization-color-legend small { color: var(--faint); font-size: 8px; font-variant-numeric: tabular-nums; }
.organization-color-legend small:last-child { text-align: right; }
.line-sample { width: 17px; height: 1px; background: var(--faint); }
.bridge-ring { width: 12px; height: 12px; border: 1.5px dashed var(--accent); border-radius: 50%; }
.source-box { margin-top: 28px; padding: 15px; background: var(--bg); border: 1px solid var(--line); }
.source-box p { margin: 6px 0 12px; color: var(--muted); font-size: 11px; }
.source-box a { color: var(--org); font-size: 11px; text-underline-offset: 3px; }

.graph-panel { position: relative; min-width: 0; overflow: hidden; background: #0b1214; }
.graph-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 42px 42px; }
.graph-toolbar { position: absolute; z-index: 3; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(11, 18, 20, .86); backdrop-filter: blur(8px); }
.graph-toolbar span { display: block; font-size: 12px; font-weight: 700; }
.graph-toolbar small { display: block; color: var(--faint); font-size: 10px; }
.graph-actions { display: flex; align-items: center; gap: 8px; }
.focus-button { padding: 7px 10px; color: var(--person); background: var(--person-soft); border: 1px solid var(--person); font-size: 10px; font-weight: 700; }
.focus-button:hover { color: var(--ink); background: #7b5e27; }
.icon-button { width: 34px; height: 34px; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; font-size: 19px; }
.icon-button:hover { color: var(--ink); border-color: var(--faint); }
#networkCanvas { position: absolute; inset: 0; width: 100%; height: 100%; outline: 0; touch-action: none; }
.graph-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.graph-empty[hidden] { display: none; }
.graph-empty strong { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.graph-empty span { color: var(--muted); font-size: 12px; }
.hover-card { position: absolute; z-index: 5; max-width: 240px; padding: 9px 11px; background: rgba(19, 29, 31, .97); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none; font-size: 11px; }
.hover-card strong { display: block; margin-bottom: 2px; color: var(--ink); }
.hover-card span { color: var(--muted); }
.hover-card em { display: block; margin-top: 4px; color: var(--accent); font-style: normal; }

.detail-placeholder { min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.detail-close { display: none; float: right; width: 31px; height: 31px; margin: -6px -5px 10px 10px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 50%; font-size: 18px; line-height: 1; }
.filter-close { display: none; width: 31px; height: 31px; padding: 0; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 50%; font-size: 18px; line-height: 1; }
.detail-close:hover { color: var(--ink); }
.placeholder-symbol { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 50%; color: var(--person); }
.detail-placeholder p { color: var(--muted); font-size: 12px; }
.detail-type { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail-type i { width: 8px; height: 8px; border-radius: 50%; }
.detail-person-head { display: grid; grid-template-columns: 66px 1fr; gap: 14px; align-items: center; margin: 10px 0 7px; }
.detail-portrait { width: 66px; height: 66px; display: grid; place-items: center; overflow: hidden; border: 3px solid var(--person); border-radius: 50%; background: #172123; color: var(--person); font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.detail-person-head .detail-title { margin: 0; }
.detail-title { margin: 10px 0 7px; font-family: Georgia, serif; font-size: 27px; line-height: 1.08; font-weight: 500; }
.detail-subtitle { margin: 0; color: var(--muted); font-size: 11px; }
.detail-total { margin: 22px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-total span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.detail-total strong { display: block; margin-top: 3px; color: var(--person); font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.detail-list { display: grid; gap: 7px; }
.detail-link { width: 100%; padding: 10px; text-align: left; background: var(--bg); border: 1px solid var(--line); }
.detail-link:hover { border-color: var(--faint); }
.detail-link:disabled { cursor: default; opacity: .55; border-style: dashed; }
.detail-link:disabled:hover { border-color: var(--line); }
.detail-link strong, .detail-link span { display: block; }
.detail-link strong { font-size: 11px; }
.detail-link span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.fact-list { display: grid; gap: 12px; }
.fact { padding-left: 12px; border-left: 2px solid var(--person); }
.fact p { margin: 0 0 5px; color: #d1d3ce; font-size: 11px; }
.fact a { color: var(--org); font-size: 10px; }
.research-summary { color: var(--muted); font-size: 11px; }
.evidence-badge { display: inline-block; margin-top: 6px; padding: 3px 6px; background: var(--org-soft); color: #9de5dc; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.municipality-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.municipality-chips span { padding: 3px 6px; color: #9de5dc; background: var(--org-soft); border: 1px solid transparent; font-size: 9px; }
.municipality-chips .is-filtered { color: #ffab99; background: var(--accent-soft); border-color: rgba(255,117,87,.45); }
.cross-municipality-note { margin: 7px 0 0; color: var(--accent); font-size: 9px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 7px 10px; margin: 0; font-size: 10px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.amount-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.amount-table th, .amount-table td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); text-align: left; }
.amount-table th { color: var(--faint); font-weight: 500; }
.amount-table td:last-child, .amount-table th:last-child { text-align: right; }
.program-tooltip { position: relative; display: inline-block; }
.program-code { color: var(--program-color); text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: help; font-weight: 700; }
.program-tooltip-card { position: absolute; z-index: 40; left: -8px; right: auto; bottom: 100%; width: min(238px, 72vw); padding: 10px 11px; color: var(--muted); background: #182426; border: 1px solid var(--line); box-shadow: 0 14px 35px rgba(0,0,0,.45); text-align: left; font-size: 10px; line-height: 1.4; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-3px); transition: opacity .14s ease, transform .14s ease, visibility .14s ease; }
.program-tooltip-card strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 11px; }
.program-tooltip-card span { display: block; }
.program-tooltip-card a { display: inline-block; margin-top: 7px; color: var(--org); text-underline-offset: 3px; }
.program-tooltip:hover .program-tooltip-card, .program-tooltip:focus-within .program-tooltip-card { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(-6px); }

.ranking-view { padding: 12px 0; }
.ranking-intro { display: flex; justify-content: space-between; align-items: end; gap: 40px; padding: 24px 0; }
.ranking-intro p { max-width: 530px; margin: 0; color: var(--muted); font-size: 12px; }
.ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.data-card { background: var(--panel); border: 1px solid var(--line); }
.data-card-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.data-card-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.data-card-heading span { color: var(--faint); font-size: 10px; }
.ranking-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.ranking-row:last-child { border-bottom: 0; }
.rank-number { color: var(--faint); font-family: Georgia, serif; font-size: 18px; }
.rank-main strong, .rank-main span { display: block; }
.rank-main strong { font-size: 12px; }
.rank-main span { color: var(--muted); font-size: 10px; }
.rank-value { text-align: right; }
.rank-value strong, .rank-value span { display: block; }
.rank-value strong { color: var(--person); font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.rank-value span { color: var(--muted); font-size: 9px; }
.ranking-row button { color: inherit; background: transparent; border: 0; text-align: left; padding: 0; cursor: pointer; }

footer { display: flex; justify-content: space-between; gap: 28px; padding: 24px clamp(18px, 3vw, 52px); border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
footer p { max-width: 780px; margin: 0; }
.mobile-filter-button, .mobile-graph-help, .mobile-scrim, .orientation-notice { display: none; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 235px minmax(390px, 1fr); }
  .details { position: fixed; z-index: 30; top: 52px; right: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); border: 1px solid var(--line); box-shadow: 0 18px 60px rgba(0,0,0,.5); transform: translateX(calc(100% + 30px)); transition: transform .2s ease; }
  .details.has-selection { transform: translateX(0); }
  .detail-close { display: block; }
}
@media (max-width: 760px) {
  .source-date { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(3), .metrics article:nth-child(4) { border-top: 1px solid var(--line); }
  .metrics article:nth-child(3) { padding-left: 0; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto 620px; }
  .filters { border-right: 0; border-bottom: 1px solid var(--line); }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .ranking-grid { grid-template-columns: 1fr; }
  .ranking-intro { align-items: start; flex-direction: column; }
  footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .brand span:last-child { font-size: 13px; }
  .hero-note { display: none; }
  h1 { font-size: 38px; }
  .metrics strong { font-size: 22px; }
  .metrics article { padding: 10px 12px 10px 0; }
  .metrics article:not(:first-child) { padding-left: 13px; }
  .workspace { grid-template-rows: auto 540px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  html, body { height: 100%; overflow: hidden; }
  .topbar { position: relative; height: 34px; padding-right: max(10px, env(safe-area-inset-right)); padding-left: max(10px, env(safe-area-inset-left)); }
  .brand { font-size: 11px; }
  .brand-mark { transform: scale(.82); transform-origin: left center; margin-right: -3px; }
  .topbar-meta { gap: 6px; font-size: 8px; }
  .district-pill { padding: 2px 6px; }
  .source-date { display: none; }
  main { width: 100%; height: calc(100dvh - 34px); padding-right: max(7px, env(safe-area-inset-right)); padding-left: max(7px, env(safe-area-inset-left)); }
  .hero, .metrics, footer { display: none; }
  .view-tabs { height: 38px; padding: 3px 0; gap: 3px; }
  .view-tab { min-height: 32px; padding: 5px 11px; font-size: 10px; }
  .workspace { --mobile-filter-width: clamp(190px, 27vw, 230px); position: relative; display: block; min-height: 0; height: calc(100dvh - 72px); padding-left: var(--mobile-filter-width); border-bottom: 0; transition: padding-left .2s ease; }
  .workspace.filters-collapsed { padding-left: 0; }
  .graph-panel { width: 100%; height: 100%; }
  .graph-toolbar { min-height: 45px; padding: 6px 8px; }
  .graph-toolbar span { max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .graph-toolbar small { font-size: 8px; }
  .desktop-graph-help { display: none !important; }
  .mobile-graph-help { display: block; }
  .graph-actions { gap: 5px; }
  .mobile-filter-button { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 9px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); font-size: 10px; font-weight: 700; }
  .focus-button { min-height: 32px; padding: 5px 8px; white-space: nowrap; }
  .icon-button { width: 32px; height: 32px; }
  .filters { position: absolute; z-index: 4; inset: 0 auto 0 0; width: var(--mobile-filter-width); height: auto; min-width: 0; min-height: 0; padding: 12px; border: 0; border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; box-shadow: none; transform: translateX(0); transition: transform .2s ease, visibility .2s ease; scrollbar-width: thin; }
  .workspace.filters-collapsed .filters { visibility: hidden; pointer-events: none; transform: translateX(-100%); }
  .filter-close { display: block; }
  .panel-heading { margin-bottom: 12px; }
  .panel-heading h2 { font-size: 21px; }
  .field-label { margin-top: 12px; }
  .search-field input, select { min-height: 38px; }
  .municipality-options { max-height: 116px; }
  .range-label { margin-top: 16px; }
  .switch-row { margin: 16px 0; padding: 13px 0; }
  .source-box { margin-top: 18px; }
  .mobile-scrim, .mobile-scrim.is-visible { display: none; }
  .details { top: 72px; right: max(6px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); width: min(340px, 45vw); min-height: 0; padding: 15px; overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .detail-title { font-size: 22px; }
  .detail-person-head { grid-template-columns: 52px 1fr; gap: 10px; }
  .detail-portrait { width: 52px; height: 52px; font-size: 17px; }
  .detail-total { margin: 14px 0; padding: 10px 0; }
  .detail-total strong { font-size: 22px; }
  .detail-section { margin-top: 17px; }
  .ranking-view { height: calc(100dvh - 72px); padding: 0 0 8px; overflow: auto; overscroll-behavior: contain; }
  .ranking-intro { align-items: end; flex-direction: row; gap: 18px; padding: 8px 0; }
  .ranking-intro h2 { font-size: 19px; }
  .ranking-intro .section-label { display: none; }
  .ranking-intro p { max-width: 55%; font-size: 9px; }
  .ranking-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .data-card-heading { padding: 10px; }
  .data-card-heading h3 { font-size: 16px; }
  .data-card-heading span { font-size: 8px; }
  .ranking-row { grid-template-columns: 25px 1fr auto; gap: 7px; padding: 8px 10px; }
  .rank-number { font-size: 14px; }
  .rank-value strong { font-size: 14px; }
}

@media (orientation: portrait) and (max-width: 760px) and (pointer: coarse) {
  .orientation-notice { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; text-align: center; color: var(--ink); background: var(--bg); }
  .orientation-notice strong { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
  .orientation-notice span:last-child { max-width: 280px; color: var(--muted); font-size: 12px; }
  .orientation-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; color: var(--person); border: 1px solid var(--person-soft); border-radius: 50%; font-size: 28px; }
}
