:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #142033;
  --muted: #526176;
  --line: #c8d3df;
  --panel: #ffffff;
  --surface: #f3f6fa;
  --accent: #cc2f2f;
  --hm-text: #142033;
  --hm-text-muted: #526176;
  --hm-surface: #f6f8fb;
  --hm-surface-raised: #ffffff;
  --hm-surface-soft: #eef3f8;
  --hm-line: #c8d3df;
  --hm-primary: #0b63ce;
  --hm-primary-strong: #084fa6;
  --hm-danger: #cc2f2f;
  --hm-success: #18854b;
  --hm-warning: #b45309;
  --hm-space-1: 4px;
  --hm-space-2: 8px;
  --hm-space-3: 12px;
  --hm-space-4: 16px;
  --hm-space-5: 20px;
  --hm-space-6: 24px;
  --hm-radius-control: 7px;
  --hm-radius-panel: 8px;
  --hm-radius-sheet: 18px;
  --hm-radius-round: 999px;
  --hm-shadow-float: 0 10px 30px rgba(20, 32, 51, 0.18);
  --hm-shadow-panel: 0 18px 42px rgba(20, 32, 51, 0.20);
  --hm-z-map-ui: 650;
  --hm-z-panel: 900;
  --hm-z-topbar: 1400;
  --hm-z-toast: 1500;
  --hm-sidebar-width: 420px;
  --hm-topbar-height: 50px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}

html,
body {
  min-height: 100%;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: var(--hm-z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  border: 1px solid #e2e6ea;
  background: #f8f8f8;
}

.brand {
  color: #486077;
  font-size: 1.15rem;
  font-weight: 650;
  text-decoration: none;
}

.map-search {
  position: absolute;
  left: 50%;
  top: calc(100% + 36px);
  z-index: 700;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 150px));
  height: 42px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #cfd6de;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(20, 32, 51, 0.18);
}

.search-locate-icon {
  width: 24px;
  height: 24px;
  display: block;
  background-image: url("/img/locate.png");
  background-repeat: no-repeat;
  background-size: 72px 24px;
  background-position: -24px 0;
}

