/* NSA Alumni Map — palette from nsa.edu (navy #121A30, slate #384A6B, accent #FF8021,
   off-white #F2F0ED); EB Garamond stands in for NSA's Sabon, Figtree for Articulat. */
:root {
  --navy: #121A30; --navy-2: #1B2542; --navy-3: #26324F; --slate: #384A6B; --accent: #FF8021; --accent-2: #FFB27A;
  --paper: #F2F0ED; --paper-dim: #C9CEDA; --muted: #98A1B8; --line: rgba(242,240,237,.12);
  --glass: rgba(15, 22, 42, .82);
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px; --panel-w: 380px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070B18; color: var(--paper); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--accent-2); }

/* ---------- the sky behind the globe */
#space { position: fixed; inset: 0; z-index: 0; transition: background .8s;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 72% 12%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 86% 64%, rgba(255,236,210,.7), transparent 60%),
    radial-gradient(1px 1px at 32% 78%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 55% 42%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 92% 88%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 6% 58%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(ellipse at 50% 45%, #1C2A55 0%, #0D1430 45%, #050810 100%);
  background-size: 310px 290px, 430px 370px, 520px 460px, 370px 410px, 610px 530px, 470px 350px, 390px 510px, 100% 100%; }
#space::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.45)); }
body.theme-atlas #space { background:
    radial-gradient(ellipse at 50% 45%, #F6F3EC 0%, #E9E3D6 55%, #D8CFBD 100%); }
body.theme-atlas #space::after { background:
    repeating-linear-gradient(0deg, rgba(18,26,48,.025) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(18,26,48,.025) 0 1px, transparent 1px 44px),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(94,78,56,.18)); }
#map { position: absolute; inset: 0; z-index: 1; }
#map canvas { outline: none; }

/* ---------- glass chrome */
.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.25); -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }

.brand { position: absolute; z-index: 5; top: var(--gutter); left: var(--gutter); width: var(--panel-w); height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.logo { display: block; color: var(--paper); height: 36px; }
.logo-svg, .logo-svg svg { display: block; height: 100%; width: auto; }
.logo-svg svg { height: 36px; }
.brand .divider { width: 1px; height: 30px; background: rgba(242,240,237,.25); }
.brand .title { font: 400 22px/1 var(--serif); letter-spacing: .04em; white-space: nowrap; }
.brand .title em { color: var(--accent-2); }

.search { position: absolute; z-index: 6; top: calc(var(--gutter) + 72px); left: var(--gutter); width: var(--panel-w); display: flex; align-items: center; padding: 0 8px 0 14px; height: 52px; }
.search .i { width: 20px; height: 20px; fill: none; stroke: var(--paper-dim); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--paper); font: 400 19px/1 var(--serif); padding: 0 10px; height: 100%; }
.search input::placeholder { color: var(--muted); font-style: italic; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { box-shadow: 0 12px 40px rgba(0,0,0,.35), 0 0 0 2px rgba(255,128,33,.55); }
.icon-btn { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--paper-dim); }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

#suggest { position: absolute; top: 58px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #0E1428; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); max-height: min(60vh, 460px); overflow: auto; }
#suggest .hd { font: 600 10.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
#suggest .opt { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
#suggest .opt .main { font: 400 17px/1.2 var(--serif); color: var(--paper); }
#suggest .opt .sub { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
#suggest .opt .sub b { color: var(--accent-2); font-weight: 600; }
#suggest .opt.on, #suggest .opt:hover { background: rgba(255,128,33,.14); }
#suggest .hint { padding: 10px; color: var(--muted); font-size: 13px; }
#suggest .hint button { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; cursor: pointer; }

