:root {
  color-scheme: light;
  --ink: #101e42;
  --muted: #50607a;
  --blue: #0751e7;
  --blue-dark: #003ebd;
  --line: #d6e2f0;
  --white: #fff;
  --radius: 17px;
  --shadow: 0 3px 10px #2447750a;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: #f3f8fd;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: radial-gradient(ellipse at top, #dceffd 0, #eef6fd 780px, #f4f8fc 1350px); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .38; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #4989f5; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 1.25rem; height: 1.25rem; display: block; flex: none; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
h1, h2, h3, p, dl { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.08; }
h2 { font-size: clamp(1.85rem, 3.1vw, 2.42rem); }
h3 { font-size: 1.26rem; }
p { color: var(--muted); line-height: 1.55; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 12; top: .5rem; left: .5rem; background: white; padding: 1rem; }
.shell { width: min(1400px, calc(100% - 96px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 5; padding: 9px 0; background: #e7f3fdde; backdrop-filter: blur(12px); }
.nav-bar { min-height: 58px; padding: 6px 17px 6px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #ffffffed; border: 1px solid #cfe2f8; border-radius: 16px; box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.38rem; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.brand-mark { color: white; background: linear-gradient(155deg, #04b6f4, #0751e7 78%); border-radius: 12px; width: 33px; height: 33px; }
.brand-mark svg { width: 22px; height: 22px; }
nav { display: flex; justify-content: center; align-items: center; gap: clamp(4px, 1.65vw, 25px); }
nav a { padding: 10px 12px; border-radius: 9px; white-space: nowrap; font-size: .91rem; font-weight: 650; }
nav a:hover, nav a[aria-current] { background: #dcedff; color: var(--blue-dark); }
.button, .text-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: .9rem; text-align: center; transition: background-color .16s; }
.primary { background: var(--blue); color: white; box-shadow: 0 2px 4px #0745b91c; }
.primary:hover { background: var(--blue-dark); }
.outline { border-color: #91b7f3; background: #f5faffc9; color: var(--blue-dark); }
.outline:hover, .text-button:hover { background: #e3efff; }
.text-button { background: transparent; color: var(--blue-dark); }
.danger { background: #b93648; color: white; }
.danger:hover { background: #982539; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero { display: grid; align-items: center; min-height: 295px; position: relative; isolation: isolate; overflow: hidden; border-radius: 22px; background: #cce9fc; margin-top: 9px; }
.hero-image { position: absolute; inset: 0 0 0 auto; z-index: -1; width: 59%; height: 100%; object-fit: cover; object-position: 50% 43%; clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%); }
.hero-copy { position: relative; max-width: 48%; padding: 29px 0 30px clamp(22px, 3.6vw, 56px); }
.hero h1 { font-size: clamp(2.3rem, 4.15vw, 3.46rem); font-weight: 850; line-height: 1; }
.hero p { color: #243a56; max-width: 465px; margin: 12px 0 21px; font-size: clamp(.97rem, 1.5vw, 1.19rem); line-height: 1.38; }
.hero .button { min-height: 46px; padding-inline: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 0; margin: 14px 0 25px; background: #fff; border: 1px solid #d3e5f7; border-radius: var(--radius); box-shadow: var(--shadow); }
.stats > div { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; justify-content: center; align-items: center; column-gap: 14px; padding: 1px 12px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stat-icon { display: inline-grid; place-items: center; flex: none; width: 51px; height: 51px; border-radius: 15px; }
.stat-icon svg { width: 27px; height: 27px; }
.stat-icon.blue { color: var(--blue); background: #e5f2ff; }
.stat-icon.green { color: #117b60; background: #e2f8ee; }
.stat-icon.red { color: #b93648; background: #fde8eb; }
.stats .stat-icon { grid-area: 1 / 1 / 3 / 2; }
.stats dd { grid-area: 1 / 2; margin: 0; font-size: clamp(1.5rem, 2.85vw, 2.25rem); font-weight: 820; line-height: 1; letter-spacing: -.05em; }
.stats dt { grid-area: 2 / 2; font-size: .9rem; color: var(--muted); }
.section { margin-bottom: clamp(37px, 5vw, 70px); }
.section-heading { margin-bottom: 16px; }
.section-heading p { margin-top: 6px; }
.map-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
.demo-note { font-size: .78rem; color: var(--muted); background: #e8f2fd; border: 1px solid #d2e4f7; border-radius: 100px; padding: 6px 10px; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 11px; }
.filters select { min-width: 155px; }
.search { position: relative; width: min(380px, 100%); }
.search span { color: var(--muted); position: absolute; top: 50%; left: 11px; transform: translateY(-50%); }
input:not([type=range]), select, textarea { width: 100%; min-width: 0; min-height: 42px; color: var(--ink); background: #fff; border: 1px solid #c8d6e7; border-radius: 9px; padding: 9px 11px; }
input::placeholder, textarea::placeholder { color: #5c6d85; }
.search input { padding-left: 38px; }
select { padding-right: 27px; }
textarea { resize: vertical; }
.chips { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip { border: 1px solid #cbddf3; color: #23436b; background: #ffffffc9; border-radius: 40px; padding: 7px 13px; font-size: .82rem; font-weight: 650; min-height: 34px; }
.chip:hover { background: #e4efff; }
.chip[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: white; }
.card, .map-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; }
.map-card { height: 367px; position: relative; overflow: hidden; background: #e8edf0; touch-action: pan-y; }
.map-scene { position: absolute; inset: 0; cursor: grab; }
.map-scene.dragging { cursor: grabbing; }
#map-art, #markers { position: absolute; inset: 0; width: 100%; height: 100%; }
#markers { pointer-events: none; }
.marker { position: absolute; z-index: 1; display: grid; place-items: center; border: 0; background: transparent; padding: 0; width: 28px; height: 28px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: auto; }
.marker::before { content: ''; width: 14px; height: 14px; border: 3px solid white; background: var(--status); box-shadow: 0 2px 5px #1438504a; border-radius: 50%; }
.marker.utility::before { border-radius: 4px; }
.marker:hover, .marker:focus-visible { z-index: 3; }
.marker:hover::before, .marker:focus-visible::before { transform: scale(1.25); }
.marker:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }
.normal { --status: #15976f; --tag-bg: #e2f7eb; --tag-ink: #116444; }
.warning { --status: #d48b16; --tag-bg: #fff2d9; --tag-ink: #80500b; }
.risk { --status: #d74055; --tag-bg: #fce8eb; --tag-ink: #a2263a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--status); flex: none; }
.map-controls { position: absolute; z-index: 2; top: 12px; left: 12px; border: 1px solid #d2deea; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px #2141661a; background: white; }
.map-controls button { display: grid; place-items: center; width: 39px; height: 37px; padding: 0; border: 0; background: white; }
.map-controls button + button { border-top: 1px solid var(--line); }
.map-controls button:hover:enabled { background: #deecff; }
.map-controls button:focus-visible { outline-offset: -4px; }
.map-legend, .map-caption { position: absolute; z-index: 2; background: #ffffffee; border: 1px solid #d2deea; border-radius: 10px; color: #283950; }
.map-legend { bottom: 11px; left: 12px; padding: 9px 11px; display: grid; gap: 5px; font-size: .72rem; pointer-events: none; }
.map-legend span, .tag { display: inline-flex; align-items: center; gap: 6px; }
.map-caption { bottom: 11px; right: 12px; padding: 6px 8px; font-size: .68rem; pointer-events: none; }
.results { height: 367px; display: flex; flex-direction: column; overflow: hidden; }
.results-head { padding: 13px 15px 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.results-head h3 { font-size: 1.16rem; }
#result-count, .chart-heading > span { color: var(--muted); font-size: .78rem; }
.compact select { min-height: 34px; padding: 6px 7px; font-size: .77rem; }
.record-list { overflow-y: auto; }
.record { width: 100%; display: grid; grid-template-columns: 33px minmax(0, 1fr) auto; align-items: center; text-align: left; gap: 10px; background: transparent; border: 0; border-bottom: 1px solid #e6edf6; padding: 10px 13px; min-height: 61px; }
.record:hover { background: #f1f7ff; }
.record:focus-visible { outline-offset: -4px; }
.record .stat-icon { border-radius: 10px; width: 33px; height: 33px; }
.record .stat-icon svg { width: 19px; height: 19px; }
.record strong { display: block; font-size: .92rem; overflow-wrap: anywhere; }
.record small { display: block; margin-top: 3px; font-size: .73rem; color: var(--muted); }
.tag { background: var(--tag-bg); color: var(--tag-ink); padding: 5px 8px; border-radius: 7px; font-weight: 720; font-size: .72rem; white-space: nowrap; }
.empty { padding: 22px 15px; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.form-panel, .preview, .chart-card, .table-card, .reference { padding: clamp(15px, 2vw, 25px); }
.form-panel label { display: block; font-size: .88rem; font-weight: 700; }
.form-panel label input:not([type=range]), .form-panel select, .form-panel textarea { display: block; margin-top: 6px; font-weight: 450; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 19px; }
.optional { color: var(--muted); font-size: .72rem; font-weight: 450; }
.parameter-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin: 13px 0 17px; }
.parameter { padding: 9px 0 10px; border-bottom: 1px solid #e3edf7; min-width: 0; }
.parameter small { color: var(--muted); font-size: .73rem; }
.parameter-inputs { display: flex; align-items: center; gap: 9px; margin-top: 4px; }
.parameter-inputs input[type=range] { flex: 1 1 auto; width: 0; min-width: 48px; min-height: 28px; accent-color: var(--blue); margin: 0; }
.parameter-inputs input[type=number] { width: 74px; min-height: 34px; padding: 5px 6px; }
.parameter-inputs input[aria-invalid=true] { border-color: #d74055; }
.preview { background: #e5f1ff; border-color: #cde1fa; }
.preview > .stat-icon { margin-bottom: 11px; background: #fff; }
.preview h3 { margin-bottom: 10px; }
.preview p, .form-bottom p, .reference p { font-size: .85rem; }
.form-bottom { display: grid; gap: 10px; margin-top: 13px; }
.mobile-status { display: none; }
.form-error { color: #a2263a; margin-top: 12px; }
.measurements { margin: 13px 0; border: 1px solid #d7e5f7; background: white; border-radius: 11px; overflow: hidden; }
.measurements > div { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 9px 12px; font-size: .85rem; }
.measurements > div + div { border-top: 1px solid #e5edf7; }
.measurements dt { color: #314760; }
.measurements dd { margin: 0; white-space: nowrap; font-weight: 680; }
.measurements dd .dot { margin-right: 6px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: 13px; }
.chart-card { display: flex; flex-direction: column; gap: 14px; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
#radar { width: 100%; height: 248px; display: block; }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; }
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .76rem; }
.chart-legend i { width: 10px; height: 10px; background: #0751e7; border-radius: 2px; }
.chart-legend span:nth-child(2) i { background: #0e9f88; }
.chart-legend span:nth-child(3) i { background: white; border: 1px dashed #6e819c; }
.bars { display: grid; align-content: center; gap: 11px; min-height: 230px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 108px) minmax(0, 1fr); align-items: center; gap: 6px; }
.bar-label { font-size: .78rem; color: #314760; }
.bar-plot { position: relative; display: grid; gap: 4px; background: repeating-linear-gradient(90deg, #e7eef8 0 1px, transparent 1px 25%); padding-block: 1px; }
.bar-limit { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #6e819c; }
.bar-line { height: 16px; display: flex; align-items: center; gap: 4px; color: #40556d; font-size: .69rem; }
.bar-line i { height: 8px; border-radius: 0 3px 3px 0; background: #0751e7; flex: none; }
.bar-line.resident i { background: #0e9f88; }
.table-scroll { overflow-x: auto; margin-top: 13px; border-radius: 9px; }
table { border-collapse: collapse; width: 100%; min-width: 615px; font-size: .84rem; }
thead { background: #e6f1ff; color: #294266; }
th, td { padding: 10px 9px; border-bottom: 1px solid #e5edf7; text-align: left; }
tbody th { font-weight: 680; }
th small { color: var(--muted); display: block; font-size: .71rem; font-weight: 420; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; list-style: none; padding: 0; margin: 0 0 13px; }
.steps li { padding: 17px; }
.steps h3 { margin: 10px 0 6px; }
.steps p { font-size: .88rem; }
.reference dl { display: flex; flex-wrap: wrap; gap: 9px 20px; margin: 12px 0; }
.reference dl div { display: flex; flex-wrap: wrap; gap: 6px; font-size: .83rem; }
.reference dt { font-weight: 700; }
.reference dd { margin: 0; color: var(--muted); }
footer { background: #e8f2fe; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 24px 0; }
.footer-inner p { margin-top: 6px; font-size: .8rem; }
dialog { color: var(--ink); border: 1px solid var(--line); padding: 0; border-radius: 18px; width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 26px); box-shadow: 0 20px 70px #11264a4d; }
dialog::backdrop { background: #14274680; }
.dialog-inner { position: relative; padding: 22px; }
.dialog-inner .close-button { position: absolute; top: 12px; right: 12px; }
.close-button { background: #e9f3ff; color: var(--blue-dark); border: 0; border-radius: 10px; width: 36px; height: 36px; }
#record-title { padding-right: 24px; margin: 9px 0 5px; overflow-wrap: anywhere; }
#record-detail p { font-size: .87rem; overflow-wrap: anywhere; }
#record-detail .actions, #confirm-dialog .actions { margin-top: 13px; }
#confirm-text { margin-top: 8px; }
.notice { position: fixed; right: 16px; bottom: 16px; z-index: 6; max-width: min(360px, calc(100vw - 32px)); background: #102448; color: white; border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); font-size: .9rem; }
@media (max-width: 1050px) {
  .shell { width: calc(100% - 48px); }
  .hero-copy { max-width: 52%; }
  .hero-image { width: 52%; }
  .hero .actions { gap: 7px; }
  .hero .button { padding: 8px 10px; min-height: 41px; font-size: .79rem; }
  .map-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .nav-bar { gap: 7px; padding-left: 13px; padding-right: 8px; }
  nav { gap: 2px; }
  nav a { padding-inline: 8px; }
}
@media (max-width: 780px) {
  html { scroll-padding-top: 116px; }
  .shell { width: calc(100% - 32px); }
  .nav-bar { flex-wrap: wrap; }
  .nav-bar nav { width: 100%; order: 2; justify-content: space-between; border-top: 1px solid #e3edf8; padding-top: 4px; }
  .nav-bar .header-action { min-height: 36px; }
  .hero { min-height: 255px; }
  .stats > div { column-gap: 7px; padding-inline: 5px; }
  .stats .stat-icon { width: 37px; height: 37px; border-radius: 10px; }
  .stats .stat-icon svg { width: 21px; height: 21px; }
  .stats dt { font-size: .76rem; }
  .form-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .parameter-controls { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 109px; }
  .shell { width: calc(100% - 24px); }
  .site-header { padding: 6px 0; }
  .nav-bar { border-radius: 13px; }
  .brand { font-size: 1.06rem; gap: 7px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .header-action { font-size: .75rem; padding-inline: 7px; gap: 4px; }
  .header-action svg, .hero .button svg { width: 16px; height: 16px; }
  nav a { font-size: .76rem; padding: 9px 4px; }
  .hero { margin-top: 6px; display: flex; flex-direction: column; align-items: stretch; border-radius: 17px; }
  .hero-copy { max-width: none; padding: 21px 15px 20px; }
  .hero h1 br { display: none; }
  .hero h1 { max-width: 370px; font-size: clamp(2rem, 8.2vw, 2.8rem); }
  .hero p { margin: 9px 0 13px; }
  .hero-image { position: static; order: 2; width: 100%; height: clamp(135px, 33vw, 190px); clip-path: none; object-position: center 49%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; margin-bottom: 21px; }
  .stats > div { justify-content: start; padding: 10px 13px; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .search { grid-column: 1 / -1; width: 100%; }
  .filters select { min-width: 0; }
  .filters .text-button { grid-column: 1 / -1; justify-self: start; }
  .map-grid, .form-grid, .chart-grid, .steps { grid-template-columns: 1fr; }
  .map-card { height: 328px; }
  .results { height: 342px; }
  .chip { min-height: 36px; padding-inline: 9px; font-size: .77rem; }
  .form-fields { gap: 9px; }
  .mobile-status { display: block; }
  .bar-row { grid-template-columns: 90px minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .nav-bar { gap: 4px; padding-left: 7px; padding-right: 6px; }
  .form-fields { grid-template-columns: 1fr; }
  .record { gap: 6px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