.search-locate-button {
  position: relative;
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.search-locate-button::after {
  content: "";
  position: absolute;
  right: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: #c8d3df;
  pointer-events: none;
}

.map-search input {
  min-width: 0;
  height: 40px;
  padding-left: 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.map-search input:focus,
.map-search input:focus-visible,
.search-locate-button:focus,
.search-locate-button:focus-visible {
  outline: 0;
}

.map-search button {
  height: 34px;
  margin-right: 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f9fb;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.topbar-actions {
  position: absolute;
  top: calc(100% + 6px);
  right: max(16px, env(safe-area-inset-right));
  z-index: calc(var(--hm-z-topbar) + 1);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  width: min(260px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(20, 32, 51, 0.22);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.topbar-actions.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-actions .button {
  width: 100%;
  justify-self: stretch;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.button,
.icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #f7f9fb;
}

.button.save-action {
  border-color: #9acaa5;
  background: #edf8ef;
  color: #14532d;
}

.button.save-action:hover,
.button.save-action:focus-visible {
  background: #dff3e4;
}

.button.cancel-action {
  border-color: #e0a6a6;
  background: #fff1f1;
  color: #7f1d1d;
}

.button.cancel-action:hover,
.button.cancel-action:focus-visible {
  background: #ffe4e4;
}

.topbar-menu-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.topbar-menu-button span,
.topbar-menu-button span::before,
.topbar-menu-button span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #263548;
}

.topbar-menu-button span {
  position: relative;
  margin: 0 auto;
}

.topbar-menu-button span::before,
.topbar-menu-button span::after {
  content: "";
  position: absolute;
  left: 0;
}

.topbar-menu-button span::before {
  top: -6px;
}

.topbar-menu-button span::after {
  top: 6px;
}

.topbar-menu-button.active {
  border-color: #9fb3c8;
  background: #eef4fb;
}

.language-picker {
  position: relative;
}

.language-button {
  min-height: 36px;
  width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.language-button img {
  width: 27px;
  height: 18px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(20, 32, 51, 0.12);
}

.language-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #4d5967;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 900;
  min-width: 158px;
  padding: 5px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 51, 0.20);
}

.language-option {
  width: 100%;
  min-height: 25px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.language-option:hover,
.language-option.active {
  background: #edf3f8;
}

.language-option img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(20, 32, 51, 0.10);
}

.hidden {
  display: none !important;
}

.workspace {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

html.css-fullscreen,
body.css-fullscreen {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.css-fullscreen .app-shell {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
}

body.css-fullscreen .topbar {
  display: none;
}

body.css-fullscreen .workspace {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.css-fullscreen .left-toolbar {
  left: calc(10px + env(safe-area-inset-left));
  /* iOS-Fallback: unterhalb der Leaflet-Zoomsteuerung starten. */
  top: calc(86px + env(safe-area-inset-top));
}

body.css-fullscreen .right-actions {
  right: calc(8px + env(safe-area-inset-right));
  top: calc(10px + env(safe-area-inset-top));
}

body.css-fullscreen .info-sidebar {
  top: calc(8px + env(safe-area-inset-top));
  bottom: calc(8px + env(safe-area-inset-bottom));
}

body.css-fullscreen .detail-panel {
  bottom: env(safe-area-inset-bottom);
}

body.css-fullscreen .leaflet-control-container .leaflet-bottom {
  bottom: env(safe-area-inset-bottom);
}

.map {
  position: absolute;
  inset: 0;
}

.left-toolbar,
.right-actions {
  position: absolute;
  z-index: 650;
  display: grid;
  gap: 10px;
  align-items: start;
  justify-items: center;
}

.left-toolbar {
  left: 10px;
  top: 113px;
}

.right-actions {
  right: 8px;
  top: 58px;
  gap: 6px;
}

.tool-button,
.right-tool,
.right-actions div {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd6de;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.18);
}

.tool-button {
  position: relative;
  padding: 0;
  cursor: pointer;
  overflow: visible;
}

.right-tool {
  position: relative;
  padding: 0;
  cursor: pointer;
}

.right-tool:disabled {
  cursor: wait;
  opacity: 0.65;
}

.tool-group {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.tool-group-add {
  margin-top: 2px;
  margin-bottom: 2px;
}

.tool-button:disabled {
  cursor: not-allowed;
}

.tool-button:disabled > :not(.plus-badge) {
  opacity: 0.55;
}

.tool-button:disabled .plus-badge {
  opacity: 0.65 !important;
}

.tool-button:disabled:hover::after,
.tool-button:disabled:focus-visible::after {
  content: attr(data-disabled-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  z-index: 930;
  transform: translateY(-50%);
  min-width: 118px;
  padding: 5px 7px;
  border: 1px solid #b9c5d1;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: left;
  box-shadow: 0 4px 14px rgba(20, 32, 51, 0.18);
  opacity: 1;
  pointer-events: none;
}

.tool-button.active {
  background: #d9f4d3;
  border-color: #71bf63;
}

.tool-button.locate-active {
  background: #ffe0b7;
  border-color: #f08a1a;
}

.tool-button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 1;
}

.tool-add > img:first-child {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  grid-area: 1 / 1;
  opacity: 1;
}

.locate-icon {
  width: 24px;
  height: 24px;
  display: block;
  background-image: url("/img/locate.png");
  background-repeat: no-repeat;
  background-size: 72px 24px;
}

.tool-button.locate-off .locate-icon {
  background-position: 0 0;
}

.tool-button.locate-active .locate-icon {
  background-position: -48px 0;
}

.tool-button.locate-unused .locate-icon {
  background-position: -24px 0;
}

.plus-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 17px !important;
  height: 17px !important;
  padding: 0 !important;
  border-radius: 50%;
  background: transparent;
  opacity: 1 !important;
  box-shadow: 0 1px 3px rgba(20, 32, 51, 0.24);
}

.measure-subicon {
  position: absolute;
  right: 3px;
  bottom: 2px;
  color: #142033;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.text-tool {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.right-actions div {
  grid-template-columns: 18px 1fr;
  width: 52px;
  padding: 3px 5px;
  font-size: 0.78rem;
  font-weight: 700;
}

.right-actions img {
  width: 18px;
  height: 18px;
}

.right-tool .right-tool-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.layer-panel {
  position: absolute;
  top: 58px;
  right: 50px;
  z-index: 720;
  width: min(300px, calc(100vw - 78px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(20, 32, 51, 0.22);
}

.layer-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.layer-panel fieldset {
  margin: 0 0 10px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.layer-panel legend {
  padding-right: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.layer-panel label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
}

.layer-panel em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.base-layer-groups {
  display: grid;
  gap: 8px;
}

.base-layer-group {
  display: grid;
  gap: 2px;
}

.base-layer-group-title {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.layer-panel .base-layer-option {
  align-items: flex-start;
  min-height: 28px;
  flex-wrap: wrap;
  row-gap: 2px;
}

.layer-panel .base-layer-option input {
  margin-top: 3px;
}

.layer-panel .base-layer-option.disabled {
  color: var(--muted);
}

.layer-panel .base-layer-option em {
  flex-basis: 100%;
  padding-left: 24px;
}

.layer-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.inline-radius-button {
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #075db3;
  font: inherit;
  cursor: pointer;
}

.coverage-circle {
  mix-blend-mode: multiply;
}

.detail-panel {
  position: absolute;
  top: 84px;
  right: 12px;
  z-index: 900;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100% - 24px);
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(20, 32, 51, 0.18);
}

.panel-title-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel-close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(15, 31, 53, 0.14);
}

.hydrant-summary-main {
  min-width: 0;
  padding-right: 34px;
}

.info-sidebar {
  position: absolute;
  left: 48px;
  top: 12px;
  bottom: 12px;
  z-index: 900;
  width: min(430px, calc(100vw - 76px));
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(20, 32, 51, 0.20);
}

.info-sidebar.open {
  display: grid;
}

.info-sidebar h1 {
  margin: 0;
  padding: 24px 48px 8px 24px;
  font-size: 1.75rem;
}

.sidebar-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #b8bec6;
  font-size: 1.7rem;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-scroll {
  min-height: 0;
  overflow: auto;
  padding: 0 24px 24px;
}

.sidebar-scroll p {
  line-height: 1.55;
}

.sidebar-warning {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border: 1px solid #d22f2f;
  border-left-width: 5px;
  border-radius: 6px;
  background: #fff1f1;
  color: #8f1515;
  line-height: 1.45;
}

.sidebar-warning strong {
  display: block;
  margin-bottom: 4px;
}

.sidebar-warning p {
  margin: 0;
}

.sidebar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.info-box {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
}

.info-box:first-of-type {
  border-radius: 6px 6px 0 0;
}

.info-box:last-of-type {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
}

.info-box p {
  margin: 6px 0 0;
}

.content-overlay {
  position: absolute;
  inset: 0;
  z-index: 1100;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 18px 48px rgba(20, 32, 51, 0.24);
}

.content-overlay[hidden] {
  display: none;
}

.overlay-close {
  position: absolute;
  top: 6px;
  right: 16px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #b8bec6;
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
}

.content-overlay-scroll {
  height: 100%;
  overflow: auto;
  padding: 24px clamp(16px, 3vw, 32px) 32px;
}

.overlay-main-nav {
  position: sticky;
  top: -24px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -24px calc(clamp(16px, 3vw, 32px) * -1) 24px;
  padding: 8px clamp(16px, 3vw, 32px);
  padding-right: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(6px);
}

.overlay-main-nav button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #075db3;
  font: inherit;
  cursor: pointer;
}

.overlay-main-nav button:hover {
  background: #eef4fb;
}

.overlay-main-nav button.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.content-overlay h1 {
  margin: 0 48px 10px 0;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 550;
}

.overlay-intro {
  max-width: 95ch;
  margin: 0 0 14px;
  line-height: 1.55;
}

.overlay-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.overlay-tab {
  min-height: 42px;
  margin-bottom: -1px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: #075db3;
  font: inherit;
  cursor: pointer;
}

.overlay-tab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.overlay-body {
  max-width: 1120px;
}

.overlay-body h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 540;
}

.overlay-body > p {
  margin: 0 0 14px;
  line-height: 1.55;
}

.overlay-card-list {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.overlay-card {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.overlay-card:last-child {
  border-bottom: 0;
}

.overlay-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.overlay-card p {
  margin: 6px 0 0;
}

.overlay-card ul {
  margin: 8px 0 0;
  padding-left: 24px;
}

.overlay-code {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fff1f5;
  color: #c7255a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
}

.overlay-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 4px solid #cc2f2f;
  background: #fff5f5;
  line-height: 1.5;
}

.stats-panel {
  margin-top: 16px;
}

.stats-range-toggle {
  display: inline-flex;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.stats-range-toggle button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #075db3;
  font: inherit;
  cursor: pointer;
}

.stats-range-toggle button:last-child {
  border-right: 0;
}

.stats-range-toggle button.active {
  background: #eaf2fa;
  color: var(--ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stats-card {
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.stats-card strong {
  display: block;
  color: #0f3b66;
  font-size: 1.8rem;
  line-height: 1.1;
}

.stats-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.25;
}

.usage-chart-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.usage-chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.usage-chart-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.usage-chart-heading span,
.stats-muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.stats-error {
  padding: 12px 14px;
  border: 1px solid #e8b4b4;
  border-radius: 5px;
  background: #fff5f5;
}

.usage-line-chart {
  width: 100%;
  overflow-x: auto;
}

.usage-line-chart svg {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
}

.usage-axis {
  stroke: #c8d3df;
  stroke-width: 1;
}

.usage-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.usage-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.usage-point {
  stroke: #fff;
  stroke-width: 1.5;
}

.usage-series-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.usage-series-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-series-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
}

.measure-active .map,
.measure-active .leaflet-container,
.measure-active .leaflet-pane,
.measure-active .leaflet-interactive {
  cursor: crosshair;
}

.add-active .map,
.add-active .leaflet-container,
.add-active .leaflet-pane,
.add-active .leaflet-interactive {
  cursor: crosshair;
}

.position-edit-active .map,
.position-edit-active .leaflet-container,
.position-edit-active .leaflet-pane,
.position-edit-active .leaflet-interactive {
  cursor: grab;
}

.position-edit-dragging .map,
.position-edit-dragging .leaflet-container,
.position-edit-dragging .leaflet-pane,
.position-edit-dragging .leaflet-interactive {
  cursor: grabbing;
}

.placement-marker {
  position: relative;
  width: 58px;
  height: 64px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.placement-marker-dragging {
  cursor: grabbing;
}

.placement-marker-pin {
  position: absolute;
  left: 17px;
  top: 6px;
  width: 25px;
  height: 41px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.placement-marker-plus {
  position: absolute;
  left: 32px;
  top: 1px;
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(20, 32, 51, 0.26);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.placement-marker-shadow {
  display: none;
}

.placement-marker::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 42px;
  height: 52px;
  border-radius: 999px;
  pointer-events: none;
}

.placement-marker-dragging .placement-marker-pin {
  transform: scale(1.12) translateY(-2px);
  transform-origin: 50% 100%;
}

.placement-marker-move .placement-marker-pin {
  filter: drop-shadow(0 3px 6px rgba(20, 32, 51, 0.28));
}

.placement-marker-move-handle {
  display: none;
}

.placement-marker-move-handle img {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hm-mobile .placement-marker-move-handle,
.hm-coarse .placement-marker-move-handle {
  position: absolute;
  left: 40px;
  top: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(130, 146, 166, 0.55);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.24);
  pointer-events: auto;
  z-index: 2;
}

.login-required-panel {
  display: grid;
  gap: 10px;
  align-items: start;
}

.login-required-panel .button {
  width: max-content;
}

.measure-point {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.measure-point-unlocked,
.measure-point:active {
  cursor: grabbing;
}

.measure-point span {
  width: 14px;
  height: 14px;
  display: block;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #3d8ed8;
  box-shadow: 0 1px 5px rgba(20, 32, 51, 0.42);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.measure-point-start span {
  background: #1d7fd1;
}

.measure-point-locked span {
  outline: 2px solid rgba(20, 32, 51, 0.25);
}

.measure-point-unlocked span {
  width: 18px;
  height: 18px;
  background: #116ab4;
}

.measure-point-dragging span {
  width: 24px;
  height: 24px;
  background: #0b5a9d;
  box-shadow: 0 2px 10px rgba(20, 32, 51, 0.5);
}

.measure-hit-line {
  cursor: copy;
  pointer-events: stroke;
}

.measure-label {
  min-width: 30px;
  padding: 1px 4px 2px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font-size: 0.66rem;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(20, 32, 51, 0.12);
}

.measure-label strong,
.measure-label span {
  display: block;
}

.measure-label-start {
  min-width: 24px;
}

.measure-label strong {
  font-weight: 800;
}

.measure-label span {
  margin-top: 1px;
}

.detail-panel.open {
  display: grid;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h1 {
  margin: 0;
  font-size: 1rem;
}

.icon-button {
  width: 36px;
  padding: 0;
  cursor: pointer;
}

.panel-body {
  overflow: auto;
  padding: 14px;
}

.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 640;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(20, 32, 51, 0.14);
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0 0 14px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hydrant-detail-card {
  margin: 0 0 14px;
  padding: 12px 12px 10px;
  border: 1px solid #233145;
  border-radius: 7px;
  background: #162235;
  color: #eef5ff;
  box-shadow: 0 10px 22px rgba(20, 32, 51, 0.18);
}

.hydrant-detail-card h2 {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #75b8ff;
  font-size: 0.95rem;
}

.hydrant-detail-row {
  display: grid;
  grid-template-columns: minmax(122px, 0.48fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}

.hydrant-detail-row span {
  color: #a9b7c8;
  text-align: right;
  overflow-wrap: anywhere;
}

.hydrant-detail-row strong {
  color: #ffffff;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.hydrant-popup-shell {
  margin-bottom: 8px;
}

.hydrant-popup-shell .leaflet-popup-content-wrapper {
  overflow: hidden;
  border: 1px solid #c7d2df;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(20, 32, 51, 0.24);
}

.hydrant-popup-shell .leaflet-popup-content {
  width: min(300px, calc(100vw - 70px)) !important;
  margin: 0;
}

.hydrant-popup-shell .leaflet-popup-tip {
  width: 16px;
  height: 16px;
  border-right: 1px solid #c7d2df;
  border-bottom: 1px solid #c7d2df;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 4px 4px 10px rgba(20, 32, 51, 0.12);
}

.hydrant-popup-shell .leaflet-popup-close-button {
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  color: #596779;
  font-size: 1.1rem;
  line-height: 24px;
}

.hydrant-popup {
  padding: 11px 12px 12px;
}

.hydrant-popup h2 {
  margin: 0 28px 6px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: #164a7a;
  font-size: 0.98rem;
}

.hydrant-popup p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
}

.hydrant-popup-rows {
  display: grid;
  gap: 4px;
}

.hydrant-popup-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.5fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 0.8rem;
  line-height: 1.28;
}

.hydrant-popup-row span {
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
}

.hydrant-popup-row strong {
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.hydrant-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.hydrant-popup-actions .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.82rem;
}

.hydrant-popup-note {
  margin-top: 10px !important;
}

.tag-list,
.form-grid {
  display: grid;
  gap: 8px;
}

.detail-tags {
  margin-top: 14px;
}

.detail-tags h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tag-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f5;
}

.tag-key {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tag-value {
  overflow-wrap: anywhere;
}

.form-grid {
  margin-top: 14px;
}

.form-row {
  display: grid;
  gap: 5px;
}

.form-row input,
.form-row select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

.form-row input:disabled {
  color: #6b7280;
  background: #eef2f6;
}

.field-label-with-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}

.field-info-button {
  width: 22px;
  height: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: help;
}

.field-info-button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.field-info-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 9px 10px;
  border: 1px solid var(--hm-border-soft, #d6dee8);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 31, 53, 0.16);
  color: var(--hm-ink, #172033);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.field-label-with-info:hover .field-info-tooltip,
.field-label-with-info:focus-within .field-info-tooltip,
.field-info-button.active + .field-info-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.form-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: -6px;
  color: var(--hm-text-muted, #5b6675);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.form-check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--hm-primary, #0b63ce);
}

.form-row input.field-invalid,
.coordinate-fields input.field-invalid {
  border-color: #c92a2a;
  background: #fff5f5;
}

.coordinate-fields {
  min-width: 0;
  margin: 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.coordinate-fields legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.coordinate-grid label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.coordinate-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.coordinate-grid input {
  min-width: 0;
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 0.92rem;
}

.form-row-inline .inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.quick-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: -3px;
}

.quick-value {
  min-height: 34px;
  min-width: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.quick-values span {
  color: var(--muted);
  font-size: 0.88rem;
}

.choice-slider {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef2f6;
}

.choice-slider-option {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.choice-slider-option.active {
  background: #fff;
  color: var(--hm-primary, #0b63ce);
  box-shadow: 0 1px 4px rgba(20, 32, 51, 0.15);
}

.map-feature-icon {
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 1px 2px rgba(20, 32, 51, 0.55));
}

.water-cluster-icon {
  background: transparent;
  border: 0;
}

.water-cluster {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    0 0 0 1px rgba(20, 32, 51, 0.14),
    0 8px 18px rgba(20, 32, 51, 0.24);
}

.water-cluster span {
  min-width: 1.6em;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  text-align: center;
}

.cluster-small {
  background: linear-gradient(145deg, #2f91ff, #0d66c2);
}

.cluster-medium {
  background: linear-gradient(145deg, #1fb979, #087f5b);
}

.cluster-large {
  background: linear-gradient(145deg, #f59f00, #d9480f);
}

.cluster-xlarge {
  background: linear-gradient(145deg, #f03e3e, #9d174d);
}

.privacy-banner {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1300;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 46px rgba(20, 32, 51, 0.25);
}

.privacy-banner strong {
  display: block;
  margin-bottom: 4px;
}

.privacy-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1080px) {
  .topbar {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .button {
    padding: 0 10px;
  }

  .map-search {
    width: min(390px, calc(100vw - 220px));
  }
}

@media (max-width: 900px) {
  .map-search {
    width: min(430px, calc(100vw - 120px));
  }

}

@media (max-width: 720px) {
  .zoom-hint {
    bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: calc(7px + env(safe-area-inset-top)) 10px 8px;
  }

  .brand {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    font-size: 1.18rem;
  }

  .topbar-controls {
    justify-self: end;
    gap: 6px;
  }

  .topbar-menu-button {
    justify-self: end;
  }

  .map-search {
    position: static;
    grid-column: 1 / -1;
    transform: none;
    width: 100%;
    height: 40px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .search-locate-icon {
    margin-left: 8px;
  }

  .map-search input {
    height: 38px;
    font-size: 16px;
  }

  .map-search button {
    height: 34px;
    padding: 0 9px;
  }

  .topbar-actions {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .language-button {
    width: 100%;
  }

  .language-menu {
    left: 0;
    right: auto;
    width: 100%;
    max-height: min(70vh, 430px);
    overflow: auto;
  }

  .button {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.9rem;
  }

  .detail-panel {
    top: auto;
    right: 0;
    bottom: calc(46px + env(safe-area-inset-bottom));
    width: 100%;
    max-height: min(72%, calc(100dvh - 170px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .panel-body {
    padding: 12px 12px 72px;
  }

  .kv,
  .tag-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .left-toolbar {
    left: 10px;
    top: 113px;
  }

  .info-sidebar {
    left: 52px;
    top: 8px;
    bottom: 8px;
    width: calc(100vw - 62px);
  }

  .info-sidebar h1 {
    padding: 18px 42px 4px 16px;
    font-size: 1.35rem;
  }

  .sidebar-scroll {
    padding: 0 16px 18px;
  }

  .content-overlay {
    inset: 0;
    border-radius: 0;
  }

  .content-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    right: 54px;
    z-index: 4;
    width: 22px;
    height: 46px;
    background: linear-gradient(to right, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.98));
    pointer-events: none;
  }

  .content-overlay-scroll {
    padding: 18px 14px 24px;
  }

  .overlay-main-nav {
    top: -18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin: -18px -14px 18px;
    padding: 7px 120px 7px 14px;
    max-width: calc(100vw - 54px);
    border-right: 1px solid rgba(200, 211, 223, 0.78);
    -webkit-overflow-scrolling: touch;
  }

  .overlay-main-nav button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .overlay-close {
    top: 5px;
    right: 12px;
    width: 32px;
    height: 32px;
  }

  .content-overlay h1 {
    font-size: 1.45rem;
  }

  .overlay-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .overlay-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.92rem;
    white-space: nowrap;
  }

  .overlay-body h2 {
    font-size: 1.22rem;
  }

  .overlay-card {
    padding: 11px 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-card {
    min-height: 78px;
    padding: 10px 11px;
  }

  .stats-card strong {
    font-size: 1.45rem;
  }

  .usage-chart-heading {
    display: block;
  }

  .usage-line-chart svg {
    min-width: 560px;
  }

  .right-actions {
    top: 12px;
    right: 6px;
  }

  .layer-panel {
    top: 56px;
    right: 48px;
    width: min(290px, calc(100vw - 62px));
  }

  .privacy-banner {
    grid-template-columns: 1fr;
  }

  .privacy-actions {
    justify-content: stretch;
  }

  .privacy-actions .button {
    flex: 1;
  }

}

@media (max-width: 420px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .topbar-actions #loginLink,
  .topbar-actions #logoutButton {
    justify-self: stretch;
  }

  .map-search {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .map-search button {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .left-toolbar {
    top: 108px;
  }

  .tool-button:disabled:hover::after,
  .tool-button:disabled:focus-visible::after {
    min-width: 96px;
    max-width: 150px;
    font-size: 0.7rem;
  }

  .detail-panel {
    max-height: 76%;
  }

  .form-actions .button,
  .form-actions button {
    flex: 1 1 100%;
  }
}

@media (pointer: coarse) {
  .form-row input,
  .form-row select,
  .quick-value,
  .button,
  .icon-button {
    min-height: 42px;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(11, 99, 206, 0.32);
  outline-offset: 2px;
}

.button.primary-action,
.button.save-action {
  border-color: var(--hm-primary);
  background: var(--hm-primary);
  color: #fff;
}

.button.primary-action:hover,
.button.primary-action:focus-visible,
.button.save-action:hover,
.button.save-action:focus-visible {
  background: var(--hm-primary-strong);
}

.button.cancel-action {
  border-color: #d7a3a3;
}

.sheet-grabber {
  display: none;
}

.detail-panel {
  border-radius: var(--hm-radius-panel);
  background: var(--hm-surface-raised);
  box-shadow: var(--hm-shadow-panel);
}

.panel-header {
  min-height: 52px;
  padding: var(--hm-space-3) var(--hm-space-4);
  background: rgba(255, 255, 255, 0.96);
}

.panel-header h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-body {
  grid-row: 2;
  min-height: 0;
  padding: var(--hm-space-4);
}

.hydrant-surface,
.hydrant-create-surface {
  display: grid;
  gap: var(--hm-space-3);
}

.hydrant-create-surface h2,
.change-summary-dialog h2 {
  margin: 0;
  font-size: 1.1rem;
}

.hydrant-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: var(--hm-space-3);
  align-items: center;
  min-width: 0;
  padding-bottom: var(--hm-space-3);
  border-bottom: 1px solid var(--hm-line);
}

.hydrant-summary-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(20, 32, 51, 0.28));
}

.hydrant-summary h2 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.2;
}

.hydrant-summary p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--hm-text-muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hydrant-status-badge {
  padding: 4px 8px;
  border: 1px solid rgba(24, 133, 75, 0.25);
  border-radius: var(--hm-radius-round);
  background: #eaf8ef;
  color: #14532d;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.hydrant-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--hm-line);
  -webkit-overflow-scrolling: touch;
}

.hydrant-tab {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--hm-primary);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.hydrant-tab.active {
  border-bottom-color: var(--hm-primary);
  color: var(--hm-text);
  font-weight: 700;
}

.hydrant-content {
  min-width: 0;
}

.modern-detail-card {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hm-text);
  box-shadow: none;
}

.detail-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius-control);
  background: var(--hm-line);
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
  gap: var(--hm-space-3);
  align-items: baseline;
  padding: 10px 12px;
  background: #fff;
  font-size: 0.9rem;
}

.detail-row span {
  color: var(--hm-text-muted);
}

.detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--hm-text);
  font-weight: 700;
}

.hydrant-primary-actions,
.editor-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hm-space-2);
  margin-top: var(--hm-space-3);
}

.hydrant-primary-actions .button,
.editor-secondary-actions .button {
  flex: 1 1 auto;
}

.editor-section {
  display: grid;
  gap: var(--hm-space-3);
}

.hydrant-edit-form {
  gap: var(--hm-space-4);
  margin-top: 0;
}

.form-row span,
.osm-tag-row span {
  color: var(--hm-text-muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.form-row .field-info-tooltip {
  color: var(--hm-ink);
  font-size: 0.82rem;
  font-weight: 500;
}

.form-row input,
.form-row select,
.osm-tag-row input {
  border-color: var(--hm-line);
  border-radius: var(--hm-radius-control);
  background: #fff;
}

.sticky-form-actions {
  position: sticky;
  bottom: calc(-1 * var(--hm-space-4));
  z-index: 2;
  margin: var(--hm-space-2) calc(-1 * var(--hm-space-4)) calc(-1 * var(--hm-space-4));
  padding: var(--hm-space-3) var(--hm-space-4);
  border-top: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.sticky-form-actions .button {
  flex: 1 1 130px;
}

.expert-warning {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #f0b36d;
  border-radius: var(--hm-radius-control);
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.35;
}

.expert-warning strong {
  font-size: 0.92rem;
}

.expert-warning span {
  font-size: 0.84rem;
}

.osm-tag-editor {
  display: grid;
  gap: var(--hm-space-3);
}

.osm-tag-rows {
  display: grid;
}

.osm-tag-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.46fr) minmax(0, 1fr) 36px;
  gap: var(--hm-space-2);
  align-items: end;
  padding: var(--hm-space-2) 0;
  border-bottom: 1px solid var(--hm-line);
}

.osm-tag-row:first-child {
  padding-top: 0;
}

.osm-tag-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.osm-tag-row label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.osm-tag-row input {
  min-width: 0;
  min-height: 38px;
  padding: 0 9px;
  font: inherit;
}

.change-summary-dialog {
  display: grid;
  gap: var(--hm-space-4);
}

.change-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius-control);
  background: var(--hm-line);
}

.change-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.36fr) minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: var(--hm-space-2);
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  font-size: 0.88rem;
}

.change-row span {
  color: var(--hm-text-muted);
}

.change-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.change-row b {
  color: var(--hm-text-muted);
  text-align: center;
}

.save-state {
  min-height: 22px;
  color: var(--hm-text-muted);
}

.history-panel {
  display: grid;
  gap: var(--hm-space-3);
}

.history-list {
  display: grid;
  gap: var(--hm-space-2);
}

.history-entry {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius-control);
  background: #fff;
}

.history-entry span,
.history-list p {
  margin: 0;
  color: var(--hm-text-muted);
}

.loading-state {
  display: grid;
  justify-items: center;
  gap: var(--hm-space-3);
  padding: var(--hm-space-6);
  color: var(--hm-text-muted);
}

.loading-state span {
  width: 28px;
  height: 28px;
  border: 3px solid #d5dfeb;
  border-top-color: var(--hm-primary);
  border-radius: 50%;
  animation: hm-spin 0.9s linear infinite;
}

@keyframes hm-spin {
  to {
    transform: rotate(360deg);
  }
}

.measurement-hud {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 780;
  transform: translateX(-50%);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--hm-space-3);
  max-width: min(92vw, 520px);
  padding: 7px 8px 7px 12px;
  border: 1px solid rgba(11, 99, 206, 0.22);
  border-radius: var(--hm-radius-round);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--hm-shadow-float);
  color: var(--hm-text);
}

.measurement-hud > div:first-child {
  display: grid;
  gap: 1px;
}

.measurement-hud span {
  color: var(--hm-text-muted);
  font-size: 0.76rem;
}

.measurement-hud strong {
  font-size: 1rem;
}

.measurement-segments {
  white-space: nowrap;
}

.measurement-actions {
  display: inline-flex;
  gap: 4px;
}

.measurement-action {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--hm-line);
  border-radius: 50%;
  background: #fff;
  color: var(--hm-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.measurement-clear-action img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.measurement-active-panel {
  border-color: rgba(11, 99, 206, 0.5);
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: var(--hm-z-toast);
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 10px 14px;
  border: 1px solid rgba(20, 32, 51, 0.16);
  border-radius: var(--hm-radius-control);
  background: #172033;
  color: #fff;
  box-shadow: var(--hm-shadow-float);
  font-size: 0.92rem;
}

.toast-success {
  background: #14532d;
}

.toast-error {
  background: #7f1d1d;
}

.hm-desktop .app-shell {
  grid-template-rows: var(--hm-topbar-height) minmax(0, 1fr);
}

.hm-desktop .topbar {
  border-left: 0;
  border-right: 0;
  background: rgba(248, 250, 252, 0.97);
}

.hm-desktop .map-search {
  position: static;
  transform: none;
  width: min(430px, 32vw);
  box-shadow: none;
}

.hm-desktop .detail-panel {
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: var(--hm-sidebar-width);
  max-height: none;
}

.hm-desktop.panel-open .map {
  right: calc(var(--hm-sidebar-width) + 24px);
}

.hm-desktop.panel-open .right-actions {
  right: calc(var(--hm-sidebar-width) + 34px);
}

.hm-desktop .left-toolbar {
  top: 70px;
  left: 14px;
}

.hm-desktop .tool-button,
.hm-desktop .right-tool,
.hm-desktop .right-actions div {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: var(--hm-radius-control);
}

.hm-desktop #measureButton.active,
.hm-mobile #measureButton.active {
  border-color: var(--hm-primary);
  background: #e8f2ff;
  box-shadow: 0 0 0 3px rgba(11, 99, 206, 0.18), var(--hm-shadow-float);
}

.hm-desktop .hydrant-tabs {
  margin: 0 calc(-1 * var(--hm-space-4));
  padding: 0 var(--hm-space-4);
  flex-wrap: wrap;
  overflow: visible;
  row-gap: 2px;
}

.hm-desktop .hydrant-tab {
  flex: 1 1 auto;
  min-width: max-content;
  padding-right: 8px;
  padding-left: 8px;
  font-size: 0.82rem;
}

.hm-ios .topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.hm-android .topbar {
  border-bottom: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 32, 51, 0.12);
}

@media (max-width: 767px) {
  .hm-mobile .workspace {
    overflow: hidden;
  }

  .hm-mobile .topbar {
    border-bottom: 1px solid rgba(200, 211, 223, 0.76);
  }

  .hm-mobile .detail-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: none;
    height: min(62dvh, 560px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--hm-radius-sheet) var(--hm-radius-sheet) 0 0;
    overflow: hidden;
  }

  .hm-mobile .detail-panel.sheet-collapsed {
    height: calc(150px + env(safe-area-inset-bottom));
  }

  .hm-mobile .detail-panel.sheet-half {
    height: min(64dvh, 560px);
  }

  .hm-mobile .detail-panel.sheet-full {
    height: calc(100dvh - 8px - env(safe-area-inset-top));
  }

  .hm-mobile .sheet-grabber {
    display: grid;
    place-items: center;
    width: 100%;
    height: 24px;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    touch-action: none;
  }

  .hm-mobile .sheet-grabber span {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: #c8d3df;
  }

  .hm-mobile .panel-header {
    min-height: 46px;
    padding: 6px 12px 10px;
  }

  .hm-mobile .panel-body {
    padding: 0 12px calc(20px + env(safe-area-inset-bottom));
  }

  .hm-mobile .detail-panel.sheet-collapsed .hydrant-tabs {
    display: none;
  }

  .hm-mobile .detail-panel.sheet-collapsed .detail-grid,
  .hm-mobile .detail-panel.sheet-collapsed .hydrant-popup-note {
    display: none;
  }

  .hm-mobile .detail-panel.sheet-collapsed .hydrant-primary-actions {
    margin-top: 8px;
  }

  .hm-mobile .hydrant-summary {
    grid-template-columns: 36px minmax(0, 1fr);
    padding-bottom: 9px;
  }

  .hm-mobile .hydrant-status-badge {
    display: none;
  }

  .hm-mobile .hydrant-tabs {
    display: none;
  }

  .hm-mobile .detail-row,
  .hm-mobile .change-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .hm-mobile .change-row b {
    display: none;
  }

  .hm-mobile .osm-tag-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .hm-mobile .osm-tag-row label {
    grid-column: 1 / 2;
  }

  .hm-mobile .osm-tag-row .remove-tag-row {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .hm-mobile .sticky-form-actions {
    bottom: calc(-20px - env(safe-area-inset-bottom));
    margin-right: -12px;
    margin-left: -12px;
    margin-bottom: calc(-20px - env(safe-area-inset-bottom));
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .hm-mobile .left-toolbar {
    left: auto;
    top: calc(124px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: auto;
    gap: 10px;
  }

  .hm-mobile .tool-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
    border-radius: 50%;
  }

  .hm-mobile #fullscreenButton,
  .hm-mobile #addSuctionTool,
  .hm-mobile #addWaterTankTool {
    display: none;
  }

  .hm-mobile .tool-group,
  .hm-mobile .tool-group-add {
    width: auto;
    display: contents;
  }

  .hm-mobile #addHydrantTool {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 760;
    width: 58px;
    height: 58px;
    min-height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--hm-primary);
    box-shadow: 0 12px 26px rgba(11, 99, 206, 0.34);
  }

  .hm-mobile #addHydrantTool > img:first-child {
    filter: brightness(0) invert(1);
  }

  .hm-mobile #addHydrantTool .plus-badge {
    right: 6px;
    bottom: 6px;
  }

  .hm-mobile #measureButton {
    order: 2;
  }

  .hm-mobile #locateButton {
    order: 1;
  }

  .hm-mobile .right-actions {
    top: 10px;
    right: max(8px, env(safe-area-inset-right));
  }

  .hm-mobile .measurement-hud {
    top: 10px;
    max-width: calc(100vw - 120px);
  }

  .hm-mobile.panel-open .measurement-hud {
    top: 8px;
  }

  .hm-mobile .toast-host {
    top: calc(72px + env(safe-area-inset-top));
    bottom: auto;
  }
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid var(--hm-line) !important;
  border-radius: var(--hm-radius-control) !important;
  box-shadow: var(--hm-shadow-float) !important;
}

