@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Merriweather:ital,wght@0,300;0,700;0,900;1,300&display=swap");

:root {
  --font-head: "Merriweather", serif;
  --font-body: "Inter", sans-serif;

  --color-bg: #ffffff;
  --color-canvas-bg: #f9f8f6;
  --color-text-main: #2c3e50;
  --color-text-sub: #64748b;
  --color-accent: #2f5d62;
  --color-res: #f4a261;
  --color-emp: #e76f51;
  --color-land: #2a9d8f;

  --radius-lg: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);

  /* Report drawer / floating controls — aligned with accent + canvas */
  --report-spine-bg: linear-gradient(180deg, #faf9f7 0%, #f4f3f0 100%);
  --report-spine-border: #e7e5e0;
  /* Soft edge tint (no heavy teal bar) */
  --report-spine-edge-glow: rgba(42, 157, 143, 0.09);
  --report-icon-radius: 50%;
  --report-icon-bg: rgba(47, 93, 98, 0.07);
  --report-icon-border: rgba(47, 93, 98, 0.2);
  --report-icon-fg: var(--color-accent);
  --report-icon-hover-bg: var(--color-accent);
  --report-icon-hover-fg: #ffffff;
  --report-icon-shadow: 0 1px 2px rgba(47, 93, 98, 0.06);
  --report-icon-hover-shadow: 0 4px 14px rgba(47, 93, 98, 0.22);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--color-bg);
}

#uc-app-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--color-bg);
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

#uc-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 450px) minmax(0, 1fr);
  height: 100%;
  width: 100%;
  min-height: 0;
}

#uc-control-deck {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  z-index: 2;
  box-shadow: 5px 0 20px rgba(0, 0, 0, 0.02);
}

.uc-deck-header {
  padding: 30px 40px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.uc-brand-lockup {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.uc-mini-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-right: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.uc-brand-text {
  font-weight: 700;
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.uc-progress-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

#uc-progress-bar {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

.uc-step-indicator {
  font-size: 0.85rem;
  color: var(--color-text-sub);
  font-weight: 600;
  text-align: right;
}

#uc-wizard-steps {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  padding-bottom: 100px;
  scrollbar-width: thin;
}

#uc-viz-canvas {
  background-color: var(--color-canvas-bg);
  background-image: radial-gradient(#cbd5e0 1px, transparent 1px);
  background-size: 30px 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

/* Step 1 map vs steps 2–8 sunburst: one full-bleed panel active */
.uc-viz-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.uc-viz-panel:not(.is-active) {
  display: none !important;
}
#viz-sunburst {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: padding-right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#viz-sunburst.squeezed {
  padding-right: 450px;
}

#viz-site-map {
  position: relative;
  transition: padding-right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  background: var(--color-canvas-bg);
  min-height: 0;
  height: 100%;
}
#viz-site-map.squeezed {
  padding-right: 450px;
}
.dma-map-root {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
/* Subtle, softened basemap (Carto Light + light wash) */
.dma-map-root .leaflet-tile-pane {
  filter: grayscale(0.35) saturate(0.7) contrast(0.94) brightness(1.03);
  opacity: 0.96;
}
@media (prefers-reduced-motion: reduce) {
  .dma-map-root .leaflet-tile-pane {
    filter: grayscale(0.3) saturate(0.85) contrast(0.96);
  }
}
.leaflet-container {
  font-family: var(--font-body);
}
#viz-site-map .leaflet-container {
  background: #e4e6ea;
}
/* Leaflet + Geoman controls — match wizard UI (Inter, soft borders, accent hover) */
#viz-site-map .leaflet-bar,
#viz-site-map .leaflet-pm-toolbar {
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
#viz-site-map .leaflet-bar a,
#viz-site-map .leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button {
  font-family: var(--font-body);
  width: 34px;
  height: 34px;
  line-height: 32px;
  color: var(--color-text-main);
  border-color: #e8ecf0 !important;
  transition: background 0.15s ease, color 0.15s ease;
}
#viz-site-map .leaflet-bar a:hover,
#viz-site-map .leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button:hover {
  background: #f1f5f9 !important;
  color: var(--color-accent) !important;
}
#viz-site-map .leaflet-bar a:focus-visible,
#viz-site-map .leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
#viz-site-map .leaflet-bar a.leaflet-disabled {
  opacity: 0.4;
}
#viz-site-map .leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button.active {
  background: rgba(47, 93, 98, 0.12) !important;
  color: var(--color-accent) !important;
}
#viz-site-map .leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button:active:not(.leaflet-disabled) {
  background: rgba(47, 93, 98, 0.12) !important;
  color: var(--color-accent) !important;
}
#viz-site-map .leaflet-control-zoom {
  border: none;
}
#viz-site-map .leaflet-pm-toolbar .button-container {
  border-bottom: 1px solid #eef2f6;
}
#viz-site-map .leaflet-pm-toolbar .button-container:last-child {
  border-bottom: none;
}
#viz-site-map .leaflet-pm-toolbar .control-fa-icon {
  font-size: 17px;
  line-height: 22px;
}
#viz-site-map .leaflet-control-attribution {
  font-family: var(--font-body);
  font-size: 0.625rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.88);
  padding: 3px 8px;
  border-radius: 6px;
  max-width: min(20rem, 92vw);
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
#viz-site-map .leaflet-control-attribution a {
  color: #64748b;
  font-weight: 500;
}
/* Fallback: hide tools we disable via JS (Geoman version differences) */
#viz-site-map .leaflet-buttons-control-button:has(.leaflet-pm-icon-circle-marker),
#viz-site-map .leaflet-buttons-control-button:has(.leaflet-pm-icon-text),
#viz-site-map .leaflet-buttons-control-button:has(.leaflet-pm-icon-delete),
#viz-site-map .leaflet-buttons-control-button:has(.leaflet-pm-icon-rotate) {
  display: none !important;
}
/* Custom control: icon button — same footprint as zoom / Geoman (see .leaflet-bar a) */
#viz-site-map .dma-zoom-to-site-control.leaflet-bar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}
#viz-site-map .dma-zoom-to-site-control {
  margin-top: 8px;
  clear: both;
}
#viz-site-map .leaflet-bar a.dma-zoom-to-site-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  background-color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}
#viz-site-map .leaflet-bar a.dma-zoom-to-site-btn:hover:not(.leaflet-disabled) {
  background-color: #f1f5f9 !important;
}
#viz-site-map .leaflet-bar a.dma-zoom-to-site-btn.active:not(.leaflet-disabled) {
  background-color: rgba(47, 93, 98, 0.12) !important;
  color: var(--color-accent) !important;
}
#viz-site-map .leaflet-bar a.dma-zoom-to-site-btn:active:not(.leaflet-disabled) {
  background-color: rgba(47, 93, 98, 0.12) !important;
  color: var(--color-accent) !important;
}
#viz-site-map .dma-zoom-to-site-icon {
  display: block;
  pointer-events: none;
  vertical-align: middle;
}
#viz-site-map .leaflet-bar a.dma-zoom-to-site-btn.leaflet-disabled {
  cursor: not-allowed;
}
/* Floating hint + toolbar over the map (no grey band) */
.dma-map-float {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.dma-map-float > * {
  pointer-events: auto;
}
.dma-map-help-backdrop {
  position: absolute;
  inset: 0;
  z-index: 950;
  background: rgba(15, 23, 42, 0.12);
  cursor: default;
}
.dma-map-help-backdrop[hidden] {
  display: none !important;
}
.dma-map-location-privacy-anchor {
  position: relative;
  display: inline-block;
}
.dma-map-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* Compact wizard buttons on the map strip */
#viz-site-map .dma-map-toolbar-row .uc-btn {
  padding: 10px 18px;
  font-size: 0.8rem;
  min-height: 40px;
  border-radius: 50px;
  font-family: var(--font-body);
}
#viz-site-map .dma-map-toolbar-row .uc-btn.secondary {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  color: var(--color-text-sub);
}
#viz-site-map .dma-map-toolbar-row .uc-btn.secondary:hover {
  background: #fff;
  color: var(--color-text-main);
  border-color: #cbd5e1;
}
#viz-site-map .dma-map-toolbar-row .uc-btn.primary {
  box-shadow: 0 2px 8px rgba(47, 93, 98, 0.2);
}
#viz-site-map .dma-map-toolbar-row .uc-btn.primary:hover {
  transform: translateY(-1px);
}
.dma-map-help-anchor {
  position: relative;
  display: inline-block;
}
.dma-map-help-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(22rem, calc(100vw - 40px));
  padding: 12px 14px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-main);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  z-index: 1010;
}
.dma-map-help-popover[hidden] {
  display: none !important;
}
.dma-map-help-popover-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dma-map-help-popover-close:hover {
  background: #f1f5f9;
  color: var(--color-text-main);
}
.dma-map-help-popover-title {
  margin: 0 28px 8px 0;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}
