:root {
  --sidebar-width: 230px;
  --details-width: 390px;
  --bg-main: #f4f6f8;
  --bg-panel: #ffffff;
  --bg-panel-2: #eef2f6;
  --border: #d3d9e1;
  --grid-line: #8a949f;
  --text-main: #18202a;
  --text-muted: #5d6875;
  --gold: #f5b91f;
  --gold-dark: #b98208;
  --silver: #697381;
  --green: #259b37;
  --yellow: #f5b91f;
  --red: #d8422f;
  --grey-point: #7b8794;
  --blue-location: #087bd8;
  --shadow: 0 18px 44px rgba(30, 42, 56, .13);
  --body-bg:
    radial-gradient(circle at 72% 20%, rgba(8, 123, 216, .10), transparent 28rem),
    linear-gradient(135deg, #f8fafc 0%, #e9eef4 48%, #f4f6f8 100%);
  --sidebar-bg: rgba(255, 255, 255, .94);
  --surface-bg: rgba(255, 255, 255, .92);
  --surface-border: rgba(24, 32, 42, .12);
  --brand-border: rgba(24, 32, 42, .08);
  --button-bg: rgba(24, 32, 42, .045);
  --bolt-row-bg: rgba(24, 32, 42, .030);
  --bolt-row-bg-alt: rgba(24, 32, 42, .070);
  --editable-number-bg: #fff6cf;
  --editable-number-border: rgba(245, 185, 31, .58);
  --search-bg: rgba(24, 32, 42, .045);
  --field-bg: #ffffff;
  --map-bg: #f5f7fa;
  --map-grid: rgba(24, 32, 42, .07);
  --grid-axis: rgba(53, 63, 76, .44);
  --grid-minor: rgba(53, 63, 76, .12);
  --axis-fill: #26313e;
  --edge-bg: #ffffff;
  --edge-border: rgba(24, 32, 42, .20);
  --point-fill: #f7fafc;
  --point-blocked: #5b6571;
  --point-blocked-core: rgba(91, 101, 113, .56);
  --blocked-symbol: #111820;
  --section-border: rgba(24, 32, 42, .10);
  --sector-label-stroke: #ffffff;
  --mobile-nav-bg: rgba(255, 255, 255, .98);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-main: #070b10;
  --bg-panel: #10151b;
  --bg-panel-2: #151b22;
  --border: #2a3038;
  --grid-line: #6f7780;
  --text-main: #f2f4f6;
  --text-muted: #9aa3ad;
  --silver: #c8cbd0;
  --green: #59c65a;
  --red: #f04d37;
  --grey-point: #8c929a;
  --blue-location: #3aa7ff;
  --shadow: 0 22px 80px rgba(0, 0, 0, .42);
  --body-bg:
    radial-gradient(circle at 72% 20%, rgba(58, 167, 255, .10), transparent 28rem),
    linear-gradient(135deg, #05080c 0%, #111820 48%, #080b10 100%);
  --sidebar-bg: rgba(9, 13, 18, .92);
  --surface-bg: rgba(13, 18, 24, .86);
  --surface-border: rgba(255, 255, 255, .10);
  --brand-border: rgba(255, 255, 255, .06);
  --button-bg: rgba(255, 255, 255, .045);
  --bolt-row-bg: rgba(255, 255, 255, .040);
  --bolt-row-bg-alt: rgba(255, 255, 255, .080);
  --editable-number-bg: rgba(245, 185, 31, .18);
  --editable-number-border: rgba(245, 185, 31, .54);
  --search-bg: rgba(0, 0, 0, .20);
  --field-bg: #0b1016;
  --map-bg: #080c11;
  --map-grid: rgba(255, 255, 255, .035);
  --grid-axis: rgba(220, 226, 232, .56);
  --grid-minor: rgba(220, 226, 232, .16);
  --axis-fill: #d9dde2;
  --edge-bg: #070b10;
  --edge-border: rgba(255, 255, 255, .18);
  --point-fill: #0b1118;
  --point-blocked: #404851;
  --point-blocked-core: rgba(64, 72, 81, .64);
  --blocked-symbol: #f2f4f6;
  --section-border: rgba(255, 255, 255, .08);
  --sector-label-stroke: #070b10;
  --mobile-nav-bg: rgba(8, 12, 17, .98);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

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

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  min-height: 100vh;
  min-width: 0;
  overflow: visible;
}

body.sidebar-collapsed {
  --sidebar-width: 0px;
}

body.sidebar-collapsed .sidebar {
  padding: 0;
  border-right: 0;
}

body.sidebar-collapsed .sidebar > :not(.panel-toggle):not(.panel-resize) {
  display: none;
}

.brand {
  height: 118px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--brand-border);
  margin-bottom: 14px;
}

.brand img {
  width: 192px;
  max-height: 104px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
  border-radius: 6px;
  text-decoration: none;
}

.nav-item span {
  color: var(--silver);
  text-align: center;
}

.nav-status {
  justify-self: center;
}

.nav-item .dot {
  width: 15px;
  height: 15px;
  border-width: 3px;
}

.nav-item .dot.blocked::before,
.nav-item .dot.blocked::after {
  height: 3px;
}

.nav-item b {
  background: rgba(245, 185, 31, .95);
  color: #121212;
  min-width: 28px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  font-size: 12px;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, rgba(245, 185, 31, .18), rgba(255, 255, 255, .03));
  border-color: rgba(245, 185, 31, .20);
}

.nav-item.filter-active {
  background: linear-gradient(90deg, rgba(245, 185, 31, .30), rgba(245, 185, 31, .08));
  border-color: rgba(245, 185, 31, .52);
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item.filter-active b {
  background: var(--gold);
}

.active-filter-badge {
  min-height: 36px;
  max-width: min(420px, 42vw);
  border: 1px solid rgba(22, 136, 232, .64);
  border-radius: 999px;
  padding: 6px 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(228, 245, 255, .98), rgba(206, 235, 255, .96));
  color: #075d9f;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 0 3px rgba(22, 136, 232, .10), 0 6px 18px rgba(22, 136, 232, .18);
}

[data-theme="dark"] .active-filter-badge {
  background: linear-gradient(180deg, rgba(12, 83, 135, .96), rgba(8, 61, 101, .96));
  color: #dff3ff;
}

.profile {
  margin-top: auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.profile strong,
.profile small { display: block; }

.profile small,
.workspace p,
.section-title small { color: var(--text-muted); }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 800;
  background: linear-gradient(160deg, var(--gold), var(--silver));
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.workspace {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 10px 12px 10px;
  gap: 6px;
}

.workspace > .topbar { grid-row: 1; }
.workspace > .control-strip { grid-row: 2; }
.workspace > .content-grid { grid-row: 3; }
.workspace > .legend { grid-row: 4; }

.topbar,
.control-strip,
.legend,
.map-card,
.details-panel {
  border: 1px solid var(--surface-border);
  background: var(--surface-bg);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
}

.topbar-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(360px, 1.25fr);
  align-items: center;
  gap: 14px;
}

.topbar-title {
  min-width: 0;
}

.topbar-search-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search-actions .search {
  flex: 1 1 auto;
  min-width: 260px;
  max-width: 680px;
}

.topbar-search-actions .action-button {
  white-space: nowrap;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; letter-spacing: 0; }
h2 { font-size: 25px; }
h3 { font-size: 15px; }

.point-total-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: .5em;
  line-height: 1;
}

.top-actions,
.control-strip,
.map-toolbar,
.legend,
.quick-actions,
.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-switch {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--search-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  user-select: none;
}

.theme-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-slider {
  width: 48px;
  height: 25px;
  position: relative;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(24, 32, 42, .04);
}

.theme-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd769, var(--gold));
  box-shadow: 0 2px 7px rgba(24, 32, 42, .22);
  transition: transform .16s ease;
}

.theme-switch input:checked + .theme-slider {
  background: #111820;
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(23px);
}

.top-menu {
  position: relative;
}

.top-menu-toggle {
  width: 38px;
  height: 34px;
}

.top-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 190px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-panel-2);
  box-shadow: var(--shadow);
}

.top-menu-list[hidden] {
  display: none;
}

