:root {
  --chrome-height: 60px;
  --sidebar-width-expanded: 300px;
  --sidebar-width-collapsed: 64px;
  --sidebar-visible-width: 64px;
  --salvi-black: #1E1E1E;
  --salvi-grey: #6A6A6A;
  --salvi-cream: #FCF9F5;
  --salvi-surface: #F7F4EF;
  --salvi-surface-white: #FFFFFF;
  --salvi-line: #E8E2D8;
  --salvi-muted: #A09A91;
  --state-success: #1F7A4D;
  --state-warning: #B7791F;
  --state-danger: #B42318;
  --state-info: #4A5568;
  --font-brand: 'Exposure', Georgia, serif;
  --font-ui: 'Inter', 'Helvetica Neue', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(30, 30, 30, 0.06), 0 8px 24px rgba(30, 30, 30, 0.04);
  --shadow-panel: 0 8px 32px rgba(30, 30, 30, 0.08);
  --bg:       #060b12;
  --bg2:      #0a1220;
  --bg3:      #0f1a2e;
  --bg4:      #152240;
  --bg5:      #1c2d52;
  --border:   #1a2a44;
  --border2:  #243660;
  --text:     #c8ddf4;
  --text2:    #6888aa;
  --text3:    #2e4a6a;
  --mv:       #f59e0b;
  --mv2:      #92600a;
  --lv:       #3b82f6;
  --lv2:      #1d4ed8;
  --tx:       #8b5cf6;
  --tx2:      #5b21b6;
  --hh:       #10b981;
  --hh2:      #065f46;
  --red:      #ef4444;
  --white:    #e8f4ff;
  --gold:     #fbbf24;
  --brand:    #1a16ff;
  --brand2:   #3a37ff;
  --brand-soft: rgba(26, 22, 255, 0.10);
  --brand-border: rgba(26, 22, 255, 0.24);
  --overlay-panel-bg: rgba(10, 18, 32, 0.94);
  --overlay-panel-border: rgba(54, 80, 120, 0.82);
  --overlay-panel-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --overlay-scrollbar-track: rgba(255, 255, 255, 0.045);
  --overlay-scrollbar-thumb: rgba(104, 136, 170, 0.42);
  --overlay-scrollbar-thumb-hover: rgba(148, 191, 255, 0.4);
  --overlay-scrollbar-thumb-border: rgba(10, 18, 32, 0.92);
}

body[data-theme='light'] {
  --bg:       #FCF9F5;
  --bg2:      #FFFFFF;
  --bg3:      #F7F4EF;
  --bg4:      #FFFDFC;
  --bg5:      #F1EAE0;
  --border:   #E8E2D8;
  --border2:  #DDD4C8;
  --text:     #1E1E1E;
  --text2:    #6A6A6A;
  --text3:    #A09A91;
  --mv:       #B7791F;
  --mv2:      #8F631F;
  --lv:       #4A5568;
  --lv2:      #364152;
  --tx:       #1E1E1E;
  --tx2:      #4B4B4B;
  --hh:       #1F7A4D;
  --hh2:      #176640;
  --red:      #B42318;
  --white:    #1E1E1E;
  --gold:     #B7791F;
  --brand:    #1E1E1E;
  --brand2:   #3A3836;
  --brand-soft: rgba(30, 30, 30, 0.05);
  --brand-border: rgba(30, 30, 30, 0.08);
  --overlay-panel-bg: rgba(255, 255, 255, 0.96);
  --overlay-panel-border: rgba(232, 226, 216, 0.96);
  --overlay-panel-shadow: 0 18px 36px rgba(30, 30, 30, 0.12);
  --overlay-scrollbar-track: rgba(232, 226, 216, 0.7);
  --overlay-scrollbar-thumb: rgba(160, 154, 145, 0.44);
  --overlay-scrollbar-thumb-hover: rgba(106, 106, 106, 0.36);
  --overlay-scrollbar-thumb-border: rgba(255, 255, 255, 0.96);
}

body[data-theme='dark-2'] {
  --bg:       #0d1117;
  --bg2:      #131922;
  --bg3:      #18202b;
  --bg4:      #1f2936;
  --bg5:      #273344;
  --border:   #253142;
  --border2:  #344255;
  --text:     #edf2f7;
  --text2:    #a2b0c2;
  --text3:    #5f7086;
  --mv:       #fbbf24;
  --mv2:      #d3951d;
  --lv:       #7dd3fc;
  --lv2:      #38bdf8;
  --tx:       #f9a8d4;
  --tx2:      #f472b6;
  --hh:       #34d399;
  --hh2:      #10b981;
  --red:      #f87171;
  --white:    #f8fafc;
  --gold:     #fbbf24;
  --brand:    #e5edf8;
  --brand2:   #f8fafc;
  --brand-soft: rgba(248, 250, 252, 0.08);
  --brand-border: rgba(248, 250, 252, 0.16);
  --overlay-panel-bg: rgba(19, 25, 34, 0.96);
  --overlay-panel-border: rgba(52, 66, 85, 0.9);
  --overlay-panel-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  --overlay-scrollbar-track: rgba(255, 255, 255, 0.04);
  --overlay-scrollbar-thumb: rgba(162, 176, 194, 0.4);
  --overlay-scrollbar-thumb-hover: rgba(237, 242, 247, 0.28);
  --overlay-scrollbar-thumb-border: rgba(19, 25, 34, 0.96);
}

@media (min-width: 768px) {
  :root {
    --chrome-height: 64px;
    --radius-xs: 2px;
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --shadow-card: 0 1px 2px rgba(30, 30, 30, 0.05), 0 6px 18px rgba(30, 30, 30, 0.04);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color .2s ease, color .2s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: var(--bg);
}

.login-landing.hidden {
  display: none;
}

.login-landing__panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 420px);
  gap: 28px;
  align-items: stretch;
}

.login-landing__brand,
.login-landing__card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg2);
  box-shadow: var(--shadow-panel);
}

.login-landing__brand {
  position: relative;
  overflow: hidden;
  padding: var(--space-6);
  background: var(--bg3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-landing__logo-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.login-landing__logo {
  width: min(520px, 100%);
  height: auto;
  display: block;
  transition: filter .2s ease, opacity .2s ease;
}
body[data-theme='light'] .login-landing__logo {
  filter: none;
}
body[data-theme='light'] .login-landing__logo-sub {
  color: var(--text);
  text-shadow: none;
}

.login-landing__logo-sub {
  font-family: var(--font-brand);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
  color: var(--text);
  text-align: center;
}
.login-landing__brand-note {
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--text2);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
body[data-theme='light'] .login-landing__brand-note {
  background: var(--bg2);
  color: var(--text2);
}

.login-landing__eyebrow {
  margin-top: 28px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--mv);
  font-family: 'JetBrains Mono', monospace;
}

.login-landing__title {
  margin: 12px 0 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(38px, 5vw, 64px);
  line-height: .95;
  letter-spacing: .4px;
}

.login-landing__copy {
  margin: 0;
  max-width: 560px;
  color: var(--text2);
  font-size: 15px;
  line-height: 1.75;
}

.login-landing__highlights {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.login-landing__highlight {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme='light'] .login-landing__highlight {
  background: rgba(255, 255, 255, 0.72);
}

.login-landing__highlight strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.login-landing__highlight span {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}

.login-landing__card {
  padding: var(--space-6);
  align-self: center;
}

.login-landing__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-dropdown-shell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.theme-dropdown-shell--topbar {
  padding: 0 0 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg3);
}

.theme-dropdown-label {
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.theme-dropdown {
  position: relative;
  min-width: 0;
}

.theme-dropdown[open] {
  z-index: 80;
}

.theme-dropdown summary {
  list-style: none;
}

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

.theme-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 122px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.theme-dropdown-trigger:hover,
.theme-dropdown[open] .theme-dropdown-trigger {
  border-color: var(--border);
  background: var(--bg2);
}

.theme-dropdown-value {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.theme-dropdown-caret {
  flex-shrink: 0;
  color: var(--text3);
  font-size: 12px;
  transition: transform .15s ease, color .15s ease;
}

.theme-dropdown[open] .theme-dropdown-caret {
  color: var(--text);
  transform: rotate(180deg);
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 81;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--overlay-panel-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--overlay-panel-bg) 94%, transparent);
  box-shadow: var(--overlay-panel-shadow);
  backdrop-filter: blur(18px);
}

.theme-dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.theme-dropdown-option:hover {
  border-color: rgba(59,130,246,.22);
  background: rgba(59,130,246,.1);
  transform: translateY(-1px);
}

.theme-dropdown-option.is-active {
  border-color: rgba(79,195,247,.34);
  background: rgba(59,130,246,.14);
}

.theme-dropdown-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.theme-dropdown-option-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.theme-dropdown-option-note {
  color: var(--text2);
  font-size: 11px;
  line-height: 1.35;
}

.theme-dropdown-option-check {
  flex-shrink: 0;
  opacity: 0;
  color: var(--brand2);
  font-size: 14px;
}

.theme-dropdown-option.is-active .theme-dropdown-option-check {
  opacity: 1;
}

.login-landing__submit.btn-mv {
  min-width: 160px;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}
.login-landing__submit.btn-mv:hover {
  background: var(--brand2);
  transform: translateY(-1px);
}

/* ── SHELL ── */
.shell { display: flex; height: 100vh; background: var(--bg); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width-expanded);
  background: var(--bg3);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .22s cubic-bezier(.4,0,.2,1);
}
.sidebar.is-collapsed {
  width: var(--sidebar-width-collapsed);
}

/* ── SIDEBAR TOGGLE BUTTON ── */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--chrome-height);
  padding: 0 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg2); }
.sidebar-toggle-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--text2);
  transition: opacity .15s;
}
.sidebar.is-collapsed .sidebar-toggle { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sidebar-toggle-label { opacity: 0; width: 0; overflow: hidden; }

/* ── SIDEBAR COLLAPSED STATE ── */
.sidebar.is-collapsed .sidebar-head { display: none; }
.sidebar.is-collapsed .nav-sec { display: none; }
.sidebar.is-collapsed .nav-label { display: none; }
.sidebar.is-collapsed .nav-badge-group { display: none; }
.sidebar.is-collapsed .nav-item {
  padding: 10px 0;
  justify-content: center;
  margin: 2px 8px;
}
.sidebar.is-collapsed .sidebar-foot { padding: 10px 0; justify-content: center; }
.sidebar.is-collapsed .role-pill { display: none; }

/* tooltip on hover when collapsed */
.sidebar.is-collapsed .nav-item { position: relative; }
.sidebar.is-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  box-shadow: var(--shadow-card);
  font-family: var(--font-ui);
}
.sidebar.is-collapsed .nav-item:hover::after { opacity: 1; }
.sidebar-head {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg2);
  box-shadow: var(--shadow-card);
}
.sidebar-brand-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.sidebar-brand-logo {
  display: block;
  width: 144px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter .2s ease, opacity .2s ease;
}
body[data-theme='light'] .sidebar-brand-logo {
  filter: none;
}
body[data-theme='light'] .sidebar-brand-sub {
  color: var(--text2);
}
.sidebar-brand-sub {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text2);
  font-family: var(--font-mono);
}
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-bolt {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--mv) 0%, #f97316 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 0 20px rgba(245,158,11,.3);
}
.logo-text { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 800; color: var(--white); letter-spacing: 1px; }
.logo-sub { font-size: 10px; color: var(--text2); font-family: 'JetBrains Mono', monospace; margin-top: 1px; }
.project-chip {
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.project-chip .pc-label { font-size: 11px; color: var(--text2); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }
.project-chip .pc-name { font-family: var(--font-ui); font-size: 18px; font-weight: 600; color: var(--text); margin-top: 4px; }
.project-chip .pc-loc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.project-chip .pc-meta { font-size: 11px; color: var(--text3); margin-top: 6px; font-family: var(--font-mono); }
.project-select { margin-top: 10px; font-size: 12px; padding: 8px 10px; }
.project-zone-list {
  display: grid;
  gap: 6px;
  max-height: 196px;
  overflow-y: auto;
  padding-right: 4px;
}
.project-zone-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.02);
}
.project-zone-option input {
  margin-top: 2px;
}
.project-zone-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.project-zone-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}
.project-zone-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.map-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.map-sector-picker {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 930;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: min(780px, calc(100% - 40px));
  max-width: calc(100% - 40px);
  padding: 8px;
  border: 1px solid var(--overlay-panel-border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  box-shadow: var(--overlay-panel-shadow);
  backdrop-filter: blur(16px);
  box-sizing: border-box;
  transform: translateX(-50%);
  pointer-events: auto;
}
.map-mobile-filter-toggle {
  display: none;
}
.map-mobile-filter-bar {
  display: none;
}
.map-mobile-filter-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}
.map-mobile-filter-toggle-label {
  color: var(--text3);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.map-mobile-filter-toggle-status {
  min-width: 0;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-mobile-filter-toggle-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text2);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.map-mobile-filter-content {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.map-mobile-expand-btn {
  display: none;
}
.map-sector-dropdown {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.map-sector-dropdown[open] {
  z-index: 1035;
}
.map-sector-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  width: 100%;
  padding: 8px 12px 8px 14px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg2) 84%, transparent);
  color: var(--text);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.map-sector-trigger:hover,
.map-sector-dropdown[open] .map-sector-trigger {
  border-color: rgba(79,195,247,.34);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
}
.map-sector-trigger #mapSectorSummary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-sector-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.map-sector-action {
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 12px;
  padding: 5px 9px;
  background: rgba(255,255,255,.05);
  color: var(--text2);
  font: inherit;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: .2px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}