.dma-map-help-popover-body {
  margin: 0;
  color: var(--color-text-sub);
}
/* Site name + area label inside polygon (permanent tooltip at centroid) */
.leaflet-tooltip.dma-site-polygon-label {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1) !important;
  padding: 6px 10px !important;
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  line-height: 1.35 !important;
  color: var(--color-text-main) !important;
  pointer-events: none !important;
  max-width: min(14rem, 70vw);
  text-align: center;
}
.leaflet-tooltip.dma-site-polygon-label::before {
  display: none !important;
}
#viz-site-map .dma-site-polygon-label-inner strong {
  font-weight: 600;
  word-break: break-word;
}
#viz-site-map .dma-site-polygon-label-area {
  color: var(--color-text-sub);
  font-weight: 500;
}
/* Geoman draft / temp stroke fallback (match final red) */
#viz-site-map .leaflet-pm-drawing-line,
#viz-site-map path.leaflet-pm-drawing-line,
#viz-site-map .leaflet-overlay-pane svg path[stroke="#3388ff"],
#viz-site-map .leaflet-overlay-pane svg polyline[stroke="#3388ff"] {
  stroke: #dc2626 !important;
}
.dma-map-loading {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(248, 250, 252, 0.92);
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}
.dma-map-loading[hidden] {
  display: none !important;
}
.dma-map-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #457b9d;
  border-radius: 50%;
  animation: dmaSpin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .dma-map-loading-spinner {
    animation: none;
    border-top-color: #e2e8f0;
  }
}
@keyframes dmaSpin {
  to {
    transform: rotate(360deg);
  }
}
.dma-map-fallback {
  position: absolute;
  inset: auto 12px 120px 12px;
  z-index: 1005;
  padding: 12px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #92400e;
}
.dma-from-map-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 6px;
  vertical-align: middle;
}
.uc-step1-map-intro {
  margin-top: 0;
  margin-bottom: 16px;
}
.dma-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dma-mobile-only {
  display: none !important;
}

