/* ============================================================
   SDPH — Design System
   Tailwind + shadcn-inspired primitives, GIS/IT friendly
   ============================================================ */

:root {
  --bg: #f4f7f9;
  --bg-soft: #eef3f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef4f6;
  --text: #0d1b2a;
  --text-soft: #33475b;
  --muted: #64748b;
  --line: #dde7ec;
  --line-strong: #c9d7df;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #e3f5f2;
  --primary-bright: #14b8a6;
  --accent: #0ea5e9;
  --accent-soft: #e5f6ff;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --rose: #e11d48;
  --rose-soft: #ffe4ea;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --emerald: #059669;
  --emerald-soft: #e4f7ef;
  --sidebar: #08131c;
  --sidebar-2: #0c1c27;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-text: #9fb3c1;
  --signal: #e4572e;
  --hazard: #f5a524;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.04), 0 1px 3px rgba(13, 27, 42, 0.05);
  --shadow-md: 0 8px 24px -12px rgba(13, 27, 42, 0.18), 0 2px 6px rgba(13, 27, 42, 0.05);
  --shadow-lg: 0 24px 60px -24px rgba(13, 27, 42, 0.28);
  --radius: 10px;
}

.dark {
  --bg: #060d14;
  --bg-soft: #09131c;
  --surface: #0c1722;
  --surface-2: #101e2b;
  --surface-3: #132433;
  --text: #e7eef4;
  --text-soft: #c3d0db;
  --muted: #8ba0b2;
  --line: #1d2e3d;
  --line-strong: #294052;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --primary-soft: rgba(45, 212, 191, 0.12);
  --primary-bright: #5eead4;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.12);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.12);
  --sidebar: #050b11;
  --sidebar-2: #08131c;
  --signal: #ff7a55;
  --hazard: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 26px 70px -30px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  text-rendering: optimizeLegibility;
}
::selection { background: var(--primary); color: #fff; }

/* Scrollbars */
.ep-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ep-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.ep-scroll::-webkit-scrollbar-track { background: transparent; }
.ep-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.ep-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, .font-display { font-family: Archivo, "IBM Plex Sans", sans-serif; letter-spacing: -0.025em; }
.ep-kicker { font-family: "IBM Plex Mono", "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ep-page-title { font-size: clamp(1.35rem, 2vw, 1.65rem); font-weight: 800; line-height: 1.2; }
.ep-page-sub { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- Surfaces ---------- */
.ep-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ep-card-hover { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.ep-card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.ep-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.ep-card-title { font-weight: 700; font-size: 14.5px; color: var(--text); }
.ep-card-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.ep-card-body { padding: 18px 20px 20px; }
.ep-card-flush .ep-card-body { padding: 0; }
.ep-divide { border-top: 1px solid var(--line); }

.ep-glass {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}

/* ---------- Buttons ---------- */
.ep-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.ep-btn:active { transform: translateY(1px); }
.ep-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ep-btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.ep-btn-primary:hover { background: var(--primary-strong); }
.dark .ep-btn-primary { color: #04211e; }
.ep-btn-secondary { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-sm); }
.ep-btn-secondary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.ep-btn-ghost { background: transparent; color: var(--text-soft); }
.ep-btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.ep-btn-danger { background: var(--rose-soft); color: var(--rose); border-color: color-mix(in srgb, var(--rose) 20%, transparent); }
.ep-btn-danger:hover { background: color-mix(in srgb, var(--rose) 18%, transparent); }
.ep-btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 5px; }
.ep-btn-lg { height: 46px; padding: 0 20px; font-size: 14px; border-radius: 7px; }
.ep-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--text-soft); cursor: pointer; transition: all .16s ease;
}
.ep-icon-btn:hover { background: var(--surface-3); color: var(--text); }
.ep-icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Inputs ---------- */
.ep-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.ep-input, .ep-select, .ep-textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; line-height: 1.4;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ep-input::placeholder, .ep-textarea::placeholder { color: var(--muted); }
.ep-input:focus, .ep-select:focus, .ep-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.ep-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.ep-textarea { min-height: 92px; resize: vertical; }
.ep-search { position: relative; }
.ep-search .ep-input { padding-left: 36px; }
.ep-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 15px; height: 15px; }