.map-sector-action:hover {
  border-color: rgba(59,130,246,.45);
  background: rgba(59,130,246,.12);
  color: var(--text);
}
.map-sector-action[disabled] {
  cursor: default;
  opacity: .5;
}
.map-sector-action--muted:hover {
  border-color: rgba(248,113,113,.35);
  background: rgba(248,113,113,.09);
}
.map-sector-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(59,130,246,.22);
  border-radius: 12px;
  background: rgba(59,130,246,.09);
  color: var(--text2);
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}
.map-sector-inline-status .btn-loader {
  width: 11px;
  height: 11px;
  border-width: 1.6px;
}
.map-sector-trigger::-webkit-details-marker {
  display: none;
}
.map-progress-date-picker {
  flex: 0 1 340px;
  min-width: min(320px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-progress-date-trigger-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  z-index: 1;
}
.map-progress-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  width: 100%;
  padding: 8px 12px 8px 14px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg2) 84%, transparent);
  color: var(--text);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
  min-width: 0;
}
.map-progress-date-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}
.map-progress-date-trigger:hover {
  border-color: rgba(79,195,247,.34);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
}
.map-progress-date-trigger.is-active,
.map-progress-date-trigger[aria-expanded='true'] {
  border-color: rgba(79,195,247,.34);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
}
.map-progress-date-icon {
  font-size: 14px;
  color: var(--text2);
}
.map-progress-date-label {
  color: var(--text2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-progress-date-value {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(59,130,246,.14);
  color: var(--text);
  font-weight: 600;
  letter-spacing: .2px;
}
.map-progress-date-trigger.is-active .map-progress-date-value {
  background: rgba(59,130,246,.14);
}
.map-progress-date-input {
  display: none;
}
.map-progress-date-clear {
  flex: 0 0 auto;
  min-height: 32px;
  white-space: nowrap;
}
.map-progress-date-clear.is-highlighted {
  border-color: rgba(248,113,113,.44);
  background: rgba(248,113,113,.18);
  color: #ffd5d5;
  box-shadow: 0 0 0 1px rgba(248,113,113,.08) inset;
}
.map-progress-date-clear.is-highlighted:hover {
  border-color: rgba(248,113,113,.6);
  background: rgba(248,113,113,.24);
  color: #fff1f1;
}
body[data-theme='light'] .map-progress-date-clear.is-highlighted {
  border-color: rgba(185,28,28,.28);
  background: rgba(239,68,68,.14);
  color: #991b1b;
  box-shadow: 0 0 0 1px rgba(185,28,28,.06) inset;
}
body[data-theme='light'] .map-progress-date-clear.is-highlighted:hover {
  border-color: rgba(185,28,28,.42);
  background: rgba(239,68,68,.2);
  color: #7f1d1d;
}
.map-progress-date-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1040;
  padding: 12px;
  border: 1px solid rgba(79,195,247,.24);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(16,25,44,.98) 0%, rgba(10,16,30,.98) 100%);
  box-shadow: 0 18px 40px rgba(2,8,23,.55);
  backdrop-filter: blur(16px);
}
.map-progress-date-menu.hidden {
  display: none;
}
.map-progress-date-menu-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}
.map-progress-date-nav {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.map-progress-date-nav:hover {
  border-color: rgba(59,130,246,.45);
  background: rgba(59,130,246,.12);
  color: #eff6ff;
  transform: translateY(-1px);
}
.map-progress-date-month-label {
  min-width: 0;
  text-align: center;
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
}
.map-progress-date-weekdays,
.map-progress-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.map-progress-date-weekdays {
  margin-top: 12px;
}
.map-progress-date-weekdays span {
  text-align: center;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .35px;
}
.map-progress-date-grid {
  margin-top: 8px;
}
.map-progress-date-day {
  position: relative;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.map-progress-date-day:hover {
  border-color: rgba(59,130,246,.4);
  background: rgba(59,130,246,.12);
  color: #f8fbff;
  transform: translateY(-1px);
}
.map-progress-date-day:focus-visible {
  border-color: rgba(79,195,247,.72);
  box-shadow: 0 0 0 2px rgba(79,195,247,.18);
}
.map-progress-date-day.is-outside {
  color: rgba(148,163,184,.52);
  background: rgba(255,255,255,.015);
}
.map-progress-date-day.is-today {
  border-color: rgba(148,163,184,.26);
}
.map-progress-date-day.is-selected {
  border-color: rgba(79,195,247,.62);
  background: rgba(59,130,246,.2);
  color: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(79,195,247,.12);
}
.map-progress-date-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.map-progress-date-day-dot {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #8ed8ff;
  box-shadow: 0 0 0 1px rgba(142,216,255,.16);
}
.map-progress-date-day.is-selected .map-progress-date-day-dot {
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}
.map-progress-date-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.map-progress-date-menu-action {
  display: inline-flex;
  align-items: center;
  min-width: 74px;
  justify-content: center;
}
.map-progress-date-menu-action.is-highlighted {
  border-color: rgba(248,113,113,.44);
  background: rgba(248,113,113,.18);
  color: #ffd5d5;
}
body[data-theme='light'] .map-progress-date-menu {
  border-color: rgba(15,23,42,.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(241,245,249,.98) 100%);
  box-shadow: 0 18px 36px rgba(15,23,42,.16);
}
body[data-theme='light'] .map-sector-picker {
  border-color: rgba(15,23,42,.12);
  background: color-mix(in srgb, rgba(255,255,255,.96) 94%, transparent);
  box-shadow: 0 18px 36px rgba(15,23,42,.14);
}
body[data-theme='light'] .map-sector-trigger,
body[data-theme='light'] .map-progress-date-trigger {
  border-color: rgba(15,23,42,.1);
  background: rgba(255,255,255,.78);
}
body[data-theme='light'] .map-sector-trigger:hover,
body[data-theme='light'] .map-sector-dropdown[open] .map-sector-trigger,
body[data-theme='light'] .map-progress-date-trigger:hover,
body[data-theme='light'] .map-progress-date-trigger.is-active,
body[data-theme='light'] .map-progress-date-trigger[aria-expanded='true'] {
  border-color: rgba(37,99,235,.24);
  background: rgba(255,255,255,.94);
}
body[data-theme='light'] .map-progress-date-nav {
  border-color: rgba(15,23,42,.12);
  background: rgba(255,255,255,.78);
}
body[data-theme='light'] .map-progress-date-nav:hover {
  border-color: rgba(37,99,235,.32);
  background: rgba(59,130,246,.1);
  color: #1d4ed8;
}
body[data-theme='light'] .map-progress-date-month-label {
  color: #0f172a;
}
body[data-theme='light'] .map-progress-date-day {
  background: rgba(15,23,42,.03);
  color: #0f172a;
}
body[data-theme='light'] .map-progress-date-day:hover {
  background: rgba(59,130,246,.09);
  color: #0f172a;
}
body[data-theme='light'] .map-progress-date-day.is-outside {
  color: rgba(100,116,139,.74);
  background: rgba(15,23,42,.015);
}
body[data-theme='light'] .map-progress-date-day.is-selected {
  color: #eff6ff;
}
body[data-theme='light'] .map-progress-date-day-dot {
  background: #2563eb;
  box-shadow: 0 0 0 1px rgba(37,99,235,.14);
}
body[data-theme='light'] .map-progress-date-menu-action.is-highlighted {
  border-color: rgba(185,28,28,.28);
  background: rgba(239,68,68,.14);
  color: #991b1b;
}
.map-progress-technicians {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(59,130,246,.22);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg3) 92%, rgba(15,23,42,.4));
  box-shadow: 0 18px 40px rgba(2,6,23,.24);
  backdrop-filter: blur(16px);
}
.map-progress-technicians-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.map-progress-technicians-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.map-progress-technicians-eyebrow.hidden {
  display: none;
}
.map-progress-technicians-eyebrow {
  color: var(--text3);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.map-progress-technicians-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.map-progress-technicians-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(59,130,246,.14);
  color: var(--text);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.map-progress-technicians-list {
  display: grid;
  gap: 8px;
}
.map-progress-technician-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.map-progress-technician-rank {
  color: inherit;
  font: inherit;
  margin-right: 4px;
}
.map-progress-technician-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.map-progress-technician-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.map-progress-technician-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-progress-technician-meta {
  color: var(--text3);
  font-size: 11px;
}
.map-progress-technician-detail {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.map-progress-technician-metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.map-progress-technician-share {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.map-progress-technician-holes {
  color: var(--text3);
  font-size: 10px;
  white-space: nowrap;
}
.map-progress-technicians-empty {
  padding: 12px;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  color: var(--text2);
  font-size: 12px;
}
.map-progress-technicians-toggle {
  justify-self: start;
  border: 1px solid rgba(59,130,246,.24);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(59,130,246,.08);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.map-progress-technicians-toggle:hover {
  border-color: rgba(59,130,246,.42);
  background: rgba(59,130,246,.14);
}
.map-sector-toggle-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  opacity: .92;
  transition: color .15s ease, opacity .15s ease;
  white-space: nowrap;
  text-transform: uppercase;
}
.map-sector-toggle-label i {
  font-size: 14px;
  line-height: 1;
}
.map-sector-trigger:hover .map-sector-toggle-label,
.map-sector-dropdown[open] .map-sector-toggle-label {
  color: #dff3ff;
  opacity: 1;
}
.map-sector-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 25;
  display: grid;
  gap: 12px;
  max-height: 525px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--overlay-scrollbar-thumb) var(--overlay-scrollbar-track);
  padding: 12px;
  border: 1px solid var(--overlay-panel-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  box-shadow: var(--overlay-panel-shadow);
  backdrop-filter: blur(14px);
  box-sizing: border-box;
}
.map-shell:not(.map-fullscreen) .map-sector-menu {
  max-height: min(calc(var(--map-shell-height) - 108px), 525px);
}
.map-shell.map-fullscreen .map-sector-menu {
  height: min(calc(100vh - 140px), 775px);
  max-height: min(calc(100vh - 72px), 1200px);
}
.map-sector-section {
  display: grid;
  gap: 8px;
}
.map-sector-section + .map-sector-section {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.map-sector-section-title {
  font-size: 10px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.map-sector-helper {
  font-size: 10px;
  color: var(--text3);
}
.map-sector-list {
  max-height: none;
  padding-right: 6px;
}
.map-sector-block {
  display: grid;
  gap: 8px;
}
.map-sector-block + .map-sector-block {
  margin-top: 8px;
}
.map-sector-block.is-selected .project-zone-option {
  border-color: rgba(59,130,246,.45);
}
.map-sector-children {
  margin-left: 18px;
  display: grid;
  gap: 8px;
}
.project-zone-option-child {
  padding: 6px 8px;
  border-style: dashed;
}
.map-sector-village-list {
  max-height: none;
}
.map-sector-empty {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  color: var(--text2);
  font-size: 12px;
}
.map-sector-loading {
  display: flex;
  align-items: center;
}
.map-sector-loading .map-loading-inline {
  color: var(--text2);
}
.map-sector-loading .btn-loader {
  width: 12px;
  height: 12px;
  border-width: 1.8px;
}

@media (max-width: 720px) {
  .map-sector-picker {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
  }
  .map-progress-date-picker {
    flex: 1 1 100%;
    min-width: 0;
  }
  .map-progress-date-trigger {
    min-height: 38px;
  }
  .map-progress-technicians {
    padding: 12px;
  }
  .map-progress-technicians-head {
    align-items: stretch;
    flex-direction: column;
  }
  .map-progress-technicians-badge {
    align-self: flex-start;
  }
  .map-sector-trigger {
    gap: 8px;
    padding-right: 8px;
  }
  .map-sector-actions {
    gap: 4px;
  }
  .map-sector-action,
  .map-sector-inline-status {
    padding: 5px 7px;
    font-size: 9px;
  }
}

@media (max-width: 560px) {
  .map-progress-date-picker {
    gap: 4px;
  }
  .map-sector-trigger #mapSectorSummary {
    max-width: 110px;
  }
  .map-sector-inline-status span:last-child {
    display: none;
  }
  .map-progress-date-label {
    display: none;
  }
  .map-progress-date-clear {
    padding-inline: 8px;
    font-size: 9px;
  }
  .map-progress-technician-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-progress-technician-share {
    justify-self: end;
  }
}

.nav { flex: 1; min-height: 0; padding: 14px 0 12px; overflow-y: auto; }
.nav-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--text3); padding: 10px 20px 6px; font-family: var(--font-mono); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  margin: 2px 10px;
  padding: 10px 12px; cursor: pointer;
  border: 1px solid transparent;
  border-left: none;
  border-radius: var(--radius-md);
  transition: all .15s;
  font-size: 13px; font-weight: 500; color: var(--text2);
}
.nav-item:hover { background: var(--bg2); color: var(--text); border-color: var(--border); }
.nav-item.active {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  color: #fff;
}
.nav-item.active .nav-icon,
.nav-item.active .nav-label {
  color: inherit;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-badge {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text2);
}
.sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}
.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
}
.rp-mgr { background: rgba(30,30,30,.04); color: var(--text); border-color: var(--border); }
.rp-tech { background: rgba(74,85,104,.08); color: var(--lv); border-color: rgba(74,85,104,.16); }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── TOPBAR ── */
.topbar {
  height: var(--chrome-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 32px; gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1100;
}
.page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.topbar-desktop {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}
.topbar-menu-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.topbar-menu-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg3);
}
.topbar-menu-btn[aria-expanded='true'] {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg3);
}
.topbar-project {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--text2);
  font-size: 13px;
}
.topbar-project strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar-project span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-left: auto;
}
.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text3);
  font-size: 12px;
  white-space: nowrap;
}
.topbar-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hh);
  flex-shrink: 0;
}
.topbar-user-menu {
  position: relative;
  min-width: 0;
}
.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(360px, 44vw);
  padding: 7px 10px 7px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.topbar-user-btn:hover,