@media (min-width: 769px) {
  #dma-mobile-top-bar,
  #dma-mobile-tab-nav {
    display: none !important;
  }

  #dma-mobile-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #dma-tab-setup.dma-tab-panel {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #dma-tab-estimate,
  #dma-tab-templates {
    display: none !important;
  }

  #dma-report-pdf-fab {
    display: none !important;
  }
}

/* --- Responsive: mobile = wizard only, viz hidden; desktop unchanged above --- */
@media (max-width: 768px) {
  .dma-desktop-only {
    display: none !important;
  }

  .dma-mobile-only {
    display: revert !important;
  }

  .dma-mobile-top-bar {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top, 0));
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 3;
  }

  .dma-mobile-top-bar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .dma-mobile-top-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .dma-mobile-top-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  #dma-mobile-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .dma-tab-panel {
    display: none !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .dma-tab-panel.dma-tab-active {
    display: flex !important;
  }

  .dma-tab-panel--setup .uc-deck-header {
    flex-shrink: 0;
  }

  .dma-tab-panel--estimate {
    padding: 24px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dma-estimate-empty__lead {
    margin: 0 0 20px;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--color-text-sub);
  }

  .dma-estimate-empty__hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-sub);
  }

  .dma-tab-templates-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 12px 16px 0;
    overflow: hidden;
  }

  .dma-tab-templates-heading {
    margin: 0 0 6px;
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--color-text-main);
  }

  .dma-tab-templates-sub {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--color-text-sub);
    line-height: 1.4;
  }

  #dma-tab-templates-storage-host {
    margin-bottom: 12px;
    font-size: 0.8rem;
  }

  .dma-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
  }

  .dma-segmented__btn {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    font-family: var(--font-body);
  }

  .dma-segmented__btn--active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
  }

  .dma-tab-templates-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
  }

  /* Templates tab: list-only OR detail-only (not split) */
  #dma-tab-templates.dma-tpl-tab-mode--list .dma-tab-templates-col--detail {
    display: none !important;
  }

  #dma-tab-templates.dma-tpl-tab-mode--detail .dma-tab-templates-col--list {
    display: none !important;
  }

  #dma-tab-templates.dma-tpl-tab-mode--detail .dma-segmented,
  #dma-tab-templates.dma-tpl-tab-mode--detail .dma-tab-templates-heading,
  #dma-tab-templates.dma-tpl-tab-mode--detail .dma-tab-templates-sub,
  #dma-tab-templates.dma-tpl-tab-mode--detail #dma-tab-templates-storage-host {
    display: none !important;
  }

  .dma-tpl-tab-back {
    display: none;
    align-self: flex-start;
    margin-bottom: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-accent);
    cursor: pointer;
    font-family: var(--font-body);
  }

  #dma-tab-templates.dma-tpl-tab-mode--detail .dma-tpl-tab-back {
    display: inline-flex;
    align-items: center;
  }

  .dma-tab-templates-col--list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .dma-tab-templates-col--list .template-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafafa;
  }

  .dma-tab-templates-col--detail {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .dma-tab-template-head {
    flex-shrink: 0;
    margin-bottom: 8px;
  }

  .dma-tab-template-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .dma-tab-template-body .modal-template-body-inner {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .dma-tab-template-body .modal-template-pane:not([hidden]) {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  .dma-tab-template-body .modal-template-pane--editor:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .dma-tab-template-body .dma-template-editor-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .dma-tab-template-footer {
    flex-shrink: 0;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom, 0));
  }

  .dma-mobile-tab-nav {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 4;
  }

  .dma-mobile-tab-nav__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 6px;
    padding: 10px max(12px, calc(10px + env(safe-area-inset-left, 0px))) max(10px, env(safe-area-inset-bottom, 0px))
      max(12px, calc(10px + env(safe-area-inset-right, 0px)));
  }

  .dma-mobile-tab-btn {
    flex: 1;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
  }

  .dma-mobile-tab-btn--active {
    background: rgba(47, 93, 98, 0.12);
    color: var(--color-accent);
  }

  .dma-mobile-tab-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .dma-mobile-tab-badge {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 6px;
  }

  /* Keep bottom nav visible over report: fix nav to bottom and shorten drawer */
  body.dma-report-drawer-open #dma-mobile-tab-nav.dma-mobile-tab-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1200 !important;
  }

  /* App header stays above report + template modal */
  #dma-mobile-top-bar.dma-mobile-top-bar {
    position: relative;
    z-index: 1200;
  }

  #btn-report-edit-inputs {
    display: none !important;
  }

  body.dma-map-takeover-active #dma-mobile-top-bar,
  body.dma-map-takeover-active #dma-mobile-tab-nav {
    display: none !important;
  }

  body.dma-estimate-calculating .dma-mobile-tab-btn:not(.dma-mobile-tab-btn--active) {
    opacity: 0.5;
    pointer-events: none;
  }

  .dma-stale-estimate-report-banner {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    font-size: 0.85rem;
    color: #92400e;
  }

  #btn-report-download-pdf {
    display: none !important;
  }

  .dma-report-pdf-fab {
    position: fixed;
    display: flex !important;
    right: 16px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 96;
    min-width: 56px;
    min-height: 56px;
    padding: 0 16px;
    border-radius: 999px;
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 20px rgba(47, 93, 98, 0.35);
    cursor: pointer;
    font-family: var(--font-body);
    align-items: center;
    justify-content: center;
  }

  .dma-report-pdf-fab[hidden] {
    display: none !important;
  }

  .uc-title {
    font-size: 1.5rem;
  }

  #viz-sunburst.squeezed {
    padding-right: 0;
  }

  #viz-site-map.squeezed {
    padding-right: 0;
  }

  /* Wizard + invisible layer for report drawer only */
