/* SkyFrame — brand system */
:root {
  --bg: #09090a;
  --bg-2: #0f0f11;
  --panel: #141416;
  --panel-2: #1a1a1d;
  --line: rgba(212, 175, 90, 0.18);
  --line-strong: rgba(212, 175, 90, 0.42);
  --gold: #d4af5a;
  --gold-hi: #f1d891;
  --gold-lo: #9c7a2e;
  --gold-grad: linear-gradient(135deg, #f3dc95 0%, #d4af5a 38%, #a9822f 62%, #e9cd7e 100%);
  --text: #ece7db;
  --muted: #8f8a7e;
  --danger: #e0685a;
  --ok: #7fbf8a;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --serif-he: 'Frank Ruhl Libre', 'David Libre', serif;
  --sans-he: 'Heebo', 'Assistant', system-ui, sans-serif;
  --brand: 'Cinzel', 'Trajan Pro', serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans-he);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.textured {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(212, 175, 90, 0.08), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(212, 175, 90, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body.textured::before {
  /* subtle paper grain, echoing the embossed logo */
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
::selection { background: rgba(212, 175, 90, .35); }

.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.brand-word { font-family: var(--brand); letter-spacing: .14em; font-weight: 600; }

/* ------------------------------------------------ header */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 32px;
  background: rgba(9, 9, 10, .82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand .brand-word { font-size: 19px; line-height: 1; }
.brand small { display: block; font-family: var(--sans-he); font-size: 11.5px; letter-spacing: .02em; color: var(--muted); margin-top: 4px; font-weight: 400; }
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.userchip b { color: var(--text); font-weight: 500; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  font-family: var(--brand); color: var(--gold); font-size: 14px;
}

/* ------------------------------------------------ buttons & inputs */
.btn {
  --b: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--b);
  background: transparent; color: var(--text);
  font: 500 14px var(--sans-he);
  cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold-hi); background: rgba(212, 175, 90, .06); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary {
  border: 0; color: #1a1408; font-weight: 600;
  background: var(--gold-grad); background-size: 160% 160%;
  box-shadow: 0 6px 24px rgba(212, 175, 90, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover { background-position: 100% 0; color: #000; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--gold-hi); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(224, 104, 90, .07); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 40px; padding: 0; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px;
  font: 15px var(--sans-he); outline: none; transition: .18s;
}
textarea { height: 96px; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 90, .14); }
input[dir="ltr"] { text-align: left; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: 18px 19px, 23px 19px; background-size: 5px 5px; background-repeat: no-repeat; }

/* ------------------------------------------------ layout */
.container { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 40px 32px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 34px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif-he); font-weight: 500; font-size: 40px; line-height: 1.1; margin: 0; }
.page-head .eyebrow { font-family: var(--brand); letter-spacing: .3em; font-size: 12px; color: var(--gold); margin-bottom: 10px; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.page-head .tools { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); margin: 26px 0; border: 0; }

/* ------------------------------------------------ gallery */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.tile {
  position: relative; display: block; color: var(--text);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .35s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--text); }
.tile .thumb { aspect-ratio: 16 / 10; background: #0c0c0d center / cover no-repeat; position: relative; overflow: hidden; }
.tile .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .75)); }
.tile .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .thumb .ph svg { width: 34%; opacity: .5; }
.tile .badge {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
  font: 600 10.5px var(--brand); letter-spacing: .18em;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(0, 0, 0, .6); border: 1px solid var(--line-strong); color: var(--gold-hi);
  backdrop-filter: blur(6px);
}
.tile .play {
  position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; opacity: 0; transition: .3s;
}
.tile .play span {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 10, 10, .55); border: 1px solid var(--gold); backdrop-filter: blur(6px);
}
.tile:hover .play { opacity: 1; }
.tile .meta { padding: 18px 20px 20px; }
.tile h3 { margin: 0 0 6px; font-family: var(--serif-he); font-weight: 500; font-size: 21px; }
.tile .sub { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.tile .sub span { display: inline-flex; align-items: center; gap: 6px; }
.tile .sub svg { width: 14px; height: 14px; color: var(--gold); }

.empty {
  text-align: center; padding: 90px 20px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty svg { width: 90px; opacity: .6; margin-bottom: 14px; }
.empty h3 { font-family: var(--serif-he); color: var(--text); font-weight: 500; font-size: 24px; margin: 0 0 6px; }

.search { position: relative; }
.search input { width: 280px; padding-inline-start: 40px; }
.search svg { position: absolute; inset-inline-start: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); }

/* ------------------------------------------------ tabs & tables (admin) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.tabs button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: 500 15px var(--sans-he); padding: 14px 20px; position: relative;
}
.tabs button.active { color: var(--gold-hi); }
.tabs button.active::after { content: ''; position: absolute; inset-inline: 14px; bottom: -1px; height: 2px; background: var(--gold-grad); }
.tabs button .count { font-size: 11.5px; margin-inline-start: 6px; padding: 1px 7px; border-radius: 20px; background: rgba(212, 175, 90, .12); color: var(--gold); }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th {
  text-align: start; font-weight: 500; font-size: 12.5px; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 14px; border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; }
table.data tr:hover td { background: rgba(212, 175, 90, .025); }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px solid; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); border-color: rgba(127, 191, 138, .35); }
.pill.warn { color: var(--gold); border-color: var(--line-strong); }
.pill.err { color: var(--danger); border-color: rgba(224, 104, 90, .4); }
.pill.off { color: var(--muted); border-color: rgba(255, 255, 255, .12); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: embed; }

.admin-models { display: grid; gap: 16px; }
.mrow {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 22px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.mrow .thumb { aspect-ratio: 16/10; border-radius: 9px; background: #0c0c0d center/cover; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.05); }
.mrow .thumb svg { width: 46%; opacity: .45; }
.mrow h3 { margin: 0 0 4px; font-family: var(--serif-he); font-weight: 500; font-size: 19px; }
.mrow .sub { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.mrow .msg { font-size: 13px; margin-top: 6px; color: var(--muted); }
.mrow .msg.err { color: var(--danger); }
.mrow .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 380px; }

/* upload progress */
.uploads { margin-top: 10px; display: grid; gap: 8px; }
.up { font-size: 12.5px; color: var(--muted); }
.up .bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 5px; }
.up .bar i { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .3s; }
.up .row { display: flex; gap: 10px; align-items: center; }
.up .row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--muted); cursor: pointer; transition: .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: rgba(212, 175, 90, .05); color: var(--text); }
.dropzone svg { width: 40px; height: 40px; color: var(--gold); margin-bottom: 8px; }
.dropzone b { color: var(--gold-hi); font-weight: 500; }