.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 38px !important;
  border-bottom-color: var(--hm-line) !important;
  color: var(--hm-text) !important;
  font-size: 1.25rem !important;
  font-weight: 700;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus-visible {
  background: var(--hm-surface-soft) !important;
}

.leaflet-control-attribution {
  max-width: calc(100vw);
  overflow: visible;
  border: 1px solid rgba(200, 211, 223, 0.7);
  border-radius: var(--hm-radius-control);
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--hm-text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(20, 32, 51, 0.12);
}

@media (max-width: 767px) {
  .hm-mobile .topbar-controls {
    min-width: 0;
  }

  .hm-mobile .leaflet-control-zoom {
    margin-top: 10px !important;
    margin-left: max(10px, env(safe-area-inset-left)) !important;
  }

  .hm-mobile .leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 42px !important;
  }

  .hm-mobile .leaflet-bottom.leaflet-right {
    right: auto;
    left: 0;
    max-width: calc(100vw - 16px);
  }

  .hm-mobile .leaflet-bottom.leaflet-right .leaflet-control {
    float: left;
    margin-right: 0;
    margin-bottom: max(8px, env(safe-area-inset-bottom));
    margin-left: max(8px, env(safe-area-inset-left));
  }

  .hm-mobile .leaflet-control-attribution {
    max-width: calc(100vw - 16px);
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .hm-mobile #addHydrantTool {
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 830;
  }

  .hm-mobile.panel-open.sheet-collapsed #addHydrantTool {
    bottom: calc(166px + env(safe-area-inset-bottom));
  }

  .hm-mobile.panel-open.sheet-half #addHydrantTool {
    bottom: calc(min(64dvh, 560px) + 14px);
  }

  .hm-mobile.panel-open.sheet-full #addHydrantTool,
  .hm-mobile.add-active #addHydrantTool {
    display: none;
  }

  .hm-mobile .right-actions {
    max-width: calc(100vw - 68px);
  }

  .hm-mobile .right-actions div,
  .hm-mobile .right-tool {
    box-shadow: var(--hm-shadow-float);
  }

  .hm-mobile .zoom-hint {
    bottom: calc(128px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}

/* Rescue skin: modern field-app layout, intentionally placed last to override legacy GIS styling. */
:root {
  --hm-app-bg: #edf2f7;
  --hm-card-bg: rgba(255, 255, 255, 0.96);
  --hm-blue: #0b63f6;
  --hm-blue-strong: #0755d8;
  --hm-red: #e52d2d;
  --hm-ink: #0f1f35;
  --hm-soft-ink: #66758a;
  --hm-border-soft: rgba(148, 163, 184, 0.28);
  --hm-hairline: rgba(15, 31, 53, 0.08);
  --hm-control-shadow: 0 8px 24px rgba(15, 31, 53, 0.16);
  --hm-sheet-shadow: 0 -18px 54px rgba(15, 31, 53, 0.22);
}

body {
  color: var(--hm-ink);
  background: var(--hm-app-bg);
}

.app-shell {
  background: var(--hm-app-bg);
}

.topbar {
  z-index: var(--hm-z-topbar);
  min-height: 58px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  border: 0;
  border-bottom: 1px solid var(--hm-hairline);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(15, 31, 53, 0.04);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: var(--hm-ink);
  font-size: 1rem;
  font-weight: 780;
  letter-spacing: 0;
}

.brand::before {
  content: "";
  width: 25px;
  height: 25px;
  display: inline-block;
  background: var(--hm-blue);
  -webkit-mask: url("/img/hydrant_underground.svg?v=3") center / contain no-repeat;
  mask: url("/img/hydrant_underground.svg?v=3") center / contain no-repeat;
}

.map-search {
  height: 38px;
  border: 1px solid var(--hm-border-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 31, 53, 0.06);
}

.map-search button {
  height: 30px;
  margin-right: 4px;
  border: 0;
  border-radius: 7px;
  background: #eef5ff;
  color: var(--hm-blue);
  font-size: 0.84rem;
  font-weight: 700;
}

.map-search .search-locate-button {
  width: 34px;
  height: 38px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.search-locate-icon {
  opacity: 0.72;
}

.topbar-menu-button,
.language-button,
.button,
.icon-button,
.tool-button,
.right-tool,
.right-actions div,
.measurement-action {
  border-color: var(--hm-border-soft);
  border-radius: 8px;
  background: #fff;
}

.topbar-menu-button,
.language-button {
  box-shadow: 0 2px 8px rgba(15, 31, 53, 0.05);
}

.topbar-actions {
  border: 1px solid var(--hm-border-soft);
  border-radius: 10px;
  box-shadow: var(--hm-control-shadow);
}

.workspace {
  background: #dfe7ef;
}

.leaflet-container {
  font-family: inherit;
  background: #dfe7ef;
}

.leaflet-control-zoom {
  border: 0 !important;
  border-radius: 10px !important;
  background: #fff;
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  line-height: 40px !important;
  color: var(--hm-ink) !important;
}

.left-toolbar,
.right-actions {
  z-index: 710;
}

.tool-button,
.right-tool,
.right-actions div {
  border: 1px solid var(--hm-border-soft);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--hm-control-shadow);
}

.tool-button.active,
.right-tool.active,
#measureButton.active {
  border-color: rgba(11, 99, 246, 0.45);
  background: #eaf3ff;
  color: var(--hm-blue);
}