/* ---------- Badges ---------- */
.ep-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--surface-3); color: var(--text-soft); border: 1px solid transparent;
}
.ep-badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.ep-badge-green { background: var(--emerald-soft); color: var(--emerald); }
.ep-badge-teal { background: var(--primary-soft); color: var(--primary); }
.ep-badge-blue { background: var(--accent-soft); color: var(--accent); }
.ep-badge-amber { background: var(--amber-soft); color: var(--amber); }
.ep-badge-rose { background: var(--rose-soft); color: var(--rose); }
.ep-badge-violet { background: var(--violet-soft); color: var(--violet); }
.ep-badge-slate { background: var(--surface-3); color: var(--muted); }

/* ---------- Data tables ---------- */
.ep-table-wrap { width: 100%; overflow-x: auto; }
.ep-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ep-table th {
  text-align: left; font-weight: 600; color: var(--muted);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  padding: 10px 18px; background: var(--surface-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ep-table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-soft); }
.ep-table tbody tr { transition: background .14s ease; }
.ep-table tbody tr:hover { background: var(--surface-2); }
.ep-table tbody tr:last-child td { border-bottom: 0; }
.ep-table .strong { color: var(--text); font-weight: 650; }
.ep-table-dense th { padding: 8px 12px; }
.ep-table-dense td { padding: 9px 12px; }

/* ---------- Sidebar / nav ---------- */
.ep-sidebar {
  background:
    radial-gradient(1200px 400px at 0% -10%, rgba(20, 184, 166, .12), transparent 60%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-line);
}
.ep-brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; color: #04211e; font-weight: 800;
  background: linear-gradient(145deg, #5eead4, #14b8a6 58%, #0d9488);
  box-shadow: 0 8px 22px -10px rgba(20, 184, 166, .7);
}
.ep-nav-section { padding: 14px 16px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(159, 179, 193, .55); }
.ep-nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 1px 8px; padding: 8px 10px; border-radius: 9px;
  color: var(--sidebar-text); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.ep-nav-item:hover { background: rgba(255,255,255,.05); color: #e6f2f4; }
.ep-nav-item.is-active { background: linear-gradient(90deg, rgba(20,184,166,.18), rgba(20,184,166,.05)); color: #7dd3c7; box-shadow: inset 0 0 0 1px rgba(20,184,166,.18); }
.ep-nav-item.is-active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
.ep-nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
.ep-nav-child { margin-left: 12px; padding-left: 16px; border-left: 1px solid var(--sidebar-line); }
.ep-nav-child .ep-nav-item { font-size: 12px; padding: 6px 9px; }
.ep-nav-chevron { margin-left: auto; transition: transform .2s ease; width: 13px !important; height: 13px !important; opacity: .7; }
.ep-nav-group.open .ep-nav-chevron { transform: rotate(90deg); }

/* ---------- Stats ---------- */
.ep-stat { position: relative; overflow: hidden; }
.ep-stat::after { content: ""; position: absolute; right: -26px; top: -40px; width: 112px; height: 112px; border-radius: 999px; background: radial-gradient(circle, var(--primary-soft), transparent 68%); pointer-events: none; }
.ep-iconbox { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.ep-iconbox svg { width: 19px; height: 19px; }
.ep-iconbox-teal { background: var(--primary-soft); color: var(--primary); }
.ep-iconbox-blue { background: var(--accent-soft); color: var(--accent); }
.ep-iconbox-amber { background: var(--amber-soft); color: var(--amber); }
.ep-iconbox-rose { background: var(--rose-soft); color: var(--rose); }
.ep-iconbox-violet { background: var(--violet-soft); color: var(--violet); }
.ep-iconbox-green { background: var(--emerald-soft); color: var(--emerald); }
.ep-stat-value { font-family: Archivo, "IBM Plex Sans", sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.ep-delta-up { color: var(--emerald); font-weight: 600; }
.ep-delta-down { color: var(--rose); font-weight: 600; }

/* ---------- Tabs ---------- */
.ep-tabs { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-3); border-radius: 11px; border: 1px solid var(--line); }
.ep-tab { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border: 0; background: transparent; transition: all .15s ease; }
.ep-tab:hover { color: var(--text); }
.ep-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Progress ---------- */
.ep-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ep-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-bright)); }
.ep-progress.amber > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ep-progress.rose > span { background: linear-gradient(90deg, #e11d48, #fb7185); }

/* ---------- Avatars ---------- */
.ep-avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.ep-avatar-lg { width: 44px; height: 44px; font-size: 14px; }

/* ---------- Timeline ---------- */
.ep-timeline { position: relative; padding-left: 26px; }
.ep-timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.ep-timeline-item { position: relative; padding-bottom: 22px; }
.ep-timeline-item:last-child { padding-bottom: 0; }
.ep-timeline-item::before { content: ""; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line-strong); }
.ep-timeline-item.done::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ep-timeline-item.active::before { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); animation: pulseRing 2.4s infinite; }