/* ---------- side panel */
#panel { position: absolute; z-index: 4; top: calc(var(--gutter) + 136px); left: var(--gutter); width: var(--panel-w); max-height: calc(100% - 136px - var(--gutter) * 2); overflow: auto; padding: 20px 20px 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; transition: opacity .3s; }
#panel .grab, #btnLayers { display: none; }
.stylemenu { position: absolute; z-index: 8; top: calc(var(--gutter) + 166px); right: var(--gutter); min-width: 190px; padding: 6px; }
.stylemenu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.stylemenu button[aria-checked=true] { background: rgba(255,128,33,.14); color: #fff; }
.menu.stylemenu button { display: flex; align-items: center; gap: 10px; }
.stylemenu .sw { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.sw-night { background: radial-gradient(circle at 60% 40%, var(--accent) 0 3px, transparent 3.5px), radial-gradient(circle at 35% 35%, #2B3A66, #121A30 70%); }
.sw-atlas { background: radial-gradient(circle at 60% 40%, var(--accent) 0 3px, transparent 3.5px), radial-gradient(circle at 35% 35%, #FBF8F2, #D8CFBD 75%); }
.sw-satellite { background: radial-gradient(circle at 60% 40%, var(--accent) 0 3px, transparent 3.5px), radial-gradient(circle at 30% 30%, #5E7F4A, #2A4A6B 55%, #0E1F3A); }
.p-kicker { font: 600 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.p-kicker .back { margin-left: auto; background: none; border: 0; color: var(--paper-dim); cursor: pointer; font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; padding: 2px 4px; border-radius: 6px; }
.p-kicker .back:hover { color: #fff; background: rgba(255,255,255,.08); }
.p-title { font: 400 28px/1.1 var(--serif); margin: 0 0 4px; }
.p-title em { color: var(--accent-2); font-style: italic; }
.p-lede { color: var(--paper-dim); margin: 0 0 16px; font-size: 13.5px; }
.big { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 4px; }
.big b { font: 500 54px/1 var(--serif); color: var(--accent); font-variant-numeric: lining-nums; letter-spacing: -.01em; }
.big span { font: 400 18px/1.2 var(--serif); color: var(--paper); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin: 4px -4px 18px; }
.statrow div { text-align: center; padding: 10px 2px; border-radius: 10px; background: rgba(255,255,255,.03); }
.statrow b { display: block; font: 500 26px/1 var(--serif); color: var(--paper); }
.statrow span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.sec h3 { font: 500 18px/1.2 var(--serif); margin: 0 0 2px; display: flex; align-items: baseline; gap: 8px; }
.sec h3 small { font: 400 12px var(--sans); color: var(--muted); margin-left: auto; }
.sec .note { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }

.hot { list-style: none; margin: 0; padding: 0; counter-reset: h; }
.hot li { counter-increment: h; }
.hot button { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 6px; border-radius: 9px; cursor: pointer; text-align: left; }
.hot button:hover { background: rgba(255,128,33,.1); }
.hot button::before { content: counter(h, upper-roman); font: 500 12px/1 var(--serif); color: var(--muted); text-align: center; }
.hot .nm { font: 400 16.5px/1.2 var(--serif); }
.hot .nm small { display: block; font: 400 11.5px/1.3 var(--sans); color: var(--muted); }
.hot .ct { font: 600 15px/1 var(--sans); color: var(--accent-2); }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.bars li button { background: none; border: 0; padding: 0; text-align: left; color: var(--paper-dim); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars li button:hover { color: #fff; text-decoration: underline; }
.bars .bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--slate), var(--accent)); }
.bars .n { text-align: right; color: var(--paper); font-variant-numeric: tabular-nums; }

.radius { margin: 12px 0 6px; }
.radius label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.radius label b { color: var(--paper); font: 500 15px var(--serif); letter-spacing: 0; text-transform: none; }
.radius input[type=range] { width: 100%; accent-color: var(--accent); }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 99px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--paper-dim); }
.chip.on, .chip:hover { border-color: var(--accent); color: #fff; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; border: 1px solid rgba(242,240,237,.2); background: rgba(255,255,255,.05); color: var(--paper); font: 600 13px/1 var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(255,255,255,.1); border-color: rgba(242,240,237,.35); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.btn.primary:hover { background: #FF9442; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }

.cities { list-style: none; margin: 0; padding: 0; }
.cities > li { padding: 9px 0; border-bottom: 1px solid rgba(242,240,237,.07); }
.cities > li:last-child { border: 0; }
.cities .row { display: flex; align-items: baseline; gap: 8px; }
.cities .row button { background: none; border: 0; padding: 0; color: var(--paper); font: 400 16.5px/1.25 var(--serif); cursor: pointer; text-align: left; }
.cities .row button:hover { color: var(--accent-2); }
.cities .row .d { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.cities .row .pinfix { font: 600 10.5px/1 var(--sans) !important; letter-spacing: .04em; color: var(--muted) !important; border: 1px solid var(--line) !important; border-radius: 6px; padding: 3px 6px !important; margin-left: 6px; }
.cities .row .pinfix:hover { color: var(--accent-2) !important; border-color: var(--accent-2) !important; }
.cities .row .n { color: var(--accent-2); font-weight: 600; font-size: 13px; min-width: 22px; text-align: right; }
.cities .names { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cities .names li { font-size: 13px; color: var(--paper-dim); background: rgba(255,255,255,.05); padding: 2px 8px; border-radius: 6px; }
.cities .names li.me { background: rgba(255,128,33,.2); color: #fff; }
.cities .names li small { color: var(--muted); margin-left: 3px; }

.locked { margin: 14px 0 4px; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(56,74,107,.35), rgba(255,128,33,.12)); border: 1px solid rgba(255,178,122,.25); }
.locked p { margin: 0 0 10px; color: var(--paper-dim); font-size: 13px; }
.locked p strong { color: var(--paper); font: 500 16px var(--serif); display: block; margin-bottom: 2px; }
.empty { color: var(--paper-dim); font: italic 400 16px/1.4 var(--serif); margin: 10px 0; }
.foot { margin-top: 16px; color: var(--muted); font-size: 11.5px; }
.foot button { background: none; border: 0; padding: 0; color: var(--paper-dim); text-decoration: underline; cursor: pointer; font-size: 11.5px; }

/* ---------- toolbar */
.toolbar { position: absolute; z-index: 5; top: var(--gutter); right: var(--gutter); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - var(--panel-w) - var(--gutter) * 3); }
.tbtn { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--paper); text-decoration: none; }
.tbtn:hover { border-color: rgba(242,240,237,.3); }
.tbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tbtn[aria-pressed=true] { color: var(--accent-2); }
.tbtn.accent { background: linear-gradient(135deg, rgba(255,128,33,.95), rgba(236,104,20,.95)); color: var(--navy); border-color: transparent; }
.tbtn.accent.in { background: var(--glass); color: var(--paper); border-color: rgba(255,178,122,.45); }
.tbtn.accent.in svg { color: var(--accent-2); }
.seg { display: inline-flex; padding: 4px; height: 44px; gap: 2px; }
.seg button { border: 0; background: none; padding: 0 12px; border-radius: 10px; cursor: pointer; color: var(--paper-dim); font-weight: 600; font-size: 12.5px; }
.seg button[aria-checked=true] { background: var(--paper); color: var(--navy); }
.menu { position: absolute; top: 52px; right: 0; min-width: 220px; padding: 6px; z-index: 8; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.menu button:hover { background: rgba(255,255,255,.08); }
.menu .who { padding: 10px 12px 6px; color: var(--muted); font-size: 12px; }

/* ---------- intro title */
#intro { position: absolute; z-index: 3; left: calc(var(--panel-w) + var(--gutter) * 2); right: 0; bottom: 9vh; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  isolation: isolate; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 2px 18px rgba(0,0,0,.85); }
/* soft dark halo behind the words so they read over the bright arcs and atmosphere */
#intro::before { content: ''; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(900px, 110vw); height: calc(100% + 120px);
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4, 7, 18, .86) 0%, rgba(4, 7, 18, .72) 45%, rgba(4, 7, 18, .35) 75%, rgba(4, 7, 18, 0) 100%); }
#intro .kicker, #intro h1, #intro .count { position: relative; }
#intro.on { opacity: 1; }
#intro .kicker { font: 500 12px/1 var(--sans); letter-spacing: .38em; text-transform: uppercase; color: #E4E7EE; margin: 0 0 12px; }
#intro h1 { font: 400 clamp(32px, 5vw, 60px)/1.05 var(--serif); margin: 0; letter-spacing: .01em; }
#intro h1 em { color: var(--accent-2); }
#intro .count { font: italic 400 18px var(--serif); color: #E4E7EE; margin: 12px 0 0; }
body.theme-atlas #intro { color: var(--navy); text-shadow: 0 1px 2px rgba(255,255,255,.9), 0 1px 14px rgba(255,255,255,.8); }
body.theme-atlas #intro::before { background: radial-gradient(closest-side, rgba(248, 245, 238, .92) 0%, rgba(248, 245, 238, .78) 45%, rgba(248, 245, 238, .35) 75%, rgba(248, 245, 238, 0) 100%); }
body.theme-atlas #intro .kicker, body.theme-atlas #intro .count { color: var(--slate); }
body.theme-atlas #intro h1 em { color: #C85E12; }

#tip { position: absolute; z-index: 7; pointer-events: none; background: rgba(10,15,30,.94); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.4); transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; }
#tip b { font: 500 15px var(--serif); display: block; }
#tip span { color: var(--accent-2); }
#toast { position: absolute; z-index: 9; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--paper); color: var(--navy); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* ---------- Moscow marker */
.home { width: 30px; height: 30px; color: var(--paper); filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); cursor: pointer; }
.home svg { width: 100%; height: 100%; }
body.theme-atlas .home { color: var(--navy); filter: drop-shadow(0 1px 3px rgba(255,255,255,.8)); }

/* ---------- MapLibre controls, re-skinned */
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--line); border-radius: 12px !important; box-shadow: 0 10px 30px rgba(0,0,0,.35) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 38px; height: 38px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.6); }
.maplibregl-ctrl-bottom-right { margin: 0 6px 6px 0; }
.maplibregl-ctrl-attrib { background: rgba(10,15,30,.7) !important; color: var(--muted); font-size: 10.5px; }
.maplibregl-ctrl-attrib-inner, .maplibregl-ctrl-attrib-inner * { color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--paper-dim); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-cooperative-gesture-screen { font: 500 17px var(--serif); background: rgba(10,15,30,.55); }

/* ---------- dialog */
dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 22px; background: #111933; color: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(5,8,18,.6); backdrop-filter: blur(3px); }
dialog .x { position: absolute; top: 12px; right: 12px; margin: 0; }
dialog h2 { font: 400 28px/1.1 var(--serif); margin: 0 0 6px; padding-right: 30px; }
dialog h2 em { color: var(--accent-2); }
dialog .lede { color: var(--paper-dim); margin: 0 0 18px; }
dialog .crest { width: 38px; height: 38px; color: var(--paper); margin-bottom: 12px; }
dialog form.f { display: flex; flex-direction: column; gap: 12px; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--paper-dim); letter-spacing: .02em; }
dialog label small { font-weight: 400; color: var(--muted); }
dialog input, dialog textarea, dialog select { font: 400 15px/1.3 var(--sans); padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(242,240,237,.18); background: rgba(255,255,255,.05); color: var(--paper); width: 100%; }
dialog input:focus, dialog textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
dialog .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog .err { background: rgba(200,60,60,.18); color: #FFC9C9; padding: 9px 12px; border-radius: 9px; margin: 0; font-size: 13px; }
dialog .ok { background: rgba(80,170,120,.15); color: #CFF1DE; padding: 12px; border-radius: 10px; }
dialog .fine { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
dialog .linkish { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
dialog .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
dialog .choice { display: grid; gap: 8px; }
dialog .choice label { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid rgba(242,240,237,.15); border-radius: 12px; cursor: pointer; font-size: 14px; color: var(--paper); font-weight: 500; }
dialog .choice label:has(input:checked) { border-color: var(--accent); background: rgba(255,128,33,.08); }
dialog .choice input { width: auto; margin-top: 3px; accent-color: var(--accent); }
dialog .choice small { display: block; font-weight: 400; color: var(--muted); }
.picker { position: relative; }
.picker ul { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #0D1326; border: 1px solid var(--line); border-radius: 10px; z-index: 3; max-height: 220px; overflow: auto; }
.picker li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.picker li small { color: var(--muted); margin-left: 6px; }
.picker li.on, .picker li:hover { background: rgba(255,128,33,.15); }

/* ---------- print roster */
#print { display: none; }
@media print {
  @page { margin: 16mm; }
  html, body { overflow: visible; height: auto; background: #fff; color: #000; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; font: 11pt/1.4 var(--sans); color: #121A30; }
  #print .ph { display: flex; align-items: center; gap: 14px; border-bottom: 1.5pt solid #121A30; padding-bottom: 8px; margin-bottom: 12px; }
  #print .ph svg { height: 40px; width: auto; color: #121A30; }
  #print h1 { font: 400 20pt/1.1 var(--serif); margin: 0; }
  #print p { margin: 0 0 10px; color: #444; }
  #print table { width: 100%; border-collapse: collapse; }
  #print th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1pt solid #999; padding: 4px; }
  #print td { border-bottom: .5pt solid #ddd; padding: 5px 4px; }
}

/* ---------- embed + small screens */
body.embed { --gutter: 12px; --panel-w: 340px; }
body.embed .brand { height: 52px; }
body.embed .brand .logo, body.embed .logo-svg svg { height: 30px; }
body.embed .search { top: calc(var(--gutter) + 62px); }
body.embed #panel { top: calc(var(--gutter) + 124px); max-height: calc(100% - 124px - var(--gutter) * 2); }

@media (max-width: 900px) {
  .tbtn span { display: none; }
  .tbtn { padding: 0 12px; }
}
@media (max-width: 720px) {
  :root { --gutter: 10px; --panel-w: calc(100vw - 20px); }
  .brand { width: auto; height: 48px; padding: 0 12px; gap: 10px; }
  .brand .logo, .logo-svg svg { height: 26px; }
  .brand .title { font-size: 17px; }
  .toolbar { top: var(--gutter); max-width: 60vw; }
  .tbtn, .seg { height: 40px; }
  .seg { display: none; }
  .search { top: calc(var(--gutter) + 56px); height: 48px; }
  /* bottom sheet: the panel is full height and slides down; JS sets --sheet-full / --sheet-y */
  #panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: var(--sheet-full, 46vh); max-height: none;
    border-radius: 18px 18px 0 0; border-bottom: 0; padding: 0 18px calc(22px + env(safe-area-inset-bottom));
    transform: translate3d(0, var(--sheet-y, 0px), 0); transition: transform .34s cubic-bezier(.2, .8, .2, 1);
    overflow: hidden; overscroll-behavior: contain; will-change: transform; }
  #panel[data-sheet=full] { overflow-y: auto; }
  #panel.dragging { transition: none; }
  #panel .grab { display: flex; position: sticky; top: 0; z-index: 3; justify-content: center; align-items: center;
    width: calc(100% + 36px); height: 28px; margin: 0 -18px 4px; padding: 0; border: 0; cursor: grab; touch-action: none; background: transparent; }
  #panel[data-sheet=full] .grab { background: linear-gradient(rgba(15, 22, 42, .97) 70%, rgba(15, 22, 42, 0)); }
  #panel .grab span { width: 42px; height: 5px; border-radius: 3px; background: rgba(242, 240, 237, .4); }
  #panel .grab:focus-visible span { background: var(--accent); }
  #btnLayers { display: grid; place-items: center; position: absolute; z-index: 3; top: calc(var(--gutter) + 114px); right: var(--gutter);
    width: 44px; height: 44px; border-radius: 12px; padding: 0; cursor: pointer; color: var(--paper); }
  #btnLayers svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
  .stylemenu { top: calc(var(--gutter) + 164px); }
  .big b { font-size: 42px; }
  .p-title { font-size: 24px; }
  .maplibregl-ctrl-bottom-right { display: none; }
  #intro { left: 0; bottom: auto; top: 22vh; }
  dialog .row2 { grid-template-columns: 1fr; }
  body.embed .search { top: calc(var(--gutter) + 56px); }
  body.embed #panel { top: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