#uc-split-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100%;
    min-height: 0;
  }

#uc-control-deck {
    grid-row: 1;
    grid-column: 1;
    z-index: 2;
    position: relative;
    border-right: none;
    border-bottom: none;
    max-height: none !important;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
  }

.uc-deck-header {
    flex-shrink: 0;
    padding: 16px 20px;
  }

#uc-wizard-steps {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 0;
  }

.uc-step.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: none;
  }

  /* Wizard nav: float above bottom tab bar (not a full-width bar above tabs) */
  #dma-tab-setup.dma-tab-active .uc-step.active .uc-actions {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 1100;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 12px;
    align-items: stretch;
    display: flex;
  }

  #dma-tab-setup.dma-tab-active .uc-step.active .uc-actions.right-align {
    justify-content: stretch;
  }

  #dma-tab-setup.dma-tab-active .uc-step.active .uc-actions .uc-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.14);
  }

  #dma-tab-setup.dma-tab-active #uc-wizard-steps .uc-step.active {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  /* Hide chart / map / triggers; report opens as fixed overlay */
#uc-viz-canvas {
    grid-row: 1;
    grid-column: 1;
    z-index: 1;
    pointer-events: none;
    min-height: 0 !important;
    align-items: stretch;
    justify-content: flex-start;
    background: transparent;
  }

#viz-sunburst,
#viz-site-map,
#tooltip-sb,
#viz-height-bar-container,
#viz-context-cluster {
    display: none !important;
  }

  /* Report drawer sits in a lower z-index column than the wizard; raise canvas while open so the panel can show */
  body.dma-report-drawer-open #uc-viz-canvas {
    z-index: 10;
  }

#uc-report-drawer {
    pointer-events: auto !important;
  }

#uc-report-drawer:not(.closed) {
    position: fixed !important;
    left: 0 !important;
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    right: 0 !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100vw !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    z-index: 85 !important;
    transform: none !important;
    box-shadow: none;
    border-radius: 0;
  }

#uc-report-drawer.closed {
    transform: translateX(100%) !important;
    pointer-events: none !important;
  }

#uc-report-drawer:not(.closed) .uc-drawer-spine {
    display: none;
  }

#uc-report-drawer:not(.closed) .uc-drawer-main {
    width: 100%;
    max-width: none;
  }

  /* Template library: between mobile top bar + tab bar (chrome stays visible) */
  #templateModal.modal-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    top: calc(56px + env(safe-area-inset-top, 0px));
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    z-index: 900;
  }

  #templateModal .modal-content-wide {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    min-height: 0;
    flex-direction: column;
    border-radius: 0;
    margin: 0;
  }

  #templateModal .modal-close-corner {
    display: none !important;
  }

  #templateModal.dma-tpl-mobile-detail .modal-col-right-head,
  #templateModal.dma-tpl-mobile-editor .modal-col-right-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    padding-left: max(4px, env(safe-area-inset-left, 0px));
    margin-bottom: 4px;
  }

  #templateModal.dma-tpl-mobile-detail .modal-template-actions,
  #templateModal.dma-tpl-mobile-editor .modal-template-actions {
    width: auto;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  #templateModal.dma-tpl-mobile-detail .modal-col-right-heading,
  #templateModal.dma-tpl-mobile-editor .modal-col-right-heading {
    flex: 1 1 120px;
    min-width: 0;
    margin: 0;
  }

  #templateModal.dma-tpl-mobile-detail .modal-template-pane,
  #templateModal.dma-tpl-mobile-editor .modal-template-pane:not([hidden]) {
    padding-right: max(24px, calc(16px + env(safe-area-inset-right, 0px)));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }

  .dma-tpl-modal-sticky-footer {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
    padding: 12px max(16px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-bottom, 0px))
      max(20px, calc(16px + env(safe-area-inset-right, 0px)));
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.08);
    position: sticky;
    bottom: 0;
    z-index: 6;
  }

  .dma-tpl-footer-browse {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .dma-tpl-modal-back-footer {
    flex: 0 1 auto;
    min-height: 48px;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    padding-left: 12px;
    padding-right: 12px;
  }

  #templateModal.dma-tpl-mobile-detail .dma-tpl-footer-browse #btn-use-template,
  #templateModal.dma-tpl-mobile-editor .dma-tpl-footer-browse #btn-use-template {
    flex: 1;
    min-width: 0;
    min-height: 48px;
  }

  .dma-tpl-footer-editor {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
  }

  .dma-tpl-footer-editor[hidden] {
    display: none !important;
    padding: 0;
    margin: 0;
    border: none;
  }

  .dma-tpl-footer-editor .dma-tpl-footer-editor-btn {
    flex: 1;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #templateModal.dma-tpl-modal-list-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    position: relative;
  }

  #templateModal.dma-tpl-modal-list-header .dma-tpl-modal-list-title {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0 8px;
    min-width: 0;
  }

  #templateModal.dma-tpl-modal-list-header .dma-tpl-mobile-list-close {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    margin: 0;
  }

  /* List-first: full-screen list only */
  #templateModal.dma-tpl-mobile-list .modal-col-right {
    display: none !important;
  }

  #templateModal.dma-tpl-mobile-list .modal-col-left {
    width: 100% !important;
    max-height: none !important;
    flex: 1;
    min-height: 0;
    border-right: none;
    display: flex;
    flex-direction: column;
  }

  #templateModal.dma-tpl-mobile-list .template-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Detail / editor: full-screen right column, scrollable body */
  #templateModal.dma-tpl-mobile-detail .modal-col-left,
  #templateModal.dma-tpl-mobile-editor .modal-col-left {
    display: none !important;
  }

  #templateModal.dma-tpl-mobile-detail .modal-col-right,
  #templateModal.dma-tpl-mobile-editor .modal-col-right {
    width: 100% !important;
    max-height: none !important;
    flex: 1;
    min-height: 0;
    padding: 16px;
    padding-right: max(20px, calc(16px + env(safe-area-inset-right, 0px)));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0));
    border-top: none;
    display: flex;
    flex-direction: column;
  }

  #templateModal.dma-tpl-mobile-detail .modal-col-right-body,
  #templateModal.dma-tpl-mobile-editor .modal-col-right-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #templateModal.dma-tpl-mobile-detail .modal-template-body-inner,
  #templateModal.dma-tpl-mobile-editor .modal-template-body-inner {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #templateModal.dma-tpl-mobile-detail .modal-template-pane:not([hidden]),
  #templateModal.dma-tpl-mobile-editor .modal-template-pane--editor:not([hidden]) {
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #templateModal.dma-tpl-mobile-editor .modal-template-pane--editor {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #templateModal.dma-tpl-mobile-editor .dma-template-editor-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-col-right-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .modal-template-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-header-simple--with-back {
    padding-left: 48px;
  }
}

