:root {
  --bg: #ebe6dc;
  --bg-strong: #d9cfbe;
  --surface: rgba(255, 250, 242, 0.88);
  --surface-strong: #fff8ef;
  --line: rgba(69, 52, 34, 0.18);
  --text: #1f1a16;
  --muted: #5f584f;
  --primary: #8a3d18;
  --primary-strong: #5e240b;
  --success: #0f8a5f;
  --warning: #e18f1c;
  --danger: #c63d2f;
  --neutral: #324b56;
  --link-up: #0f8a5f;
  --link-down: #c63d2f;
  --link-idle: #64748b;
  --swap-up: #005fbe;
  --swap-down: #d9485f;
  --impact-failed: #c63d2f;
  --impact-redundant: #0f8a5f;
  --impact-alternative: #4169e1;
  --highlight-focus: #00a5ff;
  --highlight-recovery-color: #12b76a;
  --shadow: 0 18px 48px rgba(61, 42, 21, 0.16);
  --radius: 20px;
  --radius-sm: 14px;
  --install-banner-top: 16px;
}

@media (max-width: 760px) and (orientation: landscape) {
  .install-banner {
    left: auto;
    right: 10px;
    bottom: 60px;
    width: min(340px, calc(100vw - 20px));
    padding: 10px 12px;
  }
  .install-banner-copy .eyebrow {
    display: none;
  }
  .install-banner-copy strong {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .install-banner-copy p:last-child {
    font-size: 11px;
    line-height: 1.35;
  }
  .install-banner-actions button {
    min-height: 38px;
    font-size: 12px;
  }
}

body[data-theme="dark"] {
  --bg: #09111a;
  --bg-strong: #132031;
  --surface: rgba(13, 22, 34, 0.86);
  --surface-strong: #102031;
  --line: rgba(151, 170, 193, 0.2);
  --text: #ecf2fb;
  --muted: #97aac1;
  --primary: #e07a3d;
  --primary-strong: #f2a36b;
  --success: #29c27c;
  --warning: #f0b14a;
  --danger: #ff6a5c;
  --neutral: #86a7d9;
  --swap-up: #52a3ff;
  --swap-down: #ff8a80;
  --shadow: 0 18px 48px rgba(2, 6, 12, 0.42);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(198, 61, 47, 0.16), transparent 22%),
    radial-gradient(circle at top right, rgba(15, 138, 95, 0.18), transparent 20%),
    linear-gradient(135deg, #f5efe4 0%, var(--bg) 42%, #d6c6b1 100%);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(255, 106, 92, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(41, 194, 124, 0.12), transparent 22%),
    linear-gradient(135deg, #08111a 0%, #0b1521 42%, #111f30 100%);
}
button, input, select, textarea {
  font: inherit;
}
button, .file-trigger span {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
button:hover, .file-trigger span:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(94, 36, 11, 0.18);
}
button.secondary, .file-trigger.secondary span { background: var(--neutral); }
button.success { background: var(--success); }
button.danger { background: var(--danger); }
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
}
textarea { resize: vertical; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.label, .eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
}
.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}
.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  backdrop-filter: blur(16px);
  overflow-y: auto;
}
.workspace {
  padding: 28px;
  overflow-y: auto;
}
.app-mode .shell {
  grid-template-columns: 1fr;
}
.app-mode .sidebar {
  display: none;
}
.app-mode .workspace {
  padding: 18px;
  overflow: hidden;
}
.brand-mark {
  width: 66px;
  height: 66px;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(94, 36, 11, 0.18));
}
.brand h1, .topbar h2, .card-header h2, .card-header h3 {
  margin: 0;
}
.card, .hero-card, .panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.card {
  padding: 18px;
  margin-bottom: 16px;
}
.card.inset {
  background: rgba(245, 239, 228, 0.75);
  margin-top: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-header.compact {
  margin-bottom: 8px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack.compact { gap: 10px; }
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: "Consolas", "Liberation Mono", "Courier New", monospace;
  background: rgba(138, 61, 24, 0.14);
  color: var(--primary-strong);
}
.pill.neutral { background: rgba(50, 75, 86, 0.14); color: var(--neutral); }
.pill.warning { background: rgba(225, 143, 28, 0.16); color: #8f5b09; }
.pill.danger { background: rgba(198, 61, 47, 0.16); color: var(--danger); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.app-mode .topbar {
  position: fixed;
  top: 12px;
  left: 244px;
  right: 12px;
  z-index: 5200;
  margin-bottom: 0;
  padding: 7px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(43, 30, 17, 0.14);
}
.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}
.topbar-title-block {
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-mode .topbar h2 { font-size: 16px; line-height: 1.1; }
.topbar .eyebrow { margin-bottom: 0; font-size: 10px; }
.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}
.topbar-actions input { min-width: 180px; }
.topbar-actions select,
.topbar-actions button,
.topbar-actions input {
  height: 32px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}
.topbar-actions button,
.topbar-actions select {
  flex: 0 0 auto;
}
.topbar-actions #layoutPresetSelect {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}
.event-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar-inline-feed {
  flex: 1 1 220px;
  min-width: 150px;
  justify-content: flex-start;
  overflow: hidden;
  margin-left: 8px;
  margin-right: 8px;
}
.event-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(50, 75, 86, 0.12);
  color: var(--neutral);
}
.event-chip.danger { background: rgba(198, 61, 47, 0.14); color: var(--danger); }
.event-chip.success { background: rgba(15, 138, 95, 0.14); color: var(--success); }
.event-chip.warning { background: rgba(225, 143, 28, 0.18); color: #805007; }
.event-chip.neutral { background: rgba(50, 75, 86, 0.12); color: var(--neutral); }
.install-banner {
  position: fixed;
  top: var(--install-banner-top);
  right: 18px;
  z-index: 5500;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  backdrop-filter: blur(20px);
  box-shadow: 0 22px 44px rgba(42, 28, 14, 0.18);
}
.install-banner-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.install-banner-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(94, 36, 11, 0.16));
}
.install-banner-copy {
  min-width: 0;
}
.install-banner-copy strong {
  display: block;
  margin: 2px 0 6px;
  font-size: 15px;
}
.install-banner-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.install-banner-actions button {
  min-width: 104px;
}
.workspace-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-group-title {
  margin: 4px 8px 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mobile-nav-header,
.mobile-nav-close {
  display: none;
}
.mobile-menu-screen {
  display: none;
}
.mobile-nav-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mobile-nav-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-nav-link,
.mobile-nav-home {
  width: 100%;
  justify-content: flex-start;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}
.mobile-nav-home {
  background: rgba(138, 61, 24, 0.14);
  border-color: rgba(138, 61, 24, 0.24);
  color: var(--primary-strong);
}
.mobile-tabbar {
  display: none;
}
.mobile-tab-item {
  display: none;
}
.app-mode .workspace-menu {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 220px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5210;
  margin-bottom: 0;
  padding: 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(43, 30, 17, 0.14);
}
.workspace-menu button {
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--text);
  border: 1px solid rgba(69, 52, 34, 0.12);
  backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  overflow: hidden;
}
.mobile-menu-trigger {
  display: none;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mobile-more-trigger {
  display: none;
}
.mobile-actions-panel {
  display: contents;
}
.mobile-nav-scrim {
  display: none;
}
.nav-rail-toggle {
  font-size: 16px !important;
  padding: 6px !important;
  justify-content: center !important;
}
.nav-rail-item {
  position: relative;
  text-align: left;
}
.nav-rail-item.is-active {
  background: rgba(138, 61, 24, 0.14);
  border-color: rgba(138, 61, 24, 0.34);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(138, 61, 24, 0.08);
}
.nav-rail-item.is-active .nav-rail-icon {
  color: var(--primary);
}
.nav-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  color: var(--neutral);
}
.nav-rail-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-rail-item[data-window-target="dashboardPanel"] .nav-rail-icon svg,
.nav-rail-item[data-window-target="licenseCard"] .nav-rail-icon svg {
  fill: currentColor;
  stroke: none;
}
.dedicated-client-pin {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--dedicated-client-color, #0b5fff) 82%, #08223d), color-mix(in srgb, var(--dedicated-client-color, #53a3ff) 60%, white));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dedicated-client-color, #0b5fff) 22%, transparent), 0 0 14px color-mix(in srgb, var(--dedicated-client-color, #53a3ff) 60%, transparent);
}
.dedicated-client-pin span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.ixc-login-pin {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ixc-login-color, #0f8a5f) 55%, transparent));
}
.ixc-login-pin svg {
  width: 22px;
  height: 22px;
  display: block;
}
.ixc-login-pin svg path {
  fill: var(--ixc-login-color, #0f8a5f);
  stroke: #fff;
  stroke-width: 1.4;
  paint-order: stroke fill;
}
.ixc-login-pin-highlighted {
  transform: scale(1.18);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--ixc-login-color, #00a5ff) 75%, transparent));
}
.ixc-cluster-pin {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--ixc-cluster-color, #0f8a5f) 84%, #101418 16%);
  border: 2px solid rgba(255,255,255,0.92);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ixc-cluster-color, #0f8a5f) 18%, transparent), 0 10px 20px rgba(16,20,24,0.24);
}
.ixc-cluster-pin span {
  line-height: 1;
}
.ixc-popup {
  min-width: 220px;
}
.ixc-popup a {
  color: var(--accent);
  font-weight: 600;
}
.playbook-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.playbook-step {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(69, 52, 34, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
}
.playbook-step.done {
  border-color: color-mix(in srgb, var(--color-recovery) 32%, transparent);
}
.playbook-step.in_progress {
  border-color: color-mix(in srgb, var(--color-highlight) 32%, transparent);
}
.playbook-step.skipped {
  opacity: 0.78;
}
.playbook-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.playbook-step p {
  margin: 6px 0 0;
}
.playbook-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.playbook-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(69, 52, 34, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
}
.playbook-summary p {
  margin: 8px 0 0;
}
.playbook-modal-content {
  max-height: min(88vh, 920px);
  overflow: auto;
}
.playbook-modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
.playbook-modal-meta .meta-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(69, 52, 34, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
}
.playbook-modal-meta .meta-card .label {
  margin: 0 0 4px;
}
.rfo-data-panel {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(69, 52, 34, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
}
.rfo-template-meta {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(69, 52, 34, 0.14);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}
.nav-rail-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-rail-collapsed .workspace-menu,
.workspace-menu.is-collapsed {
  width: 56px;
  padding: 8px;
  overflow: hidden;
}
.nav-rail-collapsed .workspace-menu .nav-rail-item,
.workspace-menu.is-collapsed .nav-rail-item {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}
.nav-rail-collapsed .workspace-menu .nav-rail-label,
.workspace-menu.is-collapsed .nav-rail-label {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0 !important;
}
.nav-rail-collapsed .workspace-menu .nav-rail-item,
.workspace-menu.is-collapsed .nav-rail-item {
  gap: 0;
}
.nav-rail-collapsed .workspace-menu .nav-rail-toggle,
.workspace-menu.is-collapsed .nav-rail-toggle {
  transform: rotate(180deg);
}
.nav-rail-collapsed .workspace-menu .nav-rail-icon,
.workspace-menu.is-collapsed .nav-rail-icon {
  margin-right: 0;
}
.nav-rail-collapsed .nav-group-title,
.workspace-menu.is-collapsed .nav-group-title {
  display: none;
}
.workspace-menu.is-collapsed .nav-rail-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(31, 26, 22, 0.94);
  color: #fff8ef;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(15, 9, 4, 0.28);
  pointer-events: none;
  z-index: 20;
}
.workspace-menu.is-collapsed .nav-rail-item:hover::before {
  content: "";
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent rgba(31, 26, 22, 0.94) transparent transparent;
  pointer-events: none;
  z-index: 20;
}
.nav-rail-collapsed .topbar {
  left: 76px;
}
.menu-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 6px;
  color: #fff;
  font-size: 10px;
  font-family: "Consolas", "Liberation Mono", "Courier New", monospace;
}
.menu-badge.danger { background: var(--danger); }
.menu-badge.warning { background: var(--warning); color: #382200; }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.hero-card {
  padding: 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.hero-card strong {
  font-size: 42px;
  line-height: 1;
}
.hero-card.accent {
  background: linear-gradient(145deg, rgba(138, 61, 24, 0.92), rgba(94, 36, 11, 0.94));
  color: #fff;
}
.hero-card.accent .label,
.hero-card.accent span { color: rgba(255,255,255,0.8); }
.hero-card.warning { background: rgba(198, 61, 47, 0.12); }
.panel-grid, .app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.app-mode .app-grid {
  display: block;
  position: relative;
  min-height: 100vh;
}
.panel.wide, .panel.full-map { grid-column: 1 / -1; }
.panel { padding: 18px; }
.full-map { min-height: 720px; }
.app-mode #mapPanel {
  position: fixed;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-mode #mapPanel > .card-header {
  display: none;
}
.app-mode #map {
  min-height: 100vh;
  height: 100vh;
  position: relative;
  z-index: 1;
  border-radius: 0;
  border: 0;
}
.app-mode .leaflet-top {
  top: 76px;
}
.app-mode .leaflet-right {
  right: 14px;
}
.app-mode .leaflet-bottom {
  bottom: 14px;
}
.app-mode .leaflet-control {
  margin: 0 0 12px 12px;
}
.app-mode .leaflet-control-geocoder {
  max-width: min(340px, calc(100vw - 320px));
  width: min(340px, calc(100vw - 320px));
}
.app-mode .leaflet-control-geocoder-form input {
  min-height: 38px;
}
.app-mode .leaflet-control-layers {
  max-width: min(260px, calc(100vw - 40px));
}
#windowLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5300;
}
.window-panel {
  position: absolute;
  width: min(360px, calc(100vw - 32px));
  max-height: min(66vh, 720px);
  overflow: auto;
  pointer-events: auto;
  backdrop-filter: blur(18px);
  z-index: 5310;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow:
    0 24px 54px rgba(30, 20, 10, 0.22),
    0 0 0 1px rgba(138, 61, 24, 0.05);
}
.window-drag-handle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  margin: -8px -8px 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: grab;
  background: linear-gradient(180deg, rgba(50, 75, 86, 0.12), rgba(50, 75, 86, 0.04));
}
.window-drag-handle:active {
  cursor: grabbing;
}
.window-drag-grip {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(31, 26, 22, 0.45) 1px, transparent 1.5px) center/6px 6px;
}
.window-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.window-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.window-panel.window-minimized {
  height: auto;
  max-height: none;
  overflow: hidden;
}
.window-panel.window-minimized > :not(.window-drag-handle):not(.card-header) {
  display: none !important;
}
.window-panel.window-minimized .card-header {
  margin-bottom: 0;
}
.window-panel.window-maximized {
  width: calc(100vw - 32px) !important;
  max-width: none;
  height: calc(100vh - 130px);
  max-height: none;
}
#dashboardPanel.window-panel {
  width: min(460px, calc(100vw - 32px));
}
#auditPanel.window-panel,
#incidentsPanel.window-panel,
#maintenancesPanel.window-panel,
#usersPanel.window-panel {
  width: min(420px, calc(100vw - 32px));
}
#notificationsPanel.window-panel {
  width: min(380px, calc(100vw - 32px));
}
#filtersPanel.window-panel,
#timelinePanel.window-panel,
#appearancePanel.window-panel {
  width: min(400px, calc(100vw - 32px));
}
.window-panel .card-header {
  margin-bottom: 10px;
}
.window-panel .card-header h2 { font-size: 18px; }
.window-panel .card-header h3 { font-size: 15px; }
.window-panel .icon-btn {
  width: 30px;
  height: 30px;
}
.window-panel .list {
  max-height: 240px;
}
.window-panel input,
.window-panel select,
.window-panel textarea,
.window-panel button,
.window-panel .file-trigger span {
  padding: 9px 10px;
  font-size: 13px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(69, 52, 34, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
}
.color-field span {
  font-size: 12px;
  color: var(--muted);
}
.color-field input[type="color"] {
  width: 42px;
  min-width: 42px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.window-panel .mini-card {
  padding: 10px;
}
.window-panel .mini-card strong {
  font-size: 22px;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mini-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  border: 1px solid rgba(69, 52, 34, 0.08);
}
.mini-card strong {
  font-size: 28px;
  line-height: 1;
}
#map {
  width: 100%;
  min-height: 640px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(69, 52, 34, 0.12);
}
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
}
.list-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  border: 1px solid rgba(69, 52, 34, 0.08);
}
.list-item.clickable {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.list-item.clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 61, 24, 0.24);
  box-shadow: 0 10px 22px rgba(43, 30, 17, 0.1);
}
.list-item strong, .list-item p { display: block; }
.list-item p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.comment-list {
  margin: 10px 0;
  padding-left: 18px;
  color: var(--muted);
}
.comment-list li {
  margin-bottom: 6px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(198, 61, 47, 0.12);
  color: var(--danger);
  font-size: 13px;
}
.chip button {
  padding: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}
