/* WebCore 1.0. Phone first; a side bar from 900 px. Two schemes, "Soft day" and "True black" (the default), chosen by hand or by the device
   (theme.js and Settings > Appearance set data-theme on <html>: day or black). */
:root {
  --fs-xs: .75rem; --fs-s: .85rem; --fs-m: 1rem; --fs-l: 1.15rem; --fs-xl: 1.4rem;
  --bg: #e8ebe6; --panel: #f3f5f1; --line: #cdd4cf; --text: #1f2a28; --muted: #4f5f5b;
  --accent: #0c635e; --accent-ink: #ffffff; --accent-soft: #cfe5e1;
  --me: #cfe6df; --them: #f3f5f1; --warn: #855000; --bad: #a3231b; --bad-ink: #ffffff; --good: #1a6b33;
  --warn-bg: #f3e4c4; --warn-ink: #4d3000; --bar: #0c635e; --bar-ink: #ffffff;
  --field-line: #76847f;
  --s-in: #2a78d6; --s-in2: #85b7eb; --s-out: #c4511f; --s-bad: #c62f2d; --s-warn: #b87a00; --s-ok: #138a5f;
  --pin-chat: #2f7fd1; --pin-rep: #0f6e6a; --pin-room: #9c5bd1; --pin-sens: #a67700; --pin-self: #d1452f; --pin-mine: #5f9e00; --route: #d9480f; --busy: #e07000;
  --radius: 12px; --tap: 48px; --nav-h: 64px;
  color-scheme: light dark;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="day"] { color-scheme: light; }
:root[data-theme="black"] {
  color-scheme: dark;
  --bg: #000000; --panel: #121413; --line: #2a2d2c; --text: #e8eae9; --muted: #a9aeac;
  --accent: #7fd6c9; --accent-ink: #04302b; --accent-soft: #0e2724;
  --me: #12312d; --them: #121413; --warn: #e8ac5a; --bad: #ff9288; --bad-ink: #3a0b07; --good: #86d89f;
  --warn-bg: #3b2f17; --warn-ink: #f4d9a6; --bar: #0e2724; --bar-ink: #e8f1ee;
  --field-line: #6f7a76;
  --s-in: #5aa0f0; --s-in2: #9cc6f5; --s-out: #f08a5a; --s-bad: #ff6b63; --s-warn: #eda100; --s-ok: #3fcf9a;
  --pin-chat: #5fa8ee; --pin-rep: #45c2b8; --pin-room: #b98be6; --pin-sens: #d9a93a; --pin-self: #ff8a6e; --pin-mine: #b5e14a; --route: #ffb454; --busy: #ff9d33;
}
* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#top :focus-visible { outline-color: var(--bar-ink); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: var(--fs-l); }
h3 { font-size: var(--fs-m); margin: 18px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-xs); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-s); word-break: break-all; }
[hidden] { display: none !important; }

#app { display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; }
#top { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 56px;
  background: var(--bar); color: var(--bar-ink); padding-top: env(safe-area-inset-top); }
#top h1 { font-size: var(--fs-l); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
#top .muted { color: inherit; opacity: .9; font-size: var(--fs-xs); }
#top button { color: inherit; }
#top-actions { display: flex; gap: 4px; }
#mainwrap { grid-row: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#fwbar:empty { display: none; }
#fwbar { padding: 0 12px; }
#fwbar .banner { margin: 8px auto 0; max-width: 860px; }
#main { flex: 1; overflow-y: auto; overscroll-behavior: contain; outline: none; min-height: 0; }
#nav { grid-row: 3; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
#nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h);
  color: var(--muted); text-decoration: none; font-size: var(--fs-xs); position: relative; }
#nav a.on { color: var(--accent); font-weight: 600; }
#nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.badge { position: absolute; top: 6px; left: 55%; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bad); color: var(--bad-ink); font-size: var(--fs-xs); line-height: 20px; text-align: center; font-weight: 600; }
@media (min-width: 900px) {
  #app { grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; }
  #top { grid-column: 1 / 3; }
  #nav { grid-row: 2; grid-template-columns: none; grid-auto-rows: min-content; border-top: 0; border-right: 1px solid var(--line); padding-top: 8px; }
  #nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 18px; font-size: var(--fs-m); }
  .badge { position: static; margin-left: auto; }
}

