:root {
  --bg: #05080f;
  --panel: rgba(13, 20, 34, 0.86);
  --panel-solid: #0d1422;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.34);
  --text: #f3f6fb;
  --muted: #9fb0c8;
  --accent: #5ec8ff;
  --accent-2: #ffd166;
  --warn: #ff8a70;
  --radius: 0.9rem;
  font-size: clamp(15px, 0.82vw + 0.55vh, 40px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Helvetica Neue", Arial, system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
[hidden] { display: none !important; }

.ic { width: 1.5rem; height: 1.5rem; flex: none; }
.btn { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 3.2rem; padding: 0.55rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.07); color: var(--text);
  font: inherit; font-size: 1rem; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
.btn:active { transform: scale(0.97); }
.btn.big { min-height: 3.8rem; padding: 0.7rem 1.5rem; font-size: 1.1rem; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); color: #04121c; border-color: var(--accent); font-weight: 600; }
.btn.on { background: #fff; color: #06101c; border-color: #fff; font-weight: 600; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.small { min-height: 2.6rem; padding: 0.3rem 0.85rem; font-size: 0.9rem; }

#topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: 5.2rem; display: flex; align-items: center;
  gap: 1.2rem; padding: 0 1.4rem; background: linear-gradient(180deg, rgba(5,8,15,0.95), rgba(5,8,15,0.55) 75%, transparent); }
#screen-title { font-size: 1.5rem; font-weight: 500; margin: 0; white-space: nowrap; }
#topbar-tools { margin-left: auto; display: flex; gap: 0.7rem; align-items: center; flex-wrap: nowrap; }
/* LungChat sits in its own slot; -0.5rem turns the bar's 1.2rem gap into the tools' 0.7rem. */
#topbar-chat { display: flex; gap: 0.7rem; align-items: center; margin-left: -0.5rem; }
#stage { position: fixed; inset: 0; z-index: 5; }

/* ------------------------------------------------------------ home */
.home { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3.2vh; padding: 4vh 4vw; text-align: center; }
.home h1 { font-size: clamp(2.6rem, 5.2vh, 6rem); font-weight: 300; letter-spacing: 0.02em; margin: 0; }
.home h1 b { font-weight: 600; }
.home p.lead { font-size: 1.35rem; color: var(--muted); margin: 0; max-width: 46rem; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.4rem; width: min(97vw, 112rem); }
@media (max-aspect-ratio: 5/4) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.2rem 1.4rem 1.9rem;
  border-radius: 1.6rem; border: 1px solid var(--line-strong); background: rgba(10, 17, 30, 0.62);
  backdrop-filter: blur(6px); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.tile:active { transform: scale(0.97); border-color: #fff; background: rgba(30, 48, 80, 0.7); }
.tile svg { width: 6.5rem; height: 6.5rem; }
.tile strong { font-size: 1.55rem; font-weight: 500; line-height: 1.2; }
.tile span { font-size: 1rem; color: var(--muted); line-height: 1.35; }
.home footer { font-size: 0.9rem; color: var(--muted); }


/* ------------------------------------------------------------ panels */
.screen { position: absolute; inset: 0; }
.view3d { position: absolute; inset: 0; }
.view3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lab { position: absolute; transform: translate(-50%, -50%); padding: 0.12rem 0.5rem; border-radius: 0.5rem;
  font-size: 0.82rem; white-space: nowrap; color: #fff; text-shadow: 0 0 6px #000, 0 0 3px #000; pointer-events: auto; cursor: pointer; }
/* Selected label: white text, no box, so the cells of a rare state stay visible behind it. */
.lab.sel { font-weight: 700; text-shadow: 0 0 4px #000, 0 0 2px #000, 0 0 1px #000; }
.lab.big { font-size: 1rem; font-weight: 600; }
.panel { position: absolute; z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); padding: 1rem; overflow: hidden; display: flex; flex-direction: column; gap: 0.7rem; }
.panel h3 { margin: 0; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel .scroll { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
.panel.left { top: 5.8rem; left: 1.2rem; bottom: 1.2rem; width: 23rem; }
.panel.right { top: 5.8rem; right: 1.2rem; width: 25rem; max-height: calc(100% - 7rem); }
.seg { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.25rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text); font: inherit; font-size: 0.88rem; cursor: pointer; text-align: left; }
.chip i { width: 0.9rem; height: 0.9rem; border-radius: 50%; flex: none; }
.chip small { color: var(--muted); font-size: 0.78rem; }
.chip.on { border-color: #fff; background: rgba(255,255,255,0.2); }
.chip.off { opacity: 0.38; }
.rowlist { display: flex; flex-direction: column; gap: 0.3rem; }
.rowlist .chip { border-radius: 0.6rem; width: 100%; justify-content: flex-start; }
.rowlist .chip small { margin-left: auto; }
details.acc { border-top: 1px solid var(--line); padding-top: 0.5rem; }
details.acc summary { list-style: none; cursor: pointer; min-height: 2.6rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.98rem; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::before { content: "+"; width: 1.4rem; text-align: center; color: var(--muted); font-size: 1.2rem; }
details.acc[open] summary::before { content: "\2212"; }
details.acc summary em { margin-left: auto; font-style: normal; color: var(--accent); font-size: 0.82rem; }
.note { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.note.warn { color: var(--warn); }
.card-title { font-size: 1.35rem; font-weight: 500; margin: 0; line-height: 1.2; }
.kv { font-size: 0.92rem; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }
select.sel, input.inp { width: 100%; min-height: 3.1rem; padding: 0.4rem 0.9rem; border-radius: 0.7rem; border: 1px solid var(--line-strong);
  background: #0a1220; color: var(--text); font: inherit; font-size: 1rem; user-select: text; -webkit-user-select: text; }
select.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 1.3rem) 55%, calc(100% - 0.9rem) 55%; background-size: 0.4rem 0.4rem; background-repeat: no-repeat; padding-right: 2.4rem; }
label.fld { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.hstack { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.legendbar { height: 0.9rem; border-radius: 0.5rem; background: linear-gradient(90deg, #39425a, #4b2a8c, #b5367a, #f1605d, #ffd166); }
.legendrow { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.progress { height: 0.6rem; border-radius: 0.4rem; background: rgba(255,255,255,0.12); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.hint { position: absolute; z-index: 9; left: 50%; bottom: 1.3rem; transform: translateX(-50%); padding: 0.5rem 1.2rem; border-radius: 999px;
  background: rgba(8, 13, 24, 0.72); border: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); pointer-events: none; white-space: nowrap; }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--muted); pointer-events: none; }

/* split view */
.split { position: absolute; inset: 5.4rem 0 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0 0.6rem 0.6rem; }
.pane { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(4, 7, 13, 0.6); }
.pane .panel.left { top: 0.8rem; left: 0.8rem; bottom: 0.8rem; width: 19rem; }
.pane iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.pane .pane-tag { position: absolute; z-index: 9; top: 0.8rem; right: 0.8rem; display: flex; gap: 0.4rem; }

/* sheet: a site page in 2D */
#sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #05080f; }
#sheet-bar { height: 5rem; flex: none; display: flex; align-items: center; gap: 1rem; padding: 0 1.2rem; border-bottom: 1px solid var(--line); }
#sheet-title { font-size: 1.15rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet-tools { margin-left: auto; display: flex; gap: 0.6rem; }
#sheet-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }

/* chat */
.chat { position: absolute; inset: 5.6rem 0 0 0; display: grid; grid-template-rows: auto 1fr; gap: 0.8rem; padding: 0 1.4rem 1.2rem; }
.chat-ask { display: flex; flex-direction: column; gap: 0.7rem; max-width: 80rem; width: 100%; margin: 0 auto; }
.chat-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; position: relative; }
.chat-frame iframe { width: 100%; height: 100%; border: 0; }
.chat-frame .loading { color: #456; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: #567; font-size: 1.2rem; background: #eef2f7; }

/* keyboard */
#kbd { position: fixed; z-index: 80; left: 50%; bottom: 0.8rem; transform: translateX(-50%); width: min(96vw, 64rem); padding: 0.8rem;
  border-radius: 1.2rem; background: #0b1322; border: 1px solid var(--line-strong); box-shadow: 0 1rem 3rem rgba(0,0,0,0.6); }
#kbd .krow { display: flex; gap: 0.4rem; justify-content: center; margin-top: 0.4rem; }
#kbd button { flex: 1 1 0; min-width: 0; height: 3.6rem; border-radius: 0.6rem; border: 1px solid var(--line); background: rgba(255,255,255,0.08);
  color: var(--text); font: inherit; font-size: 1.25rem; cursor: pointer; }
#kbd button:active { background: #fff; color: #000; }
#kbd button.wide { flex: 2.2 1 0; font-size: 1rem; }
#kbd button.space { flex: 7 1 0; }
#kbd button.go { background: var(--accent); color: #04121c; border-color: var(--accent); font-weight: 600; }
#kbd .ksug { display: flex; gap: 0.4rem; min-height: 2.8rem; flex-wrap: wrap; }

#toast { position: fixed; z-index: 90; left: 50%; top: 6rem; transform: translateX(-50%); padding: 0.8rem 1.4rem; border-radius: 0.8rem;
  background: #16233a; border: 1px solid var(--line-strong); font-size: 1rem; max-width: 80vw; text-align: center; }

/* tree / network screen */
.layer-tag { position: absolute; transform: translate(-50%, -50%); font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-2); text-shadow: 0 0 6px #000; pointer-events: none; white-space: nowrap; }
.node-tag { position: absolute; transform: translate(-50%, -140%); font-size: 0.86rem; color: #fff; text-shadow: 0 0 6px #000, 0 0 3px #000;
  white-space: nowrap; pointer-events: auto; cursor: pointer; padding: 0.15rem 0.5rem; border-radius: 0.5rem; }
.node-tag.grp { font-size: 1rem; font-weight: 600; }
.node-tag.sel { background: #fff; color: #06101c; text-shadow: none; }
.dsrow { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.7rem; border-radius: 0.6rem; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); cursor: pointer; font-size: 0.9rem; text-align: left; color: var(--text); font-family: inherit; width: 100%; }
.dsrow small { color: var(--muted); }
.modeswitch { display: flex; gap: 0.6rem; }
.modeswitch .btn svg { width: 2rem; height: 2rem; }
.netbar { position: absolute; z-index: 12; top: 5.8rem; left: 1.2rem; display: flex; gap: 0.6rem; align-items: center;
  padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); max-width: calc(100% - 30rem); }
.netbar span { font-size: 0.95rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the 3D view keeps clear of its side panels */
.view3d.with-left { left: 25.4rem; }
/* On the full-screen 3D screens the cloud keeps below the title bar and above the hint. */
.screen > .view3d.with-left { top: 5.6rem; bottom: 4rem; }
.view3d.with-right { right: 27.4rem; }
.pane .view3d.with-left { left: 20.6rem; }
.view3d .view3d { left: 0; right: 0; }
.scroll::-webkit-scrollbar { width: 0.5rem; }
.scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.28); border-radius: 0.3rem; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.28) transparent; }

.labels.with-right { right: 27.4rem; }

/* network node card */
table.stats { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.stats td { padding: 0.28rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
table.stats td:last-child { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.panel.right { overflow-y: auto; touch-action: pan-y; }

/* hover pop-up on a tree node */
.pop { position: absolute; z-index: 14; width: 24rem; padding: 0.8rem 0.9rem; border-radius: 0.8rem; background: rgba(10, 17, 30, 0.96);
  border: 1px solid var(--line-strong); box-shadow: 0 0.6rem 2rem rgba(0,0,0,0.6); pointer-events: none; display: flex; flex-direction: column; gap: 0.35rem; }
.pop b { font-size: 1.05rem; font-weight: 600; }
.pop table.stats { font-size: 0.86rem; }

/* compact gene legend: the explanation opens on mouse-over or tap */
.glegend { position: absolute; z-index: 10; right: 0.7rem; bottom: 0.7rem; width: 11.5rem; padding: 0.5rem 0.65rem; border-radius: 0.7rem;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 0.3rem; cursor: help; }
.glegend .gl-head { display: flex; align-items: center; gap: 0.4rem; font-size: 1rem; }
.glegend .gl-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glegend .gl-tags { margin: 0.15rem 0 0.1rem; }
.glegend .gl-tag { flex: none; white-space: nowrap; font-size: 0.68rem; padding: 0.05rem 0.4rem; border-radius: 0.5rem; border: 1px solid var(--accent-2); color: var(--accent-2); }
.glegend .gl-i { margin-left: auto; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.72rem;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.glegend .legendbar { height: 0.6rem; }
.glegend .gl-more { display: none; }
.glegend:hover, .glegend.open { width: 19rem; }
.glegend:hover .gl-more, .glegend.open .gl-more { display: block; }

/* network workspace: one pane or two, each with its own selectors */
.netws { position: absolute; z-index: 15; inset: 5.4rem 0 0 0; background: var(--bg); display: flex; flex-direction: column; gap: 0.5rem; padding: 0 0.7rem 0.7rem; }
.netws-bar { display: flex; align-items: center; gap: 0.7rem; flex: none; }
.netpanes { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.netpanes.two { grid-template-columns: 1fr 1fr; }
.netpane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(4, 7, 13, 0.6); }
.netctl { flex: none; display: flex; gap: 0.6rem; padding: 0.6rem 0.7rem; align-items: flex-end; border-bottom: 1px solid var(--line); background: rgba(13, 20, 34, 0.7); }
.netctl .fld { flex: 1 1 0; min-width: 0; }
.netctl .fld.grow { flex: 1.6 1 0; }
.netctl .fld.narrow { flex: 0.55 1 0; }
.netctl select.sel { min-height: 2.8rem; font-size: 0.92rem; }
.netbody { position: relative; flex: 1 1 auto; min-height: 0; }
.netview { position: absolute; inset: 0 19.6rem 0 0; }
.netview canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.netbody .labels { right: 19.6rem; }
.netbody .loading { right: 19.6rem; text-align: center; padding: 0 2rem; }
.panel.netcard { top: 0.6rem; right: 0.6rem; bottom: 0.6rem; width: 18.4rem; overflow-y: auto; touch-action: pan-y; }
.netpanes.two .netview, .netpanes.two .netbody .labels, .netpanes.two .netbody .loading { right: 16.6rem; }
.netpanes.two .panel.netcard { width: 15.6rem; }
.netpanes.two .netctl { flex-wrap: wrap; }
.netpanes.two .netctl .fld { flex: 1 1 45%; }
.netpanes.two .netctl .fld.narrow { flex: 1 1 20%; }

.chat-frame .btn:not(.primary) { background: #101a2c; color: #fff; border-color: #101a2c; }

/* developmental time-lapse */
.tlbar { position: absolute; z-index: 11; top: 0.6rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.8rem; align-items: center;
  padding: 0.55rem 0.9rem; border-radius: 1.2rem; background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(8px);
  width: min(38rem, calc(100% - 1.6rem)); box-sizing: border-box; }
.tlmain { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1 1 auto; }
.tlstage { font-size: 1.2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlsub { font-size: 0.8rem; color: var(--muted); }
.tldots { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tldot { width: 0.85rem; height: 0.85rem; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }
.tldot.past { background: rgba(255,255,255,0.28); }
.tldot.on { background: var(--accent); border-color: var(--accent); }

/* cell communication list */
.commbox .rowlist .chip { flex-wrap: wrap; }
.commbox .rowlist .chip .note { flex-basis: 100%; text-align: left; font-size: 0.8rem; }

/* a wider right panel for the programs and mechanism drill-downs */
.panel.right.wide { width: 30rem; bottom: 1.2rem; max-height: none; }
.view3d.with-right:has(~ .panel.right.wide) { right: 32.4rem; }

/* developmental programs */
.pg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.pg-cell { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.4rem; border-radius: 0.7rem; border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  color: var(--text); font-family: inherit; text-align: left; cursor: pointer; min-width: 0; }
.pg-cell svg { width: 100%; height: 3.4rem; display: block; }
.pg-cell b { font-size: 0.74rem; font-weight: 600; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.7rem; }
.pg-cell small { font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-cell.on { border-color: #fff; background: rgba(255,255,255,0.14); }
.pg-cell.off { opacity: 0.4; }
.pg-now { fill: rgba(255,255,255,0.2); }
.pg-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.pg-title i { width: 0.9rem; height: 0.9rem; border-radius: 50%; flex: none; }

/* signalling mechanisms */
.mx-row { align-items: center; gap: 0.6rem; }
.mx-main { display: flex; flex-direction: column; min-width: 0; text-align: left; flex: 1 1 auto; }
.mx-main b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-main small, .mx-side small { margin: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; flex: none; }
.mx-dots { display: inline-flex; gap: 0.18rem; }
.mx-dots i { width: 1.15rem; height: 1.15rem; border-radius: 50%; font-style: normal; font-size: 0.62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); color: var(--muted); background: transparent; }
.mx-dots i.on { background: var(--accent); border-color: var(--accent); color: #06121f; }
.mx-tag { align-self: flex-start; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.15rem 0.6rem; border-radius: 0.6rem; border: 1px solid var(--accent-2); color: var(--accent-2); }
.mx-step { display: flex; gap: 0.7rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.mx-step .stack { min-width: 0; flex: 1 1 auto; gap: 0.4rem; }
.mx-n { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.mx-gene { border-width: 2px; }
.screen:has(> .panel.right.wide) > .hint { left: calc(25.4rem + (100% - 57.8rem) / 2); max-width: calc(100% - 59rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the 3D temporal pattern of one gene */
.trajws .netpane { flex: 1 1 auto; }
.trajws .netws-bar .fld { flex: none; }
.trajws .netws-bar .fld.grow { flex: 0 1 24rem; }
.lab.axis { font-size: 0.72rem; color: var(--muted); background: transparent; border: 0; padding: 0; white-space: nowrap; }

/* lung-wide signalling */
.mx-bar { display: block; width: 6.5rem; height: 0.35rem; border-radius: 0.2rem; background: rgba(255,255,255,0.1); overflow: hidden; }
.mx-bar i { display: block; height: 100%; }
.mx-matrix { display: grid; gap: 0.25rem; align-items: center; font-size: 0.74rem; }
.mx-matrix b { font-weight: 600; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-matrix > b:nth-child(n) { text-align: right; }
.mx-cell { min-height: 2.6rem; border-radius: 0.5rem; border: 1px solid var(--line); color: var(--text); font-family: inherit; font-size: 0.85rem; font-variant-numeric: tabular-nums; cursor: pointer; background: transparent; }
.mx-cell.on { border-color: #fff; border-width: 2px; }
.mx-cell:disabled { opacity: 0.35; cursor: default; }
.mx-hub { cursor: default; }
.mx-hub button.mx-side { background: transparent; border: 0; color: inherit; font-family: inherit; cursor: pointer; padding: 0.2rem 0.3rem; border-radius: 0.4rem; }
.mx-hub button.mx-side:hover { background: rgba(255,255,255,0.1); }

/* the 3D alveolus model: cell types on the left, the 3D view, the reading card on the right */
.alvws .netview, .alvws .netbody .labels, .alvws .netbody .loading { left: 17.4rem; right: 25rem; }
.alvws .netws-bar { flex-wrap: wrap; }
.alvws .netpane { flex: 1 1 auto; }
.alvws .fld { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.alvws .netws-bar .fld { flex: none; }
.panel.alv-legend { top: 0.6rem; left: 0.6rem; bottom: 0.6rem; width: 16.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.panel.alv-card { width: 23.8rem; }
.alv-lin { margin-top: 0.5rem; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.alv-row { display: flex; gap: 0.3rem; align-items: stretch; }
.alv-row .chip { flex: 1 1 auto; min-width: 0; min-height: 2.3rem; }
.alv-row .chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7rem; }
.alv-row .alv-eye { min-height: 2.3rem; padding: 0 0.55rem; font-size: 0.74rem; border-radius: 0.6rem; }
.alv-hud { position: absolute; left: 18rem; bottom: 0.9rem; z-index: 6; padding: 0.6rem 0.9rem; border-radius: 0.9rem; background: var(--panel); border: 1px solid var(--line);
  font-size: 0.84rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.18rem; min-width: 17rem; pointer-events: none; }
.alv-hud b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; float: right; margin-left: 1rem; }
.alv-bar { height: 0.4rem; border-radius: 0.2rem; background: rgba(255,255,255,0.12); overflow: hidden; margin-bottom: 0.25rem; }
.alv-bar i { display: block; height: 100%; background: var(--accent); }
.alv-src { display: flex; flex-direction: column; gap: 0.12rem; padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.alv-src b { color: var(--text); font-weight: 500; }
.alv-src a { color: var(--accent); text-decoration: none; }
.alv-dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: -0.05rem; }
table.alv-nb th { text-align: left; font-weight: 500; font-size: 0.76rem; color: var(--muted); padding-bottom: 0.2rem; }
table.alv-nb td, table.alv-nb th { text-align: right; } table.alv-nb td:first-child, table.alv-nb th:first-child { text-align: left; color: var(--text); }
.alvws .lab { font-size: 0.8rem; }

/* Current volumetric model: same-origin assets, with a separate archive route. */
.alv-volume-workspace { gap: 0; }
.alv-volume-frame { display: block; flex: 1 1 auto; width: 100%; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #192b36; }
.alv-archive-note { color: var(--muted); font-size: 0.85rem; }

.screen.alveolus-open > :not(.netws) { visibility: hidden; pointer-events: none; }

/* candidate cell states in 3D (js/candidates.js): three linked maps of one viewer job on black, the menus on the left */
.screen.cand-open > :not(.netws) { visibility: hidden; pointer-events: none; }
.candws { background: #000; }
.cand-head { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.cand-head strong { font-size: 1.15rem; font-weight: 600; }
.cand-body { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 0.6rem; }
.panel.cand-rail { position: relative; min-height: 0; }
.cand-stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.cand-maps { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.cand-maps[hidden], .cand-dot[hidden], .cand-pick[hidden], .cand-hint[hidden] { display: none; }
.cand-map { position: relative; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; }
.cand-view { position: absolute; inset: 0; }
.cand-cap { position: absolute; z-index: 3; top: 0.55rem; left: 0.75rem; right: 0.75rem; font-size: 0.92rem; font-weight: 600; pointer-events: none; text-shadow: 0 0 4px #000, 0 0 2px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-tip { position: absolute; z-index: 6; pointer-events: none; padding: 0.45rem 0.75rem; border-radius: 0.6rem; background: rgba(8, 13, 24, 0.94);
  border: 1px solid var(--line-strong); font-size: 0.86rem; line-height: 1.45; max-width: 22rem; }
.cand-hint { flex: none; text-align: center; }
.cand-stage > .loading { z-index: 4; padding: 2rem; text-align: center; line-height: 1.5; }
.cand-stage > .loading.warn { color: var(--accent-2); }
.cand-scale { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cand-scale i { flex: 1 1 auto; height: 0.6rem; border-radius: 0.3rem; }
.cand-legend { display: flex; flex-direction: column; gap: 0.2rem; }
.cand-row { display: flex; align-items: center; gap: 0.5rem; min-height: 2.1rem; padding: 0.15rem 0.5rem; border-radius: 0.5rem; border: 1px solid transparent;
  background: transparent; color: var(--text); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; }
.cand-row:hover { border-color: var(--line); }
.cand-row i { width: 0.8rem; height: 0.8rem; border-radius: 50%; flex: none; }
.cand-row span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-row small { color: var(--muted); font-variant-numeric: tabular-nums; }
.cand-row.off { opacity: 0.35; }
.cand-prov b { color: var(--text); font-weight: 600; }
.cand-dot { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #000; padding: 1rem 1.2rem; }
.cand-dotgrid { border-collapse: collapse; font-size: 0.82rem; }
.cand-dotgrid td { width: 2.6rem; height: 1.6rem; text-align: center; vertical-align: middle; padding: 0; }
.cand-dotgrid td i { display: inline-block; border-radius: 50%; vertical-align: middle; }
.cand-dotgrid th.rowhead { text-align: right; padding-right: 0.7rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cand-dotgrid th.axis { vertical-align: middle; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.cand-dotgrid th.collabel { height: 8rem; width: 2.6rem; position: relative; padding: 0; }
.cand-dotgrid th.collabel span { position: absolute; top: 0.4rem; left: 50%; transform-origin: 0 0; transform: rotate(45deg); white-space: nowrap; font-weight: 400; color: var(--text); }
.cand-dotlegend { margin-top: 0.8rem; }
.cand-pick, .cand-optbtn { display: none; }

/* ============================================================ phones and tablets
   The kiosk and desktop layout above is unchanged. Below 1200px wide, or under 576px tall (a phone held
   sideways), the screens switch to a compact layout; js/layout.js holds the same query (COMPACT).
   - The top bar wraps and is measured: --top is its height in px (layout.js trackTopbar).
   - A 3D screen's side panels open one at a time from a bar at the bottom (.mdock, layout.js panelDock):
     a drawer beside the view, or on a phone held upright a sheet below it. The view keeps the rest.
   - Lists and button rows scroll sideways instead of running off the screen.
   Positional overrides carry !important because the desktop rules use :has() and long selectors. */
:root { --top: 0px; }
.mdock, .pane-ctl { display: none; }

@media (max-width: 1199.98px), (max-height: 575.98px) {
  :root { --drawer-l: min(23rem, 46vw); --drawer-r: min(28rem, 52vw); --sheet: 0px; }
  .screen { --dock: 0px; }
  .screen.has-dock { --dock: calc(3.5rem + env(safe-area-inset-bottom)); }
  select.sel, input.inp { font-size: max(16px, 1rem); }   /* iOS zooms the page into any field under 16px */

  /* top bar: Home, title and LungChat on one row; the screen's own tools scroll sideways */
  #topbar { height: auto; min-height: 3.4rem; flex-wrap: wrap; gap: 0.4rem 0.6rem; background: rgba(5, 8, 15, 0.97); border-bottom: 1px solid var(--line);
    padding: calc(0.4rem + env(safe-area-inset-top)) calc(0.6rem + env(safe-area-inset-right)) 0.4rem calc(0.6rem + env(safe-area-inset-left)); }
  #topbar .btn, #topbar .btn.big { min-height: 2.6rem; padding: 0.3rem 0.85rem; font-size: 0.92rem; flex: none; }
  #topbar .modeswitch .btn svg { width: 1.3rem; height: 1.3rem; }
  #topbar .kv { white-space: nowrap; font-size: 0.85rem; }
  #screen-title { flex: 0 1 auto; min-width: 4rem; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; }
  #topbar-tools { order: 2; flex: 1 1 0; min-width: 0; margin-left: 0; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; }
  #topbar-tools::-webkit-scrollbar { display: none; }
  #topbar-tools > :first-child { margin-left: auto; }
  #topbar-tools:empty { display: none; }
  #topbar-chat { order: 3; margin-left: auto; }
  #topbar-tools:not(:empty) ~ #topbar-chat { margin-left: 0; }

  /* home */
  .home { justify-content: flex-start; overflow-y: auto; touch-action: pan-y; gap: 1.1rem;
    padding: calc(1.4rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(1.4rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left)); }
  .home h1 { font-size: 2.2rem; }
  .home p.lead { font-size: 1rem; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)) !important; gap: 0.7rem; width: min(100%, 66rem); }
  .tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 0.95rem; row-gap: 0.2rem;
    padding: 0.95rem 1rem; border-radius: 1rem; text-align: left; }
  .tile > span:first-child { grid-row: 1 / span 2; display: flex; }
  .tile svg { width: 3.2rem; height: 3.2rem; }
  .tile strong { font-size: 1.12rem; }
  .tile span { font-size: 0.86rem; }

  /* 3D screens with side panels: the view takes the space the open panel leaves */
  .screen.has-dock > .view3d, .screen.has-dock > .labels { top: var(--top) !important; bottom: calc(var(--dock) + var(--sheet)) !important; left: 0 !important; right: 0 !important; }
  .screen.has-dock[data-open="left"] > .view3d, .screen.has-dock[data-open="left"] > .labels { left: var(--drawer-l) !important; }
  .screen.has-dock[data-open="right"] > .view3d, .screen.has-dock[data-open="right"] > .labels { right: var(--drawer-r) !important; }
  .screen.has-dock > .panel.left, .screen.has-dock > .panel.right { display: none; top: var(--top) !important; bottom: var(--dock) !important;
    max-height: none !important; border-radius: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain;
    padding-bottom: 1.2rem; }
  .screen.has-dock > .panel.left { left: 0 !important; width: var(--drawer-l) !important; border-width: 0 1px 0 0; padding-left: calc(1rem + env(safe-area-inset-left)); }
  .screen.has-dock > .panel.right { right: 0 !important; width: var(--drawer-r) !important; border-width: 0 0 0 1px; padding-right: calc(1rem + env(safe-area-inset-right)); }
  .screen.has-dock[data-open="left"] > .panel.left, .screen.has-dock[data-open="right"] > .panel.right { display: flex; }
  .screen.has-dock > .panel > .scroll:not([style*="max-height"]) { flex: none; overflow: visible; }   /* the panel scrolls as a whole; a box with its own height keeps its scroll */
  .screen.has-dock > .hint { bottom: calc(var(--dock) + 0.6rem) !important; left: 50% !important; max-width: calc(100% - 1.6rem) !important;
    white-space: normal !important; text-align: center; font-size: 0.8rem; padding: 0.35rem 0.9rem; }
  .screen.has-dock[data-open="left"] > .hint, .screen.has-dock[data-open="right"] > .hint { display: none; }
  .mdock { display: flex; position: absolute; z-index: 12; left: 0; right: 0; bottom: 0; height: var(--dock); gap: 0.5rem;
    padding: 0.45rem calc(0.6rem + env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) calc(0.6rem + env(safe-area-inset-left));
    background: var(--panel-solid); border-top: 1px solid var(--line); }
  .mdock .btn { flex: 1 1 0; min-width: 0; min-height: 0; justify-content: center; font-size: 0.95rem; }
  .mdock .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pop { max-width: calc(100% - 1rem); }

  /* two linked UMAPs: each pane folds its panel behind an Options button */
  .split { inset: var(--top) 0 0 0 !important; gap: 0.4rem; padding: 0.4rem calc(0.4rem + env(safe-area-inset-right)) calc(0.4rem + env(safe-area-inset-bottom)) calc(0.4rem + env(safe-area-inset-left)); }
  .pane .view3d.with-left { left: 0 !important; }
  .pane > .panel.left { display: none; }
  .pane.m-open > .panel.left { display: flex; z-index: 12; top: 3.5rem; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; width: auto; max-width: 22rem;
    overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
  .pane > .panel.left > .scroll { flex: none; overflow: visible; }
  .pane-ctl { display: inline-flex; position: absolute; z-index: 11; top: 0.5rem; left: 0.5rem; background: var(--panel-solid); }
  .pane:has(> iframe:not([hidden])) > .pane-ctl { display: none; }
  .glegend:hover, .glegend.open { width: min(19rem, calc(100% - 1.4rem)); }

  /* workspaces over a screen: networks, the temporal 3D plot, the alveolus models */
  .netws { inset: var(--top) 0 0 0 !important; gap: 0.4rem; padding: 0.4rem calc(0.4rem + env(safe-area-inset-right)) calc(0.4rem + env(safe-area-inset-bottom)) calc(0.4rem + env(safe-area-inset-left)); }
  .netws-bar { flex-wrap: nowrap !important; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; gap: 0.5rem; }
  .netws-bar::-webkit-scrollbar { display: none; }
  .netws-bar > * { flex: none !important; }
  .netws-bar > .note { display: none; }
  .netws-bar .btn { min-height: 2.6rem; padding: 0.3rem 0.85rem; font-size: 0.92rem; }
  .netws-bar .fld.grow { width: 15rem; }
  .netctl, .netpanes.two .netctl { flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; gap: 0.5rem; padding: 0.4rem 0.5rem; }
  .netctl .fld, .netpanes.two .netctl .fld { flex: 0 0 11rem; }
  .netctl .fld.grow, .netpanes.two .netctl .fld.grow { flex: 0 0 15rem; }
  .netctl .fld.narrow, .netpanes.two .netctl .fld.narrow { flex: 0 0 7.5rem; }
  .netctl select.sel { min-height: 2.5rem; }
  .netview, .netbody .labels, .netbody .loading { right: min(19.6rem, 46%) !important; }
  .panel.netcard { width: calc(min(19.6rem, 46%) - 1.2rem) !important; }
  .alvws .netview, .alvws .netbody .labels, .alvws .netbody .loading { left: 0 !important; right: 0 !important; }
  .panel.alv-legend { bottom: auto; width: min(16.2rem, 44%); max-height: 46%; overflow-y: auto; touch-action: pan-y; }
  .panel.alv-card { top: auto !important; left: 0.6rem !important; right: 0.6rem !important; bottom: 0.6rem !important; width: auto !important; max-height: 40%; }
  .alv-hud { display: none; }

  /* LungChat */
  .chat { inset: var(--top) 0 0 0 !important; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; padding: 0.5rem calc(0.5rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.5rem + env(safe-area-inset-left)); }
  .chat-ask .chips { flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; }
  .chat-ask .chip { flex: none; white-space: nowrap; }
  .chat-ask .inp { min-height: 3rem !important; }
  .chat-ask .btn.big { min-height: 3rem; padding: 0.5rem 1.1rem; }
  .chat-empty { font-size: 1rem; }

  /* a site page in 2D */
  #sheet-bar { height: auto; min-height: 3.4rem; gap: 0.6rem;
    padding: calc(0.4rem + env(safe-area-inset-top)) calc(0.6rem + env(safe-area-inset-right)) 0.4rem calc(0.6rem + env(safe-area-inset-left)); }
  #sheet-back.btn.big { min-height: 2.6rem; padding: 0.3rem 0.9rem; font-size: 0.95rem; flex: none; }
  #sheet-title { flex: 1 1 0; min-width: 0; font-size: 0.95rem; }

  /* the suggestion row above the device keyboard (keyboard.js); the kiosk keys stay hidden */
  #kbd.msug { left: 0; right: 0; bottom: auto; width: auto; transform: none; padding: 0.4rem calc(0.5rem + env(safe-area-inset-right)) 0.4rem calc(0.5rem + env(safe-area-inset-left)); border-radius: 0; }
  #kbd.msug .krow { display: none; }
  #kbd.msug .ksug { flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; min-height: 0; scrollbar-width: none; }
  #kbd.msug .chip { flex: none; white-space: nowrap; }

  #toast { top: calc(var(--top) + 0.6rem); max-width: calc(100vw - 1.5rem); font-size: 0.92rem; }

  /* time-lapse bar: Pause, the stage and Stop on top, the stage dots on their own full-width row.
     Each dot is a 24 x 24 px target (WCAG 2.2 SC 2.5.8) around the same small visible dot. */
  .tlbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 0.6rem; row-gap: 0.25rem; align-items: center; }
  .tlbar > .btn:first-child { grid-column: 1; grid-row: 1 / span 2; }
  .tlbar > .btn:last-child { grid-column: 3; grid-row: 1 / span 2; }
  .tlmain { display: contents; }
  .tlstage { grid-column: 2; grid-row: 1; }
  .tlsub { grid-column: 2; grid-row: 2; }
  .tldots { grid-column: 1 / -1; grid-row: 3; gap: 0; justify-content: center; }
  .tlbar .tldot, .tlbar .tldot.on, .tlbar .tldot.past { position: relative; width: max(24px, 1.6rem); height: max(24px, 1.6rem); border: 0; background: none; }
  .tlbar .tldot::before { content: ""; position: absolute; inset: calc(50% - 0.425rem); border-radius: 50%; border: 1px solid var(--line-strong); }
  .tlbar .tldot.past::before { background: rgba(255, 255, 255, 0.28); }
  .tlbar .tldot.on::before { background: var(--accent); border-color: var(--accent); }
}

/* a phone held upright: panels open as a sheet under the view, the two panes and networks stack */
@media (max-width: 767.98px) and (min-height: 576px) {
  .screen.has-dock[data-open="left"], .screen.has-dock[data-open="right"] { --sheet: calc((100% - var(--top) - var(--dock)) * 0.58); }
  .screen.has-dock[data-open] > .view3d, .screen.has-dock[data-open] > .labels { left: 0 !important; right: 0 !important; }
  .screen.has-dock > .panel.left, .screen.has-dock > .panel.right { top: auto !important; left: 0 !important; right: 0 !important; width: auto !important;
    height: var(--sheet); border-width: 1px 0 0 0; border-radius: 1rem 1rem 0 0;
    padding-left: calc(1rem + env(safe-area-inset-left)); padding-right: calc(1rem + env(safe-area-inset-right)); }
  #topbar-tools { order: 4; flex: 1 0 100%; }
  #topbar-tools > :first-child { margin-left: 0; }
  #topbar-tools:not(:empty) ~ #topbar-chat { margin-left: auto; }
  .netview, .netbody .labels, .netbody .loading { right: 0 !important; bottom: 42%; }
  .panel.netcard { top: auto !important; left: 0.4rem; right: 0.4rem !important; bottom: 0.4rem !important; width: auto !important; height: calc(42% - 0.8rem); }
  .alvws .netview, .alvws .netbody .labels, .alvws .netbody .loading { bottom: 0; }
  /* candidate cell states in 3D: one map at a time (picked above it), the menus over the maps on demand */
  .cand-body { grid-template-columns: minmax(0, 1fr); }
  .panel.cand-rail { display: none; position: absolute; z-index: 12; top: 0; left: 0; bottom: 0; width: min(22rem, 100%); }
  .candws.rail-open .panel.cand-rail { display: flex; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
  .candws.rail-open .panel.cand-rail > .scroll { flex: none; overflow: visible; }
  .cand-optbtn { display: inline-flex; }
  .cand-pick { display: flex; flex: none; }
  .cand-maps { grid-template-columns: minmax(0, 1fr); }
  .cand-maps > .cand-map { display: none; }
  .cand-maps[data-show="gene"] > .cand-map[data-k="gene"], .cand-maps[data-show="cov"] > .cand-map[data-k="cov"], .cand-maps[data-show="clu"] > .cand-map[data-k="clu"] { display: block; }
  .cand-hint { display: none; }
}

/* any compact screen held upright: two panes or two networks stack instead of standing side by side */
@media (max-width: 1199.98px) and (orientation: portrait) {
  .split { grid-template-columns: 1fr !important; grid-template-rows: 1fr 1fr; }
  .netpanes.two { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

/* a short screen (a phone held sideways): the time-lapse bar keeps to one line of text */
@media (max-height: 575.98px) {
  .tlbar { top: 0.4rem; padding: 0.35rem 0.6rem; gap: 0.5rem; }
  .tlstage { font-size: 1rem; }
  .tlsub { display: none; }
  .tlstage { grid-row: 1 / span 2; }
  .screen.has-dock > .hint { display: none; }   /* the view is under 300 px high; the gesture hint would cover it */
}

/* a phone: Home and LungChat show their icons only */
@media (max-width: 575.98px) {
  #home-btn span, #topbar-chat .btn span { display: none; }
  #home-btn, #topbar-chat .btn { padding: 0.3rem 0.7rem !important; }
}