.topbar-user-menu.is-open .topbar-user-btn {
  border-color: var(--border);
  background: var(--bg3);
}
.topbar-user-btn[disabled] {
  cursor: default;
}
.topbar-user-btn[disabled]:hover {
  border-color: transparent;
  background: transparent;
}
.topbar-user-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(79,195,247,.2), rgba(17,32,64,.88));
  color: #f8fbff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.topbar-user-avatar--large {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 13px;
}
.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
  flex: 1 1 auto;
}
.topbar-user__name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user__role {
  color: var(--text2);
  font-size: 11px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user-menu-caret {
  flex-shrink: 0;
  color: var(--text3);
  font-size: 12px;
  transition: transform .15s ease, color .15s ease;
}
.topbar-user-menu.is-open .topbar-user-menu-caret {
  color: var(--text);
  transform: rotate(180deg);
}
.topbar-user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--overlay-panel-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--overlay-panel-bg) 94%, transparent);
  box-shadow: var(--overlay-panel-shadow);
  backdrop-filter: blur(18px);
}
.topbar-user-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user-menu-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.topbar-user-menu-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.topbar-user-menu-role {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.35;
}
.topbar-user-menu-grid {
  display: grid;
  gap: 9px;
}
.topbar-user-menu-row {
  display: grid;
  gap: 3px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}
.topbar-user-menu-row:first-child {
  padding-top: 0;
  border-top: none;
}
.topbar-user-menu-label {
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.topbar-user-menu-value {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.topbar-user-menu-action {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(248, 113, 113, .24);
  border-radius: 13px;
  background: rgba(248, 113, 113, .08);
  color: #ffd9d9;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.topbar-user-menu-action:hover {
  border-color: rgba(248, 113, 113, .38);
  background: rgba(248, 113, 113, .13);
  color: #fff1f1;
  transform: translateY(-1px);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-right .theme-dropdown-shell,
.topbar-actions .topbar-user-menu {
  flex-shrink: 0;
}
.topbar-actions .theme-dropdown-shell {
  flex-shrink: 0;
}
.session-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 250px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg2);
  box-shadow: var(--shadow-card);
}
.session-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-ui);
}
.session-sub {
  font-size: 11px;
  color: var(--text2);
}
.rsw { display: flex; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.rso { padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all .15s; color: var(--text2); font-family: 'JetBrains Mono', monospace; }
.rso.active { background: var(--brand); color: #fff; }

/* ── CONTENT ── */
.content { flex: 1; overflow-y: auto; padding: 24px 32px 32px; }
.desktop-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.desktop-page-header__copy {
  min-width: 0;
}
.desktop-page-header__title {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .01em;
  color: var(--text);
}
.desktop-page-header__desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
}
.desktop-page-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  font-family: var(--font-ui);
  line-height: 1;
}
.btn-mv { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-mv:hover { background: var(--brand2); border-color: var(--brand2); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); background: var(--bg3); }
.btn-lv { background: var(--bg3); color: var(--text); border-color: var(--border); }
.btn-lv:hover { background: var(--bg2); }
.btn-success { background: rgba(31,122,77,.1); color: var(--hh); border-color: rgba(31,122,77,.18); }
.btn-success:hover { background: rgba(31,122,77,.14); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.btn-upload {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-upload:hover { background: var(--bg3); border-color: var(--text); }
.btn-quiet {
  background: transparent;
  color: var(--text2);
  border-color: transparent;
}
.btn-quiet:hover {
  background: var(--bg3);
  color: var(--text);
}
.bulk-config-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  z-index: 1110;
}
.bulk-config-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 336px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: var(--shadow-panel);
  z-index: 1111;
}
.bulk-config-title {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.bulk-config-sub {
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}
.bulk-config-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulk-config-link {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.bulk-config-link:hover {
  border-color: var(--brand);
  color: var(--text);
  background: var(--bg3);
}
.bulk-config-link.active {
  border-color: var(--border2);
  background: var(--brand-soft);
}
.bulk-config-link span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bulk-config-link strong {
  font-size: 13px;
  color: var(--text);
}
.bulk-config-link small {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
}
.bulk-config-link.active strong {
  color: var(--text);
}

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 16px; font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.card-title .ph {
  font-size: 16px;
  color: var(--text2);
  opacity: 1;
  flex-shrink: 0;
}

/* ── GRID ── */
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.g-span2 { grid-column: span 2; }
.progress-column-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.progress-sector-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.progress-sector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(26,42,68,.45);
}
.progress-sector-row:first-child {
  padding-top: 4px;
}
.progress-sector-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.progress-sector-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.progress-sector-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.progress-sector-rank {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  background: rgba(30,41,59,.55);
  border: 1px solid rgba(96,165,250,.16);
}
.progress-sector-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.progress-sector-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.progress-sector-detail {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
}
.progress-sector-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.progress-sector-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(96,165,250,.16);
  border-radius: 6px;
  background: rgba(15,23,42,.46);
  color: var(--text2);
  font-size: 11px;
  line-height: 1.2;
}
.progress-sector-chip strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.progress-sector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.progress-sector-share {
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  text-align: right;
  flex: 0 0 auto;
}
.progress-sector-share-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--hh);
}
.progress-sector-share-label {
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.progress-sector-empty {
  padding: 4px 0 2px;
  font-size: 13px;
  color: var(--text3);
}
body[data-theme='light'] .progress-sector-row {
  border-bottom-color: rgba(148,163,184,.24);
}
body[data-theme='light'] .progress-sector-rank {
  background: rgba(226,232,240,.72);
  border-color: rgba(59,130,246,.14);
}
body[data-theme='light'] .progress-sector-share {
  background: rgba(248,250,252,.9);
}
body[data-theme='light'] .progress-sector-chip {
  background: rgba(248,250,252,.88);
  border-color: rgba(59,130,246,.12);
}

/* ── SCOPE HERO CARDS ── */
.scope-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  display: grid;
  align-content: start;
}
.scope-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.scope-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: .04;
}
.sc-mv::after { background: var(--mv); }
.sc-lv::after { background: var(--lv); }
.sc-tx::after { background: var(--tx); }
.sc-hh::after { background: var(--hh); }
.scope-card .accent-line {
  height: 3px;
  border-radius: 2px;
  margin-bottom: 14px;
}
.scope-card .sc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.scope-card .sc-head-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.scope-card .sc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  border: 1px solid transparent;
}
.sc-mv .sc-icon {
  color: var(--mv);
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.18);
}
.sc-lv .sc-icon {
  color: var(--lv);
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.18);
}
.sc-tx .sc-icon {
  color: var(--tx);
  background: rgba(139,92,246,.08);
  border-color: rgba(139,92,246,.18);
}
.sc-hh .sc-icon {
  color: var(--hh);
  background: rgba(16,185,129,.08);
  border-color: rgba(16,185,129,.18);
}
.scico { font-size: 22px; margin-bottom: 6px; display: flex; align-items: center; }
.scope-card .sc-planned {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 3px;
}
.scope-card .sc-total {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-top: 6px;
}
.scope-card .sc-done {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 42px; font-weight: 800;
  line-height: 1;
}
.scope-card .sc-unit { font-size: 14px; font-weight: 500; margin-left: 3px; }
.scope-card .sc-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: .2px;
}
.pbar { height: 5px; background: var(--bg4); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.pfill { height: 100%; border-radius: 3px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.pf-mv { background: linear-gradient(90deg, var(--mv2), var(--mv)); }
.pf-lv { background: linear-gradient(90deg, var(--lv2), var(--lv)); }
.pf-tx { background: linear-gradient(90deg, var(--tx2), var(--tx)); }
.pf-hh { background: linear-gradient(90deg, var(--hh2), var(--hh)); }
.pf-neutral { background: linear-gradient(90deg, var(--border2), var(--text2)); }
.scope-card .sc-pct { font-size: 11px; color: var(--text3); margin-top: 5px; font-family: 'JetBrains Mono', monospace; }
.scope-card .sc-metrics {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.scope-card .sc-metric {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.02);
}
body[data-theme='light'] .scope-card .sc-metric {
  background: rgba(15,23,42,.025);
}
.scope-card .sc-metric-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  line-height: 1.1;
}
.scope-card .sc-metric-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}
.scope-card .sc-metric-count,
.scope-card .sc-metric-pct {
  font-family: 'JetBrains Mono', monospace;
}
.scope-card .sc-metric-count {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
}
.scope-card .sc-metric-pct {
  font-size: 10px;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

/* ── SCOPE TABLE ── */
.scope-table-wrap { overflow-x: auto; }
.scope-tbl { width: 100%; border-collapse: collapse; }
.scope-tbl th {
  text-align: left; padding: 9px 14px;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text3);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.scope-tbl td {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid rgba(26,42,68,.6);
  vertical-align: middle;
}
.scope-tbl tr:last-child td { border-bottom: none; }
.scope-tbl tr:hover td { background: rgba(255,255,255,.015); }
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
}
.table-pagination__summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text2);
  font-size: 13px;
}
.table-pagination__rows {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.table-pagination__select {
  width: auto;
  min-width: 72px;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}
.table-pagination__count {
  color: var(--text2);
}
.table-pagination__nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.table-pagination__page,
.table-pagination__arrow {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #2f9d8f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.table-pagination__page:hover,
.table-pagination__arrow:hover {
  background: rgba(47,157,143,.12);
}
.table-pagination__page.is-active {
  background: #2f9d8f;
  color: #fff;
}
.table-pagination__page[aria-current='page'] {
  cursor: default;
}
.table-pagination__page:disabled,
.table-pagination__arrow:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.table-pagination__ellipsis {
  color: var(--text2);
  font-size: 13px;
  padding: 0 2px;
}
.coord-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text3);
  background: var(--bg3);
  padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
}

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.b-done { background: rgba(16,185,129,.08); color: var(--hh); border: 1px solid rgba(16,185,129,.2); }
.b-prog { background: rgba(59,130,246,.08); color: var(--lv); border: 1px solid rgba(59,130,246,.2); }
.b-pend { background: rgba(46,74,106,.12); color: var(--text3); border: 1px solid var(--border); }
.b-mv { background: rgba(245,158,11,.1); color: var(--mv); border: 1px solid rgba(245,158,11,.2); }
.b-lv { background: rgba(59,130,246,.1); color: var(--lv); border: 1px solid rgba(59,130,246,.2); }
.b-tx { background: rgba(139,92,246,.1); color: var(--tx); border: 1px solid rgba(139,92,246,.2); }
.b-hh { background: rgba(16,185,129,.1); color: var(--hh); border: 1px solid rgba(16,185,129,.2); }
.b-rev { background: rgba(245,158,11,.12); color: var(--mv); border: 1px solid rgba(245,158,11,.25); }
.b-design { background: rgba(251,191,36,.1); color: var(--gold); border: 1px solid rgba(251,191,36,.2); }

/* ── FORMS ── */
.fg { margin-bottom: 14px; }
.fl { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--text2); margin-bottom: 5px; }
.fi {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px;
  color: var(--text); font-family: 'Barlow', sans-serif;
  font-size: 13.5px; transition: border-color .2s; outline: none;
}
.fi:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 22, 255, .08);
}
.fi::placeholder { color: var(--text3); }
select.fi { cursor: pointer; }
textarea.fi { resize: vertical; min-height: 72px; }
.combo {
  position: relative;
  z-index: 0;
}
.combo.is-open {
  z-index: 50;
}
.combo-input {
  padding-right: 42px;
}
.combo-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.combo-toggle:hover,
.combo.is-open .combo-toggle {
  background: rgba(255,255,255,.06);
  color: var(--text);
}
body[data-theme='light'] .combo-toggle:hover,
body[data-theme='light'] .combo.is-open .combo-toggle {
  background: rgba(15,23,42,.06);
}
.combo.is-open .combo-toggle {
  transform: translateY(-50%) rotate(180deg);
}
.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 51;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--bg2);
  box-shadow: 0 16px 32px rgba(0,0,0,.35);
}
.combo-option,
.combo-empty {
  width: 100%;
  box-sizing: border-box;
  border-radius: 9px;
  padding: 9px 10px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
}
.combo-option {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.combo-option:hover,
.combo-option.is-match {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.2);
}
.combo-option.is-match {
  color: var(--brand2);
}
.combo-empty {
  color: var(--text3);
  background: rgba(255,255,255,.03);
}
body[data-theme='light'] .combo-option:hover,
body[data-theme='light'] .combo-option.is-match {
  background: rgba(15,23,42,.06);
  border-color: rgba(15,23,42,.08);
}
body[data-theme='light'] .combo-empty {
  background: rgba(15,23,42,.03);
}

