@import url('/fonts/unbounded/700.css');
@import url('/fonts/instrument-sans/latin-400.css');
@import url('/fonts/instrument-sans/latin-ext-400.css');
@import url('/fonts/instrument-sans/latin-500.css');
@import url('/fonts/instrument-sans/latin-ext-500.css');
@import url('/fonts/instrument-sans/latin-600.css');
@import url('/fonts/instrument-sans/latin-ext-600.css');
@import url('/fonts/jetbrains-mono/latin-400.css');
@import url('/fonts/jetbrains-mono/latin-500.css');

:root {
  --bg: #070820; --s1: #0e0f33; --s2: #15174a;
  --line: rgba(244,242,255,.14); --line2: rgba(244,242,255,.08);
  --ink: #f4f2ff; --muted: #a9a6d6; --faint: #8f8cc2;
  --brand: #c13bff; --brand2: #8a2be2;
  --good: #0ca30c; --warn: #fab219; --bad: #d03b3b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.disp { font-family: "Unbounded", "Arial Black", sans-serif; font-weight: 700; letter-spacing: -.03em; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px;
}

#net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; background: var(--s1); border-right: 1px solid var(--line2);
  padding: 24px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.brand .t { display: flex; flex-direction: column; line-height: 1.15; }
.brand .t b { font-size: 15px; }
.brand .t span { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.nav a, .nav .off {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: rgba(244,242,255,.06); }
.nav a[aria-current="page"] { background: rgba(193,59,255,.16); color: var(--ink); }
.nav a[aria-current="page"] svg { stroke: var(--brand); }
.nav .off { opacity: .7; color: var(--faint); }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-weight: 400; }
.userbox { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(244,242,255,.03); }
.userrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.userrow .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.userrow .who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userrow .who span { font-size: 12px; color: var(--faint); }
.linkbtn { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 4px; border: 0; border-radius: 8px; background: none; text-align: left; width: 100%; }
.linkbtn:hover { background: rgba(244,242,255,.05); }
.linkbtn[aria-current="page"] { background: rgba(193,59,255,.16); color: var(--ink); }
.linkbtn[aria-current="page"] svg { stroke: var(--brand); }
.ver { font-size: 11px; color: var(--faint); padding: 2px 4px 0; }

.avatar { position: relative; overflow: hidden; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: linear-gradient(135deg, var(--brand2), var(--brand)); box-shadow: 0 0 0 1px var(--line); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.s36 { width: 36px; height: 36px; }
.avatar.s56 { width: 56px; height: 56px; font-size: 22px; }
.avatar.s84 { width: 84px; height: 84px; font-size: 30px; }

.topbar { display: none; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: rgba(14,15,51,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line2); }
.topbar .brand { padding: 0; }
.topbar .brand img { width: 32px; height: 32px; }
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(14,15,51,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line2); justify-content: space-around;
}
.tabbar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; font-size: 12px; color: var(--muted); min-height: 48px; justify-content: center; }
.tabbar a[aria-current="page"] { color: var(--ink); background: rgba(193,59,255,.16); }
.tabbar a[aria-current="page"] svg { stroke: var(--brand); }

.main { padding: 32px clamp(16px, 3vw, 40px) 64px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.1; }
.page-head p { margin-top: 8px; color: var(--muted); }

