:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --border: #dde3e0;
  --text: #17211e;
  --muted: #5d6b66;
  --faint: #8a9692;
  --brand: #1f4e46;
  --brand-2: #2f7a6c;
  --brand-soft: #e2efeb;
  --accent: #b8893b;
  --shadow: 0 1px 2px rgba(16, 32, 28, .05), 0 4px 14px rgba(16, 32, 28, .06);
  --st-concept: #7c5cc4; --st-offplan: #2f78c4; --st-uc: #d3962a; --st-done: #2e9a5b; --st-sold: #8b9590; --st-na: #c4ccc8;
  --radius: 12px;
  --sea: #dfe9ec;
  --land: #f3f1ea;
  --land-edge: #b9c4bf;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --surface: #161e1b; --surface-2: #1d2824; --border: #2a3632; --text: #e6ece9;
    --muted: #a0aea9; --faint: #74827d; --brand: #6cc3ad; --brand-2: #8fd6c3; --brand-soft: #1d3530;
    --accent: #d9ad62; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --st-na: #46524e; --st-sold: #75817c; --sea: #0d1a1f; --land: #1d2622; --land-edge: #3b4a45; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --surface: #161e1b; --surface-2: #1d2824; --border: #2a3632; --text: #e6ece9;
  --muted: #a0aea9; --faint: #74827d; --brand: #6cc3ad; --brand-2: #8fd6c3; --brand-soft: #1d3530;
  --accent: #d9ad62; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --st-na: #46524e; --st-sold: #75817c; --sea: #0d1a1f; --land: #1d2622; --land-edge: #3b4a45; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1100; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--surface); display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15.5px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 2px; margin-inline-start: auto; background: var(--surface-2); padding: 4px; border-radius: 11px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.lang-btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: var(--surface); font-weight: 600; cursor: pointer; }

main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card h2 { font-size: 15px; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 a { font-size: 13px; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s; text-align: start; font: inherit; color: inherit; }
.kpi:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }

