/* SOS pop-up (top bar, next to Manifesto). Same Leo window as Manifesto/World. Never over the player. */
body.kids .tvb-sos { display: none !important; }

#leo-pop-body:has(.hbn-sos-paper) {
  background: var(--leo-pop-bg);
  color: var(--leo-pop-fg);
  padding: 0;
  overflow: hidden;
}
.hbn-sos-paper {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  font-family: var(--leo-pop-font);
  color: var(--leo-pop-fg);
}
.hbn-sos {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--leo-pop-font);
  color: var(--leo-pop-fg);
}
.hbn-sos-form { display: flex; gap: 8px; margin: 0; flex: 0 0 auto; }
.hbn-sos-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hbn-sos-input { flex: 1 1 auto; min-width: 0; box-sizing: border-box; padding: 8px 10px; font: 400 16px/1.2 var(--leo-pop-font); border: 2px solid var(--leo-pop-line); background: #fff; color: #111; border-radius: 0; }
.hbn-sos-send { flex: 0 0 auto; margin: 0; padding: 8px 16px; font: 700 13px/1.2 var(--leo-pop-font); letter-spacing: 0.06em; text-transform: uppercase; border: 2px solid var(--leo-pop-line); background: var(--leo-pop-bar); color: var(--leo-pop-bar-fg); cursor: pointer; border-radius: 0; }
.hbn-sos-send:disabled { opacity: 0.6; cursor: default; }
.hbn-sos-meta { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 10px; font-size: 12px; min-height: 16px; flex: 0 0 auto; }
.hbn-sos-status.is-err { font-weight: 700; color: #b91c1c; }
.hbn-sos-note { margin: 2px 0 6px; font-size: 11px; line-height: 1.3; opacity: 0.8; }
.hbn-sos-head { margin: 0 0 6px; font: 700 12px/1.2 var(--leo-pop-font); letter-spacing: 0.14em; text-transform: uppercase; flex: 0 0 auto; }
.hbn-sos-wall { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; font-size: 13px; line-height: 1.35; }
.hbn-sos-wall li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--leo-pop-line); }
.hbn-sos-wall li:first-child { border-top: 0; }
.hbn-sos-text { min-width: 0; overflow-wrap: anywhere; }
.hbn-sos-at { flex: 0 0 auto; font-size: 11px; opacity: 0.7; white-space: nowrap; }
.hbn-sos-empty { display: block !important; opacity: 0.75; }
.hbn-sos-pinned-slot { flex: 0 0 auto; }
.hbn-sos-pinned-slot:empty { display: none; }
.hbn-sos-pinned {
  margin: 0 0 8px;
  padding: 6px 10px 8px 10px;
  border: 1px solid #c9a227;
  border-left-width: 3px;
  background: #f7f1de;
  color: var(--leo-pop-fg);
}
.hbn-sos-pin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 4px; }
.hbn-sos-pin-who {
  font: 700 11px/1.2 var(--leo-pop-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6d12;
}
.hbn-sos-pinned .hbn-sos-at { color: #8a6d12; opacity: 0.9; }
.hbn-sos-pinned .hbn-sos-text {
  display: block;
  color: #111;
  opacity: 1;
}

.hbn-sos-archive { flex: 0 0 auto; margin: 0 0 8px; }
.hbn-sos-archive:empty { display: none; }
.hbn-sos-archive-list { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.35; }
.hbn-sos-archive-list li { padding: 6px 0; border-top: 1px solid var(--leo-pop-line); }
.hbn-sos-archive-list li:first-child { border-top: 0; }
.hbn-sos-archive-who {
  font: 700 11px/1.2 var(--leo-pop-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
}
@media (max-width: 760px) {
  .hbn-sos-paper { padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
}
