@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Shared visual language with the study questionnaire. */
:root {
  --paper: #f7f6f2;
  --ink: #0b0b0c;
  --muted: #64615d;
  --rule: #cfcac2;
  --soft-rule: #e4e0d9;
  --blue: #164eb2;
  --blue-pale: #e9f0ff;
  --red: #df2e11;
  --orange: #ee6904;
  --yellow: #f3c524;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

body { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .metric strong, .map-popup h3 { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, a:focus-visible, #map:focus-visible, .map-point:focus-visible,
.year-bar:focus-visible, .bar:focus-visible, .map-popup button:focus-visible,
.map-actions button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.top {
  min-height: 74px;
  padding: 12px clamp(22px, 4.9vw, 80px);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  gap: 26px;
}
.top-brand { min-width: 0; gap: clamp(25px, 3vw, 70px) !important; }
.top-logo { display: block; width: 122px; height: auto; flex: 0 0 auto; }
.top-context { min-width: 0; display: flex; align-items: center; gap: 14px; }
.brand, .top-section, .test-pill {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
}
.brand { max-width: none; }
.top-rule { width: 28px; height: 1px; flex: 0 0 auto; background: var(--ink); }
.top-section { color: var(--muted); white-space: nowrap; }
.top-right { gap: 18px; }
.test-pill { padding: 6px 9px; border: 1px solid var(--ink); border-radius: 0; color: var(--ink); font-size: 10px; }
.top a { color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }

main { max-width: 1560px; padding-top: 58px; padding-bottom: 64px; }
.intro { align-items: flex-end; margin-bottom: 34px; }
.eyebrow { color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.eyebrow span { color: var(--muted); }
h1 { margin: 12px 0 14px; color: var(--ink); font-size: clamp(36px, 3.7vw, 56px); font-weight: 750; letter-spacing: -.06em; line-height: 1.04; }
h1 span { color: var(--ink); }
.intro p, .panel-head p, .chart-note { color: #4d4a46; line-height: 1.55; }
.intro p { max-width: 720px; font-size: 14px; }
.live { min-width: 240px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 0; box-shadow: none; }
.live > span { background: var(--blue); }
.live small, .tiny { color: var(--muted); }
.live button { background: var(--paper); color: var(--ink); border-radius: 0; }

.filters, .metric, .panel { background: #fff; border: 1px solid var(--rule); border-radius: 0; box-shadow: none; }
.filters { padding: 16px; gap: 10px; }
.filters label, .filter-label { color: #494641; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.filters select, .search, .multi summary, .option-search { border: 1px solid #b9b3aa; border-radius: 0; background: #fff; color: var(--ink); }
.search { color: var(--muted); }
.search input { color: var(--ink); }
.search input::placeholder { color: #6c6862; opacity: 1; }
.search:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.search input:focus-visible { outline: none; }
.multi summary i { color: var(--muted); }
.multi summary.has-selection { border-color: var(--blue); background: var(--blue-pale); }
.multi[open] summary { box-shadow: 0 0 0 2px var(--blue-pale); }
.multi-menu { border: 1px solid var(--rule); border-radius: 0; box-shadow: 0 10px 24px #0b0b0c1a; }
.multi-actions, .multi-option .option-count { color: var(--muted); }
.multi-actions button { color: var(--blue); }
.filters label.multi-option { color: var(--ink); border-radius: 0; }
.multi-option:hover { background: var(--blue-pale); }
.multi-option input { accent-color: var(--blue); }
.quiet, .pagination button { border: 1px solid #a9a299; border-radius: 0; color: var(--ink); background: white; }
.statusline { color: var(--muted); }
.chip { border: 1px solid #b8c8e6; border-radius: 0; background: var(--blue-pale); color: #143e83; }
.chip:hover { background: #d8e5fb; }

.metrics { gap: 12px; }
.metric { min-height: 108px; padding: 19px 20px; color: var(--ink); }
.metric strong { margin-top: 9px; font-size: 30px; font-weight: 750; letter-spacing: -.045em; }
.metric span { color: #4d4a46; }
.metric small { border-radius: 0; background: var(--paper); color: #514d48; }
.metric.active, .metric[aria-pressed="true"] { outline: 2px solid var(--blue); outline-offset: -2px; }
.metric:hover, .quiet:hover, .pagination button:not(:disabled):hover { border-color: var(--ink); }
.grid, .analysis-grid { gap: 16px; }
.map-panel, .breakdown, .directory, .chart-panel, .timeline-panel { padding: 24px; }
.panel-head h2, .chart-panel h2, .timeline-panel h2 { color: var(--ink); font-size: 21px; font-weight: 750; letter-spacing: -.045em; }
.panel-head p, .chart-note { font-size: 12px; }

.map-wrap { border: 1px solid var(--soft-rule); border-radius: 0; background: #f1efe9; }
#map, #map.maplibregl-map { border-radius: 0; background: #f1efe9; }
.map-actions button { border: 1px solid var(--rule); border-radius: 0; color: var(--ink); box-shadow: none; }
.map-actions button:hover { background: var(--paper); }
.maplibregl-ctrl-group { border: 1px solid var(--rule) !important; border-radius: 0 !important; box-shadow: none !important; }
.maplibregl-ctrl-scale { color: var(--ink) !important; }
.map-legend { color: #4d4a46; }
.map-legend b { color: var(--ink); }
.map-legend small { color: var(--muted); line-height: 1.5; }
.map-legend a { color: #173f83; }
.map-swatch { border-color: #6685b5; }
.map-swatch.s1 { background: #cedbf5; }
.map-swatch.s2 { background: #8eade1; }
.map-swatch.s3 { background: #315fae; }
.map-swatch.s4 { background: #143b85; }
.map-legend .approx { background: #cedbf5; border: 2px solid #c55c0b; }
.map-warning { border-color: #d6aa6b; border-radius: 0; background: #fff9eb; color: #71420d; }
.maplibregl-popup-content { border: 1px solid var(--rule); border-radius: 0 !important; box-shadow: 0 5px 18px #0b0b0c26 !important; color: var(--ink); }
.maplibregl-popup-close-button, .map-popup-subtitle, .map-popup-row span, .map-popup-list small { color: var(--muted) !important; }
.map-popup-eyebrow { color: var(--ink); }
.map-popup-row { border-color: var(--soft-rule); }
.map-popup-approx { color: #8d430b; }
.map-popup button { border-radius: 0; }
.map-popup-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.map-popup-primary:hover { background: #303030; }
.map-popup-secondary { background: var(--blue-pale); color: #143e83; }
.map-popup-secondary:hover { background: #d8e5fb; }

.break-section h3, .bar, .bar b { color: #35322f; }
.break-section h3 small { color: var(--muted); }
.bar { border-radius: 0; }
.bar:hover { background: #f2f4f9; }
.bar.active .name { color: #143e83; }
.track { border-radius: 0; background: #ebe9e4; }
.track i { border-radius: 0; background: #85a3d5; }
.bar:hover .track i, .bar.active .track i { background: var(--blue); }
.timeline-scroll { scrollbar-color: #a9b9d3 #eeece6; }
.year-bar rect { fill: #85a3d5; }
.year-bar:hover rect, .year-bar.active rect { fill: var(--blue); }

th { border-color: var(--rule); color: #56524d; }
td { border-color: var(--soft-rule); color: #383531; }
td strong { color: var(--ink); }
td small, .missing { color: var(--muted); }
.badge { border: 1px solid #d9c88f; border-radius: 0; background: #fff9da; color: #5f4a0a; }
.badge.selected { border-color: #b3c6e9; background: var(--blue-pale); color: #163f83; }
.badge.not-selected { border-color: #e2b9ad; background: #fff0ec; color: #8b2c19; }
.open { border: 1px solid #b8c8e6; border-radius: 0; background: var(--blue-pale); color: #143e83; }
.open:hover { border-color: var(--blue); }
.pagination, .footnote { color: var(--muted); }
.notice { border: 1px solid #d6aa6b; border-radius: 0; background: #fff9eb; color: #71420d; }

.scrim { background: #0b0b0cb8; }
.drawer { background: var(--paper); box-shadow: -12px 0 38px #0003; }
.drawer-top button { border: 1px solid var(--rule); border-radius: 0; background: #fff; color: var(--ink); }
.detail-heading h2 { color: var(--ink); font-size: 30px; letter-spacing: -.05em; }
.detail-heading p { color: var(--muted); }
.edit-box { border: 1px solid #b8c8e6; border-radius: 0; background: var(--blue-pale); }
.edit-box p { color: #45413d; }
.edit-box iframe { border-radius: 0; }
.detail-section { border: 1px solid var(--rule); border-radius: 0; }
.detail-section summary span, .detail-section dt { color: var(--muted); }
.detail-section dl div { border-color: var(--soft-rule); }
.detail-section dd { color: var(--ink); }
.detail-section a { color: #173f83; }

.site-footer { background: #050505; color: #fff; overflow: hidden; }
.footer-inner {
  width: min(1420px, calc(100% - clamp(44px, 9vw, 140px)));
  margin: 0 auto;
  padding: 42px 0 45px;
  display: grid;
  grid-template-columns: minmax(390px, 1.1fr) minmax(320px, 1fr);
  gap: clamp(34px, 6vw, 90px);
}
.partner-lockup { display: grid; grid-template-columns: 112px 150px 86px; align-items: start; gap: 15px; }
.partner { position: relative; min-width: 0; min-height: 56px; display: grid; grid-template-rows: 34px auto; justify-items: center; align-items: center; gap: 8px; text-align: center; }
.partner:not(:last-of-type)::after { content: ""; position: absolute; top: 1px; right: -8px; bottom: 16px; width: 1px; background: #757575; }
.partner > img { display: block; width: auto; height: 33px; max-width: 100%; object-fit: contain; }
.partner-lead img { width: 102px; height: 33px; filter: brightness(0) invert(1); }
.pattrnz-mark { display: block; width: 140px; height: 34px; overflow: hidden; }
.pattrnz-mark img { display: block; width: 238px; max-width: none; height: auto; filter: grayscale(1) contrast(200%); transform: translate(-7px, -25px); }
.partner-di img { width: 57px; height: 35px; }
.partner > span:not(.pattrnz-mark) { width: 100%; color: #d5d5d5; font-size: 10px; line-height: 1.25; }
.partner-lockup > p { grid-column: 1 / -1; color: #b1b1b1; font-size: 10px; letter-spacing: .02em; }
.footer-information { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.footer-information h2 { margin-bottom: 12px; color: #fff; font-size: 12px; }
.footer-information p { max-width: 260px; color: #bebebe; font-size: 11px; line-height: 1.5; }
.footer-spectrum { display: grid; grid-template-columns: repeat(4, 1fr); height: 14px; }
.footer-spectrum i:nth-child(1) { background: var(--blue); }
.footer-spectrum i:nth-child(2) { background: var(--red); }
.footer-spectrum i:nth-child(3) { background: var(--orange); }
.footer-spectrum i:nth-child(4) { background: var(--yellow); }

@media (max-width: 900px) {
  .top { align-items: flex-start; }
  .top-brand { gap: 22px !important; }
  .top-context { flex-wrap: wrap; gap: 7px 10px; }
  .top-rule { width: 20px; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  main { padding-top: 40px; }
  .top { flex-wrap: wrap; gap: 12px; }
  .top-brand { width: 100%; }
  .top-right { margin-left: 144px; }
  .map-panel, .breakdown, .directory, .chart-panel, .timeline-panel { padding: 18px; }
  .intro { margin-bottom: 26px; }
}
@media (max-width: 520px) {
  .top { padding: 14px 16px; }
  .top-logo { width: 100px; }
  .top-brand { gap: 16px !important; }
  .brand, .top-section { font-size: 9px; }
  .top-rule { display: none; }
  .top-context { display: grid; gap: 4px; }
  .top-right { margin-left: 116px; }
  .top-right .test-pill { display: inline-block; }
  .top a { display: inline; font-size: 11px; }
  main { padding: 34px 16px 48px; }
  h1 { font-size: 36px; }
  .live { min-width: 0; width: 100%; }
  .filters { padding: 12px; }
  .metric { min-height: 96px; padding: 14px; }
  .metric strong { font-size: 25px; }
  .drawer { padding: 20px; }
  .footer-inner { width: calc(100% - 32px); padding: 34px 0; }
  .partner-lockup { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .8fr); gap: 9px; }
  .partner:not(:last-of-type)::after { right: -5px; }
  .partner-lead img { width: 90px; }
  .pattrnz-mark { width: 112px; max-width: 100%; }
  .pattrnz-mark img { width: 200px; transform: translate(-6px, -21px); }
  .footer-information { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 380px) {
  .top-right { width: 100%; margin-left: 0; justify-content: flex-end; }
}
