/* Network tab. Inside the card the colours, shapes and motion are the desktop
   app's Swarm view (podtorrent-desktop app/ui/css/tokens.css); the page chrome
   and fonts around it are the dashboard's. Semantic colours have one meaning:
   serving = healthy, active = computing now, degraded = slow or failing checks
   (and the amber of anything simulated), gap = offline, you = the viewer's own. */
.net {
  --n-0: #e9eaee; --bg-content: #fbfbfc; --bg-elev-1: #ffffff; --bg-elev-2: #f6f6f8; --bg-glass: rgba(252, 252, 253, 0.9);
  --fg-1: #1b1c20; --fg-2: #5b5e67; --fg-3: #6b6e78; --fg-4: #a4a6af;
  --line-1: rgba(0, 0, 0, 0.09); --line-2: rgba(0, 0, 0, 0.16);
  --c-serving: #0fa36b; --c-active: #0a8fd6; --c-degraded: #d98a00; --c-gap: #e5374f; --c-you: #7b4dff;
  --c-degraded-fg: #8f5800; --net-accent: #0a7388; --tone-bg: 8%; --tone-line: 32%;
  --net-font: var(--sans);
  padding: 0; overflow: hidden; display: grid;
}
@media (prefers-color-scheme: dark) {
  .net {
    --n-0: #0d0e10; --bg-content: #141517; --bg-elev-1: #191a1d; --bg-elev-2: #1f2024; --bg-glass: rgba(30, 31, 36, 0.86);
    --fg-1: #eceef1; --fg-2: #a3a6af; --fg-3: #8a8d97; --fg-4: #50535c;
    --line-1: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.12);
    --c-serving: #3ddc97; --c-active: #4cc2ff; --c-degraded: #ffb547; --c-gap: #ff6b81; --c-you: #b18cff;
    --c-degraded-fg: #ffb547; --net-accent: #3fe8ff; --tone-bg: 10%; --tone-line: 30%;
  }
}
.net-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.net-head h2 { margin: 0; }
.net-sub, .net-muted, .net-note { color: var(--muted); font-size: 12.5px; }
.net-sub { font-variant-numeric: tabular-nums; }
.net-spacer { flex: 1; }
.net-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.net-controls select, .net-controls button { padding: 5px 10px; font-size: 13px; }
.net-controls select { padding-right: 26px; }
.net-seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; }
.net-seg button { border: 0; border-radius: 0; background: none; color: var(--muted); }
.net-seg button[aria-pressed="true"] { background: var(--soft); color: var(--fg); }
.net-seg button:disabled { opacity: .4; cursor: default; }
.net-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }

/* The desktop app's banner recipe, in its amber tone: anything simulated is labelled with it. */
.net-banner { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 18px; font-size: 12.5px; line-height: 1.4; color: var(--fg-1);
  border-top: 1px solid color-mix(in srgb, var(--c-degraded) var(--tone-line), transparent); border-bottom: 1px solid color-mix(in srgb, var(--c-degraded) var(--tone-line), transparent);
  background: color-mix(in srgb, var(--c-degraded) var(--tone-bg), var(--bg-content)); box-shadow: inset 3px 0 0 var(--c-degraded); flex-wrap: wrap; }
.net-banner::before { content: "✦"; color: var(--c-degraded-fg); }
.net-banner button { margin-left: auto; padding: 3px 10px; font-size: 12px; }
.net-banner .net-sep { width: 1px; align-self: stretch; background: color-mix(in srgb, var(--c-degraded) var(--tone-line), transparent); }

.net-stage { position: relative; height: clamp(420px, calc(100vh - 290px), 860px); background: var(--bg-content); border-top: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1);
  overflow: hidden; touch-action: none; user-select: none; color: var(--fg-1); }