.page { max-width: 860px; margin: 0 auto; padding: 12px 12px 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.stack > * + * { margin-top: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

button, .btn { min-height: var(--tap); padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: currentColor; }
button.icon { min-width: var(--tap); padding: 0; background: transparent; border: 0; font-size: var(--fs-xl); }
button.icon svg { display: block; margin: auto; }
button:disabled { opacity: .5; cursor: default; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 18px; font-size: var(--fs-s); font-weight: 400; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: var(--fs-xs); white-space: nowrap; border: 1px solid var(--line, currentColor); }
.pill.ok { color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn); }
.pill.bad { color: var(--bad); border-color: var(--bad); font-weight: 600; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
input, select, textarea { min-height: var(--tap); width: 100%; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--panel); }
textarea { resize: vertical; min-height: 96px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
label.field { display: block; }
label.field > span { display: block; font-size: var(--fs-s); color: var(--muted); margin-bottom: 4px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.hint { font-size: var(--fs-s); color: var(--muted); }
.err { color: var(--bad); }
.ok { color: var(--good); }
.warn { color: var(--warn); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.tabs.wrap { flex-wrap: wrap; overflow-x: visible; }
.tabs .chip { white-space: nowrap; flex: 0 0 auto; }
.utabs { display: flex; border-bottom: 1px solid var(--line); }
.utabs button { flex: 1; min-width: 0; padding: 0 4px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.utabs button[aria-selected=true] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg.full { display: flex; }
.seg button { flex: 1; min-height: 36px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; font-size: var(--fs-s); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--accent-soft); font-weight: 600; }
.seg.sm button { min-height: 28px; padding: 0 9px; font-size: var(--fs-xs); }
.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fbar > button:first-child { min-height: 36px; font-size: var(--fs-s); }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px; border-bottom: 1px solid var(--line);
  cursor: pointer; text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--accent-soft); }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: pre; }   /* pre: a run of spaces in a name stays as the sender wrote it */
.item .s { color: var(--muted); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); font-size: var(--fs-m); }
.avatar.rep { border-radius: 10px; }
.avatar.room { border-radius: 10px 10px 50% 50%; }
.avatar.ch { border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-xs); font-weight: 600; line-height: 22px; text-align: center; }
.count.muted { background: var(--line); color: var(--muted); }
.tag { display: inline-block; font-size: var(--fs-xs); padding: 1px 7px; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* conversation */
.chat { display: flex; flex-direction: column; height: 100%; }
.msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: var(--fs-xs); color: var(--muted); padding: 6px 0; }
.newline { align-self: stretch; text-align: center; font-size: var(--fs-xs); color: var(--accent); border-top: 1px solid var(--accent); margin: 6px 0; padding-top: 2px; }
.bubble { max-width: min(80%, 560px); padding: 7px 11px; border-radius: 14px; background: var(--them); border: 1px solid var(--line);
  white-space: pre-wrap; word-wrap: break-word; cursor: pointer; }
.bubble.me { align-self: flex-end; background: var(--me); border-color: transparent; }
.bubble .who { white-space: pre-wrap; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.bubble .meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; text-align: right; }
.bubble.mention { border-color: var(--accent); border-width: 2px; }
.quick { display: flex; gap: 6px; padding: 6px 10px 0; overflow-x: auto; background: var(--panel); border-top: 1px solid var(--line); scrollbar-width: none; }
.quick .chip { flex: none; }
.composer { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--panel); align-items: flex-end; }
.composer textarea { min-height: var(--tap); height: var(--tap); max-height: 140px; resize: none; }
.composer .left { font-size: var(--fs-xs); color: var(--muted); text-align: right; }