.top-menu-list .action-button,
.top-menu-list .auth-controls,
.top-menu-list .auth-controls .action-button {
  width: 100%;
}

.top-menu-list .theme-switch {
  width: 100%;
  justify-content: center;
}

.top-menu-list .auth-controls {
  display: grid;
  gap: 6px;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text-muted);
}

.status-pill.online { color: var(--green); }

.auth-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-button.compact {
  min-height: 34px;
  padding: 0 10px;
}

body.auth-pending .app-shell,
body.auth-locked .app-shell {
  visibility: hidden;
  filter: none;
  pointer-events: none;
  user-select: none;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #f4f6f8;
  backdrop-filter: none;
  overflow: auto;
}

.auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  background: #ffffff;
  color: #17202c;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

.auth-card img {
  width: 132px;
  height: auto;
  margin-bottom: 2px;
}

.auth-card h2 {
  font-size: 28px;
  color: #17202c;
}

.auth-card p,
.auth-message {
  color: #5f6b7a;
}

.maintenance-banner {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid #e0a912;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff8d9, #fff3b5);
  color: #17202c;
  box-shadow: 0 10px 28px rgba(153, 105, 0, .14);
}

.maintenance-banner strong,
.maintenance-banner span {
  display: block;
}

.maintenance-banner strong {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.maintenance-banner span {
  color: #654b00;
  font-weight: 750;
  line-height: 1.35;
}

.maintenance-graphic {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #17202c;
  color: #ffc629;
}

.maintenance-graphic svg {
  width: 52px;
  height: 52px;
  overflow: visible;
  fill: rgba(255, 198, 41, .15);
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.maintenance-graphic .maintenance-tool {
  fill: #ffc629;
  stroke: #17202c;
  stroke-width: 2;
}

.auth-card form {
  display: grid;
  gap: 12px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #5f6b7a;
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8e4;
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: #17202c;
  font: inherit;
  font-weight: 800;
}

.auth-card input:focus {
  border-color: #0b79e0;
  box-shadow: 0 0 0 3px rgba(11, 121, 224, .15);
  outline: none;
}

.auth-submit,
.auth-cache,
.auth-install {
  width: 100%;
  justify-content: center;
}

.auth-cache,
.auth-install {
  color: #17202c;
  background: #f6f8fb;
}

.auth-install {
  border-color: rgba(255, 198, 41, .65);
  background: linear-gradient(180deg, rgba(255, 213, 91, .22), rgba(255, 198, 41, .12));
}

.auth-message {
  min-height: 18px;
}

.auth-install-help {
  display: block;
  line-height: 1.35;
}

.action-button,
.icon-button,
.segmented button,
.zoom-controls button,
.quick-actions button,
.primary-button {
  border: 1px solid var(--border);
  color: var(--text-main);
  background: var(--button-bg);
  min-height: 36px;
  border-radius: 6px;
}

.action-button { padding: 0 13px; }
.icon-button { width: 38px; }

.control-strip {
  min-height: 46px;
  border-radius: 8px;
  padding: 6px;
  flex-wrap: wrap;
}

.control-strip.filter-panel {
  min-height: 0;
  display: block;
}

.control-strip.filter-panel.is-collapsed {
  display: none;
}

.filter-panel-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-panel-body[hidden] {
  display: none;
}

.search {
  flex: 1;
  min-width: 220px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--search-bg);
  position: relative;
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  width: 100%;
  padding-right: 112px;
}

.search-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 800;
  opacity: .58;
  pointer-events: none;
}

.search-error {
  position: absolute;
  left: 12px;
  top: calc(100% + 5px);
  z-index: 8;
  display: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(216, 66, 47, .12);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.search.invalid {
  border-color: var(--red);
}

.search.invalid .search-error {
  display: block;
}

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

.view-actions .action-button {
  white-space: nowrap;
}

.point-layer-toggle.active {
  color: #111;
  border-color: rgba(245, 185, 31, .75);
  background: linear-gradient(180deg, #ffd769, var(--gold));
}

.point-hit.saved-visible .point-marker {
  filter: drop-shadow(0 0 5px rgba(24, 32, 42, .18));
}

[data-theme="dark"] .point-hit.saved-visible .point-marker {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, .16));
}

select,
textarea {
  color: var(--text-main);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

select { height: 38px; padding: 0 10px; }

.coordinate-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-filter-summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(22, 136, 232, .48);
  border-radius: 6px;
  padding: 7px 10px;
  background: rgba(22, 136, 232, .10);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 850;
}

@keyframes filterClearPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22, 136, 232, .12), 0 0 10px rgba(22, 136, 232, .18); }
  50% { box-shadow: 0 0 0 4px rgba(22, 136, 232, .20), 0 0 18px rgba(22, 136, 232, .34); }
}

.filter-clear-button.filters-active {
  border-color: rgba(22, 136, 232, .72);
  background: linear-gradient(180deg, #eef8ff, #dcefff);
  color: #075d9f;
  animation: filterClearPulse 1.8s ease-in-out infinite;
}

[data-theme="dark"] .filter-clear-button.filters-active {
  background: linear-gradient(180deg, rgba(12, 83, 135, .96), rgba(8, 61, 101, .96));
  color: #dff3ff;
}

@media (prefers-reduced-motion: reduce) {
  .filter-clear-button.filters-active { animation: none; }
}

.installer-filter {
  position: relative;
  max-width: min(520px, 100%);
}

.installer-dropdown {
  position: relative;
}

.installer-dropdown summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text-main);
  background: var(--button-bg);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.installer-dropdown summary::-webkit-details-marker {
  display: none;
}

.installer-dropdown summary::after {
  content: "▾";
  color: var(--text-muted);
  font-size: 12px;
}

.installer-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-bg);
  box-shadow: var(--shadow);
}

.installer-chip {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text-main);
  background: var(--button-bg);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.installer-chip.active {
  color: #111;
  border-color: rgba(245, 185, 31, .75);
  background: linear-gradient(180deg, #ffd769, var(--gold));
}

.installer-chip.empty {
  color: var(--text-muted);
}

#entryDateFilter {
  min-width: 148px;
}

#areaPrefix,
#areaNumber,
#coordX,
#coordY {
  min-width: 74px;
}

.derived-sector {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(245, 185, 31, .35);
  border-radius: 6px;
  background: rgba(245, 185, 31, .10);
  color: var(--gold);
  font-weight: 800;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: var(--details-width) minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
}

body.details-collapsed {
  --details-width: 0px;
}

body.details-collapsed .content-grid {
  gap: 0;
}

.map-card {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.search-results-card {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-bg);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.search-results-card[hidden],
.content-grid.search-results-mode .map-card {
  display: none !important;
}

.search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-results-head h2 {
  margin: 0;
  font-size: 22px;
}

.search-results-head p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-weight: 700;
}

.search-results-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.search-result-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active {
  border-color: rgba(11, 121, 224, .68);
  background: rgba(11, 121, 224, .08);
}

.search-result-point {
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.search-result-meta,
.search-result-snippet,
.search-result-count {
  display: block;
  color: var(--text-muted);
  font-weight: 750;
}

.search-result-snippet {
  margin-top: 4px;
  line-height: 1.35;
}

.search-result-count {
  justify-self: end;
  white-space: nowrap;
}

.search-result-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--panel-bg);
  font-weight: 800;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.map-toolbar .segmented {
  flex: 0 0 auto;
}

.map-toolbar .zoom-controls {
  margin-left: auto;
}

