:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #eef3ee;
  --ink: #19211c;
  --muted: #69736d;
  --line: #d8dfd9;
  --green: #2d7a4b;
  --green-strong: #087a34;
  --work-open: #b7ff3c;
  --work-progress: #ffc247;
  --exported: #3e4d43;
  --green-dark: #1d5736;
  --blue: #2f6f9f;
  --lift: #00f5ff;
  --lift-ink: #ffffff;
  --amber: #b97818;
  --hv: #f4a340;
  --vrao: #c74c24;
  --skt: #f7ff00;
  --stump: #b9b7ff;
  --method-open: #ffffff;
  --red: #e52520;
  --violet: #6d5fb8;
  --shadow: 0 18px 45px rgba(31, 43, 34, 0.12);
}

.document-preview-floating-back {
  display: none;
}

@media (max-width: 760px) {
  .measure-list {
    padding-left: 3px;
    padding-right: 3px;
  }

  .measure-group-header {
    padding: 7px 7px;
    background: #f5faf5;
    border-left: 4px solid #173820;
  }

  .measure-group-header strong {
    font-size: 14px;
    color: #102818;
  }

  .measure-group-header small,
  .measure-group-header .pill {
    display: none;
  }

  .measure-row {
    padding-left: 5px;
    padding-right: 5px;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  #projectsView .map-canvas {
    height: calc(100% - 44px);
  }

  .object-tabs {
    min-height: 44px;
    height: 44px;
    gap: 7px;
    padding: 5px 8px;
  }

  .object-tab {
    min-width: 112px;
    height: 34px;
    padding: 0 12px;
  }

  .object-tab.active {
    height: 36px;
  }

  .object-tab strong {
    font-size: 12px;
  }

  .tree-map-popup.mobile-fullscreen .leaflet-popup-card {
    padding-right: 62px;
  }

  .mobile-popup-back {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    z-index: 180;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: #102818;
    color: #fff;
    display: grid;
    place-items: center;
    margin: 0;
    box-shadow: 0 14px 30px rgba(16, 40, 24, 0.26);
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-popup-back span {
    transform: translateY(-2px);
  }

  .tree-map-popup.mobile-fullscreen .popup-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .tree-map-popup.mobile-fullscreen .action-idle {
    grid-column: 1 / -1;
    min-height: 54px;
  }

  .tree-map-popup.mobile-fullscreen .popup-scouting {
    border: 0;
    background: #e8f6ff;
    padding: 10px;
  }

  .tree-map-popup.mobile-fullscreen .popup-scouting-toggle {
    min-height: 42px;
    background: #93dcff;
    color: #092c36;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-grid,
  .tree-map-popup.mobile-fullscreen .popup-scout-row {
    background: transparent;
    gap: 7px;
    padding: 0;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button {
    min-height: 44px;
    box-shadow: 0 8px 18px rgba(24, 33, 29, 0.12);
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv {
    background: #ffd185;
    color: #4e330d;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao {
    background: #ff9b7a;
    color: #532012;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao {
    background: linear-gradient(135deg, #ffd185 0 50%, #ff9b7a 50% 100%);
    color: #2b2114;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv.active {
    background: var(--hv);
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao.active {
    background: var(--vrao);
    color: #fff;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao.active {
    background: linear-gradient(135deg, var(--hv) 0 50%, var(--vrao) 50% 100%);
    color: #fff;
  }

  .tree-map-popup.mobile-fullscreen .scout-photo-choice {
    min-height: 48px;
    background: #173820;
    color: #fff;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-note textarea {
    min-height: 78px;
    border: 2px solid #93dcff;
    background: #fff;
    font-size: 16px;
  }

  .tree-map-popup.mobile-fullscreen .idle-photo-actions {
    grid-template-columns: 1fr 1fr;
  }

  .tree-map-popup.mobile-fullscreen .tree-photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tree-map-popup.mobile-fullscreen .tree-photo-item img {
    height: 112px;
  }

  body[data-active-view="disposal"] .maps-open-button {
    min-height: 50px;
    background: #102818;
    color: #fff;
    box-shadow: 0 10px 22px rgba(16, 40, 24, 0.22);
  }

  body[data-active-view="documents"] .documents-actions,
  body[data-active-view="documents"] .document-folder-tools,
  body[data-active-view="documents"] #documentDropZone,
  body[data-active-view="documents"] .folder-copy small,
  body[data-active-view="documents"] .folder-count,
  body[data-active-view="documents"] .document-empty small,
  body[data-active-view="documents"] [data-delete-document-file] {
    display: none !important;
  }

  body[data-active-view="documents"] .document-folder-path {
    min-height: 0;
    margin-bottom: 8px;
  }

  body[data-active-view="documents"] .document-folder-path > button:not(.document-level-back),
  body[data-active-view="documents"] .document-folder-path > span {
    display: none;
  }

  body[data-active-view="documents"] .document-level-back {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(70px, env(safe-area-inset-bottom));
    z-index: 180;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #102818;
    color: #fff;
    display: grid;
    place-items: center;
    margin: 0;
    box-shadow: 0 14px 30px rgba(16, 40, 24, 0.26);
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
  }

  body[data-active-view="documents"] .document-level-back span {
    transform: translateY(-2px);
  }

  body[data-active-view="documents"] .document-folder-card {
    min-height: 78px;
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 12px;
  }

  body[data-active-view="documents"] .document-file-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  body[data-active-view="documents"] .document-file-main small {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body.auth-locked {
  background: #eef4ef;
}

body.auth-locked .app-shell,
body:not(.auth-locked) .access-gate {
  display: none;
}

.access-gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(135, 224, 154, 0.18), transparent 32%),
    linear-gradient(160deg, #f7faf7 0%, #e6eee7 100%);
}

.access-card {
  width: min(100%, 380px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(23, 56, 32, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(17, 36, 24, 0.14);
}

.access-logo {
  width: 72px;
  height: 72px;
}

.access-card h1 {
  margin: 2px 0 4px;
  font-size: 28px;
  color: #102818;
}

.access-card p {
  margin: 0;
  color: #5c6b62;
}

.access-card label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #4b5a51;
}

.access-card input {
  min-height: 52px;
  border: 1px solid rgba(23, 56, 32, 0.18);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #102818;
  background: #f8faf8;
}

.access-card .primary-button {
  min-height: 52px;
  border-radius: 10px;
  background: #173820;
}

.access-error {
  min-height: 20px;
  font-size: 13px;
  font-weight: 800;
  color: #b82f1c !important;
}

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

.app-shell.nav-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.nav-hidden .sidebar {
  display: none;
}

.sidebar {
  background: #17231c;
  color: #f6faf5;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  z-index: 25;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f8fbf7;
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand h1,
.brand p,
.workspace h2,
.workspace h3,
.eyebrow {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  color: #b9c8bd;
  font-size: 13px;
  margin-top: 3px;
}

.main-nav,
.project-list,
.work-list {
  display: grid;
  gap: 8px;
}

.nav-button,
.project-button {
  min-height: 44px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.nav-button:hover,
.nav-button.active,
.project-button:hover,
.project-button.active {
  background: rgba(255, 255, 255, 0.1);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  font-weight: 700;
}

.sidebar-section {
  display: grid;
  gap: 12px;
}

.section-label,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .section-label {
  color: #aebeb3;
}

.project-button {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.project-card {
  position: relative;
  border-radius: 8px;
}

.project-card.active {
  background: rgba(255, 255, 255, 0.1);
}

.project-card.awaiting-approval {
  background: rgba(242, 162, 58, 0.18);
  box-shadow: inset 3px 0 0 #f2a23a;
}

.project-card.awaiting-approval .project-button small {
  color: #ffe0a3;
  font-weight: 850;
}

.project-select-button {
  padding-right: 42px;
}

.project-menu-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #d9e8de;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

.project-menu-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.project-menu {
  position: absolute;
  top: 39px;
  right: 7px;
  z-index: 50;
  min-width: 188px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #f8fbf8;
  padding: 6px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.project-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: #eef4ee;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.project-menu button:hover {
  background: #dfeadf;
}

.project-menu button.danger {
  background: #fff0ee;
  color: #b42318;
}

.project-menu button.danger:hover {
  background: #ffd8d2;
}

.project-button strong {
  font-size: 14px;
}

.project-button small {
  color: #bdd0c3;
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  background: rgba(244, 246, 243, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.workspace h2 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
}

.search-wrap {
  min-width: 250px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-icon {
  color: var(--muted);
  font-weight: 800;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

.primary-button {
  border-color: var(--green-dark);
  background: var(--green);
  color: #fff;
}

.ghost-button.icon-only,
.primary-button.icon-only {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.view {
  display: none;
  padding: 22px 28px 28px;
  min-height: 0;
  overflow: auto;
}

.active-view {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.metric-value {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

.scout-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.ops-chip {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ops-chip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.ops-chip strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8eee9;
  font-size: 18px;
}

.ops-chip.ops-hv strong {
  background: #ffe2b8;
  color: #6b420a;
}

.ops-chip.ops-lift strong {
  background: var(--lift);
  color: var(--lift-ink);
}

.ops-chip.ops-skt strong {
  background: var(--skt);
  color: #5a4400;
}

.hv-date-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.hv-planning-date-strip {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.hv-date-select-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hv-date-select {
  min-height: 36px;
  min-width: min(280px, 100%);
  border: 1px solid rgba(31, 43, 34, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.hv-date-filter {
  min-height: 30px;
  border: 1px solid rgba(31, 43, 34, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: #17231c;
  font-size: 12px;
  font-weight: 850;
}

.hv-date-filter.active {
  outline: 3px solid rgba(8, 127, 131, 0.22);
  border-color: rgba(8, 127, 131, 0.46);
}

.hv-date-filter strong {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

#projectsView .stats-row,
#projectsView.map-focus .scout-summary {
  display: none;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.map-panel,
.detail-panel,
.list-panel,
.review-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-toolbar {
  display: none;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  transition:
    min-height 0.18s ease,
    padding 0.18s ease,
    opacity 0.16s ease;
}

.active-view .map-toolbar {
  display: flex;
}

.map-panel.map-toolbar-hidden .map-toolbar {
  min-height: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.map-quick-toggle {
  position: absolute;
  top: 10px;
  z-index: 6;
  min-width: 84px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(24, 33, 29, 0.28);
  backdrop-filter: blur(10px);
}

.map-quick-toggle .toggle-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.map-quick-toggle .toggle-label {
  white-space: nowrap;
}

.map-toolbar-toggle {
  left: 12px;
  background: #17231c;
  display: none;
}

.map-panel.map-toolbar-hidden .map-toolbar-toggle {
  display: inline-flex;
}

.map-nav-toggle {
  right: 12px;
  background: #087f83;
}

.map-nav-toggle.active {
  background: #17231c;
}

.map-tree-search {
  min-width: 116px;
  min-height: 34px;
  border: 1px solid rgba(25, 33, 28, 0.12);
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.map-tree-search span {
  color: var(--muted);
  font-weight: 950;
}

.map-tree-search input {
  width: 74px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.leaflet-tree-marker.search-hit,
.tree-marker.search-hit {
  animation: treeSearchHit 0.45s ease-in-out 4;
  outline: 4px solid rgba(0, 218, 255, 0.88);
  z-index: 500;
}

@keyframes treeSearchHit {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.segmented {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 8px;
  max-width: 100%;
  overflow-x: auto;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  white-space: nowrap;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(31, 43, 34, 0.12);
}

.map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-hide-button {
  min-height: 34px;
  border: 1px solid rgba(29, 87, 54, 0.16);
  border-radius: 999px;
  background: #17231c;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(24, 33, 29, 0.14);
}

.toolbar-hide-button span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.toolbar-hide-button strong {
  font-size: 12px;
  font-weight: 900;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

.open,
.status-badge.open {
  background: var(--blue);
}

.progress,
.status-badge.progress {
  background: var(--amber);
}

.done,
.status-badge.done {
  background: var(--green);
}

.problem,
.status-badge.problem {
  background: var(--red);
}

.exported,
.status-badge.exported {
  background: var(--exported);
}

.hv {
  background: var(--hv);
}

.lift {
  background: var(--lift);
}

.skt {
  background: var(--skt);
}

.map-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    #dce9d8;
  background-size: 54px 54px;
  overflow: hidden;
}

#projectsView,
#disposalView {
  overflow: hidden;
}

#projectsView .map-layout,
#disposalView .split-layout {
  min-height: 0;
}

#projectsView .map-canvas,
#disposalView .map-canvas {
  min-height: 0;
}

.detail-panel,
.list-panel {
  min-height: 0;
  overflow: auto;
}

.object-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 46px;
  padding: 7px 10px 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: #f3f7f1;
}

.object-tab {
  min-width: 132px;
  max-width: 230px;
  height: 39px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #e8efe5;
  color: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  box-shadow: inset 0 -1px 0 rgba(31, 43, 34, 0.05);
}

.object-tab strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.object-tab span {
  min-width: 25px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}

.object-tab.active {
  height: 43px;
  background: var(--surface);
  color: var(--green-deep);
  border-color: #b7cab6;
  box-shadow: 0 -5px 14px rgba(31, 43, 34, 0.08);
}

.leaflet-tree-map {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  background: #dce9d8;
}

.leaflet-tree-map.active {
  display: block;
}

.leaflet-tree-map.active ~ .river,
.leaflet-tree-map.active ~ .park,
.leaflet-tree-map.active ~ .street,
.leaflet-tree-map.active ~ #treeMarkers,
.leaflet-tree-map.active ~ #treeMapPopup {
  display: none;
}

.leaflet-tree-map .leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  max-height: min(66vh, calc(100dvh - 132px));
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 10px;
  scrollbar-width: thin;
}

.leaflet-tree-marker {
  position: relative;
  min-width: 38px;
  height: 30px;
  padding: 0 7px;
  --marker-method: var(--method-open);
  --marker-status: var(--work-open);
  border: 1px solid rgba(25, 33, 28, 0.3);
  border-radius: 8px;
  color: #17231c;
  background: var(--marker-method);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.22);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.manual-placement-mode #leafletTreeMap {
  cursor: crosshair;
}

.manual-placement-mode #leafletTreeMap::after {
  content: "Baumposition anklicken";
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 650;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #12382e;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(18, 56, 46, 0.22);
  pointer-events: none;
}

.leaflet-tree-marker span {
  position: relative;
  z-index: 2;
  min-width: 22px;
  min-height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: #17231c;
  padding: 0 3px;
}

.leaflet-tree-marker.method-open,
.tree-marker.method-open {
  --marker-method: var(--method-open);
}

.leaflet-tree-marker.lift,
.tree-marker.lift {
  --marker-method: var(--lift);
}

.leaflet-tree-marker.skt,
.tree-marker.skt {
  --marker-method: var(--skt);
}

.leaflet-tree-marker.stump,
.tree-marker.stump {
  --marker-method: var(--stump);
}

.leaflet-tree-marker.tone-open,
.tree-marker.tone-open {
  color: #1b321a;
}

.leaflet-tree-marker.tone-hv-pending,
.tree-marker.tone-hv-pending {
  color: #4e330d;
}

.leaflet-tree-marker.tone-progress,
.tree-marker.tone-progress {
  --marker-status: var(--work-progress);
  background: linear-gradient(135deg, var(--marker-status) 0 50%, var(--marker-method) 50% 100%);
  color: #3f2a06;
}

.leaflet-tree-marker.tone-progress span,
.tree-marker.tone-progress span {
  background: rgba(255, 255, 255, 0.42);
  color: #3f2a06;
}

.leaflet-tree-marker.tone-done,
.tree-marker.tone-done {
  --marker-method: var(--green-strong);
  background: var(--green-strong);
  color: #fff;
}

.leaflet-tree-marker.tone-done span,
.tree-marker.tone-done span {
  background: transparent;
  color: #fff;
}

.leaflet-tree-marker.tone-problem,
.tree-marker.tone-problem {
  --marker-status: #ff5a4f;
  background: linear-gradient(135deg, var(--marker-status) 0 50%, var(--marker-method) 50% 100%);
  color: #17231c;
  outline: 3px solid rgba(188, 71, 63, 0.34);
}

.leaflet-tree-marker.tone-rework,
.tree-marker.tone-rework {
  --marker-method: #113f8c;
  color: #fff;
}

.leaflet-tree-marker.tone-rework span,
.tree-marker.tone-rework span {
  background: transparent;
  color: #fff;
}

.leaflet-tree-marker.tone-exported,
.tree-marker.tone-exported {
  --marker-method: var(--exported);
  color: #fff;
  cursor: not-allowed;
}

.leaflet-tree-marker .tree-badge,
.tree-marker .tree-badge {
  position: absolute;
  right: -13px;
  min-width: 34px;
  height: 17px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(24, 33, 29, 0.18);
}

.leaflet-tree-marker .sofo-badge,
.tree-marker .sofo-badge {
  top: -13px;
  left: -15px;
  right: auto;
  min-width: 38px;
  height: 18px;
  background: #ff2f92;
  color: #fff;
  font-size: 8px;
  transform: rotate(-5deg);
  box-shadow: 0 5px 13px rgba(255, 47, 146, 0.34);
}

.leaflet-tree-marker .hv-badge,
.tree-marker .hv-badge {
  top: -10px;
  color: #17231c;
}

.leaflet-tree-marker .vrao-badge,
.tree-marker .vrao-badge {
  top: auto;
  bottom: -10px;
  min-width: 40px;
  height: 17px;
  background: var(--vrao);
  color: #fff;
  font-size: 8px;
  letter-spacing: 0;
}

.leaflet-tree-marker.has-vrao:not(.has-hv) .vrao-badge,
.tree-marker.has-vrao:not(.has-hv) .vrao-badge {
  top: -10px;
  bottom: auto;
}

.leaflet-tree-marker .idle-badge,
.tree-marker .idle-badge {
  top: 19px;
  left: -13px;
  right: auto;
  min-width: 30px;
  height: 17px;
  background: #ff8a00;
  color: #fff;
  box-shadow: 0 5px 12px rgba(255, 138, 0, 0.35);
}

.leaflet-tree-marker .idle-badge.warning,
.tree-marker .idle-badge.warning {
  animation: idlePulse 0.9s ease-in-out infinite;
}

@keyframes idlePulse {
  0%,
  100% {
    transform: rotate(-3deg) scale(1);
    box-shadow: 0 5px 12px rgba(255, 138, 0, 0.35);
  }
  50% {
    transform: rotate(-3deg) scale(1.13);
    box-shadow: 0 0 0 6px rgba(255, 138, 0, 0.22), 0 7px 18px rgba(255, 138, 0, 0.46);
  }
}

.hv-date-1 {
  background: var(--hv-date-color, #f59e0b);
}

.hv-date-2 {
  background: var(--hv-date-color, #ef6c35);
}

.hv-date-3 {
  background: var(--hv-date-color, #e95678);
}

.hv-date-4 {
  background: var(--hv-date-color, #b46ce3);
}

.hv-date-5 {
  background: var(--hv-date-color, #6074e8);
}

.hv-date-6 {
  background: var(--hv-date-color, #2f9dd8);
}

.hv-date-7 {
  background: var(--hv-date-color, #21a8a0);
}

.hv-date-8 {
  background: var(--hv-date-color, #52b45b);
}

.hv-date-9 {
  background: var(--hv-date-color, #98bd2d);
}

.hv-date-10 {
  background: var(--hv-date-color, #d1a827);
}

.hv-date-11 {
  background: var(--hv-date-color, #cf7c32);
}

.hv-date-12 {
  background: var(--hv-date-color, #8f9a1a);
}

.hv-date-13 {
  background: var(--hv-date-color, #c65c92);
}

.hv-date-14 {
  background: var(--hv-date-color, #7f6ad9);
}

.hv-date-15 {
  background: var(--hv-date-color, #347ec4);
}

.hv-date-16 {
  background: var(--hv-date-color, #2f8d74);
}

.hv-date-17 {
  background: var(--hv-date-color, #6a9f38);
}

.hv-date-18 {
  background: var(--hv-date-color, #b58a22);
}

.hv-date-19 {
  background: var(--hv-date-color, #d45d4d);
}

.hv-date-20 {
  background: var(--hv-date-color, #6f7f24);
}

.hv-date-missing {
  background: var(--hv-date-color, #d6a65a);
}

.leaflet-tree-marker:hover,
.leaflet-tree-marker.selected {
  outline: 3px solid rgba(25, 33, 28, 0.24);
}

.leaflet-popup-card {
  min-width: 230px;
}

.leaflet-popup-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.leaflet-popup-card dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.leaflet-popup-card dt,
.popup-measures span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.leaflet-popup-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.popup-measures {
  margin-top: 8px;
}

.popup-measures ul {
  margin: 5px 0 0;
  padding-left: 17px;
}

.popup-measures li {
  margin: 3px 0;
  line-height: 1.35;
}

.popup-measures li small,
.popup-instruction {
  display: block;
  margin-top: 3px;
  color: #7b4a12;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.popup-instruction {
  border: 1px solid rgba(242, 162, 58, 0.3);
  border-radius: 8px;
  background: #fff7e8;
  padding: 7px 8px;
  white-space: pre-line;
}

.popup-instruction span {
  display: block;
  margin-bottom: 2px;
  color: #9a5a08;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.popup-work-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.popup-work-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: #f8fbf7;
}

.popup-work-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.popup-work-meta strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
}

.popup-idle-evidence {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  border: 1px solid rgba(255, 122, 0, 0.24);
  border-radius: 8px;
  padding: 8px;
  background: #fff8ed;
}

.popup-idle-evidence > strong {
  color: #7b3d00;
  font-size: 12px;
}

.popup-idle-evidence div {
  border-top: 1px solid rgba(255, 122, 0, 0.16);
  padding-top: 6px;
}

.popup-idle-evidence span,
.popup-idle-evidence small {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.popup-idle-evidence span {
  font-weight: 900;
}

.idle-photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 4px;
}

.idle-photo-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 122, 0, 0.2);
  border-radius: 8px;
  background: #fff;
}

.idle-photo-item img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: contain;
  background: #f5f3ec;
}

.idle-photo-item figcaption {
  padding: 3px 5px 4px;
  color: #7b3d00;
  font-size: 10px;
  font-weight: 950;
  text-align: center;
}

.popup-idle-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ff7a00;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
}

.popup-idle-mail.prepared {
  background: #1f7a45;
}

.idle-photo-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.idle-photo-choices .idle-primary-step {
  margin: 0;
  min-height: 62px;
}

.popup-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.popup-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.popup-position-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  border: 1px solid rgba(18, 56, 46, 0.18);
  border-radius: 999px;
  background: #eef5f0;
  color: #12382e;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.popup-position-button:hover {
  background: #dfeee5;
}

.popup-action {
  min-height: 66px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 6px;
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.16);
}

.popup-action span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 15px;
  font-weight: 900;
}

.popup-action strong {
  font-size: 12px;
  line-height: 1.1;
}

.popup-action.active {
  outline: 3px solid rgba(25, 33, 28, 0.24);
}

.popup-action:disabled,
.popup-cutters input:disabled,
.mini-segmented button:disabled,
.problem-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.popup-lock {
  margin-top: 9px;
  min-height: 28px;
  border-radius: 8px;
  background: var(--exported);
  color: #fff;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.popup-scouting {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  border: 1px solid rgba(25, 33, 28, 0.1);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 9px;
  box-shadow: none;
}

.popup-scouting-toggle {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: #eef3ee;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-align: center;
}

.popup-scouting-toggle strong {
  font-size: 14px;
  font-weight: 900;
}

.popup-scouting-fields {
  display: none;
  gap: 7px;
}

.popup-scouting-fields.scout-expanded {
  display: grid;
}

.popup-scout-section {
  display: grid;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.popup-scout-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.popup-scout-grid,
.popup-scout-row {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 4px;
}

.popup-scout-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.popup-scout-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popup-scout-grid button,
.popup-scout-row button {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 6px 5px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}

.popup-scout-grid button {
  display: grid;
  place-items: center;
}

.popup-scout-grid button.lift {
  background: var(--lift);
  color: #00343a;
}

.popup-scout-grid button.skt {
  background: var(--skt);
  color: #313400;
}

.popup-scout-grid button.stump {
  background: var(--stump);
  color: #2f2a68;
}

.popup-scout-grid button.active,
.popup-scout-row button.active {
  color: var(--ink);
}

.popup-scout-grid button.lift.active {
  background: var(--lift);
  color: #04343b;
  box-shadow: inset 0 0 0 2px rgba(0, 52, 58, 0.32);
}

.popup-scout-grid button.skt.active {
  background: var(--skt);
  color: #343600;
  box-shadow: inset 0 0 0 2px rgba(49, 52, 0, 0.3);
}

.popup-scout-grid button.stump.active {
  background: var(--stump);
  color: #2f2a68;
  box-shadow: inset 0 0 0 2px rgba(93, 24, 52, 0.3);
}

.popup-scout-grid button.active {
  outline: 0;
}

.popup-scout-row button.hv.active {
  background: var(--hv);
  color: #4e330d;
  box-shadow: inset 0 0 0 2px rgba(78, 51, 13, 0.22);
}

.popup-scout-row button.vrao.active {
  background: var(--vrao);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.popup-scout-row button.hv-vrao.active {
  background: linear-gradient(135deg, var(--hv) 0 50%, var(--vrao) 50% 100%);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.popup-scout-note {
  display: grid;
  gap: 8px;
}

.scout-photo-choice {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.popup-scout-note textarea {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  resize: vertical;
  padding: 9px;
  background: rgba(255, 255, 255, 0.86);
}

.scout-general-note {
  background: #f1f8f7;
  border-color: rgba(8, 127, 131, 0.24);
}

.popup-wizard {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}

.popup-wizard p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.popup-wizard small {
  color: var(--muted);
  font-size: 12px;
}

.popup-wizard textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  color: var(--ink);
}

.popup-next,
.popup-photo-choice {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.popup-next.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.popup-reset {
  min-height: 36px;
  border: 1px solid rgba(188, 71, 63, 0.24);
  border-radius: 8px;
  background: #fff8f7;
  color: #833028;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.popup-photo-choice {
  position: relative;
  overflow: hidden;
}

.popup-photo-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.popup-step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.popup-step-actions > .popup-next:only-child {
  grid-column: 1 / -1;
}

.idle-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.idle-photo-button.disabled {
  opacity: 0.5;
}

.photo-choice-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-choice-pair.compact {
  gap: 6px;
}

.photo-choice-pair.compact .popup-photo-choice {
  min-height: 42px;
  font-size: 12px;
}

.idle-phase-column {
  display: grid;
  gap: 6px;
}

.idle-phase-column > strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.idle-phase-column.disabled {
  opacity: 0.55;
}

.tree-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 7px;
}

.tree-photo-item {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.tree-photo-item img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: contain;
}

/* Final, scoped scouting cleanup. Keep this after generic popup rules so the
   shared popup button styles cannot recolor the scouting panel. */
.leaflet-popup-card .popup-scouting,
.tree-map-popup .popup-scouting {
  border: 1px solid rgba(25, 33, 28, 0.1);
  background: #fbfcfb;
  box-shadow: none;
}

.leaflet-popup-card .popup-scouting-toggle,
.tree-map-popup .popup-scouting-toggle {
  background: #eef3ee;
  color: var(--green-dark);
}

.leaflet-popup-card .popup-scout-grid,
.leaflet-popup-card .popup-scout-row,
.tree-map-popup .popup-scout-grid,
.tree-map-popup .popup-scout-row {
  background: #fff;
}

.leaflet-popup-card .popup-scout-grid button,
.leaflet-popup-card .popup-scout-row button,
.tree-map-popup .popup-scout-grid button,
.tree-map-popup .popup-scout-row button {
  background: transparent;
  color: #24302a;
}

.leaflet-popup-card .popup-scout-grid button.lift,
.tree-map-popup .popup-scout-grid button.lift {
  background: var(--lift);
  color: #00343a;
}

.leaflet-popup-card .popup-scout-grid button.skt,
.tree-map-popup .popup-scout-grid button.skt {
  background: var(--skt);
  color: #313400;
}

.leaflet-popup-card .popup-scout-grid button.stump,
.tree-map-popup .popup-scout-grid button.stump {
  background: var(--stump);
  color: #2f2a68;
}

.leaflet-popup-card .popup-scout-grid button.active,
.leaflet-popup-card .popup-scout-row button.active,
.tree-map-popup .popup-scout-grid button.active,
.tree-map-popup .popup-scout-row button.active {
  background: #fff;
}

.leaflet-popup-card .popup-scout-grid button.lift.active,
.tree-map-popup .popup-scout-grid button.lift.active {
  background: var(--lift);
  box-shadow: inset 0 0 0 2px rgba(0, 52, 58, 0.32);
}

.leaflet-popup-card .popup-scout-grid button.skt.active,
.tree-map-popup .popup-scout-grid button.skt.active {
  background: var(--skt);
  box-shadow: inset 0 0 0 2px rgba(49, 52, 0, 0.3);
}

.leaflet-popup-card .popup-scout-grid button.stump.active,
.tree-map-popup .popup-scout-grid button.stump.active {
  background: var(--stump);
  box-shadow: inset 0 0 0 2px rgba(93, 24, 52, 0.3);
}

.leaflet-popup-card .popup-scout-row button.hv.active,
.tree-map-popup .popup-scout-row button.hv.active {
  background: var(--hv);
  color: #4e330d;
  box-shadow: inset 0 0 0 2px rgba(78, 51, 13, 0.22);
}

.leaflet-popup-card .popup-scout-row button.vrao.active,
.tree-map-popup .popup-scout-row button.vrao.active {
  background: var(--vrao);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.leaflet-popup-card .popup-scout-row button.hv-vrao.active,
.tree-map-popup .popup-scout-row button.hv-vrao.active {
  background: linear-gradient(135deg, var(--hv) 0 50%, var(--vrao) 50% 100%);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.leaflet-popup-card .scout-photo-choice,
.tree-map-popup .scout-photo-choice {
  background: #fff;
  color: var(--ink);
}

.leaflet-popup-card .popup-scout-note textarea,
.tree-map-popup .popup-scout-note textarea {
  background: #fff;
}

.action-progress {
  background: var(--amber);
}

.action-done {
  background: var(--green);
}

.action-problem {
  background: var(--red);
}

.action-idle {
  background: #ff7a00;
  color: #fff;
}

.idle-primary-step {
  width: 100%;
  min-height: 58px;
  border: 0;
  margin-top: 4px;
  cursor: pointer;
}

.idle-single-choice {
  margin-top: 8px;
}

.idle-primary-step input {
  display: none;
}

.idle-stamp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.idle-stamp-grid div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fffaf3;
}

.idle-stamp-grid div.complete {
  border-color: rgba(255, 122, 0, 0.45);
  background: #fff0dc;
}

.idle-stamp-grid span,
.idle-stamp-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.idle-stamp-grid strong {
  display: block;
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.2;
}

.idle-live-total {
  margin: 0;
  min-height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff0dc;
  color: #7b3d00;
  font-size: 13px;
  font-weight: 900;
}

.idle-live-total.warning {
  background: #ff8a00;
  color: #fff;
  animation: idlePanelPulse 1.1s ease-in-out infinite;
}

@keyframes idlePanelPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 138, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 138, 0, 0.16);
  }
}

.popup-cutters {
  margin-top: 9px;
  display: grid;
  gap: 5px;
}

.popup-cutters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.popup-cutters input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.map-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.7), transparent 11%),
    radial-gradient(circle at 80% 72%, rgba(255, 255, 255, 0.56), transparent 13%);
  pointer-events: none;
}

.river {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 57%;
  height: 78px;
  transform: rotate(-7deg);
  background: #97c2cf;
  opacity: 0.85;
  border-top: 10px solid rgba(255, 255, 255, 0.42);
  border-bottom: 10px solid rgba(255, 255, 255, 0.35);
}

.park {
  position: absolute;
  border-radius: 8px;
  background: rgba(84, 145, 84, 0.34);
  border: 1px solid rgba(45, 122, 75, 0.28);
}

.park-one {
  left: 7%;
  top: 11%;
  width: 18%;
  height: 26%;
}

.park-two {
  right: 9%;
  top: 15%;
  width: 23%;
  height: 21%;
}

.street {
  position: absolute;
  display: flex;
  align-items: center;
  color: rgba(25, 33, 28, 0.62);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.street.horizontal {
  left: -3%;
  right: -3%;
  height: 38px;
  padding-left: 8%;
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(75, 83, 77, 0.1);
  border-bottom: 1px solid rgba(75, 83, 77, 0.1);
}

.street.horizontal.one {
  top: 18%;
  transform: rotate(-2deg);
}

.street.horizontal.two {
  top: 39%;
  transform: rotate(4deg);
}

.street.horizontal.three {
  top: 75%;
  transform: rotate(-4deg);
}

.street.vertical {
  top: -4%;
  bottom: -4%;
  width: 38px;
  justify-content: center;
  writing-mode: vertical-rl;
  background: rgba(255, 255, 255, 0.74);
  border-left: 1px solid rgba(75, 83, 77, 0.1);
  border-right: 1px solid rgba(75, 83, 77, 0.1);
}

.street.vertical.one {
  left: 34%;
  transform: rotate(4deg);
}

.street.vertical.two {
  left: 68%;
  transform: rotate(-3deg);
}

.marker {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  min-width: 38px;
  height: 30px;
  padding: 0 7px;
  --marker-method: var(--method-open);
  --marker-status: var(--work-open);
  border: 1px solid rgba(25, 33, 28, 0.3);
  border-radius: 8px;
  background: var(--marker-method);
  color: #17231c;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.22);
  display: grid;
  place-items: center;
}

.tree-marker {
  overflow: visible;
}

.tree-marker span {
  position: relative;
  z-index: 2;
  min-width: 22px;
  min-height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: #17231c;
  padding: 0 3px;
}

.marker:hover,
.marker.selected {
  outline: 3px solid rgba(25, 33, 28, 0.24);
  z-index: 6;
}

.tree-map-popup {
  position: absolute;
  z-index: 8;
  width: min(320px, calc(100% - 20px));
  max-height: min(calc(100% - 20px), calc(100dvh - 116px));
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, 0);
  border: 1px solid rgba(25, 33, 28, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(24, 33, 29, 0.18);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  scrollbar-width: thin;
}

.tree-map-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 8px);
}

.tree-map-popup::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 1px solid rgba(25, 33, 28, 0.14);
  border-top: 1px solid rgba(25, 33, 28, 0.14);
  background: rgba(255, 255, 255, 0.96);
}

.popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.popup-head strong {
  font-size: 16px;
}

.method-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 9px;
  color: #17231c;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.method-pill.lift {
  border-color: rgba(0, 200, 215, 0.72);
  background: var(--lift);
  color: #00343a;
}

.method-pill.skt {
  border-color: rgba(210, 220, 0, 0.72);
  background: var(--skt);
  color: #313400;
}

.method-pill.stump {
  border-color: rgba(255, 112, 177, 0.64);
  background: var(--stump);
  color: #2f2a68;
}

.method-pill.method-open {
  border-color: var(--line);
  background: #fff;
  color: #17231c;
}

.tree-map-popup dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.tree-map-popup dl div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
}

.tree-map-popup dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tree-map-popup dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.popup-hv {
  margin-top: 9px;
  min-height: 28px;
  border-radius: 8px;
  color: #6b420a;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.disposal-marker {
  min-width: 58px;
  min-height: 48px;
  padding: 5px 8px 7px;
  color: #17231c;
  border: 2px solid rgba(25, 33, 28, 0.18);
  border-radius: 9px 9px 9px 3px;
}

.leaflet-disposal-marker {
  position: relative;
  transform: none;
  min-width: 58px;
  min-height: 48px;
  border-radius: 9px 9px 9px 3px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(24, 33, 29, 0.26);
}

.disposal-number {
  position: absolute;
  left: -18px;
  top: -10px;
  min-width: 44px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #17231c;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(24, 33, 29, 0.22);
}

.disposal-map-date {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  min-width: 42px;
  height: 18px;
  border-radius: 999px;
  background: rgba(23, 35, 28, 0.92);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(24, 33, 29, 0.16);
}

.disposal-marker.astwerk {
  background: #b9f36a;
}

.disposal-marker.stammholz {
  background: #ffd84a;
}

.disposal-marker.gemischt {
  background: linear-gradient(135deg, #b9f36a 0 50%, #ffd84a 50% 100%);
}

.disposal-marker.done {
  background: #d9ded8;
  border-color: rgba(84, 94, 87, 0.48);
  box-shadow: 0 7px 17px rgba(24, 33, 29, 0.18);
  filter: grayscale(0.75);
  opacity: 0.76;
}

.disposal-material-code {
  min-width: 34px;
  min-height: 25px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  color: #17231c;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(25, 33, 28, 0.12);
}

.disposal-material-code.large {
  min-width: 50px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 14px;
}

.gemischt .disposal-material-code {
  min-width: 45px;
  font-size: 11px;
}

.done .disposal-material-code {
  background: rgba(255, 255, 255, 0.58);
  color: #5f6962;
}

.depot {
  position: absolute;
  right: 8%;
  top: 8%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #17231c;
  color: #fff;
  font-weight: 800;
  z-index: 4;
}

#disposalView .depot {
  display: none;
}

.detail-panel,
.list-panel,
.review-panel {
  padding: 18px;
}

.detail-panel {
  min-height: 620px;
  display: flex;
  flex-direction: column;
}

.detail-empty {
  color: var(--muted);
  margin: auto;
  text-align: center;
  max-width: 240px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.detail-title h3 {
  font-size: 24px;
}

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill {
  background: #e7ede8;
  color: var(--ink);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.field,
.note-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.field strong {
  font-size: 15px;
}

.compact-detail-grid {
  grid-template-columns: 1fr;
}

.field-warning {
  border-color: rgba(242, 162, 58, 0.5);
  background: #fff4df;
}

.compact-note p {
  display: grid;
  gap: 6px;
}

.compact-helper {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  padding: 10px;
}

.note-box {
  margin: 12px 0;
}

.note-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.note-box p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.prep-panel {
  border: 1px solid #d7c091;
  border-radius: 8px;
  padding: 12px;
  background: #fff8ea;
  margin: 12px 0;
}

.prep-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.prep-title span {
  color: #79530f;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.prep-title strong {
  font-size: 15px;
}

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

.prep-item {
  border: 1px solid rgba(121, 83, 15, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.prep-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 3px;
}

.prep-item strong {
  font-size: 13px;
}

.prep-item.needs-attention {
  border-color: rgba(185, 120, 24, 0.5);
  background: #fff0d4;
}

.prep-panel p {
  margin: 10px 0 0;
  line-height: 1.42;
}

.status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.status-actions button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.status-actions button:hover {
  border-color: #8ba293;
}

.feedback-box {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.feedback-box textarea {
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.photo-drop {
  min-height: 76px;
  border: 1px dashed #9aaba0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  padding: 10px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin-top: 3px;
  font-size: 22px;
}

.hv-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.hv-title-row h3 {
  margin: 3px 0 0;
}

.hv-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hv-info-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid rgba(31, 43, 34, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  padding: 0;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.hv-info-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(720px, calc(100vw - 32px));
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(31, 43, 34, 0.16);
  padding: 10px;
}

.hv-info-popover.hv-summary-strip {
  margin-bottom: 0;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.hv-info-wrap:hover .hv-info-popover,
.hv-info-wrap:focus-within .hv-info-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.documents-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.documents-main-panel {
  order: 1;
}

.documents-side-panel {
  order: 2;
}

.documents-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.document-folder-input {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.document-folder-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.document-folder-input input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.document-folder-input.compact {
  min-width: 0;
}

.document-folder-input.compact input {
  min-height: 34px;
}

.document-folder-path {
  min-height: 36px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(25, 33, 28, 0.08);
}

.document-folder-path button {
  min-height: 30px;
  border: 1px solid rgba(25, 33, 28, 0.1);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.document-folder-path button:hover {
  border-color: rgba(45, 122, 75, 0.34);
  background: #eef7ef;
}

.document-folder-path span {
  color: var(--muted);
  font-weight: 850;
}

.document-folder-tools {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 0 12px;
  border: 1px solid var(--line);
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.document-folder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.document-folder-card {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  text-align: left;
  box-shadow: none;
}

.document-folder-card:hover,
.document-folder-card.active {
  border-color: rgba(45, 122, 75, 0.2);
  background: #eef7ef;
}

.document-file-name-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.document-file-name-button:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.document-folder-card.active {
  box-shadow: inset 3px 0 0 var(--green);
}

.folder-shape {
  position: relative;
  width: 30px;
  height: 22px;
  border-radius: 5px;
  background: #dfe9df;
  box-shadow: inset 0 -6px 0 rgba(25, 33, 28, 0.05);
}

.folder-shape::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -5px;
  width: 15px;
  height: 9px;
  border-radius: 5px 5px 0 0;
  background: inherit;
}

.document-folder-card.orange .folder-shape {
  background: #ffd08a;
}

.document-folder-card.green .folder-shape {
  background: #a8e6b2;
}

.document-folder-card.red .folder-shape {
  background: #ffbbb8;
}

.document-folder-card.blue .folder-shape {
  background: #b8dcff;
}

.document-folder-card.teal .folder-shape {
  background: #9cebdc;
}

.document-folder-card.violet .folder-shape {
  background: #d3c8ff;
}

.folder-copy {
  min-width: 0;
}

.folder-copy strong,
.folder-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-copy strong {
  font-size: 14px;
  font-weight: 900;
}

.folder-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.folder-count {
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(25, 33, 28, 0.06);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 950;
  font-size: 12px;
}

.document-drop-zone {
  min-height: 76px;
  border: 1px dashed rgba(45, 122, 75, 0.34);
  border-radius: 8px;
  background: #f7fbf7;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
}

.document-drop-zone.drag-active {
  border-color: var(--green);
  background: #e8f6eb;
  box-shadow: inset 0 0 0 2px rgba(45, 122, 75, 0.14);
}

.document-drop-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.document-drop-zone strong {
  font-size: 16px;
  align-self: end;
}

.document-drop-zone small {
  grid-column: 2;
  align-self: start;
  color: var(--muted);
  line-height: 1.3;
}

.document-drop-zone .ghost-button {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.document-file-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.document-file-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 104px 86px 34px;
  align-items: center;
  gap: 8px;
  padding: 0 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.document-file-head span:first-child {
  grid-column: 2;
}

.document-file-row {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 104px 86px 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.document-file-row:hover {
  border-color: rgba(45, 122, 75, 0.18);
  background: #f8fbf8;
}

.document-file-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e8eee9;
  color: #17231c;
  font-size: 11px;
  font-weight: 950;
}

.document-file-icon.large {
  width: 62px;
  height: 62px;
  font-size: 15px;
}

.document-file-main {
  min-width: 0;
}

.document-file-main,
.document-file-date,
.document-file-size {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-file-main {
  font-size: 13px;
}

.document-file-date,
.document-file-size,
.document-file-main small,
.document-empty small {
  color: var(--muted);
  font-size: 12px;
}

.document-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  display: grid;
  gap: 4px;
}

.document-empty.folder-empty {
  grid-column: 1 / -1;
  min-height: 96px;
  align-content: center;
}

.document-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 22px;
  background: rgba(15, 24, 18, 0.64);
}

.document-preview-overlay.visible {
  display: grid;
  place-items: center;
}

.document-preview-card {
  width: min(1040px, 100%);
  height: min(760px, calc(100dvh - 44px));
  border-radius: 10px;
  background: #f7faf7;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.document-preview-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.document-preview-head h3,
.document-preview-head p {
  margin: 0;
}

.document-preview-head small {
  color: var(--muted);
}

.document-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.document-preview-back span:first-child {
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.document-open-link {
  text-decoration: none;
}

.document-preview-body {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.document-preview-body iframe,
.document-preview-body img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.document-pdf-render {
  width: 100%;
  min-height: 100%;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 14px;
}

.document-pdf-status {
  justify-self: start;
  border-radius: 999px;
  background: #e8eee9;
  color: var(--ink);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.document-pdf-page {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.document-pdf-page canvas {
  max-width: 100%;
  height: auto !important;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(31, 43, 34, 0.12);
}

.document-pdf-page-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.document-preview-placeholder {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.document-preview-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ghost-button.danger {
  border-color: rgba(229, 37, 32, 0.24);
  color: #b42318;
  background: #fff7f6;
}

.ghost-button.danger:hover {
  border-color: rgba(229, 37, 32, 0.45);
  background: #ffe8e6;
}

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.project-archive-panel {
  display: grid;
  gap: 12px;
}

.archive-card {
  border: 1px solid rgba(21, 94, 57, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfffb 0%, #f2f8f3 100%);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.archive-card.exported {
  border-color: rgba(34, 139, 76, 0.28);
  background: #f0f8f2;
}

.archive-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #17351f;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.archive-status strong,
.archive-status small {
  display: block;
}

.archive-status small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.archive-checks {
  display: grid;
  gap: 8px;
}

.archive-checks .check-item {
  padding: 9px 10px;
}

.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.archive-actions button {
  min-height: 42px;
}

.archive-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.work-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
  display: grid;
  gap: 9px;
}

.work-item-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.work-item strong {
  display: block;
  font-size: 15px;
}

.work-item small {
  color: var(--muted);
}

.office-project-filter {
  min-width: min(280px, 100%);
  display: grid;
  gap: 4px;
}

.office-project-filter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.office-project-filter select {
  min-height: 34px;
  border: 1px solid rgba(31, 43, 34, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.office-review-summary {
  min-height: 42px;
  border: 1px solid rgba(21, 94, 57, 0.16);
  border-radius: 8px;
  background: #f7fbf7;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.office-review-summary strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.office-work-item {
  padding: 8px 10px;
  gap: 6px;
}

.office-work-item .work-item-header {
  align-items: center;
}

.office-work-item strong {
  font-size: 14px;
}

.office-work-item small {
  font-size: 12px;
}

.office-tags {
  gap: 4px;
}

.office-tags .tag {
  min-height: 21px;
  padding: 0 7px;
  font-size: 11px;
}

.office-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3px 10px;
}

.disposal-work-item .work-item-header {
  align-items: center;
}

.disposal-list-actions {
  display: flex;
  justify-content: flex-start;
}

.disposal-district-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.district-chip {
  min-height: 34px;
  border: 1px solid rgba(25, 33, 28, 0.12);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  text-align: center;
}

.district-chip:hover {
  border-color: rgba(45, 122, 75, 0.32);
  background: #eef7ef;
}

.district-chip.active {
  border-color: rgba(45, 122, 75, 0.55);
  background: #dff3e4;
  box-shadow: inset 0 0 0 1px rgba(45, 122, 75, 0.16);
}

.district-chip strong {
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.district-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.disposal-compact-list {
  display: grid;
  gap: 5px;
}

.disposal-row {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(25, 33, 28, 0.1);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  text-align: left;
}

.disposal-row.selected {
  outline: 3px solid rgba(8, 127, 131, 0.22);
  border-color: rgba(8, 127, 131, 0.42);
}

.disposal-row.done {
  background: #eef1ef;
  color: #4f5b54;
}

.disposal-row.astwerk:not(.done) {
  background: linear-gradient(90deg, rgba(185, 243, 106, 0.36), #fff 34%);
}

.disposal-row.stammholz:not(.done) {
  background: linear-gradient(90deg, rgba(255, 216, 74, 0.42), #fff 34%);
}

.disposal-row.gemischt:not(.done) {
  background: linear-gradient(90deg, rgba(185, 243, 106, 0.42) 0 18%, rgba(255, 216, 74, 0.42) 18% 36%, #fff 36%);
}

.disposal-row-main {
  min-width: 0;
}

.disposal-row-main strong,
.disposal-row-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disposal-row-main strong {
  font-size: 12px;
  font-weight: 900;
}

.disposal-row-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ghost-button.compact,
.primary-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  text-decoration: none;
}

.disposal-map-popup {
  position: absolute;
  z-index: 9;
  width: min(340px, calc(100% - 20px));
  max-height: min(calc(100% - 20px), calc(100dvh - 116px));
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  scrollbar-width: thin;
}

.popup-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(25, 33, 28, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.disposal-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.disposal-map-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 8px);
}

.disposal-map-popup.guided-flow {
  width: min(360px, calc(100% - 24px));
}

.disposal-popup-card {
  position: relative;
  border: 1px solid rgba(25, 33, 28, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 34px rgba(24, 33, 29, 0.18);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 0;
}

.disposal-popup-card.astwerk {
  border-top: 5px solid #8fdf43;
}

.disposal-popup-card.stammholz {
  border-top: 5px solid #ffd84a;
}

.disposal-popup-card.gemischt {
  border-top: 5px solid #cbe94f;
}

.disposal-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 34px;
}

.disposal-popup-number,
.disposal-row-number {
  min-width: 54px;
  height: 26px;
  padding: 0 7px;
  justify-self: start;
  border-radius: 999px;
  background: #17231c;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  line-height: 1;
}

.disposal-popup-head strong {
  display: block;
  font-size: 15px;
}

.disposal-popup-head small,
.disposal-popup-card p {
  color: var(--muted);
}

.disposal-popup-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.disposal-popup-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.disposal-popup-card dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.disposal-popup-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.disposal-popup-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.disposal-wizard {
  margin-top: 0;
}

.disposal-action-grid,
.disposal-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.disposal-choice-grid {
  grid-template-columns: 1fr 1fr;
}

.disposal-action,
.disposal-choice {
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 8px;
  color: #17231c;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.14);
}

.disposal-action span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.disposal-action strong,
.disposal-choice strong {
  font-size: 12px;
  line-height: 1.1;
}

.disposal-action.done {
  background: var(--green-strong);
  color: #fff;
}

.disposal-action.progress {
  background: var(--work-progress);
  color: #3f2a06;
}

.disposal-action.problem {
  background: var(--red);
  color: #fff;
}

.disposal-action.note {
  background: #eef7ef;
  color: #254330;
  border: 1px solid rgba(37, 67, 48, 0.16);
}

.disposal-choice.astwerk {
  background: #b9f36a;
}

.disposal-choice.stammholz {
  background: #ffd84a;
}

.disposal-choice.gemischt {
  background: linear-gradient(135deg, #b9f36a 0 50%, #ffd84a 50% 100%);
}

.disposal-meta-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.disposal-comment-preview {
  border-left: 3px solid rgba(42, 124, 64, 0.32);
  padding-left: 9px;
  color: #254330;
}

.disposal-location-warning {
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 8px;
  background: #fff0f0;
  color: #9f1d1d;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.maps-link-field {
  display: grid;
  gap: 5px;
}

.maps-link-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.maps-link-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.disposal-popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.disposal-popup-actions .ghost-button.danger {
  grid-column: 1 / -1;
  min-height: 40px;
}

.disposal-meta-grid {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 8px;
}

.disposal-wizard .popup-step-actions,
.disposal-popup-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  padding-top: 8px;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.98) 22%);
}

.measure-list {
  display: grid;
  gap: 8px;
}

.measure-export-actions,
.measure-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.office-transfer-actions {
  margin-left: 0;
}

.transfer-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px 0 7px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(31, 43, 34, 0.1);
}

.transfer-button.compact {
  min-height: 34px;
  padding-right: 10px;
}

.transfer-button.export {
  border-color: rgba(19, 97, 55, 0.2);
  background: linear-gradient(180deg, #257348, #174c32);
}

.transfer-button.import {
  border-color: rgba(27, 96, 150, 0.2);
  background: linear-gradient(180deg, #2d83c0, #1f5f8f);
}

.transfer-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 43, 34, 0.16);
}

.transfer-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.import-selected-file {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(27, 96, 150, 0.18);
  border-radius: 8px;
  background: #eef8ff;
  padding: 10px 12px;
  color: var(--ink);
}

.import-selected-file .transfer-icon {
  background: #1f5f8f;
  color: #fff;
}

.import-selected-file strong {
  display: block;
  font-size: 13px;
}

.import-selected-file small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

#measuresView .panel-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

#measuresView .panel-header > div:first-child {
  min-width: 190px;
}

.measure-street-nav {
  position: static;
  z-index: 24;
  margin: 0 -10px 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(31, 43, 34, 0.08);
}

.measure-project-info {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(25, 33, 28, 0.1);
  border-radius: 8px;
  background: #f7fbf6;
  padding: 9px;
}

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

.measure-project-info label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.measure-project-info span,
.object-note-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.measure-project-info input,
.measure-project-info textarea,
.object-note-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(25, 33, 28, 0.14);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.measure-project-info textarea {
  min-height: 54px;
  resize: vertical;
}

.measure-project-info.readonly input,
.measure-project-info.readonly textarea,
.object-note-field input[readonly] {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
}

.object-note-field {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.object-info-dot {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  border-radius: 999px;
  background: #12382e;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}

.measure-street-nav-inner {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

.measure-filter-bar {
  display: flex;
  gap: 6px;
  align-items: end;
  flex-wrap: wrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(216, 223, 217, 0.8);
}

.measure-filter-select {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.measure-filter-select span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.measure-filter-select select {
  min-height: 32px;
  border: 1px solid rgba(25, 33, 28, 0.16);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 28px 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.measure-filter-reset {
  min-height: 32px;
}

.measure-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 42;
  width: 48px;
  height: 48px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 12px 26px rgba(31, 43, 34, 0.24);
  cursor: pointer;
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.active-view .measure-top-button {
  display: grid;
}

.measure-top-button:hover {
  transform: translateY(-1px);
  background: #123b25;
}

.additional-tree-panel {
  margin-bottom: 8px;
  border: 1px solid rgba(29, 87, 54, 0.16);
  border-radius: 8px;
  background: #f8fbf8;
  overflow: hidden;
}

.additional-tree-panel summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.additional-tree-panel summary strong {
  color: var(--green-dark);
  font-size: 11px;
}

.additional-tree-grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.65fr) minmax(160px, 1.15fr) minmax(130px, 0.9fr) minmax(86px, 0.58fr) minmax(210px, 1.5fr) minmax(160px, 1fr) auto;
  gap: 8px;
  padding: 0 10px 10px;
  align-items: end;
}

.additional-tree-grid label {
  display: grid;
  gap: 4px;
}

.additional-tree-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.additional-tree-grid input,
.additional-tree-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(25, 33, 28, 0.16);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.additional-tree-grid .primary-action {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 12px;
}

.measure-filter-chip {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  white-space: nowrap;
}

.measure-filter-chip span {
  font-size: 11px;
  font-weight: 850;
}

.measure-filter-chip strong {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8eee9;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.measure-filter-chip.active {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.measure-filter-chip.active strong {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.measure-filter-chip.filter-done.active {
  border-color: #1f9a4b;
  background: #1f9a4b;
}

.measure-filter-chip.filter-problem.active {
  border-color: var(--red);
  background: var(--red);
}

.measure-filter-chip.filter-hv.active {
  border-color: var(--hv);
  background: var(--hv);
  color: #412b0a;
}

.measure-filter-chip.filter-hv.active strong {
  background: rgba(255, 255, 255, 0.34);
  color: #412b0a;
}

.measure-filter-chip.filter-vrao.active {
  border-color: var(--vrao);
  background: var(--vrao);
}

.measure-filter-chip.filter-idle-open.active {
  border-color: #ff8a00;
  background: #ff8a00;
  color: #fff;
}

.measure-street-link {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf7;
  color: var(--ink);
  padding: 0 9px;
  text-decoration: none;
  white-space: nowrap;
}

.measure-street-link:hover {
  border-color: rgba(29, 87, 54, 0.3);
  background: #edf6ef;
}

.measure-street-link.active {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.measure-street-link.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.measure-street-link strong {
  font-size: 11px;
  font-weight: 850;
}

.measure-street-link span {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e1ebe3;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
}

.measure-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
  scroll-margin-top: 142px;
}

.measure-group-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  background: #eef3ee;
  border-bottom: 1px solid var(--line);
}

.measure-group-header strong {
  display: block;
  font-size: 13px;
}

.measure-group-header small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.measure-head,
.measure-row {
  display: grid;
  grid-template-columns: 52px minmax(132px, 0.72fr) minmax(160px, 0.98fr) minmax(112px, 0.58fr) minmax(88px, 0.42fr) minmax(148px, 0.72fr) minmax(138px, 0.74fr) minmax(190px, 0.9fr);
  gap: 5px;
  align-items: center;
}

.measure-head {
  padding: 5px 7px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  background: #f8faf8;
}

.measure-row {
  border-top: 1px solid rgba(31, 43, 34, 0.12);
  padding: 4px 7px;
  position: relative;
  min-height: 34px;
}

.measure-row + .measure-row {
  border-top: 1px solid #e2e8e3;
}

.measure-row.status-open {
  background: #fff;
}

.measure-row.scouted-lift {
  background: rgba(0, 245, 255, 0.22);
}

.measure-row.scouted-skt {
  background: rgba(247, 255, 0, 0.28);
}

.measure-row.scouted-stump {
  background: rgba(185, 183, 255, 0.24);
}

.measure-row.has-hv {
  background: rgba(245, 158, 11, 0.3);
}

.measure-row.status-progress {
  background: #ffe9a8;
}

.measure-row.status-done {
  background: #8dde9d;
}

.measure-row.status-problem {
  background: #ffc9c5;
}

.measure-row.status-rework {
  background: #123f8c;
  color: #fff;
}

.measure-row.status-rework small,
.measure-row.status-rework .measure-muted-dash {
  color: rgba(255, 255, 255, 0.76);
}

.measure-row.status-rework .measure-comment-field input,
.measure-row.status-rework .measure-comment-field textarea {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.94);
}

.measure-row.status-exported {
  background: #cdd8d1;
}

.measure-row.has-hv:not(.status-done):not(.status-problem):not(.status-progress):not(.status-exported):not(.status-rework) {
  background: rgba(245, 158, 11, 0.3);
}

.measure-row.has-open-idle:not(.status-rework) {
  box-shadow: inset 0 0 0 2px rgba(255, 138, 0, 0.28);
}

.measure-row.has-open-idle.idle-warning:not(.status-rework) {
  box-shadow: inset 0 0 0 3px rgba(255, 138, 0, 0.55);
}

.measure-row.red-export:not(.status-rework) {
  color: #b42318;
}

.measure-row.red-export:not(.status-rework) small,
.measure-row.red-export:not(.status-rework) .measure-muted-dash {
  color: rgba(180, 35, 24, 0.78);
}

.measure-row.red-export:not(.status-rework)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #e11d48;
}

.measure-row.red-export:not(.status-rework) input,
.measure-row.red-export:not(.status-rework) textarea,
.measure-row.red-export:not(.status-rework) select {
  color: var(--ink);
}

.measure-tree-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.measure-tree-cell small,
.measure-masterdata small {
  display: inline;
  white-space: nowrap;
}

.measure-tree-title strong,
.measure-masterdata strong,
.measure-task strong {
  display: inline;
  font-size: 12px;
  line-height: 1.2;
}

.measure-masterdata {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-masterdata strong::after {
  content: " · ";
  color: var(--muted);
}

.measure-task-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
}

.measure-lines {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.measure-line-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
  min-width: 0;
}

.measure-line-item em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.measure-line-item strong,
.measure-lines > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-quick-actions {
  display: inline-flex;
  gap: 3px;
  opacity: 0.42;
}

.measure-row:hover .measure-quick-actions,
.measure-task.changed .measure-quick-actions {
  opacity: 1;
}

.measure-icon-button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 43, 34, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 0;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.measure-icon-button:hover {
  border-color: rgba(29, 87, 54, 0.25);
  background: #fff;
  color: var(--green-dark);
}

.measure-icon-button.reset-measure {
  color: #b42318;
}

.measure-instruction,
.detail-instruction {
  color: #7b4a12;
  font-weight: 850;
}

.measure-instruction {
  display: block;
  margin-top: 3px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  text-overflow: ellipsis;
  line-height: 1.25;
  white-space: nowrap;
  cursor: help;
}

.measure-instruction span {
  display: inline-block;
  margin-right: 5px;
  color: #9a5a08;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.measure-instruction:hover,
.measure-instruction:focus {
  outline: none;
  overflow: visible;
  white-space: normal;
  z-index: 30;
}

.measure-instruction:hover::after,
.measure-instruction:focus::after {
  content: attr(data-full-note);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 60;
  width: min(440px, 72vw);
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(154, 90, 8, 0.22);
  border-radius: 8px;
  background: #fff8e8;
  box-shadow: 0 16px 36px rgba(31, 43, 34, 0.2);
  color: #5f3a0a;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  white-space: pre-line;
}

.detail-instruction {
  border-left: 3px solid var(--hv);
  padding-left: 8px;
}

.measure-task.changed strong {
  color: #b42318;
}

.measure-due-date {
  display: inline-block;
  margin-left: 6px;
  color: #0d3b25;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.original-measure {
  color: #b42318;
  font-size: 10px;
  font-weight: 850;
}

.measure-change-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px;
  margin-top: 3px;
  align-items: center;
}

.measure-change-controls input {
  min-width: 0;
  min-height: 26px;
  border: 1px solid rgba(25, 33, 28, 0.16);
  border-radius: 6px;
  background: #fff;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.measure-change-controls button {
  min-height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
}

.measure-change-controls .reset-measure {
  border-color: rgba(180, 35, 24, 0.24);
  color: #b42318;
}

.measure-status {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.measure-status.open {
  border: 1px solid rgba(25, 33, 28, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(25, 33, 28, 0.72);
}

.measure-status.progress {
  background: #f6c75b;
  color: #4a3105;
}

.measure-status.done {
  background: #168f43;
  color: #fff;
}

.measure-status.problem {
  background: var(--red);
  color: #fff;
}

.measure-status.rework {
  background: #123f8c;
  color: #fff;
}

.measure-filter-chip.filter-rework.active,
.measure-filter-chip.filter-rework:hover {
  border-color: #123f8c;
  background: #123f8c;
  color: #fff;
}

.measure-status.exported {
  background: var(--exported);
  color: #fff;
}

.measure-status-cell {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 112px;
  gap: 4px;
  align-items: center;
}

.measure-status-select {
  min-width: 0;
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(25, 33, 28, 0.16);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.measure-status-select.status-open {
  border-color: rgba(25, 33, 28, 0.16);
  color: rgba(25, 33, 28, 0.78);
}

.measure-status-select.status-progress {
  border-color: rgba(246, 199, 91, 0.8);
  background: #fff4d2;
  color: #5f3d04;
}

.measure-status-select.status-done {
  border-color: rgba(22, 143, 67, 0.45);
  background: #e4f8e9;
  color: #116d35;
}

.measure-status-select.status-problem {
  border-color: rgba(188, 71, 63, 0.45);
  background: #fff0ef;
  color: #833028;
}

.measure-status-select.status-rework {
  border-color: rgba(18, 63, 140, 0.55);
  background: #edf3ff;
  color: #123f8c;
}

.measure-row small {
  color: rgba(25, 33, 28, 0.68);
  display: block;
  margin-top: 1px;
  line-height: 1.2;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-area-hint {
  cursor: help;
}

.cutters-field,
.measure-cutters-field {
  display: grid;
  gap: 5px;
}

.measure-cutters-field input {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(25, 33, 28, 0.18);
  border-radius: 6px;
  padding: 0 7px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.measure-comment-field input,
.measure-comment-field textarea {
  width: 100%;
  min-height: 28px;
  max-height: 48px;
  border: 1px solid rgba(25, 33, 28, 0.18);
  border-radius: 6px;
  padding: 0 7px;
  resize: vertical;
  font-size: 11px;
  line-height: 1.25;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.measure-idle-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 4px;
  border: 1px solid rgba(255, 122, 0, 0.22);
  border-radius: 7px;
  padding: 5px 6px;
  background: rgba(255, 248, 237, 0.9);
  align-items: center;
}

.measure-idle-block.empty-idle {
  grid-template-columns: 1fr;
  padding: 3px 6px;
  border-color: rgba(255, 122, 0, 0.14);
  background: rgba(255, 248, 237, 0.52);
}

.measure-idle-block.open-idle {
  border-color: rgba(255, 138, 0, 0.38);
  background: #fff4e4;
}

.measure-idle-block.open-idle.warning {
  border-color: rgba(255, 138, 0, 0.68);
  background: #ffe4bd;
}

.idle-open-note {
  grid-column: 2;
  color: #7b3d00;
  font-weight: 850;
}

.measure-idle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #7b3d00;
  min-height: 20px;
}

.measure-idle-head strong,
.measure-idle-head span {
  font-size: 11px;
  font-weight: 900;
}

.measure-idle-block.empty-idle .measure-idle-head {
  min-height: 18px;
}

.measure-idle-block.empty-idle .measure-idle-head strong,
.measure-idle-block.empty-idle .measure-idle-head span {
  font-size: 10px;
}

.measure-idle-record {
  grid-column: 2;
  display: grid;
  grid-template-columns: 122px 94px 94px 88px 28px minmax(180px, 1fr);
  gap: 4px;
  align-items: center;
}

.measure-idle-record label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.measure-idle-record span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.measure-idle-record input {
  width: 100%;
  min-height: 24px;
  border: 1px solid rgba(25, 33, 28, 0.18);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 11px;
}

.idle-date-field input {
  min-width: 0;
}

.idle-time-field input {
  min-width: 58px;
}

.idle-photo-flags {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}

.idle-photo-flags span {
  min-width: 39px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
}

.idle-photo-flags .ok {
  background: #1f8f49;
  color: #fff;
}

.idle-photo-flags .missing {
  background: rgba(123, 61, 0, 0.12);
  color: rgba(123, 61, 0, 0.62);
}

.idle-mini-photos {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.idle-mini-photo {
  width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 122, 0, 0.25);
  border-radius: 6px;
  background: #fff;
}

.idle-mini-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idle-mail-link {
  width: 26px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ff7a00;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.idle-mail-link.disabled {
  background: rgba(123, 61, 0, 0.12);
  color: rgba(123, 61, 0, 0.46);
}

.rework-toggle {
  min-height: 24px;
  border: 1px solid rgba(18, 63, 140, 0.28);
  border-radius: 999px;
  background: #edf3ff;
  color: #123f8c;
  font-size: 11px;
  font-weight: 900;
  padding: 0 8px;
}

.rework-toggle.active {
  background: #123f8c;
  color: #fff;
}

.cutters-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cutters-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.detail-cutters {
  margin: 0 0 12px;
}

.scout-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.done-hidden-controls {
  justify-content: center;
}

.measure-muted-dash {
  color: rgba(25, 33, 28, 0.34);
  font-size: 12px;
  font-weight: 900;
}

.mini-segmented {
  display: inline-flex;
  gap: 3px;
  min-height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.44);
  padding: 2px;
}

.mini-segmented button,
.problem-toggle,
.done-toggle {
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(25, 33, 28, 0.7);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.mini-segmented button.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(31, 43, 34, 0.12);
}

.inline-check {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0 7px;
  color: rgba(25, 33, 28, 0.72);
  font-size: 11px;
  font-weight: 850;
}

.inline-check input {
  width: 15px;
  height: 15px;
}

.inline-check.active {
  border-color: rgba(242, 162, 58, 0.68);
  background: #ffe2b8;
  color: #6b420a;
}

.compact-date {
  width: 112px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 750;
}

.compact-date:disabled {
  background: #f0f3f0;
  color: var(--muted);
}

.problem-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.problem-toggle.active {
  border-color: rgba(188, 71, 63, 0.45);
  background: #f8e3e0;
  color: #833028;
}

.done-toggle {
  border: 1px solid rgba(22, 143, 67, 0.24);
  background: #eefaf1;
  color: #12783a;
}

.done-toggle.active {
  border-color: rgba(22, 143, 67, 0.5);
  background: #168f43;
  color: #fff;
}

.done-date {
  width: 112px;
}

.scout-problem-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(188, 71, 63, 0.24);
  border-radius: 8px;
  background: #fff8f7;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.scout-problem-note span {
  color: #833028;
  font-size: 12px;
  font-weight: 850;
}

.scout-problem-note textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid rgba(188, 71, 63, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  resize: vertical;
}

.scout-photo-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.scout-photo-upload {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(188, 71, 63, 0.32);
  border-radius: 8px;
  background: #fff;
  color: #833028;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
}

.scout-photo-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scout-photo-row strong {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
}

.photo-ok {
  background: #e8f2eb;
  color: var(--green-dark);
}

.photo-missing {
  background: #f2ede7;
  color: var(--muted);
}

.material-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #e8eee9;
  font-size: 12px;
  font-weight: 750;
}

.office-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.hv-scope-toggle {
  flex: 0 0 auto;
}

.hv-scope-toggle .segment {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.import-step {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.import-step strong {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e8eee9;
  color: var(--ink);
}

.import-step.done strong,
.import-step.active strong {
  background: var(--green);
  color: #fff;
}

.import-step.active {
  border-color: rgba(45, 122, 75, 0.38);
  color: var(--ink);
  background: #eef7f0;
}

.import-match-list {
  display: grid;
  gap: 10px;
}

.import-progress-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 8px;
  background: #fff7e6;
  padding: 12px 14px;
}

.import-progress-card.done {
  border-color: rgba(45, 122, 75, 0.34);
  background: #edf8ef;
}

.import-progress-card strong,
.import-progress-card small {
  display: block;
}

.import-progress-card small {
  margin-top: 3px;
  color: var(--muted);
}

.import-progress-card > span {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.import-progress-card.done > span {
  background: var(--green);
}

.import-match {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.import-match.strong {
  border-color: rgba(45, 122, 75, 0.38);
}

.import-match.likely {
  border-color: rgba(47, 111, 159, 0.34);
}

.import-match.uncertain,
.import-match.missing {
  border-color: rgba(185, 120, 24, 0.45);
  background: #fffaf0;
}

.match-score {
  border-radius: 8px;
  background: #edf3ee;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px;
  text-align: center;
}

.match-score strong {
  font-size: 22px;
  line-height: 1;
}

.match-score span,
.match-main small,
.match-grid span {
  color: var(--muted);
  font-size: 12px;
}

.match-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.match-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.match-title strong {
  display: block;
  font-size: 16px;
}

.match-title small {
  display: block;
  margin-top: 3px;
}

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

.match-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  min-width: 0;
}

.match-grid span {
  display: block;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.match-grid strong,
.match-grid small {
  display: block;
}

.match-grid strong {
  font-size: 14px;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #17231c;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.match-badge.strong {
  background: #d9efdf;
}

.match-badge.likely {
  background: #d9eef8;
}

.match-badge.uncertain,
.match-badge.missing {
  background: #ffe2b8;
}

.match-actions {
  min-width: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.match-actions .ghost-button {
  width: 100%;
}

.match-actions .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.import-summary div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.import-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.import-summary strong {
  font-size: 24px;
  line-height: 1;
}

.hv-schedule {
  display: grid;
  gap: 12px;
}

.hv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 28px;
}

.hv-summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  margin-bottom: 12px;
}

.hv-summary-card {
  min-height: 58px;
  border-radius: 8px;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  background: #f7fbf7;
}

.hv-summary-card.warn {
  border-color: rgba(255, 138, 0, 0.28);
  background: #fff4df;
}

.hv-summary-card strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.hv-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.vrao-sheet {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(31, 43, 34, 0.08);
}

.vrao-sheet-row {
  display: grid;
  align-items: stretch;
  border-top: 1px solid #edf1ee;
  background: #fff;
  font-size: 11px;
  min-width: 100%;
  width: var(--hv-table-width);
}

.vrao-sheet.with-project {
  --hv-table-width: 1980px;
}

.vrao-sheet.without-project {
  --hv-table-width: 1868px;
}

.vrao-sheet-row.with-project {
  grid-template-columns: 34px 112px 74px 112px 76px 150px 78px 62px 210px 76px 84px 138px 112px 96px 116px 84px 128px 154px 102px;
}

.vrao-sheet-row.without-project {
  grid-template-columns: 34px 74px 112px 76px 150px 78px 62px 210px 76px 84px 138px 112px 96px 116px 84px 128px 154px 102px;
}

.vrao-sheet-row:first-child {
  border-top: 0;
}

.vrao-sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #17351f;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.vrao-sheet-head span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
  white-space: nowrap;
}

.vrao-sheet-row:not(.vrao-sheet-head) {
  border-left: 5px solid var(--hv-date-color, transparent);
}

.vrao-sheet-row.ready {
  background: #f9fdf9;
}

.vrao-sheet-row.missing-date,
.vrao-sheet-row.missing-ge,
.vrao-sheet-row.missing-ruckzuck,
.vrao-sheet-row.missing-nl,
.vrao-sheet-row.missing-deployment {
  background: #fffaf1;
}

.vrao-sheet-row.overbooked {
  background: #fff2df;
}

.vrao-sheet-row input,
.vrao-sheet-row select,
.vrao-sheet-row .text-cell,
.vrao-sheet-row .project-cell,
.vrao-sheet-row .row-num,
.vrao-sheet-row .vrao-state {
  min-width: 0;
  min-height: 34px;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-right: 1px solid #edf1ee;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 7px;
  font: inherit;
  font-size: 11px;
}

.vrao-sheet-row input,
.vrao-sheet-row select {
  outline-offset: -2px;
}

.vrao-sheet-row input:focus,
.vrao-sheet-row select:focus {
  outline: 2px solid rgba(0, 209, 196, 0.42);
  background: #f6fffd;
}

.vrao-sheet-row .text-cell,
.vrao-sheet-row .project-cell,
.vrao-sheet-row .row-num,
.vrao-sheet-row .vrao-state {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vrao-sheet-row .strong {
  font-weight: 900;
}

.vrao-sheet-row .hv-date-number {
  justify-content: center;
  background: var(--hv-date-color, #d6a65a);
  color: #102016;
  font-weight: 950;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.1);
}

.vrao-sheet-row .hv-measure-cell {
  font-weight: 850;
}

.vrao-sheet-row .row-num {
  justify-content: center;
  color: var(--muted);
  font-weight: 900;
}

.vrao-sheet-row input[type="time"],
.vrao-sheet-row input[type="number"],
.vrao-sheet-row select,
.vrao-sheet-row .vrao-state {
  text-align: center;
}

.vrao-sheet-row .vrao-state {
  justify-content: center;
  background: #e9f3eb;
  color: #1d5e35;
  font-weight: 900;
}

.vrao-sheet-row:not(.ready) .vrao-state {
  background: #fff0d6;
  color: #9a4d00;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.hv-day {
  border: 1px solid var(--line);
  border-left: 7px solid var(--hv-date-color, var(--hv));
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.hv-day.overbooked {
  border-color: #c98523;
}

.hv-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--hv-date-color, var(--hv)) 14%, #f8faf7);
  border-bottom: 1px solid var(--line);
}

.hv-day-header strong {
  display: block;
  font-size: 16px;
}

.hv-day-header small {
  color: var(--muted);
}

.hv-day-count {
  background: var(--hv-date-color, var(--hv));
  color: #17231c;
}

.hv-tree-list {
  display: grid;
}

.hv-tree-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #edf1ee;
}

.hv-tree-row:first-child {
  border-top: 0;
}

.hv-tree-row span,
.hv-tree-row small {
  color: var(--muted);
}

.hv-planning-row {
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(92px, 0.55fr)) minmax(170px, 0.9fr);
  align-items: stretch;
  background: #fff;
}

.hv-planning-row.ready {
  border-left: 5px solid #1b8f4d;
}

.hv-planning-row.missing-date,
.hv-planning-row.missing-ge,
.hv-planning-row.missing-ruckzuck,
.hv-planning-row.missing-nl,
.hv-planning-row.missing-deployment {
  border-left: 5px solid #ff8a00;
}

.hv-main {
  display: grid;
  gap: 2px;
  align-content: center;
}

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

.hv-planning-row label span,
.hv-idle-planning > strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hv-planning-row input,
.hv-planning-row select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.hv-comment-field {
  grid-column: span 2;
}

.hv-idle-planning {
  grid-column: 1 / -2;
  display: grid;
  grid-template-columns: 96px 96px 82px minmax(160px, 1fr);
  gap: 8px;
  align-items: end;
  border: 1px solid rgba(255, 138, 0, 0.18);
  border-radius: 8px;
  background: #fff8ed;
  padding: 8px;
}

.hv-idle-planning > strong {
  align-self: center;
  color: #9a4d00;
  text-transform: none;
  font-size: 12px;
}

.hv-idle-comment {
  min-width: 160px;
}

.hv-plan-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  align-self: end;
  border-radius: 999px;
  background: #ecf3ed;
  color: #1d5e35;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.hv-planning-row:not(.ready) .hv-plan-state {
  background: #fff0d6;
  color: #9a4d00;
}

.date-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.date-field span {
  color: #79530f;
  font-size: 12px;
  font-weight: 850;
}

.date-field input {
  min-height: 40px;
  border: 1px solid rgba(121, 83, 15, 0.3);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.date-field input:disabled {
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

.idle-panel {
  border: 1px solid #b9c7d6;
  border-radius: 8px;
  padding: 12px;
  background: #f2f7fb;
  margin: 12px 0;
}

.idle-records {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.idle-record {
  border: 1px solid rgba(47, 111, 159, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
  display: grid;
  gap: 3px;
}

.idle-record span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.idle-record small,
.muted-copy {
  color: var(--muted);
}

.muted-copy {
  margin: 0;
}

.idle-form {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 8px;
}

.idle-form label,
.photo-check {
  display: grid;
  gap: 5px;
}

.idle-form label span,
.photo-check span {
  color: #315f84;
  font-size: 12px;
  font-weight: 850;
}

.idle-form input,
.idle-note {
  min-height: 40px;
  border: 1px solid rgba(47, 111, 159, 0.25);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.photo-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px dashed rgba(47, 111, 159, 0.32);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.64);
}

.photo-check input {
  width: 18px;
  height: 18px;
}

.idle-note {
  width: 100%;
  min-height: 72px;
  padding: 10px;
  resize: vertical;
  margin: 8px 0;
}

.full-width {
  width: 100%;
}

.idle-review {
  border-color: rgba(47, 111, 159, 0.25);
  background: #f7fbfe;
}

.checks {
  display: grid;
  gap: 10px;
}

.check-item {
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check-item span {
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
}

.check-item.good {
  background: #e8f2eb;
}

.check-item.good span {
  background: var(--green);
}

.check-item.warn {
  background: #fff3df;
}

.check-item.warn span {
  background: var(--amber);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  background: #17231c;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mobile-project-switch,
.measure-mobile-status {
  display: none;
}

.mobile-popup-back {
  display: none;
}

.photo-preview-thumb {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid rgba(25, 33, 28, 0.12);
  border-radius: 8px;
  margin-top: 6px;
  background: #f5f7f4;
}

.disposal-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.disposal-photo-item {
  margin: 0;
  min-width: 0;
  border: 1px solid rgba(25, 33, 28, 0.12);
  border-radius: 8px;
  background: #f5f7f4;
  overflow: hidden;
}

.disposal-photo-item img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: contain;
  background: #fff;
}

.disposal-photo-item figcaption {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 4px;
  padding: 4px 5px 4px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.disposal-photo-item figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disposal-photo-item figcaption button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(183, 45, 33, 0.12);
  color: #b42318;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.compact-photo-choice {
  min-height: 38px;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    max-height: 44vh;
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
  }

  .main-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-layout,
  .split-layout,
  .office-grid,
  .hv-layout,
  .import-layout,
  .documents-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    display: none;
  }

  #projectsView,
  #disposalView {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    min-width: 0;
    width: 100%;
  }

  .search-wrap {
    min-width: 0;
  }

  .view {
    padding: 14px;
  }

  .additional-tree-grid {
    grid-template-columns: 1fr;
  }

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

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

  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-canvas {
    min-height: min(560px, calc(100dvh - 170px));
  }

  .tree-map-popup {
    left: 10px !important;
    right: 10px;
    top: 10px !important;
    width: auto;
    max-height: calc(100dvh - 126px);
    transform: none;
  }

  .tree-map-popup.visible {
    transform: none;
  }

  .tree-map-popup::before {
    display: none;
  }

  .disposal-map-popup {
    left: 10px !important;
    right: 10px;
    top: 10px !important;
    width: auto;
    max-height: calc(100dvh - 126px);
    transform: none;
  }

  .disposal-map-popup.visible {
    transform: none;
  }

  .disposal-popup-card {
    padding: 10px;
  }

  .main-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .project-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .project-button {
    min-width: 190px;
  }

  .nav-button {
    justify-content: center;
    padding: 9px;
  }

  .nav-button span:last-child {
    display: none;
  }

  .field-grid,
  .prep-grid,
  .hv-tree-row,
  .idle-form,
  .import-steps,
  .import-summary,
  .import-match,
  .match-grid,
  .measure-head,
  .measure-row,
  .status-actions,
  .document-folder-grid,
  .documents-actions {
    grid-template-columns: 1fr;
  }

  .documents-actions {
    display: grid;
    align-items: stretch;
  }

  .hv-planning-row,
  .hv-idle-planning {
    grid-template-columns: 1fr;
  }

  .hv-comment-field,
  .hv-idle-planning {
    grid-column: auto;
  }

  .document-folder-input {
    min-width: 0;
  }

  .document-folder-card {
    min-height: 96px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: 12px;
  }

  .document-folder-tools {
    grid-template-columns: 1fr;
  }

  .document-drop-zone {
    min-height: 160px;
  }

  .document-file-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .document-file-head,
  .document-file-date,
  .document-file-size {
    display: none;
  }

  .document-file-row .ghost-button {
    grid-column: auto;
    width: 100%;
  }

  .document-preview-overlay {
    padding: 10px;
  }

  .document-preview-card {
    height: calc(100dvh - 20px);
  }

  .document-preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .document-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .document-preview-actions .primary-button,
  .document-preview-actions .ghost-button {
    width: 100%;
    min-height: 44px;
  }

  .document-preview-back {
    display: none;
  }

  .document-preview-floating-back {
    display: grid;
  }

  .document-preview-body.pdf {
    align-items: start;
    padding: 10px 10px 78px;
    background: #eef3ee;
  }

  .document-pdf-render {
    gap: 10px;
  }

  .match-actions {
    grid-template-columns: 1fr 1fr;
  }

  .measure-head {
    display: none;
  }
}

@media (max-width: 760px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background: #eef3ee;
  }

  .app-shell {
    display: block;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding-bottom: 62px;
  }

  .app-shell.nav-hidden {
    padding-bottom: 0;
  }

  .app-shell.nav-hidden .workspace {
    height: 100dvh;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 80;
    height: 62px;
    max-height: 62px;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    display: block;
    overflow: visible;
    background: rgba(23, 35, 28, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.22);
  }

  .brand,
  .sidebar-section {
    display: none;
  }

  .main-nav {
    height: 50px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .nav-button {
    min-height: 50px;
    border-radius: 8px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 4px 2px;
    font-size: 10px;
    font-weight: 850;
  }

  .nav-button .icon {
    width: 20px;
    min-width: 20px;
    font-size: 15px;
  }

  .nav-button span:last-child {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    height: calc(100dvh - 62px);
    min-height: 0;
    overflow: hidden;
  }

  .topbar {
    min-height: 54px;
    padding: 7px 9px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 30;
  }

  body[data-active-view="projects"] .topbar,
  body[data-active-view="disposal"] .topbar {
    display: none;
  }

  .topbar .eyebrow {
    display: none;
  }

  .workspace h2 {
    margin: 0;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .topbar-actions {
    min-width: 0;
    flex: 1;
    gap: 6px;
  }

  .search-wrap {
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
  }

  #syncButton {
    min-width: 40px;
    min-height: 38px;
    padding: 0 9px;
  }

  #syncButton span:last-child {
    display: none;
  }

  .view,
  .active-view {
    height: 100%;
    min-height: 0;
    padding: 8px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-active-view="projects"] #projectsView,
  body[data-active-view="disposal"] #disposalView {
    height: calc(100dvh - 62px);
    padding: 0;
    overflow: hidden;
  }

  body[data-active-view="projects"] .app-shell.nav-hidden #projectsView,
  body[data-active-view="disposal"] .app-shell.nav-hidden #disposalView {
    height: 100dvh;
  }

  #projectsView .map-layout,
  #disposalView .split-layout {
    display: grid;
    height: 100%;
    min-height: 0;
    gap: 0;
  }

  #projectsView .map-layout {
    grid-template-columns: 1fr;
  }

  #projectsView .map-panel,
  #disposalView .map-panel {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #projectsView .map-canvas {
    height: calc(100% - 34px);
    min-height: 0;
  }

  .object-tabs {
    min-height: 34px;
    height: 34px;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-top: 1px solid rgba(25, 33, 28, 0.08);
    background: rgba(248, 251, 247, 0.96);
  }

  .object-tab {
    min-width: 92px;
    height: 28px;
    border: 1px solid rgba(25, 33, 28, 0.1);
    border-radius: 999px;
    background: #eef5ec;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 9px;
    box-shadow: none;
  }

  .object-tab strong {
    font-size: 11px;
  }

  .object-tab span {
    display: none;
  }

  .object-tab.active {
    height: 30px;
    background: #173820;
    color: #fff;
    border-color: #173820;
    box-shadow: 0 5px 12px rgba(23, 56, 32, 0.2);
  }

  .map-toolbar {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 8px;
    z-index: 10;
    min-height: 44px;
    max-height: 96px;
    padding: 6px;
    border: 1px solid rgba(25, 33, 28, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(24, 33, 29, 0.16);
    overflow-x: auto;
    flex-direction: row;
  }

  .map-tree-search {
    min-width: 92px;
    flex: 0 0 92px;
    min-height: 32px;
    padding: 0 7px;
  }

  .map-tree-search input {
    width: 52px;
    font-size: 12px;
  }

  .map-toolbar .segmented {
    min-width: max-content;
  }

  .map-toolbar .segment {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .map-legend {
    display: none;
  }

  .toolbar-hide-button {
    min-height: 32px;
    padding: 0 9px;
  }

  .toolbar-hide-button strong {
    display: none;
  }

  .map-quick-toggle {
    top: 8px;
    min-width: 42px;
    height: 38px;
    padding: 0 8px;
  }

  .map-toolbar-toggle {
    left: 8px;
  }

  .map-nav-toggle {
    right: 8px;
    min-width: 72px;
    background: #082414;
    border-color: rgba(255, 255, 255, 0.86);
  }

  .map-nav-toggle.active {
    background: #082414;
  }

  .map-nav-toggle .toggle-label {
    display: inline;
    font-size: 11px;
  }

  .map-toolbar-toggle .toggle-label {
    display: none;
  }

  .leaflet-popup-content {
    max-height: calc(100dvh - 142px);
    margin: 8px;
  }

  .leaflet-popup-card {
    font-size: 12px;
  }

  .leaflet-popup-card .popup-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .popup-action {
    min-height: 54px;
  }

  .tree-map-popup,
  .disposal-map-popup {
    left: 8px !important;
    right: 8px;
    top: 8px !important;
    width: auto;
    max-height: calc(100dvh - 84px);
    transform: none;
  }

  .tree-map-popup.visible,
  .disposal-map-popup.visible {
    transform: none;
  }

  .tree-map-popup::before {
    display: none;
  }

  #disposalView .split-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(52vh, 1fr) minmax(190px, 34vh);
  }

  #disposalView .map-canvas {
    height: 100%;
    min-height: 0;
  }

  body[data-active-view="disposal"] #disposalView .map-toolbar {
    left: 8px;
    right: 8px;
    top: 8px;
    min-height: 42px;
    max-height: 52px;
    padding: 5px;
    gap: 6px;
    border: 1px solid rgba(25, 33, 28, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(24, 33, 29, 0.14);
    overflow-x: auto;
    overflow-y: hidden;
  }

  body[data-active-view="disposal"] #disposalView .map-toolbar .segmented {
    min-width: max-content;
  }

  body[data-active-view="disposal"] #addDisposalButton {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #173820;
    border-color: #173820;
    color: #fff;
    box-shadow: none;
  }

  body[data-active-view="disposal"] #addDisposalButton span:last-child {
    display: inline;
    font-size: 12px;
  }

  .disposal-leaflet-map {
    min-height: 100%;
  }

  #disposalView .list-panel {
    min-height: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    overflow: auto;
  }

  #disposalView .list-panel .panel-header {
    min-height: 38px;
    padding: 7px 9px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
  }

  #disposalView .panel-header h3,
  #disposalView .panel-header .eyebrow {
    display: none;
  }

  .disposal-district-summary {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 7px;
  }

  .district-chip {
    flex: 0 0 auto;
    min-width: 82px;
    max-width: 142px;
    min-height: 34px;
    padding: 0 10px;
  }

  .disposal-compact-list {
    padding: 0 7px 8px;
  }

  .disposal-row {
    min-height: 42px;
  }

  .disposal-popup-card {
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    padding: 10px;
  }

  #measuresView {
    padding: 0;
  }

  #measuresView .review-panel,
  #hvView .review-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
  }

  #measuresView .panel-header,
  #hvView .panel-header {
    min-height: 48px;
    padding: 8px;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 25;
    background: rgba(255, 255, 255, 0.96);
  }

  #measuresView .panel-header .eyebrow,
  #hvView .panel-header .eyebrow {
    display: none;
  }

  #measuresView .panel-header h3,
  #hvView .panel-header h3 {
    font-size: 14px;
  }

  .measure-transfer-actions {
    display: none;
  }

  .measure-street-nav {
    top: 48px;
    margin: 0;
    padding: 6px 7px;
    max-height: 42vh;
    overflow: auto;
  }

  .measure-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }

  .measure-filter-select {
    min-width: 0;
  }

  .measure-filter-select span {
    font-size: 9px;
  }

  .measure-filter-select select {
    width: 100%;
    min-height: 34px;
    font-size: 12px;
  }

  .measure-filter-reset {
    grid-column: 1 / -1;
    width: 100%;
  }

  .measure-street-nav-inner {
    padding-top: 4px;
  }

  .measure-list {
    padding: 8px;
  }

  .measure-group {
    scroll-margin-top: 178px;
  }

  .measure-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 88px;
    gap: 4px 6px;
    padding: 6px;
    align-items: start;
  }

  .measure-tree-cell {
    grid-column: 1;
  }

  .measure-masterdata {
    grid-column: 2;
  }

  .measure-status-cell {
    grid-column: 3;
    align-self: start;
  }

  .measure-task {
    grid-column: 2 / 4;
  }

  .measure-task strong {
    font-size: 12px;
  }

  .measure-instruction {
    max-height: none;
    white-space: normal;
  }

  .scout-controls,
  .measure-cutters-field,
  .measure-comment-field,
  .measure-idle-block,
  .scout-problem-note {
    grid-column: 1 / -1;
  }

  .mini-segmented {
    width: 100%;
  }

  .measure-cutters-field input,
  .measure-comment-field input,
  .measure-status-select,
  .done-date {
    min-height: 34px;
  }

  .measure-idle-block.empty-idle {
    display: none;
  }

  .measure-idle-block {
    grid-template-columns: 1fr;
  }

  .measure-idle-record,
  .measure-idle-head,
  .idle-open-note {
    grid-column: 1;
  }

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

  .measure-idle-note {
    grid-column: 1 / -1;
  }

  #hvView {
    padding: 0;
  }

  #hvView .panel-header {
    flex-wrap: wrap;
  }

  .hv-scope-toggle {
    order: 3;
    width: 100%;
  }

  .hv-scope-toggle .segment {
    flex: 1;
  }

  .hv-planning-only {
    min-height: 34px;
    padding: 0 9px;
  }

  .hv-date-strip {
    position: sticky;
    top: 94px;
    z-index: 22;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding: 7px 8px;
  }

  .hv-date-select {
    width: 100%;
    min-width: 0;
  }

  .hv-date-reset {
    width: 100%;
  }

  .vrao-sheet {
    display: none;
  }

  .vrao-mobile-list {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .vrao-mobile-card {
    border: 1px solid rgba(25, 33, 28, 0.14);
    border-left: 6px solid var(--hv-date-color, #d6a65a);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 43, 34, 0.08);
    overflow: hidden;
  }

  .vrao-mobile-card.ready {
    border-left-color: #1b8f4d;
  }

  .vrao-mobile-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 7px;
    background: #f8faf8;
    border-bottom: 1px solid rgba(216, 223, 217, 0.9);
  }

  .vrao-mobile-head strong,
  .vrao-mobile-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vrao-mobile-head small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .vrao-mobile-date {
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--hv-date-color, #d6a65a);
    padding: 0 8px;
    font-size: 11px;
    font-weight: 950;
  }

  .vrao-mobile-main {
    display: grid;
    gap: 3px;
    padding: 7px;
    border-bottom: 1px solid rgba(216, 223, 217, 0.72);
  }

  .vrao-mobile-main span {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    font-size: 12px;
    line-height: 1.25;
  }

  .vrao-mobile-main strong,
  .vrao-mobile-grid span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .vrao-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
  }

  .vrao-mobile-grid label {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .vrao-mobile-grid input,
  .vrao-mobile-grid select {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border: 1px solid rgba(25, 33, 28, 0.16);
    border-radius: 7px;
    background: #fff;
    padding: 0 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
  }

  .vrao-mobile-idle {
    min-height: 30px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: #fff8ed;
    color: #8a4a00;
    font-size: 12px;
    font-weight: 900;
  }
}

@media (min-width: 761px) {
  .vrao-mobile-list {
    display: none;
  }
}

@media (max-width: 760px) {
  .main-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button[data-view="hv"] {
    display: none;
  }

  .mobile-project-switch {
    position: fixed;
    left: 78px;
    right: 96px;
    top: max(8px, env(safe-area-inset-top));
    z-index: 86;
    display: block;
  }

  .app-shell.nav-hidden .mobile-project-switch {
    display: none;
  }

  .mobile-project-switch span {
    display: none;
  }

  .mobile-project-switch select {
    width: 100%;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: #082414;
    box-shadow: 0 8px 18px rgba(8, 20, 14, 0.34);
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    padding: 0 28px 0 12px;
    outline: 1px solid rgba(255, 255, 255, 0.08);
  }

  body[data-active-view="measures"] .mobile-project-switch {
    left: 8px;
    right: 8px;
    top: max(8px, env(safe-area-inset-top));
    z-index: 31;
  }

  body[data-active-view="measures"] .topbar,
  body[data-active-view="documents"] .topbar {
    display: none;
  }

  body[data-active-view="hv"] .mobile-project-switch,
  body[data-active-view="documents"] .mobile-project-switch,
  body[data-active-view="disposal"] .mobile-project-switch,
  body[data-active-view="import"] .mobile-project-switch,
  body[data-active-view="office"] .mobile-project-switch {
    display: none;
  }

  .disposal-popup-close {
    display: none;
  }

  .measure-transfer-actions,
  .office-transfer-actions,
  .additional-tree-panel {
    display: none !important;
  }

  .measure-street-nav {
    top: 48px;
    max-height: 196px;
    position: sticky;
    transform: none;
  }

  .measure-filter-bar {
    grid-template-columns: 1fr;
  }

  .measure-project-info {
    gap: 4px;
    margin-bottom: 6px;
    padding: 7px;
  }

  .project-info-fields {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .measure-project-info span {
    display: none;
  }

  .measure-project-info input,
  .measure-project-info textarea {
    min-height: 28px;
    padding: 0;
    font-size: 12px;
  }

  .measure-project-info textarea {
    min-height: 32px;
  }

  .object-note-field {
    display: none;
  }

  .measure-filter-reset {
    min-height: 32px;
  }

  .measure-list {
    padding: 7px;
  }

  .measure-group {
    scroll-margin-top: 286px;
  }

  .measure-group-header {
    min-height: 34px;
    padding: 6px 8px;
  }

  .measure-group-header small {
    font-size: 10px;
  }

  .measure-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 6px 7px;
    gap: 3px 7px;
  }

  .measure-tree-cell small {
    display: none;
  }

  .measure-tree-title strong {
    min-width: 34px;
    min-height: 28px;
    border-radius: 7px;
    font-size: 13px;
  }

  .measure-masterdata {
    min-width: 0;
  }

  .measure-masterdata strong,
  .measure-masterdata small {
    display: inline;
    font-size: 11px;
  }

  .measure-masterdata small::before {
    content: " · ";
  }

  .measure-mobile-status {
    display: none;
  }

  .measure-task {
    grid-column: 2;
    min-width: 0;
  }

  .measure-task-line {
    align-items: start;
  }

  .measure-line-item strong,
  .measure-lines > strong,
  .measure-instruction,
  .vrao-mobile-main span {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .measure-line-item {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .measure-line-item strong,
  .measure-lines > strong {
    display: block;
    line-height: 1.25;
    white-space: normal;
  }

  .measure-instruction {
    margin-top: 2px;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.25;
  }

  .measure-quick-actions,
  .measure-change-controls,
  .scout-controls,
  .measure-cutters-field,
  .measure-comment-field,
  .measure-idle-block,
  .scout-problem-note {
    display: none !important;
  }

  .measure-head {
    display: none !important;
  }

  .photo-preview-thumb {
    max-height: 150px;
  }

  .disposal-popup-card .photo-preview-thumb,
  .tree-map-popup .photo-preview-thumb,
  .leaflet-popup-card .photo-preview-thumb {
    max-height: 128px;
  }

  .disposal-photo-gallery {
    grid-template-columns: 1fr;
  }

  .disposal-photo-item img {
    height: min(260px, 36dvh);
  }

  body[data-active-view="disposal"] .disposal-map-popup {
    position: fixed;
    inset: 0 !important;
    z-index: 124;
    width: auto;
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    background: rgba(238, 243, 238, 0.98);
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }

  body[data-active-view="disposal"] .disposal-map-popup.visible {
    transform: none;
  }

  body[data-active-view="disposal"] .disposal-map-popup.guided-flow {
    width: auto;
  }

  body[data-active-view="disposal"] .disposal-popup-card {
    min-height: calc(100dvh - 24px);
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    padding: 12px;
    align-content: start;
  }

  body[data-active-view="disposal"] .disposal-popup-head {
    padding-right: 0;
  }

  body[data-active-view="disposal"] .disposal-popup-card dl div,
  body[data-active-view="disposal"] .disposal-meta-grid,
  body[data-active-view="disposal"] .disposal-popup-actions {
    grid-template-columns: 1fr;
  }

  body[data-active-view="disposal"] .disposal-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-active-view="disposal"] .disposal-choice-grid {
    grid-template-columns: 1fr;
  }

  body[data-active-view="disposal"] #disposalView .list-panel .panel-header {
    display: none;
  }

  body[data-active-view="disposal"] .maps-link-field input,
  body[data-active-view="disposal"] .popup-wizard textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .tree-map-popup.mobile-fullscreen {
    position: fixed;
    inset: 0 !important;
    z-index: 120;
    display: block;
    width: auto;
    max-height: none;
    overflow-y: auto;
    transform: none;
    border-radius: 0;
    padding: max(10px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom));
    background: rgba(238, 243, 238, 0.98);
    box-shadow: none;
  }

  .leaflet-tree-map.active ~ #treeMapPopup.mobile-fullscreen {
    display: block;
  }

  .tree-map-popup.mobile-fullscreen .leaflet-popup-card {
    min-height: calc(100dvh - 20px);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
  }

  .mobile-popup-back {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #173820;
    color: #fff;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    font-size: 30px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-popup-back span {
    transform: translateY(-1px);
  }
}

/* Mobile outdoor refinements - keep last. */
@media (max-width: 760px) {
  .measure-list { padding-left: 3px; padding-right: 3px; }
  .measure-group-header { padding: 7px; background: #f5faf5; border-left: 4px solid #173820; }
  .measure-group-header strong { font-size: 14px; color: #102818; }
  .measure-group-header small, .measure-group-header .pill { display: none !important; }
  .measure-row { padding-left: 5px; padding-right: 5px; grid-template-columns: 38px minmax(0, 1fr); }
  #projectsView .map-canvas { height: calc(100% - 44px); }
  .object-tabs { min-height: 44px; height: 44px; gap: 7px; padding: 5px 8px; }
  .object-tab { min-width: 112px; height: 34px; padding: 0 12px; }
  .object-tab.active { height: 36px; }
  .object-tab strong { font-size: 12px; }
  .tree-map-popup.mobile-fullscreen .leaflet-popup-card { padding-right: 62px; }
  .mobile-popup-back { position: fixed; right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); z-index: 180; width: 48px; height: 48px; border: 0; border-radius: 999px; background: #102818; color: #fff; display: grid; place-items: center; margin: 0; box-shadow: 0 14px 30px rgba(16, 40, 24, 0.26); font-size: 34px; font-weight: 950; line-height: 1; }
  .mobile-popup-back span { transform: translateY(-2px); }
  .tree-map-popup.mobile-fullscreen .popup-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tree-map-popup.mobile-fullscreen .action-idle { grid-column: 1 / -1; min-height: 54px; }
  .tree-map-popup.mobile-fullscreen .popup-scouting { border: 0; background: #e8f6ff; padding: 10px; }
  .tree-map-popup.mobile-fullscreen .popup-scouting-toggle { min-height: 42px; background: #93dcff; color: #092c36; }
  .tree-map-popup.mobile-fullscreen .popup-scout-grid, .tree-map-popup.mobile-fullscreen .popup-scout-row { background: transparent; gap: 7px; padding: 0; }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button { min-height: 44px; box-shadow: 0 8px 18px rgba(24, 33, 29, 0.12); }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv { background: #ffd185; color: #4e330d; }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao { background: #ff9b7a; color: #532012; }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao { background: linear-gradient(135deg, #ffd185 0 50%, #ff9b7a 50% 100%); color: #2b2114; }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv.active { background: var(--hv); }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao.active { background: var(--vrao); color: #fff; }
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao.active { background: linear-gradient(135deg, var(--hv) 0 50%, var(--vrao) 50% 100%); color: #fff; }
  .tree-map-popup.mobile-fullscreen .scout-photo-choice { min-height: 48px; background: #173820; color: #fff; }
  .tree-map-popup.mobile-fullscreen .popup-scout-note textarea { min-height: 78px; border: 2px solid #93dcff; background: #fff; font-size: 16px; }
  .tree-map-popup.mobile-fullscreen .idle-photo-actions { grid-template-columns: 1fr 1fr; }
  .tree-map-popup.mobile-fullscreen .tree-photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-map-popup.mobile-fullscreen .tree-photo-item img { height: 112px; }
  body[data-active-view="disposal"] .maps-open-button { min-height: 50px; background: #102818; color: #fff; box-shadow: 0 10px 22px rgba(16, 40, 24, 0.22); }
  body[data-active-view="documents"] .documents-actions, body[data-active-view="documents"] .document-folder-tools, body[data-active-view="documents"] #documentDropZone, body[data-active-view="documents"] .folder-copy small, body[data-active-view="documents"] .folder-count, body[data-active-view="documents"] .document-empty small, body[data-active-view="documents"] [data-delete-document-file] { display: none !important; }
  body[data-active-view="documents"] .document-folder-path { min-height: 0; margin-bottom: 8px; }
  body[data-active-view="documents"] .document-folder-path > button:not(.document-level-back), body[data-active-view="documents"] .document-folder-path > span { display: none; }
  body[data-active-view="documents"] .document-folder-card { min-height: 78px; grid-template-columns: 46px minmax(0, 1fr); padding: 12px; }
  body[data-active-view="documents"] .document-file-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  body[data-active-view="documents"] .document-file-head, body[data-active-view="documents"] .document-file-date, body[data-active-view="documents"] .document-file-size { display: none; }
  body[data-active-view="documents"] .document-file-main small { display: none; }
}

/* Mobile document and popup refinements - keep last. */
@media (max-width: 760px) {
  .tree-map-popup.mobile-fullscreen .leaflet-popup-card {
    padding-right: 12px;
    padding-bottom: 76px;
  }

  .mobile-popup-back {
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(70px, env(safe-area-inset-bottom));
    transform: none;
    width: 44px;
    height: 44px;
    opacity: 0.96;
  }

  body[data-active-view="documents"] .document-folder-grid:empty {
    display: none;
  }

  body[data-active-view="documents"] .document-file-name-button {
    font-size: 14px;
    line-height: 1.2;
  }

  body[data-active-view="documents"] .document-file-row > .ghost-button:not(.danger) {
    display: none !important;
  }

  body[data-active-view="documents"] .document-file-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv,
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao,
  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao {
    background: #fff;
    color: #102818;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv.active {
    background: var(--hv);
    color: #4e330d;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.vrao.active {
    background: var(--vrao);
    color: #fff;
  }

  .tree-map-popup.mobile-fullscreen .popup-scout-row button.hv-vrao.active {
    background: linear-gradient(135deg, var(--hv) 0 50%, var(--vrao) 50% 100%);
    color: #fff;
  }
}
