/* Israel Drone Map. Colors, type, spacing and shapes follow the "Israel Drone Map" design system (direction A · Ink). */
:root {
  color-scheme: light;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EEF1F5;
  --line: #E3E7ED;
  --line-strong: #808A99;
  --ink: #0E1726;
  --ink-2: #5F6B7A;
  --primary: #0E1726;
  --primary-hover: #22304A;
  --on-primary: #FFFFFF;
  --accent: #2563EB;
  --accent-tint: #E7EEFD;
  --focus: var(--accent);
  --allowed: #12804A; --allowed-tint: #E8F6EE; --allowed-ink: #0E6B3C;
  --conditional: #F4B740; --conditional-tint: #FEF4DC; --conditional-ink: #7A5200;
  --approval: #C2410C; --approval-tint: #FDEBDD; --approval-ink: #9A3412;
  --prohibited: #C9213A; --prohibited-tint: #FDE7EA; --prohibited-ink: #A61B2E;
  --unknown: #5F6B7A; --unknown-tint: #EEF1F5; --unknown-ink: #4A5563;
  --notam: #6D28D9; --notam-tint: #F1EAFE;
  --on-status: #FFFFFF;
  --on-conditional: #2A1D00;
  --map-land: #EEF1F4;
  --shadow-1: 0 1px 2px rgba(14,23,38,.06), 0 2px 8px rgba(14,23,38,.06);
  --shadow-2: 0 6px 24px rgba(14,23,38,.12);
  --shadow-3: 0 -8px 32px rgba(14,23,38,.14);
  --scrim: rgba(11,16,24,.55);

  --radius-xs: 6px; --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 28px; --radius-pill: 999px;
  --tap-target: 44px;
  --control: 40px;
  --panel-w: 400px;
  --font-sans: "Rubik", "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
}
/* Dark theme: follows the system unless the visitor picked a theme (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1018; --surface: #141B26; --surface-2: #1E2734; --line: #2A3443; --line-strong: #5E6A7B;
    --ink: #E8EDF4; --ink-2: #9AA6B5; --primary: #E8EDF4; --primary-hover: #FFFFFF; --on-primary: #0E1726;
    --accent: #6EA0FF; --accent-tint: #16244A;
    --allowed: #3FBF7A; --allowed-tint: #0F2A1E; --allowed-ink: #6FD6A0;
    --conditional-tint: #2E2410; --conditional-ink: #F2C766;
    --approval: #F08A4B; --approval-tint: #33190D; --approval-ink: #F7A673;
    --prohibited: #F0627A; --prohibited-tint: #36121A; --prohibited-ink: #F68C9D;
    --unknown: #8D99A8; --unknown-tint: #1E2734; --unknown-ink: #B4BECB;
    --notam: #A98BFA; --notam-tint: #241A40;
    --on-status: #0B1018; --map-land: #1A212C;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 6px 24px rgba(0,0,0,.5); --shadow-3: 0 -8px 32px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1018; --surface: #141B26; --surface-2: #1E2734; --line: #2A3443; --line-strong: #5E6A7B;
  --ink: #E8EDF4; --ink-2: #9AA6B5; --primary: #E8EDF4; --primary-hover: #FFFFFF; --on-primary: #0E1726;
  --accent: #6EA0FF; --accent-tint: #16244A;
  --allowed: #3FBF7A; --allowed-tint: #0F2A1E; --allowed-ink: #6FD6A0;
  --conditional-tint: #2E2410; --conditional-ink: #F2C766;
  --approval: #F08A4B; --approval-tint: #33190D; --approval-ink: #F7A673;
  --prohibited: #F0627A; --prohibited-tint: #36121A; --prohibited-ink: #F68C9D;
  --unknown: #8D99A8; --unknown-tint: #1E2734; --unknown-ink: #B4BECB;
  --notam: #A98BFA; --notam-tint: #241A40;
  --on-status: #0B1018; --map-land: #1A212C;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 6px 24px rgba(0,0,0,.5); --shadow-3: 0 -8px 32px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* icons */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.small .ico, .ico.xs { width: 14px; height: 14px; vertical-align: -2px; }