.map-hover-readout {
  min-width: 118px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-bg);
  color: var(--muted);
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.map-hover-readout.active {
  color: #111;
  border-color: rgba(245, 185, 31, .65);
  background: linear-gradient(180deg, #ffd769, var(--gold));
  box-shadow: 0 8px 20px rgba(245, 185, 31, .18);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-radius: 0;
  min-width: 92px;
  background: var(--search-bg);
}

.segmented button.active {
  color: #121212;
  background: linear-gradient(180deg, #ffd769, var(--gold));
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zoom-controls button { width: 38px; }

.map-rotation-controls {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-bg);
}

.map-rotation-controls button {
  width: 38px;
  min-width: 38px;
  border: 0;
  border-radius: 0;
  color: var(--text-main);
  font-size: 21px;
  line-height: 1;
}

.map-rotation-controls button + output,
.map-rotation-controls output + button {
  border-left: 1px solid var(--border);
}

.map-orientation-indicator {
  min-width: 43px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.map-viewport {
  min-height: 0;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    var(--map-bg);
  background-size: 24px 24px;
  touch-action: none;
  cursor: grab;
}

.map-viewport.is-panning {
  cursor: grabbing;
}

.edge-coordinates {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: var(--edge-label-rail-width, 42px);
  background: var(--edge-bg);
  pointer-events: none;
}

.edge-coordinates.left {
  left: 0;
  border-right: 1px solid var(--edge-border);
}

.edge-coordinates.right {
  display: none;
}

.edge-coordinates span {
  position: absolute;
  z-index: 1;
  left: 10px;
  min-width: var(--edge-label-min-width, 32px);
  height: var(--edge-label-height, 26px);
  display: grid;
  place-items: center;
  color: var(--text-main);
  font-size: var(--edge-label-font-size, 16px);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 1px 0 var(--map-bg),
    0 -1px 0 var(--map-bg),
    1px 0 0 var(--map-bg),
    -1px 0 0 var(--map-bg),
    0 3px 10px rgba(0, 0, 0, .22);
}

.edge-coordinates span.active,
.edge-x-coordinates span.active {
  z-index: 20;
  color: #111;
  background: linear-gradient(180deg, #ffd769, var(--gold));
  border-radius: 6px;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(245, 185, 31, .28);
}

.edge-coordinates.right span {
  left: auto;
  right: 10px;
}

.edge-x-coordinates {
  position: absolute;
  left: var(--edge-label-rail-width, 42px);
  right: 0;
  top: 0;
  z-index: 5;
  height: var(--edge-x-rail-height, 42px);
  background: var(--edge-bg);
  border-bottom: 1px solid var(--edge-border);
  pointer-events: none;
}

.edge-x-coordinates span {
  position: absolute;
  z-index: 1;
  top: 10px;
  transform: translateX(-50%);
  min-width: var(--edge-x-label-min-width, 38px);
  height: var(--edge-label-height, 26px);
  display: grid;
  place-items: center;
  color: var(--text-main);
  font-size: var(--edge-label-font-size, 16px);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 1px 0 var(--map-bg),
    0 -1px 0 var(--map-bg),
    1px 0 0 var(--map-bg),
    -1px 0 0 var(--map-bg),
    0 3px 10px rgba(0, 0, 0, .22);
}

.map-stage {
  width: 1496.5px;
  height: 760px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
}

.hall-underlay,
.grid-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hall-underlay {
  object-fit: contain;
  opacity: 0;
  filter: invert(.95) grayscale(1) contrast(.86) brightness(.72);
}

.map-card.mode-hybrid .hall-underlay { opacity: 0; }
.map-card.mode-hybrid .grid-layer { opacity: .95; }
.map-card.mode-hybrid .grid-axis,
.map-card.mode-hybrid .grid-minor {
  opacity: .42;
}

.grid-axis {
  stroke: var(--grid-axis);
  stroke-width: 1.15;
}

.grid-axis.active-axis {
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-opacity: .98;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(245, 185, 31, .48));
}

.grid-minor {
  stroke: var(--grid-minor);
  stroke-width: 1;
}

.axis-label {
  fill: var(--axis-fill);
  font-size: 11px;
  font-weight: 700;
}

.axis-y { font-size: 10px; }

.axis-label.active {
  fill: #111;
  font-size: 14px;
  font-weight: 950;
  paint-order: stroke;
  stroke: var(--gold);
  stroke-width: 3px;
}

.search-area-label {
  fill: var(--gold);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: var(--sector-label-stroke);
  stroke-width: 5px;
  opacity: .94;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18));
}

.map-upright-label {
  transform: rotate(var(--map-label-counter-rotation, 0deg));
  transform-box: fill-box;
  transform-origin: center;
}

.point-hit,
.point-hit * {
  cursor: pointer;
}

.point-marker {
  fill: var(--point-fill);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.point-column-backing {
  fill: #d7dce1;
  stroke: #9da7b1;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.point-prime-backing {
  fill: #cfd5db;
  stroke: #8f99a4;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

[data-theme="dark"] .point-prime-backing {
  fill: #59636d;
  stroke: #b0bac3;
}

.point-qa-pending-corner {
  fill: #ffd22e;
  stroke: #a87300;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 1px rgba(90, 62, 0, .34));
  pointer-events: none;
}

[data-theme="dark"] .point-column-backing {
  fill: #626b75;
  stroke: #b4bdc6;
}

.point-marker.todo {
  fill: var(--point-fill);
  stroke: var(--grey-point);
}

.point-marker.planned {
  fill: transparent;
  stroke: var(--blue-location);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 21 10;
  animation: plannedSvgSpin 1.8s linear infinite;
  filter: drop-shadow(0 0 4px rgba(22, 136, 232, .5));
}

.point-marker.planned.has-plan-label {
  animation: none;
}

.point-marker.lift {
  fill: var(--map-bg);
  stroke: var(--red);
  stroke-width: 2.4;
}

.point-lift-label {
  fill: var(--red);
  stroke: var(--map-bg);
  stroke-width: .9px;
  paint-order: stroke fill;
  font-size: 3.35px;
  font-weight: 950;
  letter-spacing: -.16px;
  pointer-events: none;
}

.point-plan-label {
  fill: var(--blue-location);
  stroke: var(--map-bg);
  stroke-width: 1.2px;
  paint-order: stroke fill;
  font-size: 4.2px;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.point-marker.done {
  fill: var(--green);
  stroke: var(--green);
}

.point-marker.partial_blocked {
  fill: url("#partialBlockedGradient");
  stroke: var(--blocked-symbol);
  stroke-width: 2.4;
}

.point-marker.attention {
  fill: var(--yellow);
  stroke: var(--yellow);
}

.point-marker.problem {
  fill: var(--red);
  stroke: var(--red);
  animation: problemPointPulse 1.05s ease-in-out infinite;
  filter: drop-shadow(0 0 7px rgba(216, 66, 47, .58));
  transform-box: fill-box;
  transform-origin: center;
}

.point-marker.blocked {
  fill: var(--map-bg);
  stroke: var(--blocked-symbol);
  stroke-width: 2.4;
}

.point-marker.missing-column {
  fill: #fff;
  stroke: #111;
  stroke-width: 2.4;
}

.point-missing-line {
  stroke: #111;
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.point-cross {
  stroke: var(--blocked-symbol);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.point-selection-frame {
  fill: rgba(226, 53, 44, .10);
  stroke: #e2352c;
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 7px rgba(226, 53, 44, .82));
  pointer-events: none;
}

.point-range-frame {
  fill: rgba(31, 145, 236, .13);
  stroke: rgba(17, 126, 214, .82);
  stroke-width: 1.8;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.point-range-frame.boundary {
  fill: rgba(31, 145, 236, .22);
  stroke: var(--blue-location);
  stroke-width: 2.8;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 7px rgba(31, 145, 236, .8));
}

.point-edit-pulse {
  fill: rgba(226, 53, 44, .11);
  stroke: #e2352c;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  animation: editingPointPulse 1.05s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(226, 53, 44, .64));
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}

@keyframes problemPointPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .62;
    transform: scale(1.45);
  }
}

@keyframes editingPointPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .38;
    transform: scale(1.75);
  }
}

@keyframes selectedFramePulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .62;
  }
}

.sector-frame,
.sector-highlight {
  fill: rgba(245, 185, 31, .11);
  stroke: var(--gold);
  stroke-width: 4.5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 2px 5px rgba(0, 0, 0, .18));
}

.sector-frame {
  fill: transparent;
  stroke-width: 7;
  opacity: 1;
}

.sector-highlight,
.sector-hover {
  stroke-width: 8;
  stroke-dasharray: 10 6;
}