/* ── UPLOAD ── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: 10px; padding: 28px 20px;
  text-align: center; cursor: pointer;
  transition: all .2s;
  background: rgba(59,130,246,.02);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--lv);
  background: rgba(59,130,246,.06);
}
.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.upload-hint {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
}
.upload-validation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}
.upload-validation-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
}
.upload-validation-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.upload-validation-msg {
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
}
.upload-validation-msg strong {
  color: var(--white);
}
.upload-validation-more {
  font-size: 11px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
}

.upload-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.upload-tab {
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
}

.upload-tab:hover {
  border-color: var(--lv);
  color: var(--white);
}

.upload-tab.active {
  border-color: rgba(59,130,246,.42);
  background: rgba(59,130,246,.14);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.18);
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.upload-zone.is-busy {
  opacity: .78;
  cursor: progress;
  pointer-events: none;
}

.upload-actions.is-busy {
  opacity: .75;
}

.upload-hint {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
}

.upload-status {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.28);
  background:
    linear-gradient(180deg, rgba(59,130,246,.08), rgba(59,130,246,.03)),
    var(--bg3);
}

.upload-status.hidden,
.upload-progress.hidden {
  display: none;
}

.upload-status-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.upload-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: rgba(148,163,184,.65);
  box-shadow: 0 0 0 4px rgba(148,163,184,.12);
}

.upload-status-indicator.is-busy {
  background: var(--lv);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
  animation: uploadPulse 1.25s ease-in-out infinite;
}

.upload-status-indicator.is-ready {
  background: var(--hh);
  box-shadow: 0 0 0 4px rgba(16,185,129,.12);
}

.upload-status-indicator.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239,68,68,.14);
}

.upload-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.upload-status-detail {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  margin-top: 4px;
}

.upload-progress {
  margin-top: 12px;
}

.upload-progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15,23,42,.7);
  border: 1px solid rgba(59,130,246,.16);
}

.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  transition: width .24s ease;
}

.upload-progress-meta {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

@keyframes uploadPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.16); opacity: .82; }
}

/* ── STEP LIST ── */
.step-list { display: flex; flex-direction: column; }
.step-item { display: flex; align-items: flex-start; gap: 13px; padding: 11px 0; border-bottom: 1px solid rgba(26,42,68,.5); }
.step-item:last-child { border-bottom: none; }
.sn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.sn-done { background: var(--hh2); color: var(--hh); }
.sn-act { background: rgba(59,130,246,.2); color: var(--lv); box-shadow: 0 0 8px rgba(59,130,246,.3); }
.sn-pend { background: var(--bg4); color: var(--text3); border: 1px solid var(--border); }
.sb { flex: 1; }
.sname { font-size: 13px; font-weight: 600; }
.sdesc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.smeta { font-size: 11px; color: var(--text3); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }

/* ── TIMELINE ── */
.tl { display: flex; flex-direction: column; }
.tli { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tli:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px; background: var(--border); }
.tld { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 1; }
.tlb { flex: 1; padding-top: 4px; }
.tlt { font-size: 13px; font-weight: 600; }
.tls { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tlm { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', monospace; margin-top: 3px; }

/* ── PROGRESS RING (SVG) ── */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring-labels { display: flex; flex-direction: column; gap: 4px; }
.ring-main { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 800; }
.ring-sub { font-size: 11px; color: var(--text2); }

/* ── MODAL ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 2000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.overlay.hidden { display: none; }
.modal { position: relative; z-index: 2001; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 26px; width: 560px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
body[data-theme='light'] .modal,
body[data-theme='light'] .card,
body[data-theme='light'] .sidebar,
body[data-theme='light'] .scope-card,
body[data-theme='light'] .project-chip,
body[data-theme='light'] .session-strip,
body[data-theme='light'] .tx-zone,
body[data-theme='light'] .rev-change,
body[data-theme='light'] .map-legend,
body[data-theme='light'] .map-tip {
  box-shadow: var(--shadow-card);
}
body[data-theme='light'] .topbar {
  box-shadow: none;
}
body[data-theme='light'] .btn-ghost,
body[data-theme='light'] .btn-upload {
  color: var(--salvi-black);
  border-color: var(--salvi-black);
}
body[data-theme='light'] .btn-ghost:hover,
body[data-theme='light'] .btn-upload:hover,
body[data-theme='light'] .btn-quiet:hover,
body[data-theme='light'] .topbar-menu-btn:hover {
  background: var(--salvi-surface);
  color: var(--salvi-black);
}
body[data-theme='light'] .btn-quiet,
body[data-theme='light'] .topbar-menu-btn,
body[data-theme='light'] .topbar-status,
body[data-theme='light'] .topbar-project,
body[data-theme='light'] .topbar-user__role {
  color: var(--salvi-grey);
}
body[data-theme='light'] .topbar-project strong,
body[data-theme='light'] .topbar-user__name {
  color: var(--salvi-black);
}
body[data-theme='light'] .theme-dropdown-shell--topbar {
  background: rgba(255,255,255,.78);
}
body[data-theme='light'] .theme-dropdown-trigger:hover,
body[data-theme='light'] .theme-dropdown[open] .theme-dropdown-trigger {
  background: rgba(255,255,255,.92);
}
body[data-theme='light'] .theme-dropdown-option:hover {
  border-color: rgba(37,99,235,.16);
  background: rgba(59,130,246,.08);
}
body[data-theme='light'] .theme-dropdown-option.is-active {
  border-color: rgba(37,99,235,.24);
  background: rgba(59,130,246,.1);
}
body[data-theme='light'] .theme-dropdown-option-check {
  color: #1d4ed8;
}
body[data-theme='light'] .topbar-user-btn:hover,
body[data-theme='light'] .topbar-user-menu.is-open .topbar-user-btn {
  background: rgba(255,255,255,.72);
}
body[data-theme='light'] .topbar-user-avatar {
  border-color: rgba(174, 191, 214, .9);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(219,231,243,.96));
  color: #17304d;
}
body[data-theme='light'] .topbar-user-menu-panel {
  border-color: rgba(174, 191, 214, .92);
  background: color-mix(in srgb, rgba(255,255,255,.98) 96%, transparent);
  box-shadow: 0 18px 36px rgba(15, 35, 65, .14);
}
body[data-theme='light'] .topbar-user-menu-row {
  border-top-color: rgba(174, 191, 214, .7);
}
body[data-theme='light'] .topbar-user-menu-action {
  border-color: rgba(185,28,28,.18);
  background: rgba(239,68,68,.08);
  color: #991b1b;
}
body[data-theme='light'] .topbar-user-menu-action:hover {
  border-color: rgba(185,28,28,.28);
  background: rgba(239,68,68,.12);
  color: #7f1d1d;
}
.modal-title { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 18px; color: var(--white); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }

/* ── ALERT ── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.a-info { background: rgba(59,130,246,.07); border: 1px solid rgba(59,130,246,.2); color: #93c5fd; }
body[data-theme='light'] .a-info {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(174, 191, 214, .92);
  color: var(--text);
}
.a-warn { background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.2); color: var(--mv); }
body[data-theme='light'] .a-warn {
  background: rgba(248, 244, 237, .92);
  border-color: rgba(139, 107, 64, .28);
  color: var(--mv2);
}
.a-ok { background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.2); color: var(--hh); }
.a-err { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.22); color: var(--red); }

/* ── DIVIDERS ── */
.sep { height: 1px; background: var(--border); margin: 12px 0; }
.vsep { width: 1px; background: var(--border); margin: 0 8px; }

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--bg2); border: 1px solid var(--hh);
  border-radius: 10px; padding: 11px 18px;
  font-size: 13px; color: var(--hh); z-index: 1500;
  transition: all .3s; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 24px rgba(16,185,129,.15);
  font-family: 'Barlow', sans-serif;
}
.toast.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
.toast.err { border-color: var(--red); color: var(--red); box-shadow: 0 4px 24px rgba(239,68,68,.15); }

.btn[disabled] {
  cursor: wait;
  opacity: .78;
}

.btn--loading {
  pointer-events: none;
}

.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-loader {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  animation: buttonSpin .8s linear infinite;
}

.hidden { display: none; }

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

.format-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-format.active {
  background: var(--mv);
  color: #000;
  border-color: transparent;
}

.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.report-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

.report-meta {
  font-size: 11px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

.report-preview {
  min-height: 240px;
  border: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 12px;
  padding: 18px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.report-placeholder {
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.report-export-panel {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.report-export-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

.report-export-copy {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

.report-notes {
  display: grid;
  gap: 10px;
}

.report-note {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.field-issue-summary-cards {
  margin-bottom: 18px;
}

.field-issue-mini-card {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 92%, white 8%), var(--bg3));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.field-issue-mini-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.field-issue-mini-value {
  font-family: var(--font-brand);
  font-size: 30px;
  line-height: 1;
}

.field-issue-mini-label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.field-issue-mini-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
}

.connection-stage-note {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

.connection-stage-mini-card {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 92%, white 8%), var(--bg3));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.connection-stage-mini-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.connection-stage-mini-value {
  font-family: var(--font-brand);
  font-size: 30px;
  line-height: 1;
}

.connection-stage-mini-label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.connection-stage-mini-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
}

.connection-stage-source {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text3);
}

.connection-stage-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}

.connection-stage-empty {
  padding: 18px;
  color: var(--text3);
  font-size: 13px;
}

.field-issue-editor-hint {
  margin-bottom: 14px;
}

.field-issue-editor-note {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.field-issue-comment-cell {
  min-width: 240px;
  max-width: 420px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.field-issue-source-doc,
.field-issue-date,
.field-issue-readonly {
  margin-top: 4px;
  color: var(--text3);
  font-size: 11px;
  line-height: 1.4;
}

.field-issue-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.field-issue-detail-meta {
  margin-bottom: 14px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.field-issue-detail-list {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.field-issue-detail-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 92%, white 8%), var(--bg3));
  box-shadow: var(--shadow-card);
}

.field-issue-detail-card.is-focused {
  border-color: color-mix(in srgb, var(--mv) 48%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mv) 36%, transparent), var(--shadow-card);
}

.field-issue-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.field-issue-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.field-issue-detail-facts {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.field-issue-detail-fact {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg3) 94%, transparent);
}

.field-issue-detail-fact-label {
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field-issue-detail-fact-value {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.field-issue-detail-problem {
  white-space: pre-wrap;
  font-weight: 600;
}

.field-issue-detail-doc {
  margin-top: 10px;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.45;
}

.field-issue-detail-audit {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.field-issue-detail-audit-block {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg3) 92%, transparent);
  border: 1px solid var(--border);
}

.field-issue-detail-audit-label {
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field-issue-detail-audit-value {
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.field-issue-detail-empty {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.auth-modal {
  width: 620px;
}

.auth-helper-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

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

.auth-helper-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.auth-helper-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-helper-copy strong {
  font-size: 13px;
  color: var(--white);
}

.auth-helper-copy span {
  font-size: 11px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
}

.auth-error,
.asset-detail-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
}

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

.asset-field {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.asset-field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.asset-field-value {
  font-size: 13px;
  color: var(--white);
}

.asset-field-value-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(71, 85, 105, .2);
  font-size: 12px;
  line-height: 1.1;
}

.asset-field-value-pill.info {
  color: #dbeafe;
  border-color: rgba(59, 130, 246, .34);
  background: rgba(59, 130, 246, .12);
}

.asset-field-value-pill.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, .34);
  background: rgba(245, 158, 11, .12);
}

.asset-field-value-pill.success {
  color: #d1fae5;
  border-color: rgba(16, 185, 129, .34);
  background: rgba(16, 185, 129, .12);
}

.asset-field-value-pill.danger {
  color: #fee2e2;
  border-color: rgba(239, 68, 68, .34);
  background: rgba(239, 68, 68, .14);
}

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

.bulk-edit-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
}

.bulk-edit-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.bulk-edit-table th,
.bulk-edit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.bulk-edit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg2);
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.bulk-edit-table tbody tr:last-child td {
  border-bottom: none;
}

.bulk-edit-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme='light'] .bulk-edit-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

.bulk-edit-meta {
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bulk-edit-meta strong {
  color: var(--white);
}

.bulk-edit-sub {
  color: var(--text2);
  font-size: 11px;
}

.bulk-edit-table .fi {
  min-width: 120px;
}

@media (max-width: 1180px) {
  .topbar {
    padding: 0 20px;
  }

  .topbar-project span,
  .topbar-user__role,
  .topbar-status {
    display: none;
  }

  .desktop-page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .page-title {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: nowrap;
  }

  .desktop-page-header {
    display: none;
  }
}

@media (max-width: 960px) {
  .login-landing {
    padding: 18px;
  }

  .login-landing__panel {
    grid-template-columns: 1fr;
  }

  .login-landing__brand,
  .login-landing__card {
    padding: 22px;
  }

  .session-strip {
    min-width: 0;
    flex: 1;
  }

  .asset-detail-grid,
  .asset-detail-form {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .sidebar-toggle { display: none; }
  .sidebar.is-collapsed {
    width: 0 !important;
    border-bottom-color: transparent;
  }
  .sidebar:not(.is-collapsed) .sidebar-head { display: grid; }
  .sidebar:not(.is-collapsed) .nav-sec { display: block; }
  .sidebar:not(.is-collapsed) .nav-label { display: inline; }
  .sidebar:not(.is-collapsed) .nav-badge-group { display: flex; }
  .sidebar:not(.is-collapsed) .nav-item { padding: 9px 12px; justify-content: flex-start; }
  .sidebar:not(.is-collapsed) .nav-item::after { display: none; }
  .sidebar:not(.is-collapsed) .sidebar-foot { padding: 14px 18px; justify-content: flex-start; }
  .sidebar:not(.is-collapsed) .role-pill { display: inline-flex; }

  .sidebar-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 12px;
    align-items: stretch;
  }

  .project-chip {
    margin-top: 0;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 14px;
    scrollbar-width: thin;
  }

  .nav-sec {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 10px;
    padding: 9px 12px;
    background: transparent;
    white-space: nowrap;
  }

  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--mv);
  }

  .sidebar-foot {
    padding-top: 0;
    border-top: none;
  }

  .main {
    min-height: 0;
  }

  .topbar {
    height: var(--chrome-height);
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
  }

  .topbar-project span,
  .topbar-user__role,
  .topbar-status {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .card {
    padding: 16px;
  }

  .card-hd {
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

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

  .g2 {
    grid-template-columns: 1fr;
  }

  .g-span2 {
    grid-column: auto;
  }

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

/* ── SCOPE REVISION HISTORY ── */
.rev-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.rev-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rev-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text3); }
.rev-changes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.rev-change { background: var(--bg4); border-radius: 6px; padding: 6px 10px; }
.rch-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }
.rch-val { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700; }
.rch-diff { font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.diff-up { color: var(--hh); }
.diff-dn { color: var(--red); }
.diff-eq { color: var(--text3); }

/* ── TRANSFORMER ZONE CARDS ── */
.tx-zone {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: border-color .2s;
}
.tx-zone:hover { border-color: var(--border2); }
.tx-zone-hd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.tx-id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--tx); font-weight: 500; }
.tx-rating { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; color: var(--white); }
.tx-detail { font-size: 11px; color: var(--text2); }