.right-actions {
  gap: 8px;
}

.right-actions div {
  min-width: 58px;
  height: 38px;
  grid-template-columns: 20px minmax(20px, auto);
  padding: 4px 7px;
  color: var(--hm-ink);
  font-weight: 800;
}

.right-tool {
  width: 38px;
  height: 38px;
  min-height: 38px;
}

.layer-panel {
  border-color: var(--hm-border-soft);
  border-radius: 12px;
  background: var(--hm-card-bg);
  box-shadow: var(--hm-control-shadow);
}

.png-export-dialog {
  position: absolute;
  left: 64px;
  top: 12px;
  z-index: 940;
  width: min(320px, calc(100vw - 24px));
  display: grid;
  gap: 16px;
  padding: 22px 24px 24px;
  border: 1px solid var(--hm-border-soft);
  border-radius: 12px;
  background: var(--hm-card-bg);
  color: var(--hm-ink);
  box-shadow: var(--hm-control-shadow);
}

.png-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.png-export-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.png-export-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--hm-muted);
  font-size: 1.35rem;
  cursor: pointer;
}

.png-export-help {
  margin: 0;
  color: var(--hm-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.png-export-field {
  display: grid;
  gap: 8px;
}

.png-export-field > span,
.png-export-field-label span {
  color: var(--hm-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.png-export-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.png-export-field-label output {
  min-width: 34px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(11, 99, 246, 0.24);
  border-radius: 999px;
  background: rgba(11, 99, 246, 0.10);
  color: var(--hm-blue);
  font-size: 0.82rem;
  font-weight: 850;
}

.png-export-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.png-export-segments button {
  min-height: 34px;
  border: 1px solid var(--hm-border-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--hm-ink);
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.png-export-segments button.active {
  border-color: rgba(11, 99, 246, 0.45);
  background: rgba(11, 99, 246, 0.10);
  color: var(--hm-blue);
}

.png-export-range {
  --png-export-zoom-progress: 80%;
  width: 100%;
  height: 44px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.png-export-range:focus-visible {
  outline: 3px solid rgba(47, 109, 246, 0.24);
  outline-offset: 2px;
  border-radius: 999px;
}

.png-export-range::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--hm-blue) 0 var(--png-export-zoom-progress),
    #e4eaf2 var(--png-export-zoom-progress) 100%
  );
}

.png-export-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -11.5px;
  -webkit-appearance: none;
  appearance: none;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--hm-blue);
  box-shadow: 0 4px 14px rgba(20, 32, 51, 0.24);
}

.png-export-range::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: #e4eaf2;
}