.sector-u1 { stroke: #00dcd8; fill: rgba(24, 227, 224, .13); }
.sector-u4 { stroke: #16d82b; fill: rgba(36, 226, 52, .13); }
.sector-mz { stroke: #ff18cf; fill: rgba(255, 41, 212, .13); }
.sector-tl { stroke: #ffe600; fill: rgba(255, 238, 33, .13); }

.sector-frame-label,
.sector-highlight-label,
.sector-hover-label {
  fill: #ff2727;
  font-size: var(--sector-frame-label-size, 34px);
  font-weight: 900;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: var(--sector-label-stroke);
  stroke-width: var(--sector-label-stroke-width, 6px);
  opacity: .98;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22));
  pointer-events: none;
}

.sector-highlight-label {
  fill: var(--gold);
  font-size: var(--sector-highlight-label-size, 38px);
  stroke-width: var(--sector-highlight-stroke-width, 7px);
  opacity: .96;
}

.sector-hover-label {
  fill: var(--gold);
  font-size: var(--sector-highlight-label-size, 38px);
  stroke-width: var(--sector-highlight-stroke-width, 7px);
  opacity: .52;
}

.mode-hybrid .point-marker {
  opacity: .84;
}

.point-hit.selected .point-marker,
.point-marker.problem {
  opacity: 1;
}

.sector-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  padding: 5px 9px;
  border-radius: 6px;
  color: #111820;
  background: linear-gradient(180deg, #ffd769, var(--gold));
  border: 1px solid rgba(180, 126, 0, .4);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .12s ease;
}

.sector-tooltip.visible {
  opacity: .98;
}

.details-panel {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 8px;
  padding: 12px;
}

body.details-collapsed .details-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

body.details-collapsed .details-panel > :not(.panel-toggle):not(.panel-resize) {
  display: none;
}

.panel-toggle {
  position: absolute;
  top: 10px;
  right: -14px;
  z-index: 25;
  width: 28px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-main);
  background: var(--surface-bg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.details-toggle {
  top: 12px;
}

body.sidebar-collapsed .sidebar-toggle,
body.details-collapsed .details-toggle {
  right: -34px;
}

.panel-resize {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 24;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.panel-resize::after {
  content: "";
  position: absolute;
  top: 42%;
  right: 4px;
  width: 2px;
  height: 64px;
  border-radius: 999px;
  background: rgba(105, 115, 129, .38);
}

body.sidebar-collapsed .sidebar-resize,
body.details-collapsed .details-resize {
  display: none;
}

body.is-resizing-panel {
  cursor: col-resize;
  user-select: none;
}

.details-heading {
  border-bottom: 1px solid var(--section-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.point-kicker,
.point-meta,
.field span,
.status-select span {
  color: var(--text-muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.point-meta {
  margin: 4px 0 0;
  font-size: 13px;
}

.field {
  display: block;
  margin-bottom: 10px;
}

.status-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.lift-access-control {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid rgba(226, 53, 44, .38);
  border-radius: 10px;
  background: rgba(226, 53, 44, .07);
}

.lift-access-control[hidden] {
  display: none !important;
}

.lift-access-heading,
.lift-access-inputs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lift-access-heading strong {
  color: var(--text-main);
  font-size: 13px;
}

.lift-access-heading output {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.lift-access-inputs > input[type="range"] {
  min-width: 0;
  flex: 1 1 auto;
  accent-color: var(--red);
}

.lift-access-inputs label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--red);
  font-weight: 900;
}

.lift-access-inputs input[type="number"] {
  width: 72px;
  min-height: 38px;
  border: 1px solid rgba(226, 53, 44, .48);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-main);
  padding: 7px 8px;
  font: inherit;
  font-weight: 900;
  text-align: right;
}

.range-status-notice {
  display: grid;
  gap: 5px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #83b9e8;
  border-radius: 12px;
  background: #eef8ff;
  color: #174b72;
}

.range-status-notice[hidden] {
  display: none;
}

.range-status-notice strong {
  color: #103d60;
}

.range-status-notice span {
  font-size: 13px;
  line-height: 1.42;
}

.range-status-notice[data-ready="true"] {
  border-color: #56a875;
  background: #effaf3;
  color: #24633a;
}

.range-status-notice[data-ready="true"] strong {
  color: #174d2b;
}

.range-clear-bolts {
  min-height: 38px;
  border: 1px solid #c7352a;
  border-radius: 8px;
  padding: 7px 12px;
  background: #fff3f1;
  color: #9f241c;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.range-clear-bolts:hover:not(:disabled) {
  background: #ffe3df;
  box-shadow: 0 0 0 3px rgba(199, 53, 42, .12);
}

.range-clear-bolts:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.status-select span {
  margin: 0;
}

.status-select select,
.field textarea {
  width: 100%;
}

.field textarea {
  resize: vertical;
  min-height: 78px;
  padding: 10px;
}

.details-heading {
  position: relative;
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
  margin-bottom: 8px;
}

.details-title {
  min-width: 0;
  padding-right: 46px;
  position: relative;
}

.point-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 0;
  position: relative;
}

.point-meta-row .point-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.point-meta-link {
  width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.point-meta-link:hover {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.point-action-menu {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 80;
  flex: 0 0 auto;
}

.point-action-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.point-action-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  display: grid;
  gap: 6px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid #cfd8e4;
  border-radius: 8px;
  background: #f1f4f8;
  color: #17202c;
  box-shadow: 0 16px 34px rgba(9, 13, 20, .18);
}

.point-action-list[hidden] {
  display: none !important;
}

.point-action-list .action-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-color: #d5dde8;
  background: #f8fafc;
  color: #17202c;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.point-action-list .relocate-point-button,
.point-action-list .copy-point-link-button,
.point-action-list .share-point-button {
  width: 100%;
  min-height: 38px;
}

.save-point-button {
  position: absolute;
  top: 0;
  right: 44px;
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.save-point-button.dirty {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  animation: savePulse 1.2s ease-in-out infinite;
}

@keyframes savePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 185, 31, .34); }
  50% { box-shadow: 0 0 0 7px rgba(245, 185, 31, 0); }
}

.bolt-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bolt-stats div {
  padding: 8px 6px;
  background: var(--button-bg);
  text-align: center;
}

.bolt-stats div + div { border-left: 1px solid var(--border); }
.bolt-stats small { display: block; color: var(--text-muted); font-size: 12px; }
.bolt-stats strong { font-size: 22px; }
#doneBolts { color: var(--green); }

.bolt-breakdown {
  display: grid;
  grid-template-columns: minmax(106px, .95fr) repeat(3, minmax(62px, 1fr));
  gap: 6px;
  align-items: center;
  margin: -2px 0 10px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--button-bg);
}

.bolt-breakdown-head,
.bolt-breakdown label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.bolt-type-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.08;
}

.bolt-type-label small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
}

.bolt-breakdown input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--text-main);
  padding: 5px 7px;
  font-size: 14px;
  font-weight: 800;
}

.bolt-breakdown input:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.bolt-breakdown input:not([readonly]):not(:disabled) {
  background: var(--editable-number-bg);
  border-color: var(--editable-number-border);
}

.bolt-breakdown input[readonly] {
  background: transparent;
  color: var(--text-muted);
  border-style: dashed;
  cursor: default;
}

.bolt-breakdown input:focus {
  outline: 2px solid rgba(249, 181, 26, .45);
  border-color: var(--gold);
}

.bolt-field-control {
  position: relative;
  display: block;
  min-width: 0;
}

.bolt-field-control input {
  height: 100%;
  padding-right: 27px !important;
  appearance: textfield;
}

.bolt-field-control input::-webkit-inner-spin-button,
.bolt-field-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.bolt-field-steppers {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  display: grid;
  width: 23px;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
}

.bolt-field-steppers button {
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(102, 115, 131, .34);
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
}

.bolt-field-steppers button:disabled { opacity: .35; }

.bolt-breakdown-head {
  color: var(--text-main);
}

.bolt-breakdown > :nth-child(8n+9),
.bolt-breakdown > :nth-child(8n+10),
.bolt-breakdown > :nth-child(8n+11),
.bolt-breakdown > :nth-child(8n+12) {
  background-color: var(--bolt-row-bg-alt);
}

.bolt-breakdown > input[readonly]:nth-child(8n+10) {
  background-color: var(--bolt-row-bg-alt);
}

.bolt-breakdown > :nth-child(n+5) {
  min-height: 34px;
}

