/* Palette sampled from the product itself:
   graphite container body, LED-strip blue, rover off-white shell, steel, solar-cell navy. */
:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --bg-rgb: 11 14 18;
  --surface: #11151b;
  --surface-2: #161c23;
  --surface-3: #1d252e;
  --line: #232c36;
  --line-strong: #303c49;
  --text: #eef1f4;
  --muted: #9aa6b2;
  --faint: #6f7c89;
  --accent: #3a9bff;
  --accent-hover: #6cb6ff;
  --accent-soft: rgba(58, 155, 255, 0.14);
  --accent-ink: #04162b;
  --steel: #b8c2ca;
  --solar: #1f3a6b;
  --sun: #f0b35a;
  --ok: #3ddc97;
  --warn: #f5b841;
  --alert: #ff6b5e;
  --warn-text: #f3dca8;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --header-h: 68px;
}
/* Light theme: same product palette, darker accents so text keeps ≥ 4.5:1 contrast on white. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-rgb: 244 246 248;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --surface-3: #e2e8ee;
  --line: #dbe2e8;
  --line-strong: #c3cdd6;
  --text: #0e1621;
  --muted: #4b5a69;
  --faint: #64717e;
  --accent: #1768c9;
  --accent-hover: #0f56ab;
  --accent-soft: rgba(23, 104, 201, 0.1);
  --accent-ink: #ffffff;
  --steel: #53606c;
  --sun: #9a6212;
  --ok: #0b7f51;
  --warn: #9a5f06;
  --alert: #cf3a26;
  --warn-text: #6e4a0c;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: rgb(var(--bg-rgb) / .55); border-color: var(--line-strong); color: var(--text); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn-quiet { background: transparent; color: var(--muted); padding: 0 12px; }
.btn-quiet:hover { color: var(--text); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Header ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 32px; padding: 0 32px;
  background: linear-gradient(to bottom, rgb(var(--bg-rgb) / .92), rgb(var(--bg-rgb) / .74));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topbar nav { flex: 1; }
.topbar nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.topbar nav a {
  display: block; padding: 8px 14px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-size: 15px; font-weight: 500; transition: color .15s, background .15s;
}
.topbar nav a:hover { color: var(--text); }
.topbar nav a.active { color: var(--text); background: var(--surface-3); }
.theme-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .i-moon, [data-theme="light"] .theme-btn .i-sun { display: none; }
[data-theme="light"] .theme-btn .i-moon { display: block; }

/* ---------- Hero / 3D ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 600px; max-height: 1080px; overflow: hidden; background: #c9a57f; }
.hero-poster, .hero-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-poster[hidden] { display: none; }
.scene { position: absolute; inset: 0; z-index: 1; }
.scene canvas { display: block; width: 100%; height: 100%; cursor: grab; opacity: 0; transition: opacity .7s ease; touch-action: pan-y; }
.scene.ready canvas { opacity: 1; }
.scene canvas:active { cursor: grabbing; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(var(--bg-rgb) / .62) 0, rgb(var(--bg-rgb) / 0) calc(var(--header-h) + 130px)),
    linear-gradient(to top, var(--bg) 0, rgb(var(--bg-rgb) / 0) 120px);
}
.scene-loading {
  position: absolute; z-index: 4; left: 50%; bottom: 128px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); font-size: 13px; background: rgb(var(--bg-rgb) / .78); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); transition: opacity .5s ease;
}
.scene-loading::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.scene-loading.done { opacity: 0; pointer-events: none; }

/* Poster capture keeps the overlays in the layout (the 3D framing depends on their size) but invisible. */
.poster-mode .topbar, .poster-mode .scene-loading, .poster-mode .hero-poster { display: none !important; }
.poster-mode .hero-line, .poster-mode .hero-bar { visibility: hidden; }
.poster-mode .hero::after { content: none; }
.poster-mode .scene canvas { transition: none; }

.menu-btn { display: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent);
  font-size: 14px; font-weight: 600; letter-spacing: 0; margin-bottom: 16px;
}

.hero-line {
  position: absolute; z-index: 4; top: calc(var(--header-h) + 28px); inset-inline: 16px;
  text-align: center; font-size: clamp(22px, 2.3vw, 32px); font-weight: 700; line-height: 1.35;
  pointer-events: none;
}
.hero-line .sub, .hero-line .dash { font-weight: 500; opacity: .85; }