.uc-step {
  display: none;
  animation: fadeIn 0.4s ease;
}
.uc-step.active {
  display: block;
}

.uc-title {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-text-main);
  margin: 0 0 10px 0;
  line-height: 1.1;
}

.uc-sub {
  font-size: 1rem;
  color: var(--color-text-sub);
  margin: 0 0 30px 0;
  line-height: 1.5;
}

.uc-hint-text {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 0.8rem;
}

.uc-input-group {
  margin-bottom: 25px;
}

.uc-input-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--color-text-main);
}

.uc-input-group input {
  width: 100%;
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all 0.2s;
  box-sizing: border-box;
}

.uc-input-group input:focus {
  border-color: var(--color-accent);
  outline: none;
  background: #fafafa;
}

.uc-divider-section {
  display: flex;
  align-items: center;
  margin: 30px 0 20px 0;
}
.uc-divider-section::before,
.uc-divider-section::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}
.uc-divider-label {
  padding: 0 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

.uc-row {
  display: flex;
  gap: 15px;
}

.uc-dual-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.uc-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 5px;
  background: #e2e8f0;
  outline: none;
}

.uc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--color-accent);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.uc-range.amber::-webkit-slider-thumb {
  border-color: var(--color-res);
}

.uc-number-box {
  width: 80px !important;
  text-align: center;
  font-weight: 700;
  color: var(--color-accent);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.uc-spinner-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.uc-spinner-wrapper.small {
  width: auto;
}
.uc-spinner-wrapper input {
  padding-right: 32px !important;
}
.uc-spinner-controls {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  width: 30px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #f1f5f9;
}
.uc-spin-btn {
  flex: 1;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.uc-spin-btn.down {
  border-top: 1px solid #f1f5f9;
}
.uc-spin-btn:hover {
  background: #e6fffa;
}
.uc-spin-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.uc-spin-btn.up::after {
  border-bottom: 5px solid #64748b;
}
.uc-spin-btn.down::after {
  border-top: 5px solid #64748b;
}

.uc-storey-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}
.uc-storey-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.uc-storey-btn.wide {
  grid-column: span 2;
  aspect-ratio: auto;
  background: #f8fafc;
  color: #475569;
  font-size: 0.9rem;
}
.uc-storey-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.uc-storey-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.uc-actions {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.uc-actions.right-align {
  justify-content: flex-end;
}
.uc-btn {
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s;
}
.uc-btn.primary {
  background: var(--color-accent);
  color: white;
}
.uc-btn.primary:hover {
  transform: translateY(-2px);
  background: #1f3f43;
}
.uc-btn.secondary {
  background: transparent;
  color: #94a3b8;
}
.uc-btn.secondary:hover {
  color: var(--color-text-main);
}
.uc-btn.finish {
  background: linear-gradient(135deg, var(--color-res), var(--color-emp));
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.uc-lookup-card {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 15px;
  margin-bottom: 25px;
  transition: all 0.2s;
}
.uc-lookup-card.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  gap: 15px;
  border: 2px dashed #cbd5e0;
}
.lookup-icon-placeholder {
  font-size: 2rem;
  color: #cbd5e0;
  line-height: 1;
}
.lookup-label-placeholder {
  font-weight: 600;
  color: #64748b;
}
.uc-btn-browse {
  padding: 12px 24px;
  border-radius: 50px;
  border: 2px solid #2c3e50;
  background: transparent;
  color: #2c3e50;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.uc-btn-browse:hover {
  background: #2c3e50;
  color: white;
}

/* Themed confirm (replaces window.confirm) — same card + tint as map help */
.dma-modal-root[hidden] {
  display: none !important;
}
.dma-modal-root {
  position: fixed;
  inset: 0;
  z-index: 10003;
  display: grid;
  grid-template: "stack" 1fr / 1fr;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}
.dma-modal-backdrop {
  grid-area: stack;
  background: rgba(15, 23, 42, 0.12);
  cursor: default;
}
.dma-modal-dialog {
  grid-area: stack;
  place-self: center;
  width: min(22rem, calc(100vw - 32px));
  max-height: min(85vh, 100%);
  overflow: auto;
  z-index: 1;
  outline: none;
}
.dma-modal__panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 18px 20px 16px;
  font-family: var(--font-body);
}
.dma-modal__title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}
.dma-modal__body {
  margin: 0 0 18px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-sub);
}
.dma-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.dma-modal__actions .uc-btn {
  padding: 10px 22px;
  font-size: 0.9rem;
}
.dma-modal__actions--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.dma-modal-root--high {
  z-index: 10050;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content-wide {
  width: 900px;
  max-width: 95%;
  height: 600px;
  background: white;
  border-radius: var(--radius-lg);
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  position: relative;
}
.modal-col-left {
  width: 40%;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  min-height: 0;
}
.modal-col-left .template-list-scroll {
  flex: 1;
  min-height: 0;
}
.modal-col-right-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 0 44px 12px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-col-right-heading {
  margin: 0;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.modal-col-right {
  width: 60%;
  display: flex;
  flex-direction: column;
  padding: 30px;
  position: relative;
  min-height: 0;
}
.modal-col-right-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Single scroll region: detail + editor occupy the same grid cell (no competing flex:1 siblings). */
.modal-template-body-inner {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template: "pane" minmax(0, 1fr) / minmax(0, 1fr);
  position: relative;
}
.modal-template-pane {
  grid-area: pane;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-template-pane--editor {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-template-pane[hidden] {
  display: none !important;
}
.modal-col-right .modal-footer-action,
.modal-col-right .dma-tpl-modal-sticky-footer {
  flex-shrink: 0;
  margin-top: auto;
}

.dma-tpl-modal-sticky-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.dma-tpl-footer-browse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.dma-tpl-footer-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.dma-tpl-footer-editor[hidden] {
  display: none !important;
}

.dma-tpl-footer-browse[hidden] {
  display: none !important;
}

@media (min-width: 769px) {
  .dma-tpl-modal-back-footer {
    display: none !important;
  }
}
.dma-btn-use-template {
  min-width: min(260px, 100%);
  max-width: 100%;
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 700;
}
.dma-template-storage-more {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-accent, #2a9d8f);
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.dma-template-storage-more:hover {
  filter: brightness(0.92);
}
.dma-template-storage-panel {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.modal-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}
.dma-template-placeholder {
  color: #94a3b8 !important;
  text-align: center;
  margin-top: 2rem;
}
.dma-template-action {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--color-text-main);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.dma-template-action:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.dma-template-action--primary {
  background: var(--color-accent, #2a9d8f);
  border-color: transparent;
  color: #fff;
}
.dma-template-action--primary:hover {
  filter: brightness(0.95);
  border-color: transparent;
}
.dma-template-action--outline {
  background: #fff;
}
.dma-template-action--danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}
.dma-template-action--danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}
#modal-template-editor.dma-template-editor-root {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dma-template-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.dma-template-editor-head {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.dma-template-editor-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text-main);
}
.dma-template-editor-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--color-text-sub);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.dma-template-editor-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}
.dma-template-editor-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.dma-template-footer-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}
.dma-template-footer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dma-template-footer-btn--ghost {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--color-text-main);
}
.dma-template-footer-btn--ghost:hover:not(:disabled) {
  background: #f8fafc;
}
.dma-template-footer-btn--primary {
  background: var(--color-accent, #2a9d8f);
  color: #fff;
}
.dma-template-footer-btn--primary:hover:not(:disabled) {
  filter: brightness(0.97);
}
.dma-editor-section-title {
  margin: 18px 0 10px;
  color: #475569;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  font-weight: 800;
}
.dma-editor-grid {
  display: grid;
  gap: 8px 12px;
  align-items: center;
}
.dma-editor-grid--land {
  grid-template-columns: 1fr minmax(100px, 140px);
}
.dma-editor-grid--mix3 {
  grid-template-columns: 1fr minmax(72px, 100px) minmax(88px, 120px);
}
.dma-editor-grid--pair {
  grid-template-columns: 1fr minmax(100px, 140px);
}
.dma-editor-col-h {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dma-editor-col-h--right {
  text-align: right;
}
.dma-editor-label {
  color: #334155;
  font-weight: 700;
  font-size: 0.82rem;
}
.dma-editor-text,
.dma-editor-num {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background: #fbfdff;
  color: var(--color-text-main);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.dma-editor-num--right {
  text-align: right;
}
.dma-editor-text:focus,
.dma-editor-num:focus {
  outline: none;
  border-color: var(--color-accent, #2a9d8f);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.18);
}
.dma-editor-total-row {
  margin-top: 12px;
}
.dma-editor-total-row--after-pct {
  margin-top: 8px;
  margin-bottom: 2px;
}
.dma-editor-total {
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  text-align: right;
}
.dma-editor-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
  margin: 6px 0 0;
  padding: 0 2px;
}
#btn-use-template:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dma-editor-errors {
  margin-bottom: 10px;
}
.dma-editor-errors-banner {
  border: 1px solid #fecaca;
  background: #fff1f2;
  padding: 10px 12px;
  border-radius: 12px;
  color: #7f1d1d;
  font-weight: 700;
  font-size: 0.82rem;
}
.dma-editor-error-line {
  margin: 4px 0;
}
.report-site-location__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.report-site-location__header .report-section-head {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.report-section-head {
  margin-bottom: 12px;
}
.report-section-head .uc-report-header {
  margin-bottom: 0;
}
.report-section-head .report-section-caption {
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}
.report-section-caption {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}
.uc-drawer-download-bar {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.92) 0%, #f5f5f5 100%);
  border-top: 1px solid #e2e8f0;
  box-shadow:
    0 -8px 24px rgba(15, 23, 42, 0.08),
    0 -1px 0 rgba(255, 255, 255, 0.9) inset;
  z-index: 2;
}
.uc-drawer-download-bar .download-pdf-trigger {
  box-shadow: 0 4px 14px rgba(42, 157, 143, 0.35);
}
#uc-report-drawer.maximized .uc-drawer-download-bar .download-pdf-trigger {
  padding: 10px 16px;
  font-size: 0.84rem;
  font-weight: 700;
}
.dma-recaptcha-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 8px;
  max-width: 420px;
  line-height: 1.4;
}
.uc-btn.finish:disabled,
.uc-btn.finish.uc-btn--recaptcha-blocked {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
  transform: none;
  box-shadow: none;
}
.uc-btn.finish:disabled:hover,
.uc-btn.finish.uc-btn--recaptcha-blocked:hover {
  transform: none;
}
.os-shortfall-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: linear-gradient(135deg, #fff1f2 0%, #fef2f2 100%);
  color: #991b1b;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}
.uc-btn--compact {
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 0.82rem;
}
.report-site-map-wrap {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.report-site-map-root {
  height: min(280px, 42vh);
  min-height: 200px;
  width: 100%;
  z-index: 0;
}
.modal-header-simple {
  padding: 20px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  border-bottom: 1px solid #e2e8f0;
}
.template-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}
.template-item {
  padding: 12px 15px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 5px;
  transition: background 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-main);
}
.template-item:hover {
  background: #e2e8f0;
}
.modal-close-corner {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
  font-family: inherit;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 10px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.modal-close-corner:hover {
  color: var(--color-accent);
  background: rgba(15, 23, 42, 0.06);
}
.modal-close-corner:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

#viz-height-bar-container {
  position: absolute;
  right: 40px;
  bottom: 40px;
  width: 12px;
  height: 300px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}