/* ---------- primitives ---------- */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card h2 { font-size: 18px; font-weight: 600; }
.card h3 { font-size: 15px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: stretch; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 500; border: 1px solid var(--line); background: rgba(244,242,255,.045); }
.btn:hover { border-color: rgba(193,59,255,.65); }
.btn.p { border: 0; background: linear-gradient(100deg, var(--brand2), var(--brand)); color: #fff; }
.btn.p:hover { filter: brightness(1.12); }
.btn.d { border-color: rgba(208,59,59,.55); background: transparent; }
.btn.d:hover { background: rgba(208,59,59,.12); border-color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--line); white-space: nowrap; }
.chip.admin { border-color: rgba(193,59,255,.65); background: rgba(193,59,255,.16); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); }
.seg button { padding: 6px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--s2); color: var(--ink); font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--s1); font-weight: 500; color: var(--ink); }
.pill[aria-pressed="true"] { border-color: rgba(193,59,255,.65); background: rgba(193,59,255,.16); }
.pill .n { font-size: 12px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty b { color: var(--ink); font-size: 17px; font-weight: 600; }
.note { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(244,242,255,.04); font-size: 14px; line-height: 1.45; color: var(--muted); }
.note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line2); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.kv > :first-child { color: var(--muted); flex: none; }
.kv > :last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* status shapes: always a shape plus a label */
.st { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--good); }
.st[data-s="slow"] { width: 12px; height: 11px; border-radius: 0; background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st[data-s="down"] { border-radius: 2px; background: var(--bad); }
.st[data-s="unknown"], .st[data-s="paused"] { background: transparent; box-shadow: inset 0 0 0 2px var(--faint); }
.st[data-s="paused"] { box-shadow: inset 0 0 0 2px var(--faint), inset 0 0 0 5px var(--s1); }
.stl { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; white-space: nowrap; }

/* day strip */
.strip { display: flex; align-items: flex-end; gap: 1px; height: 24px; width: 100%; max-width: 150px; }
.strip i { flex: 1 1 0; height: 100%; border-radius: 1.5px; background: var(--good); }
.strip i[data-d="s"] { background: var(--warn); height: 66%; }
.strip i[data-d="d"] { background: var(--bad); height: 33%; }
.strip i[data-d="-"] { background: rgba(244,242,255,.14); height: 100%; }
.strip.lg { height: 40px; gap: 3px; max-width: none; }
.strip.lg i { border-radius: 3px; }

/* logos: one colour, from the brand */
.tile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); }
.tile.s28 { width: 28px; height: 28px; border-radius: 9px; }
.tile.s32 { width: 32px; height: 32px; }
.tile.s48 { width: 48px; height: 48px; border-radius: 14px; }
.glyph { display: block; width: 58%; height: 58%; background: var(--brand); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.letter { color: var(--brand); font-weight: 700; line-height: 1; font-size: 15px; }
.tile.s48 .letter { font-size: 20px; }

/* meters / stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; flex: 1 1 360px; }
.stat { padding: 16px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(244,242,255,.03); display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-size: 26px; line-height: 1.15; font-weight: 600; }
.stat .l { font-size: 13px; color: var(--muted); }

/* hero */
.hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; padding: 28px; }
.hero .msg { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero .msg h2 { font-size: clamp(22px, 3.4vw, 28px); line-height: 1.15; display: flex; align-items: center; gap: 14px; }
.hero .msg h2 .st { width: 16px; height: 16px; }
.hero .msg h2 .st[data-s="slow"] { width: 20px; height: 18px; }
.hero .acts { display: flex; flex-wrap: wrap; gap: 12px; }

/* list rows */
.list { display: flex; flex-direction: column; }
.list a.item, .list .item { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; }
.list a.item:hover { background: rgba(244,242,255,.05); }
.item .grow { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.item .right { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.item .right b { font-weight: 500; font-size: 14px; }
.events { display: flex; flex-direction: column; gap: 14px; }
.ev { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.45; }
.ev .tm { flex: none; width: 70px; font-size: 12px; color: var(--muted); padding-top: 3px; }
.ev .st { margin-top: 6px; }

/* services table */
.table { container: table / inline-size; background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 8px; min-width: 0; }
.trow { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1.6fr) 76px 64px 84px 150px 72px; gap: 12px; align-items: center; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: none; text-align: left; }
.trow.head { color: var(--faint); font-size: 13px; border-bottom: 1px solid var(--line2); border-radius: 0; padding-bottom: 12px; cursor: default; }
.trow:not(.head):hover { background: rgba(244,242,255,.05); }
.trow[data-sel="true"] { background: rgba(193,59,255,.14); }
/* The whole row is one link; the Local and Public icons sit above it. */
.rowlink { display: block; min-width: 0; }
.rowlink::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.rowlink b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink:focus-visible { outline: none; }
.rowlink:focus-visible::after { outline: 2px solid var(--ink); outline-offset: -2px; }
.lnks { display: flex; align-items: center; gap: 6px; }
.lnk { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); background: rgba(244,242,255,.03); }
.lnk:hover { border-color: rgba(193,59,255,.65); color: var(--ink); }
.lnk.public svg { stroke: var(--brand); }
.trow .nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trow .nm .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.trow .nm .tx b, .trow .nm .tx .rowlink b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .nm .tx span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r { text-align: right; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 24px; align-items: start; }
.panel { position: sticky; top: 24px; }
.backlink { display: none; align-items: center; gap: 8px; color: var(--muted); padding: 4px 0; border: 0; background: none; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 14px; top: 14px; }
.search input { padding-left: 40px; }

/* service map: hosts on the left, their services in a wide grid on the right */
.node { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; white-space: nowrap; min-width: 0; }
.node.slow { border-color: rgba(250,178,25,.7); }
.node.down { border-color: rgba(208,59,59,.8); }
.node.host { border-color: rgba(193,59,255,.6); border-radius: 14px; }
.node .ms { font-size: 12px; color: var(--muted); margin-left: auto; padding-left: 8px; }
.node .name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.map2 { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 26px 48px; align-items: start; position: relative; }
.mrail { padding-top: 14px; min-width: 0; }
.mframe { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 12px; border: 1px dashed rgba(193,59,255,.35); border-radius: 18px; min-width: 0; }
.mframe.none { visibility: hidden; padding: 0; border: 0; height: 0; }
.node.chip { padding: 10px 12px; }
a.node.chip:hover { border-color: rgba(193,59,255,.65); }
.map2 .tunnel { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flow { stroke-dasharray: 8 8; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .flow { animation: none; } }

/* chart */
.chart { position: relative; height: 220px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart .tip { position: absolute; top: 0; background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart .tip b { display: block; font-size: 18px; }
.chart .tip span { font-size: 12px; color: var(--muted); }
.xl { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 6px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lab { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13px; color: var(--muted); }
.field > label.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 232px; overflow-y: auto; padding: 6px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(244,242,255,.03); }
.ip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--muted); font-size: 12px; min-width: 0; }
.ip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip:hover { background: rgba(244,242,255,.05); }
.ip[aria-checked="true"] { border-color: rgba(193,59,255,.65); background: rgba(193,59,255,.16); color: var(--ink); }
.log { border-top: 1px solid var(--line2); padding: 12px 0; }
.log summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.log ul { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); color: var(--ink);
}
textarea.input { padding: 10px 14px; min-height: 88px; }
.input::placeholder { color: var(--faint); }
.input:focus-visible, .select:focus-visible { outline-offset: 1px; border-color: var(--brand); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.switch .tx { display: flex; flex-direction: column; min-width: 0; }
.switch .tx span { font-size: 13px; color: var(--muted); }
.tg { position: relative; flex: none; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: rgba(244,242,255,.16); }
.tg[aria-checked="true"] { background: var(--brand2); }
.tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.tg[aria-checked="true"]::after { left: 21px; }
.err { color: #ff9b9b; font-size: 14px; }
.ok { color: #7fe07f; font-size: 14px; }
.formbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--s1); color: var(--ink); overflow: hidden; }
dialog::backdrop { background: rgba(3,4,16,.7); backdrop-filter: blur(4px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
dialog .dh { padding: 22px 24px 12px; }
dialog .dh h2 { font-size: 20px; }
dialog .db { padding: 8px 24px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
dialog .df { padding: 16px 24px 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; border-top: 1px solid var(--line2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* member home */
.avatars { display: flex; gap: 12px; flex-wrap: wrap; }
.avatars button { width: 64px; height: 64px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background-size: cover; background-position: center; color: var(--ink); font-weight: 600; font-size: 22px; background-color: var(--s2); }
.avatars button[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(193,59,255,.3); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.app { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--s1); }
a.app:hover { border-color: rgba(193,59,255,.65); background: var(--s2); }
.app b { font-size: 16px; font-weight: 600; }
.home-cols { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }

.loading { color: var(--muted); padding: 24px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.open .listcol { display: none; }
  .split:not(.open) .panel { display: none; }
  .split.open .backlink { display: inline-flex; }
  .panel { position: static; }
  .home-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar, .tabbar { display: flex; }
  .main { padding: 20px 16px 104px; gap: 20px; }
  .card { padding: 18px; border-radius: 18px; }
  .toast { bottom: 88px; }
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 20px; }
  .map2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mrail { padding-top: 0; }
  .mframe { grid-template-columns: minmax(0, 1fr); }
  .map2 .tunnel { display: none; }
  .lnk { width: 36px; height: 36px; }
  dialog .dh, dialog .db, dialog .df { padding-left: 18px; padding-right: 18px; }
  .page-head .btn { width: 100%; }
}

[hidden] { display: none !important; }

.trow.u { grid-template-columns: minmax(0, 1.6fr) minmax(120px, 1fr) 120px; }

/* The list adapts to its own width, so it also works next to the detail panel. */
@container table (max-width: 780px) {
  .trow { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "nm nm st" "strip lnk up"; row-gap: 10px; }
  .trow.head { display: none; }
  .trow > .c-host, .trow > .c-ms { display: none; }
  .trow > .c-st { grid-area: st; }
  .trow > .nm { grid-area: nm; }
  .trow > .c-strip { grid-area: strip; }
  .trow > .c-open { grid-area: lnk; }
  .trow > .c-up { grid-area: up; }
  .trow .strip { max-width: 190px; }
  .trow.u { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm last" "grp grp"; }
  .trow.u > .c-last { grid-area: last; }
  .trow.u > .c-grp { grid-area: grp; }
}

@media (max-width: 720px) {
  .apps { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .app { padding: 16px; gap: 12px; }
}
