/* Экран карты: панели, карточки, редактор, диалоги и состояния доступности. */
: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(300px, 340px) 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 { padding: 20px 25px; border-right: 1px solid #d9e2e2; }
.map-panel--layers h1 { font-size: 18px; }
.map-panel--layers .map-intro { margin: 14px 0; }
.map-panel--layers .map-section { padding: 14px 0; }
.map-panel--layers .map-status { margin: 8px 0; }
.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-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; align-content: start; gap: 8px; height: clamp(160px, calc(100dvh - 750px), 600px); overflow-y: auto; overscroll-behavior: contain; padding: 3px; }
.map-object-list:focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-section--objects > .map-action { margin-bottom: 10px; }
.map-section--objects > [data-map-target="catalogMore"] { margin: 10px 0 0; }
.map-object-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border: 1px solid #dbe5e4;
  border-radius: 7px;
  background: #f8fbfa;
}
.map-object-row:has(.map-object:hover), .map-object-row:has(.map-object[aria-pressed="true"]) { border-color: #317569; background: #eaf4f1; }
.map-object-visibility { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #317569; cursor: pointer; }
.map-object-visibility:hover { background: #dcebe7; }
.map-object-visibility:focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-object-visibility svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-object-row--hidden { border-style: dashed; }
.map-object-row--hidden .map-object-visibility { color: #657d7a; }
.map-object__visibility-note { font-size: 11px; color: #586d69; }
.map-object {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 11px 8px 11px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #20323e;
  text-align: left;
  cursor: pointer;
}
.map-object:focus-visible { outline: 3px solid #317569; outline-offset: -3px; }
.map-object__kind { color: #657d7a; font-size: 11px; }
.map-object strong { font-size: 13px; font-weight: 600; }

.map-group-list { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; padding: 3px; }
.map-group-row { min-width: 0; padding-bottom: 6px; border-bottom: 1px solid #e4eaea; }
.map-group-row label, .map-group-choices label { display: flex; align-items: flex-start; gap: 9px; min-height: 32px; padding: 6px 0; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.map-group-row input, .map-editor .map-group-choices input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: #317569; }
.map-group-row :focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.map-memberships { min-width: 0; margin: 8px 0; border: 1px solid #d9e2e2; border-radius: 6px; padding: 10px; }
.map-memberships legend { font-size: 13px; font-weight: 600; }
.map-group-choices { max-height: 200px; overflow-y: auto; }

.map-stage { display: flex; flex-direction: column; position: relative; min-width: 0; min-height: 0; background: #e8f0ef; }
.map-stage > .map-canvas { width: 100%; height: auto; min-height: 0; flex: 1 1 0; }
.maplibregl-ctrl-group { box-shadow: 0 2px 12px rgba(32, 50, 62, .14); }

.map-panel--card h2 { margin: 0 0 28px; font-size: 21px; }
.map-coordinates { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #e4eaea; }
.map-coordinates h2 { margin-bottom: 10px; font-size: 17px; }
.map-click-coordinates { margin: 0; color: #48635f; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; user-select: text; }

.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; overflow-wrap: anywhere; }
.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; overflow-wrap: anywhere; }
.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-appearance { display: grid; gap: 12px; margin: 12px 0; padding: 16px 12px; min-width: 0; border: 1px solid #d5e1df; border-radius: 6px; }
.map-appearance legend { font-weight: 700; }
.map-appearance__mode { display: flex; align-items: center; gap: 8px; }
.map-editor .map-appearance__mode input { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: #317569; }
.map-appearance__swatch { width: 26px; height: 26px; border-radius: 4px; border: 1px solid #b9c9c7; }
.map-appearance__color { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.map-editor .map-appearance input[type=color] { height: 40px; padding: 4px; }
.map-editor .map-appearance input[type=range] { min-height: 28px; padding: 0; accent-color: #317569; }
.map-appearance__range-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-appearance output { font-variant-numeric: tabular-nums; }
.map-appearance .map-hint, .map-appearance .map-status { margin: 0; }
.map-appearance .map-status:empty { display: none; }
.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-section--objects > .map-object-list { height: 40dvh; min-height: 180px; }
  .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-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; }
.formatted-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.formatted-text p { margin: 0 0 .5em; }
.formatted-text ul, .formatted-text ol { margin: .5em 0; padding-inline-start: 1.5em; }
.formatted-text li { margin: .2em 0; }
.formatted-text > :last-child { margin-bottom: 0; }
.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; }

.additional-fields { margin-top: 20px; padding-top: 12px; border-top: 1px solid #d9e2e2; }
.additional-field { min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid #d9e2e2; border-radius: 6px; }
.additional-field > label, .additional-option > label { display: block; margin: 8px 0 6px; }
.additional-field input, .additional-field select, .additional-field textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.additional-field .map-editor__actions { flex-wrap: wrap; }
.additional-option { margin: 10px 0; }
.additional-values { margin-top: 16px; }

.additional-fields button:disabled { opacity: .55; cursor: default; }

/* One SDK layout and hit area for the local icon and its literal caption. */
.map-marker { position: relative; left: -13px; top: -13px; display: flex; align-items: flex-start; gap: 6px; width: max-content; max-width: 212px; cursor: pointer; }
.map-marker__symbol { display: block; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; }
.map-marker__symbol img { display: block; width: 26px; height: 26px; }
.map-marker__symbol { mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.map-marker__label:empty { display: none; }
.map-marker--caption { left: 0; top: 0; transform: translate(-50%, -50%); }
.map-marker--caption .map-marker__symbol { display: none; }
.type-badge__icon { display: inline-block; width: 26px; height: 26px; flex: 0 0 26px; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.map-object__icon { display: inline-block; width: 22px; height: 22px; vertical-align: middle; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.map-marker__label { display: block; max-width: 180px; padding: 3px 6px; box-sizing: border-box; border: 1px solid #b7c8c3; border-radius: 4px; background: #fff; color: #173b33; font: 600 12px/16px system-ui, sans-serif; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 1px 3px #0003; }

/* The road scheme orders manual kilometer values; spacing is schematic. */
.road-panel { border-top: 1px solid #d5dfdc; margin-top: 20px; padding-top: 4px; }
.road-scheme { list-style: none; padding: 0 0 0 14px; margin: 16px 0 20px 8px; border-left: 3px solid #317569; }
.road-scheme__node { position: relative; padding: 10px 0 12px 8px; }
.road-scheme__node::before { content: ""; position: absolute; left: -23px; top: 21px; width: 12px; height: 12px; border-radius: 50%; background: #317569; border: 2px solid #fff; }
.road-scheme__select { display: block; padding: 6px 8px; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 5px; color: #173b33; background: transparent; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.road-scheme__select[aria-pressed="true"] { background: #e6efe9; border-color: #317569; font-weight: 700; }
.road-scheme__select:focus-visible, .road-scheme__edit:focus-visible { outline: 3px solid #a77a32; outline-offset: 2px; }
.road-scheme__edit { margin: 4px 8px 0; padding: 2px 0; background: transparent; border: 0; color: #3c665d; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.road-panel__actions { flex-direction: column; align-items: flex-start; gap: 12px; }
.road-panel button:disabled { opacity: .55; cursor: default; }
.road-marker-form { display: grid; gap: 16px; margin: 16px 0 20px; padding: 16px; background: #f3f6f4; border: 1px solid #d5dfdc; border-radius: 6px; }
.road-marker-form h4, .road-marker-form .map-hint, .road-marker-form .map-status { margin: 0; }
.road-marker-form .map-status:empty { display: none; }
.road-marker-form .map-editor__actions { margin-top: 4px; }
.road-marker-form > .map-action { justify-self: start; }
.road-marker-form label { display: block; margin: 0; font-size: 13px; }
.road-generation-preview { max-height: 220px; overflow-y: auto; margin: 0; }
.road-marker-form input, .road-marker-form select { display: block; box-sizing: border-box; width: 100%; padding: 9px; border: 1px solid #aabdb7; border-radius: 4px; font: inherit; margin-top: 5px; }

/* Keep the 26px anchor/hit box; only the visible road dot becomes 12px. */
.map-marker--road .map-marker__symbol { flex: 0 0 12px; width: 12px; height: 12px; margin: 7px; border: 2px solid #fff; box-sizing: border-box; }
.map-marker--road .map-marker__label:empty { display: none; }

/* Temporary overlays have their own collection/pane. Captions are literal text nodes. */
.temporary-marker { display: flex; align-items: flex-start; position: relative; left: -13px; top: -13px; min-width: 26px; min-height: 26px; width: max-content; max-width: 210px; cursor: pointer; font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.temporary-marker__dot { flex: 0 0 12px; width: 12px; height: 12px; margin: 7px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 2px #20323e; }
.temporary-marker__title { margin-top: 3px; max-width: 180px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; color: #20323e; background: #ffffffed; border-radius: 3px; padding: 2px 4px; }
.temporary-marker__title:empty { display: none; }
.temporary-marker--selected .temporary-marker__dot { outline: 2px solid #20323e; outline-offset: 1px; }
.temporary-marker:focus-visible { outline: 3px solid #317569; outline-offset: 2px; border-radius: 4px; }
.temporary-section { display: block; }
.temporary-section > * + * { margin-top: 9px; }
.temporary-section h2 { margin: 0; }
.temporary-section .map-status { margin: 9px 0 0; }
.temporary-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.4; }
.temporary-toggle input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: #317569; }
.temporary-list { display: grid; gap: 8px; min-height: 0; max-height: 180px; overflow-y: auto; }
.temporary-list-item { min-height: 34px; border: 1px solid #dbe5e4; border-radius: 6px; overflow-wrap: anywhere; }
.temporary-card { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #dbe5e4; }
.temporary-card h3 { overflow-wrap: anywhere; }
.temporary-form { display: grid; gap: 16px; }
.temporary-form label { font-size: 13px; font-weight: 600; }
.temporary-form input, .temporary-form textarea { width: 100%; min-height: 40px; padding: 8px; border: 1px solid #b9c9c7; border-radius: 6px; font: inherit; }
.temporary-form input[type="color"] { width: 70px; padding: 4px; }
.temporary-form .map-status, .temporary-form .map-hint { margin: 0; }
.temporary-form .map-editor__actions { display: grid; gap: 12px; }
.temporary-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.temporary-countdown { color: #6c3a24; font-size: 14px; font-variant-numeric: tabular-nums; }
.temporary-section :focus-visible, .temporary-card :focus-visible { outline: 3px solid #317569; outline-offset: 2px; }

.temporary-card .map-editor__actions { display: flex; flex-direction: column; gap: 12px; }
.map-panel--card:has(.temporary-card:not([hidden])) > .map-eyebrow, .map-panel--card:has(.temporary-card:not([hidden])) > h2 { display: none; }

/* History keeps long coordinate snapshots inside the card. */
.history-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
.history-restore { margin-top: 16px; padding: 12px; border: 2px solid #317569; border-radius: 8px; }
.history-restore > button { display: block; margin-top: 12px; }
.history-restore pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 180px; overflow: auto; }

/* Catalog panels share the remaining desktop height; operational notices stay bounded. */
.catalog-tabs { display: flex; gap: 6px; margin: 12px 0; }
.catalog-tabs [role=tab] { flex: 1; min-height: 38px; border: 1px solid #b9c9c7; border-radius: 6px; background: #fff; color: #215e58; cursor: pointer; }
.catalog-tabs [aria-selected=true] { background: #e7f2ee; border-color: #317569; font-weight: 700; }
.catalog-tabs :focus-visible, .catalog-select :focus-visible, .catalog-search:focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.catalog-search, .map-catalog input[type=search] { width: 100%; min-height: 36px; padding: 7px; border: 1px solid #b9c9c7; border-radius: 6px; background: #fff; color: #20323e; }
.map-catalog > input[type=search] { margin-bottom: 12px; }
.map-catalog label { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.catalog-select { position: relative; margin-bottom: 8px; }
.catalog-select button { width: 100%; min-height: 36px; text-align: left; color: #20323e; background: white; border: 1px solid #b9c9c7; border-radius: 6px; padding: 7px; overflow-wrap: anywhere; cursor: pointer; }
.catalog-select__popup { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; padding: 8px; background: #fff; border: 1px solid #b9c9c7; border-radius: 6px; box-shadow: 0 4px 12px #20323e26; }
.catalog-select [role=listbox] { display: grid; gap: 4px; max-height: 190px; overflow-y: auto; margin-top: 6px; }
.catalog-select [aria-selected=true] { background: #e7f2ee; }
.map-catalog [data-map-target="catalogReset"] { display: block; }
.map-catalog [hidden] { display: none; }
@media (min-width: 761px) {
  .map-panel--layers { display: flex; flex-direction: column; overflow-y: auto; padding: 16px; }
  .map-panel--layers > * { flex-shrink: 0; }
  .map-panel--layers > .map-status { max-height: 64px; overflow-y: auto; }
  .map-panel--layers .temporary-section { max-height: none; overflow: visible; padding: 12px 0; }
  .map-panel--layers .temporary-section h2 { font-size: 14px; }
  .map-panel--layers .temporary-section .map-action { min-height: 30px; padding: 5px; }
  .map-catalog { display: flex; flex: 1 0 0; flex-direction: column; }
  .map-catalog > * { flex-shrink: 0; }
  .map-panel--layers .map-catalog { padding: 12px 0 0; }
  .map-catalog h2 { font-size: 14px; margin-bottom: 10px; }
  .map-catalog .map-status { max-height: 42px; overflow-y: auto; margin: 4px 0; font-size: 12px; }
  .map-section--objects .map-object-list { flex: 1 0 160px; height: auto; min-height: 160px; }
  .map-panel--layers .map-panel__footnote { margin: 8px 0 0; font-size: 10px; }
}

/* Separate complete object events; field lists and Roads history keep their own rhythm. */
[data-object-history] > ol { padding-left: 24px; }
[data-object-history] > ol > li { padding-left: 4px; overflow-wrap: anywhere; }
[data-object-history] > ol > li + li { margin-top: 28px; padding-top: 24px; border-top: 1px solid #b9c9c7; }
[data-object-history] > ol > li > strong:first-child { display: block; padding: 10px; margin-bottom: 14px; border-radius: 5px; background: #eaf2ef; color: #254c44; font-size: 14px; line-height: 1.6; }

.catalog-select__popup--above { top: auto; bottom: 100%; }

/* Shared selection above the SDK canvas, with a bounded complete picker. */
.group-bar { position: relative; z-index: 5; flex: 0 0 auto; min-width: 0; padding: 12px 14px; background: #fff; border-bottom: 1px solid #d8e2df; }
.group-bar__header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.group-bar__count { color: #2f7568; font-size: 12px; white-space: nowrap; }
.group-bar__search { flex: 1 1 90px; margin-left: auto; max-width: 190px; min-width: 90px; }
.group-bar__header > button { flex-shrink: 0; }
/* Leave room below chips for overlay scrollbars and their keyboard focus outline. */
.group-bar__chips { display: flex; gap: 7px; overflow-x: auto; padding: 9px 0 12px; scrollbar-width: thin; scrollbar-color: #779d94 #edf3f0; }
.group-bar__chips::-webkit-scrollbar { height: 6px; }
.group-bar__chips::-webkit-scrollbar-track { background: #edf3f0; border-radius: 3px; }
.group-bar__chips::-webkit-scrollbar-thumb { background: #779d94; border-radius: 3px; }
.group-bar__chip { display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 7px 10px; border: 1px solid #c6d5ca; border-radius: 6px; font-size: 13px; cursor: pointer; }
.group-bar__chip:has(input:checked) { background: #e7f2ed; border-color: #2f7568; color: #235a4d; }
.group-bar__chip input { accent-color: #2f7568; }
.group-bar :focus-visible { outline: 3px solid #317569; outline-offset: 2px; }
.group-bar__popup { position: absolute; right: 14px; top: 100%; width: min(360px, calc(100% - 28px)); padding: 14px; background: #fff; border: 1px solid #b9c9c7; border-radius: 8px; box-shadow: 0 8px 22px #173f3526; max-height: 50dvh; overflow-y: auto; }
.group-bar [hidden] { display: none; }
.group-bar .map-status { margin: 6px 0; }
.group-bar__options .catalog-search { margin-top: 6px; margin-bottom: 12px; }
.group-bar__popup > button { margin-top: 10px; }

/* Editor-only handles: visible circle and hit area share the same 32px box. */
.map-draft-handle {
  position: absolute;
  left: -16px;
  top: -16px;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 3px solid #a54132;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0005;
  cursor: grab;
}
.map-draft-handle:active { cursor: grabbing; }
.map-draft-handle--point { background: transparent; border: 2px dashed #317569; box-shadow: none; }

/* One owned confirmation in the browser modal layer, above the SDK canvas. */
.app-confirmation { width: min(460px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #b9c9c7; border-radius: 10px; background: #fff; color: #20323e; box-shadow: 0 16px 48px #173f3540; }
.app-confirmation::backdrop { background: #17313b80; }
.app-confirmation h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.35; }
.app-confirmation p { margin: 0 0 20px; line-height: 1.6; overflow-wrap: anywhere; }
.app-confirmation .map-editor__actions { justify-content: flex-end; }
.app-confirmation :focus-visible { outline: 3px solid #317569; outline-offset: 3px; }

.background-layer { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding-right: 10px; border-right: 1px solid #d8e2df; max-width: 100%; }
.background-layer__toggle { display: flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.background-layer__toggle input { accent-color: #2f7568; }
.background-layer__status { font-size: 11px; color: #52716c; max-width: 260px; overflow-wrap: anywhere; }
.background-layer > button { font-size: 12px; color: #235a4d; background: #fff; border: 1px solid #b9c9c7; border-radius: 4px; padding: 3px 5px; }