#viz-height-bar-fill {
  width: 100%;
  height: 0%;
  background: var(--color-text-main);
  transition: height 0.5s ease;
}
#viz-height-label {
  position: absolute;
  right: 60px;
  bottom: 40px;
  font-weight: 900;
  color: var(--color-text-main);
  font-family: var(--font-head);
}

/* Report drawer (simplified baseline; enough for V7 JS) */
#uc-report-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  background: #ffffff;
  z-index: 50;
  display: flex;
  flex-direction: row;
  transform: translateX(0);
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.05);
}
#uc-report-drawer.closed {
  transform: translateX(100%);
}
#uc-report-drawer.maximized {
  width: 100% !important;
}
.uc-drawer-spine {
  width: 52px;
  background: var(--report-spine-bg);
  border-right: 1px solid var(--report-spine-border);
  border-left: 1px solid var(--report-spine-border);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 5px 0 12px -4px var(--report-spine-edge-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-shrink: 0;
  height: 100%;
}
.spine-group {
  display: none;
  flex-direction: column;
  gap: 12px;
}
#uc-report-drawer:not(.closed):not(.maximized) .group-default {
  display: flex;
}
#uc-report-drawer.maximized .group-maximized {
  display: flex;
}
/* Shared: report spine + collapsed-tab icon buttons (theme: accent teal, card-like radius) */
.uc-circle-btn,
.uc-trigger-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--report-icon-bg);
  border: 1px solid var(--report-icon-border);
  border-radius: var(--report-icon-radius);
  cursor: pointer;
  color: var(--report-icon-fg);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  box-shadow: var(--report-icon-shadow);
  position: relative;
  font-family: var(--font-body);
}