/* buttons */
button {
  min-height: 32px; border: 0; border-radius: var(--radius-pill); padding: 0 14px; cursor: pointer;
  background: var(--surface-2); color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color .12s, transform .08s;
}
button:active { transform: scale(.98); }
@media (hover: hover) { button:hover { background: var(--line); } }

/* ---------- top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-end; justify-content: space-between;
  padding: 10px 16px 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; align-self: center; }
.logo { width: 34px; height: 42px; flex: none; }
.logo-tile { fill: var(--primary); }
.logo-drone { fill: none; stroke: var(--on-primary); stroke-width: 2.23; stroke-linecap: round; }
.logo-hub { fill: #2563EB; stroke: var(--on-primary); stroke-width: 2; }
.brand-text { min-width: 0; }
.brand h1 { margin: 0; font-size: 1.2rem; line-height: 1.25; font-weight: 600; letter-spacing: -.005em; }
.brand p { margin: 1px 0 0; font-size: .8rem; color: var(--ink-2); }

.controls { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.controls label { display: flex; flex-direction: column; font-size: .72rem; gap: 3px; color: var(--ink-2); font-weight: 500; }
.controls input, .controls select {
  height: var(--control); padding: 0 12px; border-radius: 12px; border: 0; min-width: 0; color: var(--ink);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: .9rem; font-variant-numeric: tabular-nums;
}
.controls input:focus, .controls select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.controls input[type=number] { width: 7.5em; }
.controls select { max-width: 24em; padding-inline-end: 28px; }
.controls .row { display: flex; gap: 6px; }
.controls .buttons { display: flex; gap: 6px; }
.controls button { height: var(--control); padding: 0 14px; font-size: .88rem; }
.lang { font-weight: 600; min-width: var(--control); }
.lang .ic { display: none; }
.settings-btn { display: none; }
.theme-btn { width: var(--control); padding: 0 !important; }
.theme-btn .t-light { display: none; }
:root[data-theme="dark"] .theme-btn .t-dark { display: none; }
:root[data-theme="dark"] .theme-btn .t-light { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .t-dark { display: none; }
  :root:not([data-theme="light"]) .theme-btn .t-light { display: inline-flex; }
}
button.done { background: var(--allowed-tint); color: var(--allowed-ink); }
.banners-toggle { display: none; }

/* ---------- notices ---------- */
.banners { position: relative; z-index: 1; }
.banners:empty { display: none; }
.banner { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px; font-size: .84rem; line-height: 1.45; border-bottom: 1px solid var(--line); }
.banner > .ico { margin-top: 1px; }
.banner.warning { background: var(--conditional-tint); color: var(--conditional-ink); }
.banner.error { background: var(--prohibited-tint); color: var(--prohibited-ink); }
.banner.info { background: var(--accent-tint); color: var(--ink); }
.banner.info > .ico { color: var(--accent); }
.banner a { color: inherit; }
.banner .b-text { flex: 1; min-width: 0; }

