:root {
  --bg: #0a0b09;
  --panel: rgba(12, 14, 18, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.10);
  --text: #e8eae3;
  --muted: #8d9088;
  --accent: #0b63f3;
  --accent-l: #5c97ff;
  --warn: #ff9f1c;
  --hot: #ff2e63;
  --ok: #7bd389;
  --mono: "DM Mono", ui-monospace, monospace;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", Inter, sans-serif;
  --brand: "Syne", "Space Grotesk", sans-serif;
  --tap: 44px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-l);
  --feed-w: 340px;
  --detail-w: 380px;
  --chrome-h: 0px;
  --sheet-collapsed: 52px;
  --sheet-half: 38vh;
  --sheet-expanded: 72vh;
  --foot-h: 36px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--sans);
  overflow: hidden;
}
body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Release-polish Rule #37 — text wrapping */
h1, h2, h3, .brand .prod, .panel-head h2, .tab-label, #top .wm, .sheet-title {
  text-wrap: balance;
}
p, .note, #feed-list .impact, #detail .row p, .claim, .reason, li .what {
  text-wrap: pretty;
}

.glass {
  background: var(--panel);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
}

/* ---- Full-viewport map (desktop default) ---- */
#map-wrap {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #020308;
  overflow: hidden;
  -ms-touch-action: none;
  touch-action: none;
}
#map {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
#hud {
  position: absolute; left: .75rem; bottom: .75rem;
  z-index: 1;
  max-width: calc(100% - 1.5rem);
  pointer-events: none;
}
#hud .tag {
  display: inline-block;
  font-family: var(--mono); font-size: .65rem; padding: .25rem .5rem;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.55);
  letter-spacing: .05em; margin: 0 .4rem .35rem 0;
}
#hud .muted { color: var(--muted); }

/* ---- Chrome (header + badges + filters) — overlay on desktop ---- */
#chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  pointer-events: none;
}
#chrome > * { pointer-events: auto; }