/* ── MAP ── */
.map-wrap {
  position: relative;
  --map-panel-inline-gap: 12px;
  --map-layer-panel-width: clamp(210px, 18vw, 248px);
  --map-filter-right-clearance: 56px;
  --map-filter-usable-left: calc(8px + var(--map-layer-panel-width) + var(--map-panel-inline-gap));
}
body.map-fullscreen-active .sidebar {
  position: relative;
  z-index: 1110;
}
body.map-fullscreen-active:not(.is-mobile) .map-wrap:has(.map-shell.map-fullscreen) .map-sector-picker {
  position: fixed;
  top: calc(var(--chrome-height) + 8px);
  left: calc((100vw + var(--sidebar-visible-width)) / 2);
  transform: translateX(-50%);
  z-index: 1090;
}
.map-shell {
  --map-shell-height: min(72vh, calc(100vh - 255px));
  background: #10192a;
  border: 1px solid var(--border);
  border-radius: 12px;
  height: var(--map-shell-height);
  min-height: 430px;
  max-height: 760px;
  position: relative; overflow: hidden;
  isolation: isolate;
}
.map-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.map-loading-overlay.hidden {
  display: none;
}
.map-loading-spinner {
  width: 28px;
  height: 28px;
  border-width: 2.5px;
  color: rgba(232,244,255,.9);
}
.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.leaflet-container {
  width: 100%;
  height: 100%;
  background: #111827;
  font-family: 'Barlow', sans-serif;
}
body[data-theme='light'] .leaflet-container {
  background: #dbe7f3;
}
.map-shell .leaflet-top,
.map-shell .leaflet-bottom {
  z-index: 500;
}
.leaflet-control-zoom a,
.leaflet-control-layers-toggle,
.leaflet-bar a {
  background: rgba(7, 17, 31, .94);
  color: var(--text2);
  border-color: #233652;
}
.leaflet-control-zoom a:hover,
.leaflet-bar a:hover {
  background: #112040;
  color: #4fc3f7;
}
.leaflet-control-layers {
  background: rgba(7, 17, 31, .94);
  border: 1px solid #233652;
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
}
.leaflet-control-layers-expanded {
  padding: 12px 14px;
}
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  color: var(--text);
  font-size: 12px;
}
.leaflet-control-attribution {
  background: rgba(7, 17, 31, .82);
  color: var(--text2);
}
.leaflet-control-attribution a {
  color: #4fc3f7;
}
.leaflet-control-scale {
  margin: 0 0 12px 12px;
}
.leaflet-control-scale-line {
  min-width: 58px;
  padding: 4px 10px 3px;
  border: 1px solid var(--overlay-panel-border);
  border-top: none;
  border-radius: 0 0 9px 9px;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  backdrop-filter: blur(12px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .2px;
}
.leaflet-control-scale-line:not(:first-child) {
  border-top: 1px solid var(--overlay-panel-border);
  border-radius: 9px;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(7, 17, 31, .97);
  color: var(--text);
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
}
.leaflet-popup-content strong {
  color: var(--white);
}
.map-popup-card {
  display: grid;
  gap: 0;
}
.map-popup-sub {
  color: var(--text2);
  margin-top: 2px;
}
.map-popup-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.map-popup-flag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(71, 85, 105, .24);
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .25px;
}
.map-popup-flag.info {
  color: #dbeafe;
  background: rgba(59, 130, 246, .18);
  border-color: rgba(59, 130, 246, .38);
}
.map-popup-flag.warn {
  color: #fde68a;
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .34);
}
.map-popup-flag.success {
  color: #d1fae5;
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .34);
}
.map-popup-flag.danger {
  color: #fee2e2;
  background: rgba(239, 68, 68, .18);
  border-color: rgba(239, 68, 68, .36);
}
.map-popup-callout {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(15, 23, 42, .42);
}
.map-popup-callout.info {
  border-color: rgba(59, 130, 246, .28);
  background: rgba(59, 130, 246, .1);
}
.map-popup-callout.warn {
  border-color: rgba(245, 158, 11, .28);
  background: rgba(245, 158, 11, .1);
}
.map-popup-callout.success {
  border-color: rgba(16, 185, 129, .28);
  background: rgba(16, 185, 129, .1);
}
.map-popup-callout.danger {
  border-color: rgba(239, 68, 68, .32);
  background: rgba(127, 29, 29, .28);
}
.map-popup-callout-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
}
.map-popup-callout-copy {
  margin-top: 5px;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.45;
}
.map-popup-meta {
  color: var(--text3);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.map-popup-stages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.map-popup-actions {
  display: grid;
  gap: 8px;
}
.map-stage-tag {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .25px;
  color: #e2e8f0;
  background: rgba(71, 85, 105, .28);
  border: 1px solid rgba(148, 163, 184, .28);
}
.map-stage-tag.done {
  color: #d1fae5;
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .38);
}
.map-stage-tag.progress {
  color: #dbeafe;
  background: rgba(59, 130, 246, .2);
  border-color: rgba(59, 130, 246, .42);
}
.map-stage-tag.rejected {
  color: #fee2e2;
  background: rgba(239, 68, 68, .18);
  border-color: rgba(239, 68, 68, .38);
}
.map-popup-action {
  margin-top: 12px;
  border: 1px solid rgba(79, 195, 247, .42);
  background: rgba(17, 32, 64, .92);
  color: #dbeafe;
  border-radius: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.map-popup-actions .map-popup-action {
  margin-top: 0;
}
.map-popup-action:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 195, 247, .72);
  background: rgba(22, 41, 74, .98);
}
.map-transformer-label-wrap {
  background: transparent;
  border: none;
}
.map-transformer-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #ff7043;
  white-space: nowrap;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  letter-spacing: .3px;
}
.leaflet-tooltip.map-persistent-label {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #dbeafe;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .28px;
  white-space: nowrap;
  text-shadow: 0 0 4px #000, 0 0 4px #000, 0 2px 8px rgba(0, 0, 0, .95);
}
.leaflet-tooltip.map-persistent-label::before {
  display: none;
}
.leaflet-tooltip.map-label-transformer {
  color: #ff9a76;
}
.leaflet-tooltip.map-label-tap {
  color: #d6f39d;
}
.leaflet-tooltip.map-label-pole {
  color: #8ed8ff;
  font-size: 9px;
}
.map-pole-icon,
.map-transformer-icon,
.map-activity-icon,
.map-tap-icon,
.map-connection-icon {
  background: transparent;
  border: none;
}
.map-pole-icon svg,
.map-transformer-icon svg {
  overflow: visible;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25));
}
.map-pole-marker,
.map-transformer-marker,
.map-tap-marker,
.map-connection-marker,
.map-connection-badge {
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
  transform-origin: center;
}
.map-pole-marker svg,
.map-transformer-marker svg,
.map-tap-marker svg {
  overflow: visible;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .34));
}
body[data-theme='light'] .map-pole-marker svg,
body[data-theme='light'] .map-transformer-marker svg,
body[data-theme='light'] .map-tap-marker svg {
  filter: saturate(.92) contrast(1.14) brightness(.9) drop-shadow(0 6px 12px rgba(15, 35, 60, .42));
}
.map-asset-dimmed {
  opacity: .15 !important;
  filter: saturate(.45);
}
.map-asset-highlighted {
  opacity: 1 !important;
  transform: scale(1.35);
  z-index: 20;
  filter: saturate(1.08) drop-shadow(0 10px 16px rgba(0, 0, 0, .5));
}
.map-connection-marker {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(6, 182, 212, .85);
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
body[data-theme='light'] .map-connection-marker {
  background: #2d6b78;
  box-shadow: 0 3px 8px rgba(15, 35, 60, .18);
}

.map-connection-marker.is-planned {
  background: rgba(245, 158, 11, .78);
}
body[data-theme='light'] .map-connection-marker.is-planned {
  background: #8b6b40;
}

.map-connection-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, .98);
  color: #06202d;
  border: none;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .24);
}
body[data-theme='light'] .map-connection-badge {
  background: #2d6b78;
  color: #f8fafc;
  box-shadow: 0 3px 8px rgba(15, 35, 60, .18);
}