/* ---------- layout ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.map-wrap { flex: 1; min-height: 300px; position: relative; display: flex; }
#map { flex: 1; min-height: 0; position: relative; z-index: 0; background: var(--map-land); }

/* ---------- place search (floats over the map) ---------- */
.search { position: absolute; top: 12px; right: 12px; z-index: 5; width: min(360px, calc(100% - 84px)); margin: 0; }
.search-box {
  height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; padding-inline: 14px 6px;
  background: var(--surface); color: var(--ink-2); border-radius: var(--radius-pill); box-shadow: var(--shadow-2);
}
.search-box:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .92rem; padding: 0;
}
.search-box input::placeholder { color: var(--ink-2); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--ink-2); flex: none; }
.search-clear[hidden] { display: none; }
.search-list {
  list-style: none; margin: 8px 0 0; padding: 6px; background: var(--surface); color: var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); max-height: min(60vh, 420px); overflow-y: auto;
}
.search-list[hidden] { display: none; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 44px; border-radius: var(--radius-sm); cursor: pointer; }
.search-item.active, .search-item:hover { background: var(--surface-2); }
.search-item .s-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.search-item.active .s-ic, .search-item:hover .s-ic { background: var(--surface); }
.search-item .s-ic .ico { width: 16px; height: 16px; }
.search-item .s-text { display: flex; flex-direction: column; min-width: 0; }
.search-item .s-title { font-weight: 500; font-size: .9rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item .s-sub { font-size: .75rem; color: var(--ink-2); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-more { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; }
.search-more .s-ic { background: var(--accent-tint); color: var(--accent); }
.search-note { padding: 10px 12px; font-size: .82rem; color: var(--ink-2); }
.search-note.small { font-size: .72rem; padding: 6px 12px 4px; }
.map-fabs { display: none; }

/* "Made with love" line at the bottom edge of the map */
.map-credit {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1; margin: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; max-width: calc(100% - 24px);
  padding: 4px 12px; border-radius: var(--radius-pill); font-size: .74rem; font-weight: 500; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow-1);
}
.map-credit .heart { width: 14px; height: 14px; fill: #E5484D; flex: none; }
.map-credit .mc-lead { display: inline-flex; align-items: center; gap: 3px; }
.panel {
  width: var(--panel-w); max-width: 100%; overflow-y: auto; background: var(--bg); border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.tabs {
  display: flex; gap: 2px; position: sticky; top: 0; z-index: 2; background: var(--surface);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1; min-width: 0; height: 36px; padding: 0 4px; font-size: .84rem; font-weight: 500; color: var(--ink-2); background: transparent; white-space: nowrap;
}
.tabs button.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
@media (hover: hover) { .tabs button:not(.active):hover { background: var(--surface-2); color: var(--ink); } }
.tab { display: none; padding: 16px; font-size: .9rem; line-height: 1.5; }
.tab.active { display: block; }
.tab h3 { font-size: .98rem; font-weight: 600; margin: 22px 0 8px; }
.tab h3:first-child { margin-top: 0; }
.tab ol { padding-inline-start: 22px; }
.tab li { margin: 4px 0; }
.muted { color: var(--ink-2); }
.small { font-size: .8rem; }
.tab p.contact { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.not-permission { margin: auto 0 0; padding: 10px 16px; font-size: .76rem; line-height: 1.4; text-align: center; background: var(--surface); color: var(--ink-2); border-top: 1px solid var(--line); }
details summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
details summary::marker { color: var(--ink-2); }
ul.plain { padding-inline-start: 18px; margin: 4px 0; }

/* ---------- verdict ---------- */
.verdict { border-radius: var(--radius-lg); padding: 14px 16px 16px; color: var(--on-status); margin-bottom: 10px; }
.verdict .v-title { display: flex; align-items: flex-start; gap: 10px; font-size: 1.12rem; line-height: 1.35; font-weight: 700; }
.verdict .v-title .v-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.2); margin-top: -2px; }
.verdict .v-title .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.verdict .v-heights { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.verdict .v-heights > div { flex: 1 1 0; min-width: 120px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,.16); font-size: .74rem; line-height: 1.3; }
.verdict .v-heights b { display: block; font-size: 1.2rem; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.verdict.allowed { background: var(--allowed); }
.verdict.prohibited { background: var(--prohibited); }
.verdict.approval { background: var(--approval); }
.verdict.conditional { background: var(--conditional); color: var(--on-conditional); }
.verdict.conditional .v-ic, .verdict.conditional .v-heights > div { background: rgba(42,29,0,.1); }
.verdict.unknown { background: var(--unknown); }
:root[data-theme="dark"] .verdict .v-ic, :root[data-theme="dark"] .verdict .v-heights > div { background: rgba(11,16,24,.14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .verdict .v-ic, :root:not([data-theme="light"]) .verdict .v-heights > div { background: rgba(11,16,24,.14); } }
.point-meta { margin: 0 2px 4px; }

/* ---------- reason cards ---------- */
.reason { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); padding: 12px; margin: 10px 0; }
.reason .r-head { display: flex; gap: 10px; align-items: flex-start; }
.reason .r-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent); }
.reason .r-ic .ico { width: 16px; height: 16px; }
.reason.prohibited .r-ic { background: var(--prohibited-tint); color: var(--prohibited-ink); }
.reason.approval .r-ic { background: var(--approval-tint); color: var(--approval-ink); }
.reason.conditional .r-ic { background: var(--conditional-tint); color: var(--conditional-ink); }
.reason.unknown .r-ic { background: var(--unknown-tint); color: var(--unknown-ink); }
.reason .r-title { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; padding-top: 4px; }
.reason .r-head > .badge { margin-top: 4px; }
.reason .r-name { color: var(--ink-2); font-size: .84rem; margin: 2px 0 0 0; padding-inline-start: 40px; }
.reason p { margin: 6px 0; }
.reason dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: .8rem; }
.reason dt { color: var(--ink-2); }
.reason dd { margin: 0; }
.reason p.note { display: flex; gap: 6px; background: var(--accent-tint); border-radius: var(--radius-sm); padding: 6px 9px; font-size: .82rem; }
.reason p.note .ico { color: var(--accent); margin-top: 2px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; font-size: .7rem; font-weight: 600; padding: 0 9px; border-radius: var(--radius-pill);
  white-space: nowrap; vertical-align: 1px; background: var(--accent-tint); color: var(--ink);
}
.badge.allowed { background: var(--allowed-tint); color: var(--allowed-ink); }
.badge.prohibited { background: var(--prohibited-tint); color: var(--prohibited-ink); }
.badge.approval { background: var(--approval-tint); color: var(--approval-ink); }
.badge.conditional { background: var(--conditional-tint); color: var(--conditional-ink); }
.badge.unknown { background: var(--unknown-tint); color: var(--unknown-ink); }
.badge.verify { background: var(--surface); color: var(--approval-ink); box-shadow: inset 0 0 0 1.5px var(--approval); height: 20px; }
.badge.notam { background: var(--notam-tint); color: var(--notam); }
.badge.field { background: var(--allowed-tint); color: var(--allowed-ink); }
.coord { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.coord-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.coord ul.plain { list-style: none; padding: 0; }
.coord ul.plain li { margin: 6px 0; }
a[href^="tel:"] {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; margin: 2px 0; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-weight: 600; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums;
  margin-inline-end: 4px;
}
a[href^="tel:"]:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
pre.notam { white-space: pre-wrap; direction: ltr; text-align: left; font-size: .75rem; background: var(--surface-2); padding: 8px; border-radius: var(--radius-xs); max-height: 260px; overflow: auto; }

/* ---------- layers tab ---------- */
.legend-item { display: flex; align-items: center; gap: 10px; margin: 2px 0; min-height: 36px; }
.legend-item .legend-label { flex: 1; }
.op-btn { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; color: var(--ink-2); background: transparent; flex: none; }
.op-btn[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.op-row[hidden] { display: none; }
.op-row { display: flex; align-items: center; gap: 8px; margin: 0 30px 8px; }
.op-row input[type=range] { flex: 1; accent-color: var(--primary); }
.op-val { font-size: .78rem; color: var(--ink-2); min-width: 3em; text-align: end; font-variant-numeric: tabular-nums; }
.swatch { width: 22px; height: 16px; border-radius: var(--radius-xs); border: 2px solid; flex: none; }
.layer-toggle { display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 0; min-height: var(--tap-target); border-bottom: 1px solid var(--line); cursor: pointer; }
.layer-toggle span { flex: 1; }
.layer-toggle input {
  order: 2; appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 22px; flex: none; cursor: pointer;
  background: var(--line-strong); position: relative; transition: background-color .15s;
}
.layer-toggle input::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .15s;
}
.layer-toggle input:checked { background: var(--primary); }
.layer-toggle input:checked::before { inset-inline-start: 19px; background: var(--on-primary); }

/* city names on the map */
.city-label { pointer-events: none; }
.city-label span {
  display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 2px #000, 0 1px 2px #000;
}
.city-label.r1 span { font-size: 15px; font-weight: 700; }
.city-label.r3 span { font-size: 11px; font-weight: 500; }

/* ---------- sources tab ---------- */
table.sources { width: 100%; border-collapse: collapse; font-size: .82rem; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-1); }
table.sources td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
table.sources tr:last-child td { border-bottom: 0; }
.st-ok { color: var(--allowed-ink); font-weight: 600; }
.st-stale { color: var(--approval-ink); font-weight: 600; }
.st-missing, .st-error { color: var(--prohibited-ink); font-weight: 600; }