#top {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -ms-flex-wrap: nowrap; flex-wrap: nowrap;
  padding: .55rem 1rem;
  padding-top: max(.55rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  border-left: 0; border-right: 0; border-top: 0;
  border-radius: 0;
  gap: .55rem;
}
#top > * { margin: 0; }
.brand {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  text-decoration: none; color: var(--text); min-height: var(--tap); min-width: 0;
  -webkit-box-flex: 0; -ms-flex: 0 1 auto; flex: 0 1 auto;
}
.brand img { border-radius: 7px; border: 1px solid rgba(255,255,255,.15); margin-right: .55rem; width: 28px; height: 28px; }
.brand .wm { font-family: var(--brand); font-weight: 700; font-size: 1.05rem; margin-right: .55rem; white-space: nowrap; }
.brand .prod { color: var(--accent-l); font-family: var(--display); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.meta {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: baseline; -ms-flex-align: baseline; align-items: baseline;
  -ms-flex-wrap: nowrap; flex-wrap: nowrap;
  margin-left: auto;
  gap: .15rem .95rem;
  min-width: 0;
}
.meta > div, .meta .stat {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -ms-flex-direction: row; flex-direction: row;
  -webkit-box-align: baseline; -ms-flex-align: baseline; align-items: baseline;
  gap: .35rem;
  white-space: nowrap;
  line-height: 1.2;
}
.meta b { font-family: var(--mono); font-size: .92rem; font-weight: 600; }
.meta span { color: var(--muted); font-size: .78rem; letter-spacing: .01em; }
.top-nav {
  display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: .15rem; -ms-flex-negative: 0; flex-shrink: 0;
}
.nav-link {
  color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 600;
  padding: .35rem .55rem; border-radius: 999px; min-height: 32px;
  display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
.nav-link.on, .nav-link[aria-current="page"] {
  color: var(--accent-l); background: rgba(11,99,243,.16);
}
.nav-link:hover { color: var(--text); }
.sibling {
  color: var(--accent-l); font-size: .8rem; text-decoration: none; white-space: nowrap;
  display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height: var(--tap);
  gap: .25rem; -ms-flex-negative: 0; flex-shrink: 0;
}
.sibling-ico { font-size: .95rem; }
a:focus-visible, button:focus-visible, #feed-list li:focus-visible, .sheet-handle:focus-visible {
  outline: none; box-shadow: var(--focus);
}

#badge-strip {
  padding: .35rem 1rem;
  border-bottom: 1px solid var(--line);
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}
#filters {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  -webkit-transform: translateX(-50%); transform: translateX(-50%);
  z-index: 4;
  max-width: min(720px, calc(100% - 2rem));
  padding: .35rem .55rem;
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--panel-border);
}
.hscroll {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -ms-flex-wrap: nowrap; flex-wrap: nowrap;
  gap: .35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.hscroll::-webkit-scrollbar { height: 4px; }
.hscroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.badge {
  display: inline-block;
  font-family: var(--mono); font-size: .68rem; padding: .28rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; line-height: 1.2; -ms-flex-negative: 0; flex-shrink: 0;
}
.badge.Confirmed { color: #9dffb8; border-color: #2f8a4e; background: #0d2a18; }
.badge.Unverified { color: #ffe29a; border-color: #8a6a20; background: #2a210d; }
.badge.Disputed { color: #ffb086; border-color: #8a3f20; background: #2a140d; }
.badge.Likely\ false, .badge[data-b="Likely false"] { color: #ff9aaa; border-color: #8a2035; background: #2a0d14; }

.filter-btn {
  font-family: var(--mono); font-size: .65rem; padding: .3rem .55rem;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.35);
  color: var(--muted); cursor: pointer; min-height: 32px;
  white-space: nowrap; -ms-flex-negative: 0; flex-shrink: 0;
}
.filter-btn.on, .filter-btn[aria-pressed="true"] {
  color: var(--accent-l); border-color: var(--accent); background: rgba(11,99,243,.18);
}

/* ---- Overlay UI host (panels + popup) ---- */
#ui {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  pointer-events: none;
}
#ui > * { pointer-events: auto; }

/* ---- Collapsible side panels (desktop) ---- */
.panel {
  position: absolute;
  top: 150px;
  bottom: 48px;
  width: var(--feed-w);
  max-width: calc(100vw - 1rem);
  z-index: 4;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -ms-flex-direction: row; flex-direction: row;
  overflow: hidden;
  border-radius: 12px;
  -webkit-transition: width .2s ease, height .2s ease, max-height .2s ease;
  transition: width .2s ease, height .2s ease, max-height .2s ease;
}
#feed { left: .75rem; }
#detail {
  right: .75rem; width: var(--detail-w);
  -webkit-box-orient: horizontal; -webkit-box-direction: reverse;
  -ms-flex-direction: row-reverse; flex-direction: row-reverse;
}
.panel-inner {
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1;
  min-width: 0; min-height: 0; overflow: auto;
  padding: .85rem 1rem 1.25rem;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -ms-flex-direction: column; flex-direction: column;
}
.sheet-handle { display: none; }
.panel-head {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  margin-bottom: .55rem; -ms-flex-negative: 0; flex-shrink: 0;
}
.panel-head h2 {
  font-family: var(--display); font-size: .9rem; margin: 0;
  letter-spacing: .04em; text-transform: uppercase; color: #c5d2ea;
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0;
}
.sheet-count {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  font-weight: 500; margin-left: .35rem; text-transform: none; letter-spacing: 0;
}
.panel-collapse, #detail-close, #detail-close-desk {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; cursor: pointer;
  min-width: var(--tap); min-height: var(--tap);
  font-size: 1rem;
  margin-left: .35rem;
}
.feed-tools {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  gap: .45rem; margin-bottom: .65rem; -ms-flex-negative: 0; flex-shrink: 0;
}
.feed-tools input[type="search"],
.feed-tools select {
  font: .8rem/1.3 var(--sans);
  color: var(--text);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: .35rem .55rem;
}
.feed-tools input[type="search"] {
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0;
}
.feed-tools select {
  -ms-flex-negative: 0; flex-shrink: 0;
  max-width: 7.5rem;
  color: var(--muted);
}
.panel-tab {
  -ms-flex-negative: 0; flex-shrink: 0;
  width: 36px;
  writing-mode: vertical-rl;
  -webkit-text-orientation: mixed; text-orientation: mixed;
  background: rgba(11,99,243,.2);
  border: 0; border-left: 1px solid var(--line);
  color: var(--accent-l);
  cursor: pointer;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em;
  padding: .5rem 0;
  display: none;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  min-height: 120px;
}
#detail .panel-tab { border-left: 0; border-right: 1px solid var(--line); }
.panel.collapsed { width: 40px; bottom: auto; height: auto; max-height: 60vh; }
.panel.collapsed .panel-inner { display: none; }
.panel.collapsed .panel-tab {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  width: 40px; min-height: 140px;
}
#detail[hidden] { display: none !important; }

#feed-list {
  list-style: none; margin: 0; padding: 0; width: 100%;
  -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto;
  min-height: 0; overflow: auto;
}
#feed-list li {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; cursor: pointer;
  background: rgba(255,255,255,0.02);
  width: 100%; margin-bottom: .5rem;
  word-wrap: break-word; overflow-wrap: break-word;
}
#feed-list li:hover, #feed-list li.on { border-color: #2a5fd4; background: rgba(11,99,243,0.12); }
#feed-list .when { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
#feed-list .name { font-weight: 600; margin: .2rem 0; }
#feed-list .sector { font-size: .78rem; color: #a9b7cf; }
#feed-list .impact { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.note { font-size: .72rem; color: var(--muted); line-height: 1.45; margin-top: .85rem; -ms-flex-negative: 0; flex-shrink: 0; }
.feed-empty, .feed-error {
  border: 1px dashed var(--line); border-radius: 10px; padding: 1rem;
  color: var(--muted); font-size: .85rem;
}
.feed-error { color: #ff9aaa; border-color: #8a2035; }
.panel-scroll { min-width: 0; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; overflow: auto; }
#detail .row { margin: 0 0 .65rem; }
#detail .row > span {
  display: block; font-size: .65rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: .15rem;
}
#detail .row b, #detail .row p {
  margin: 0; font-weight: 500; font-size: .88rem;
  word-wrap: break-word; overflow-wrap: break-word;
}
#detail h3 {
  font-family: var(--display); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .04em; color: #c5d2ea; margin: 1rem 0 .5rem;
}
#d-sources, #d-attr { list-style: none; padding: 0; margin: 0 0 1rem; }
#d-sources li, #d-attr li { margin-bottom: .5rem; }
#d-sources a, #d-attr a {
  color: var(--accent-l); word-wrap: break-word; overflow-wrap: break-word;
  display: inline-block; min-height: var(--tap); padding: .15rem 0;
}
.attr-card {
  border: 1px solid var(--line); border-radius: 8px; padding: .65rem .75rem;
  background: rgba(255,255,255,0.02);
}
.attr-card .tier { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.attr-card .claim { font-size: .85rem; margin: .35rem 0; word-wrap: break-word; }
.attr-card .reason { font-size: .75rem; color: #a9b7cf; word-wrap: break-word; }

#foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: .4rem 1rem;
  padding-bottom: max(.4rem, env(safe-area-inset-bottom));
  font-size: .7rem; color: var(--muted);
  border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
  pointer-events: auto;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: .35rem; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
#foot a { color: var(--accent-l); }
#live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); margin: 0 .15rem; vertical-align: middle;
}

/* ---- Map pin popup ---- */
#map-popup {
  position: absolute;
  z-index: 8;
  width: min(300px, calc(100vw - 1.5rem));
  max-width: 300px;
  padding: .75rem .85rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #2a5fd4;
  background: rgba(8, 12, 22, 0.94);
  -webkit-box-shadow: 0 10px 28px rgba(0,0,0,.45);
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  pointer-events: auto;
}
#map-popup[hidden] { display: none !important; }
#map-popup.map-popup--mobile { width: min(320px, calc(100vw - 1.25rem)); }
.map-popup-close {
  position: absolute;
  top: .35rem; right: .35rem;
  width: var(--tap); height: var(--tap);
  min-width: var(--tap); min-height: var(--tap);
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 1rem; cursor: pointer;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
}
.map-popup-close:hover, .map-popup-close:focus-visible { color: var(--text); background: rgba(255,255,255,.06); }
.map-popup-body { padding-right: 2rem; }
#map-popup .when { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
#map-popup .name {
  font-weight: 600; margin: .25rem 0 .15rem;
  font-size: .95rem; color: var(--text);
  text-wrap: balance;
}
#map-popup .sector { font-size: .78rem; color: #a9b7cf; }
#map-popup .impact {
  font-size: .75rem; color: var(--muted); margin-top: .3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