.map-connection-badge.is-planned {
  background: rgba(245, 158, 11, .96);
  color: #231400;
}
body[data-theme='light'] .map-connection-badge.is-planned {
  background: #705532;
  color: #f8f3ea;
}
.map-activity-badge {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
  color: #fff;
}
.mab-install { background: #10b981; }
.mab-cable { background: #3b82f6; }
.mab-dig { background: #000; }
.mab-survey { background: #0ea5e9; }
.mab-transformer { background: #8b5cf6; }
.mab-service { background: #059669; }
.mab-default { background: #64748b; }
.map-legend {
  position: absolute; bottom: 10px; left: 10px;
  background: color-mix(in srgb, var(--bg2) 88%, transparent); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
  display: flex; gap: 14px; z-index: 5; flex-wrap: wrap;
}
.li { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }
.ld { width: 9px; height: 9px; border-radius: 50%; }
.ld-hole {
  width: 10px;
  height: 10px;
  background: #000;
}
.ld-activity {
  width: 12px;
  height: 12px;
  background: var(--lv);
}
body[data-theme='light'] .leaflet-control-layers,
body[data-theme='light'] .leaflet-control-attribution {
  background: rgba(255, 255, 255, .92);
}
body[data-theme='light'] .leaflet-control-zoom a,
body[data-theme='light'] .leaflet-control-layers-toggle,
body[data-theme='light'] .leaflet-bar a {
  background: rgba(255, 255, 255, .96);
  color: var(--text2);
  border-color: rgba(174, 191, 214, .95);
}
body[data-theme='light'] .leaflet-control-zoom a:hover,
body[data-theme='light'] .leaflet-bar a:hover {
  background: var(--bg3);
  color: var(--text);
}
body[data-theme='light'] .leaflet-control-layers {
  border-color: rgba(174, 191, 214, .95);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(15, 35, 65, .16);
}
body[data-theme='light'] .leaflet-control-attribution {
  color: var(--text2);
}
body[data-theme='light'] .leaflet-control-attribution a {
  color: var(--text2);
}
body[data-theme='light'] .leaflet-control-scale-line {
  color: var(--text2);
  box-shadow: 0 10px 24px rgba(15, 35, 65, .12);
}
body[data-theme='light'] .leaflet-popup-content-wrapper,
body[data-theme='light'] .leaflet-popup-tip {
  background: rgba(255, 255, 255, .98);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(15, 35, 65, .16);
}
body[data-theme='light'] .map-stage-tag {
  color: var(--text2);
  background: rgba(148, 163, 184, .14);
  border-color: rgba(148, 163, 184, .28);
}
body[data-theme='light'] .map-popup-flag {
  color: var(--text2);
  background: rgba(148, 163, 184, .12);
  border-color: rgba(148, 163, 184, .28);
}
body[data-theme='light'] .map-popup-flag.info {
  color: #1d4ed8;
  background: rgba(59, 130, 246, .1);
}
body[data-theme='light'] .map-popup-flag.warn {
  color: #92400e;
  background: rgba(245, 158, 11, .12);
}
body[data-theme='light'] .map-popup-flag.success {
  color: #047857;
  background: rgba(16, 185, 129, .12);
}
body[data-theme='light'] .map-popup-flag.danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, .1);
}
body[data-theme='light'] .map-popup-callout {
  background: rgba(241, 245, 249, .86);
  border-color: rgba(174, 191, 214, .62);
}
body[data-theme='light'] .map-popup-callout.danger {
  background: rgba(254, 242, 242, .96);
  border-color: rgba(239, 68, 68, .2);
}
body[data-theme='light'] .map-popup-callout-copy {
  color: var(--text2);
}
body[data-theme='light'] .map-stage-tag.done {
  color: var(--hh2);
}
body[data-theme='light'] .map-stage-tag.progress {
  color: var(--text);
}
body[data-theme='light'] .map-stage-tag.rejected {
  color: var(--red);
}
body[data-theme='light'] .map-popup-action {
  border-color: rgba(174, 191, 214, .94);
  background: rgba(247, 250, 252, .96);
  color: var(--text);
}
body[data-theme='light'] .map-popup-action:hover {
  border-color: rgba(88, 112, 138, .34);
  background: rgba(231, 237, 245, .98);
}
body[data-theme='light'] .asset-field-value-pill {
  background: rgba(241, 245, 249, .88);
  border-color: rgba(174, 191, 214, .7);
  color: var(--text);
}
body[data-theme='light'] .asset-field-value-pill.success {
  color: #047857;
  background: rgba(220, 252, 231, .92);
  border-color: rgba(16, 185, 129, .2);
}
body[data-theme='light'] .asset-field-value-pill.danger {
  color: #b91c1c;
  background: rgba(254, 242, 242, .96);
  border-color: rgba(239, 68, 68, .2);
}
body[data-theme='light'] .leaflet-tooltip.map-persistent-label {
  text-shadow: 0 1px 3px rgba(255, 255, 255, .95), 0 1px 10px rgba(255, 255, 255, .85);
}
.map-shell .leaflet-control-layers { display: none; }
.map-shell.map-fullscreen {
  position: fixed;
  top: var(--chrome-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  width: auto;
  height: auto !important;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border-color: transparent;
}
body.map-fullscreen-active:not(.is-mobile) .map-shell.map-fullscreen {
  left: var(--sidebar-visible-width);
}

/* ── MAP OVERLAY CONTROLS ── */
.map-expand-btn {
  position: absolute; top: 12px; right: 12px; z-index: 1025;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  border: 1px solid var(--overlay-panel-border); border-radius: 12px;
  color: var(--text2); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s ease;
  backdrop-filter: blur(14px);
  box-shadow: var(--overlay-panel-shadow);
}
.map-expand-btn:hover { color: var(--mv); border-color: var(--mv); background: color-mix(in srgb, var(--overlay-panel-bg) 98%, transparent); }
.map-panel-toggle {
  position: absolute; top: 12px; left: 12px; z-index: 1025;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  border: 1px solid var(--overlay-panel-border); border-radius: 12px;
  color: var(--text2); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
  transition: color .15s, border-color .15s, background .15s ease;
  backdrop-filter: blur(14px);
  box-shadow: var(--overlay-panel-shadow);
}
.map-panel-toggle:hover { color: var(--mv); border-color: var(--mv); background: color-mix(in srgb, var(--overlay-panel-bg) 98%, transparent); }
.map-status-stack {
  position: absolute;
  right: 14px;
  bottom: 108px;
  z-index: 915;
  width: min(240px, calc(100% - 92px));
  display: grid;
  gap: 16px;
  pointer-events: none;
  --map-overlay-kicker-size: 10px;
  --map-overlay-title-size: 15px;
  --map-overlay-metric-size: 17px;
  --map-overlay-name-size: 12px;
  --map-overlay-detail-size: 11px;
  --map-overlay-caption-size: 10px;
}
.map-status-stack .map-progress-technicians,
.map-status-stack .map-field-issue-summary,
.map-status-stack .map-village-asset-summary {
  width: 100%;
}
.map-status-stack .map-progress-technicians:not(.hidden) + .map-village-asset-summary::before,
.map-status-stack .map-village-asset-summary:not(.hidden) + .map-field-issue-summary::before {
  content: '';
  display: block;
  height: 1px;
  margin: 12px 0 16px;
  background: linear-gradient(90deg, rgba(230, 239, 248, 0) 0%, rgba(230, 239, 248, .3) 50%, rgba(230, 239, 248, 0) 100%);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians:not(.hidden) + .map-village-asset-summary::before,
body[data-theme='light'] .map-status-stack .map-village-asset-summary:not(.hidden) + .map-field-issue-summary::before {
  background: linear-gradient(90deg, rgba(23, 48, 77, 0) 0%, rgba(23, 48, 77, .28) 50%, rgba(23, 48, 77, 0) 100%);
}
.map-status-stack .map-progress-technicians {
  position: relative;
  z-index: 0;
  gap: 10px;
  padding: 10px 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: #e6f0fb;
  pointer-events: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92), 0 3px 12px rgba(0, 0, 0, .58);
}
.map-status-stack .map-progress-technicians::before {
  content: '';
  position: absolute;
  inset: -6px -10px;
  z-index: -1;
  border-radius: 22px;
  background: radial-gradient(120% 130% at 28% 12%, rgba(3, 9, 20, .55), rgba(3, 9, 20, 0) 72%);
  pointer-events: none;
}
.map-status-stack .map-progress-technicians-list {
  max-height: max(96px, min(180px, calc(var(--map-shell-height) - 250px)));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  gap: 0;
}
.map-status-stack .map-progress-technicians-eyebrow {
  font-size: var(--map-overlay-kicker-size);
  font-weight: 600;
  letter-spacing: .12em;
  color: rgba(210, 227, 245, .62);
}
.map-status-stack .map-progress-technicians-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--map-overlay-title-size);
  font-weight: 700;
  color: #f7fbff;
  line-height: 1.05;
}
.map-status-stack .map-progress-technicians-badge {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(230, 239, 248, .76);
  font-size: var(--map-overlay-caption-size);
}
.map-status-stack .map-progress-technician-row {
  gap: 8px;
  padding: 7px 0;
  border: none;
  border-bottom: 1px solid rgba(230, 239, 248, .14);
  border-radius: 0;
  background: transparent;
}
.map-status-stack .map-progress-technician-row:first-child {
  padding-top: 2px;
}
.map-status-stack .map-progress-technician-row:last-child {
  padding-bottom: 2px;
  border-bottom: none;
}
.map-status-stack .map-progress-technician-rank {
  color: inherit;
}
.map-status-stack .map-progress-technician-heading {
  gap: 8px;
}
.map-status-stack .map-progress-technician-name {
  color: #f7fbff;
  font-size: var(--map-overlay-name-size);
}
.map-status-stack .map-progress-technician-meta {
  color: rgba(230, 239, 248, .76);
  font-size: var(--map-overlay-caption-size);
}
.map-status-stack .map-progress-technician-detail {
  color: #dff3ff;
  font-size: var(--map-overlay-detail-size);
  font-weight: 600;
  line-height: 1.25;
}
.map-status-stack .map-progress-technician-metrics {
  gap: 1px;
}
.map-status-stack .map-progress-technician-share {
  color: #dff3ff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--map-overlay-metric-size);
  line-height: 1;
}
.map-status-stack .map-progress-technician-holes {
  color: rgba(230, 239, 248, .62);
  font-size: var(--map-overlay-caption-size);
}
.map-status-stack .map-progress-technicians-empty {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(230, 239, 248, .76);
}
.map-status-stack .map-progress-technicians-toggle {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(230, 239, 248, .88);
  font-size: 10px;
  letter-spacing: .04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(230, 239, 248, .4);
}
.map-status-stack .map-progress-technicians-toggle:hover {
  background: transparent;
  color: #f7fbff;
  text-decoration-color: currentColor;
}
.map-village-asset-summary {
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #e6f0fb;
  pointer-events: none;
  backdrop-filter: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92), 0 3px 12px rgba(0, 0, 0, .58);
}
.map-village-asset-summary.hidden {
  display: none;
}
.map-field-issue-summary {
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #e6f0fb;
  pointer-events: auto;
  backdrop-filter: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92), 0 3px 12px rgba(0, 0, 0, .58);
}
.map-field-issue-summary.hidden {
  display: none;
}
.map-field-issue-summary-eyebrow {
  font-size: var(--map-overlay-kicker-size);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(210, 227, 245, .62);
}
.map-field-issue-summary-title {
  margin-top: 2px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--map-overlay-title-size);
  font-weight: 700;
  color: #f7fbff;
  line-height: 1.05;
}
.map-field-issue-summary-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.map-field-issue-item {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(230, 239, 248, .14);
}
.map-field-issue-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.map-field-issue-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.map-field-issue-item-subject {
  color: #dff3ff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.map-field-issue-item-status,
.map-field-issue-more {
  color: rgba(230, 239, 248, .74);
  font-size: var(--map-overlay-caption-size);
}
.map-field-issue-item-comment {
  margin-top: 4px;
  color: #f7fbff;
  font-size: var(--map-overlay-detail-size);
  line-height: 1.45;
}
.map-field-issue-item-meta {
  margin-top: 3px;
  color: rgba(230, 239, 248, .74);
  font-size: var(--map-overlay-caption-size);
  line-height: 1.35;
}
.map-field-issue-item-summary {
  margin-top: 3px;
  color: #f7fbff;
  font-size: var(--map-overlay-detail-size);
  line-height: 1.35;
}
.map-field-issue-item-link {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(230, 239, 248, .9);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(230, 239, 248, .42);
  cursor: pointer;
}
.map-field-issue-item-link:hover {
  color: #f7fbff;
  text-decoration-color: currentColor;
}
.map-field-issue-summary-action {
  margin-top: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(230, 239, 248, .88);
  font-size: 10px;
  letter-spacing: .04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(230, 239, 248, .4);
  cursor: pointer;
}
.map-field-issue-summary-action:hover {
  color: #f7fbff;
  text-decoration-color: currentColor;
}
.map-village-asset-summary-eyebrow {
  font-size: var(--map-overlay-kicker-size);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(210, 227, 245, .62);
}
.map-village-asset-summary-title {
  margin-top: 2px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--map-overlay-title-size);
  font-weight: 700;
  color: #f7fbff;
  line-height: 1.05;
}
.map-village-asset-summary-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.map-village-asset-summary-stat {
  min-width: 0;
}
.map-village-asset-summary-stat-left {
  justify-self: start;
  text-align: left;
}
.map-village-asset-summary-stat-right {
  justify-self: end;
  text-align: right;
}
.map-village-asset-summary-value {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--map-overlay-metric-size);
  font-weight: 700;
  color: #dff3ff;
  line-height: 1;
}
.map-village-asset-summary-label {
  display: block;
  margin-top: 1px;
  font-size: var(--map-overlay-caption-size);
  line-height: 1.25;
  color: rgba(230, 239, 248, .76);
}
body[data-theme='light'] .map-village-asset-summary {
  color: var(--text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .88);
}
body[data-theme='light'] .map-field-issue-summary {
  color: var(--text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .88);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians {
  color: var(--text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .88);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians::before {
  background: radial-gradient(120% 130% at 28% 12%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 72%);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians-eyebrow {
  color: rgba(23, 48, 77, .58);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians-title,
body[data-theme='light'] .map-status-stack .map-progress-technician-name {
  color: var(--white);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians-badge,
body[data-theme='light'] .map-status-stack .map-progress-technician-meta,
body[data-theme='light'] .map-status-stack .map-progress-technician-detail,
body[data-theme='light'] .map-status-stack .map-progress-technicians-empty {
  color: rgba(23, 48, 77, .72);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians-toggle {
  color: rgba(23, 48, 77, .8);
  text-decoration-color: rgba(23, 48, 77, .4);
}
body[data-theme='light'] .map-status-stack .map-progress-technicians-toggle:hover {
  color: var(--white);
  text-decoration-color: currentColor;
}
body[data-theme='light'] .map-status-stack .map-progress-technician-row {
  border-bottom-color: rgba(23, 48, 77, .16);
}
body[data-theme='light'] .map-status-stack .map-progress-technician-rank {
  color: inherit;
}
body[data-theme='light'] .map-status-stack .map-progress-technician-share {
  color: var(--lv2);
}
body[data-theme='light'] .map-status-stack .map-progress-technician-holes {
  color: rgba(23, 48, 77, .6);
}
body[data-theme='light'] .map-village-asset-summary-eyebrow {
  color: rgba(23, 48, 77, .58);
}
body[data-theme='light'] .map-field-issue-summary-eyebrow {
  color: rgba(23, 48, 77, .58);
}
body[data-theme='light'] .map-village-asset-summary-title {
  color: var(--white);
}
body[data-theme='light'] .map-field-issue-summary-title,
body[data-theme='light'] .map-field-issue-item-comment {
  color: var(--white);
}
body[data-theme='light'] .map-village-asset-summary-value {
  color: var(--lv2);
}
body[data-theme='light'] .map-village-asset-summary-label {
  color: rgba(23, 48, 77, .72);
}
body[data-theme='light'] .map-field-issue-item {
  border-bottom-color: rgba(23, 48, 77, .16);
}
body[data-theme='light'] .map-field-issue-item-subject {
  color: var(--lv2);
}
body[data-theme='light'] .map-field-issue-item-status,
body[data-theme='light'] .map-field-issue-item-meta,
body[data-theme='light'] .map-field-issue-more {
  color: rgba(23, 48, 77, .72);
}
body[data-theme='light'] .map-field-issue-item-summary {
  color: var(--white);
}
body[data-theme='light'] .map-field-issue-item-link {
  color: rgba(23, 48, 77, .82);
  text-decoration-color: rgba(23, 48, 77, .38);
}
body[data-theme='light'] .map-field-issue-item-link:hover {
  color: var(--white);
  text-decoration-color: currentColor;
}
body[data-theme='light'] .map-field-issue-summary-action {
  color: rgba(23, 48, 77, .8);
  text-decoration-color: rgba(23, 48, 77, .4);
}
body[data-theme='light'] .map-field-issue-summary-action:hover {
  color: var(--white);
  text-decoration-color: currentColor;
}

@media (max-width: 767px) {
  .field-issue-detail-audit {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── MAP LAYER PANEL ── */
.map-layer-panel {
  --map-panel-top: 12px;
  position: absolute; top: var(--map-panel-top); left: 12px; z-index: 1015;
  background: color-mix(in srgb, var(--overlay-panel-bg) 92%, transparent);
  border: 1px solid var(--overlay-panel-border); border-radius: 18px;
  padding: 54px 14px 14px;
  width: min(var(--map-layer-panel-width), calc(100% - 24px));
  min-width: min(var(--map-layer-panel-width), calc(100% - 24px));
  box-shadow: var(--overlay-panel-shadow);
  pointer-events: auto;
  transform: translateZ(0);
  max-height: calc(100% - var(--map-panel-top) - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--overlay-scrollbar-thumb) var(--overlay-scrollbar-track);
  backdrop-filter: blur(18px);
}
.map-layer-panel.collapsed { display: none; }
.map-shell.map-fullscreen .map-layer-panel {
  max-height: calc(100vh - var(--chrome-height) - 24px);
}
.map-shell.map-fullscreen .map-sector-menu {
  height: min(calc(100vh - var(--chrome-height) - 156px), 760px);
  max-height: calc(100vh - var(--chrome-height) - 96px);
}
.map-shell.map-fullscreen .map-progress-date-menu {
  max-height: min(calc(100vh - var(--chrome-height) - 120px), 520px);
  overflow-y: auto;
}
body.map-fullscreen-active:not(.is-mobile) .map-sector-picker {
  position: fixed;
  top: calc(var(--chrome-height) + 8px);
  left: calc((100vw + var(--sidebar-visible-width)) / 2);
  z-index: 1090;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - var(--sidebar-visible-width) - 132px));
  max-width: calc(100vw - var(--sidebar-visible-width) - 132px);
}
body.map-fullscreen-active .map-status-stack {
  right: 18px;
  bottom: 96px;
}
body[data-theme='light'] .map-expand-btn,
body[data-theme='light'] .map-panel-toggle {
  border-color: rgba(174, 191, 214, .94);
  background: color-mix(in srgb, rgba(255,255,255,.96) 96%, transparent);
  box-shadow: 0 12px 28px rgba(15, 35, 65, .14);
}

.mlp-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.mlp-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--white);
}
.mlp-close {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1;
  transition: color .15s;
}
.mlp-close:hover { color: var(--text); }
.mlp-sec {
  font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text3); font-family: 'JetBrains Mono', monospace;
  margin: 8px 0 5px;
}
.mlp-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px; cursor: pointer;
}
.mlp-row input[type="checkbox"],
.mlp-row input[type="radio"] {
  accent-color: var(--mv); width: 12px; height: 12px;
  flex-shrink: 0; cursor: pointer;
}
.mlp-swatch {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 50%; flex-shrink: 0;
}
.mlp-swatch-ring {
  display: inline-block; width: 10px; height: 10px;
  background: transparent; border: 2px solid var(--hh); border-radius: 50%;
  flex-shrink: 0;
}
.mlp-swatch-act {
  display: inline-block; width: 12px; height: 12px;
  background: var(--lv); border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%; flex-shrink: 0;
}
.mlp-label { flex: 1; font-size: 12px; color: var(--text); }
.mlp-count {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text3); margin-left: auto;
}
.mlp-legend-note {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(54, 80, 120, .72);
  border-radius: 10px;
  background: rgba(12, 21, 38, .72);
  display: grid;
  gap: 6px;
}
body[data-theme='light'] .mlp-legend-note {
  border-color: rgba(174, 191, 214, .95);
  background: rgba(231, 238, 248, .82);
}

.map-sector-menu::-webkit-scrollbar,
.map-layer-panel::-webkit-scrollbar,
.project-zone-list::-webkit-scrollbar {
  width: 10px;
}
.map-sector-menu::-webkit-scrollbar-track,
.map-layer-panel::-webkit-scrollbar-track,
.project-zone-list::-webkit-scrollbar-track {
  background: var(--overlay-scrollbar-track);
  border-radius: 999px;
}
.map-sector-menu::-webkit-scrollbar-thumb,
.map-layer-panel::-webkit-scrollbar-thumb,
.project-zone-list::-webkit-scrollbar-thumb {
  min-height: 26px;
  background: var(--overlay-scrollbar-thumb);
  border: 2px solid var(--overlay-scrollbar-thumb-border);
  border-radius: 999px;
  background-clip: padding-box;
}
.map-sector-menu::-webkit-scrollbar-thumb:hover,
.map-layer-panel::-webkit-scrollbar-thumb:hover,
.project-zone-list::-webkit-scrollbar-thumb:hover {
  background: var(--overlay-scrollbar-thumb-hover);
  background-clip: padding-box;
}
.mlp-legend-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}
.mlp-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text2);
}
.mlp-legend-line {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid currentColor;
  flex-shrink: 0;
}
.mlp-legend-line.planned-feeder {
  color: #64748b;
  border-top-style: dashed;
}
.mlp-legend-line.planned-drop {
  color: #f59e0b;
  border-top-style: dashed;
}
.mlp-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.mlp-legend-dot.planned {
  background: rgba(245, 158, 11, .78);
  border-style: dashed;
}
.mlp-legend-dot.connected {
  background: rgba(6, 182, 212, .92);
}
.map-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.map-loading-inline .btn-loader {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}
.map-progress-cards {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.map-progress-card {
  border: 1px solid rgba(44, 69, 106, .95);
  background: rgba(9, 18, 33, .94);
  border-radius: 12px;
  padding: 10px 11px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
body[data-theme='light'] .map-progress-card {
  border-color: rgba(174, 191, 214, .95);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 18px rgba(15, 35, 65, .08);
}
.map-progress-card:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 195, 247, .42);
}
body[data-theme='light'] .map-progress-card:hover {
  border-color: rgba(88, 112, 138, .28);
}
.map-progress-card.active {
  background: rgba(19, 36, 63, .98);
  border-color: rgba(79, 195, 247, .66);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .26);
}
body[data-theme='light'] .map-progress-card.active {
  background: rgba(235, 241, 247, .96);
  border-color: rgba(88, 112, 138, .38);
  box-shadow: 0 10px 22px rgba(15, 35, 65, .12);
}
.map-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 7px;
}
.map-progress-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}
.map-progress-percent {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text2);
}
.map-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(30, 41, 59, .92);
  border-radius: 999px;
  overflow: hidden;
}
body[data-theme='light'] .map-progress-bar {
  background: rgba(199, 212, 229, .9);
}
.map-progress-fill {
  height: 100%;
  border-radius: inherit;
}
.map-progress-meta {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}
.map-clear-filter {
  width: 100%;
  border: 1px dashed rgba(148, 163, 184, .55);
  background: transparent;
  color: var(--text2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.map-clear-filter:hover {
  border-color: rgba(79, 195, 247, .64);
  color: #dbeafe;
  background: rgba(17, 32, 64, .68);
}
body[data-theme='light'] .map-clear-filter:hover {
  border-color: rgba(88, 112, 138, .34);
  color: var(--text);
  background: rgba(235, 241, 247, .78);
}
.map-clear-filter.active {
  border-color: rgba(79, 195, 247, .72);
  color: #dbeafe;
}
body[data-theme='light'] .map-clear-filter.active {
  border-color: rgba(88, 112, 138, .4);
  color: var(--text);
}

/* ── DASHBOARD COMPACT TOP ── */
#page-dashboard #dashHero {
  gap: 16px;
  margin-bottom: 18px !important;
}
#page-dashboard .scope-card {
  min-height: 152px;
  height: 152px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: var(--shadow-card);
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
#page-dashboard .scope-card:hover {
  transform: none;
  border-color: var(--border2);
}
#page-dashboard .scope-card::after {
  display: none;
}
#page-dashboard .scope-card .sc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#page-dashboard .scope-card .sc-kicker {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text2);
}
#page-dashboard .scope-card .sc-icon {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 16px;
  padding: 0;
}
#page-dashboard .scope-card .sc-label {
  margin-top: 4px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0;
}
#page-dashboard .scope-card .sc-value-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
#page-dashboard .scope-card .sc-value-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
#page-dashboard .scope-card .sc-done {
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}
#page-dashboard .scope-card .sc-unit {
  font-size: 12px;
  color: var(--text2);
}
#page-dashboard .scope-card .sc-target {
  min-width: 0;
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-dashboard .scope-card .pbar {
  margin-top: 8px;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-xs);
}
#page-dashboard .scope-card .pfill {
  background: var(--brand);
  border-radius: inherit;
}
#page-dashboard .scope-card .sc-pct {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
#page-dashboard .scope-card .sc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-dashboard .scope-card .sc-meta-item {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-dashboard .scope-card .sc-meta-item strong {
  color: var(--text);
  font-weight: 500;
}
#page-dashboard .scope-card .sc-meta-sep {
  color: var(--text3);
  flex-shrink: 0;
}
#page-dashboard .g2[style*="margin-bottom:20px"] {
  margin-bottom: 10px !important;
}
#page-dashboard .card-hd {
  margin-bottom: 10px;
}