/* ---------- Steps (CCC / wizard) ---------- */
.ep-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ep-step { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ep-step.done { border-color: color-mix(in srgb, var(--emerald) 30%, var(--line)); background: color-mix(in srgb, var(--emerald-soft) 45%, var(--surface)); }
.ep-step.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ep-step-index { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.ep-step.done .ep-step-index { background: var(--emerald); color: #fff; }
.ep-step.active .ep-step-index { background: var(--primary); color: #fff; }

/* ---------- Maps ---------- */
.map-shell { position: relative; border-radius: 12px; overflow: hidden; background: #0b1822; border: 1px solid var(--line); }
.map-canvas { width: 100%; height: 100%; min-height: 300px; background: #0b1822; z-index: 0; }
.map-overlay { position: absolute; z-index: 500; }
.map-panel { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.map-legend { position: absolute; right: 12px; bottom: 12px; z-index: 500; padding: 10px 12px; min-width: 142px; }
.map-coords { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--muted); }
.leaflet-container { font-family: "IBM Plex Sans", sans-serif; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted) !important; font-size: 9px !important; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-md) !important; }
.leaflet-popup-tip { background: var(--surface) !important; }
.map-pin { width: 12px; height: 12px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(20,184,166,.28); background: #14b8a6; }
.map-pin.amber { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.map-pin.rose { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.25); }
.map-pin.blue { background: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.25); }

/* ---------- Charts ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { max-width: 100%; }
.ep-spark { height: 40px; }

/* ---------- Landing page ---------- */
.landing-nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); width: min(1180px, calc(100% - 28px)); z-index: 80; border-radius: 999px; transition: all .3s ease; }
.landing-nav.scrolled { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.hero-mesh {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 62%),
    radial-gradient(760px 440px at 94% 6%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 64%);
}
.grid-pattern {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--line) 60%, transparent) 1px, transparent 1px),
                    linear-gradient(to bottom, color-mix(in srgb, var(--line) 60%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}
.ep-orb { position: absolute; border-radius: 999px; filter: blur(48px); opacity: .3; animation: float 11s ease-in-out infinite; }
.ep-hero-title { font-family: Archivo, "IBM Plex Sans", sans-serif; font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; }
.gradient-text { background: none; color: inherit; }
.hero-panel { box-shadow: 0 40px 100px -40px rgba(8, 19, 28, .55), 0 8px 30px -12px rgba(8,19,28,.3); }
.hero-glow { position: absolute; inset: -30%; background: conic-gradient(from 180deg, color-mix(in srgb, var(--primary) 16%, transparent), color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--primary) 16%, transparent)); filter: blur(70px); opacity: .5; animation: spin 30s linear infinite; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.feature-card { position: relative; overflow: hidden; }
.feature-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 180px at 0% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%); opacity: 0; transition: opacity .3s ease; }
.feature-card:hover::before { opacity: 1; }
.preview-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.preview-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14b8a6, #38bdf8); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

