/* Slemani Data Hub
   Layout: a city survey file — a blueprint sheet opens the page, then the dashboard, the map
   and the catalogue sit as frosted survey panels over a slowly drifting light-blue sky.
   Single light theme by request: light-blue moving background, green type. */
:root {
  --sky-0: #f2faff;
  --sky-1: #dff1fb;
  --sky-2: #c3e4f7;
  --sky-3: #9cd1f0;
  --ink: #0f4a34;          /* body text — deep green */
  --green: #067a50;        /* headings, links */
  --green-2: #10a36f;      /* bright accent */
  --green-3: #c9f0dc;      /* soft fill */
  --muted: #3b6f5c;
  --paper: rgba(255, 255, 255, 0.68);
  --paper-2: rgba(255, 255, 255, 0.86);
  --line: rgba(15, 74, 52, 0.14);
  --line-2: rgba(15, 74, 52, 0.26);
  --bp-paper: #e7f4fd;
  --bp-ink: #2b6db1;
  --bp-ink-2: #8dbbe3;
  --bp-water: #2f8fd0;
  --shadow: 0 1px 2px rgba(15, 74, 52, 0.06), 0 10px 30px -12px rgba(20, 90, 140, 0.28);
  --f-display: 'Zain', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-body: 'Zain', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--sky-1);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--green-2); outline-offset: 2px; border-radius: 8px;
}
h1, h2, h3 { font-family: var(--f-display); color: var(--green); line-height: 1.25; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); font-weight: 900; }
h3 { font-size: 1.3rem; font-weight: 800; }
p { margin: 0; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 0.82em; letter-spacing: 0.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ───────── moving sky ───────── */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(170deg, var(--sky-0) 0%, var(--sky-1) 45%, #d3ecfa 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.75; will-change: transform; }
.b1 { width: 52vmax; height: 52vmax; background: radial-gradient(circle, #bfe3f8 0%, transparent 70%); top: -18vmax; right: -12vmax; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 44vmax; height: 44vmax; background: radial-gradient(circle, #cdeefa 0%, transparent 70%); bottom: -16vmax; left: -10vmax; animation: drift2 31s ease-in-out infinite alternate; }
.b3 { width: 30vmax; height: 30vmax; background: radial-gradient(circle, #d9f5ec 0%, transparent 70%); top: 38%; left: 34%; animation: drift3 23s ease-in-out infinite alternate; }
.b4 { width: 26vmax; height: 26vmax; background: radial-gradient(circle, #a9d8f3 0%, transparent 70%); top: 12%; left: 8%; animation: drift4 37s ease-in-out infinite alternate; opacity: 0.5; }
#skyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.grid { position: absolute; inset: -80px; background-image: linear-gradient(rgba(43, 109, 177, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(43, 109, 177, 0.06) 1px, transparent 1px); background-size: 80px 80px; animation: gridDrift 60s linear infinite; }
@keyframes drift1 { to { transform: translate(-14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(16vmax, -8vmax) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-10vmax, -12vmax) scale(0.85); } }
@keyframes drift4 { to { transform: translate(12vmax, 14vmax) scale(1.2); } }
@keyframes gridDrift { to { transform: translate(80px, 80px); } }

/* ───────── top bar ───────── */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px var(--gutter);
  background: rgba(239, 248, 254, 0.78);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  animation: barIn 0.8s var(--ease) both;
}
@keyframes barIn { from { transform: translateY(-100%); opacity: 0; } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand-mark { width: 40px; height: 40px; animation: floaty 5s ease-in-out infinite; }
.bm-bg { fill: var(--green); }
.bm-line { fill: none; stroke: #e6fff3; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; animation: drawLine 2.4s var(--ease) 0.4s both; }
.bm-dot { fill: #9df2c8; animation: pulseDot 2s ease-in-out infinite; transform-origin: 32px 12px; }
.bm-axis { stroke: rgba(230, 255, 243, 0.45); stroke-width: 1.6; fill: none; }
@keyframes drawLine { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes pulseDot { 50% { transform: scale(1.45); } }
@keyframes floaty { 50% { transform: translateY(-3px) rotate(-3deg); } }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-family: var(--f-display); font-size: 1.35rem; font-weight: 900; letter-spacing: 0.01em; }
.brand-txt small { font-size: 0.85rem; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { position: relative; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1rem; transition: background 0.25s, color 0.25s; }
.nav a::after { content: ''; position: absolute; inset-inline: 14px; bottom: 3px; height: 2px; background: var(--green-2); transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease); }
.nav a:hover { background: rgba(16, 163, 111, 0.1); color: var(--green); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

main { padding-inline: var(--gutter); }

/* ───────── hero ───────── */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding-block: clamp(28px, 5vw, 64px) 24px; max-width: 1320px; margin-inline: auto; }
.hero-copy { min-width: 0; display: grid; gap: 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-2); font-size: 1.05rem; }
.eyebrow::before { content: ''; width: 34px; height: 3px; border-radius: 3px; background: currentColor; transform-origin: right; animation: grow 1s var(--ease) 0.3s both; }
@keyframes grow { from { transform: scaleX(0); } }
.hero-title { font-family: var(--f-display); font-weight: 900; font-size: clamp(3.1rem, 8.6vw, 7rem); line-height: 0.95; letter-spacing: -0.01em; text-align: right; display: flex; flex-wrap: wrap; gap: 0 0.28em; justify-content: flex-end; }
.split { display: inline-flex; }
.split .ch { display: inline-block; background: linear-gradient(120deg, #067a50 0%, #10a36f 35%, #2b8fd0 55%, #067a50 80%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: letterDrop 0.9s var(--ease) both, shimmer 7s linear 1.6s infinite; animation-delay: calc(var(--i) * 55ms), calc(1.6s + var(--i) * 80ms); }
.split.alt .ch { animation-name: letterRise, shimmer; }
@keyframes letterDrop { from { transform: translateY(-0.8em) rotate(-18deg) scale(0.6); opacity: 0; } 60% { transform: translateY(0.06em) rotate(4deg); opacity: 1; } }
@keyframes letterRise { from { transform: translateY(0.9em) scale(1.4); opacity: 0; filter: blur(6px); } }
@keyframes shimmer { to { background-position: -260% 0; } }
.hero-lede { font-size: clamp(1.15rem, 1.8vw, 1.45rem); max-width: 40ch; color: var(--ink); }
.hero-lede b { color: var(--green); }
.hero-lede em { font-style: normal; color: var(--green-2); font-weight: 800; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 800; text-decoration: none; font-size: 1.05rem; transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s; }
.btn-solid { background: var(--green); color: #fff; box-shadow: 0 8px 20px -8px rgba(6, 122, 80, 0.7); }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -10px rgba(6, 122, 80, 0.8); }
.btn-ghost { background: var(--paper); color: var(--green); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { transform: translateY(-3px) rotate(-1deg); background: var(--paper-2); }

.hero-sheet { position: relative; margin: 0; min-width: 0; aspect-ratio: 1.12 / 1; max-width: 100%; border-radius: var(--r); overflow: hidden; background: var(--bp-paper); border: 1.5px solid rgba(43, 109, 177, 0.28); box-shadow: var(--shadow); }
.hero-sheet canvas { width: 100%; height: 100%; display: block; }
.titleblock { position: absolute; inset-inline: 10px; bottom: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 0; background: rgba(231, 244, 253, 0.92); border: 1.5px solid rgba(43, 109, 177, 0.45); font-size: 0.85rem; color: var(--bp-ink); }
.titleblock span { padding: 4px 10px; border-inline-start: 1.5px solid rgba(43, 109, 177, 0.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titleblock span:first-child { border-inline-start: 0; font-family: var(--f-mono); }
.titleblock i { font-style: normal; opacity: 0.7; margin-inline-end: 4px; }

/* ───────── KPIs ───────── */
.kpis { max-width: 1320px; margin: 8px auto 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transform-origin: top; }
.kpi b { font-family: var(--f-display); font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 900; color: var(--green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi b.money { font-size: clamp(1.45rem, 2.3vw, 2.1rem); white-space: nowrap; }
.kpi span { font-size: 0.98rem; color: var(--muted); line-height: 1.4; }
.k-flip { animation: kFlip 0.9s var(--ease) both; animation-delay: calc(0.5s + var(--i, 0) * 0.12s); }
@keyframes kFlip { from { transform: perspective(600px) rotateX(-85deg); opacity: 0; } }

/* ───────── ticker ───────── */
.ticker { max-width: 1320px; margin: 18px auto 0; overflow: hidden; border-block: 1px solid var(--line); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 40px; width: max-content; padding-block: 10px; animation: tick 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 1.02rem; }
.tick b { font-family: var(--f-display); font-weight: 900; font-size: 1.35rem; color: var(--green); font-variant-numeric: tabular-nums; }
.tick a { color: var(--muted); font-size: 0.82rem; text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.tick::after { content: '◆'; color: var(--green-2); opacity: 0.45; font-size: 0.7rem; margin-inline-start: 32px; }
@keyframes tick { to { transform: translateX(50%); } }

/* ───────── sections ───────── */
.sec { max-width: 1320px; margin-inline: auto; padding-block: clamp(48px, 7vw, 96px) 0; }
.sec-head { display: grid; gap: 10px; margin-bottom: 26px; max-width: 70ch; }
.sec-sub { color: var(--muted); font-size: 1.12rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); min-width: 0; }
.panel h3 { margin-bottom: 12px; }
.panel h3 small { font-weight: 400; color: var(--muted); font-size: 0.8em; }

/* reveal system — each class plays a different entrance */
.rv.play { animation: var(--anim, riseIn) 0.95s var(--ease) both; animation-delay: var(--d, 0s); }
.js .rv.pending { opacity: 0; }
.anim-blur { --anim: blurIn; }
.anim-rise { --anim: riseIn; }
.anim-zoom { --anim: zoomIn; }
.anim-slide { --anim: slideIn; }
.anim-flip { --anim: flipIn; }
.anim-skew { --anim: skewIn; }
.anim-sheet { --anim: sheetIn; }
.anim-track { --anim: trackIn; }
.wipe { --anim: wipeIn; }
@keyframes blurIn { from { filter: blur(14px); opacity: 0; transform: scale(1.04); } }
@keyframes riseIn { from { transform: translateY(46px); opacity: 0; } }
@keyframes zoomIn { from { transform: scale(0.82); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(-70px); opacity: 0; } }
@keyframes flipIn { from { transform: perspective(900px) rotateY(55deg); opacity: 0; } }
@keyframes skewIn { from { transform: skewY(7deg) translateY(40px); opacity: 0; } }
@keyframes sheetIn { from { transform: perspective(1200px) rotateX(24deg) rotateZ(-3deg) translateY(40px); opacity: 0; } }
@keyframes trackIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes wipeIn { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

/* ───────── dashboard ───────── */
.dash { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.dash > :nth-child(1) { grid-column: span 3; }
.dash > :nth-child(2) { grid-column: span 3; }
.dash > :nth-child(3) { grid-column: span 2; }
.dash > :nth-child(4) { grid-column: span 2; }
.dash > :nth-child(5) { grid-column: span 2; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .lbl { font-family: var(--f-body); font-size: 15px; fill: var(--ink); }
.chart .val { font-family: var(--f-mono); font-size: 13px; fill: var(--ink); font-weight: 600; }
.chart .axis { font-family: var(--f-mono); font-size: 11px; fill: var(--muted); }
.chart .gridl { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1.2; }
.chart .bar { transform-box: fill-box; transform-origin: right center; animation: barGrow 1.1s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 0.2s); cursor: pointer; transition: opacity 0.2s; }
.chart .col { transform-box: fill-box; transform-origin: center bottom; animation: colRise 1s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i) * 90ms + 0.2s); cursor: pointer; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart g:hover .bar, .chart g:hover .col { opacity: 0.78; }
.chart:not(.played) .bar, .chart:not(.played) .col { animation-play-state: paused; }
@keyframes barGrow { from { transform: scaleX(0); } }
@keyframes colRise { from { transform: scaleY(0); } }
.sevbar { display: flex; height: 38px; border-radius: 10px; overflow: hidden; gap: 2px; background: var(--paper-2); }
.sevbar span { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem; transform-origin: right; animation: barGrow 1.2s var(--ease) both; animation-delay: calc(var(--i) * 150ms + 0.3s); min-width: 0; }
.sevbar span.dark { color: #3b2a00; }
.sevlegend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.sevlegend li { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.sevlegend li b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.sev-ic { width: 18px; height: 18px; flex: none; }
.note { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }
.toplist { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: t; }
.toplist li { counter-increment: t; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 5px 6px; border-radius: 10px; cursor: pointer; transition: background 0.2s, transform 0.25s var(--ease); font-size: 0.98rem; line-height: 1.45; }
.toplist li::before { content: counter(t); font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }
.toplist li:hover { background: rgba(16, 163, 111, 0.1); transform: translateX(-4px); }
.toplist b { font-variant-numeric: tabular-nums; color: var(--green); white-space: nowrap; }
.tooltip { position: fixed; z-index: 80; pointer-events: none; background: #0f4a34; color: #f0fff8; padding: 8px 12px; border-radius: 10px; font-size: 0.95rem; line-height: 1.45; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); max-width: 260px; }

/* ───────── map ───────── */
.mapwrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; border-radius: var(--r); overflow: hidden; border: 1.5px solid rgba(43, 109, 177, 0.3); box-shadow: var(--shadow); background: var(--paper-2); }
.mapside { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-inline-end: 1px solid var(--line); min-width: 0; max-height: 700px; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 6px 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.search:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(16, 163, 111, 0.15); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); width: 100%; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px 3px 12px; font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s; line-height: 1.6; }
.chip:hover { transform: translateY(-2px); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--c); }
.chip[aria-pressed="false"] { opacity: 0.45; background: transparent; }
.chip[aria-pressed="true"] { border-color: var(--c, var(--green)); }
.chip small { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); }
.listmeta { font-size: 0.95rem; color: var(--muted); }
.listmeta b { color: var(--green); font-variant-numeric: tabular-nums; }
.maplist { position: relative; list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; display: grid; gap: 4px; align-content: start; scrollbar-width: thin; }
.maplist li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background 0.2s, transform 0.25s var(--ease); line-height: 1.4; }
.maplist li:hover, .maplist li.sel { background: rgba(16, 163, 111, 0.1); transform: translateX(-3px); }
.maplist li .stripe { border-radius: 4px; background: var(--c); }
.maplist li b { display: block; font-size: 1rem; font-weight: 800; color: var(--ink); }
.maplist li span { font-size: 0.86rem; color: var(--muted); }
.mapbox { position: relative; min-width: 0; isolation: isolate; z-index: 0; }
.leaflet-host { height: min(78vh, 700px); min-height: 420px; width: 100%; background: var(--bp-paper); }
.mapmodes { position: absolute; top: 12px; left: 56px; z-index: 500; display: flex; background: rgba(255, 255, 255, 0.9); border-radius: 12px; padding: 3px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mapmodes button { border: 0; background: transparent; font: inherit; font-size: 0.92rem; font-weight: 800; color: var(--muted); padding: 4px 12px; border-radius: 9px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.mapmodes button.on { background: var(--green); color: #fff; }
.mapreset { position: absolute; top: 12px; right: 12px; z-index: 500; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); font: inherit; font-weight: 800; font-size: 0.92rem; color: var(--green); padding: 5px 12px; border-radius: 10px; cursor: pointer; box-shadow: var(--shadow); }
.maptoast { position: absolute; bottom: 16px; inset-inline: 16px; z-index: 600; background: #0f4a34; color: #f0fff8; padding: 8px 14px; border-radius: 12px; font-size: 0.95rem; text-align: center; animation: riseIn 0.4s var(--ease) both; }
.maplegend { position: absolute; bottom: 26px; left: 12px; z-index: 500; background: rgba(255, 255, 255, 0.9); border-radius: 12px; padding: 8px 10px; border: 1px solid var(--line); font-size: 0.82rem; display: grid; grid-template-columns: repeat(2, auto); gap: 2px 12px; }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.maplegend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* Leaflet overrides */
.leaflet-container { font-family: var(--f-body); background: var(--bp-paper); }
.leaflet-control-zoom a { color: var(--green) !important; font-weight: 800; }
.leaflet-control-attribution { font-size: 11px; background: rgba(255, 255, 255, 0.82) !important; direction: ltr; }
.pin { position: relative; width: 30px; height: 30px; }
.pin-core { position: absolute; inset: 3px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff; box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.45); display: grid; place-items: center; animation: pinPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0s); transition: transform 0.25s var(--ease); }
.pin-core svg { width: 13px; height: 13px; transform: rotate(45deg); fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pin:hover .pin-core { transform: rotate(-45deg) scale(1.25); }
.pin-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
.pin.sev4 .pin-ring { animation: ripple 2.4s ease-out infinite; animation-delay: calc(var(--d, 0s) + 0.6s); }
.pin.sel .pin-core { transform: rotate(-45deg) scale(1.45); }
.pin.sel .pin-ring { animation: ripple 1.2s ease-out infinite; }
.pin.dim { opacity: 0.18; }
@keyframes pinPop { from { transform: rotate(-45deg) scale(0); } }
@keyframes ripple { from { transform: scale(0.8); opacity: 0.8; } to { transform: scale(2.6); opacity: 0; } }
.nb-label { position: absolute; left: 0; top: 0; font-family: var(--f-body); font-size: 12.5px; font-weight: 700; color: #2b6db1; white-space: nowrap; text-shadow: 0 0 3px var(--bp-paper), 0 0 3px var(--bp-paper), 0 0 2px var(--bp-paper); pointer-events: none; transform: translate(-50%, -50%); }
.nb-label.vil { font-weight: 400; font-size: 11.5px; opacity: 0.8; }
.nb-label.town { font-size: 15px; font-weight: 900; color: #174a7c; }
.lens { animation: lensDash 1.4s linear infinite; }
@keyframes lensDash { to { stroke-dashoffset: -24; } }
.ppopup .leaflet-popup-content-wrapper { border-radius: 16px; direction: rtl; text-align: right; box-shadow: 0 16px 40px -14px rgba(10, 60, 90, 0.5); animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; transform-origin: bottom center; }
.ppopup .leaflet-popup-content { margin: 12px 14px; font-family: var(--f-body); color: var(--ink); line-height: 1.5; }
@keyframes popIn { from { transform: scale(0.6) translateY(16px); opacity: 0; } }
.ppop { display: grid; gap: 8px; }
.pp-t { font-family: var(--f-display); font-size: 1.15rem; font-weight: 800; line-height: 1.4; }
.pp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pp-stats span { background: #f1f9fe; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 0.8rem; display: grid; line-height: 1.35; }
.pp-stats b { font-family: var(--f-display); font-size: 1.2rem; color: var(--green); font-weight: 900; }
.pp-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; flex-wrap: wrap; }
.pp-row b { color: var(--green); font-variant-numeric: tabular-nums; }
.pp-row b.red { color: #b5452c; }
.pp-btn { font: inherit; font-weight: 800; font-size: 0.95rem; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--green); color: #fff; cursor: pointer; transition: transform 0.25s var(--ease); }
.pp-btn:hover { transform: translateY(-2px); }
.leaflet-tooltip.ptip { font-family: var(--f-body); font-size: 14px; font-weight: 700; color: var(--ink); border-radius: 10px; border: 0; box-shadow: var(--shadow); direction: rtl; padding: 4px 10px; }

/* ───────── catalogue ───────── */
.cattools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.cattools .search { flex: 1 1 260px; max-width: 380px; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.98rem; }
.sort select { font: inherit; font-size: 0.98rem; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 4px 10px; background: #fff; color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: start; font: inherit; color: inherit; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.3s; overflow: hidden; min-width: 0; }
.card::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--c); transform-origin: top; transition: width 0.3s var(--ease); }
.card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 18px 34px -16px rgba(20, 90, 140, 0.45); background: var(--paper-2); }
.card:hover::before { width: 9px; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code { font-family: var(--f-mono); font-size: 0.78rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 6px; padding: 0 6px; }
.sector-name { font-size: 0.88rem; color: var(--muted); font-weight: 700; }
.sevpill { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 800; padding: 1px 8px 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--sc) 16%, #fff); color: color-mix(in srgb, var(--sc) 70%, #000); white-space: nowrap; }
.sevpill .sev-ic { width: 14px; height: 14px; }
.card h3 { font-size: 1.22rem; line-height: 1.4; color: var(--ink); }
.card .place { font-size: 0.9rem; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.card .place svg { width: 14px; height: 14px; flex: none; margin-top: 4px; fill: none; stroke: currentColor; stroke-width: 2; }
.card .keystat { display: flex; align-items: baseline; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.card .keystat b { font-family: var(--f-display); font-size: 1.55rem; font-weight: 900; color: var(--green); line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .keystat span { font-size: 0.9rem; color: var(--muted); line-height: 1.35; }
.costbar { display: grid; gap: 4px; margin-top: auto; }
.costbar .track { height: 7px; border-radius: 6px; background: rgba(15, 74, 52, 0.08); overflow: hidden; }
.costbar .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green-2), var(--green)); transform-origin: right; }
.card:is(.play, .shown) .costbar .fill { animation: barGrow 1.2s var(--ease) both; animation-delay: calc(var(--d, 0s) + 0.35s); }
.costbar small { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.costbar small b { color: var(--green); font-variant-numeric: tabular-nums; }
/* eight card entrances, assigned in rotation */
.card.c0 { --anim: riseIn; } .card.c1 { --anim: zoomIn; } .card.c2 { --anim: flipIn; } .card.c3 { --anim: slideIn; }
.card.c4 { --anim: cardRotate; } .card.c5 { --anim: skewIn; } .card.c6 { --anim: blurIn; } .card.c7 { --anim: cardDrop; }
@keyframes cardRotate { from { transform: rotate(-6deg) translateY(40px) scale(0.9); opacity: 0; } }
@keyframes cardDrop { from { transform: translateY(-50px); opacity: 0; } 70% { transform: translateY(6px); opacity: 1; } }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--muted); }

/* ───────── drawer (detail sheet) ───────── */
.drawer { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(10, 50, 40, 0.28); opacity: 0; transition: opacity 0.35s; backdrop-filter: blur(2px); }
.drawer-card { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(620px, 100%); background: #f6fbff; box-shadow: -20px 0 50px -20px rgba(10, 60, 90, 0.4); transform: translateX(-104%); transition: transform 0.5s var(--ease); display: flex; flex-direction: column; outline: none; }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-card { transform: none; }
.drawer-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; font-size: 1.6rem; line-height: 1; color: var(--green); cursor: pointer; transition: transform 0.3s var(--ease); }
.drawer-x:hover { transform: rotate(90deg); }
.drawer-body { overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px calc(env(safe-area-inset-bottom, 0px) + 28px); display: grid; gap: 18px; }
.d-hero { display: grid; gap: 8px; padding-inline-end: 44px; }
.d-hero h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); color: var(--ink); }
.drawer.open .d-hero h2 { animation: typeIn 0.9s steps(28) both; }
@keyframes typeIn { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.d-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.92rem; color: var(--muted); }
.d-meta .mono { direction: ltr; }
.d-meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.d-sec { display: grid; gap: 8px; }
.drawer.open .d-sec { animation: riseIn 0.6s var(--ease) both; animation-delay: calc(var(--i) * 80ms + 0.15s); }
.d-sec h4 { margin: 0; font-family: var(--f-display); font-size: 1.1rem; color: var(--green); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.d-sec h4::before { content: ''; width: 16px; height: 3px; border-radius: 3px; background: var(--green-2); }
.d-sec p { line-height: 1.85; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.stat b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 900; color: var(--green); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.9rem; line-height: 1.4; }
.stat a, .stat em { font-size: 0.78rem; font-style: normal; color: var(--muted); }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 800; border-radius: 6px; padding: 0 6px; margin-inline-end: 4px; vertical-align: 1px; }
.tag-src { background: var(--green-3); color: var(--green); }
.tag-est { background: #fff1cf; color: #7a5200; }
.loss { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.loss b { font-family: var(--f-display); font-size: 1.7rem; color: #b5452c; font-weight: 900; font-variant-numeric: tabular-nums; }
.loss span { font-size: 0.9rem; color: var(--muted); }
.fixbox { background: linear-gradient(160deg, #eafbf2, #f4fffa); border: 1.5px solid rgba(16, 163, 111, 0.35); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.boq { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.boq th { text-align: start; font-weight: 800; color: var(--muted); font-size: 0.85rem; border-bottom: 1.5px solid var(--line-2); padding: 4px 6px; }
.boq td { padding: 6px; border-bottom: 1px dashed var(--line); vertical-align: top; line-height: 1.45; }
.boq td:last-child, .boq th:last-child { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 0.86rem; }
.boq tfoot td { font-weight: 800; border-bottom: 0; color: var(--green); font-size: 1rem; }
.capbar { display: grid; gap: 4px; }
.capbar .track { position: relative; height: 12px; border-radius: 8px; background: rgba(15, 74, 52, 0.1); overflow: hidden; }
.capbar .fill { height: 100%; background: linear-gradient(90deg, var(--green-2), var(--green)); border-radius: 8px; transform-origin: right; }
.drawer.open .capbar .fill { animation: barGrow 1.2s var(--ease) 0.5s both; }
.capbar small { font-size: 0.85rem; color: var(--muted); display: flex; justify-content: space-between; }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.d-actions button { font: inherit; font-weight: 800; border-radius: 999px; padding: 8px 18px; cursor: pointer; border: 1.5px solid var(--green); background: var(--green); color: #fff; transition: transform 0.25s var(--ease); }
.d-actions button.ghost { background: #fff; color: var(--green); }
.d-actions button:hover { transform: translateY(-2px); }
.srcs { margin: 0; padding-inline-start: 20px; font-size: 0.9rem; line-height: 1.6; }
.srcs a { word-break: break-word; }

/* ───────── docs / blueprint ───────── */
.docs { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.blueprint { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; background: #174a7c; border: 2px solid #0f3a63; box-shadow: var(--shadow); aspect-ratio: 1.3 / 1; max-width: 100%; }
.blueprint canvas { width: 100%; height: 100%; display: block; }
.bp-title { position: absolute; inset-inline: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid rgba(220, 238, 255, 0.75); background: rgba(23, 74, 124, 0.88); color: #e2f1ff; font-size: 0.82rem; }
.bp-cell { padding: 4px 8px; border-inline-start: 1px solid rgba(220, 238, 255, 0.5); display: grid; line-height: 1.35; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-cell:first-child { border-inline-start: 0; }
.bp-cell i { font-style: normal; font-family: var(--f-mono); font-size: 0.68rem; opacity: 0.7; }
.doclist { display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.3s; transform-style: preserve-3d; }
.doc:hover { transform: perspective(700px) rotateX(4deg) rotateY(-4deg) translateY(-3px); box-shadow: 0 16px 30px -16px rgba(20, 90, 140, 0.5); background: var(--paper-2); }
.doc .ic { width: 46px; height: 56px; border-radius: 6px 14px 6px 6px; background: var(--green); color: #fff; display: grid; place-items: center; font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; position: relative; }
.doc .ic.map { background: #2b6db1; }
.doc .ic.web { background: #6b8f7f; }
.doc b { display: block; font-size: 1.02rem; line-height: 1.4; }
.doc span { font-size: 0.86rem; color: var(--muted); }
.doc small { display: block; direction: ltr; text-align: right; font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── method ───────── */
.method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.method p { font-size: 1rem; line-height: 1.8; }
.method p + p { margin-top: 8px; }
.srcbox { margin-top: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px; }
.srcbox summary { cursor: pointer; font-weight: 800; color: var(--green); font-size: 1.1rem; }
.srclist { margin: 12px 0 0; padding-inline-start: 22px; columns: 2 320px; column-gap: 30px; font-size: 0.9rem; line-height: 1.55; }
.srclist li { break-inside: avoid; margin-bottom: 6px; }
.srclist a { direction: ltr; unicode-bidi: isolate; }

/* ───────── footer ───────── */
.foot { margin-top: clamp(60px, 8vw, 110px); position: relative; color: #e8fff4; }
.wave { display: block; width: 100%; height: 60px; fill: var(--green); }
.wave path { animation: waveMove 9s ease-in-out infinite alternate; }
@keyframes waveMove { to { d: path('M0 30 Q150 60 300 30 T600 30 T900 30 T1200 30 V60 H0Z'); } }
.foot-in { background: var(--green); padding: 10px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 28px); display: grid; gap: 6px; font-size: 1rem; }
.foot-in b { font-family: var(--f-display); font-size: 1.2rem; }
.noscript { padding: 20px; text-align: center; }

/* ───────── responsive ───────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash > :nth-child(n) { grid-column: span 3; }
  .dash > :nth-child(5) { grid-column: span 6; }
  .method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .mapwrap { grid-template-columns: minmax(0, 1fr); }
  .mapside { max-height: none; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .maplist { max-height: 220px; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .dash > :nth-child(n) { grid-column: span 6; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
}
@media (max-width: 600px) {
  body { font-size: 17.5px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:last-child { grid-column: span 2; }
  .method { grid-template-columns: minmax(0, 1fr); }
  .bp-title { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock { grid-template-columns: auto 1fr; }
  .titleblock span:last-child { display: none; }
  .drawer-card { top: auto; height: 88vh; width: 100%; border-radius: 22px 22px 0 0; transform: translateY(104%); }
  .drawer-body { padding-inline: 16px; }
  .maplegend { display: none; }
  .mapside .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .mapside .chip { flex: none; }
  .mapmodes { left: 50px; }
  .mapmodes button { padding: 4px 9px; }
  .leaflet-host { height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .rv.pending { opacity: 1; }
}