@media (max-width: 1480px) {
  #page-dashboard #dashHero {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  #page-dashboard .scope-card {
    min-height: 148px;
    height: 148px;
    padding: 14px;
  }

  #page-dashboard .scope-card .sc-icon {
    font-size: 14px;
  }

  #page-dashboard .scope-card .sc-label {
    font-size: 13px;
  }

  #page-dashboard .scope-card .sc-done {
    font-size: 24px;
  }

  #page-dashboard .scope-card .sc-unit {
    font-size: 10px;
  }

  #page-dashboard .scope-card .sc-target,
  #page-dashboard .scope-card .sc-meta {
    font-size: 10px;
  }
}

@media (max-width: 1240px) and (min-width: 768px) {
  #page-dashboard #dashHero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .map-card-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .map-sector-picker {
    width: min(320px, calc(100% - 92px));
    max-width: calc(100% - 92px);
  }
}

@media (min-width: 901px) {
  .map-sector-picker {
    --map-filter-font-size: clamp(10px, 0.2vw + 8.5px, 12px);
    --map-filter-action-font-size: clamp(9px, 0.1vw + 8.1px, 10px);
    --map-filter-min-height: clamp(40px, 1.2vw + 29px, 44px);
    --map-filter-gap: clamp(8px, 0.45vw + 4px, 12px);
    --map-filter-pill-pad-y: clamp(7px, 0.25vw + 5px, 8px);
    --map-filter-pill-pad-left: clamp(12px, 0.45vw + 8px, 14px);
    --map-filter-pill-pad-right: clamp(10px, 0.45vw + 6px, 12px);
    --map-filter-action-pad-y: clamp(4px, 0.15vw + 2.5px, 5px);
    --map-filter-action-pad-x: clamp(7px, 0.35vw + 4px, 9px);
    --map-filter-value-pad-y: clamp(2px, 0.1vw + 1.5px, 3px);
    --map-filter-value-pad-x: clamp(8px, 0.25vw + 5px, 9px);
    flex-wrap: nowrap;
    gap: var(--map-filter-gap);
    width: min(980px, calc(100% - 40px));
    max-width: calc(100% - 40px);
  }

  .map-sector-dropdown {
    flex: 0 1 clamp(320px, 34vw, 540px);
    min-width: clamp(260px, 28vw, 340px);
    max-width: clamp(320px, 34vw, 540px);
  }

  .map-progress-date-picker {
    flex: 0 1 clamp(250px, 29vw, 360px);
    min-width: clamp(220px, 24vw, 300px);
    gap: clamp(6px, 0.35vw + 3px, 8px);
  }

  .map-sector-trigger,
  .map-progress-date-trigger {
    min-height: var(--map-filter-min-height);
    font-size: var(--map-filter-font-size);
  }

  .map-sector-trigger {
    gap: clamp(8px, 0.35vw + 5px, 10px);
    padding:
      var(--map-filter-pill-pad-y)
      var(--map-filter-pill-pad-right)
      var(--map-filter-pill-pad-y)
      var(--map-filter-pill-pad-left);
  }

  .map-progress-date-trigger {
    gap: clamp(10px, 0.35vw + 7px, 12px);
    padding:
      var(--map-filter-pill-pad-y)
      var(--map-filter-pill-pad-right)
      var(--map-filter-pill-pad-y)
      var(--map-filter-pill-pad-left);
  }

  .map-sector-actions {
    gap: clamp(4px, 0.2vw + 2px, 6px);
  }

  .map-sector-action,
  .map-sector-inline-status,
  .map-progress-date-clear {
    font-size: var(--map-filter-action-font-size);
    padding: var(--map-filter-action-pad-y) var(--map-filter-action-pad-x);
  }

  .map-progress-date-copy {
    gap: clamp(6px, 0.2vw + 4px, 7px);
  }

  .map-progress-date-icon {
    font-size: clamp(13px, 0.12vw + 12px, 14px);
  }

  .map-progress-date-value {
    padding: var(--map-filter-value-pad-y) var(--map-filter-value-pad-x);
    font-size: inherit;
  }

  .map-wrap:has(.map-shell:not(.map-fullscreen) .map-layer-panel:not(.collapsed)) .map-sector-picker {
    left: calc((100% + var(--map-filter-usable-left) - var(--map-filter-right-clearance)) / 2);
    transform: translateX(-50%);
    width: min(980px, calc(100% - var(--map-filter-usable-left) - var(--map-filter-right-clearance)));
    max-width: calc(100% - var(--map-filter-usable-left) - var(--map-filter-right-clearance));
    justify-content: center;
  }

  body.map-fullscreen-active:not(.is-mobile) .map-wrap:has(.map-shell.map-fullscreen .map-layer-panel:not(.collapsed)) .map-sector-picker {
    left: calc((100vw + var(--sidebar-visible-width) + var(--map-filter-usable-left) - 72px) / 2);
    transform: translateX(-50%);
    width: min(980px, calc(100vw - var(--sidebar-visible-width) - var(--map-filter-usable-left) - 72px));
    max-width: calc(100vw - var(--sidebar-visible-width) - var(--map-filter-usable-left) - 72px);
    justify-content: center;
  }
}

@media (max-width: 1366px) and (min-width: 901px) {
  .map-sector-picker {
    width: min(900px, calc(100% - 34px));
    max-width: calc(100% - 34px);
  }
}

@media (max-width: 1240px) and (min-width: 901px) {
  .map-wrap {
    --map-layer-panel-width: clamp(196px, 17vw, 228px);
    --map-panel-inline-gap: 10px;
    --map-filter-right-clearance: 48px;
  }

  .map-sector-dropdown {
    flex: 0 1 clamp(280px, 32vw, 450px);
    min-width: clamp(232px, 26vw, 300px);
    max-width: clamp(280px, 32vw, 450px);
  }

  .map-sector-picker {
    --map-filter-font-size: clamp(9px, 0.16vw + 8px, 11px);
    --map-filter-action-font-size: clamp(8px, 0.08vw + 7.5px, 9px);
    --map-filter-min-height: clamp(38px, 0.9vw + 30px, 41px);
    --map-filter-gap: clamp(6px, 0.2vw + 4px, 8px);
    --map-filter-pill-pad-y: clamp(6px, 0.2vw + 4px, 7px);
    --map-filter-pill-pad-left: clamp(10px, 0.3vw + 7px, 12px);
    --map-filter-pill-pad-right: clamp(8px, 0.25vw + 5px, 10px);
    --map-filter-action-pad-y: clamp(3px, 0.1vw + 2px, 4px);
    --map-filter-action-pad-x: clamp(6px, 0.2vw + 4px, 8px);
    --map-filter-value-pad-y: 2px;
    --map-filter-value-pad-x: clamp(7px, 0.2vw + 4px, 8px);
    width: min(820px, calc(100% - 28px));
    max-width: calc(100% - 28px);
  }

  .map-progress-date-picker {
    flex: 0 1 clamp(220px, 26vw, 280px);
    min-width: clamp(190px, 22vw, 240px);
    gap: 4px;
  }

  .map-sector-actions {
    gap: 4px;
  }

  .map-sector-action,
  .map-sector-inline-status,
  .map-progress-date-clear {
    letter-spacing: .1px;
  }

  .map-progress-date-trigger {
    gap: 8px;
  }
}