/* ------------------------------------------------ modal */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: fade .2s;
}
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); animation: rise .25s cubic-bezier(.2,.7,.2,1); }
.modal h2 { font-family: var(--serif-he); font-weight: 500; margin: 0 0 22px; font-size: 26px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-start; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ------------------------------------------------ toast */
#toasts { position: fixed; bottom: 26px; inset-inline-start: 26px; z-index: 200; display: grid; gap: 10px; }
.toast {
  padding: 13px 18px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 14px; animation: rise .25s; max-width: 420px;
}
.toast.err { border-color: rgba(224,104,90,.5); }

/* ------------------------------------------------ login / landing */
.landing { min-height: 100%; display: grid; grid-template-columns: 1.15fr 1fr; position: relative; z-index: 1; }
.landing .hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; border-inline-end: 1px solid var(--line);
  background: radial-gradient(800px 600px at 50% 45%, rgba(212,175,90,.08), transparent 65%);
}
.landing .hero .logo-wrap { flex: 1; display: grid; place-items: center; position: relative; }
.landing .hero .logo-wrap img {
  width: min(520px, 78%); aspect-ratio: 1; object-fit: cover; border-radius: 4px;
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 72%);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.6));
  animation: float 9s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-10px); } }
.landing .hero .grid-lines {
  position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,175,90,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,90,.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 70%);
}
.landing .tagline { position: relative; }
.landing .tagline h2 { font-family: var(--serif-he); font-weight: 400; font-size: 34px; margin: 0 0 10px; line-height: 1.25; }
.landing .tagline p { color: var(--muted); margin: 0; max-width: 520px; }
.landing .features { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.landing .features div { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.landing .features svg { width: 18px; height: 18px; color: var(--gold); }
.landing .login { display: grid; place-items: center; padding: 48px; }
.landing .login .card { width: min(420px, 100%); padding: 40px; }
.landing .login h1 { font-family: var(--serif-he); font-weight: 500; font-size: 32px; margin: 0 0 6px; }
.landing .login .lead { color: var(--muted); margin: 0 0 30px; }
.landing .login .btn.primary { width: 100%; height: 48px; font-size: 15px; margin-top: 8px; }
.landing .login .err { color: var(--danger); font-size: 14px; min-height: 22px; margin-top: 12px; }
.landing .copy { color: var(--muted); font-size: 12px; margin-top: 22px; text-align: center; letter-spacing: .04em; }

@media (max-width: 960px) {
  .landing { grid-template-columns: 1fr; }
  .landing .hero { padding: 28px; border: 0; min-height: 52vh; }
  .landing .tagline h2 { font-size: 26px; }
  .topbar { padding: 12px 16px; }
  .container { padding: 26px 16px 60px; }
  .page-head h1 { font-size: 30px; }
  .search input { width: 100%; }
  .mrow { grid-template-columns: 1fr; }
  .mrow .actions { justify-content: flex-start; max-width: none; }
  .userchip .name { display: none; }
}

/* ------------------------------------------------ viewer */
body.viewer { overflow: hidden; background: #050506; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; outline: none; }
.v-top {
  position: fixed; top: 0; inset-inline: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  background: linear-gradient(180deg, rgba(5,5,6,.92), rgba(5,5,6,0));
  pointer-events: none;
}
.v-top > * { pointer-events: auto; }
.v-title h1 { margin: 0; font-family: var(--serif-he); font-weight: 500; font-size: 22px; line-height: 1.2; text-shadow: 0 2px 12px #000; }
.v-title small { color: var(--muted); font-size: 13px; }
.v-top .brand { margin-inline-start: auto; opacity: .95; }
.glass {
  background: rgba(14, 14, 16, .72); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.v-tools {
  position: fixed; z-index: 20; inset-inline-start: 20px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; padding: 8px;
}
.v-tools button {
  width: 46px; height: 46px; border-radius: 10px; border: 0; background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer; position: relative; transition: .15s;
}
.v-tools button svg { width: 21px; height: 21px; }
.v-tools button:hover { background: rgba(212,175,90,.1); color: var(--gold-hi); }
.v-tools button.on { background: rgba(212,175,90,.16); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--line-strong); }
.v-tools hr { border: 0; height: 1px; background: var(--line); margin: 4px 6px; }
.v-tools button[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; inset-inline-start: 56px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 13px; padding: 6px 10px; border-radius: 7px;
  background: rgba(10,10,12,.92); border: 1px solid var(--line); color: var(--text); pointer-events: none;
}
.v-panel { position: fixed; z-index: 20; inset-inline-end: 20px; bottom: 20px; width: 300px; padding: 18px; font-size: 13.5px; }
.v-panel h4 { margin: 0 0 10px; font-family: var(--brand); letter-spacing: .2em; font-size: 11px; color: var(--gold); font-weight: 600; }
.v-panel .kv { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); }
.v-panel .kv b { color: var(--text); font-weight: 500; }
.v-panel p { margin: 0 0 10px; color: var(--muted); }
.v-panel input[type=range] { height: auto; padding: 0; accent-color: var(--gold); background: none; border: 0; box-shadow: none; }
.v-measure { position: fixed; z-index: 20; top: 86px; left: 50%; transform: translateX(-50%); padding: 10px 18px; font-size: 14px; display: none; }
.v-measure b { color: var(--gold-hi); font-family: var(--brand); letter-spacing: .05em; }
.v-help { position: fixed; z-index: 20; bottom: 20px; inset-inline-start: 20px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); display: flex; gap: 18px; }
.v-help b { color: var(--text); font-weight: 500; }

.loader {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #050506; transition: opacity .6s;
}
.loader.hide { opacity: 0; pointer-events: none; }
.loader .in { text-align: center; }
.loader svg.mark { width: 110px; height: 110px; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.97); } }
.loader .t { margin-top: 18px; font-family: var(--brand); letter-spacing: .4em; font-size: 12px; color: var(--gold); }
.loader .p { margin-top: 14px; width: 240px; height: 2px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.loader .p i { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .25s; }
.loader .s { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 20px; }

/* Cesium overrides */
.v-credits { position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%); z-index: 15; font-size: 10.5px; color: rgba(255,255,255,.45); direction: ltr; white-space: nowrap; }
.v-credits a { color: rgba(255,255,255,.55); }
.v-credits img { height: 14px; vertical-align: middle; }
.v-credits .cesium-credit-lightbox-overlay { display: none; }