.chip-neutral {
  background: rgba(50, 75, 86, 0.12);
  color: var(--neutral);
  border: 1px solid rgba(50, 75, 86, 0.16);
}
.link-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.embed-body {
  margin: 0;
  overflow: hidden;
}
.embed-shell {
  position: fixed;
  inset: 0;
}
.embed-overlay {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 6000;
}
.embed-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
#embedMap {
  width: 100vw;
  height: 100vh;
}
.link-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding-right: 2px;
}
.link-picker-option {
  width: 100%;
  justify-content: flex-start;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  color: var(--text);
  border: 1px solid rgba(69, 52, 34, 0.08);
  box-shadow: none;
}
.link-picker-empty {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  background: color-mix(in srgb, var(--surface-strong) 64%, transparent);
  border: 1px dashed rgba(69, 52, 34, 0.12);
}
.trigger-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.incident-header-tags {
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.timeline-item {
  border-left: 4px solid rgba(50, 75, 86, 0.2);
}
.timeline-item.danger {
  border-left-color: rgba(198, 61, 47, 0.82);
}
.timeline-item.warning {
  border-left-color: rgba(225, 143, 28, 0.9);
}
.timeline-item.success {
  border-left-color: rgba(15, 138, 95, 0.84);
}
.timeline-item.neutral {
  border-left-color: rgba(50, 75, 86, 0.5);
}
.timeline-item span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.inline-actions button {
  flex: 1 1 180px;
}
.file-trigger input { display: none; }
.file-trigger span { display: block; text-align: center; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 17, 14, 0.48);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 5000;
}
.modal-content {
  width: min(620px, 100%);
  background: var(--surface-strong);
  border-radius: 26px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
}
.modal-content.wide { width: min(880px, 100%); }
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
#toastHost {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: rgba(31, 26, 22, 0.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  min-width: 260px;
  box-shadow: var(--shadow);
}
.toast.error { background: rgba(198, 61, 47, 0.94); }
.toast.success { background: rgba(15, 138, 95, 0.94); }
.noc-tooltip {
  background: rgba(25, 22, 18, 0.9) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px;
  font-family: "Consolas", "Liberation Mono", "Courier New", monospace;
}
.offline-tile {
  width: 256px;
  height: 256px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(0deg, rgba(111, 92, 68, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 92, 68, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(245, 239, 228, 0.95), rgba(214, 198, 177, 0.92));
  background-size: 32px 32px, 32px 32px, auto;
  color: rgba(50, 75, 86, 0.72);
  font-family: "Consolas", "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}
.offline-tile span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.78);
  border: 1px solid rgba(69, 52, 34, 0.1);
}
.dimmed-element { opacity: 0.14 !important; }
.highlight-element {
  stroke: var(--highlight-focus) !important;
  stroke-width: 8px !important;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--highlight-focus) 68%, transparent)) !important;
  opacity: 1 !important;
}
.highlight-recovery {
  stroke: var(--highlight-recovery-color) !important;
  stroke-width: 8px !important;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--highlight-recovery-color) 68%, transparent)) !important;
  opacity: 1 !important;
}
.highlight-pop {
  transform: scale(1.8) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--highlight-focus) 72%, transparent) !important;
}
.impact-alt-neon {
  stroke: var(--impact-alternative) !important;
  filter:
    drop-shadow(0 0 6px color-mix(in srgb, var(--impact-alternative) 95%, transparent))
    drop-shadow(0 0 14px color-mix(in srgb, var(--impact-alternative) 82%, transparent))
    drop-shadow(0 0 22px color-mix(in srgb, var(--impact-alternative) 60%, transparent)) !important;
}
.link-hit-area {
  cursor: pointer;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-up { stroke-dasharray: 10, 14 !important; animation: flow-anim .9s linear infinite !important; }
.pulse-down { animation: pulse-anim .85s ease-in-out infinite alternate !important; }
.pop-down { animation: pop-anim-down .7s infinite alternate !important; }
@keyframes flow-anim { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes pulse-anim { from { opacity: 1; } to { opacity: .45; stroke-width: 10px; stroke: var(--link-down) !important; } }
@keyframes pop-anim-down { from { transform: scale(1); } to { transform: scale(1.55); } }

#map:fullscreen,
#map:-webkit-full-screen {
  min-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: 0;
  width: 100vw;
  background: #111;
}

@media (max-width: 1200px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(69, 52, 34, 0.1); }
  .hero-grid, .panel-grid, .app-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .topbar-actions input { min-width: 0; }
  .topbar-main {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-inline-feed {
    justify-content: flex-start;
  }
  .workspace-menu { position: static; flex-direction: row; flex-wrap: wrap; width: auto; }
  .window-panel {
    position: static;
    width: 100%;
    max-height: none;
    margin-bottom: 16px;
  }
  #windowLayer {
    position: static;
  }
  .app-mode .app-grid {
    min-height: auto;
  }
  .app-mode #mapPanel,
  .app-mode #map {
    min-height: 60vh;
  }
  .app-mode .topbar {
    left: 12px;
  }
  .app-mode .workspace-menu {
    width: auto;
    padding: 8px;
  }
}