.uc-circle-btn:hover,
.uc-trigger-btn:hover {
  background: var(--report-icon-hover-bg);
  color: var(--report-icon-hover-fg);
  border-color: var(--report-icon-hover-bg);
  transform: translateY(-1px);
  box-shadow: var(--report-icon-hover-shadow);
}

.uc-circle-btn::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  box-shadow: var(--shadow-card);
  font-family: var(--font-body);
}
.uc-circle-btn:hover::after {
  opacity: 1;
}

/* Bold directional chevrons inside a ring (stroke icons) */
.uc-circle-btn svg.dma-report-icon,
.uc-trigger-btn svg.dma-report-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  pointer-events: none;
  overflow: visible;
}

.dma-report-icon polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.uc-circle-btn:focus-visible,
.uc-trigger-btn:focus-visible {
  outline: 2px solid var(--color-land);
  outline-offset: 2px;
}

.uc-circle-btn:focus-visible:not(:hover),
.uc-trigger-btn:focus-visible:not(:hover) {
  border-color: var(--color-land);
  color: var(--color-land);
  background: rgba(42, 157, 143, 0.1);
}

/* Toast (non-blocking feedback) */
.dma-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.9rem;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 10002;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
}

.dma-toast.dma-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.uc-drawer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.uc-drawer-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 25px;
  scrollbar-width: thin;
  background: #fafafa;
}

#uc-report-trigger {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(100%);
  background: var(--color-canvas-bg);
  padding: 12px 10px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border: 1px solid var(--report-spine-border);
  border-right: none;
  border-left: 1px solid var(--report-spine-border);
  cursor: default;
  box-shadow:
    -3px 4px 24px rgba(44, 62, 80, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    inset 5px 0 14px -5px var(--report-spine-edge-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 40;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#uc-report-trigger.visible {
  transform: translateY(-50%) translateX(0);
}

/* Wizard uses Estimate tab + bottom nav; hide edge chevrons on mobile */
@media (max-width: 768px) {
  #uc-report-trigger {
    display: none !important;
  }
}