.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.stackbar span { display: block; height: 100%; cursor: pointer; }
.stackbar span:hover { filter: brightness(1.1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; }
.legend button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend button:hover { color: var(--text); }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 36px; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 7px; cursor: pointer; background: none; border: 0; text-align: start; width: 100%; font-size: 13.5px; }
.bar-row:hover { background: var(--surface-2); }
.bar-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand-2); border-radius: 4px; }
.bar-row .n { font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; min-width: 200px; }
.search input { width: 100%; height: 40px; border: 1px solid var(--border); background: var(--bg); border-radius: 9px; padding: 0 38px 0 12px; font: inherit; color: var(--text); }
[dir="ltr"] .search input { padding: 0 12px 0 38px; }
.search svg { position: absolute; top: 11px; inset-inline-start: 12px; color: var(--faint); pointer-events: none; }
[dir="rtl"] .search input { padding: 0 38px 0 12px; }
select, .chk { height: 40px; border: 1px solid var(--border); background: var(--bg); border-radius: 9px; padding: 0 10px; font: inherit; color: var(--text); font-size: 14px; max-width: 220px; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.btn { height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--brand-2); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.btn-primary:hover { color: var(--surface); filter: brightness(1.08); }
.count-line { color: var(--muted); font-size: 13.5px; margin: -4px 2px 12px; }

/* ---------- developer cards ---------- */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dev-card { padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-align: start; font: inherit; color: inherit; transition: border-color .15s; }
.dev-card:hover { border-color: var(--brand-2); }
.dev-card .top { display: flex; gap: 12px; align-items: flex-start; }
.avatar { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.dev-card h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.dev-card .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.gold { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.chip.warn { background: color-mix(in srgb, var(--st-uc) 16%, transparent); color: var(--st-uc); }
.mini-stages { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.dev-card .foot-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.contact-icons { display: flex; gap: 6px; }
.contact-icons span { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.contact-icons span.on { color: var(--brand); background: var(--brand-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
th .arr { opacity: .6; font-size: 10px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
td .pname { font-weight: 600; }
td .small { font-size: 12px; color: var(--muted); }
.stage { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.stage i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pager { display: flex; justify-content: center; gap: 8px; align-items: center; padding: 14px; color: var(--muted); font-size: 13.5px; }
.pager button { height: 34px; min-width: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- companies ---------- */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.co-card { padding: 16px; cursor: pointer; text-align: start; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.co-card:hover { border-color: var(--brand-2); }
.co-card h3 { margin: 0; font-size: 15px; }
.co-stats { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.co-stats b { color: var(--text); font-size: 18px; display: block; font-variant-numeric: tabular-nums; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 200px); min-height: 560px; }
.map-side { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.map-filters { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.map-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-selects select { max-width: none; width: 100%; height: 36px; font-size: 13px; }
.map-box { position: relative; overflow: hidden; min-width: 0; }
#map, .mini-map { width: 100%; height: 100%; border-radius: var(--radius); }
.mini-map { height: 330px; overflow: hidden; }
.map-tools { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1001; }
.map-legend { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 1001; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100% - 20px); background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: 11.5px; color: var(--muted); }
.map-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.map-note { position: absolute; top: 56px; inset-inline-end: 12px; z-index: 1001; max-width: 300px; background: var(--surface); border: 1px solid var(--st-uc); color: var(--text); border-radius: 9px; padding: 8px 12px; font-size: 12.5px; box-shadow: var(--shadow); }
.map-chip { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow); }
.seg-solid { margin: 0; background: var(--surface); padding: 3px; border-radius: 999px; border: 1px solid var(--border); box-shadow: var(--shadow); gap: 2px; flex-wrap: nowrap; }
.seg-solid button { border: 0; background: none; }
.seg-solid button.on { background: var(--brand); color: var(--surface); }
.side-h { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.city-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; width: 100%; background: none; border: 0; text-align: start; font: inherit; color: inherit; }
.city-item:hover, .city-item:focus-visible { background: var(--surface-2); }
.city-item .ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.city-item .n { font-weight: 600; font-variant-numeric: tabular-nums; }
.city-h { font-size: 21px; margin: 6px 0 2px; }
.back-btn { align-self: flex-start; background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 13.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.seg button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* city markers (Leaflet) */
.dn-wrap { background: none; border: 0; }
.dn { border-radius: 50%; display: grid; place-items: center; position: relative; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); transition: transform .15s; }
.dn::after { content: ""; position: absolute; inset: 21%; border-radius: 50%; background: var(--surface); }
.dn span { position: relative; z-index: 1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.dn-wrap:hover .dn { transform: scale(1.08); }
.dn-wrap.sel .dn { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--brand); }
.dn-lbl { position: absolute; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text); pointer-events: none; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface); }
.lp-s { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; }
.lp-n { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; }
.lp-e { left: 100%; top: 50%; transform: translateY(-50%); margin-left: 4px; }
.lp-w { right: 100%; top: 50%; transform: translateY(-50%); margin-right: 4px; }

/* built-in SVG map */
.sv-wrap { position: relative; width: 100%; height: 100%; }
.sv { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; border-radius: var(--radius); }
.sv-wrap.mini .sv { cursor: default; }
.sv-wrap.narrow .sv-lbl.minor { display: none; }
.sv-sea { fill: var(--sea); }
.sv-land { fill: var(--land); stroke: var(--land-edge); stroke-width: 1.2; stroke-linejoin: round; }
.sv-m { cursor: pointer; outline: none; }
.sv-hit { fill: var(--surface); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.sv-hole { fill: var(--surface); }
.sv-ring { fill: none; stroke: var(--brand); stroke-width: 3; opacity: 0; }
.sv-m.sel .sv-ring, .sv-m:focus-visible .sv-ring { opacity: 1; }
.sv-m:hover .sv-hit { stroke: var(--brand); stroke-width: 1.5; }
.sv-n { fill: var(--text); font-weight: 700; text-anchor: middle; font-family: inherit; pointer-events: none; }
.sv-lbl { fill: var(--text); font-size: 12.5px; font-weight: 600; font-family: inherit; paint-order: stroke; stroke: var(--land); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.sv-ctl { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; box-shadow: var(--shadow); z-index: 2; }
.sv-ctl button { width: 32px; height: 32px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 17px; font-weight: 600; color: var(--text); }
.sv-ctl button:last-child { border-bottom: 0; }
.sv-ctl button:hover { background: var(--surface-2); }

/* Leaflet essentials, inlined so the map has no external stylesheet dependency */
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-zoom-box, .leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-container { overflow: hidden; -webkit-tap-highlight-color: transparent; outline: 0; direction: ltr; font-family: inherit; background: var(--sea); }
.leaflet-tile, .leaflet-marker-icon { user-select: none; -webkit-user-drag: none; }
.leaflet-container img.leaflet-tile, .leaflet-container .leaflet-marker-icon { max-width: none !important; max-height: none !important; }
.leaflet-tile { filter: inherit; visibility: hidden; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-pane { z-index: 400; } .leaflet-tile-pane { z-index: 200; } .leaflet-overlay-pane { z-index: 400; } .leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; } .leaflet-tooltip-pane { z-index: 650; } .leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; } .leaflet-map-pane svg { z-index: 200; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition: transform .25s cubic-bezier(0, 0, .25, 1); }
.leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile { transition: none; }
.leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; }
.leaflet-interactive { cursor: pointer; }
.leaflet-grab { cursor: grab; } .leaflet-dragging .leaflet-grab, .leaflet-dragging .leaflet-marker-draggable { cursor: move; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; } .leaflet-right { right: 0; } .leaflet-bottom { bottom: 0; } .leaflet-left { left: 0; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; float: left; clear: both; }
.leaflet-right .leaflet-control { float: right; margin-right: 10px; } .leaflet-left .leaflet-control { margin-left: 12px; }
.leaflet-top .leaflet-control { margin-top: 12px; } .leaflet-bottom .leaflet-control { margin-bottom: 0; }
.leaflet-bar { box-shadow: var(--shadow); border-radius: 9px; border: 1px solid var(--border); overflow: hidden; }
.leaflet-bar a { background: var(--surface); color: var(--text); width: 32px; height: 32px; display: block; text-align: center; text-decoration: none !important; font: 600 17px/32px system-ui, sans-serif; border-bottom: 1px solid var(--border); }
.leaflet-bar a:last-child { border-bottom: 0; } .leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-bar a.leaflet-disabled { color: var(--faint); cursor: default; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent); margin: 0 !important; padding: 0 6px; font-size: 10.5px; color: var(--muted); border-radius: 6px 0 0 0; }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-tooltip { position: absolute; padding: 3px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); white-space: nowrap; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); font-size: 12px; }

/* ---------- global search ---------- */
.search-btn { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.search-btn:hover { border-color: var(--faint); color: var(--text); }
.search-btn kbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; background: var(--surface-2); }
.palette { position: fixed; inset: 0; z-index: 1300; }
.palette-scrim { position: absolute; inset: 0; background: rgba(8, 16, 14, .4); }
.palette-box { position: relative; width: min(640px, calc(100% - 32px)); margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.palette-input { flex: none; padding: 12px; border-bottom: 1px solid var(--border); }
.palette-input svg { top: 24px; inset-inline-start: 24px; }
.palette-input input { height: 44px; font-size: 16px; }
.pres { overflow-y: auto; padding: 6px; }
.pres-group { font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px 4px; }
.pres-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 9px; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.pres-item .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.pres-item .li-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pres-item .li-main b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-item .li-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-item.active, .pres-item:hover { background: var(--surface-2); }
.phint { flex: none; border-top: 1px solid var(--border); padding: 8px 14px; font-size: 12px; color: var(--faint); }

/* ---------- copy + toast ---------- */
.contact-wrap { position: relative; min-width: 0; display: flex; }
.contact-wrap .contact { flex: 1; }
.contact-wrap.has-copy .contact { padding-inline-end: 46px; }
.copy-btn { position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.copy-btn:hover { color: var(--brand); border-color: var(--brand-2); }
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--surface); padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1400; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.h-links { display: inline-flex; gap: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(8, 16, 14, .38); opacity: 0; transition: opacity .2s; }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(640px, 100%); background: var(--surface); box-shadow: -10px 0 40px rgba(0,0,0,.18); overflow-y: auto; transform: translateX(var(--drawer-off, 100%)); transition: transform .25s ease; padding: 28px 28px 40px; }
[dir="rtl"] .drawer-panel { --drawer-off: -100%; }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-close { position: sticky; top: 0; float: inline-end; margin: -10px -10px 0 0; z-index: 2; }
[dir="rtl"] .drawer-close { margin: -10px 0 0 -10px; }
.d-kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--brand-2); text-transform: uppercase; margin-bottom: 4px; }
.d-title { font-size: 22px; margin: 0; line-height: 1.35; padding-inline-end: 40px; }
.d-sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.d-section { margin-top: 22px; }
.d-section h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .03em; display: flex; justify-content: space-between; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none !important; min-width: 0; }
a.contact:hover { border-color: var(--brand-2); background: var(--surface-2); }
.contact .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.contact .tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.contact .tx small { color: var(--muted); font-size: 11.5px; }
.contact .tx span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.list-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: start; width: 100%; font: inherit; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .li-main { min-width: 0; }
.list-item .li-main b { font-weight: 600; font-size: 14px; display: block; }
.list-item .li-main small { color: var(--muted); font-size: 12.5px; }
.prose { font-size: 14px; line-height: 1.8; margin: 0; }
.prose + .prose { margin-top: 8px; }
.note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

.foot { border-top: 1px solid var(--border); background: var(--surface); }
.foot-inner { max-width: 1320px; margin: 0 auto; padding: 16px 20px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .top-actions { margin-inline-start: auto; }
  main { padding: 18px 16px 32px; }
  .map-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .map-box { height: 62vh; min-height: 380px; order: -1; }
  .map-side { max-height: none; overflow: visible; }
  .search-btn .sb-label, .search-btn kbd { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .contact-grid { grid-template-columns: 1fr; }
  .drawer-panel { padding: 22px 16px 32px; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand { flex: 1; min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
  .top-actions { gap: 6px; }
  .brand-text small { display: none; }
  .dev-grid, .co-grid { grid-template-columns: 1fr; }
  select, .chk { max-width: none; flex: 1 1 45%; }
}