.hero-bar {
  position: absolute; z-index: 4; bottom: 28px; inset-inline: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.hero-bar > * { pointer-events: auto; }
.product-switch {
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: rgb(var(--bg-rgb) / .78); border: 1px solid var(--line-strong); backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgb(0 0 0 / .18);
}
.product-switch button {
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; transition: all .18s; white-space: nowrap;
}
.product-switch button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.product-switch button:not([aria-selected="true"]):hover { color: var(--text); }
.hero-hint { font-size: 12.5px; color: var(--muted); text-align: center; padding: 2px 12px; border-radius: 999px; background: rgb(var(--bg-rgb) / .55); }
.hero-hint .h-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hero-hint .h-fine { display: none; }
  .hero-hint .h-touch { display: inline; }
}

.hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hotspot {
  position: absolute; top: 0; left: 0; pointer-events: auto;
  display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; min-height: 32px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgb(var(--bg-rgb) / .8); backdrop-filter: blur(6px);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: opacity .2s, border-color .2s, background .2s;
  will-change: transform;
}
.hotspot.flip { flex-direction: row-reverse; padding: 5px 12px 5px 8px; }
.hotspot:hover, .hotspot.active { border-color: var(--accent); background: rgb(var(--bg-rgb) / .94); }
.hotspot .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 10px currentColor; color: var(--ok); }
.hotspot[data-status="warn"] .dot { background: var(--warn); color: var(--warn); }
.hotspot[data-status="alert"] .dot { background: var(--alert); color: var(--alert); animation: blink 1s infinite; }
.hotspot .n { color: var(--faint); font-size: 12px; }
.hotspot.hidden { opacity: 0 !important; pointer-events: none; }
.poster-mode .hotspots { display: none !important; }

.component-panel {
  position: absolute; z-index: 5; inset-inline-end: 24px; top: calc(var(--header-h) + 84px);
  width: 320px; max-height: calc(100% - var(--header-h) - 200px); overflow: auto; padding: 20px; border-radius: var(--radius);
  background: rgb(var(--bg-rgb) / .94); border: 1px solid var(--line-strong); backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgb(0 0 0 / .22);
}
.component-panel[hidden] { display: none; }
.component-panel h3 { font-size: 18px; padding-inline-end: 32px; }
.component-panel .desc { color: var(--muted); font-size: 14px; margin-top: 6px; }
.component-panel dl { margin: 16px 0 0; display: grid; gap: 8px; }
.component-panel dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.component-panel dt { color: var(--muted); font-size: 14px; }
.component-panel dd { margin: 0; font-weight: 600; }
.panel-close {
  position: absolute; inset-inline-end: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px;
}
.panel-close:hover { background: var(--surface-3); color: var(--text); }

@keyframes blink { 50% { opacity: .35; } }