.bolt-breakdown > label:nth-child(n+5),
.bolt-breakdown > .bolt-breakdown-placeholder:nth-child(n+5) {
  padding: 5px 7px;
  border-radius: 6px;
}

.bolt-breakdown > input:nth-child(n+5) {
  background-clip: padding-box;
}

.bolt-breakdown-placeholder {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.quick-actions button { min-width: 0; }

.point-plan-panel {
  display: grid;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px solid rgba(22, 136, 232, .42);
  border-radius: 10px;
  background: rgba(22, 136, 232, .06);
}

.point-plan-panel[hidden],
.axis-side-panel[hidden],
.desktop-quality-check[hidden] {
  display: none !important;
}

.point-plan-heading,
.point-plan-range,
.point-plan-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.point-plan-heading {
  justify-content: space-between;
}

.point-plan-heading strong,
.point-plan-heading small {
  display: block;
}

.point-plan-heading small,
.point-plan-range span,
.point-plan-message {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.point-plan-panel label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.point-plan-panel input,
.point-plan-panel textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--text-main);
}

.point-plan-range label {
  flex: 1 1 130px;
}

.point-plan-range .point-plan-shortcut {
  flex: 1 0 100%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.point-plan-actions button,
.point-plan-range button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--text-main);
  font-weight: 800;
}

.point-plan-message {
  min-height: 1.2em;
  margin: 0;
}

.point-plan-message[data-mode="error"] { color: var(--red); }
.point-plan-message[data-mode="success"] { color: var(--green); }

.point-plan-summary {
  display: grid;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid rgba(22, 136, 232, .4);
  border-radius: 9px;
  background: rgba(22, 136, 232, .06);
}

.point-plan-summary[hidden] { display: none !important; }
.point-plan-summary small,
.point-plan-summary p { color: var(--text-muted); }
.point-plan-summary p { margin: 0; white-space: pre-wrap; }

.desktop-quality-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  font-weight: 850;
}

.desktop-quality-check input {
  width: 38px;
  height: 38px;
  accent-color: var(--green);
}

.desktop-quality-check strong,
.desktop-quality-check small { display: block; }
.desktop-quality-check small { color: var(--text-muted); font-size: 11px; }

.planning-map-pick .map-viewport {
  outline: 3px solid rgba(22, 136, 232, .55);
  outline-offset: -3px;
  cursor: crosshair;
}

.hidden-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.section-title {
  justify-content: space-between;
  margin: 10px 0 6px;
}

.docs-inline {
  margin: 6px 0 8px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.docs-inline .doc-grid:empty {
  display: none;
}

.doc-tile {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(245, 185, 31, .17), rgba(58, 167, 255, .10));
  display: grid;
  place-items: center;
  color: var(--silver);
  font-size: 12px;
  text-align: center;
  padding: 6px;
  overflow: hidden;
  gap: 4px;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}

.docs-inline .doc-tile {
  min-height: 54px;
}

.doc-tile.empty {
  cursor: default;
}

.doc-tile img {
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  margin: -6px -6px 0;
  object-fit: cover;
  grid-row: 1 / span 2;
  grid-column: 1;
}

.doc-tile strong {
  max-width: 100%;
  color: var(--text-main);
  font-size: 10px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: end;
}

.doc-gps-status {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.12;
}

.doc-gps-status.used {
  color: #249a3d;
}

.doc-gps-status.excluded {
  color: #c0392b;
}

.doc-gps-status.no-gps {
  color: var(--text-muted);
}

.doc-tile img + strong {
  z-index: 1;
  width: calc(100% + 12px);
  margin: -20px -6px -6px;
  padding: 4px 5px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
}

.doc-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(10, 14, 18, .78);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
}

.doc-delete:hover {
  background: var(--danger);
  color: #fff;
}

.doc-preview {
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-height: 34px;
  color: var(--text-main);
  font-weight: 900;
}

.doc-preview.video {
  min-height: 46px;
  border-radius: 999px;
  color: #111;
  background: var(--gold);
  font-size: 20px;
}

.media-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
}

.media-viewer-window {
  width: min(980px, 96vw);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
  overflow: hidden;
}

.media-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.media-viewer-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.media-viewer-header strong,
.media-viewer-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-header small {
  color: var(--text-muted);
}

.media-viewer-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--text-main);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.media-viewer-body {
  min-height: 320px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--panel-strong) 68%, #000 32%);
}

.media-image,
.media-video {
  width: 100%;
  height: 100%;
  max-height: calc(92vh - 68px);
  object-fit: contain;
  background: #05080c;
}

.media-viewer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.media-viewer-meta .doc-gps-status {
  font-size: 13px;
}

.media-viewer-meta button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--text-main);
  font-weight: 800;
  cursor: pointer;
}

.media-video-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: grid;
  background: #05080c;
}

.media-video-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 0;
  background: radial-gradient(circle at center, rgba(245, 185, 31, .16), rgba(5, 8, 12, .92));
  color: #fff;
  cursor: pointer;
  text-align: center;
  padding: 28px;
}

.media-video-start[hidden],
.media-video-start.is-hidden {
  display: none !important;
  pointer-events: none;
}

.media-video-start span {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-size: 30px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .35);
}

.media-video-start strong {
  font-size: 24px;
}

.media-video-start small {
  color: rgba(255, 255, 255, .72);
}

.media-file-link {
  color: var(--text-main);
  font-weight: 800;
}

.photo-import-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 18, 24, .42);
  backdrop-filter: blur(4px);
}

.photo-import-window {
  width: min(560px, 94vw);
  display: grid;
  gap: 14px;
  border: 1px solid #d4dce6;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  color: #17202c;
  box-shadow: 0 28px 82px rgba(8, 13, 20, .34);
}

.photo-import-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.photo-import-header div {
  display: grid;
  gap: 3px;
}

.photo-import-header strong {
  font-size: 22px;
}

.photo-import-header small,
.photo-drop-zone span {
  color: #647181;
  font-weight: 700;
  line-height: 1.35;
}

.photo-drop-zone {
  min-height: 180px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 2px dashed rgba(245, 185, 31, .66);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at center, rgba(3, 7, 12, .96) 0%, rgba(15, 21, 29, .84) 25%, rgba(86, 94, 104, .28) 48%, rgba(238, 241, 245, .94) 74%),
    linear-gradient(180deg, #eef2f7 0%, #d8dee7 100%);
  text-align: center;
  outline: none;
  box-shadow:
    inset 0 16px 34px rgba(255, 255, 255, .72),
    inset 0 -38px 70px rgba(0, 0, 0, .30),
    inset 0 0 0 1px rgba(255, 255, 255, .55);
  animation: dropTunnelGlow 9.2s ease-in-out infinite;
}

.photo-drop-zone::before,
.photo-drop-zone::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

.photo-drop-zone::before {
  background:
    repeating-radial-gradient(ellipse at center, rgba(255, 255, 255, .14) 0 7px, transparent 7px 16px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .66) 34%, transparent 62%);
  transform: scaleX(1.55);
  filter: blur(.2px);
  animation: dropTunnelRings 8.6s cubic-bezier(.42, 0, .18, 1) infinite;
}

.photo-drop-zone::after {
  inset: 30px 54px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .58) 42%, transparent 72%);
  transform: scaleX(1.85);
  animation: dropTunnelCore 7.4s ease-in-out infinite;
}

.photo-drop-zone strong,
.photo-drop-zone span {
  position: relative;
  z-index: 1;
  max-width: 430px;
  color: #f8fafc;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .72);
}

.photo-drop-zone strong {
  font-size: 24px;
}

.photo-drop-zone.drag-over,
.photo-drop-zone:focus-visible {
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px rgba(255, 198, 41, .24),
    inset 0 12px 30px rgba(255, 255, 255, .54),
    inset 0 -48px 82px rgba(0, 0, 0, .38);
}

.photo-drop-zone.drag-over::after {
  animation-duration: 3s;
}

.photo-drop-zone.drag-over::before {
  animation-duration: 3.4s;
}