/* ---------- Governance / GIS extras ---------- */
.ep-coord { font-family: "JetBrains Mono", monospace; font-size: 10.5px; background: var(--surface-3); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; color: var(--muted); }
.ep-kbd { font-family: "JetBrains Mono", monospace; font-size: 9.5px; padding: 2px 5px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); }
.ep-layer-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; transition: background .14s ease; }
.ep-layer-row:hover { background: var(--surface-2); }
.ep-layer-swatch { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; }
.ep-switch { position: relative; width: 34px; height: 19px; border-radius: 999px; background: var(--line-strong); transition: background .18s ease; flex: 0 0 auto; }
.ep-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 999px; background: #fff; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ep-switch.on { background: var(--primary); }
.ep-switch.on::after { transform: translateX(15px); }
.ep-heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.ep-heat span { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); }
.ep-heat span.l1 { background: color-mix(in srgb, var(--primary) 18%, var(--surface-3)); }
.ep-heat span.l2 { background: color-mix(in srgb, var(--primary) 34%, var(--surface-3)); }
.ep-heat span.l3 { background: color-mix(in srgb, var(--primary) 55%, var(--surface-3)); }
.ep-heat span.l4 { background: color-mix(in srgb, var(--primary) 78%, var(--surface-3)); }
.ep-heat span.l5 { background: var(--primary); }
.ep-gauge { --v: 72; width: 92px; height: 92px; border-radius: 999px; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--v) * 1%), var(--surface-3) 0); position: relative; }
.ep-gauge::before { content: ""; position: absolute; inset: 9px; border-radius: 999px; background: var(--surface); }
.ep-gauge > span { position: relative; font-weight: 800; font-size: 17px; font-family: Archivo, sans-serif; }
.ep-bim-stage { position: relative; height: 320px; border-radius: 14px; overflow: hidden; background: radial-gradient(600px 300px at 50% 30%, #163241, #08131c 70%); }
.ep-iso { position: absolute; left: 50%; top: 52%; width: 150px; height: 150px; transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-42deg); transform-style: preserve-3d; }
.ep-iso .face { position: absolute; background: linear-gradient(135deg, rgba(45,212,191,.32), rgba(14,165,233,.12)); border: 1px solid rgba(125,211,199,.35); box-shadow: inset 0 0 30px rgba(20,184,166,.12); }
.ep-iso .top { width: 150px; height: 150px; transform: translateZ(70px); }
.ep-iso .front { width: 150px; height: 70px; transform: rotateX(-90deg) translateZ(35px) translateY(35px); }
.ep-iso .side { width: 70px; height: 150px; transform: rotateY(-90deg) translateZ(75px) translateX(35px); }
.ep-twin-grid { background-image: linear-gradient(rgba(45,212,191,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(45,212,191,.12) 1px, transparent 1px); background-size: 32px 32px; }
.ep-chat { display: flex; gap: 10px; }
.ep-chat-bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 12.5px; line-height: 1.55; }
.ep-chat-ai { background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.ep-chat-me { background: var(--primary); color: #fff; border-top-right-radius: 4px; margin-left: auto; }
.dark .ep-chat-me { color: #04211e; }

/* ---------- Modal / toast / dropdown ---------- */
.ep-modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(4, 12, 18, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fadeIn .18s ease; }
.ep-modal-footer { position: sticky; bottom: 0; }
.map-dark .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.86) contrast(.92) saturate(.75); }
.ep-modal { width: min(640px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: scaleIn .2s cubic-bezier(.2,.8,.2,1); }
.ep-modal-wide { width: min(860px, 100%); }
.ep-toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; animation: slideIn .22s ease; }
.ep-dropdown { position: absolute; z-index: 90; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: scaleIn .14s ease; }
.ep-dropdown-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-soft); cursor: pointer; }
.ep-dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.ep-command { position: fixed; inset: 0; z-index: 110; background: rgba(4,12,18,.5); backdrop-filter: blur(4px); display: flex; justify-content: center; padding-top: 12vh; animation: fadeIn .15s ease; }
.ep-command-box { width: min(620px, calc(100% - 24px)); height: max-content; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: scaleIn .16s ease; }
.ep-command-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; cursor: pointer; color: var(--text-soft); }
.ep-command-item:hover, .ep-command-item.is-selected { background: var(--surface-2); color: var(--text); }