.uc-project-plaque {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 25px;
  overflow: hidden;
}
.plaque-main-row {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.uc-plaque-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 900;
  color: #1e293b;
}
.uc-plaque-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 50px;
  text-transform: uppercase;
}
.plaque-footer-row {
  background: #f8fafc;
  padding: 10px 20px;
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: right;
}
.plaque-footer-row a {
  color: #2a9d8f;
  font-weight: 700;
  text-decoration: none;
}
.plaque-footer-row a:hover {
  text-decoration: underline;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plaque-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-text-main);
}
.ai-highlight {
  color: #2a9d8f;
  font-weight: 900;
}

.sb-tooltip {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.uc-report-module.hero-complex {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #f8fafc;
  border-color: #cbd5e0;
}
.hero-top-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.hero-bottom-row {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}
.mini-stat {
  text-align: center;
}
.mini-label {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}
.mini-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2c3e50;
  font-family: var(--font-head);
}

.uc-stat-block {
  text-align: center;
}
.uc-stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.uc-stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  display: block;
}
.uc-stat-value.orange {
  color: var(--color-res);
}
.uc-stat-value.clay {
  color: var(--color-emp);
}
.uc-stat-separator {
  width: 1px;
  height: 40px;
  background: #cbd5e0;
}

.uc-demo-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.uc-demo-hero .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
}
.uc-demo-hero .val {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--color-text-main);
}
.uc-demo-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 8px;
}
.uc-demo-split-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.uc-demo-split-bar .bar-segment.adults {
  background: #457b9d;
}
.uc-demo-split-bar .bar-segment.children {
  background: #e9c46a;
}

.uc-verdict-banner {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.uc-verdict-banner.success {
  background: #e6fffa;
  color: #2a9d8f;
  border: 1px solid #2a9d8f;
}
.uc-verdict-banner.deficit {
  background: #fff5f5;
  color: #e53e3e;
  border: 1px solid #e53e3e;
}

.uc-os-subcard {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.uc-os-subcard .sub-head {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.uc-sub-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  padding: 6px 0 6px 10px;
  margin-bottom: 8px;
  border-left: 4px solid var(--color-res);
}

.uc-btn.full-width {
  width: 100%;
  box-sizing: border-box;
}

.uc-btn-change {
  padding: 10px 18px;
  border-radius: 50px;
  border: 2px solid #2c3e50;
  background: transparent;
  color: #2c3e50;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.uc-btn-change:hover {
  background: #2c3e50;
  color: #fff;
}

.uc-report-module {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.uc-report-header {
  margin: -20px -20px 20px -20px;
  padding: 12px 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  color: #ffffff;
  background: #94a3b8;
  border-radius: 7px 7px 0 0;
}
.uc-table-compact,
.uc-table-micro {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  color: #2c3e50;
}
.uc-table-compact thead th,
.uc-table-micro thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  padding: 8px;
  border-bottom: 2px solid #e2e8f0;
}
.uc-table-compact td,
.uc-table-micro td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.uc-table-compact td:last-child,
.uc-table-micro td:last-child {
  font-weight: 700;
  color: #1e293b;
  text-align: right;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .uc-step {
    animation: none;
  }
}

.uc-step1-map-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
}

.uc-step1-map-cta .uc-btn.primary {
  min-height: 48px;
  font-size: 0.95rem;
}

.dma-btn-ghost-link {
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  padding: 10px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-body);
}

.dma-btn-ghost-link:hover {
  color: #1f3f43;
}

/* Full-screen map takeover */
.dma-map-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  background: var(--color-canvas-bg);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.dma-map-fullscreen-overlay[hidden] {
  display: none !important;
}

.dma-map-fs-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.dma-map-fs-back,
.dma-map-fs-help {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
}

.dma-map-fs-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.dma-map-fullscreen-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--color-canvas-bg);
}

.dma-map-fullscreen-stage #viz-site-map {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
  padding-right: 0 !important;
}

.dma-map-fs-footer {
  flex-shrink: 0;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom, 0));
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.dma-map-fs-done {
  min-height: 48px;
  width: 100%;
}

.dma-map-fs-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-text-sub);
  line-height: 1.45;
  text-align: center;
}

/* reCAPTCHA: avoid clipped widget on small screens */
.dma-recaptcha-wrap {
  margin: 20px 0;
  scroll-margin-top: 100px;
}

.dma-recaptcha-widget {
  display: inline-block;
  vertical-align: top;
}

/* Report: sticky mobile actions (primary = PDF per plan) */
.uc-report-mobile-sticky {
  display: none;
  flex-shrink: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0));
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  z-index: 3;
}

.uc-report-mobile-sticky .uc-btn {
  min-height: 44px;
  flex: 1;
  min-width: min(160px, 100%);
}

@media (max-width: 768px) {
#uc-report-drawer:not(.closed) .uc-report-mobile-sticky {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 4;
  }

#uc-report-drawer:not(.closed) .uc-drawer-download-bar {
    display: none;
  }
}

/* Template modal: list column header (title + Close on mobile) */
.modal-header-simple--with-back.dma-tpl-modal-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.modal-header-simple--with-back.dma-tpl-modal-list-header .dma-tpl-modal-list-title {
  flex: 1;
  text-align: center;
  margin: 0;
  min-width: 0;
}
