/* ============================================================
   Neuron Network Explorer — operations console theme
   Near-black basemap, lime accent, mono numerals.
   Used only by the standalone home/map page (templates/home.html).
   ============================================================ */

:root {
  --bg0: #07090c;
  --bg1: #0b0e12;
  --panel: rgba(10, 13, 17, 0.90);
  --panel-solid: #0c0f13;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ecf1;
  --muted: #7d8b96;
  --accent: #b6f04a;
  --accent-dim: rgba(182, 240, 74, 0.14);
  --amber: #e6a23c;
  --offline: #55606c;
  --blue: #22a7e0;
  --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }

/* ---------- map canvas ---------- */

#map {
  position: absolute;
  inset: 0;
}

/* ---------- boot overlay ---------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.9s ease;
}

#boot.hidden { opacity: 0; pointer-events: none; }

#boot img { width: 260px; opacity: 0.95; }

#boot .boot-line {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

#boot .boot-line .dots {
  /* fixed-width slot: the growing dots must not re-centre (shift) the line */
  display: inline-block;
  width: 1.6em;
  text-align: left;
}

#boot .boot-line .dots::after {
  content: '';
  animation: bootdots 1.6s steps(4, end) infinite;
}

@keyframes bootdots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

#boot .boot-bar {
  width: 220px;
  height: 2px;
  background: var(--line);
  overflow: hidden;
  border-radius: 2px;
}

#boot .boot-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: bootsweep 1.4s ease-in-out infinite;
}

@keyframes bootsweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ---------- header ---------- */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(to bottom, rgba(7, 9, 12, 0.85), rgba(7, 9, 12, 0));
  pointer-events: none;
}

header > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { height: 34px; display: block; }

.brand .wordmark {
  font-size: 14px;
  font-family: var(--font-data);
  letter-spacing: 0.22em;
  color: var(--text);
  text-transform: uppercase;
  border-left: 1px solid var(--line-strong);
  padding-left: 14px;
  line-height: 1;
  white-space: nowrap;
}

/* status strip */

.status-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.status-item { display: flex; align-items: center; gap: 7px; white-space: nowrap; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: livepulse 2.2s ease-in-out infinite;
}

@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.status-strip.reconnecting .live-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.status-strip.reconnecting #ws-state { color: var(--amber); }
.status-strip.offline .live-dot { background: var(--offline); box-shadow: none; animation: none; }

#ws-state { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* buttons */

.btn {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(12, 15, 19, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn.accent {
  border-color: rgba(182, 240, 74, 0.5);
  color: var(--accent);
}

/* coming soon popover */

.popover-anchor { position: relative; }

#coming-soon-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  display: none;
}

#coming-soon-pop.open { display: block; }

#coming-soon-pop .micro { margin-bottom: 6px; }

/* ---------- micro label ---------- */

.micro {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- sidebar ---------- */

#sidebar {
  position: fixed;
  z-index: 30;
  top: 64px;
  left: 12px;
  bottom: 12px;
  width: 358px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

/* branded accent line across the top of the panel */
#sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(182, 240, 74, 0));
  opacity: 0.75;
  pointer-events: none;
}

.panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.panel.active { display: flex; }

.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }

/* idle panel */

.headline {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2px 0 8px;
}

/* servers/clients segmented toggle + filter trees */

.side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.side-toggle .seg {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.side-toggle .seg:hover { color: var(--text); }

.side-toggle .seg.active {
  color: var(--accent);
  border-color: rgba(182, 240, 74, 0.5);
  background: var(--accent-dim);
}

.filter-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.filter-tree[hidden] { display: none; }

.tree-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 0;
  border-radius: 7px;
}

.tree-node:hover { background: rgba(255, 255, 255, 0.04); }

.tree-expand {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.15s;
}

.tree-expand.open { transform: rotate(90deg); color: var(--accent); }

.tree-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.tree-icon { width: 17px; height: 17px; flex-shrink: 0; }