/* console */
.console { background: #0b0f0e; color: #cfe9e3; border-radius: var(--radius); padding: 10px; min-height: 180px; max-height: 50vh; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-s); white-space: pre-wrap; }
.console .in { color: #8fd3c9; }
.console .in::before { content: "> "; }

/* sheet */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-body { background: var(--bg); width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 4px 14px 24px; }
.sheet-head { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 1; }
.sheet-head h2 { flex: 1; }
@media (min-width: 900px) { .sheet { align-items: center; } .sheet-body { border-radius: 16px; } }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }

/* map */
.map { position: relative; height: calc(100dvh - 56px - var(--nav-h)); background: var(--panel); touch-action: none; }
@media (min-width: 900px) { .map { height: calc(100dvh - 56px); } }
.map svg { width: 100%; height: 100%; display: block; }
.map .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map .lbl { fill: var(--muted); font-size: 11px; white-space: pre; }
/* coordinates on the map are a watermark: faint, not selectable, not copyable, they never catch a tap */
.map .coord { opacity: .55; font-style: italic; letter-spacing: .02em; pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.map .border { fill: var(--accent-soft); fill-opacity: .55; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map svg, .map svg * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.map svg * { pointer-events: none; }
.map svg .pin { pointer-events: all; }
.map .rname { fill: var(--text); font-size: 12px; font-weight: 600; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; }
.map .city { fill: var(--text); opacity: .45; font-style: italic; font-size: 10px; text-anchor: middle; pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.map .leader { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .selring { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .msearch { position: absolute; left: 10px; top: 10px; right: 70px; max-width: 320px; }
.map .msearch input { width: 100%; }
.map .msearch .srow { display: flex; gap: 6px; }
.map .msearch .srow button { flex: 0 0 auto; width: var(--tap); padding: 0; font-size: var(--fs-l); }
.map .msearch .found { margin-top: 4px; padding: 4px; max-height: calc(100dvh - 300px); overflow: auto; }
.map button.wide { display: block; width: 100%; text-align: left; margin-top: 4px; }
.map .scalebar { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map .pin { stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.map .pin.chat { fill: var(--pin-chat); stroke: var(--pin-chat); } .map .pin.rep { fill: var(--pin-rep); stroke: var(--pin-rep); } .map .pin.room { fill: var(--pin-room); stroke: var(--pin-room); } .map .pin.sens { fill: var(--pin-sens); stroke: var(--pin-sens); }
.map .pin.self { fill: var(--pin-self); stroke: var(--text); stroke-width: 3; }
.map .tools { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.map .tools button { width: var(--tap); padding: 0; font-size: var(--fs-l); }
.map .note { position: absolute; left: 10px; top: 56px; max-width: min(300px, calc(100% - 20px)); font-size: var(--fs-s); }
.map .info { position: absolute; left: 10px; bottom: 10px; right: 70px; }
.qr { display: block; margin: 10px auto; width: min(260px, 70vw); height: auto; background: #fff; padding: 10px; border-radius: 8px; image-rendering: pixelated; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.banner { background: var(--accent-soft); border-radius: var(--radius); padding: 6px 10px; margin: 8px 0; display: flex; align-items: center; gap: 8px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.crit { background: var(--bad); color: var(--bad-ink); }
.banner.crit a, .banner.crit button { color: inherit; }
.banner button { margin-left: 2px; }
.banner .btxt { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.banner .btxt.open { display: block; }
.banner .bact { display: flex; gap: 8px; align-items: center; flex: none; }
.banner .bact button { margin-left: 0; }
button.linkish { all: unset; cursor: pointer; text-decoration: underline; font-size: var(--fs-s); padding: 4px 2px; }

/* the check-up: the dot in the header, and the rows of the Status sheet. Colour is never the only signal: the word and the position say it too. */
.sdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--good); }
.sdot.note, .hdot.note .sdot { background: var(--pin-chat); }
.sdot.warn, .hdot.warn .sdot { background: var(--busy); }
.sdot.crit, .hdot.crit .sdot { background: var(--bad); }
#top .hdot { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; font-size: var(--fs-xs); color: var(--bar-ink); }
#top .hdot .sdot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
/* acknowledged: nothing new to look at, but not gone: a hollow dot in its colour */
#top .hdot.ack .sdot { background: transparent; box-shadow: inset 0 0 0 3px var(--busy), 0 0 0 2px rgba(255, 255, 255, .6); }
#top .hdot.ack.crit .sdot { box-shadow: inset 0 0 0 3px var(--bad), 0 0 0 2px rgba(255, 255, 255, .6); }
#top .hdot.ack.note .sdot { box-shadow: inset 0 0 0 3px var(--pin-chat), 0 0 0 2px rgba(255, 255, 255, .6); }
#top .hdot.ack .sdot { animation: none; }
#top .hdot.crit:not(.ack) .sdot { animation: hdpulse 1.6s ease-in-out infinite; }
@keyframes hdpulse { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { #top .hdot.crit:not(.ack) .sdot { animation: none; } }
@media (max-width: 700px) { .hide-sm { display: none; } }
.srow { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.srow:first-of-type { border-top: 0; }
.srow .sdot { margin-top: 5px; }
.srow a, .srow button { flex: none; }
.login { max-width: 380px; margin: 10vh auto; padding: 0 16px; }

.theme-opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; min-height: var(--tap); cursor: pointer; }
.theme-opt input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); }
.theme-opt + .theme-opt { border-top: 1px solid var(--line); }

/* Add-ons > Bot */
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.figs b { display: block; font-size: var(--fs-xl); }
.pill { display: inline-block; font-size: var(--fs-xs); background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 2px 10px; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.botprev { align-self: stretch; max-width: none; }
.page .stack, .item .grow { min-width: 0; }
.pill { white-space: nowrap; flex-shrink: 0; }
details.perms{margin:8px 0;border:1px solid var(--line,#ccc);border-radius:8px;padding:0 12px}
details.perms>summary{cursor:pointer;padding:10px 0;font-weight:600;color:var(--text)}
details.perms[open]>summary{border-bottom:1px solid var(--line,#ccc);margin-bottom:8px}
details.perms>summary.fs{display:flex;align-items:center;gap:8px;list-style:none}
details.perms>summary.fs::-webkit-details-marker{display:none}
details.perms>summary.fs::after{content:'\203A';margin-left:4px;color:var(--muted);font-weight:400;transition:transform .15s}
details.perms[open]>summary.fs::after{transform:rotate(90deg)}
details.perms>summary.fs .fsum{margin-left:auto;font-weight:400;font-size:var(--fs-s);color:var(--muted);text-align:right;min-width:0}
details.perms>summary.fs .sdot{width:10px;height:10px}
details.perms>summary.fs .sdot.none{background:transparent}
@media (prefers-reduced-motion: reduce){details.perms>summary.fs::after{transition:none}}

.lines { white-space: pre-line; }

/* the map: how fresh a node was heard (filled, hollow, faint), the route, lines to the repeaters heard directly, the key */
.map .pin.stale { fill: var(--panel); stroke-width: 3; }
.map .pin.old { fill: var(--panel); stroke-width: 3; opacity: .5; }
.map .pin.rep.stale, .map .pin.rep.old { stroke: var(--pin-rep); }
.map .pin.room.stale, .map .pin.room.old { stroke: var(--pin-room); }
.map .pin.sens.stale, .map .pin.sens.old { stroke: var(--pin-sens); }
.map .pin.chat.stale, .map .pin.chat.old { stroke: var(--pin-chat); }
.map .legend { position: absolute; left: 10px; bottom: 10px; font-size: 11px; color: var(--muted); pointer-events: none; -webkit-user-select: none; user-select: none; }
.map .card.route { top: 56px; }
.map .note.small:not(.route) { top: auto; bottom: 34px; }
.map .hopn { fill: var(--accent-ink); font-size: 10px; font-weight: 600; text-anchor: middle; pointer-events: none; -webkit-user-select: none; user-select: none; }
.map .hopn.alt { opacity: .55; font-weight: 400; }
.map .pin.dim, .map .hopn.dim { opacity: .3; } .map .lbl.rname.dim { opacity: .45; }
.map .pin:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the map: the Show menu, a clearer route, rings round favourites */
.map .tools { max-height: calc(100% - 20px); overflow-y: auto; }
.map .tools button.showbtn { font-size: var(--fs-xs); font-weight: 600; }
.map .showmenu { position: absolute; right: 70px; bottom: 10px; width: min(300px, calc(100% - 90px)); padding: 8px 10px; }
.map .showmenu .mrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.map .showmenu .mrow button { min-width: 64px; }
.map .showmenu .mrow button.on { background: var(--accent-soft); border-color: var(--accent); }
.map .showmenu .legend { position: static; margin-top: 6px; font-size: 11px; color: var(--muted); }
.map .oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map circle.watchring { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.map circle.watchring.warn { stroke: var(--warn); }
.map circle.watchring.bad { stroke: var(--bad); }
.map line.routehalo { stroke: var(--panel); stroke-width: 8; stroke-linecap: round; opacity: .9; vector-effect: non-scaling-stroke; }
.map line.route { stroke: var(--route); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map line.route.gap { stroke-dasharray: 2 8; }
.map line.route.m0 { stroke: var(--route); }
.map line.route.m1 { stroke: var(--pin-mine); stroke-dasharray: 10 6; }
.map line.route.m2 { stroke: var(--pin-rep); stroke-dasharray: 2 6; }
.map line.route.m3 { stroke: var(--pin-room); stroke-dasharray: 12 4 2 4; }
.map line.route.gap { stroke-dasharray: 2 8; }
.map .mineleg { position: absolute; left: 10px; bottom: 10px; right: 56px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); pointer-events: none; background: color-mix(in srgb, var(--panel) 86%, transparent); border-radius: 8px; padding: 5px 8px; }
.map .mineleg .mrl { display: flex; align-items: center; gap: 6px; }
.map .mineleg[hidden] { display: none; }
.map .mineleg svg { flex: none; overflow: visible; width: 22px; height: 8px; }
.map .mineleg line.route { stroke-width: 3; vector-effect: none; }
.map path.routearrow { fill: var(--route); stroke: var(--panel); stroke-width: 1.5; }
.map circle.busydot { fill: var(--busy); stroke: var(--bg, #fff); stroke-width: 1; vector-effect: non-scaling-stroke; }
.busy { color: var(--busy); font-weight: 600; }
.map circle.nosidot { fill: var(--bad); stroke: var(--bg, #fff); stroke-width: 1; vector-effect: non-scaling-stroke; }
.nosi { color: var(--bad); font-weight: 600; }
.map circle.favring { fill: none; stroke: var(--route); stroke-width: 2; opacity: .9; vector-effect: non-scaling-stroke; }
.map .card.route .grow { min-width: 0; }
.map .card.route { padding: 6px 8px; }
.map path.nbr { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.map .country { fill: var(--muted); font-size: 10px; letter-spacing: .2em; text-anchor: middle; opacity: .6; }

.chart { width: 100%; height: auto; display: block; }
.chart .ct { font-size: 8px; fill: var(--muted); }
.chart .cg { stroke: var(--line); stroke-width: 0.5; }
.chart .ca { stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 0.7; stroke-dasharray: 1 4; }
.chart .cam { fill: var(--muted); fill-opacity: 0.6; }
.chart .ca2 { stroke: var(--warn); stroke-opacity: 0.45; stroke-width: 0.7; stroke-dasharray: 1 4; }
.chart .ca2m { fill: var(--warn); fill-opacity: 0.6; }
.chart .cbr { fill: none; stroke: var(--s-in); stroke-width: 1.5; stroke-dasharray: 2 3; opacity: 0.6; }
.chart .ctk { stroke: var(--s-bad); stroke-width: 2; stroke-linecap: round; }
.chart .cb { fill: var(--s-in); opacity: 0.25; }
.chart .tr-in { fill: var(--s-in); }
.chart .tr-bad { fill: var(--s-bad); }
.chart .tr-out { fill: var(--s-out); }
.chart .cz { stroke: var(--line); stroke-width: 1; }
.chart .cdv { stroke: var(--line); stroke-width: 0.6; stroke-dasharray: 1 3; }
.chart .cem { stroke: var(--s-bad); stroke-width: 0.9; opacity: 0.55; }
.chart .cer { stroke: var(--s-warn); stroke-width: 0.9; stroke-dasharray: 3 2; }
.chart .car { fill: var(--accent); opacity: 0.12; }
.chart .cok { stroke: var(--s-ok); stroke-width: 0.8; }
.chart .ced { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.chart .cet { font-size: 8px; fill: currentColor; }
.spark { flex: none; }
.trow { display: flex; align-items: baseline; gap: 8px; }
.trow b { flex: none; }
.trow .tv { flex: 1; text-align: right; font-variant-numeric: tabular-nums; }
.trow .ta { flex: none; font-size: var(--fs-xs); color: var(--muted); }
.trow .ta.old { color: var(--s-warn); }
.hc.stale .chart { opacity: 0.5; filter: grayscale(1); }
.chart .clow { font-size: 8px; fill: var(--s-bad); }
.chart .cz2 { fill: var(--s-bad); opacity: 0.14; }
.chart .cl { stroke: var(--warn); stroke-width: 0.8; stroke-dasharray: 3 3; }
.chart .cp { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.chart .cd { fill: var(--accent); }
.chart .cm { stroke: var(--bad); stroke-width: 0.8; opacity: 0.8; }

.heat { display: grid; gap: 2px; }
.heat-row { display: grid; grid-template-columns: 2.4rem repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.heat-l, .heat-t { font-size: var(--fs-xs); color: var(--muted); }
.heat-c { height: 14px; border-radius: 2px; background: var(--line); opacity: .9; }

details.fold>summary{cursor:pointer;font-weight:600;font-size:var(--fs-m);padding:2px 0}
details.fold[open]>summary{margin-bottom:10px}

.map polyline.loctrail { fill: none; stroke: var(--pin-chat); stroke-width: 1.5; opacity: .6; vector-effect: non-scaling-stroke; }
.map circle.locdot { fill: var(--pin-chat); opacity: .6; }

.map .pin.chat.mine, .map .pin.chat.mine.stale, .map .pin.chat.mine.old { stroke: var(--pin-mine); }
.map .pin.chat.mine:not(.stale):not(.old) { fill: var(--pin-mine); }
.map polyline.loctrail.mine { stroke: var(--pin-mine); } .map circle.locdot.mine { fill: var(--pin-mine); }
.pre { white-space: pre-wrap; }
.pill.mine:not(.warn) { background: color-mix(in srgb, var(--pin-mine) 16%, transparent); border: 1px solid var(--pin-mine); color: var(--text); }
.map .pin.chat.chan { stroke-dasharray: 3 2; fill-opacity: .4; }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* a short description of a part of the page: at most 5 lines on a phone */
.hint.desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; margin: 0; }

.chart .cp2 { fill: none; stroke: var(--warn); stroke-width: 1.4; stroke-linejoin: round; }
.chart .ct2 { font-size: 8px; fill: var(--warn); }
/* Traffic: Now */
.verdict { display: flex; flex-direction: column; gap: 6px; }
.verdict .vt { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.verdict .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; }
.verdict .dot.warn { background: var(--warn); }
.gauge { padding: 8px 0; border-bottom: 1px solid var(--line); }
.gauge:last-child { border-bottom: 0; }
.gauge .row { align-items: baseline; }
.gbar { position: relative; height: 6px; background: var(--line); border-radius: 3px; margin: 7px 0 5px; }
.gbar.seg { display: flex; overflow: hidden; gap: 2px; background: var(--line); }
.gbar.seg i { border-radius: 0; flex: none; }
.gbar i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }
.gbar.warn i { background: var(--warn); }
.gbar u, .gbar s { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text); text-decoration: none; }
.gbar s { background: var(--warn); }
.gflag { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--warn); border-radius: 6px; background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: var(--fs-s); }
.gflag a { color: var(--accent); cursor: pointer; }

/* Traffic: Nodes */
.kbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.kbar span { display: block; height: 100%; }
.ntab { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.ntab .nr { display: grid; grid-template-columns: var(--cols); gap: 6px; padding: 9px 12px; align-items: center; border-bottom: 1px solid var(--line); font-size: var(--fs-s); min-width: 0; }
.ntab .nr:last-child { border-bottom: 0; }
.ntab .nr > * { min-width: 0; overflow-wrap: anywhere; }
.ntab .nr.nh { font-size: var(--fs-xs); color: var(--muted); }
.ntab .nr.tap { cursor: pointer; }
.ntab .r { text-align: right; }
.ntab .warn, .ntab small.warn { color: var(--warn); }
.ntab .muted, .ntab small.muted { color: var(--muted); }
.ntab small { font-size: var(--fs-xs); }
.ntab .srt { cursor: pointer; }
.ntab .srt[aria-sort=descending] { color: var(--text); font-weight: 600; }
.seg.sm button { white-space: normal; line-height: 1.15; }
.sum { margin: 0; }
.utabs.scroll { overflow-x: auto; scrollbar-width: none; }
.utabs.scroll button { flex: 0 0 auto; padding: 0 12px; white-space: nowrap; }
.map line.route.trail { opacity: .45; stroke-width: 2; }
.map .mineleg .mrl.trail { padding-left: 28px; font-size: var(--fs-xs); }
.map .showmenu .vsel { display: flex; gap: 6px; }
.map .showmenu .vbtn { flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 6px 2px; font-size: var(--fs-xs); }
.map .showmenu .vbtn.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.map .keyhole { fill: #16201f; pointer-events: none; }
.map .keyhole.hollow { fill: var(--pin-mine); }
.map .vico { width: 22px; height: 22px; background: var(--c); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.map .vico.net { --c: var(--pin-rep); } .map .vico.com { --c: var(--pin-chat); } .map .vico.mine { --c: var(--pin-mine); }

/* My Companions: one row each, details on tap */
.comp .crow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; }
.comp .crow-main { min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; display: block; }
.comp .crow-main .small { overflow-wrap: anywhere; line-height: 1.45; }   /* all of it shows: it wraps, the Ask and ⋯ buttons drop to their own line when narrow */
.cstrip { padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); font-size: var(--fs-s); }
.cstrip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.comp .crow-main .row { flex-wrap: wrap; gap: 6px; }
.comp .crow-main .row b { min-width: 4rem; }
.comp .crow-acts { gap: 6px; flex-wrap: nowrap; align-self: start; }
.comp button.loc { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; min-width: 4.5rem; }
.comp button.loc:disabled { background: none; color: var(--muted); border-color: var(--line); font-weight: 400; }
.comp .ask-issue { color: var(--warn); }
.hstate { font-size: var(--fs-s); font-weight: 400; opacity: .8; }
.hstate.warn { color: var(--warn-ink); opacity: 1; font-weight: 600; }

.loading { padding: 24px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pkts { list-style: none; margin: 0; padding: 0; font-size: var(--fs-s); }
.pkt { padding: 8px 2px; border-bottom: 1px solid var(--line); }
.pk1 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.pk1 b { font-weight: 600; }
.pkr { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pkp { margin-top: 3px; color: var(--muted); font-size: var(--fs-s); line-height: 1.5; overflow-wrap: anywhere; }
.pkp b { color: var(--text); font-weight: 600; }

.mentions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
.mentions[hidden] { display: none; }

.tier { gap: 6px; }
.tierh { font-weight: 600; margin-top: 6px; }
.tierfold { text-align: left; background: none; border: 1px dashed var(--line, currentColor); border-radius: 8px; padding: 8px 10px; color: inherit; font: inherit; font-size: var(--fs-s); cursor: pointer; }
.tgrid { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { .tgrid { display: grid; grid-template-columns: 1fr 1fr; } }
.note2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .note2 { -webkit-line-clamp: 2; line-clamp: 2; } }

button.sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-xs); position: relative; }   /* looks small, still has a 44 px hit area */
button.sm::after { content: ""; position: absolute; inset: -6px -2px; }

.pill.hourly { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.muted { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

.cmp { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)) 1.2em; gap: 4px 8px; font-size: var(--fs-s); align-items: baseline; font-variant-numeric: tabular-nums; }
.cmp .cr { text-align: right; }
.cmp.strip { grid-template-columns: auto minmax(3.2rem, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 4px 8px; font-size: var(--fs-s); align-items: center; }
.cmp.strip.six { grid-template-columns: auto minmax(2.6rem, 1.4fr) repeat(5, minmax(0, 1fr)); gap: 4px 6px; font-size: var(--fs-xs); }
.cmp .cr.dev { background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: 0 4px; font-weight: 600; }
.chg { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 2px 0; }
.cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.cdot.bad { background: var(--s-bad); } .cdot.warn { background: var(--s-warn); }
details.gfold > summary { cursor: pointer; font-size: var(--fs-s); color: var(--muted); padding: 4px 0; }
.relgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.chart .cgy { fill: var(--muted); fill-opacity: 0.5; }
.chart .cor { fill: var(--s-out); }
.chart .ces { stroke: var(--s-out); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .cnb { fill: var(--muted); fill-opacity: 0.09; }
.chart .ctg { fill: none; stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 1; stroke-linejoin: round; }
.chart .cus { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 3; }
.chart .cto { stroke: var(--s-out); stroke-width: 2; stroke-linecap: round; }
.chart .cbz { fill: var(--accent); stroke: var(--accent); stroke-width: 1; }
.chart .cqt { fill: var(--panel); stroke: var(--accent); stroke-width: 1.2; }
.chart .ced2 { stroke-width: 2; }
.chart .cbad { fill: var(--s-bad); }
.chart .cd2 { fill: var(--muted); }
.chart .cband { fill: var(--accent); fill-opacity: 0.12; }
.brows { gap: 4px; margin-top: 6px; }
.brow { display: grid; grid-template-columns: 6.5em 1fr 4.5em; gap: 8px; align-items: center; }
.btrack { position: relative; height: 12px; background: var(--line); border-radius: 4px; }
.btrack .bwk { position: absolute; left: 0; top: 4px; height: 4px; background: var(--muted); border-radius: 2px; }
.btrack .btd { position: absolute; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--s-out); }

.chart .ctr { fill: var(--s-in); }
.chart .ctd { fill: var(--s-bad); }
.chart .cts { fill: var(--s-out); stroke: var(--panel); stroke-width: 1; }
.chart .csel { fill: none; stroke: var(--text); stroke-width: 1; }
.trro { font-size: var(--fs-s); min-height: 2.6em; }
.spk { width: 100%; height: 1.5rem; display: block; }
.spk .sb { fill: var(--muted); fill-opacity: 0.18; }
.spk .sl { fill: none; stroke: var(--s-in); stroke-width: 1.6; stroke-linejoin: round; }
.spk .se { fill: var(--s-in); }
.spk .se.dev { fill: var(--s-bad); }

/* W72: the expert view */
.chart .xl { fill: var(--accent); opacity: 0.12; }
.chart .xb { fill: var(--muted); fill-opacity: 0.22; }
.chart .xm { stroke: var(--muted); stroke-width: 1.2; }
.chart .xw { fill: var(--s-warn); }
.chart .xs { fill: var(--s-out); }
.chart .xa { fill: none; stroke-width: 1.5; stroke-dasharray: 5 3; }
.chart .xa.m { stroke: var(--text); stroke-width: 1; }
.chart .xa.o { stroke: var(--s-out); } .chart .xa.i { stroke: var(--s-in); } .chart .xa.d { stroke: var(--s-bad); }
.chart .xat { font-size: 8px; font-weight: 600; fill: var(--muted); }
.chart .xat.o { fill: var(--s-out); } .chart .xat.i { fill: var(--s-in); } .chart .xat.d { fill: var(--s-bad); }
.chart .xv { fill: var(--text); }
.xtab { font-variant-numeric: tabular-nums; font-size: var(--fs-s); table-layout: fixed; }
.xtab th { font-weight: 400; color: var(--muted); text-align: right; padding: 2px 3px; }
.xtab td { text-align: right; padding: 3px 3px; border-top: 1px solid var(--line); white-space: nowrap; }
.xtab th:first-child, .xtab td:first-child { text-align: left; width: 27%; }
.xtab td.n { font-weight: 600; }
.xtab td.bad { color: var(--s-bad); font-weight: 600; }
.xrow { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 4px; }
.xrow .pill { flex: none; }

.tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.tile { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.nbrow { display: flex; align-items: center; gap: 8px; }
.nbn { flex: 0 0 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbbar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.nbbar i { display: block; height: 100%; border-radius: 3px; background: var(--s-ok); }
.nbs { flex: none; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.wstat { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0.5px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
button.quiet { border: 0; background: none; font-size: var(--fs-s); }
.center { text-align: center; margin-top: 16px; }
.labt { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px 8px; font-size: var(--fs-s); }