/* ---------- disclaimer dialog ---------- */
dialog { max-width: 560px; border: none; border-radius: var(--radius-lg); padding: 22px 24px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); line-height: 1.5; }
dialog h2 { margin: 0 0 8px; font-size: 1.3rem; }
dialog::backdrop { background: var(--scrim); }
dialog button { background: var(--primary); color: var(--on-primary); height: 44px; padding: 0 24px; font-weight: 600; }
@media (hover: hover) { dialog button:hover { background: var(--primary-hover); } }

/* ---------- Leaflet, themed ---------- */
.leaflet-container { font-family: var(--font-sans); background: var(--map-land); }
.leaflet-bar { border: none !important; box-shadow: var(--shadow-2) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); width: 36px; height: 36px; line-height: 36px; }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-bar a.leaflet-disabled { background: var(--surface); color: var(--line-strong); }
.leaflet-control-layers { border: none !important; border-radius: 12px !important; box-shadow: var(--shadow-2) !important; background: var(--surface); color: var(--ink); }
.leaflet-control-layers-toggle { background-image: none !important; width: 36px !important; height: 36px !important; position: relative; }
.leaflet-control-layers-toggle::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 13 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 13 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.leaflet-control-layers-expanded { padding: 8px 12px; }
.leaflet-control-layers label { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-md); }
.leaflet-popup-content { font-size: .85rem; line-height: 1.45; margin: 14px 16px; }
/* The map is left-to-right for Leaflet; its popups and labels follow the page language. */
html[dir="rtl"] .leaflet-popup-content, html[dir="rtl"] .leaflet-tooltip { direction: rtl; text-align: right; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-2); width: 28px; height: 28px; font-size: 20px; line-height: 26px; }
.leaflet-tooltip { font-size: .75rem; background: var(--surface); color: var(--ink); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-2); padding: 6px 9px; }
.leaflet-tooltip-top::before { border-top-color: var(--surface); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--surface); }
.leaflet-tooltip-left::before { border-left-color: var(--surface); }
.leaflet-tooltip-right::before { border-right-color: var(--surface); }
.leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink-2); }
.leaflet-control-attribution a { color: var(--accent); }
.leaflet-control-scale-line { background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink); border-color: var(--ink-2); }
.popup-open .leaflet-tooltip { display: none; }
/* The street map gets a dark rendering in dark mode; satellite imagery stays as it is. */
:root[data-theme="dark"] #map.base-osm .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #map.base-osm .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7); }
}

