:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20323e;
  background: #f5f7f5;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button, input, select { font: inherit; }

.map-shell {
  display: grid;
  grid-template-columns: minmax(250px, 278px) minmax(0, 1fr) minmax(280px, 318px);
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
}

.map-panel {
  z-index: 1;
  overflow-y: auto;
  padding: 30px 25px;
  background: #fff;
}

.map-panel--layers { border-right: 1px solid #d9e2e2; }
.map-panel--card { border-left: 1px solid #d9e2e2; }
.map-brand { display: flex; align-items: flex-start; gap: 12px; }
.map-brand__mark { color: #317569; font-size: 32px; line-height: 1; }
.map-account-nav, .account-nav { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.map-account-nav a, .account-nav a { color: #215e58; font-size: 13px; }
.map-account-nav button, .account-nav button { border: 0; padding: 0; background: transparent; color: #215e58; text-decoration: underline; cursor: pointer; font-size: 13px; }
.map-eyebrow { margin: 0 0 5px; color: #5d7775; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; line-height: 1.2; }
h2 { margin-bottom: 14px; font-size: 17px; line-height: 1.25; }
.map-intro { margin: 24px 0 26px; color: #61747a; font-size: 13px; line-height: 1.55; }
.map-section { border-top: 1px solid #e4eaea; padding: 23px 0 17px; }
.map-hint, .map-panel__footnote { color: #6b7e82; font-size: 12px; line-height: 1.5; }
.map-panel__footnote { margin-top: 25px; }
.map-panel__footnote a { color: #215e58; }

.map-layer-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
}
.map-layer-switch > span { display: inline-flex; align-items: center; gap: 10px; }
.map-layer-switch input { width: 18px; height: 18px; accent-color: #317569; cursor: pointer; }
.map-layer-switch:has(input:disabled) { opacity: .55; cursor: default; }
.map-layer-switch input:disabled { cursor: default; }
.map-legend-dot { width: 12px; height: 12px; border-radius: 50%; background: #c76d48; box-shadow: 0 0 0 2px #f5e5df; }
.map-legend-area { width: 13px; height: 13px; border: 2px solid #315b83; background: #c8d8e6; }
.map-status { margin: 12px 0; color: #58716d; font-size: 13px; }
.map-status--error { color: #a54132; }
.map-section label[for="map-kind-filter"] { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
#map-kind-filter { width: 100%; min-height: 40px; padding: 7px; border: 1px solid #b9c9c7; border-radius: 6px; background: #fff; color: #20323e; }
#map-kind-filter:focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-object-list { display: grid; gap: 8px; }
.map-object {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dbe5e4;
  border-radius: 7px;
  background: #f8fbfa;
  color: #20323e;
  text-align: left;
  cursor: pointer;
}
.map-object:hover, .map-object[aria-pressed="true"] { border-color: #317569; background: #eaf4f1; }
.map-object:focus-visible, .map-layer-switch input:focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-object__kind { color: #657d7a; font-size: 11px; }
.map-object strong { font-size: 13px; font-weight: 600; }

.map-stage { position: relative; min-width: 0; min-height: 0; background: #e8f0ef; }
.map-stage__caption {
  position: absolute;
  z-index: 1;
  top: 20px;
  left: 20px;
  padding: 8px 12px;
  border: 1px solid #dbe4e2;
  border-radius: 5px;
  background: rgba(255, 255, 255, .94);
  color: #48635f;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  pointer-events: none;
}
.map-stage__caption span { color: #9aabaa; }
.map-canvas { width: 100%; height: 100%; }
.maplibregl-ctrl-group { box-shadow: 0 2px 12px rgba(32, 50, 62, .14); }

.map-panel--card h2 { margin: 0 0 28px; font-size: 21px; }

.account-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.account-card { min-width: 0; width: min(100%, 420px); padding: 32px; border: 1px solid #d9e2e2; border-radius: 10px; background: #fff; box-shadow: 0 12px 34px rgba(32, 50, 62, .08); }
.account-card--wide { width: min(100%, 780px); }
.account-card h1 { margin: 0 0 16px; }
.account-card h2 { margin-top: 32px; }
.account-card p { color: #61747a; font-size: 14px; line-height: 1.5; }
.account-form { display: grid; gap: 9px; margin-top: 22px; }
.account-form label { font-size: 13px; font-weight: 600; }
.account-form input, .account-form select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #b9c9c7; border-radius: 6px; background: #fff; color: #20323e; }
.account-form input[type="submit"] { margin-top: 12px; border-color: #317569; background: #317569; color: #fff; font-weight: 600; cursor: pointer; }
.account-form :focus-visible, .account-nav :focus-visible, .map-account-nav :focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.account-card .account-error { color: #9d3328; }
.account-table-wrap { max-width: 100%; overflow-x: auto; }
.account-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 13px; }
.account-table th, .account-table td { padding: 10px 6px; border-bottom: 1px solid #d9e2e2; text-align: left; }
.account-table button { border: 0; background: transparent; color: #9d3328; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) {
  .account-table { min-width: 0; }
  .account-table thead { display: none; }
  .account-table tr { display: block; padding: 8px 0; border-bottom: 1px solid #d9e2e2; }
  .account-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 0; overflow-wrap: anywhere; }
  .account-table td::before { content: attr(data-label); flex: 0 0 88px; font-weight: 600; }
}
.map-card__empty { padding: 20px; border: 1px dashed #c8d6d4; border-radius: 8px; color: #6b7e82; font-size: 14px; line-height: 1.5; }
.map-card h3 { padding-bottom: 16px; border-bottom: 1px solid #e4eaea; font-size: 18px; line-height: 1.35; }
.map-card dl { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 0; }
.map-card dt { margin-top: 13px; color: #6c7e83; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.map-card dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.map-action { border: 1px solid #317569; border-radius: 6px; background: #317569; color: #fff; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.map-action--secondary { background: #fff; color: #215e58; }
.map-action--danger { border-color: #9d3328; background: #fff; color: #9d3328; }
.map-action:focus-visible, .map-editor :focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-editor { margin-top: 16px; }
.map-editor[hidden], .map-card[hidden], .map-editor [hidden] { display: none; }
.map-editor form { display: grid; gap: 8px; }
.map-editor label { font-size: 13px; font-weight: 600; }
.map-editor input, .map-editor select, .map-editor textarea { width: 100%; min-height: 40px; border: 1px solid #b9c9c7; border-radius: 6px; padding: 8px; background: #fff; color: #20323e; }
.map-editor textarea { resize: vertical; }
.map-editor__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.map-history { margin-top: 20px; border-top: 1px solid #e4eaea; padding-top: 12px; font-size: 13px; line-height: 1.5; }
.map-history h4 { margin: 0 0 8px; font-size: 14px; }
.map-history ol { margin: 0; padding-left: 20px; }
.map-history li + li { margin-top: 10px; }
.map-history li { overflow-wrap: anywhere; }
.map-history dl { margin: 4px 0 0; }
.map-history dt { margin-top: 4px; }

@media (max-width: 900px) {
  .map-shell { grid-template-columns: minmax(230px, 255px) minmax(0, 1fr); }
  .map-panel--card { grid-column: 1 / -1; border-top: 1px solid #d9e2e2; border-left: 0; }
  .map-panel--card h2 { margin-bottom: 15px; }
}

@media (max-width: 600px) {
  .map-shell { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
  .map-panel { overflow: visible; padding: 20px; }
  .map-panel--layers { border-right: 0; }
  .map-intro { margin: 12px 0 16px; }
  .map-section { padding: 15px 0 8px; }
  .map-panel__footnote { margin-top: 12px; }
  .map-stage { flex: none; height: 43dvh; min-height: 320px; }
  .map-stage__caption { top: 10px; left: 10px; max-width: calc(100% - 20px); }
  .map-panel--card { flex: 1; min-height: 230px; }
}
.dynamic-field { display: grid; gap: 6px; margin: 10px 0; min-width: 0; }
.dynamic-field p { margin: 0; }
.field-error { color: #9d3328; font-size: 13px; }
[aria-invalid=true] { border-color: #9d3328 !important; }
.type-badge { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.type-badge img, .map-object__kind img { width: 22px; height: 22px; vertical-align: middle; }
.retired-values { margin-top: 20px; padding-top: 12px; border-top: 1px dashed #a7b5b4; }
.map-card dd { white-space: pre-wrap; }
.map-account-nav { flex-wrap: wrap; }
.map-status, .map-hint { overflow-wrap: anywhere; }

.map-attribution {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 55px);
  padding-right: 6px;
  background: #fff;
  font-size: 10px;
}
.map-attribution img { display: block; width: 64px; height: auto; }
.map-attribution a { color: #1b473e; }
