/* RadioDusk app shell: the sidebar shared by the map (/map/) and the guides (/, /g/...).
   Collapsible (button in the header, floating button to reopen) and resizable (drag the right edge, or arrow keys on it).
   Width and collapsed state are remembered on the device (shell.js). Brand locked: black, paper, pink; Manrope. */
:root {
  --black: #000; --paper: #F4EFE8; --pink: #F2448F;
  --grey: rgba(244,239,232,.66); --faint: rgba(244,239,232,.44); --line: rgba(244,239,232,.09); --line-2: rgba(244,239,232,.18);
  --s1: #0d0b10; --s2: #16131a; --s3: #201c25;
  --sans: "Manrope", system-ui, -apple-system, sans-serif; --ease: cubic-bezier(.16,1,.3,1);
  --glass: rgba(16,13,20,.58); --glass-edge: rgba(244,239,232,.16); --glass-blur: blur(18px) saturate(170%); --glass-hi: inset 0 1px 0 rgba(255,255,255,.08);
  --sw: 320px;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app { display: grid; grid-template-columns: var(--sw) 1fr; height: 100dvh; }
.app.site { height: auto; min-height: 100dvh; }
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .panel { visibility: hidden; }
.app.resizing, .app.resizing * { cursor: col-resize !important; user-select: none; }
.panel { position: relative; font: 500 14.5px/1.45 var(--sans); letter-spacing: normal; color: var(--paper); }
/* the sidebar sets its own sizes so it looks the same on every page, whatever the page's base font */
.panel .i { width: 17px; height: 17px; flex: none; vertical-align: -0.2em; color: currentColor; }
.panel .search > .i { width: 17px; height: 17px; color: var(--faint); }
.panel .search input { font: 600 14.5px var(--sans); letter-spacing: normal; }
.panel .search input::placeholder { font: 600 14.5px var(--sans); color: var(--faint); }
.panel a { text-decoration: none; }
.panel a:hover { color: inherit; }
.seg a:hover { color: var(--paper); }
.seg [aria-current="page"]:hover { color: #000; }
.app.site .panel { position: sticky; top: 0; height: 100dvh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }

/* header: logo, collapse button, Map | Guides switch */
.panel-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { appearance: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--grey); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--s2); color: var(--paper); }
.icon-btn .i { width: 18px; height: 18px; color: currentColor; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 14px 12px; padding: 3px; background: var(--s2); border-radius: 999px; }
.seg a, .seg button { appearance: none; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font: 700 13.5px var(--sans); color: var(--grey); text-decoration: none; cursor: pointer; transition: background .2s, color .2s; }
.seg a:hover, .seg button:hover { color: var(--paper); }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--paper); color: #000; }
.seg [aria-current="page"] .i, .seg [aria-pressed="true"] .i { color: #000; }
.seg .i { width: 16px; height: 16px; color: currentColor; }
.seg.small { margin: 0; }
.seg.small a, .seg.small button { padding: 5px 10px; font-size: 12.5px; }

/* drag handle on the right edge */
.resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 20; background: transparent; border: 0; padding: 0; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, .resizer:focus-visible::after, .app.resizing .resizer::after { background: var(--pink); }
.resizer:focus-visible { outline: none; }

/* reopen button when the sidebar is collapsed */
.panel-open { position: fixed; top: 14px; left: 14px; z-index: 950; display: none; gap: 8px; align-items: center; appearance: none; border: 1px solid var(--glass-edge); background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-hi), 0 8px 24px rgba(8,20,32,.25); color: var(--paper); border-radius: 999px; padding: 7px 13px 7px 9px; font: 700 13.5px var(--sans); cursor: pointer; }
.panel-open img { width: 22px; height: 22px; }
.panel-open .i { width: 16px; height: 16px; color: var(--paper); }
.app.collapsed ~ .panel-open, .app.collapsed .panel-open { display: inline-flex; }