@keyframes dropTunnelRings {
  0% {
    background-size: 114% 114%, 100% 100%;
    background-position: 0 0, center;
    opacity: .72;
    transform: scaleX(1.55) scale(1.16) rotate(0deg);
  }
  54% {
    opacity: .98;
    transform: scaleX(1.55) scale(.74) rotate(5deg);
  }
  78% {
    background-size: 74% 74%, 100% 100%;
    background-position: center, center;
    opacity: .42;
    transform: scaleX(1.55) scale(.48) rotate(8deg);
  }
  100% {
    background-size: 114% 114%, 100% 100%;
    background-position: center, center;
    opacity: .72;
    transform: scaleX(1.55) scale(1.16) rotate(10deg);
  }
}

@keyframes dropTunnelCore {
  0% {
    opacity: .72;
    transform: scaleX(1.85) scale(1.04);
    filter: blur(0);
  }
  58% {
    opacity: .96;
    transform: scaleX(1.85) scale(.72);
    filter: blur(1px);
  }
  80% {
    opacity: .48;
    transform: scaleX(1.85) scale(.54);
    filter: blur(2px);
  }
  100% {
    opacity: .72;
    transform: scaleX(1.85) scale(1.04);
    filter: blur(0);
  }
}

@keyframes dropTunnelGlow {
  0%, 100% {
    box-shadow:
      inset 0 16px 34px rgba(255, 255, 255, .72),
      inset 0 -38px 70px rgba(0, 0, 0, .30),
      inset 0 0 0 1px rgba(255, 255, 255, .55);
  }
  58% {
    box-shadow:
      inset 0 12px 28px rgba(255, 255, 255, .58),
      inset 0 -52px 88px rgba(0, 0, 0, .42),
      inset 0 0 0 1px rgba(245, 185, 31, .28);
  }
  82% {
    box-shadow:
      inset 0 22px 44px rgba(255, 255, 255, .50),
      inset 0 -66px 106px rgba(0, 0, 0, .52),
      inset 0 0 0 1px rgba(245, 185, 31, .16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-drop-zone,
  .photo-drop-zone::before,
  .photo-drop-zone::after {
    animation: none;
  }
}

.photo-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.user-modal[hidden] {
  display: none !important;
}

.user-modal {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
}

.user-window {
  width: min(980px, 96vw);
  max-height: min(820px, 94vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  overflow: hidden;
}

.point-share-window {
  width: min(560px, 94vw);
}

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

.user-window-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.point-share-preview {
  border: 1px solid rgba(245, 185, 31, .42);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 185, 31, .12);
  display: grid;
  gap: 4px;
}

.point-share-preview strong {
  font-size: 18px;
}

.point-share-preview small {
  color: var(--text-muted);
}

.user-window-header strong {
  font-size: 18px;
}

.user-window-header small,
.form-note {
  color: var(--text-muted);
}

.user-admin-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.user-list-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-panel-2);
}

.user-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.user-list-item {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-panel);
  color: var(--text-main);
  text-align: left;
}

.user-list-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 185, 31, .18);
}

.user-list-item small {
  color: var(--text-muted);
}

.user-form {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.user-form label,
.user-form fieldset {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.user-form fieldset {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px;
}

.user-form legend {
  padding: 0 6px;
  color: var(--text-main);
}

.user-form input,
.user-form select,
.user-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--text-main);
  padding: 9px 10px;
}

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

.user-password-tools {
  display: grid;
  align-content: end;
  gap: 6px;
  min-width: 0;
}

.user-password-tools .action-button {
  width: 100%;
  min-height: 42px;
}

.user-password-tools small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.login-invite-box[hidden] {
  display: none !important;
}

.login-invite-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(245, 185, 31, .45);
  border-radius: 8px;
  background: rgba(245, 185, 31, .10);
}

.login-invite-box strong {
  color: var(--text-main);
}

.login-invite-message {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-main);
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

body.theme-dark .login-invite-box {
  background: rgba(245, 185, 31, .16);
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
}

.check-row input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-window {
  max-width: 560px;
}

.profile-form {
  padding: 18px;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-avatar-preview {
  width: 86px;
  height: 86px;
  font-size: 26px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

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

.profile-photo-actions .danger {
  grid-column: 1 / -1;
}

.profile-camera-panel {
  display: grid;
  gap: 10px;
  margin: 2px 0 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel-2);
}

.profile-camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #111821;
}

.profile-camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.profile-face-guide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 31%, rgba(17, 24, 33, .34) 32% 100%);
}

.profile-face-guide span {
  position: relative;
  width: min(58%, 260px);
  aspect-ratio: 1;
  border: 3px solid rgba(255, 198, 41, .96);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.9),
    0 0 28px rgba(255, 198, 41, .34);
}

.profile-face-guide span::before,
.profile-face-guide span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(54%, 238px);
  height: 1px;
  background: rgba(255,255,255,.65);
  transform: translate(-50%, -50%);
}

.profile-face-guide span::after {
  width: 1px;
  height: min(54%, 238px);
}

.profile-camera-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.profile-save-ok {
  color: var(--ok);
}

.profile-save-error {
  color: var(--danger);
}

.action-button.danger {
  color: #fff;
  background: var(--red);
  border-color: color-mix(in srgb, var(--red) 74%, #000 26%);
}

.permission-lock {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(216, 66, 47, .28);
  border-radius: 7px;
  background: rgba(216, 66, 47, .08);
  color: var(--text-main);
  font-size: 13px;
}

.permission-lock strong {
  color: var(--red);
}

.manager-only[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .user-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

.transfer-progress {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5200;
  width: min(360px, calc(100vw - 32px));
}

.transfer-progress-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

.transfer-progress-head,
.transfer-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.transfer-progress-head span {
  color: var(--gold);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.transfer-progress-file,
.transfer-progress-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.transfer-progress-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 64%, transparent);
}

.transfer-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--ok));
  transition: width .18s ease;
}

.transfer-progress.error .transfer-progress-head span {
  color: var(--danger);
}

.transfer-progress.error .transfer-progress-bar span {
  background: var(--danger);
}

.history-list {
  padding: 0;
  margin: 8px 0 14px;
  list-style: none;
  display: grid;
  gap: 8px;
}

.history-list[hidden] {
  display: none !important;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.history-toggle::after {
  content: "▾";
  color: var(--text-muted);
  font-size: 12px;
  transform: rotate(-90deg);
  transition: transform .14s ease;
}

.history-toggle[aria-expanded="true"]::after {
  transform: rotate(0deg);
}

.history-toggle small {
  color: var(--text-muted);
  font-weight: 700;
}

.history-list li {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px;
  background: var(--search-bg);
}

.history-list small { color: var(--text-muted); display: block; margin-top: 4px; }

.chat-shell .workspace {
  min-width: 0;
}

.chat-mobile-menu {
  position: relative;
  display: none;
  flex: 0 0 auto;
}

.chat-mobile-menu summary {
  position: relative;
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 24px;
  font-weight: 900;
  list-style: none;
}

.chat-mobile-menu[open] summary,
.chat-mobile-menu.has-unread summary {
  border-color: rgba(30, 144, 255, .45);
  background: #e8f4ff;
  color: #0b2947;
}

.chat-menu-icon,
.chat-menu-mail {
  grid-area: 1 / 1;
  transition: opacity .15s ease, transform .15s ease;
}

.chat-menu-mail {
  color: #1e90ff;
  font-size: 22px;
  opacity: 0;
  transform: scale(.8);
}

.chat-mobile-menu.has-unread .chat-menu-icon {
  opacity: 0;
  transform: scale(.8);
}

.chat-mobile-menu.has-unread .chat-menu-mail {
  opacity: 1;
  transform: scale(1);
}

.chat-menu-unread {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 4px 12px rgba(220, 38, 38, .28);
}

.chat-mobile-menu summary::-webkit-details-marker {
  display: none;
}

.chat-mobile-menu-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 90;
  width: min(310px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-bg);
  box-shadow: var(--shadow);
}

.chat-mobile-menu-popover a,
.chat-mobile-menu-popover button {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-main);
  background: var(--field-bg);
  font-weight: 850;
  text-decoration: none;
}

.chat-mobile-chat-row {
  grid-template-columns: 1fr auto;
  justify-items: stretch;
  text-align: left;
}

.chat-mobile-row-badge {
  min-width: 34px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
}

.chat-mobile-menu-popover a.active {
  border-color: rgba(245, 185, 31, .5);
  background: rgba(245, 185, 31, .16);
}

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