.net-gl, .net-text { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.net-text { pointer-events: none; }
.net-overlay { position: absolute; inset: 0; pointer-events: none; }
.net-overlay > * { pointer-events: auto; }
.net-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-3); pointer-events: none; padding: 24px; text-align: center; }
/* The node list is for the keyboard and screen readers; a focused entry shows as a caption. */
.net-a11y { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 0; list-style: none; z-index: 2; }
.net-a11y button { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.net-a11y button:focus-visible { width: auto; height: auto; clip-path: none; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-glass);
  color: var(--fg-1); font-size: 12.5px; max-width: min(520px, 80vw); text-overflow: ellipsis; backdrop-filter: blur(12px); }
.net-tip { position: absolute; z-index: 3; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: var(--bg-glass); backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px var(--line-2), 0 12px 32px rgba(0, 0, 0, .25); font-size: 12.5px; max-width: 280px; }
.net-tip .net-muted, .net-panel .net-muted { color: var(--fg-2); }
.net-zoom { position: absolute; left: 12px; top: 12px; display: grid; gap: 4px; z-index: 2; }
.net-zoom button { width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 0; background: var(--bg-glass); color: var(--fg-1); box-shadow: 0 0 0 1px var(--line-2); font-size: 15px; }

.net-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); z-index: 4; overflow: auto; padding: 16px; border-radius: 14px;
  background: var(--bg-glass); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-2), 0 12px 32px rgba(0, 0, 0, .28); font-size: 13px; user-select: text; display: grid; gap: 10px; align-content: start; }
.net-panel[hidden] { display: none; }
.net-panel h3 { margin: 6px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.net-panel p { margin: 0; }
.net-panel-h { display: flex; gap: 10px; align-items: center; }
.net-panel-h > div { flex: 1; min-width: 0; }
.net-panel-h b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.net-x { width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--fg-2); font-size: 18px; border-radius: 8px; }
.net-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.net-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--fg-1); box-shadow: inset 0 0 0 1px var(--line-2); }
.net-chip.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.net-chip.serving { --c: var(--c-serving); } .net-chip.computing { --c: var(--c-active); } .net-chip.degraded { --c: var(--c-degraded); } .net-chip.offline { --c: var(--c-gap); }
.net-chip.trust.attested { box-shadow: inset 0 0 0 1.5px var(--fg-2); }
.net-chip.trust.self_declared { box-shadow: none; outline: 1.5px dashed var(--fg-3); outline-offset: -1.5px; }
.net-chip.trust.unverified { box-shadow: none; color: var(--fg-2); }
.net-chip.ok { color: var(--c-serving); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-serving) 40%, transparent); }
.net-chip.you { color: var(--c-you); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-you) 50%, transparent); }
.net-chip.sim { color: var(--c-degraded-fg); background: color-mix(in srgb, var(--c-degraded) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-degraded) 35%, transparent); }
.net-kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; }
.net-kv:empty { display: none; }
.net-kv dt { color: var(--fg-3); } .net-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.net-models { display: grid; gap: 8px; }
.net-model { padding: 8px 10px; border-radius: 10px; background: var(--bg-elev-2); display: grid; gap: 2px; }
.net-model .net-chip { margin-left: 6px; }
.net-link { padding: 0; border: 0; background: none; color: var(--net-accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.net-link:hover { background: none; }
.net-form { display: grid; gap: 8px; }
.net-form label { display: grid; gap: 3px; font-size: 12px; color: var(--fg-2); }
.net-form label.net-check { display: flex; gap: 8px; align-items: center; color: var(--fg-1); }
.net-form input:not([type]), .net-form select, .net-form textarea { width: 100%; padding: 6px 10px; }
.net-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.net-share { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; }
.net-share i.attested { background: var(--fg-1); } .net-share i.self_declared { background: var(--fg-3); } .net-share i.unverified { background: var(--fg-4); }

/* Follow a request: the picker and the readout. */
.net-menu { position: absolute; top: 12px; right: 12px; z-index: 6; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 8px; border-radius: 14px;
  background: var(--bg-glass); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-2), 0 12px 32px rgba(0, 0, 0, .28); display: grid; gap: 4px; font-size: 13px; }
.net-menu[hidden], .net-hud[hidden] { display: none; }
.net-menu > .net-muted { padding: 8px 10px; }
.net-menu-h { padding: 8px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.net-menu-item { display: grid; gap: 1px; text-align: left; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--fg-1); font-weight: 500; }
.net-menu-item:hover, .net-menu-item:focus-visible { background: color-mix(in srgb, var(--fg-1) 8%, transparent); }
.net-menu-item.primary { background: var(--net-accent); color: var(--accfg); font-weight: 600; text-align: center; }
.net-menu-item .net-muted { color: var(--fg-2); font-weight: 400; font-size: 12px; }
.net-hud { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; width: min(880px, calc(100% - 28px)); padding: 12px 14px; border-radius: 14px; display: grid; gap: 10px;
  background: var(--bg-glass); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-2), 0 12px 32px rgba(0, 0, 0, .28); font-size: 13px; user-select: text; }