@media (max-width: 980px) {
  .workspace {
    padding: 20px 16px;
  }
  .app-mode .workspace {
    padding: 84px 12px 12px;
    overflow: auto;
  }
  .topbar-main {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .topbar-title-block {
    width: 100%;
  }
  .topbar-inline-feed {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
  }
  .topbar-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: stretch;
    margin-left: 0;
  }
  .topbar-actions input {
    flex: 1 1 100%;
  }
  .topbar-actions select,
  .topbar-actions button {
    flex: 1 1 calc(50% - 8px);
  }
  .topbar-actions #layoutPresetSelect {
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .install-banner {
    right: 12px;
    width: min(400px, calc(100vw - 24px));
  }
}

@media (max-width: 760px) {
  body.mobile-nav-open,
  body.mobile-actions-open {
    overflow: hidden;
  }
  .mobile-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-more-trigger {
    display: none;
  }
  .app-mode .leaflet-top {
    top: 66px;
  }
  .app-mode .leaflet-top.leaflet-right,
  .app-mode .leaflet-bottom.leaflet-right {
    right: 10px;
    left: auto;
  }
  .app-mode .leaflet-top.leaflet-left,
  .app-mode .leaflet-bottom.leaflet-left {
    left: 10px;
    right: auto;
  }
  .app-mode .leaflet-bottom {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .app-mode .leaflet-control {
    margin: 0 0 10px 10px;
  }
  .app-mode .leaflet-control-layers {
    box-shadow: 0 10px 24px rgba(17, 22, 28, 0.16);
  }
  .app-mode .leaflet-control-geocoder {
    width: 42px;
    max-width: 42px;
    overflow: hidden;
    transition: width 0.18s ease, max-width 0.18s ease;
  }
  .app-mode .leaflet-bottom .leaflet-control-geocoder {
    margin-bottom: 56px;
  }
  .app-mode .leaflet-control-geocoder-form input {
    min-height: 42px;
  }
  .app-mode .leaflet-control-geocoder .leaflet-control-geocoder-form {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-width 0.18s ease, opacity 0.18s ease;
  }
  .app-mode .leaflet-control-geocoder.leaflet-control-geocoder-expanded {
    width: min(300px, calc(100vw - 20px));
    max-width: min(300px, calc(100vw - 20px));
  }
  .app-mode .leaflet-control-geocoder.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
    max-width: min(240px, calc(100vw - 88px));
    opacity: 1;
    pointer-events: auto;
  }
  .app-mode .leaflet-control-layers-expanded {
    max-height: min(42vh, 280px);
    overflow: auto;
  }
  .app-mode .topbar {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 8px 10px;
    z-index: 5240;
  }
  .install-banner {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    width: auto;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
  }
  .app-mode .install-banner {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  .install-banner-brand {
    align-items: center;
  }
  .install-banner-logo {
    width: 42px;
    height: 42px;
  }
  .install-banner-copy strong {
    font-size: 14px;
  }
  .install-banner-copy p:last-child {
    font-size: 12px;
  }
  .install-banner-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .install-banner-actions button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
  }
  .topbar-row {
    flex-wrap: wrap;
  }
  .topbar-row h2 {
    font-size: 14px;
  }
  .topbar .eyebrow {
    display: none;
  }
  #hudBadge {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .topbar-inline-feed {
    display: none;
  }
  .topbar-actions {
    position: relative;
    gap: 6px;
  }
  .topbar-actions input {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 40px;
  }
  .mobile-actions-panel {
    display: none !important;
  }
  .app-mode .workspace-menu {
    display: none !important;
  }
  .mobile-menu-screen {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 5320;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(84px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 99%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)),
      radial-gradient(circle at top right, rgba(138, 61, 24, 0.1), transparent 30%);
  }
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid rgba(69, 52, 34, 0.12);
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--surface-strong) 98%, transparent);
    z-index: 2;
  }
  .mobile-nav-header strong {
    display: block;
    font-size: 15px;
  }
  .mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
  }
  .mobile-menu-screen .nav-group-title {
    margin: 0 4px;
    font-size: 10px;
  }
  .mobile-nav-section + .mobile-nav-section {
    border-top: 1px solid rgba(69, 52, 34, 0.08);
    padding-top: 18px;
  }
  .mobile-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 5310;
    background: rgba(9, 17, 26, 0.18);
  }
  body.mobile-nav-open .mobile-nav-scrim {
    display: block;
  }
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5250;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
    border-top: 1px solid rgba(69, 52, 34, 0.12);
    box-shadow: 0 -12px 26px rgba(17, 22, 28, 0.1);
  }
  .mobile-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 11px;
    letter-spacing: 0.03em;
  }
  .mobile-tab-item.is-active {
    background: rgba(138, 61, 24, 0.14);
    border-color: rgba(138, 61, 24, 0.24);
    color: var(--primary-strong);
  }
  #windowLayer {
    position: fixed;
    inset: 50px 0 72px;
    z-index: 5200;
    pointer-events: none;
  }
  .window-panel,
  #dashboardPanel.window-panel,
  #auditPanel.window-panel,
  #incidentsPanel.window-panel,
  #maintenancesPanel.window-panel,
  #usersPanel.window-panel,
  #notificationsPanel.window-panel,
  #filtersPanel.window-panel,
  #timelinePanel.window-panel,
  #appearancePanel.window-panel {
    position: absolute;
    inset: 12px 12px 12px 12px;
    width: auto;
    max-height: none;
    margin-bottom: 0;
    overflow: auto;
    pointer-events: auto;
  }
  .window-panel.window-maximized {
    width: auto !important;
    height: auto;
  }
  .window-drag-handle {
    cursor: default;
    margin: -8px -8px 12px;
    padding: 10px 12px;
    border-radius: 16px;
    position: sticky;
    top: -8px;
    z-index: 2;
  }
  .window-panel .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .window-panel {
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(17, 22, 28, 0.12);
    background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
  }
  .window-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .full-map,
  #map {
    min-height: calc(100vh - 116px);
  }
  .hero-grid,
  .panel-grid,
  .app-grid,
  .form-grid,
  .color-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 10px;
  }
  .modal-content,
  .modal-content.wide {
    width: 100%;
    padding: 16px;
    border-radius: 20px;
  }
  input,
  select,
  textarea,
  button,
  .file-trigger span {
    min-height: 44px;
  }
  .inline-actions button {
    flex: 1 1 100%;
  }
  .list {
    max-height: none;
  }
  .list-item p {
    font-size: 13px;
    line-height: 1.45;
  }
  .chip {
    min-height: 40px;
    align-items: center;
  }
  .event-chip {
    white-space: nowrap;
  }
  #toastHost {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    min-width: 0;
  }
}