.chat-mobile-menu-popover label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.chat-mobile-menu-popover input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-main);
  background: var(--field-bg);
  padding: 8px 10px;
}

.chat-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 12px;
  flex: 1;
}

.chat-list-panel,
.chat-thread-panel,
.chat-create-panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-create-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.chat-thread-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-panel-head,
.chat-thread-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-panel-head strong,
.chat-thread-head h2 {
  display: block;
  margin: 0;
  font-size: 18px;
}

.chat-panel-head small,
.chat-thread-head p,
.chat-engine-note {
  color: var(--text-muted);
}

.chat-conversation-list,
.chat-user-picker,
.chat-messages {
  overflow: auto;
  min-height: 0;
}

.chat-conversation-list {
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.chat-search {
  position: relative;
  display: block;
  padding: 8px 8px 0;
}

.chat-search span {
  position: absolute;
  left: 20px;
  top: 21px;
  color: var(--text-muted);
  pointer-events: none;
}

.chat-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px 8px 32px;
  color: var(--text-main);
  background: var(--field-bg);
  font-weight: 750;
}

.chat-conversation-row {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  touch-action: pan-y;
}

.chat-conversation {
  position: relative;
  z-index: 1;
  min-height: 68px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 7px;
  text-align: left;
  color: var(--text-main);
  background: var(--surface-bg);
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.chat-conversation-row.show-delete .chat-conversation {
  cursor: default;
}

.chat-conversation-delete {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: 86px;
  border: 0;
  border-radius: 0 7px 7px 0;
  color: #fff;
  background: #d8422f;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity .16s ease, transform .18s ease;
}

.chat-conversation-row.show-delete .chat-conversation-delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.chat-conversation-row.show-delete .chat-conversation {
  transform: translateX(-92px);
}

.chat-conversation:hover,
.chat-conversation.active {
  border-color: rgba(245, 185, 31, .38);
  background: rgba(245, 185, 31, .12);
}

.chat-conversation small {
  grid-column: 2 / 4;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-conversation b,
.chat-unread-badge {
  background: var(--gold);
  color: #111;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.chat-user-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--grey-point);
  align-self: center;
}

.chat-user-dot.online,
.chat-presence.online {
  background: var(--green);
}

.chat-presence {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--grey-point);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.chat-messages {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.chat-message {
  display: flex;
  justify-content: flex-start;
}

.chat-message.own {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(640px, 78%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg-panel);
}

.chat-message.own .chat-bubble {
  color: #111;
  border-color: rgba(245, 185, 31, .55);
  background: linear-gradient(180deg, #ffd769, var(--gold));
}

.chat-bubble p {
  margin: 4px 0;
  white-space: pre-wrap;
}

.chat-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.chat-attachment {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
  display: grid;
  align-content: end;
  gap: 3px;
  color: var(--text-main);
  background: rgba(255, 255, 255, .78);
  text-decoration: none;
  overflow: hidden;
}

.chat-attachment.image {
  position: relative;
  min-height: 118px;
}

.chat-attachment.image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-attachment.image strong,
.chat-attachment.image small {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, .86);
}

.chat-attachment.video,
.chat-attachment.file {
  justify-items: center;
  align-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(17, 24, 32, .08), rgba(245, 185, 31, .2));
}

.chat-attachment.video span,
.chat-attachment.file span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--gold);
  font-weight: 900;
}

.chat-attachment strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inline-point-link,
.chat-point-task {
  color: inherit;
  text-decoration: none;
}

.chat-inline-point-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(245, 185, 31, .5);
  border-radius: 999px;
  padding: 2px 9px;
  background: rgba(245, 185, 31, .18);
  font-weight: 900;
}

.chat-point-task {
  display: grid;
  gap: 5px;
  min-width: min(340px, 68vw);
}

.chat-point-task span {
  width: max-content;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(17, 24, 32, .1);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-point-task strong {
  font-size: 18px;
}

.chat-point-task p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.chat-bubble small {
  color: var(--text-muted);
  font-size: 11px;
}

.chat-message.own .chat-bubble small {
  color: rgba(17, 17, 17, .68);
}

.chat-compose {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.chat-compose textarea,
.chat-create-panel input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--text-main);
  padding: 10px;
  resize: vertical;
}

.chat-compose textarea {
  grid-column: 1 / 2;
}

.chat-compose .primary-button {
  grid-column: 2 / 3;
  grid-row: 1;
}

.chat-attachment-picker,
.chat-pending-attachments {
  grid-column: 1 / -1;
}

.chat-attachment-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-attachment-picker button,
.chat-pending-chip button {
  border: 1px solid var(--border);
  border-radius: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--text-main);
  background: var(--search-bg);
  font-weight: 800;
}

.chat-pending-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-pending-attachments[hidden] {
  display: none;
}

.chat-pending-chip,
.chat-upload-status {
  border: 1px solid rgba(245, 185, 31, .5);
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-main);
  background: rgba(245, 185, 31, .14);
  font-weight: 800;
}

.chat-pending-chip button {
  width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
}

.chat-user-picker {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.chat-user-choice {
  display: grid;
  grid-template-columns: auto 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px;
  background: var(--search-bg);
}

.chat-user-choice small {
  color: var(--text-muted);
}

.chat-create-panel .field {
  padding: 12px 12px 0;
}

.chat-create-panel .primary-button {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
}

.chat-engine-note {
  margin: 0 12px 14px;
  font-size: 12px;
  line-height: 1.35;
}

.chat-create-close {
  display: none;
}

.chat-empty {
  color: var(--text-muted);
  padding: 18px;
  text-align: center;
}

.chat-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(245, 185, 31, .6);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text-main);
  background: var(--surface-bg);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .2);
}

.chat-toast strong,
.chat-toast span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-toast span {
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 1280px) {
  .chat-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .chat-create-panel {
    grid-column: 1 / -1;
    min-height: 260px;
  }
}

@media (max-width: 860px) {
  body.chat-page { overflow: auto; }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  body.chat-page .workspace {
    height: auto;
    min-height: 100vh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  body.chat-page .topbar {
    justify-content: flex-start;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 70;
  }

  .chat-mobile-menu {
    display: block;
  }

  .chat-list-panel,
  .chat-thread-panel,
  .chat-create-panel {
    min-height: 320px;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-compose textarea,
  .chat-compose .primary-button,
  .chat-attachment-picker,
  .chat-pending-attachments {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .chat-attachment-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-bubble {
    max-width: 92%;
  }
}

.primary-button {
  width: 100%;
  color: #111;
  font-weight: 800;
  background: linear-gradient(180deg, #ffd766, var(--gold));
  border-color: var(--gold-dark);
}

.details-heading .save-point-button {
  width: auto;
}

.point-admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-right: 120px;
}

.relocate-point-button,
.copy-point-link-button,
.share-point-button {
  width: auto;
  min-height: 42px;
  white-space: nowrap;
}

.legend {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 6px;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--silver);
}

.legend .dot {
  width: 11px;
  height: 11px;
  border-width: 2px;
}

.legend .dot.blocked::before,
.legend .dot.blocked::after {
  height: 2px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 3px solid currentColor;
  background: rgba(255, 255, 255, .06);
}

.dot.todo { color: var(--grey-point); }
.dot.planned {
  color: var(--blue-location);
  border-right-color: transparent;
  background: transparent;
  animation: plannedRingSpin 1.8s linear infinite;
}
.dot.planned.has-plan-label {
  border-right-color: currentColor;
  animation: none;
}
.dot.planned.has-plan-label::after {
  content: attr(data-plan-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 7px;
  font-weight: 950;
  line-height: 1;
}
.dot.lift {
  color: var(--red);
  background: var(--map-bg);
}
.dot.lift::after {
  content: attr(data-lift-percent);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 5.7px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.05em;
}
.dot.done {
  color: var(--green);
  background: currentColor;
}

.dot.partial_blocked {
  color: var(--blocked-symbol);
  background: linear-gradient(90deg, var(--green) 0 50%, var(--blocked-symbol) 50% 100%);
}

.dot.attention {
  color: var(--yellow);
  background: currentColor;
}

.dot.problem {
  color: var(--red);
  background: currentColor;
  animation: problemLegendPulse 1.05s ease-in-out infinite;
}

.dot.blocked {
  color: var(--blocked-symbol);
  background: var(--map-bg);
}

.dot.missing-column {
  color: #111;
  background: #fff;
}

.dot.missing-column::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.dot.blocked::before,
.dot.blocked::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
}

.dot.blocked::before { transform: translateY(-50%) rotate(45deg); }
.dot.blocked::after { transform: translateY(-50%) rotate(-45deg); }

@keyframes problemLegendPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.24); opacity: .66; }
}

