:root {
  color-scheme: light;
  --ink: #252e40;
  --muted: #647084;
  --brand: #5063cb;
  --brand-dark: #394caa;
  --line: #e3e7ef;
  --surface: #f6f7fa;
  --dark: #242a34;
  --radius: 16px;
  --text-caption: .8125rem;
  --text-small: .875rem;
  --text-body: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button:disabled, input:disabled { cursor: not-allowed; }
button:disabled { background: #e9ecf7; color: #59658a; border-color: #e9ecf7; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a, button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8298f3; outline-offset: 5px; }
section[id] { scroll-margin-top: 28px; }
.container { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 20px; top: -80px; z-index: 10; padding: 12px 20px; background: white; color: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--dark); color: #fff; }
.header-inner { min-height: 88px; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { object-fit: contain; }
.brand > span { font-size: 21px; font-weight: 700; letter-spacing: .08em; line-height: 1.35; }
.brand small { display: block; font-size: var(--text-small); font-weight: 400; letter-spacing: .07em; opacity: .7; margin-top: 3px; }
.main-nav { display: flex; gap: 34px; margin-left: auto; }
.main-nav a { font-size: var(--text-body); color: #e0e4ed; padding: 10px 0; }
.main-nav a:hover, .site-footer a:hover { color: #b5c7ff; }
.header-status { display: flex; align-items: center; gap: 9px; border-left: 1px solid #48505d; padding-left: 30px; color: #bdc4d1; font-size: var(--text-small); }
.status-dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #7c90e7; }
.hero { background: linear-gradient(115deg, #f8f9fd, #eff2fa); padding: 66px 0 70px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: center; }
.eyebrow { font-size: var(--text-small); font-weight: 650; letter-spacing: .17em; color: var(--brand); margin-bottom: 13px; }
.hero-copy .eyebrow { font-size: var(--text-small); display: flex; align-items: center; gap: 10px; letter-spacing: .12em; }
.eyebrow-line { width: 24px; height: 2px; background: var(--brand); }
h1 { font-size: clamp(32px, 3.1vw, 44px); font-weight: 750; line-height: 1.5; letter-spacing: -.035em; }
h1 span { display: block; font-size: .64em; color: #566587; font-weight: 500; letter-spacing: 0; margin-top: 4px; }
.hero-description { margin-top: 24px; color: var(--muted); font-size: 1.0625rem; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 46px; border: 1px solid transparent; border-radius: 8px; padding: 11px 20px; font-size: var(--text-body); font-weight: 600; }
.button-primary { background: var(--brand); color: white; }
a.button-primary:hover { background: var(--brand-dark); }
.button-outline { background: #fff; border-color: #d5dbe9; color: #46516b; }
.button-outline:hover { border-color: var(--brand); }
.hero-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--text-small); margin-top: 23px; }
.hero-visual { position: relative; min-width: 0; border-radius: var(--radius); overflow: hidden; height: 355px; background: #164575; box-shadow: 0 18px 36px #21345c17; }
.hero-visual > img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, #102044dd); }
.hero-visual figcaption { position: absolute; bottom: 29px; left: 30px; right: 24px; z-index: 1; color: white; display: grid; gap: 6px; }
.visual-label { font-size: var(--text-caption); letter-spacing: .2em; color: #c4ddff; }
.hero-visual strong { font-size: 24px; letter-spacing: .04em; }
.hero-visual figcaption > span:last-child { font-size: var(--text-small); color: #d8e2f7; }
.visual-number { position: absolute; top: 22px; right: 22px; z-index: 1; font-size: var(--text-caption); color: white; padding: 5px 10px; border: 1px solid #ffffff55; border-radius: 20px; background: #16254c40; }
.section { padding-top: 64px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h2 { font-size: 26px; font-weight: 700; line-height: 1.5; letter-spacing: -.025em; }
.badge { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: var(--text-small); color: var(--muted); white-space: nowrap; background: #fff; }
.section-description { color: var(--muted); font-size: var(--text-body); margin-top: 10px; }
.search-preview { display: flex; align-items: center; margin-top: 26px; padding: 7px; border: 1px solid #dce1ed; border-radius: 10px; background: #fafbfe; gap: 10px; }
.search-preview label { font-size: 29px; color: #687899; padding-left: 13px; line-height: 1; }
.search-preview input { min-width: 0; flex: 1; border: none; background: transparent; padding: 10px 0; color: var(--muted); font-size: var(--text-body); opacity: 1; }
.search-preview input::placeholder { color: #6b768a; opacity: 1; }
.field-note { font-size: var(--text-small); color: var(--muted); margin-top: 10px; }
.city-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 24px; }
.city-card { padding: 22px 19px 17px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(150deg, #fff, #f5f7fc); }
.city-index { flex-wrap: wrap; font-size: var(--text-caption); color: var(--brand); display: flex; align-items: center; gap: 10px; }
.city-index > span { color: #788295; font-size: var(--text-caption); letter-spacing: .1em; }
.city-card h3 { font-size: 23px; margin: 22px 0 5px; }
.city-card > p { font-size: var(--text-small); color: var(--muted); }
.city-state { align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; display: flex; justify-content: space-between; font-size: var(--text-caption); color: var(--muted); }
.compare-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding: 42px 52px; border: 1px solid #e3e4f3; border-radius: var(--radius); background: linear-gradient(115deg, #f0f3fc, #f6f1fa); align-items: center; }
.compare-copy h2 { font-size: 31px; }
.compare-copy > p:not(.eyebrow):not(.field-note) { color: var(--muted); font-size: var(--text-body); line-height: 1.95; margin-top: 18px; }
.topic-tags { display: flex; gap: 8px; margin-top: 23px; }
.topic-tags span { font-size: var(--text-small); padding: 4px 15px; color: #56649b; border: 1px solid #dce0f2; border-radius: 5px; }
.compare-copy .field-note { margin-top: 27px; }
.compare-preview { background: #fff; border: 1px solid #e3e5ee; border-radius: 12px; padding: 22px 26px; box-shadow: 0 8px 24px #35356008; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-small); }
.preview-heading .badge { font-size: var(--text-caption); }
.city-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; padding: 23px 0; }
.city-pair strong { font-size: 24px; }
.city-pair small { display: block; font-size: var(--text-caption); font-weight: 400; letter-spacing: .12em; color: var(--muted); margin-top: 4px; }
.versus { border-radius: 50%; background: #f1f3fa; color: #7582ad; font-size: var(--text-small); padding: 9px; }
.comparison-topics { margin: 0 0 18px; }
.comparison-topics > div { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; border-top: 1px solid #edf0f5; padding: 11px 0; font-size: var(--text-small); }
.comparison-topics dd { margin: 0; color: var(--muted); }
.compare-preview .button { width: 100%; font-size: var(--text-small); }
.preview-note { text-align: center; color: var(--muted); font-size: var(--text-caption); margin-top: 12px; }
.stories-section { padding-bottom: 64px; }
.story-grid { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 22px; margin-top: 26px; }
.story-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.story-image { position: relative; height: 185px; background: #dbe3f1; }
.story-image img { width: 100%; height: 100%; object-fit: cover; }
.story-image > span { position: absolute; left: 16px; bottom: 14px; color: white; background: #23334de8; padding: 4px 10px; border-radius: 4px; font-size: var(--text-caption); }
.story-body { padding: 22px; }
.story-kicker { color: var(--brand); font-size: var(--text-caption); letter-spacing: .06em; margin-bottom: 10px; }
.story-body h3 { font-size: 1.25rem; }
.story-body > p:not(.story-kicker) { font-size: var(--text-small); color: var(--muted); margin-top: 10px; line-height: 1.9; }
.story-status { display: block; color: var(--muted); font-size: var(--text-caption); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; }
.insight-card { border-radius: 12px; padding: 25px 30px; background: #f0f2fb; display: flex; flex-direction: column; }
.insight-mark { font-family: Georgia, serif; color: #6b7dcc; font-size: 68px; height: 68px; line-height: 1.3; }
.insight-card h3 { font-size: 26px; line-height: 1.6; }
.insight-card > p:not(.story-kicker) { color: #64708b; font-size: var(--text-small); line-height: 1.95; margin-top: 18px; }
.insight-bottom { margin-top: auto; padding-top: 28px; font-size: var(--text-small); color: #5b6891; display: flex; align-items: center; gap: 8px; }
.principles { border-top: 1px solid var(--line); padding: 44px 0; background: #f8f9fb; }
.principles-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 38px; }
.principles h2 { font-size: 21px; }
.principle > span { font-size: var(--text-caption); color: var(--brand); }
.principle h3 { font-size: var(--text-body); margin-top: 14px; }
.principle p { font-size: var(--text-small); color: var(--muted); line-height: 1.9; margin-top: 8px; }
.site-footer { background: var(--dark); color: #fff; }
.footer-top { padding-block: 36px; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer-top p { font-size: var(--text-small); color: #bac2cf; margin-top: 15px; }
.footer-top nav { display: flex; gap: 28px; font-size: var(--text-small); color: #c5ccd8; }
.footer-bottom { flex-wrap: wrap; border-top: 1px solid #414753; display: flex; justify-content: space-between; gap: 16px; padding-block: 20px; color: #afb8c8; font-size: var(--text-caption); }
@media (max-width: 1000px) {
  .header-inner { gap: 24px; }
  .main-nav { gap: 22px; }
  .header-status { padding-left: 18px; }
  .hero-grid { gap: 28px; }
  .hero-visual { height: 335px; }
  .hero-actions { gap: 8px; }
  .hero-actions .button { padding-inline: 15px; gap: 10px; }
  .city-grid { grid-template-columns: repeat(3, 1fr); }
  .compare-panel { padding: 32px; gap: 30px; }
  .story-grid { gap: 16px; grid-template-columns: 1fr 1fr; }
  .insight-card { grid-column: 1 / -1; }
  .insight-card h3 br { display: none; }
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .container { width: calc(100% - 36px); }
  .header-inner { flex-wrap: wrap; gap: 0; padding-top: 16px; }
  .brand > span { font-size: 1.25rem; }
  .brand img { width: 36px; height: 36px; }
  .header-status { order: 1; margin-left: auto; border: 0; padding: 0; font-size: var(--text-caption); }
  .main-nav { order: 2; width: 100%; margin: 13px 0 0; gap: 28px; border-top: 1px solid #414753; }
  .main-nav a { font-size: var(--text-small); padding: 13px 0; }
  .hero { padding: 36px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  h1 { font-size: 36px; }
  .hero-description { font-size: var(--text-body); margin-top: 17px; }
  .hero-actions { margin-top: 23px; }
  .hero-visual { height: 260px; }
  .hero-visual figcaption { left: 24px; bottom: 23px; }
  .hero-visual strong { font-size: 22px; }
  .section { padding-top: 40px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  h2 { font-size: 23px; }
  .section-description { font-size: var(--text-body); }
  .search-preview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
  .search-preview .button { grid-column: 1 / -1; padding-inline: 10px; font-size: var(--text-small); }
  .search-preview label { padding-left: 4px; }
  .search-preview input { font-size: var(--text-body); }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .city-card { padding: 18px 15px 15px; }
  .city-card:last-child { grid-column: 1 / -1; }
  .city-card h3 { margin-top: 14px; }
  .city-state { margin-top: 18px; }
  .compare-panel { grid-template-columns: 1fr; gap: 26px; padding: 26px 20px; }
  .compare-copy h2 { font-size: 27px; }
  .compare-copy h2 br { display: none; }
  .compare-preview { padding: 20px; }
  .story-grid { grid-template-columns: 1fr; }
  .story-image { height: 200px; }
  .stories-section { padding-bottom: 40px; }
  .principles-grid { grid-template-columns: 1fr; gap: 26px; }
  .principles-grid > div:first-child h2 br { display: none; }
  .principle { border-top: 1px solid var(--line); padding-top: 18px; }
  .principle h3 { margin-top: 8px; }
  .footer-top { align-items: flex-start; flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a.button { transition: background-color .15s, border-color .15s; }
}

/* Search and source-backed region profiles. */
.catalog-page h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.3; margin: 14px 0; }
.catalog-page { min-height: 60vh; }
.search-preview input { color: var(--ink); }
.search-preview:focus-within { border-color: #5575ca; box-shadow: 0 0 0 3px #5575ca22; }
.catalog-date { display: flex; align-items: center; gap: 8px; }
.catalog-date label { font-size: 16px; white-space: nowrap; }
.catalog-date input { font-size: 16px; }
.region-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; margin-top: 24px; }
.region-result h2 { font-size: 24px; margin: 0 0 10px; }
a.city-card { display: block; color: inherit; transition: border-color .2s, box-shadow .2s; }
a.city-card:hover { border-color: #627cca; box-shadow: 0 6px 18px #2d3e6512; }
.notice { padding: 22px; background: #f0f3fb; border-radius: 10px; line-height: 1.8; margin-block: 20px; }
.notice p { margin-block: 8px; }
.catalog-pagination { margin-top: 24px; }
.profile-overview, .fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.profile-panel { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.profile-panel h2, .profile-panel h3 { margin: 0 0 18px; font-size: 24px; }
.profile-panel p { line-height: 1.8; }
.profile-fields { margin: 0; }
.profile-fields > div { display: flex; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.profile-fields dt { color: var(--muted); min-width: 95px; }
.profile-fields dd { margin: 0; }
.profile-heading { margin-top: 44px; }
.fact-grid { margin-top: 24px; }
.fact-value { font-size: clamp(30px, 4vw, 40px); font-weight: 700; margin: 16px 0; color: #3e56aa; }
.fact-value span { font-size: 19px; font-weight: 400; margin-left: 10px; }
.source-link, .back-link, .profile-fields a { color: #3854a8; text-decoration: underline; text-underline-offset: 4px; }
.profile-panel details { padding-top: 16px; border-top: 1px solid var(--line); }
.profile-panel summary { cursor: pointer; color: #3854a8; font-weight: 600; }
/* Region statistics: readable controls and source records without a wide table. */
.profile-statistics, #history { scroll-margin-top: 24px; }
.catalog-page { padding-bottom: 64px; }
.statistics-form { margin-top: 24px; background: #f8f9fd; }
.statistics-controls { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 18px; }
.statistics-controls > div { min-width: 0; }
.statistics-controls label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.statistics-controls input, .statistics-controls select { display: block; width: 100%; min-width: 0; min-height: 46px; border: 1px solid #cbd3e2; border-radius: 7px; background: white; color: var(--ink); font: inherit; font-size: 16px; padding: 10px; }
.query-options { margin-top: 20px; }
.query-options .statistics-controls { margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.checkbox-field { display: flex; align-items: center; gap: 10px; margin-top: 20px; cursor: pointer; }
.checkbox-field input { width: 20px; height: 20px; accent-color: var(--brand); }
.query-actions { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.query-actions button { cursor: pointer; }
.scope-note { margin-top: 18px; }
.knowledge-note { margin-top: 18px; padding: 18px 22px; border-left: 3px solid #b5c1e3; background: #f6f8fc; overflow-wrap: anywhere; }
.knowledge-note summary { cursor: pointer; color: #3854a8; }
.knowledge-note p { margin-top: 12px; }
.kpi-heading { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.kpi-heading h3 { margin-bottom: 0; flex: 1; min-width: min(100%, 180px); }
.data-status { display: inline-block; font-size: 14px; line-height: 1.6; padding: 4px 10px; border-radius: 6px; background: #f0f2f6; color: #536077; }
.status-ready { background: #edf5f0; color: #286448; }
.status-conflict, .status-incompatible { background: #fff4df; color: #815111; }
.kpi-placeholder { font-size: 23px; color: var(--muted); margin: 24px 0; }
.candidate-source + .candidate-source { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.candidate-source p { margin-top: 10px; }
.history-list { display: grid; gap: 18px; margin-top: 24px; }
.history-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.history-summary h3 { margin-bottom: 8px; }
.history-summary > div { min-width: 0; }
.history-value { font-size: 25px; font-weight: 650; color: #3e56aa; overflow-wrap: anywhere; }
.history-value span { font-size: 18px; font-weight: 400; }
.history-record details { margin-top: 20px; }
.history-record details p { margin-top: 10px; }
.history-record > .data-status { margin-top: 14px; }
@media (max-width: 1000px) {
  .statistics-controls, .query-options .statistics-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .profile-overview, .fact-grid { grid-template-columns: 1fr; }
  .profile-panel { padding: 20px; }
  .catalog-date { grid-column: 1 / -1; flex-wrap: wrap; }
  .catalog-date input { min-width: 0; width: 150px; }
}
@media (max-width: 480px) {
  .statistics-controls, .query-options .statistics-controls { grid-template-columns: minmax(0, 1fr); }
  .query-actions .button { width: 100%; }
  .knowledge-note { padding: 16px; }
  .history-value { font-size: 23px; }
}