/* ---------- Calendar ---------- */
.ep-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ep-cal-cell { min-height: 72px; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: var(--surface); font-size: 10.5px; }
.ep-cal-cell.muted { background: var(--surface-2); color: var(--muted); }
.ep-cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.ep-cal-event { margin-top: 3px; padding: 2px 4px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Utility ---------- */
.ep-scroll-x { overflow-x: auto; }
.ep-fade-in { animation: fadeUp .45s cubic-bezier(.2,.7,.2,1) both; }
.ep-fade-in-1 { animation-delay: .05s; }
.ep-fade-in-2 { animation-delay: .1s; }
.ep-fade-in-3 { animation-delay: .15s; }
.ep-fade-in-4 { animation-delay: .2s; }
.ep-sep { height: 1px; background: var(--line); }
.ep-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-hide { display: none !important; }
.ep-link { color: var(--primary); font-weight: 600; cursor: pointer; }
.ep-link:hover { text-decoration: underline; }
.ep-dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }
.ep-notch { position: absolute; top: 0; right: 0; width: 46px; height: 46px; background: linear-gradient(225deg, var(--bg) 50%, transparent 50%); }

@media (max-width: 1024px) {
  .ep-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ep-steps { grid-template-columns: 1fr; }
  .ep-page-title { font-size: 1.25rem; }
  .ep-stat-value { font-size: 22px; }
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.35); } 70% { box-shadow: 0 0 0 8px rgba(245,158,11,0); } 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   LANDING — Industrial / cartographic direction
   Signature: plan-sheet grid + surveyor corner ticks + mono data labels
   ============================================================ */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: .5; mix-blend-mode: soft-light;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px);
}
.plan-sheet {
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}
.contour-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='420' viewBox='0 0 720 420' fill='none'%3E%3Cg stroke='%230f766e' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M-40 90C80 40 200 130 320 96S560 20 760 74'/%3E%3Cpath d='M-40 130C90 84 210 168 330 136S570 66 760 116'/%3E%3Cpath d='M-40 174C100 132 220 208 340 178S580 112 760 158'/%3E%3Cpath d='M-40 222C110 184 230 252 350 224S590 162 760 204'/%3E%3Cpath d='M-40 274C120 240 240 300 360 274S600 218 760 256'/%3E%3Cpath d='M-40 330C130 300 250 352 370 328S610 278 760 312'/%3E%3Cpath d='M-40 390C140 364 260 406 380 386S620 342 760 372'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 720px 420px;
}
.dark .contour-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='420' viewBox='0 0 720 420' fill='none'%3E%3Cg stroke='%232dd4bf' stroke-opacity='0.14' stroke-width='1'%3E%3Cpath d='M-40 90C80 40 200 130 320 96S560 20 760 74'/%3E%3Cpath d='M-40 130C90 84 210 168 330 136S570 66 760 116'/%3E%3Cpath d='M-40 174C100 132 220 208 340 178S580 112 760 158'/%3E%3Cpath d='M-40 222C110 184 230 252 350 224S590 162 760 204'/%3E%3Cpath d='M-40 274C120 240 240 300 360 274S600 218 760 256'/%3E%3Cpath d='M-40 330C130 300 250 352 370 328S610 278 760 312'/%3E%3Cpath d='M-40 390C140 364 260 406 380 386S620 342 760 372'/%3E%3C/g%3E%3C/svg%3E");
}
.mono-label {
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.mono-label.signal { color: var(--signal); }
.data-num { font-family: "IBM Plex Mono", "JetBrains Mono", monospace; font-weight: 600; letter-spacing: -.02em; }
.sec-no {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600;
  letter-spacing: .18em; color: var(--signal);
}
/* surveyor corner ticks */
.ticks { position: relative; }
.ticks::before, .ticks::after { content: ""; position: absolute; width: 16px; height: 16px; border-color: var(--signal); border-style: solid; pointer-events: none; }
.ticks::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.ticks::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.ticks-soft::before, .ticks-soft::after { border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
/* industrial buttons */
.btn-plan {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px; border: 1.5px solid var(--text); border-radius: 4px;
  background: var(--text); color: var(--surface);
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn-plan:hover { background: var(--signal); border-color: var(--signal); color: #fff; transform: translateY(-2px); }
.btn-plan:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.btn-plan.ghost { background: transparent; color: var(--text); }
.btn-plan.ghost:hover { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn-plan.sm { height: 38px; padding: 0 14px; font-size: 10.5px; }
.dark .btn-plan { background: var(--text); color: #0b0f0e; border-color: var(--text); }
.dark .btn-plan:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.dark .btn-plan.ghost { background: transparent; color: var(--text); }
/* plan-sheet cards: hairline, no soft bubble shadows */
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.plan-card:hover { border-color: var(--text); transform: translateY(-2px); }
.plan-card .plan-card-cap { border-bottom: 1px solid var(--line); background: var(--surface-2); }
/* data sheet rows */
.sheet-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 85%, transparent); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row dt, .sheet-row .k { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-row dd, .sheet-row .v { font-size: 13px; font-weight: 600; margin: 0; }
/* hairline nav (landing) */
.plan-nav a { position: relative; }
.plan-nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 1.5px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.plan-nav a:hover::after, .plan-nav a:focus-visible::after { transform: scaleX(1); }
/* animated contour stroke for hero */
.contour-draw path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.6s cubic-bezier(.4,0,.2,1) forwards; }
.contour-draw path:nth-child(2) { animation-delay: .15s; }
.contour-draw path:nth-child(3) { animation-delay: .3s; }
.contour-draw path:nth-child(4) { animation-delay: .45s; }
.contour-draw path:nth-child(5) { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
/* coordinate ticker strip */
.coord-strip { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.coord-strip span { padding: 0 10px; border-right: 1px solid var(--line); }
.coord-strip span:last-child { border-right: 0; }
/* section heading with rule */
.head-rule { display: flex; align-items: center; gap: 14px; }
.head-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (prefers-reduced-motion: reduce) {
  .contour-draw path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   Global AI assistant (BayuAI) + wallet badge
   ============================================================ */
.ep-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff; border: 1px solid color-mix(in srgb, var(--primary) 70%, #000);
  box-shadow: var(--shadow-lg); cursor: pointer; transition: transform .18s ease, background .18s ease;
}
.ep-fab:hover { transform: translateY(-2px); background: var(--primary-strong); }
.dark .ep-fab { color: #04211e; }
.ep-fab-dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 999px; background: var(--rose); border: 2px solid var(--bg); animation: pulseSoft 2.2s ease-in-out infinite; }
.ep-fab-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 96;
  width: min(384px, calc(100vw - 28px)); height: min(596px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: scaleIn .18s ease;
}
.ep-fab-panel.hidden { display: none !important; }
.ep-fab-head { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(120deg, var(--primary), var(--primary-strong)); color: #fff; }
.dark .ep-fab-head { background: linear-gradient(120deg, #0f766e, #0b5f59); }
.ep-fab-bot { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.ep-fab-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: transparent; border: 0; cursor: pointer; }
.ep-fab-icon:hover { background: rgba(255,255,255,.18); }
.ep-fab-messages { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); scrollbar-width: thin; }
.ep-fab-quick { padding: 10px 13px; border-top: 1px solid var(--line); background: var(--surface); }
.ep-fab-q { text-align: left; font-size: 11px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--primary); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.ep-fab-q:hover { background: var(--primary-soft); border-color: var(--primary); }
.ep-fab-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ep-fab-input .ep-input { font-size: 12px; }

/* Publish dataset — staged validation animation */
.pub-step { display: flex; align-items: center; gap: 10px; padding: 4px 0; opacity: .3; transition: opacity .3s ease, transform .3s ease; }
.pub-step.pub-step-done { opacity: 1; transform: translateX(2px); }
.pub-dot { width: 18px; height: 18px; border-radius: 999px; background: var(--surface-3); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex: 0 0 auto; transition: background .3s ease; }
.pub-step.pub-step-done .pub-dot { background: var(--emerald); }
.pub-label { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.pub-step.pub-step-done .pub-label { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .pub-step { transition: none; }
}

/* ============================================================
   Advanced Technology — module-specific visualisations
   ============================================================ */
.pipe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pipe-node { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); min-width: 118px; }
.pipe-arrow { color: var(--line-strong); }
.pipe-node .mono { color: var(--muted); }

/* Digital twin — MapLibre GL container */
.twin-canvas { position: absolute; inset: 0; background: #05101a; }
.twin-canvas .maplibregl-canvas { outline: none; }

/* AR device frame */
.ar-device { width: 248px; height: 470px; margin: 0 auto; border-radius: 30px; border: 9px solid #0b131a; background: #0e1a22; overflow: hidden; position: relative; box-shadow: var(--shadow-lg); }
.ar-device::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 64px; height: 5px; border-radius: 99px; background: #1f2937; z-index: 3; }
.ar-scene { position: absolute; inset: 0; background: linear-gradient(180deg, #5b7a6a 0%, #3d5a4a 42%, #243b31 100%); }
.ar-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 26px 26px; }
.ar-overlay-box { position: absolute; border: 1.5px solid #2dd4bf; background: rgba(45,212,191,.12); }
.ar-tag { position: absolute; left: 0; top: -18px; font-family: "IBM Plex Mono", monospace; font-size: 7px; padding: 1px 4px; background: #2dd4bf; color: #04211e; white-space: nowrap; }
.ar-crosshair { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.7); border-radius: 999px; }
.ar-crosshair::before, .ar-crosshair::after { content: ""; position: absolute; background: rgba(255,255,255,.7); }
.ar-crosshair::before { left: 50%; top: -6px; bottom: -6px; width: 1px; }
.ar-crosshair::after { top: 50%; left: -6px; right: -6px; height: 1px; }
.ar-hud { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: 8px; color: #cbe7e2; background: rgba(8,19,28,.55); padding: 4px 6px; border-radius: 4px; }

/* Command centre video wall */
.wall-wrap { background: #08131c; border: 1px solid #16303a; }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wall-cell { background: #0b1822; border: 1px solid #16303a; border-radius: 6px; padding: 9px; color: #cbe7e2; font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: .06em; min-height: 130px; }
.wall-cell-wide { grid-column: span 2; }
@media (max-width: 1024px) { .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wall-cell-wide { grid-column: span 2; } }
@media (max-width: 640px) { .wall-grid { grid-template-columns: 1fr; } .wall-cell-wide { grid-column: span 1; } .ar-device { width: 220px; height: 420px; } }

/* ============================================================
   Real rendering engines — BIM / Digital Twin / Compare / Basemaps
   ============================================================ */
.engine-shell { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid rgba(45, 212, 191, .18); background: linear-gradient(180deg, #071520, #050f16); }
.engine-shell:fullscreen { border-radius: 0; height: 100vh !important; }
.bim-canvas { position: absolute; inset: 0; }
.bim-canvas canvas { display: block; }

.engine-topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; background: linear-gradient(180deg, rgba(5, 14, 20, .88), rgba(5, 14, 20, 0)); pointer-events: none; }
.engine-title { font-size: 9px; letter-spacing: .1em; color: #8fb3ad; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine-chip { flex: none; font-family: "IBM Plex Mono", monospace; font-size: 8.5px; letter-spacing: .08em; color: #5eead4; border: 1px solid rgba(45, 212, 191, .32); background: rgba(13, 148, 136, .16); padding: 2px 7px; border-radius: 4px; }

.engine-north { position: absolute; left: 11px; bottom: 42px; z-index: 5; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .3); background: rgba(8, 19, 28, .7); color: #cbe7e2; font-family: "IBM Plex Mono", monospace; font-size: 9px; }
.engine-north::before { content: ""; position: absolute; top: -7px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 6px solid #2dd4bf; }

.engine-toolbar { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.engine-tool { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; border: 1px solid rgba(148, 163, 184, .22); background: rgba(8, 19, 28, .78); color: #9fb3c1; cursor: pointer; transition: all .15s ease; }
.engine-tool:hover { color: #5eead4; border-color: rgba(45, 212, 191, .5); background: rgba(13, 148, 136, .2); }
.engine-tool.is-active { color: #04211e; background: #2dd4bf; border-color: #2dd4bf; }

.engine-hud { position: absolute; left: 10px; right: 52px; bottom: 10px; z-index: 5; pointer-events: none; }
.engine-hud > span { display: inline-block; padding: 5px 8px; border-radius: 5px; border: 1px solid rgba(148, 163, 184, .16); background: rgba(8, 19, 28, .74); color: #9fb3c1; font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: .02em; }
.engine-hud b { color: #5eead4; font-weight: 600; }

.engine-loader { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: #061119; color: #8fb3ad; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .08em; transition: opacity .4s ease, visibility .4s; }
.engine-loader span::after { content: ""; display: inline-block; width: 16px; height: 1px; margin-left: 8px; background: #2dd4bf; vertical-align: middle; animation: enginePulse 1s ease-in-out infinite; }
.engine-loader.is-hidden { opacity: 0; visibility: hidden; }
@keyframes enginePulse { 0%, 100% { transform: scaleX(.3); opacity: .4; } 50% { transform: scaleX(1.6); opacity: 1; } }

/* BIM model tree */
.bim-tree-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 7px; border-radius: 5px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--text); cursor: pointer; text-align: left; transition: background .14s ease; }
.bim-tree-row:hover { background: var(--surface-2); }
.bim-tree-row.is-sel { background: var(--primary-soft); border-left-color: var(--primary); font-weight: 600; }
.bim-tree-row.is-muted { opacity: .5; cursor: default; }

/* Satellite comparison swipe */
.cmp-canvas { position: absolute; inset: 0; background: #05101a; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: 50%; z-index: 500; width: 2px; background: #f8fafc; box-shadow: 0 0 0 1px rgba(5, 16, 26, .5); transform: translateX(-1px); cursor: ew-resize; touch-action: none; }
.cmp-grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: #f8fafc; color: #0f172a; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.cmp-label { position: absolute; bottom: 10px; z-index: 501; padding: 4px 8px; border-radius: 4px; background: rgba(5, 16, 26, .82); color: #e2e8f0; font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: .06em; pointer-events: none; }
.cmp-label-before { left: 10px; }
.cmp-label-after { right: 10px; }

/* Leaflet basemap switcher */
.map-basemap-ctrl { display: flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: 8px; background: rgba(246, 250, 251, .95); box-shadow: 0 2px 10px rgba(15, 23, 42, .18); border: 1px solid rgba(15, 23, 42, .08); }
.dark .map-basemap-ctrl { background: rgba(8, 19, 28, .92); border-color: rgba(148, 163, 184, .2); }
.map-basemap-ctrl button { display: flex; align-items: center; gap: 5px; padding: 3px 7px; border: 0; border-radius: 5px; background: transparent; color: #475569; font-size: 10px; font-family: "IBM Plex Sans", sans-serif; cursor: pointer; white-space: nowrap; }
.dark .map-basemap-ctrl button { color: #9fb3c1; }
.map-basemap-ctrl button:hover { background: rgba(15, 118, 110, .1); }
.map-basemap-ctrl button.is-active { background: #0f766e; color: #fff; }
.map-sat .leaflet-control-attribution { background: rgba(5, 16, 26, .7); color: #9fb3c1; }
.map-sat .leaflet-control-attribution a { color: #5eead4; }

.twin-shell.is-night .engine-topbar { background: linear-gradient(180deg, rgba(2, 8, 14, .95), transparent); }

@media (max-width: 640px) {
  .engine-toolbar { flex-direction: row; top: auto; bottom: 10px; right: 10px; transform: none; }
  .engine-hud { right: 10px; bottom: 50px; }
  .engine-north { bottom: 10px; }
}