@media (max-width: 1120px) and (min-width: 901px) {
  .map-wrap {
    --map-layer-panel-width: clamp(184px, 16vw, 212px);
    --map-panel-inline-gap: 8px;
    --map-filter-right-clearance: 40px;
  }

  .map-sector-dropdown {
    flex: 0 1 clamp(244px, 30vw, 360px);
    min-width: clamp(210px, 25vw, 260px);
    max-width: clamp(244px, 30vw, 360px);
  }

  .map-sector-picker {
    width: min(740px, calc(100% - 24px));
    max-width: calc(100% - 24px);
  }

  .map-progress-date-picker {
    flex: 0 1 clamp(190px, 24vw, 230px);
    min-width: clamp(168px, 20vw, 210px);
  }

  .map-progress-date-label {
    display: none;
  }

  .map-progress-date-copy {
    flex: 0 1 auto;
    gap: 5px;
  }

  .map-progress-date-clear {
    padding-inline: 7px;
  }
}

@media (max-width: 980px) and (min-width: 901px) {
  .map-wrap {
    --map-layer-panel-width: 176px;
    --map-panel-inline-gap: 8px;
    --map-filter-right-clearance: 36px;
  }

  .map-sector-dropdown {
    flex: 0 1 clamp(220px, 30vw, 300px);
    min-width: 196px;
    max-width: clamp(220px, 30vw, 300px);
  }

  .map-sector-picker {
    width: min(680px, calc(100% - 20px));
    max-width: calc(100% - 20px);
  }

  .map-progress-date-picker {
    flex: 0 1 178px;
    min-width: 156px;
    gap: 3px;
  }

  .map-sector-action,
  .map-sector-inline-status,
  .map-progress-date-clear {
    padding-inline: 6px;
  }
}

@media (max-width: 700px) {
  #page-dashboard #dashHero {
    grid-template-columns: 1fr;
  }

  #page-dashboard .scope-card .sc-metrics {
    grid-template-columns: 1fr;
  }

  #page-dashboard .scope-card .sc-metric:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .sidebar-head {
    grid-template-columns: 1fr;
  }

  .sidebar-brand-card {
    padding: 12px 14px 10px;
  }

  .sidebar-brand-logo {
    width: 132px;
  }

  .content {
    padding: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 10px;
  }

  .page-title {
    font-size: 20px;
  }

  .g4,
  .g3,
  .rev-changes {
    grid-template-columns: 1fr;
  }

  .map-shell {
    --map-shell-height: min(52vh, calc(100vh - 260px));
    min-height: 300px;
    max-height: 460px;
  }

  .map-sector-picker {
    top: 10px;
    width: min(100%, calc(100% - 84px));
    max-width: calc(100% - 84px);
  }

  .map-sector-dropdown {
    width: 100%;
  }

  .map-sector-trigger {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 11px;
  }

  .map-sector-menu {
    gap: 10px;
    padding: 10px;
  }

  .map-layer-panel {
    --map-panel-top: 44px;
    top: var(--map-panel-top);
    left: 8px;
    right: 8px;
    min-width: 0;
    max-width: none;
    width: auto;
  }

  .map-progress-cards {
    grid-template-columns: 1fr;
  }

  .map-status-stack {
    right: 8px;
    bottom: 132px;
    width: min(220px, calc(100% - 16px));
  }

  .modal {
    width: min(94vw, 560px);
    padding: 20px;
  }

  .modal-foot {
    flex-direction: column;
  }
}

@media (max-width: 1100px) {
  .map-shell {
    --map-shell-height: min(58vh, calc(100vh - 220px));
    height: var(--map-shell-height);
    min-height: 340px;
    max-height: 560px;
  }
  .map-shell:not(.map-fullscreen) .map-sector-menu {
    max-height: min(calc(var(--map-shell-height) - 96px), 425px);
  }
}

/* ── SCOPE SUMMARY STRIPS ── */
.ss-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(26,42,68,.5);
}
.ss-strip:last-child { border-bottom: none; }
.ss-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.ss-name { flex: 1; font-size: 13px; font-weight: 500; }
.ss-nums { text-align: right; }
.ss-done { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 700; }
.ss-of { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', monospace; }
.ss-bar { width: 120px; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.ss-fill { height: 100%; border-radius: 2px; }

/* ── ZONE / SECTION SELECTOR ── */
.zone-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.zt { padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text2); transition: all .15s; white-space: nowrap; }
.zt.active { color: var(--mv); border-bottom-color: var(--mv); }
.zt:hover:not(.active) { color: var(--text); }

body[data-theme='light'] .scope-tbl td {
  border-bottom-color: var(--border);
}
body[data-theme='light'] .scope-tbl tr:hover td {
  background: rgba(15, 23, 42, .025);
}
body[data-theme='light'] .step-item {
  border-bottom-color: var(--border);
}
body[data-theme='light'] .ss-strip {
  border-bottom-color: var(--border);
}
body[data-theme='light'] .map-shell {
  background: #dce8f5;
}
body[data-theme='light'] .upload-progress-track {
  background: rgba(226, 232, 240, .85);
  border-color: rgba(174, 191, 214, .35);
}
body[data-theme='light'] .nav-item.active {
  background: #1e1e1e;
  border-color: #1e1e1e;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
body[data-theme='light'] .project-zone-option {
  background: rgba(15, 23, 42, .025);
}
body[data-theme='light'] .map-sector-empty {
  background: rgba(15, 23, 42, .02);
}
body[data-theme='light'] .bulk-config-menu,
body[data-theme='light'] .map-sector-menu {
  box-shadow: 0 18px 36px rgba(15, 35, 65, .12);
}
body[data-theme='light'] .tli:not(:last-child)::after {
  background: var(--border);
}

/* ── AI ASSISTANT ── */
.ai-sidebar-section { flex-shrink: 0; }
.ai-sidebar-sep { height: 1px; background: var(--border); margin: 0 12px 4px; }
.sidebar.is-collapsed .ai-sidebar-sep { margin: 0 8px 4px; }

.ai-nav-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 18px; cursor: pointer;
  border-left: 3px solid transparent;
  border-top: none; border-right: none; border-bottom: none;
  transition: all .15s;
  font-size: 13.5px; font-weight: 500; color: var(--text2);
  width: 100%; background: none; text-align: left;
  font-family: 'Barlow', sans-serif;
}
.ai-nav-btn:hover { background: var(--bg3); color: var(--text); }
.sidebar.is-collapsed .ai-nav-btn {
  padding: 10px 0; justify-content: center;
  border-left-width: 2px; position: relative;
}
.sidebar.is-collapsed .ai-nav-btn::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: 7px; padding: 5px 11px;
  font-size: 12px; font-weight: 500; color: var(--text);
  white-space: nowrap; z-index: 200; pointer-events: none;
  opacity: 0; transition: opacity .12s ease; font-family: 'Barlow', sans-serif;
}
.sidebar.is-collapsed .ai-nav-btn:hover::after { opacity: 1; }
.ai-sparkle { color: var(--text); animation: ai-pulse 2.8s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.ai-chat-widget {
  position: fixed; bottom: 22px; right: 22px;
  width: 300px; z-index: 1400;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.28);
  overflow: hidden;
  animation: ai-chat-in .22s cubic-bezier(.4,0,.2,1);
}
@keyframes ai-chat-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.ai-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1390;
  background: rgba(9, 14, 20, .48);
  backdrop-filter: blur(4px);
}
.ai-chat-backdrop.hidden { display: none; }
body.ai-chat-detached-open { overflow: hidden; }
.ai-chat-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.ai-chat-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.ai-chat-title .ph { color: var(--text); font-size: 16px; }
.ai-chat-btns { display: flex; gap: 2px; }
.ai-chat-ctrl {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 15px; line-height: 1;
  padding: 3px 7px; border-radius: 5px; font-family: inherit;
}
.ai-chat-ctrl .ph { font-size: 15px; }
.ai-chat-ctrl:hover { background: var(--bg4); color: var(--text); }
.ai-chat-body { padding: 16px; }
.ai-message { display: flex; gap: 10px; align-items: flex-start; }
.ai-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text);
}
.ai-bubble {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 2px 10px 10px 10px;
  padding: 10px 12px;
  font-size: 12.5px; color: var(--text2); line-height: 1.55;
}
.ai-chat-mini {
  position: fixed; bottom: 22px; right: 22px; z-index: 1400;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 999px; padding: 9px 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  transition: background .15s;
}
.ai-chat-mini.hidden { display: none; }
.ai-chat-mini .ph { color: var(--text); font-size: 15px; }
.ai-chat-mini:hover { background: var(--bg3); }
body.map-fullscreen-active .ai-chat-mini {
  right: 84px;
  bottom: 18px;
}

/* --- AI chat widget: conversation + input --- */
.ai-chat-widget { width: 360px; display: flex; flex-direction: column; }
.ai-chat-widget.hidden { display: none; }
body.map-fullscreen-active .ai-chat-widget:not(.ai-chat-widget-detached) {
  right: 84px;
  bottom: 18px;
  max-height: calc(100vh - 36px);
}
.ai-chat-widget.ai-chat-widget-detached {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(900px, calc(100vw - 40px));
  height: min(82vh, 760px);
  border-radius: 18px;
  transform: translate(-50%, -50%);
  z-index: 1401;
  animation: ai-chat-modal-in .22s cubic-bezier(.4,0,.2,1);
}
@keyframes ai-chat-modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.ai-chat-body {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 380px; overflow-y: auto;
}
.ai-chat-widget.ai-chat-widget-detached .ai-chat-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 18px;
}
.ai-message-user { justify-content: flex-end; }
.ai-bubble-user {
  background: var(--bg4); color: var(--text);
  border-radius: 10px 2px 10px 10px;
  max-width: 85%;
}
.ai-chat-foot {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}
.ai-chat-widget.ai-chat-widget-detached .ai-chat-foot { padding: 12px 14px; }
.ai-chat-input {
  flex: 1; resize: none; min-height: 34px; max-height: 90px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border2); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; font-family: inherit; line-height: 1.4;
}
.ai-chat-widget.ai-chat-widget-detached .ai-chat-input {
  min-height: 44px;
  max-height: 180px;
}
.ai-chat-input:focus { outline: none; border-color: var(--text3); }
.ai-chat-input:disabled { opacity: .6; }
.ai-chat-send {
  background: var(--bg4); color: var(--text);
  border: 1px solid var(--border2); border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.ai-chat-send:hover { background: var(--bg2); }
.ai-chat-send:disabled { opacity: .5; cursor: default; }
.ai-status { color: var(--text3); }
.ai-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3); opacity: .4;
  animation: ai-typing-blink 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-typing-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-md-h { font-weight: 700; margin: 6px 0 2px; color: var(--text); }
.ai-md-gap { height: 6px; }
.ai-md-list { margin: 4px 0 4px 16px; padding: 0; }
.ai-md-list li { margin: 2px 0; }
.ai-suggestions {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 10px;
}
.ai-suggestion-btn {
  width: 100%;
  text-align: left;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.ai-suggestion-btn:hover {
  background: var(--bg4);
  border-color: var(--text3);
  transform: translateY(-1px);
}
.ai-suggestion-btn:focus-visible {
  outline: 2px solid var(--text3);
  outline-offset: 1px;
}
.ai-md-records {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0;
}
.ai-md-record {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 9px 10px;
}
.ai-md-record-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ai-md-record-row {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 4px;
}
.ai-md-record-label {
  color: var(--text3);
  font-size: 11.5px;
}
.ai-md-record-value {
  color: var(--text2);
  word-break: break-word;
}
.ai-md-table { border-collapse: collapse; margin: 6px 0; font-size: 11.5px; width: 100%; }
.ai-md-table th, .ai-md-table td {
  border: 1px solid var(--border2); padding: 4px 7px; text-align: left;
}
.ai-md-table th { background: var(--bg4); color: var(--text); }

@media (min-width: 768px) {
  :root {
    --radius-xl: 6px;
  }

  .login-landing__brand,
  .login-landing__card,
  .theme-dropdown-menu,
  .topbar-user-menu-panel,
  .map-sector-picker,
  .map-progress-date-menu,
  .map-sector-menu,
  .map-layer-panel,
  .modal {
    border-radius: var(--radius-lg);
  }

  .login-landing__highlight,
  .scope-card,
  .scope-card .sc-icon,
  .scope-card .sc-metric,
  .project-zone-option,
  .map-progress-technicians,
  .map-progress-technician-row,
  .map-progress-technicians-empty,
  .mlp-legend-note {
    border-radius: var(--radius-md);
  }

  .login-landing__brand-note,
  .theme-dropdown-trigger,
  .theme-dropdown-option,
  .topbar-user-btn,
  .topbar-user-avatar,
  .topbar-user-avatar--large,
  .topbar-user-menu-action,
  .map-sector-trigger,
  .map-sector-action,
  .map-progress-date-trigger,
  .map-progress-date-value,
  .map-progress-date-nav,
  .map-progress-date-day,
  .map-progress-technicians-toggle,
  .map-expand-btn,
  .map-panel-toggle {
    border-radius: var(--radius-sm);
  }

  .map-status-stack .map-progress-technicians::before {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 720px) {
  .ai-chat-widget.ai-chat-widget-detached {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 14px;
  }
}