.png-export-range::-moz-range-progress {
  height: 7px;
  border-radius: 999px;
  background: var(--hm-blue);
}

.png-export-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--hm-blue);
  box-shadow: 0 4px 14px rgba(20, 32, 51, 0.24);
}

.png-export-zoom-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: -8px;
  color: var(--hm-muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1;
}

.png-export-zoom-scale span {
  text-align: center;
}

.png-export-zoom-scale span:first-child {
  text-align: left;
}

.png-export-zoom-scale span:last-child {
  text-align: right;
}

.png-export-area-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.png-export-area-row:has(.png-export-reset:not(.hidden)) {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.png-export-select,
.png-export-primary {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.png-export-select {
  border: 1px solid var(--hm-border-soft);
  background: #fff;
  color: var(--hm-ink);
  text-align: center;
}

.png-export-reset {
  width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff1f1;
  cursor: pointer;
}

.png-export-reset img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.png-export-primary {
  background: #2f6df6;
  box-shadow: 0 8px 18px rgba(47, 109, 246, 0.24);
}

.png-export-primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.png-export-selection-layer {
  position: absolute;
  inset: 0;
  z-index: 720;
  pointer-events: none;
}

.png-export-selection-layer.selecting {
  cursor: crosshair;
  pointer-events: auto;
}

.png-export-selection-rect {
  position: absolute;
  border: 2px solid #2f6df6;
  background: rgba(47, 109, 246, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.58) inset;
}

.detail-panel {
  z-index: 930;
  overflow: hidden;
  border: 1px solid var(--hm-border-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 56px rgba(15, 31, 53, 0.22);
}

.panel-header {
  min-height: 54px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hm-hairline);
  background: rgba(255, 255, 255, 0.96);
}

.panel-header h1 {
  color: var(--hm-ink);
  font-size: 0.98rem;
  font-weight: 780;
}

.panel-body {
  grid-row: 2;
  padding: 14px;
  background: #fff;
}

.hydrant-summary {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 0 0 13px;
  border-bottom: 1px solid var(--hm-hairline);
}

.hydrant-summary-icon {
  width: 38px;
  height: 38px;
}

.hydrant-summary h2 {
  color: var(--hm-ink);
  font-size: 1.04rem;
  font-weight: 800;
}

.hydrant-summary p,
.detail-row span,
.form-row span,
.osm-tag-row span {
  color: var(--hm-soft-ink);
}

.hydrant-status-badge {
  border: 0;
  background: #dcfce7;
  color: #166534;
}

.hydrant-tabs {
  margin: 0 -14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--hm-hairline);
}

.hydrant-tab {
  min-height: 44px;
  color: var(--hm-soft-ink);
  font-weight: 720;
}

.hydrant-tab.active {
  border-bottom-color: var(--hm-blue);
  color: var(--hm-blue);
}

.detail-grid,
.change-list {
  border: 1px solid var(--hm-hairline);
  border-radius: 10px;
  background: var(--hm-hairline);
}

.detail-row,
.change-row,
.history-entry {
  background: #fff;
}

.form-row input,
.form-row select,
.coordinate-grid input,
.osm-tag-row input {
  min-height: 42px;
  border: 1px solid var(--hm-border-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--hm-ink);
}

.quick-value {
  border-color: var(--hm-border-soft);
  border-radius: 8px;
}

.button.primary-action,
.button.save-action {
  border-color: var(--hm-blue);
  background: var(--hm-blue);
  color: #fff;
  font-weight: 760;
}

.button.primary-action:hover,
.button.primary-action:focus-visible,
.button.save-action:hover,
.button.save-action:focus-visible {
  background: var(--hm-blue-strong);
}

.button.secondary {
  background: #f8fafc;
  color: var(--hm-blue);
  font-weight: 700;
}

.button.cancel-action {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
  font-weight: 720;
}

.sticky-form-actions {
  border-top: 1px solid var(--hm-hairline);
}

.measurement-hud {
  border: 1px solid rgba(11, 99, 246, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--hm-control-shadow);
}

.toast-host {
  border-radius: 10px;
  box-shadow: var(--hm-control-shadow);
}

.info-sidebar {
  display: none !important;
}

.content-overlay {
  border: 0;
  background: rgba(255, 255, 255, 0.98);
}

.leaflet-control-attribution {
  opacity: 0.86;
}

.hm-desktop .topbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 430px) minmax(0, 1fr) auto auto;
  gap: 12px;
}