/* ---------- Sections ---------- */
main > section:not(.hero) { padding: 104px 56px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; }
.section-head p.sub { color: var(--muted); font-size: 17px; margin-top: 14px; }
.wrap { max-width: 1360px; margin: 0 auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.section-alt .card { background: var(--bg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 17px; font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap;
}
.badge-real { color: var(--ok); border-color: rgba(61, 220, 151, .4); }
.badge-sim { color: var(--sun); border-color: rgba(240, 179, 90, .4); }
.badge-accent { color: var(--accent); border-color: rgba(58, 155, 255, .45); }
.data-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 20px; color: var(--muted); font-size: 14px; }

/* ---------- Twin ---------- */
.fleet { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.fleet button {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; text-align: start;
  transition: border-color .15s, background .15s;
}
.fleet button:hover { border-color: var(--line-strong); }
.fleet button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.fleet .fid { font-weight: 700; font-size: 14px; direction: ltr; }
.fleet .fsite { color: var(--muted); font-size: 13px; }

.twin-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-auto-rows: auto; gap: 16px; }
.twin-map-card { grid-row: span 2; display: flex; flex-direction: column; }
.map { width: 100%; min-height: 320px; flex: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.coords { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin: 16px 0 0; }
.coords dt { color: var(--muted); font-size: 13px; }
.coords dd { margin: 0; font-weight: 600; }

.metric-big { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.1; }
.metric-big small { font-size: 16px; color: var(--muted); font-weight: 500; margin-inline-start: 6px; }
.metric-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.weather-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.weather-list div { padding: 12px; border-radius: 10px; background: var(--surface-2); }
.section-alt .weather-list div { background: var(--surface); }
.weather-list span { display: block; color: var(--muted); font-size: 13px; }
.weather-list strong { font-size: 18px; }

.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.bar.sand > i { background: var(--sun); }
.bar-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

.sensors { grid-column: 2 / span 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sensor { padding: 16px; }
.sensor-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sensor-name { color: var(--muted); font-size: 13px; }
.sensor-val { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.sensor-val small { font-size: 13px; color: var(--faint); font-weight: 500; margin-inline-start: 4px; font-family: var(--font-body); }
.sensor canvas { width: 100%; height: 40px; display: block; margin-top: 8px; }
.status { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.status.warn { background: var(--warn); }
.status.alert { background: var(--alert); animation: blink 1s infinite; }

.alerts { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; max-height: 188px; overflow: auto; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.section-alt .alerts li { background: var(--surface); }
.alerts time { color: var(--faint); font-size: 12px; margin-inline-start: auto; white-space: nowrap; }

/* ---------- Land ---------- */
.land-grid { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }
.land-form { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; }
.land-form .map { min-height: 240px; cursor: crosshair; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { color: var(--faint); font-size: 13px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="number"], select {
  width: 100%; min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-2); transition: border-color .15s;
}
input:hover, select:hover { border-color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--alert); }
.field-error { color: var(--alert); font-size: 13px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button {
  min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer;
}
.presets button:hover { color: var(--text); border-color: var(--accent); }

.empty {
  display: grid; place-items: center; text-align: center; gap: 12px; min-height: 520px; padding: 48px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted);
}
.empty h3 { color: var(--text); font-size: 22px; }
.empty svg { width: 120px; height: 120px; }

.progress-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.progress-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.progress-list .src { color: var(--faint); font-size: 13px; margin-inline-start: auto; direction: ltr; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spin.ok { border: 0; background: var(--ok); animation: none; }
.spin.fail { border: 0; background: var(--alert); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.res { display: grid; gap: 16px; }
.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.res-head h3 { font-size: 24px; }
.res-head .place { color: var(--muted); margin-top: 4px; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.res-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.res-kpis .card { padding: 18px; }
.res-kpis span { color: var(--muted); font-size: 13px; display: block; }
.res-kpis strong { font-family: var(--font-display); font-size: 26px; display: block; margin-top: 2px; }
.res-kpis em { font-style: normal; font-size: 13px; color: var(--faint); }
.res-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.table th { color: var(--muted); font-weight: 500; }
.table td.v { text-align: end; font-weight: 600; }
.texture-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
.texture-bar i { display: block; height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }

.score-list { display: grid; gap: 14px; }
.score-row .bar-row { margin-top: 0; }
.score-row .bar-row strong { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.chip b { display: block; font-size: 15px; }
.chip span { color: var(--muted); font-size: 12px; }

.scenarios { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.scenario {
  text-align: start; padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; display: grid; gap: 6px;
}
.scenario:hover { border-color: var(--line-strong); }
.scenario[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.scenario .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.scenario p { color: var(--muted); font-size: 13px; }
.layout-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; margin-top: 16px; }
.layout-wrap svg { width: 100%; height: auto; border-radius: 10px; }
.zone-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.zone-list li { display: flex; align-items: center; gap: 10px; }
.zone-list li b { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.zone-list li span { margin-inline-start: auto; color: var(--muted); }

.alert-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(245, 184, 65, .35); background: rgba(245, 184, 65, .08); font-size: 14px; color: var(--warn-text); }
.alert-box strong { color: var(--warn); }
.note { color: var(--faint); font-size: 13px; }

/* ---------- Paths ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tabs button {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; transition: all .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.path-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.path-panel h3 { font-size: 24px; }
.path-panel .who { color: var(--muted); margin-top: 8px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; }
.steps li::before {
  content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--accent); font-size: 13px; font-weight: 700;
}
.calc .out { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.calc .out div { padding: 16px; border-radius: 12px; background: var(--surface-2); }
.section-alt .calc .out div { background: var(--surface); }
.calc .out span { color: var(--muted); font-size: 13px; display: block; }
.calc .out strong { font-family: var(--font-display); font-size: 22px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.seg button {
  min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.warn-note { margin-top: 12px; color: var(--warn-text); }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.range-head { display: flex; justify-content: space-between; font-size: 14px; }
.range-head output { font-weight: 700; color: var(--accent); }

/* ---------- Company ---------- */
.company-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: start; }
.registry { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.registry li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.registry li .k { color: var(--accent); font-weight: 700; flex: none; width: 22px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: f; }
.flow li { position: relative; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); counter-increment: f; }
.flow li::before { content: counter(f, arabic-indic); color: var(--accent); font-family: var(--font-display); font-size: 22px; font-weight: 700; display: block; }
.flow li b { display: block; font-size: 15px; margin-top: 4px; }
.flow li p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.flow li .lnk { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--steel); }
.lines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.lines .card h4 { font-size: 16px; }
.lines .card p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.lines .card .rev { margin-top: 12px; font-size: 13px; color: var(--accent); }
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.roadmap .card h4 { font-size: 16px; }
.roadmap .card .when { color: var(--accent); font-size: 13px; font-weight: 600; }
.roadmap ul { margin: 10px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; }

.units-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.unit-card h3 { font-size: 18px; }
.unit-card ul { margin: 12px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
footer a { color: var(--muted); }

footer { padding: 40px 56px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

/* ---------- Leaflet tweaks ---------- */
.leaflet-container { font-family: var(--font-body); background: var(--surface-2); }
.leaflet-control-attribution { font-size: 10px; }
.unit-marker { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(58, 155, 255, .3); }
.unit-marker.idle { background: var(--faint); box-shadow: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .twin-grid { grid-template-columns: 1fr 1fr; }
  .twin-map-card { grid-row: auto; grid-column: span 2; }
  .sensors { grid-column: span 2; }
  .land-grid { grid-template-columns: 1fr; }
  .land-form { position: static; }
  .company-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .topbar { padding: 0 12px 0 16px; gap: 8px; }
  .brand-text small { display: none; }
  .topbar nav { display: none; }
  .topbar .btn-primary { margin-inline-start: auto; min-height: 40px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
  .brand-text strong { white-space: nowrap; }
  .theme-btn { width: 40px; height: 40px; }
  .menu-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer;
  }
  .menu-btn svg { width: 22px; height: 22px; }
  body.menu-open .topbar nav {
    display: block; position: fixed; top: var(--header-h); inset-inline: 0;
    background: rgb(var(--bg-rgb) / .98); border-bottom: 1px solid var(--line); padding: 8px 12px 16px;
  }
  body.menu-open .topbar nav ul { flex-direction: column; }
  body.menu-open .topbar nav a { padding: 14px 16px; font-size: 16px; border-radius: 12px; }
  main > section:not(.hero) { padding: 64px 16px; }
  /* The model is width-bound on phones, so the hero height follows the width instead of the screen. */
  .hero { height: min(100svh, calc(var(--header-h) + 150vw)); min-height: 540px; }
  .hero-line { top: calc(var(--header-h) + 18px); font-size: 20px; }
  .hero-line .dash { display: none; }
  .hero-line .sub { display: block; font-size: 15px; margin-top: 2px; }
  .hero-bar { bottom: 18px; gap: 8px; }
  .product-switch button { padding: 0 16px; font-size: 14px; }
  .scene-loading { bottom: 110px; }
  .component-panel { inset-inline: 12px; width: auto; top: auto; bottom: 12px; max-height: 58%; }
  .twin-grid, .sensors { grid-template-columns: 1fr 1fr; }
  .res-kpis { grid-template-columns: 1fr 1fr; }
  .res-2, .path-panel, .layout-wrap, .scenarios { grid-template-columns: 1fr; }
  .flow, .lines, .roadmap { grid-template-columns: 1fr 1fr; }
  .units-strip { grid-template-columns: 1fr; }
  footer { padding: 32px 20px; }
}
@media (max-width: 440px) {
  .site-header-home .brand-text { display: none; }
  .topbar .btn-primary { padding: 0 12px; font-size: 13px; }
  .menu-btn { width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .hotspot .lbl { display: none; }
  .hotspot, .hotspot.flip { padding: 6px 10px; }
  .twin-grid { grid-template-columns: 1fr; }
  .twin-map-card, .sensors { grid-column: auto; }
  .flow, .lines, .roadmap { grid-template-columns: 1fr; }
}
.twin-grid > *, .sensors > *, .land-grid > *, .res-2 > *, .path-panel > *, .company-grid > *, .layout-wrap > * { min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