#map-popup .map-popup-meta {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -ms-flex-wrap: wrap; flex-wrap: wrap;
  gap: .45rem; margin-top: .65rem;
}
#map-popup .map-popup-details {
  font-family: var(--mono); font-size: .72rem;
  min-height: var(--tap); padding: 0 .85rem;
  border-radius: 999px; border: 1px solid var(--accent);
  background: rgba(11,99,243,.18); color: var(--accent-l);
  cursor: pointer;
}
#map-popup .map-popup-details:hover,
#map-popup .map-popup-details:focus-visible { background: rgba(11,99,243,.32); }
#map-popup .map-popup-cluster {
  list-style: none; margin: 0; padding: 0;
  max-height: 220px; overflow: auto;
}
#map-popup .map-popup-cluster > li { margin: 0 0 .35rem; }
#map-popup .map-popup-cluster button {
  display: block; width: 100%; text-align: left;
  min-height: var(--tap); padding: .55rem .65rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--text);
  cursor: pointer;
}
#map-popup .map-popup-cluster button:hover,
#map-popup .map-popup-cluster button:focus-visible {
  border-color: #2a5fd4; background: rgba(11,99,243,.12);
}
#map-popup .map-popup-cluster .when { display: block; margin-bottom: .15rem; }
#map-popup .map-popup-cluster .name { font-size: .85rem; margin: 0; }
#map-popup .map-popup-heading {
  font-family: var(--mono); font-size: .68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 0 0 .5rem; padding-right: 1.5rem;
}
#map:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-l);
}