/* selected point: the logo pin, anchored at its tip */
.pin-icon { background: none; border: none; }
.pin-mark { display: block; width: 36px; height: 44px; overflow: visible; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.pin-mark .logo-tile { stroke: var(--on-primary); stroke-width: 2; stroke-linejoin: round; }

/* popup */
.popup-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; line-height: 1.3; margin: 0 0 6px; padding-right: 22px; } /* clear of the close button, top right */
.popup-verdict .pv-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--on-status); background: var(--unknown); }
.popup-verdict .pv-ic .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.popup-verdict.allowed .pv-ic { background: var(--allowed); }
.popup-verdict.prohibited .pv-ic { background: var(--prohibited); }
.popup-verdict.approval .pv-ic { background: var(--approval); }
.popup-verdict.conditional .pv-ic { background: var(--conditional); color: var(--on-conditional); }
.popup-contacts { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.popup-contacts-title { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 4px; }
.popup-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0; line-height: 1.4; }
.popup-contact-name { color: var(--ink-2); }
.popup-verify { color: var(--approval-ink); font-weight: 700; }
.popup-note { font-size: .72rem; color: var(--approval-ink); margin-top: 3px; }
.popup-more { display: none; }

/* ---------- phones and small screens (also phones in landscape) ---------- */
@media (max-width: 820px), (max-height: 500px) {
  .topbar { padding: 8px 12px 10px; gap: 8px; align-items: stretch; flex-direction: column; }
  .logo { width: 28px; height: 34px; }
  .brand { gap: 10px; align-self: stretch; }
  .brand h1 { font-size: 1.05rem; }
  .brand p { display: none; }
  /* Flight settings fold away behind a one-line summary button */
  .controls { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  /* One row: settings summary, notices, search. Location and link sit under the fields when settings are open. */
  .controls .buttons { display: contents; }
  .settings-btn { order: -3; }
  #locate, #share { order: -2; }
  #locate .lbl, #share .lbl { display: none; }
  .topbar:not(.expanded) .controls > label { display: none; }
  .controls label { flex: 1 1 40%; font-size: .75rem; }
  .controls label:nth-child(-n+2) { flex-basis: 100%; }
  .controls select { max-width: none; width: 100%; }
  .controls input[type=number] { width: 100%; }
  .controls label { min-width: 0; }
  .controls .row { width: 100%; min-width: 0; }
  .controls .row input { flex: 1 1 auto; min-width: 0; width: 100%; }
  .controls .row button { flex: none; }
  /* 16px stops iPhone Safari from zooming into the page when a field is tapped */
  .controls input, .controls select { font-size: 16px; height: var(--tap-target); }
  .controls button { height: var(--tap-target); }
  .settings-btn {
    display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; justify-content: flex-start; text-align: start; padding: 0 14px !important;
    background: var(--surface-2); color: var(--ink); font-weight: 500;
  }
  .topbar.expanded .settings-btn { background: var(--primary); color: var(--on-primary); }
  .settings-btn .summary { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
  .settings-btn .chev { display: inline-flex; transition: transform .15s; }
  .topbar.expanded .settings-btn .chev { transform: rotate(180deg); }
  .lang .lbl { display: none; }
  .lang .ic { display: inline; }
  #lang, #theme, #locate, #share { width: var(--tap-target); min-width: var(--tap-target); padding: 0; flex: none; }
  /* Notices and search float in the map's top-left corner; the zoom and layer buttons move down below them */
  .map-fabs { display: flex; gap: 8px; position: absolute; top: 10px; left: 10px; z-index: 5; direction: ltr; }
  .map-fabs button { height: var(--tap-target); min-width: var(--tap-target); box-shadow: var(--shadow-2); }
  #map .leaflet-top.leaflet-left { top: 54px; }
  .search-btn { width: var(--tap-target); padding: 0; background: var(--surface); color: var(--ink); }
  .search-btn[aria-expanded="true"] { background: var(--primary); color: var(--on-primary); }
  .notices-btn { display: inline-flex; flex: none; gap: 5px; padding: 0 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--conditional-tint); color: var(--conditional-ink); }
  .notices-btn[hidden] { display: none; }
  .notices-btn.error { background: var(--prohibited-tint); color: var(--prohibited-ink); }
  .notices-btn.info { background: var(--accent-tint); color: var(--ink); }
  .notices-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px currentColor; }
  /* Search opens from the magnifier instead of covering the map all the time */
  .search { display: none; }
  .map-wrap.search-open .search { display: block; }
  /* Notices open from the warning button in the top bar */
  .banners { display: none; }
  .banners.open { display: block; box-shadow: var(--shadow-1); }
  .banner { padding: 9px 12px; font-size: .8rem; }
  /* Bigger touch targets */
  .tabs button { height: 40px; font-size: .84rem; }
  .op-btn { width: 40px; height: 40px; }
  .leaflet-control-attribution { font-size: 9px; line-height: 1.3; }
  a[href^="tel:"] { min-height: 32px; padding: 0 10px; font-size: .8rem; }
  .popup-more {
    display: flex; width: 100%; height: 40px; margin-top: 10px; font-size: .84rem; font-weight: 600; background: var(--primary); color: var(--on-primary);
  }
  /* Language and theme move up to the title row, so the row below has room for the full flight-settings summary */
  .brand { min-height: var(--tap-target); padding-inline-end: 104px; }
  #lang, #theme { position: absolute; top: 8px; height: var(--tap-target); }
  #lang { inset-inline-end: 12px; }
  #theme { inset-inline-end: 62px; }
  .settings-btn .summary { font-size: .84rem; }
  /* Compact type on small screens */
  .tab { font-size: .86rem; line-height: 1.45; }
  .tab h3 { font-size: .92rem; margin: 18px 0 6px; }
  .verdict { padding: 12px 14px 14px; }
  .verdict .v-title { font-size: 1rem; gap: 8px; }
  .verdict .v-title .v-ic { width: 26px; height: 26px; }
  .verdict .v-title .ico { width: 15px; height: 15px; }
  .verdict .v-heights { margin-top: 10px; }
  .verdict .v-heights b { font-size: 1.05rem; }
  .reason { padding: 10px 12px; }
  .reason .r-title { font-size: .88rem; }
  .reason .r-name { font-size: .8rem; }
  .badge { font-size: .66rem; height: 20px; padding: 0 8px; }
  .leaflet-popup-content { font-size: .8rem; margin: 12px 14px; }
  .popup-verdict { font-size: .86rem; }
  .popup-verdict .pv-ic { width: 22px; height: 22px; }
  .popup-verdict .pv-ic .ico { width: 13px; height: 13px; }
  .popup-contact { gap: 3px 4px; margin: 5px 0; }
  .popup-contact a[href^="tel:"] { min-height: 30px; padding: 0 8px; font-size: .76rem; margin-inline-end: 0; }
  .search-box { height: 42px; }
  .search-box input { font-size: 16px; } /* 16px stops iPhone Safari zooming in on focus */
  dialog { max-width: calc(100vw - 24px); padding: 18px 20px; max-height: calc(100dvh - 24px); overflow: auto; }
  dialog button { min-width: 140px; }
}

/* Phones in portrait: map on top, the panel slides over its bottom edge like a sheet, and the whole page scrolls */
@media (max-width: 820px) {
  html, body { height: auto; }
  body { display: block; }
  .layout { display: block; }
  /* The map fills the screen; only the panel's tab row peeks out below it (no repeat of the popup's verdict) */
  .map-wrap { height: calc(100vh - var(--topbar-h, 120px) - 46px); height: calc(100svh - var(--topbar-h, 120px) - 46px); min-height: 240px; }
  .map-credit { bottom: 50px; }
  .search { top: 10px; right: 10px; left: 10px; width: auto; } /* opens over the corner buttons */
  #map .leaflet-bottom { bottom: 20px; }
  /* Landscape phones: the map gets nearly the whole screen; scroll down for the panel */
  @media (orientation: landscape) { .map-wrap { height: 85vh; height: 85svh; } }
  .panel {
    width: 100%; overflow: visible; border-inline-start: none; position: relative; z-index: 1; margin-top: -20px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--bg); box-shadow: var(--shadow-3);
  }
  .tabs { top: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 18px 10px 8px; }
  .tabs::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-strong); opacity: .6; }
  .tab { padding: 14px 14px 18px; }
  .not-permission { margin: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