.hm-desktop .topbar-controls {
  grid-column: 3;
  justify-self: end;
}

.hm-desktop .topbar-menu-button {
  grid-column: 5;
}

.hm-desktop .map-search {
  grid-column: 2;
  width: 100%;
}

.hm-desktop .left-toolbar {
  top: 72px;
  left: 14px;
  gap: 9px;
}

.hm-desktop .tool-button,
.hm-desktop .right-tool {
  width: 42px;
  height: 42px;
  min-height: 42px;
}

.hm-desktop .detail-panel {
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(430px, calc(100vw - 88px));
}

.hm-desktop .right-actions {
  top: 14px;
  right: 14px;
}

.hm-desktop.panel-open .right-actions {
  right: calc(min(430px, calc(100vw - 88px)) + 28px);
}

@media (max-width: 767px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hm-mobile .topbar {
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 48px;
    gap: 8px;
    align-items: center;
    padding: calc(8px + env(safe-area-inset-top)) 10px 10px;
    background: #fff;
    backdrop-filter: none;
  }

  .hm-mobile .brand {
    min-height: 38px;
    font-size: 1rem;
  }

  .hm-mobile .language-button {
    width: 58px;
    height: 42px;
    min-height: 42px;
    border-radius: 9px;
    gap: 5px;
    padding: 0 8px;
  }

  .hm-mobile .language-button img {
    flex: 0 0 auto;
  }

  .hm-mobile .language-menu {
    right: 0;
    left: auto;
    width: max-content;
    min-width: 190px;
    max-width: calc(100vw - 20px);
  }

  .hm-mobile .topbar-menu-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 9px;
  }

  .hm-mobile .topbar-controls {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .hm-mobile .topbar-menu-button {
    grid-column: 3;
    grid-row: 1;
  }

  .hm-mobile .map-search {
    grid-column: 1 / -1;
    grid-row: 2;
    position: static;
    transform: none;
    width: 100%;
    height: 42px;
    grid-template-columns: 42px minmax(0, 1fr);
    box-shadow: none;
  }

  .hm-mobile .map-search .search-locate-button {
    display: grid;
    width: 42px;
    height: 42px;
  }

  .hm-mobile .map-search input {
    height: 40px;
    padding-left: 10px;
    font-size: 16px;
  }

  .hm-mobile .map-search button[type="submit"] {
    display: none;
  }

  .hm-mobile .right-actions {
    top: calc(10px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    gap: 8px;
  }

  .hm-mobile .object-counter {
    width: 56px;
    min-width: 56px;
    height: 38px;
    border-radius: 10px;
  }

  .hm-mobile #layerToggleButton {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 50%;
  }

  .hm-mobile .left-toolbar {
    top: calc(132px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    gap: 10px;
  }

  .hm-mobile .tool-button {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border-radius: 50%;
  }

  .hm-mobile #locateButton,
  .hm-mobile #measureButton {
    box-shadow: var(--hm-control-shadow);
  }

  .hm-mobile #addHydrantTool {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    min-height: 56px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 22px rgba(32, 70, 180, 0.28), 0 2px 6px rgba(15, 31, 53, 0.14);
  }

  .hm-mobile #addHydrantTool::after {
    content: "+";
    position: absolute;
    inset: 1px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #5f7cff;
    color: #fff;
    font-size: 2.35rem;
    font-weight: 300;
    line-height: 1;
  }

  .hm-mobile #addHydrantTool > img {
    display: none;
  }

  .hm-mobile.panel-open.sheet-collapsed #addHydrantTool {
    bottom: calc(168px + env(safe-area-inset-bottom));
  }

  .hm-mobile.panel-open.sheet-half #addHydrantTool {
    display: none;
  }

  .hm-mobile .detail-panel {
    height: min(62dvh, 560px);
    border: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: var(--hm-sheet-shadow);
    transition: height 160ms ease, top 160ms ease, transform 160ms ease, border-radius 160ms ease;
  }

  .hm-mobile .detail-panel.sheet-collapsed {
    height: calc(146px + env(safe-area-inset-bottom));
  }

  .hm-mobile .detail-panel.sheet-half {
    height: min(58dvh, 520px);
  }

  .hm-mobile .detail-panel.sheet-full {
    height: calc(100dvh - env(safe-area-inset-top));
    border-radius: 14px 14px 0 0;
  }

  .hm-mobile .detail-panel.sheet-dragging {
    top: auto !important;
    bottom: 0 !important;
    height: var(--sheet-drag-height) !important;
    transition: none;
    will-change: height;
  }

  .hm-mobile .panel-close-button {
    top: 30px;
  }

  .hm-mobile .panel-header {
    min-height: 46px;
    padding: 6px 14px 10px;
  }

  .hm-mobile .panel-body {
    padding: 0 14px calc(22px + env(safe-area-inset-bottom));
  }

  .hm-mobile .hydrant-summary {
    grid-template-columns: 40px minmax(0, 1fr);
    padding-bottom: 12px;
  }

  .hm-mobile .hydrant-summary h2 {
    font-size: 1.02rem;
  }

  .hm-mobile .hydrant-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-mobile .hydrant-primary-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .hm-mobile .button {
    min-height: 44px;
    border-radius: 9px;
  }

  .hm-mobile .detail-row {
    padding: 10px 12px;
  }

  .hm-mobile .leaflet-control-attribution {
    max-width: calc(100vw - 16px);
  }
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  z-index: 640;
}