/* ---- Mobile/tablet: stacked chrome → map → sheet (match app.js isNarrow ≤1100) ---- */
@media (max-width: 1100px) {
  body {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-orient: vertical; -webkit-box-direction: normal;
    -ms-flex-direction: column; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden;
  }

  #chrome {
    position: relative;
    top: auto; left: auto; right: auto;
    -ms-flex-negative: 0; flex-shrink: 0;
    z-index: 5;
    pointer-events: auto;
    background: rgba(8, 10, 14, 0.96);
    border-bottom: 1px solid var(--line);
  }

  #top {
    padding: .35rem .65rem;
    padding-top: max(.35rem, env(safe-area-inset-top));
    gap: .4rem;
    min-height: 0;
  }
  .brand { min-height: 36px; }
  .brand img { width: 22px; height: 22px; margin-right: .4rem; }
  .brand .wm { font-size: .88rem; margin-right: .35rem; }
  .brand .prod { font-size: .72rem; max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; }
  .meta { gap: .15rem .55rem; margin-left: auto; }
  .meta b { font-size: .78rem; }
  .meta span { font-size: .65rem; }
  .meta .stat:last-child span { display: none; } /* "As of" → just date on very tight */
  .sibling { min-height: 36px; font-size: .72rem; }
  .sibling-text { display: none; }
  .nav-link { font-size: .7rem; padding: .28rem .45rem; min-height: 30px; }

  #badge-strip {
    padding: .25rem .65rem;
    border-bottom: 1px solid var(--line);
  }
  .badge { font-size: .6rem; padding: .18rem .42rem; }

  #filters {
    position: relative;
    top: auto; left: auto;
    -webkit-transform: none; transform: none;
    max-width: none; width: 100%;
    margin: 0; padding: .25rem .65rem .35rem;
    border-radius: 0; border: 0; border-top: 1px solid var(--line);
    text-align: left;
    background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .filter-btn { font-size: .6rem; padding: .22rem .45rem; min-height: 28px; }

  #map-wrap {
    position: relative;
    top: auto; right: auto; bottom: auto; left: auto;
    -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    z-index: 0;
  }
  #hud { display: none; }

  #ui {
    position: relative;
    top: auto; right: auto; bottom: auto; left: auto;
    -ms-flex-negative: 0; flex-shrink: 0;
    height: auto;
    z-index: 4;
    pointer-events: none;
    display: block;
  }
  #ui > * { pointer-events: auto; }
  #map-popup {
    position: fixed;
    z-index: 9;
  }

  .panel {
    position: relative;
    top: auto; bottom: auto; left: auto; right: auto;
    width: 100%;
    max-width: none;
    border-radius: 14px 14px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    -webkit-box-orient: vertical; -webkit-box-direction: normal;
    -ms-flex-direction: column; flex-direction: column;
    -webkit-transition: height .22s ease, max-height .22s ease;
    transition: height .22s ease, max-height .22s ease;
  }
  #feed {
    height: var(--sheet-collapsed);
    max-height: var(--sheet-collapsed);
    z-index: 5;
  }
  #feed[data-sheet="half"] {
    height: var(--sheet-half);
    max-height: var(--sheet-half);
  }
  #feed[data-sheet="expanded"] {
    height: var(--sheet-expanded);
    max-height: var(--sheet-expanded);
  }
  #feed.collapsed,
  #feed[data-sheet="collapsed"] {
    height: var(--sheet-collapsed);
    max-height: var(--sheet-collapsed);
  }
  /* Keep panel-inner visible on mobile so list can render when sheet opens */
  #feed.collapsed .panel-inner,
  #feed[data-sheet="collapsed"] .panel-inner {
    display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important;
  }
  #feed[data-sheet="collapsed"] .feed-tools,
  #feed[data-sheet="collapsed"] #feed-list,
  #feed[data-sheet="collapsed"] .note,
  #feed.collapsed .feed-tools,
  #feed.collapsed #feed-list,
  #feed.collapsed .note {
    display: none;
  }

  .panel-tab { display: none !important; }
  .desktop-only { display: none !important; }

  .sheet-handle {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: .45rem;
    min-height: 48px;
    padding: .15rem 0 .35rem;
    cursor: pointer;
    -ms-flex-negative: 0; flex-shrink: 0;
    -webkit-user-select: none; user-select: none;
    touch-action: none;
  }
  .sheet-grip {
    display: block;
    width: 36px; height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
    margin: 0 auto;
    position: absolute;
    left: 50%; top: 6px;
    -webkit-transform: translateX(-50%); transform: translateX(-50%);
  }
  .sheet-handle { position: relative; padding-top: .85rem; }
  .sheet-title {
    font-family: var(--display); font-size: .82rem; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; color: #c5d2ea;
    -webkit-box-flex: 1; -ms-flex: 1; flex: 1;
  }
  .sheet-handle .panel-collapse,
  .sheet-handle #detail-close {
    min-width: 36px; min-height: 36px;
    margin-left: .2rem;
  }

  .panel-inner {
    padding: 0 .75rem .65rem;
    overflow: hidden;
  }
  #feed[data-sheet="half"] .panel-inner,
  #feed[data-sheet="expanded"] .panel-inner {
    overflow: hidden;
  }
  .feed-tools { margin-bottom: .45rem; }
  .feed-tools input[type="search"],
  .feed-tools select { min-height: 34px; font-size: .78rem; }

  #detail {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: min(70vh, 560px);
    max-height: 70vh;
    z-index: 8;
    border-radius: 14px 14px 0 0;
  }
  #detail.collapsed {
    height: 52px; max-height: 52px; width: 100%;
  }
  #detail.collapsed .panel-scroll { display: none; }
  #detail .panel-inner { overflow: hidden; }
  #detail:not(.collapsed) .panel-scroll { overflow: auto; }

  #foot {
    position: relative;
    -ms-flex-negative: 0; flex-shrink: 0;
    padding: .25rem .65rem;
    padding-bottom: max(.25rem, env(safe-area-inset-bottom));
    font-size: .62rem;
    gap: .25rem;
    z-index: 5;
  }
  #foot .foot-mid { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { -webkit-transition: none !important; transition: none !important; }
}

#foot .foot-ver {
  margin-left: auto;
  opacity: 0.45;
  font-size: 11px;
  font-family: "DM Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  color: var(--muted, #8d9088);
}