/* sidebar section labels and link rows (guides pages) */
.side-label { margin: 18px 18px 6px; font-size: 12px; font-weight: 700; color: var(--faint); }
.side-links { padding: 0 8px; display: grid; gap: 1px; }
.side-link { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--grey); text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.side-link:hover { background: var(--s2); color: var(--paper); }
.side-link .i { width: 17px; height: 17px; color: currentColor; }
.side-link.active { color: var(--paper); background: var(--s2); }
.side-link.active::before { content: ""; }
.toc .side-link { grid-template-columns: 1fr; padding-left: 40px; position: relative; }
.toc .side-link::after { content: ""; position: absolute; left: 25px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--line-2); transition: background .15s; }
.toc .side-link.active::after { background: var(--pink); }
.side-actions { display: grid; gap: 8px; margin: 18px 14px; }
.side-actions a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: 12px; font: 700 14px var(--sans); text-decoration: none; color: var(--paper); border: 1px solid var(--line-2); transition: background .15s, transform .15s var(--ease); }
.side-actions a:hover { background: var(--s2); }
.side-actions a:active { transform: scale(.98); }
.side-actions a.primary { background: var(--pink); border-color: var(--pink); color: #000; }
.side-actions a.primary .i { color: #000; }
.side-actions a .i { width: 17px; height: 17px; }
.side-actions a.yt { background: #FF0033; border-color: #FF0033; color: #fff; }
.side-actions a.yt svg { width: 18px; height: 18px; }
.panel-foot { margin-top: auto; padding: 14px 18px 18px; font-size: 12px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.panel-foot a { color: var(--grey); text-decoration: none; }
.panel-foot a:hover { color: var(--paper); }

/* ---------- panel ---------- */
.panel { background: var(--s1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.grab { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 14px; }
.brand { display: flex; gap: 9px; align-items: center; text-decoration: none; font-size: 17px; letter-spacing: -0.03em; }
.brand span { color: var(--pink); }

.search { position: relative; margin: 0 14px; }
.search > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; font: 600 14.5px var(--sans); color: var(--paper); background: var(--s2); border: 1px solid transparent; border-radius: 12px; padding: 11px 38px 11px 38px; transition: border-color .2s, background .2s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--line-2); background: var(--s3); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px var(--sans); color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 6px; background: rgba(22,19,26,.82); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); border-radius: 14px; max-height: min(60vh, 420px); overflow: auto; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.results li { padding: 8px 10px; border-radius: 10px; cursor: pointer; display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: center; }
.results li > .i { width: 17px; height: 17px; color: var(--grey); }
.results li[aria-selected="true"], .results li:hover { background: var(--s3); }
.results li b { font-weight: 600; display: block; }
.results li span { font-size: 12px; color: var(--grey); }
.results .empty { color: var(--grey); display: block; cursor: default; }
.results .empty:hover { background: none; }

.summary { display: flex; justify-content: space-between; align-items: center; min-height: 18px; margin: 14px 18px 4px; font-size: 13px; color: var(--grey); }
.summary .clear { appearance: none; background: none; border: 0; padding: 4px 0; color: var(--grey); font-weight: 600; cursor: pointer; }
.summary .clear:hover { color: var(--paper); }
.summary .clear[hidden] { display: none; }

.switch-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 8px 8px; padding: 10px 10px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.switch-row:hover { background: var(--s2); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { width: 36px; height: 22px; border-radius: 999px; background: var(--s3); border: 1px solid var(--line-2); position: relative; transition: background .2s var(--ease); flex: none; }
.switch-row i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: transform .25s var(--ease); }
.switch-row input:checked + i { background: var(--pink); border-color: var(--pink); }
.switch-row input:checked + i::after { transform: translateX(14px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--pink); outline-offset: 2px; }

.layers { flex: 1; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
.grp { margin: 2px 0; }
.grp-row { display: grid; grid-template-columns: 1fr auto; align-items: center; border-radius: 12px; }
.grp-row:hover { background: var(--s2); }
.grp-head { appearance: none; min-width: 0; display: grid; grid-template-columns: 20px 1fr 14px; gap: 10px; align-items: center; background: none; border: 0; padding: 10px 6px 10px 10px; border-radius: 12px; cursor: pointer; text-align: left; font-weight: 700; font-size: 14.5px; }
.grp-head .t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grp-check { appearance: none; background: none; border: 0; padding: 10px; cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.grp-check .tick { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.grp-check .tick svg { width: 12px; height: 12px; color: #000; fill: currentColor; opacity: 0; }
.grp-check[aria-checked="true"] .tick { background: var(--paper); border-color: var(--paper); }
.grp-check[aria-checked="true"] .tick svg { opacity: 1; }
.grp-check[aria-checked="mixed"] .tick { border-color: var(--paper); }
.grp-check[aria-checked="mixed"] .tick::after { content: ""; width: 8px; height: 2px; border-radius: 2px; background: var(--paper); }
.grp-check[aria-checked="mixed"] .tick svg { display: none; }
.grp-head .on { font-size: 11.5px; font-weight: 700; color: var(--paper); background: rgba(244,239,232,.12); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.grp-head .chev { width: 14px; height: 14px; color: var(--faint); fill: currentColor; transition: transform .25s var(--ease); }
.grp-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.grp-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.grp.open .grp-body { grid-template-rows: 1fr; }
.grp-body > div { overflow: hidden; }
.row { appearance: none; width: 100%; display: grid; grid-template-columns: 20px 1fr auto 18px; gap: 10px; align-items: center; background: none; border: 0; padding: 7px 10px; border-radius: 10px; cursor: pointer; text-align: left; font-size: 14px; color: var(--grey); transition: background .15s, color .15s; }
.row:hover { background: var(--s2); color: var(--paper); }
.row > .i { width: 17px; height: 17px; justify-self: center; color: var(--faint); transition: color .15s; }
.row .n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint); }
.row .n b { color: var(--pink); font-weight: 700; }
.row .tick { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.row .tick svg { width: 12px; height: 12px; color: #000; fill: currentColor; opacity: 0; }
.row[aria-checked="true"] { color: var(--paper); }
.row[aria-checked="true"] > .i { color: var(--paper); }
.row[aria-checked="true"] .tick { background: var(--paper); border-color: var(--paper); }
.row[aria-checked="true"] .tick svg { opacity: 1; }
.row.guide[aria-checked="true"] > .i { color: var(--pink); }



@media (max-width: 760px) {
  .resizer, .collapse-btn, .panel-open { display: none !important; }
  .app.collapsed { grid-template-columns: 1fr; }
  .app.collapsed .panel { visibility: visible; }
}
@media (prefers-reduced-motion: reduce) { .app, .app * { transition: none !important; } }
.row.fav-row[aria-checked="true"] > .i { color: var(--pink); }
.fav-grp { margin-bottom: 4px; }
.layers.fav-mode .grp:not(.fav-grp) { opacity: .45; }