.net-hud .net-muted { color: var(--fg-2); font-size: 12px; }
.net-hud-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.net-hud-h button { padding: 3px 10px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.net-hud kbd { font: 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg-2); }
.net-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.net-step { flex: 1 1 108px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg-elev-2); display: grid; gap: 1px; box-shadow: inset 0 2px 0 var(--line-2); }
.net-step.done { box-shadow: inset 0 2px 0 var(--c-serving); }
.net-step.doing { box-shadow: inset 0 2px 0 var(--c-active); }
.net-step.todo b { color: var(--fg-3); }
.net-step-t { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.net-step b { font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-step .net-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net.is-following .net-zoom { display: none; }

/* Flow view: its own dark stage whatever the page's theme, so light on dark here is deliberate. */
.net-flow-layer { position: absolute; inset: 0; z-index: 1; color: #e8eefc; --nf-line: rgba(150, 175, 230, 0.16); }
.net-flow-layer[hidden] { display: none; }
.net-flow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.net.is-flow .net-only-map, .net.is-flow .net-zoom, .net.is-flow .net-a11y { display: none; }
.net-stage:fullscreen { height: 100vh; border: 0; }
.net-flow-hud { position: absolute; left: 16px; right: 16px; top: 14px; display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap; pointer-events: none;
  padding: 10px 16px; border-radius: 14px; background: rgba(8, 13, 28, 0.62); box-shadow: inset 0 0 0 1px var(--nf-line); backdrop-filter: blur(10px); }
.nf-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font: 600 11px var(--net-font); letter-spacing: .12em; color: #3ddc97;
  box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.45); }
.nf-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: nf-beat 1.6s ease-in-out infinite; }
.nf-pill.sim { color: #ffb547; box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.5); } .nf-pill.replay { color: #4cc2ff; box-shadow: inset 0 0 0 1px rgba(76, 194, 255, 0.5); }
@keyframes nf-beat { 50% { opacity: .35; } }
.nf-stat { display: grid; gap: 0; min-width: 62px; }
.nf-stat b { font: 600 20px/1.15 var(--mono); font-variant-numeric: tabular-nums; color: #fff; }
.nf-stat span { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #8c98b3; }
.nf-stat.big b { font-size: 34px; letter-spacing: -.02em; color: #9fe3ff; text-shadow: 0 0 22px rgba(76, 201, 255, 0.55); min-width: 2.6ch; }
.net-flow-hud.is-busy .nf-stat.big b { color: #fff; }
.nf-spark { width: 150px; height: 40px; margin-left: -8px; }
.net-flow-ledger { position: absolute; left: 16px; right: 16px; bottom: 12px; padding: 8px 14px 10px; border-radius: 14px; background: rgba(8, 13, 28, 0.62);
  box-shadow: inset 0 0 0 1px var(--nf-line); backdrop-filter: blur(10px); font: 11.5px/24px var(--mono); user-select: text; }
.nf-rows { height: calc(var(--nf-rows, 6) * 24px); overflow: hidden; }
.nf-rows:empty::after { content: "Finished requests are listed here, newest first."; color: #6f7b96; font-family: var(--net-font); }
.nf-row { display: grid; grid-template-columns: 100px minmax(90px, 1.1fr) minmax(90px, 1.1fr) minmax(90px, 1.2fr) 62px 62px 86px 76px 86px 96px; gap: 0 14px; white-space: nowrap; color: #c6d0e6; }
.nf-row span { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.nf-row span:nth-child(n+5) { text-align: right; }
.nf-head { font: 600 10px/20px var(--net-font); letter-spacing: .09em; text-transform: uppercase; color: #6f7b96; border-bottom: 1px solid var(--nf-line); margin-bottom: 2px; }
.nf-head span { color: inherit; }
.nf-key { color: #fff; } .nf-key i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.nf-row.replay { font-style: italic; opacity: .7; }
.nf-usd { color: #ffd76a; } .nf-row.bad .nf-usd { color: #ff6b81; }
.nf-rows .nf-row:first-child { animation: nf-in .9s ease-out; }
@keyframes nf-in { from { background: color-mix(in srgb, var(--c) 30%, transparent); transform: translateY(-6px); opacity: 0; } }
.net-flow-layer .net-tip { background: rgba(14, 20, 38, 0.92); color: #e8eefc; z-index: 3; }
.net-flow-layer .net-tip .net-muted { color: #9aa6c2; }
@media (max-width: 900px) {
  .nf-row { grid-template-columns: 0 minmax(70px, 1fr) minmax(70px, 1fr) 0 0 52px 0 64px 0 80px; gap: 0 8px; }
  .nf-spark { display: none; } .nf-stat.big b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .nf-pill i, .nf-rows .nf-row:first-child { animation: none; } }

/* Time: the scrubber under the stage. */
.net-time { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 12.5px; }
.net-time button, .net-time select { padding: 3px 10px; font-size: 12px; }
.net-time select { padding-right: 24px; }
.net-time-track { flex: 1 1 220px; min-width: 140px; display: grid; }
.net-time input[type="range"] { width: 100%; padding: 0; border: 0; background: none; accent-color: var(--acc); }
.net-time-marks { width: 100%; height: 7px; display: block; } .net-time-marks[hidden] { display: none; }
.net-time-l { font-variant-numeric: tabular-nums; min-width: 9em; }
.net-live[aria-pressed="true"] { color: var(--c-serving); border-color: color-mix(in srgb, var(--c-serving) 45%, transparent); }
.net-live[aria-pressed="true"]::before { content: "● "; }
.net-time.is-replay { background: color-mix(in srgb, var(--c-active) 6%, transparent); }
.net-time .net-muted { margin-left: auto; text-align: right; }

.net-labels-menu { width: min(300px, calc(100% - 24px)); }
.net-form textarea { resize: vertical; font: inherit; color: var(--fg-1); border-radius: 8px; border: 1px solid var(--edge); background: var(--card); }
.net-swatches { display: flex; gap: 6px; }
.net-swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); color: var(--fg-3); font-size: 12px; line-height: 1; }
.net-swatch[aria-checked="true"] { outline: 2px solid var(--fg-1); outline-offset: 2px; }

.net-foot { display: flex; align-items: center; gap: 8px 22px; padding: 12px 18px; flex-wrap: wrap; }
.net-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.net-lg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.net-lg span { display: inline-flex; align-items: center; gap: 6px; }
.net-lg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.net-lg i.serving { background: var(--c-serving); } .net-lg i.computing { background: var(--c-active); } .net-lg i.degraded { background: var(--c-degraded); }
.net-lg i.offline { background: var(--c-gap); box-shadow: 0 0 6px var(--c-gap); } .net-lg i.you { background: var(--c-you); border-radius: 50%; }
.net-lg i.o { width: 12px; height: 12px; border-radius: 50%; }
.net-lg i.o.solid { border: 1.5px solid var(--muted); } .net-lg i.o.dashed { border: 1.5px dashed var(--muted); } .net-lg i.o.none { background: color-mix(in srgb, var(--muted) 25%, transparent); }
.net-lg i.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-active); } .net-lg i.dot.usd { background: var(--fg); } .net-lg i.dot.serving { background: var(--c-serving); }
.net-note { margin-left: auto; text-align: right; max-width: 520px; }
@media (max-width: 720px) {
  .net-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62%; }
  .net-note { margin-left: 0; text-align: left; }
}