/* ================================================================ map */
.mapview .m-top {
  position: fixed; z-index: 25; top: 14px; inset-inline: 14px;
  display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 16px;
}
.m-top .brand svg { width: 34px; height: 34px; }
.m-top .brand .brand-word { font-size: 15px; }
.m-title { display: flex; flex-direction: column; line-height: 1.15; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.m-title small { color: var(--muted); font-size: 11.5px; }
.m-title b { font-family: var(--serif-he); font-weight: 500; font-size: 19px; }
.m-top select { width: auto; height: 36px; font-size: 13.5px; padding-inline: 12px 34px; }
.m-top .spacer { flex: 1; }
.m-search { position: relative; }
.m-search svg { position: absolute; inset-inline-start: 12px; top: 10px; width: 17px; height: 17px; color: var(--muted); }
.m-search input { width: 360px; height: 38px; padding-inline-start: 38px; font-size: 13.5px; background: rgba(0,0,0,.35); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); font: 600 12.5px var(--brand); letter-spacing: .1em; padding: 0 14px; height: 36px; cursor: pointer; }
.seg button.on { background: var(--gold-grad); color: #1a1408; }

.m-layers {
  position: fixed; z-index: 22; top: 84px; inset-inline-start: 14px; width: 330px; max-height: calc(100vh - 150px);
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; transition: max-height .3s;
}
.m-layers.min { max-height: 52px; }
.m-layers.min #collapse svg { transform: rotate(180deg); }
.m-layers-head { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.m-layers-head h3 { margin: 0; flex: 1; font: 600 12px var(--brand); letter-spacing: .28em; color: var(--gold); }
.m-layers-body { overflow-y: auto; padding: 6px 0 10px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.grp-h { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); font: 500 13.5px var(--sans-he); padding: 10px 16px; cursor: pointer; }
.grp-h svg { width: 14px; height: 14px; color: var(--gold); transition: transform .2s; transform: rotate(90deg); }
.grp.open .grp-h svg { transform: none; }
.grp-h span { margin-inline-start: auto; font-size: 11px; color: var(--gold); background: rgba(212,175,90,.12); border-radius: 20px; padding: 0 8px; }
.grp-b { display: none; padding: 0 8px 6px; }
.grp.open .grp-b { display: block; }
.li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 10px; transition: background .15s; }
.li:hover { background: rgba(212,175,90,.05); }
.li.on { background: rgba(212,175,90,.07); }
.li-main { flex: 1; min-width: 0; }
.li-name { font-size: 13.5px; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.li .op { height: auto; padding: 0; margin-top: 8px; accent-color: var(--gold); background: none; border: 0; box-shadow: none; }
.li-act { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.li:hover .li-act { opacity: 1; }
.ib { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--text); border-radius: 7px; cursor: pointer; }
.ib:hover { background: rgba(212,175,90,.14); color: var(--gold-hi); }
.ib svg { width: 16px; height: 16px; }
.sw { width: 11px; height: 11px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5); display: inline-block; }
.legend { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; font-size: 11px; color: var(--muted); }
.legend i { grid-column: 1 / -1; height: 7px; border-radius: 4px; margin-bottom: 4px; }
.legend span:last-child { text-align: end; }
.chk { position: relative; flex: none; margin-top: 2px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk span { display: block; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); transition: .15s; }
.chk input:checked + span { background: var(--gold-grad); border-color: transparent; }
.chk input:checked + span::after { content: ''; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid #1a1408; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 6px; }
.chip { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 20px; padding: 5px 12px; font: 12.5px var(--sans-he); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { color: #1a1408; background: var(--gold-grad); border-color: transparent; font-weight: 500; }
.li-empty { text-align: center; padding: 20px 24px 10px; color: var(--muted); font-size: 13px; }
.li-empty svg { width: 56px; opacity: .5; }

.m-tools { top: auto; bottom: 64px; transform: none; inset-inline-start: auto; inset-inline-end: 14px; }
.m-tools button[data-tip]:hover::after { inset-inline-start: auto; inset-inline-end: 56px; }

.m-status {
  position: fixed; z-index: 22; bottom: 14px; inset-inline: 14px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; gap: 22px; padding: 0 16px; font-size: 12.5px; color: var(--muted);
}
.m-status .mono { font-size: 12px; color: var(--text); }
.m-status .scale { display: inline-flex; align-items: center; gap: 8px; direction: ltr; }
.m-status .scale i { display: block; height: 7px; border: 2px solid var(--gold); border-top: 0; min-width: 20px; transition: width .2s; }
.m-status .scale b { color: var(--text); font-weight: 500; direction: rtl; }
.m-status #cH { margin-inline-start: auto; }
.mapview .v-credits { bottom: 56px; }

.m-popup {
  position: fixed; z-index: 30; width: 320px; max-height: 60vh; overflow: auto; padding: 16px 18px; font-size: 13px;
  animation: rise .18s;
}
.m-popup h4 { margin: 0 0 10px; font: 500 15px var(--serif-he); display: flex; align-items: center; gap: 8px; padding-inline-end: 24px; }
.m-popup table { width: 100%; border-collapse: collapse; }
.m-popup th { text-align: start; color: var(--muted); font-weight: 400; padding: 5px 0; width: 42%; vertical-align: top; }
.m-popup td { padding: 5px 0; word-break: break-word; }
.m-popup tr + tr th, .m-popup tr + tr td { border-top: 1px solid rgba(255,255,255,.05); }
.m-popup hr { border: 0; height: 1px; background: var(--line); margin: 12px 0; }
.m-popup .kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--muted); }
.m-popup .kv b { color: var(--text); font-weight: 500; }
.m-popup .x { position: absolute; top: 10px; inset-inline-end: 10px; width: 26px; height: 26px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 6px; }
.m-popup .x:hover { color: var(--gold-hi); background: rgba(212,175,90,.1); }

.m-swipe { position: fixed; z-index: 21; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--gold-grad); cursor: ew-resize; box-shadow: 0 0 18px rgba(0,0,0,.6); }
.m-swipe::before { content: ''; position: absolute; inset: 0 -12px; }
.m-swipe-handle { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #111; border: 2px solid var(--gold); display: grid; place-items: center; color: var(--gold-hi); }
.m-swipe-handle svg { width: 20px; height: 20px; }
.m-compare { position: fixed; z-index: 24; top: 84px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 12.5px; color: var(--muted); direction: ltr; }
.m-compare label { display: flex; align-items: center; gap: 8px; direction: rtl; }
.m-compare select { width: 210px; height: 34px; font-size: 13px; }
.m-compare .vs { color: var(--gold); font-size: 18px; }

@media (max-width: 960px) {
  .m-search, .m-title, #orgSel { display: none; }
  .m-layers { width: calc(100% - 28px); max-height: 45vh; }
  .m-status #cWgs, .m-status #cH { display: none; }
  .m-compare select { width: 130px; }
}

/* ================================================================ portal / admin extras */
.map-hero {
  position: relative; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 260px; margin-bottom: 40px;
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line-strong); color: var(--text);
  background: #0c0c0d; transition: border-color .3s, box-shadow .3s;
}
.map-hero:hover { border-color: var(--gold); box-shadow: var(--shadow); color: var(--text); }
.map-hero .art { position: relative; background: #0d0d0e center / cover; }
.map-hero .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(270deg, transparent 40%, #0c0c0d 100%); }
html[dir=rtl] .map-hero .art::after { background: linear-gradient(90deg, transparent 40%, #0c0c0d 100%); }
.map-hero .art .tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); filter: saturate(1.05); transform: scale(1.04); transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.map-hero:hover .art .tiles { transform: scale(1.1); }
.map-hero .art .tiles img { width: 100%; height: 100%; object-fit: cover; }
.map-hero .art .grid-lines { position: absolute; inset: 0; z-index: 1; background-image: linear-gradient(rgba(212,175,90,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(212,175,90,.12) 1px, transparent 1px); background-size: 48px 48px; }
.map-hero .txt { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; gap: 10px; z-index: 1; }
.map-hero .txt .eyebrow { font: 600 11px var(--brand); letter-spacing: .32em; color: var(--gold); }
.map-hero .txt h2 { margin: 0; font: 500 34px/1.15 var(--serif-he); }
.map-hero .txt p { margin: 0; color: var(--muted); }
.map-hero .stats { display: flex; gap: 26px; margin: 10px 0 16px; }
.map-hero .stats div { display: flex; flex-direction: column; }
.map-hero .stats b { font: 600 26px var(--brand); }
.map-hero .stats span { font-size: 12px; color: var(--muted); }
.map-hero .btn { align-self: flex-start; }
.section-title { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; }
.section-title h2 { margin: 0; font: 500 26px var(--serif-he); }
.section-title span { color: var(--muted); font-size: 14px; }

.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 34px; }
.stat-card { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
.stat-card span { display: block; color: var(--muted); font-size: 12.5px; }
.stat-card b { display: block; font: 600 28px var(--brand); margin-top: 6px; }
.notice { padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(224,104,90,.4); background: rgba(224,104,90,.06); margin-bottom: 24px; font-size: 14px; }
.type-badge { font: 500 11.5px var(--sans-he); letter-spacing: 0; padding: 3px 9px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--gold-hi); }
.progress { height: 5px; border-radius: 5px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 8px; max-width: 420px; }
.progress i { display: block; height: 100%; background: var(--gold-grad); transition: width .5s; }
input[type=color] { width: 56px; height: 44px; padding: 4px; cursor: pointer; }
@media (max-width: 960px) {
  .map-hero { grid-template-columns: 1fr; }
  .map-hero .art { min-height: 160px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
