* { box-sizing:border-box; }

:root {
  color-scheme:dark;
  --bg:#080A18;
  --bg-soft:#111329;
  --panel:#17132D;
  --panel-soft:#111329;
  --line:rgba(167,110,255,.22);
  --line-strong:rgba(182,108,255,.5);
  --gold:#7C3AED;
  --gold-light:#B66CFF;
  --champagne:#E7D9FF;
  --silver:#A7A0BD;
  --text:#F4F0FF;
  --muted:#A7A0BD;
  --font-ar:'Cairo',Tahoma,Arial,sans-serif;
  --font-en:'Inter',Arial,sans-serif;
  --font:var(--font-ar);
  --shadow:0 24px 70px rgba(0,0,0,.42);
}

html { scroll-behavior:smooth; scroll-padding-top:22px; background:var(--bg); }
body { margin:0; min-height:100vh; color:var(--text); background:var(--bg); font-family:var(--font); font-size:13px; }
html[dir="ltr"] { --font:var(--font-en); }
html[dir="ltr"] body { direction:ltr; }
button,select,input { font:inherit; }
button { color:inherit; }
button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible { outline:2px solid var(--gold-light); outline-offset:3px; }
::selection { color:#080A18; background:var(--gold-light); }

.hero {
  min-height:100svh;
  height:900px;
  max-height:1100px;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:radial-gradient(ellipse at 68% 47%,#24183a 0,#111329 37%,#080A18 77%);
  border-bottom:1px solid rgba(167,110,255,.16);
}
#earthCanvas { width:100%; height:100%; position:absolute; inset:0; display:block; z-index:0; filter:hue-rotate(225deg) saturate(.82); }
.hero-vignette { position:absolute; inset:0; z-index:1; pointer-events:none; background:linear-gradient(90deg,rgba(8,10,24,.96) 0%,rgba(8,10,24,.9) 26%,rgba(8,10,24,.25) 57%,rgba(8,10,24,.05) 78%),linear-gradient(0deg,#080A18 0%,transparent 23%,transparent 76%,rgba(8,10,24,.6)); }
.hero-header { position:absolute; z-index:3; inset:0 0 auto; padding:30px clamp(24px,6vw,92px); display:flex; align-items:center; justify-content:space-between; }
.brand { display:flex; gap:12px; align-items:center; color:var(--text); text-decoration:none; min-width:0; }
.brand-mark { width:42px; height:42px; display:grid; place-items:center; position:relative; border:1px solid var(--gold); border-radius:50%; color:var(--gold-light); font:600 16px var(--font-en); letter-spacing:-2px; box-shadow:inset 0 0 20px #7c3aed12,0 0 24px #7c3aed12; }
.brand-mark span { font-size:11px; position:absolute; inset:auto -3px -4px auto; color:var(--champagne); background:#111329; border-radius:50%; padding:2px; }
.brand-copy b,.brand-copy small { display:block; }
.brand-copy b { font:600 11px var(--font-en); letter-spacing:2.4px; white-space:nowrap; }
.brand-copy small { color:var(--gold); font-size:9px; margin-top:4px; letter-spacing:.2px; }
.hero-actions { display:flex; align-items:center; gap:16px; }
.live-pill { display:inline-flex; align-items:center; gap:9px; color:var(--muted); font-size:9px; letter-spacing:.3px; }
.live-pill i { width:6px; height:6px; border-radius:50%; background:var(--gold-light); box-shadow:0 0 9px #b66cff80; }
.language-toggle { border:1px solid var(--line-strong); border-radius:5px; background:#111329bd; color:var(--champagne); padding:9px 13px; font:600 10px var(--font-en); letter-spacing:1px; cursor:pointer; transition:.25s; }
.language-toggle:hover { background:#7c3aed20; border-color:var(--gold-light); }
.hero-content { position:absolute; z-index:2; left:clamp(28px,11vw,168px); top:50%; transform:translateY(-46%); width:min(430px,44vw); animation:heroReveal 1.1s cubic-bezier(.2,.8,.2,1) both; }
html[dir="rtl"] .hero-content { left:auto; right:clamp(28px,11vw,168px); }
.eyebrow,.section-kicker { color:var(--gold); font-size:9px; font-weight:600; letter-spacing:1.2px; }
.hero-eyebrow { display:block; margin-bottom:18px; text-transform:uppercase; }
.hero-content h1 { margin:0; color:var(--text); font-size:clamp(37px,5vw,68px); font-weight:500; line-height:1.2; letter-spacing:-1.5px; }
.hero-content h1 span { color:var(--gold-light); }
.hero-content p { max-width:370px; color:var(--muted); font-size:13px; line-height:2; margin:21px 0 27px; }
.gold-button { display:inline-flex; align-items:center; justify-content:center; gap:26px; min-height:44px; padding:0 19px; border:1px solid var(--gold); border-radius:4px; background:linear-gradient(115deg,#7C3AED,#5727aa); color:#F4F0FF; font-weight:700; font-size:11px; cursor:pointer; box-shadow:0 10px 32px #7c3aed1d; transition:transform .35s,box-shadow .35s,filter .35s; }
.gold-button:hover { transform:translateY(-2px); box-shadow:0 14px 40px #b66cff36; filter:brightness(1.07); }
.gold-button>span:last-child { font:18px var(--font-en); }
.quiet-link { display:block; background:none; border:0; color:var(--muted); font-size:10px; margin-top:18px; padding:4px 0; cursor:pointer; }
.quiet-link:hover { color:var(--champagne); }
.earth-caption { position:absolute; z-index:2; right:clamp(22px,6vw,90px); bottom:60px; display:flex; align-items:center; gap:13px; }
html[dir="ltr"] .earth-caption { right:clamp(22px,6vw,90px); }
.caption-rule { height:1px; width:45px; background:var(--gold); box-shadow:0 0 12px #b66cff; }
.earth-caption b,.earth-caption small { display:block; }
.earth-caption b { color:var(--champagne); font-size:10px; font-weight:600; }
.earth-caption small { color:var(--muted); font:9px var(--font-en); margin-top:4px; }
.hero-hint { position:absolute; z-index:2; left:50%; bottom:27px; transform:translateX(-50%); display:flex; align-items:center; gap:9px; color:var(--muted); font-size:9px; white-space:nowrap; }
.hero-hint span:first-child { width:4px; height:4px; border:1px solid var(--gold); border-radius:50%; }
.globe-status { position:absolute; z-index:2; bottom:62px; left:50%; transform:translateX(-50%); color:var(--muted); font-size:9px; white-space:nowrap; }
.globe-status.ready { color:var(--gold-light); }
.globe-status.error { color:var(--champagne); }
.hero.fly-away .hero-content,.hero.fly-away .hero-header,.hero.fly-away .earth-caption,.hero.fly-away .hero-hint { transition:opacity .55s,transform .85s; opacity:0; }
.hero.fly-away .hero-content { transform:translateY(-60%) scale(.96); }

.app-shell { display:flex; min-height:100vh; direction:rtl; background:radial-gradient(ellipse at 76% -14%,#7c3aed0b,transparent 42%),var(--bg); }
html[dir="ltr"] .app-shell { direction:ltr; }
.sidebar { flex:0 0 246px; width:246px; position:sticky; top:0; height:100vh; padding:25px 15px 18px; display:flex; flex-direction:column; border-left:1px solid var(--line); background:linear-gradient(180deg,#111329f5,#080A18fa); z-index:5; }
html[dir="ltr"] .sidebar { border-left:0; border-right:1px solid var(--line); }
.sidebar .brand { padding:2px 6px 34px; }
.sidebar .brand-mark { width:37px; height:37px; }
.sidebar .brand-copy b { font-size:9px; letter-spacing:1.3px; }
.sidebar .brand-copy small { font-size:8px; }
.side-label { padding:0 11px 12px; color:var(--muted); font-size:8px; letter-spacing:1px; }
.nav { display:grid; gap:5px; }
.nav-item { width:100%; display:flex; align-items:center; gap:12px; padding:11px; border:1px solid transparent; border-radius:5px; background:transparent; color:var(--muted); text-align:start; font-size:10px; cursor:pointer; transition:background .25s,border-color .25s,color .25s; }
.nav-item>span:first-child { flex:0 0 19px; color:var(--gold-light); text-align:center; font-size:16px; }
.nav-item:hover,.nav-item.active { color:var(--text); background:linear-gradient(90deg,#7c3aed14,#7c3aed05); border-color:#a76eff38; box-shadow:inset -2px 0 var(--gold); }
html[dir="ltr"] .nav-item:hover,html[dir="ltr"] .nav-item.active { box-shadow:inset 2px 0 var(--gold); }
.nav-item.active>span:first-child { color:var(--gold-light); }
.sidebar-bottom { margin-top:auto; }
.status { display:flex; align-items:center; gap:8px; padding:12px 8px; border-top:1px solid var(--line); margin-bottom:10px; color:var(--muted); font-size:8px; }
.status i { width:6px; height:6px; border-radius:50%; background:var(--gold-light); }
.user-chip { display:flex; align-items:center; gap:10px; border-top:1px solid var(--line); padding:15px 5px 0; }
.avatar { width:31px; height:31px; display:grid; place-items:center; border:1px solid var(--line-strong); border-radius:50%; color:var(--gold-light); font:600 9px var(--font-en); }
.user-chip b,.user-chip small { display:block; }
.user-chip b { font-size:9px; font-weight:600; }
.user-chip small { margin-top:4px; color:var(--muted); font-size:8px; }
.main { min-width:0; width:calc(100% - 246px); max-width:1800px; margin-inline:auto; padding:28px clamp(18px,2.4vw,36px) 25px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:22px; }
.topbar .eyebrow { color:var(--gold-light); }
.topbar h1 { margin:7px 0 3px; color:var(--text); font-size:25px; font-weight:500; letter-spacing:0; }
.subhead { margin:0; color:var(--muted); font-size:10px; }
.top-actions { display:flex; align-items:center; gap:12px; }
.top-actions .live-pill { padding:8px 11px; border:1px solid var(--line); border-radius:20px; font-size:8px; }
.year-select { display:flex; align-items:center; gap:8px; padding:6px 10px; border:1px solid var(--line); border-radius:5px; color:var(--muted); font-size:9px; }
.year-select select,.scenario-control select,.compare-controls select { min-width:96px; padding:6px 9px; border:1px solid #a76eff66; border-radius:3px; background:#111329; color:var(--champagne); font-family:var(--font); font-size:10px; }
.year-select option,.scenario-control option,.compare-controls option { background:#111329; }
.compact-toggle { padding:7px 10px; }

.kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; margin-bottom:13px; }
.kpi-card,.panel { background:linear-gradient(145deg,rgba(23,19,45,.96),rgba(17,19,41,.95)); border:1px solid var(--line); border-radius:7px; box-shadow:var(--shadow),inset 0 1px #f4f0ff10; transition:border-color .3s,box-shadow .3s,transform .3s; }
.kpi-card { position:relative; overflow:hidden; padding:15px 16px; }
.kpi-card:after { content:""; position:absolute; inset:0 auto auto 15px; width:25%; height:1px; background:linear-gradient(90deg,transparent,var(--gold-light),transparent); opacity:.52; }
.kpi-card:hover,.panel:hover { border-color:var(--line-strong); box-shadow:0 20px 58px #0008,inset 0 1px #f4f0ff20,0 0 25px #7c3aed12; }
.kpi-top { display:flex; align-items:center; justify-content:space-between; gap:6px; color:var(--muted); font-size:9px; }
.kpi-icon { color:var(--gold-light); font:normal 17px var(--font-en); }
.kpi-icon.silver { color:var(--silver); }
.kpi-card>strong { display:block; margin:11px 0 6px; color:var(--text); font:500 24px var(--font); }
.kpi-card .unit { font-size:10px; color:var(--muted); font-weight:400; }
.kpi-card>small { display:flex; justify-content:space-between; align-items:center; gap:5px; color:var(--muted); font-size:8px; }
.kpi-card em { color:var(--gold-light); font-size:7px; font-style:normal; }
.trend { color:#d4c2ed; }

.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(270px,.82fr); gap:12px; scroll-margin-top:20px; }
.panel { min-width:0; padding:15px; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.panel-heading h2 { margin:5px 0 0; color:var(--text); font-size:13px; font-weight:600; }
.section-kicker { color:var(--gold-light); font-size:8px; letter-spacing:.7px; }
.heading-tag { margin-inline-start:7px; padding:3px 6px; border:1px solid #a76eff44; border-radius:3px; color:var(--gold-light); font-size:8px; font-weight:400; }
.map-panel { min-width:0; scroll-margin-top:20px; }
.map-tools { display:flex; gap:5px; }
.tool-btn,.icon-btn { border:1px solid var(--line); border-radius:4px; background:#111329; color:var(--muted); padding:7px 9px; font-size:9px; cursor:pointer; transition:.25s; }
.tool-btn:hover,.icon-btn:hover,.tool-btn.active { border-color:#b66cff88; color:var(--champagne); background:#7c3aed18; }
.map-stage { position:relative; width:100%; height:430px; min-height:430px; overflow:hidden; isolation:isolate; border:1px solid #a76eff28; border-radius:4px; background:#080A18; }
#map { position:absolute; inset:0; width:100%; height:100%; min-height:430px; z-index:1; border-radius:4px; background:#080A18; }
.leaflet-container { direction:ltr; background:#111329; font-family:var(--font); }
#map .leaflet-tile-pane { filter:grayscale(.72) hue-rotate(235deg) brightness(.58) contrast(1.08); }
#map .leaflet-overlay-pane svg { overflow:visible; }
#map .leaflet-overlay-pane svg path { transition:fill-opacity .28s,stroke-width .28s; }
#map .leaflet-interactive { cursor:pointer; }
#map .leaflet-control-zoom { border:1px solid #b66cff66; box-shadow:0 4px 18px #0008; }
#map .leaflet-control-zoom a { background:#111329!important; color:var(--gold-light)!important; border-color:#a76eff44!important; }
#map .leaflet-control-zoom a:hover { background:#271b43!important; color:var(--champagne)!important; }
#map .leaflet-popup-content-wrapper,#map .leaflet-popup-tip { background:#17132D; color:var(--text); border:1px solid #b66cffa6; box-shadow:0 0 18px #7c3aed22; }
#map .leaflet-popup-content { margin:13px 16px; font:12px var(--font); }
#map .holo-district { filter:hue-rotate(230deg) drop-shadow(0 0 3px #b66cff8c) drop-shadow(0 0 8px #7c3aed3a); transition:filter .3s; }
#map .holo-district:hover { filter:hue-rotate(230deg) drop-shadow(0 0 5px #E7D9FF) drop-shadow(0 0 13px #B66CFF); }
.holo-popup { min-width:190px; color:var(--text); text-align:start; }
.holo-popup-tag { color:var(--gold-light); font-size:9px; }
.holo-popup h3 { margin:9px 0; color:var(--gold-light); font-size:16px; }
.holo-popup p { color:var(--muted); font-size:10px; }
.holo-popup-population { display:flex; flex-direction:column; gap:5px; padding:9px 0; border-top:1px solid #E7D9FF15; }
.holo-popup-population span { color:var(--muted); font-size:9px; }
.holo-popup-population strong { color:var(--gold-light); font-size:17px; }
.holo-popup-source { font-size:9px!important; line-height:1.7; }
.holo-popup-source a { color:var(--gold-light); }
.holo-popup-line { display:block; height:1px; margin-top:12px; background:linear-gradient(90deg,#7C3AED,#E7D9FF,transparent); }
.holo-tooltip { background:#111329!important; color:var(--champagne)!important; border:1px solid #b66cff!important; border-radius:3px!important; box-shadow:0 0 12px #0009; font-size:10px; }
.holo-tooltip:before { border-top-color:#b66cff!important; }
.map-legend { position:absolute; z-index:500; inset:auto auto 13px 13px; display:grid; grid-template-columns:repeat(2,max-content); gap:7px 11px; padding:11px 12px; border:1px solid #b66cff55; border-radius:4px; background:#111329e8; color:var(--muted); font-size:9px; pointer-events:none; direction:inherit; }
.map-legend b,.map-legend small { grid-column:1/-1; }
.map-legend b { color:var(--text); font-size:9px; }
.map-legend span { display:flex; gap:6px; align-items:center; }
.map-legend i { width:8px; height:8px; border-radius:50%; filter:hue-rotate(230deg); }
.map-legend small { max-width:235px; color:var(--muted); font-size:7px; line-height:1.6; }
.map-note,.map-coords,.map-status { position:absolute; z-index:600; pointer-events:none; }
.map-note { inset:auto 12px 11px auto; max-width:45%; color:var(--muted); font-size:7px; text-align:end; }
.map-coords { inset:12px 13px auto auto; padding:4px 7px; border:1px solid #a76eff38; border-radius:3px; background:#111329c9; color:var(--champagne); font:9px var(--font-en); }
.map-status:not([hidden]) { top:13px; left:50%; transform:translateX(-50%); max-width:calc(100% - 120px); padding:7px 10px; border:1px solid #b66cff66; border-radius:4px; background:#111329f2; color:var(--champagne); font-size:9px; text-align:center; }
.map-status.error { border-color:#b66cff; color:var(--champagne); }
.right-stack { display:grid; grid-template-rows:1fr 1fr; gap:12px; min-width:0; }
.compact { margin-bottom:12px; }
.mini-icon { color:var(--gold-light); font-size:18px; }
.region-list { display:grid; gap:10px; margin-top:14px; }
.region-item { display:grid; grid-template-columns:minmax(65px,92px) 1fr auto; align-items:center; gap:8px; color:var(--muted); font-size:9px; }
.region-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-track { height:5px; overflow:hidden; border-radius:5px; background:#111329; }
.bar-fill { height:100%; border-radius:5px; background:linear-gradient(90deg,#7C3AED,#B66CFF); box-shadow:0 0 8px #7c3aed32; transition:width .6s; }
.region-item strong { color:var(--champagne); font-size:8px; font-weight:500; }
.panel-foot { margin-top:12px; padding-top:9px; border-top:1px solid #f4f0ff0d; color:var(--muted); font-size:8px; line-height:1.8; }
.insight-list { display:grid; gap:3px; }
.insight-row { margin:0; padding:7px 0; border-bottom:1px solid #f4f0ff12; color:var(--text); font-size:9px; line-height:1.7; }
.insight-row:last-child { border:0; }
.insight-row strong { color:var(--gold-light); font-weight:600; }

.lower-grid { display:grid; grid-template-columns:1.15fr 1fr .9fr; gap:12px; margin-top:12px; scroll-margin-top:20px; }
.chart-panel,.timeline-panel { min-height:220px; }
.chart-unit { color:var(--muted); font-size:8px; }
.chart-wrap { height:142px; }
.chart-wrap canvas { display:block; width:100%; height:100%; filter:hue-rotate(230deg); }
.chart-note { margin:7px 0 0; color:var(--muted); font-size:8px; line-height:1.6; }
.donut-wrap { display:flex; align-items:center; justify-content:space-around; gap:10px; min-height:145px; }
.donut { position:relative; flex:0 0 124px; width:124px; height:124px; display:grid; place-items:center; border-radius:50%; background:conic-gradient(#c8a667 0 100%); filter:drop-shadow(0 0 11px #7c3aed22) hue-rotate(230deg); transition:background .5s; }
.donut:before { content:""; position:absolute; inset:14px; border-radius:50%; background:#17132D; }
.donut div { z-index:1; text-align:center; }
.donut b,.donut small { display:block; }
.donut b { font-size:12px; }
.donut small { margin-top:4px; color:var(--muted); font-size:8px; }
.donut-legend { display:grid; gap:8px; color:var(--muted); font-size:8px; }
.donut-legend span { display:flex; align-items:center; gap:7px; }
.donut-legend i { width:7px; height:7px; flex:0 0 7px; border-radius:2px; filter:hue-rotate(230deg); }
.timeline-years { display:flex; justify-content:space-between; margin:22px 2px 10px; color:var(--muted); font-size:9px; }
.timeline-years span:last-child { color:var(--gold-light); }
input[type=range] { width:100%; accent-color:var(--gold); cursor:pointer; }
.timeline-controls { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:15px; }
.play-btn { border:1px solid #b66cff66; border-radius:4px; background:#7c3aed18; color:var(--champagne); padding:8px 10px; font-size:9px; cursor:pointer; }
#frameCount { color:var(--muted); font-size:9px; }
.timeline-hint { margin-top:12px; color:var(--muted); font-size:8px; line-height:1.7; }

.enterprise-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px; }
.forecast-panel,.comparison-panel,.city-panel,.reports-panel { scroll-margin-top:20px; }
.scenario-control { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:5px 0 12px; color:var(--muted); font-size:9px; }
.forecast-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.forecast-item { padding:12px; border:1px solid #a76eff24; border-radius:4px; background:#7c3aed08; }
.forecast-item small,.forecast-item b,.forecast-item span { display:block; }
.forecast-item small { color:var(--muted); font-size:8px; }
.forecast-item b { margin-top:8px; color:var(--text); font:500 17px var(--font); }
.forecast-item span { margin-top:5px; color:var(--gold-light); font-size:8px; }
.compare-controls { display:flex; align-items:end; flex-wrap:wrap; gap:8px; }
.compare-controls label { display:grid; flex:1 1 120px; gap:5px; color:var(--muted); font-size:8px; }
.compare-controls select { width:100%; }
.small-button { min-height:32px; padding:0 12px; font-size:9px; }
.comparison-result { min-height:56px; padding:12px 0 4px; color:var(--muted); font-size:9px; }
.comparison-table { width:100%; border-collapse:collapse; text-align:start; font-size:8px; }
.comparison-table th,.comparison-table td { padding:7px 5px; border-bottom:1px solid #f4f0ff12; }
.comparison-table th { color:var(--gold-light); font-weight:500; }
.comparison-table td { color:var(--text); }
.city-panel { margin-top:12px; }
.city-panel .panel-heading { margin-bottom:10px; }
.city-stage { position:relative; min-height:370px; overflow:hidden; border:1px solid #a76eff2e; border-radius:4px; background:radial-gradient(ellipse at 50% 40%,#25183d 0,#111329 47%,#080A18 100%); }
#cityCanvas { position:absolute; inset:0; width:100%; height:100%; display:block; filter:hue-rotate(230deg) saturate(.9); }
.city-overlay { position:absolute; inset:14px auto auto 15px; max-width:65%; padding:8px 10px; border:1px solid #a76eff3a; border-radius:3px; background:#111329d9; color:var(--muted); font-size:8px; pointer-events:none; }
.city-legend { position:absolute; inset:auto 15px 14px auto; display:flex; gap:14px; padding:8px 10px; border:1px solid #a76eff33; border-radius:3px; background:#111329d9; color:var(--muted); font-size:8px; pointer-events:none; }
.city-legend span { display:flex; align-items:center; gap:6px; }
.city-legend i { width:8px; height:8px; border-radius:2px; background:linear-gradient(140deg,#7C3AED,#B66CFF); }
.city-legend span:last-child i { background:#E7D9FF; box-shadow:0 0 8px #b66cff; }
.reports-panel { margin-top:12px; }
.report-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.report-actions .tool-btn { padding:11px 13px; }
.reports-panel>p { margin-top:12px; }
.footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px 15px; margin-top:15px; padding:12px 2px 0; color:var(--muted); font-size:8px; }
.footer>span:first-child { color:var(--gold-light); font:9px var(--font-en); letter-spacing:.5px; }
.toast { position:fixed; z-index:10000; inset:auto 25px 22px auto; max-width:calc(100vw - 50px); padding:11px 15px; border:1px solid var(--line-strong); border-radius:4px; background:#17132D; color:var(--champagne); font-size:10px; opacity:0; transform:translateY(8px); pointer-events:none; transition:.25s; }
.toast.show { opacity:1; transform:translateY(0); }
.map-stage.expanded { height:560px; }
html[dir="ltr"] .map-legend { inset:auto 13px 13px auto; }
html[dir="ltr"] .map-note { inset:auto auto 11px 12px; text-align:start; }
html[dir="ltr"] .map-coords { inset:12px auto auto 13px; }

@keyframes heroReveal { from { opacity:0; transform:translateY(-37%) } to { opacity:1; transform:translateY(-46%) } }
@keyframes slowGlow { 0%,100% { opacity:.42 } 50% { opacity:.83 } }

@media(max-width:1220px) {
  .sidebar { flex-basis:218px; width:218px; }
  .main { width:calc(100% - 218px); padding-inline:20px; }
  .dashboard-grid { grid-template-columns:minmax(0,1.4fr) minmax(245px,.9fr); }
  .lower-grid { grid-template-columns:1fr 1fr; }
  .timeline-panel { grid-column:1/-1; }
}
@media(max-width:900px) {
  .sidebar { flex-basis:64px; width:64px; padding-inline:7px; }
  .sidebar .brand { justify-content:center; padding:3px 0 25px; }
  .sidebar .brand-copy,.side-label,.sidebar .nav-item>span:not(:first-child),.status,.user-chip>div:last-child { display:none; }
  .nav-item { justify-content:center; padding:11px 4px; font-size:0; }
  .main { width:calc(100% - 64px); padding:20px 14px; }
  .dashboard-grid { grid-template-columns:1fr; }
  .right-stack { grid-template-columns:1fr 1fr; grid-template-rows:auto; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hero-content { left:7vw; width:46vw; }
  html[dir="rtl"] .hero-content { right:7vw; }
  .hero-vignette { background:linear-gradient(90deg,rgba(8,10,24,.94),rgba(8,10,24,.6) 40%,rgba(8,10,24,.05) 80%),linear-gradient(0deg,#080A18 0%,transparent 25%,transparent 80%,#080A1866); }
}
@media(max-width:620px) {
  .hero { height:100svh; min-height:690px; }
  .hero-header { padding:19px 18px; }
  .hero-header .live-pill { display:none; }
  .hero-content { top:47%; left:23px; width:min(350px,83vw); }
  html[dir="rtl"] .hero-content { right:23px; }
  .hero-content h1 { font-size:42px; }
  .hero-content p { max-width:300px; font-size:11px; }
  .hero-vignette { background:linear-gradient(90deg,#080A18db,#080A1860 72%,#080A181a),linear-gradient(0deg,#080A18 0%,transparent 28%,transparent 75%,#080A1888); }
  .earth-caption { right:18px; bottom:65px; }
  .globe-status { bottom:90px; font-size:8px; }
  .hero-hint { bottom:28px; width:100%; justify-content:center; font-size:8px; }
  .sidebar { flex-basis:52px; width:52px; padding-inline:5px; }
  .sidebar .brand-mark { width:34px; height:34px; }
  .nav { gap:3px; }
  .nav-item { min-height:42px; }
  .main { width:calc(100% - 52px); padding:17px 10px; }
  .topbar { display:block; }
  .topbar h1 { font-size:21px; }
  .top-actions { justify-content:flex-start; flex-wrap:wrap; gap:7px; margin-top:12px; }
  .top-actions>.live-pill { display:none; }
  .kpi-grid { gap:7px; }
  .kpi-card { padding:11px 9px; }
  .kpi-card>strong { font-size:19px; }
  .kpi-top { font-size:8px; }
  .kpi-card>small { align-items:flex-start; flex-direction:column; font-size:7px; }
  .dashboard-grid,.right-stack,.lower-grid,.enterprise-grid { grid-template-columns:1fr; }
  .right-stack { grid-template-rows:auto; }
  .timeline-panel { grid-column:auto; }
  .map-stage { height:430px; }
  .map-tools { gap:3px; }
  .tool-btn { padding:7px 6px; font-size:8px; }
  .map-legend { inset:auto auto 8px 8px; padding:8px; gap:5px 7px; font-size:8px; }
  .map-legend small { max-width:195px; font-size:7px; }
  .map-note { inset:auto 8px 8px auto; max-width:42%; font-size:6px; }
  .map-coords { inset:8px 8px auto auto; font-size:8px; }
  .map-status:not([hidden]) { max-width:calc(100% - 90px); font-size:8px; }
  html[dir="ltr"] .map-legend { inset:auto 8px 8px auto; }
  html[dir="ltr"] .map-note { inset:auto auto 8px 8px; }
  html[dir="ltr"] .map-coords { inset:8px auto auto 8px; }
  .region-item { grid-template-columns:85px 1fr auto; }
  .enterprise-grid { gap:10px; }
  .city-stage { min-height:315px; }
  .city-overlay { max-width:75%; }
  .report-actions { align-items:stretch; }
  .report-actions>* { flex:1 1 100%; }
  .footer { flex-direction:column; }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
@media print {
  :root { color-scheme:light; --bg:#fff; --text:#161616; --muted:#555; }
  body,.app-shell,.main { color:#161616!important; background:#fff!important; }
  .hero,.sidebar,.top-actions,.map-tools,.toast,.hero-actions,.report-actions,.play-btn { display:none!important; }
  .app-shell { display:block; }
  .main { width:100%; max-width:none; padding:0; }
  .panel,.kpi-card { break-inside:avoid; color:#181818!important; background:#fff!important; border:1px solid #aaa!important; box-shadow:none!important; }
  .panel-heading h2,.kpi-card>strong,.kpi-top,.region-item,.forecast-item b,.comparison-table td,.holo-popup { color:#222!important; }
  .map-stage,.city-stage { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .footer,.panel-foot,.chart-note { color:#444!important; }
  @page { margin:13mm; size:A4 landscape; }
}