@keyframes plannedRingSpin {
  to { transform: rotate(360deg); }
}

@keyframes plannedSvgSpin {
  to { stroke-dashoffset: -31; }
}

.app-version {
  position: fixed;
  right: 10px;
  bottom: 8px;
  z-index: 50;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  pointer-events: none;
}

.axis-side-panel {
  display: grid;
  gap: 9px;
  margin: 2px 0 4px;
  padding: 11px;
  border: 1px solid rgba(22, 136, 232, .34);
  border-radius: 10px;
  background: rgba(22, 136, 232, .06);
}

.missing-column-notice {
  display: grid;
  gap: 4px;
  margin: 2px 0 10px;
  padding: 12px;
  border: 1px solid #9aa4af;
  border-radius: 9px;
  background: linear-gradient(135deg, #fff, #edf1f4);
  color: #111820;
}

.missing-column-notice[hidden] { display: none !important; }
.missing-column-notice strong { font-size: 15px; }
.missing-column-notice span { color: #55616d; font-size: 13px; font-weight: 700; line-height: 1.35; }

[data-theme="dark"] .missing-column-notice {
  border-color: #737e89;
  background: linear-gradient(135deg, #1b2229, #11171d);
  color: #f5f7f9;
}

[data-theme="dark"] .missing-column-notice span { color: #b8c1ca; }

.axis-side-panel.pending {
  border-color: rgba(22, 136, 232, .78);
  box-shadow: 0 0 0 3px rgba(22, 136, 232, .12);
}

.axis-side-heading {
  display: grid;
  gap: 2px;
}

.axis-side-heading small,
.axis-side-tab small {
  color: var(--muted);
}

.axis-side-context {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
}

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

.axis-side-tab {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px 9px;
  text-align: left;
}

.axis-side-tab.qa-pending::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 22px solid var(--yellow);
  border-left: 22px solid transparent;
  pointer-events: none;
}

.axis-side-tab.active {
  border-color: var(--blue);
  background: rgba(22, 136, 232, .13);
  box-shadow: inset 0 0 0 2px rgba(22, 136, 232, .22);
}

.axis-side-tab.empty:not(.active) {
  border-style: dashed;
}

.point-hit.axis-side-pending .point-marker {
  stroke: var(--blue);
  stroke-width: 2.6px;
  filter: drop-shadow(0 0 5px rgba(22, 136, 232, .9));
}

.mobile-only { display: none; }
.desktop-only { display: inline-grid; }

@media (max-width: 860px) {
  body { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .desktop-only { display: none; }
  .workspace {
    height: calc(100vh - 66px);
    padding: max(10px, env(safe-area-inset-top)) 10px 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .mobile-only { display: inline-grid; }
  .topbar {
    min-height: 58px;
    padding: 8px;
    flex-wrap: wrap;
  }
  .topbar-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .topbar-search-actions {
    width: 100%;
  }
  .topbar-search-actions .search {
    min-width: 0;
    max-width: none;
  }
  .topbar p,
  .status-pill { display: none; }
  .top-actions { gap: 6px; }
  .theme-switch {
    min-height: 32px;
    padding: 0 8px;
    gap: 6px;
    font-size: 12px;
  }
  .theme-slider {
    width: 42px;
    height: 23px;
  }
  .theme-slider::before {
    width: 15px;
    height: 15px;
  }
  .theme-switch input:checked + .theme-slider::before {
    transform: translateX(20px);
  }
  h1 { font-size: 18px; }
  .control-strip {
    overflow-x: auto;
    min-height: 50px;
    flex-wrap: nowrap;
  }
  .control-strip.filter-panel {
    overflow-x: visible;
    min-height: 46px;
  }
  .filter-panel-body {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .search { min-width: 220px; }
  .view-actions {
    flex-wrap: nowrap;
  }
  .view-actions .action-button {
    min-width: 104px;
  }
  .coordinate-tools {
    flex-wrap: nowrap;
  }
  .derived-sector {
    min-width: 126px;
  }
  .content-grid {
    display: block;
    min-height: 0;
    height: 100%;
  }
  .map-card {
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
  }
  .map-viewport {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
  }
  .map-toolbar {
    grid-column: 1;
    grid-row: 1;
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    z-index: 5;
    border: 0;
    padding: 0;
    pointer-events: none;
  }
  .segmented { display: none; }
  .zoom-controls {
    margin-left: auto;
    display: grid;
    pointer-events: auto;
  }
  .details-panel {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 66px;
    max-height: 47vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(calc(100% - 132px));
    transition: transform .22s ease;
    padding: 18px 14px;
  }
  .details-panel.open { transform: translateY(0); }
  .close-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
  }
  .quick-actions,
  .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .legend { display: none; }
  .app-version {
    right: 8px;
    bottom: 72px;
  }
  .bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    height: 66px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--mobile-nav-bg);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .bottom-nav button {
    border: 0;
    color: var(--text-muted);
    background: transparent;
    display: grid;
    place-items: center;
    gap: 2px;
    font-size: 20px;
  }
  .bottom-nav button span { font-size: 11px; }
  .bottom-nav button.active { color: var(--gold); }
}

@media (max-width: 860px) {
  body.chat-page {
    min-height: 100dvh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.chat-page .app-shell {
    display: block;
    min-height: 100dvh;
    height: auto;
  }

  body.chat-page .workspace {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: max(8px, env(safe-area-inset-top)) 8px calc(18px + env(safe-area-inset-bottom));
  }

  body.chat-page .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 120;
  }

  body.chat-page .topbar h1 {
    font-size: 20px;
  }

  body.chat-page .topbar p,
  body.chat-page .top-actions {
    display: none;
  }

  body.chat-page .chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: visible;
  }

  body.chat-page .chat-list-panel,
  body.chat-page .chat-thread-panel,
  body.chat-page .chat-create-panel {
    min-height: auto;
    overflow: visible;
  }

  body.chat-page .chat-thread-panel {
    display: grid;
    grid-template-rows: auto minmax(260px, 52vh) auto;
  }

  body.chat-page .chat-messages,
  body.chat-page .chat-conversation-list,
  body.chat-page .chat-user-picker {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  body.chat-page .chat-mobile-menu-popover {
    left: 0;
    right: auto;
    max-height: min(74vh, 520px);
    overflow: auto;
  }

  body.chat-page .app-version {
    right: 14px;
    bottom: 10px;
  }
}

@media (max-width: 860px) {
  html.chat-page-root,
  html.chat-page-root body.chat-page {
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: static;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  html.chat-page-root body.chat-page .app-shell,
  html.chat-page-root body.chat-page .workspace,
  html.chat-page-root body.chat-page .chat-layout,
  html.chat-page-root body.chat-page .chat-list-panel,
  html.chat-page-root body.chat-page .chat-thread-panel {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.chat-page-root body.chat-page .workspace {
    display: block;
    padding: max(8px, env(safe-area-inset-top)) 8px calc(22px + env(safe-area-inset-bottom));
  }

  html.chat-page-root body.chat-page .chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 8px;
  }

  html.chat-page-root body.chat-page .chat-conversation-list,
  html.chat-page-root body.chat-page .chat-messages,
  html.chat-page-root body.chat-page .chat-user-picker {
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.chat-page-root body.chat-page .chat-thread-panel {
    display: grid;
    grid-template-rows: auto auto auto;
  }

  html.chat-page-root body.chat-page .chat-create-panel {
    display: none;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.chat-page-root body.chat-page.chat-create-open .chat-create-panel {
    display: grid;
    grid-template-rows: auto auto auto auto auto;
  }

  html.chat-page-root body.chat-page .chat-create-close {
    display: inline-grid;
  }
}