.row-count {
  margin-left: auto;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  padding-left: 8px;
}

.tree-breakdown {
  margin: 0 0 4px 26px;
  padding: 4px 10px;
  border-left: 1px solid var(--line);
}

.bd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3.5px 0;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
}

.bd-row .bd-n {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.filter-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.filter-row:hover { background: rgba(255, 255, 255, 0.04); }

.filter-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-row.disabled {
  color: var(--muted);
  cursor: pointer; /* still clickable: opens contact */
}

.filter-row.disabled input[type="checkbox"] {
  accent-color: var(--offline);
  cursor: pointer;
  opacity: 0.45;
}

.filter-hint {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid rgba(182, 240, 74, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--accent-dim);
  pointer-events: none;
  white-space: nowrap;
}

.filter-row.disabled:hover .filter-hint { display: block; }

.lede {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.lede.tight { margin-bottom: 8px; }

.lede.note {
  font-size: 10.5px;
  line-height: 1.55;
  border-left: 2px solid rgba(182, 240, 74, 0.35);
  padding-left: 10px;
  margin: 4px 0 16px;
}

.lede a { color: var(--accent); }
.lede a:hover { text-decoration: underline; }

.tree-cta {
  padding: 8px 10px 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.tree-cta a { color: var(--accent); }
.tree-cta a:hover { text-decoration: underline; }

/* stat tiles */

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* hero tile: the headline network number gets a faint accent wash */
.stats .stat:first-child {
  background: linear-gradient(160deg, rgba(182, 240, 74, 0.10), rgba(182, 240, 74, 0.02) 55%, transparent);
  border-color: rgba(182, 240, 74, 0.28);
}

/* trending: compact single-row tile */
.stat.trend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat.trend .value { margin-top: 0; }

.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.stat.wide { grid-column: 1 / -1; }

.stat .value {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  margin-top: 5px;
  line-height: 1.1;
}

.stat.wide .value { font-size: 31px; }

.stat .value.text { font-size: 14px; line-height: 1.4; color: var(--accent); font-weight: 500; }
.stat .value.text a {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stat .value.text a:hover { text-decoration: underline; }
.value-icon { width: 18px; height: 18px; }

/* activity feed */

#feed-section {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  flex: 1;
}

#feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

#feed {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

#feed::-webkit-scrollbar { width: 4px; }
#feed::-webkit-scrollbar-thumb { background: var(--line-strong); }

.feed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-data);
  font-size: 10.5px;
  animation: feedin 0.4s ease;
  white-space: nowrap;
  border-radius: 6px;
}

.feed-row:hover { background: rgba(255, 255, 255, 0.03); }

/* entry animation must never touch opacity: a stalled animation would leave
   rows invisible on throttled/headless renderers */
@keyframes feedin {
  from { transform: translateY(-5px); }
  to   { transform: none; }
}

.feed-row .t { color: var(--muted); flex-shrink: 0; }

.feed-row .kind {
  flex-shrink: 0;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.feed-row .kind.hb   { color: var(--accent); border-color: rgba(182, 240, 74, 0.4); }
.feed-row .kind.node { color: var(--blue);   border-color: rgba(34, 167, 224, 0.4); }
.feed-row .kind.link { color: var(--amber);  border-color: rgba(230, 162, 60, 0.4); }

.feed-row .what {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.feed-row .net {
  flex-shrink: 0;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ---------- cell / node panels ---------- */

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.back-btn {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.back-btn:hover { color: var(--accent); border-color: var(--accent); }

.panel h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 2px 0 4px;
  overflow-wrap: anywhere;
}

.node-list { margin-top: 12px; }

.node-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.node-row:hover { border-color: var(--accent); background: var(--accent-dim); }

.node-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.node-dot.active   { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.node-dot.degraded { background: var(--amber); }
.node-dot.offline  { background: var(--offline); }

.node-row .nname { font-family: var(--font-data); font-size: 11px; flex-shrink: 0; }
.node-row .addr {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-row .seen { font-family: var(--font-data); font-size: 10.5px; color: var(--muted); }

/* status pill */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
}

.pill.active   { color: var(--accent); border-color: rgba(182, 240, 74, 0.5); background: var(--accent-dim); }
.pill.degraded { color: var(--amber);  border-color: rgba(230, 162, 60, 0.5);  background: rgba(230, 162, 60, 0.12); }
.pill.offline  { color: var(--muted); }

/* definition rows */

.section { margin-top: 18px; }
.section > .micro { display: block; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}

.kv .k { color: var(--muted); flex-shrink: 0; }
.kv .v {
  font-family: var(--font-data);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.kv .v.accent { color: var(--accent); }

/* identity block */

.identity-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 4px 0;
}

.identity-key .k {
  color: var(--muted);
  font-size: 12.5px;
  flex-shrink: 0;
}

.identity-key code {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--text);
  overflow-wrap: anywhere;
  flex: 1;
}

.icon-btn {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 11px;
  font-family: var(--font-data);
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* audit links */

.audit-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}

.audit-link .k { color: var(--muted); }
.audit-link a {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* requests table */

table.req {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 11px;
}

table.req th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

table.req td {
  padding: 7px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ---------- legend ---------- */

#legend {
  position: fixed;
  z-index: 30;
  left: 384px;
  bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#legend .micro { display: block; margin-bottom: 7px; }

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text);
  padding: 2.5px 0;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-swatch.active   { background: rgba(182, 240, 74, 0.25); border: 1.5px solid var(--accent); }
.legend-swatch.degraded { background: rgba(230, 162, 60, 0.22); border: 1.5px solid var(--amber); }
.legend-swatch.offline  { background: rgba(85, 96, 108, 0.25);  border: 1.5px solid var(--offline); }

/* ---------- freeze overlay ---------- */

.frozen-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(7, 9, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.frozen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 28px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.frozen-msg { font-size: 14px; color: var(--text); }

/* ---------- demo-mode badge ---------- */

.demo-badge {
  position: fixed;
  z-index: 55;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--amber);
  background: rgba(20, 14, 4, 0.92);
  border: 1px solid rgba(230, 162, 60, 0.55);
  border-radius: 999px;
  padding: 7px 16px;
  pointer-events: none;
}

/* ---------- map tooltip ---------- */

#tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  display: none;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.7;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

#tooltip .micro { display: block; margin-bottom: 2px; }
#tooltip .n { color: var(--accent); }

/* ---------- mobile ---------- */

/* pull-up tab: anchored to the bottom edge, opens the sheet */
#sidebar-toggle {
  display: none;
  position: fixed;
  z-index: 45;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 30px;
  padding: 4px 0 6px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  color: var(--accent);
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* sheet resize handle: hidden on desktop; on mobile a wide grab strip with a
   centred pill, draggable to resize the sheet */
.sheet-handle {
  display: none;
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  cursor: grab;
  touch-action: none; /* the drag owns vertical gestures */
}

.sheet-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

@media (max-width: 880px) {
  /* bottom sheet: pull-up tab opens to half; drag the handle to any height */
  #sidebar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 52vh;
    height: 52dvh;
    border-radius: 16px 16px 0 0;
    transform: translateY(calc(100% + 10px));
    transition: transform 0.3s ease, border-radius 0.3s ease;
    z-index: 46;
  }

  #sidebar.sheet-open { transform: none; }
  #sidebar.dragging { transition: none; }
  #sidebar.sheet-max { border-radius: 0; }

  .sheet-handle { display: block; }

  #sidebar-toggle { display: block; }
  #sidebar.sheet-open ~ #sidebar-toggle { display: none; }

  #legend { left: 12px; bottom: 60px; }
  #sidebar.sheet-open ~ #legend { display: none; }

  .status-strip .optional { display: none; }
  .brand .wordmark { display: none; }

  .headline { font-size: 20px; }
  .stat .value { font-size: 22px; }
  .stat.wide .value { font-size: 26px; }
}