.detail-panel {
  z-index: 930;
}

.left-toolbar {
  left: 10px;
  top: 104px;
}

.hm-desktop .left-toolbar {
  left: 10px;
  top: 104px;
}

@media (max-width: 767px) {
  .hm-mobile .left-toolbar {
    left: max(10px, env(safe-area-inset-left));
    right: auto;
    top: 108px;
  }

  .hm-mobile .png-export-dialog {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    padding: 20px;
  }

  .hm-mobile .png-export-dialog.selecting {
    left: 50%;
    right: auto;
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 32px);
    min-height: 0;
    padding: 9px 13px;
    border-radius: 999px;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .hm-mobile .png-export-dialog.selecting > * {
    display: none;
  }

  .hm-mobile .png-export-dialog.selecting::before {
    content: attr(data-selecting-label);
    display: block;
    color: var(--hm-ink);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  body.hm-mobile:not(.css-fullscreen) .map {
    inset: 0;
  }

  body.hm-mobile.position-edit-active:not(.css-fullscreen) .detail-panel.sheet-collapsed {
    height: calc(82px + env(safe-area-inset-bottom));
  }

  body.hm-mobile.position-edit-dragging:not(.css-fullscreen) .detail-panel.sheet-collapsed {
    transform: translateY(calc(48px + env(safe-area-inset-bottom)));
  }

  body.hm-mobile:not(.css-fullscreen) .detail-panel.sheet-full {
    top: 112px;
    bottom: 0;
    height: auto;
    border-radius: 14px 14px 0 0;
  }

  body.hm-mobile:not(.css-fullscreen) .detail-panel.sheet-full .panel-body {
    max-height: none;
    overflow: auto;
  }

  .hm-mobile .detail-panel[data-kind="editor"] .panel-header {
    display: none;
  }

  .hm-mobile .detail-panel[data-kind="editor"] .panel-body {
    padding-top: 12px;
  }

  .hm-mobile .tool-button,
  .hm-mobile .right-tool,
  .hm-mobile #layerToggleButton {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid var(--hm-border-soft);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--hm-control-shadow);
  }

  .hm-mobile #addHydrantTool {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    min-height: 56px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 22px rgba(32, 70, 180, 0.28), 0 2px 6px rgba(15, 31, 53, 0.14);
  }

  .hm-mobile .button {
    border-radius: 6px;
  }
}