@media (max-width: 1400px) and (max-height: 900px) and (orientation: landscape) {
  body.mobile-nav-open,
  body.mobile-actions-open {
    overflow: hidden;
  }
  .mobile-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-more-trigger,
  .mobile-actions-panel {
    display: none !important;
  }
  .topbar-inline-feed {
    display: none;
  }
  .app-mode .workspace-menu {
    display: none !important;
  }
  .app-mode .topbar {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 8px 10px;
    z-index: 5240;
  }
  .topbar-main {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .topbar-title-block {
    min-width: 0;
    flex: 0 0 auto;
  }
  .topbar-row {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .topbar-row h2 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  .topbar-actions input {
    flex: 1 1 auto;
    min-width: 140px;
    min-height: 38px;
  }
  .topbar-actions #layoutPresetSelect,
  .topbar-actions #loadLayoutPresetBtn,
  .topbar-actions #saveLayoutPresetBtn,
  .topbar-actions #saveLayoutBtn,
  .topbar-actions #resetLayoutBtn,
  .topbar-actions #toggleNavRailBtn,
  .topbar-actions #topbarLogoutBtn {
    display: none !important;
  }
  .mobile-menu-screen {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 5320;
    padding: 12px 16px 78px;
    overflow-y: auto;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 99%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)),
      radial-gradient(circle at top right, rgba(138, 61, 24, 0.1), transparent 30%);
  }
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid rgba(69, 52, 34, 0.12);
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--surface-strong) 98%, transparent);
    z-index: 2;
  }
  .mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
  }
  .mobile-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 5310;
    background: rgba(9, 17, 26, 0.18);
  }
  body.mobile-nav-open .mobile-nav-scrim {
    display: block;
  }
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5250;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px 10px;
    background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
    border-top: 1px solid rgba(69, 52, 34, 0.12);
    box-shadow: 0 -12px 26px rgba(17, 22, 28, 0.1);
  }
  .mobile-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: 10px;
    letter-spacing: 0.03em;
  }
  .mobile-tab-item.is-active {
    background: rgba(138, 61, 24, 0.14);
    border-color: rgba(138, 61, 24, 0.24);
    color: var(--primary-strong);
  }
  #windowLayer {
    position: fixed;
    inset: 48px 0 58px;
    z-index: 5200;
    pointer-events: none;
  }
  .window-panel {
    position: absolute;
    inset: 8px;
    width: auto;
    max-height: none;
    margin-bottom: 0;
    overflow: auto;
    pointer-events: auto;
    border-radius: 18px;
  }
  .window-panel.window-maximized {
    width: auto !important;
    height: auto;
  }
  .app-mode .leaflet-top {
    top: 50px;
  }
  .app-mode .leaflet-top.leaflet-right,
  .app-mode .leaflet-bottom.leaflet-right {
    right: 8px;
    left: auto;
  }
  .app-mode .leaflet-top.leaflet-left,
  .app-mode .leaflet-bottom.leaflet-left {
    left: 8px;
    right: auto;
  }
  .app-mode .leaflet-bottom {
    bottom: 62px;
  }
  .app-mode .leaflet-control-layers {
    box-shadow: 0 10px 24px rgba(17, 22, 28, 0.16);
  }
  .app-mode .leaflet-control-geocoder {
    width: 40px;
    max-width: 40px;
    overflow: hidden;
    transition: width 0.18s ease, max-width 0.18s ease;
  }
  .app-mode .leaflet-bottom .leaflet-control-geocoder {
    margin-bottom: 54px;
  }
  .app-mode .leaflet-control-geocoder .leaflet-control-geocoder-form {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-width 0.18s ease, opacity 0.18s ease;
  }
  .app-mode .leaflet-control-geocoder.leaflet-control-geocoder-expanded {
    width: min(260px, calc(100vw - 16px));
    max-width: min(260px, calc(100vw - 16px));
  }
  .app-mode .leaflet-control-geocoder.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
    max-width: min(210px, calc(100vw - 74px));
    opacity: 1;
    pointer-events: auto;
  }
  .app-mode .leaflet-control-layers-expanded {
    max-height: min(46vh, 220px);
    overflow: auto;
  }
  .full-map,
  #map {
    min-height: calc(100vh - 58px);
  }
}
