/* Aileron by Sora Sagano, CC0 1.0. See fonts/LICENSE.txt. */
@font-face { font-family: "Aileron"; font-weight: 300; font-display: swap; src: url("../fonts/aileron-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Aileron"; font-weight: 400; font-display: swap; src: url("../fonts/aileron-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Aileron"; font-weight: 600; font-display: swap; src: url("../fonts/aileron-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Aileron"; font-weight: 700; font-display: swap; src: url("../fonts/aileron-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* Surfaces, darkest first. */
  --plane: #060708;
  --bg: #0e0f12;
  --s1: #141619;
  --s2: #1b1e22;
  --s3: #252a30;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.14);
  /* Text colours. */
  --ink: #f2f1ee;
  --ink2: #b7b6af;
  --ink3: #8a8983;
  /* Data: blue is traffic and allow, orange is block. */
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --block: #d95926;
  --block-soft: rgba(217, 89, 38, 0.16);
  /* Flows blocked by the user's rules, limits, or Ask mode. These are choices, not bad requests. */
  --rule-block: #a46fc2;
  /* A day counted before the split, which has only a total. */
  --unsplit: #5f636a;
  /* Status. Always shown with an icon or a label. */
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  /* Privacy grades A to F. */
  --gA: #0ca30c;
  --gB: #8fb51f;
  --gC: #fab219;
  --gD: #ec835a;
  --gF: #d03b3b;
  /* Profile colours. */
  --p1: #199e70;
  --p2: #c98500;
  --p3: #d55181;
  --p4: #9085e9;
  /* Liquid Glass. Blur only where content moves behind the glass. Elsewhere, a tint and a rim cost nothing. */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-float: rgba(28, 31, 36, 0.62);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  --glass-blur: blur(24px) saturate(170%);
  --win: 26px;
  --r: 10px;
  --font: "Aileron", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--plane);
  color: var(--ink);
  font: 400 13px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink3); }
.ic { flex: none; display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 5px; border: 3px solid transparent; background-clip: content-box; }

/* Dev bar: design navigation, not part of the app. */
.devbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink3);
}
.devbar b { color: var(--ink); font-weight: 600; margin-right: 12px; letter-spacing: 0.02em; }
.devbar a, .devbar button {
  color: var(--ink2); text-decoration: none; padding: 4px 10px; border-radius: 6px;
  background: none; border: 0;
}
.devbar a:hover, .devbar button:hover { background: var(--s2); color: var(--ink); }
.devbar .on { background: var(--s2); color: var(--ink); }
.devbar .sep { flex: 1; }
.devbar .tag { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; margin: 0 6px 0 14px; }
.embed .devbar { display: none; }

.stage { display: grid; place-items: center; padding: 32px 24px 48px; }
.embed .stage { padding: 20px; }

/* Window. */
.window {
  width: 1240px; height: 800px; display: flex; overflow: hidden;
  background: var(--bg); border-radius: var(--win);
  box-shadow: 0 0 0 1px var(--line2), 0 40px 80px -20px rgba(0, 0, 0, 0.8);
}
.sidebar {
  width: 208px; flex: none; display: flex; flex-direction: column; margin: 7px 8px 7px 7px;
  border-radius: calc(var(--win) - 7px); background: var(--glass); box-shadow: var(--glass-rim), 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 10px 12px 14px;
}
.lights { display: flex; gap: 8px; padding: 2px 6px 22px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--s3); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand .ic { color: var(--accent); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 8px; color: var(--ink2); text-decoration: none; font-weight: 600;
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.nav a.on { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.nav a.on .ic { color: var(--accent); }
.nav .count {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px;
  background: var(--s3); color: var(--ink); font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}
.nav .count.warn { background: rgba(250, 178, 25, 0.18); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.state-card { margin-top: 18px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; }
.state-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); flex: none; }
.dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, 0.2); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(250, 178, 25, 0.2); }
.dot.crit { background: var(--crit); box-shadow: 0 0 0 3px rgba(208, 59, 59, 0.25); }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink2); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  height: 60px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 16px;
}
/* Toolbar items float in glass capsules, in three groups at most. */
.toolbar .pulse { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--glass); box-shadow: var(--glass-rim); }
.toolbar .seg { padding: 3px; border: 0; border-radius: 17px; background: var(--glass); box-shadow: var(--glass-rim); }
.toolbar .seg button { border-radius: 14px; }
.toolbar .btn { height: 34px; border: 0; border-radius: 17px; background: var(--glass); box-shadow: var(--glass-rim); }
.toolbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.toolbar .grow { flex: 1; }
.pulse { display: flex; align-items: center; gap: 10px; color: var(--ink2); }
.pulse b { color: var(--ink); font-weight: 600; min-width: 76px; text-align: right; }
.content { flex: 1; min-height: 0; overflow: auto; }
/* A scroll edge effect instead of a toolbar border. It uses a mask, not a blur, so scrolling stays cheap. */
.content, .applist, .detail { mask-image: linear-gradient(to bottom, transparent, #000 14px); }
.pad { padding: 20px 24px 28px; }

/* Controls. */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--s1); border: 1px solid var(--line); border-radius: 8px; }
.seg button {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px;
  border: 0; border-radius: 6px; background: none; color: var(--ink2); font-weight: 600; font-size: 12px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--s3); color: var(--ink); box-shadow: 0 0 0 1px var(--line2); }
.seg.verdict button[aria-pressed="true"][data-v="allow"] { background: var(--accent-soft); box-shadow: 0 0 0 1px rgba(57, 135, 229, 0.5); }
.seg.verdict button[aria-pressed="true"][data-v="allow"] .ic { color: var(--accent); }
.seg.verdict button[aria-pressed="true"][data-v="block"] { background: var(--block-soft); box-shadow: 0 0 0 1px rgba(217, 89, 38, 0.55); }
.seg.verdict button[aria-pressed="true"][data-v="block"] .ic { color: var(--block); }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 11px; }

.sw { width: 34px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 10px; background: var(--s3); position: relative; transition: background 0.15s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink2); transition: transform 0.15s, background 0.15s; }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"]::after { transform: translateX(14px); background: #fff; }
.sw.lg { width: 46px; height: 26px; border-radius: 13px; }
.sw.lg::after { width: 22px; height: 22px; }
.sw.lg[aria-checked="true"]::after { transform: translateX(20px); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px;
  border: 1px solid var(--line2); border-radius: 8px; background: var(--s2); font-weight: 600; font-size: 12px;
  white-space: nowrap; flex: none;
}
.btn:hover { background: var(--s3); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.lg { height: 40px; padding: 0 22px; font-size: 14px; border-radius: 10px; }
.icon-btn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--ink3); }
.icon-btn:hover { background: var(--s3); color: var(--ink); }
.icon-btn.allow:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn.block:hover { background: var(--block-soft); color: var(--block); }
.icon-btn.ring { box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink2); }
.field {
  height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px;
  background: var(--bg); min-width: 0;
}
.field::placeholder { color: var(--ink3); }
select.field { padding-right: 6px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--s3); color: var(--ink2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip .ic { width: 12px; height: 12px; }
.chip.tracker .ic, .chip.flag .ic { color: var(--warn); }
.chip.tracker, .chip.flag { background: rgba(250, 178, 25, 0.12); color: var(--ink); }
.chip.warn .ic { color: var(--warn); }
.chip.allow .ic { color: var(--accent); }
.chip.block .ic { color: var(--block); }
.chip.good .dot { box-shadow: none; }
.chip.crit { background: rgba(208, 59, 59, 0.2); color: var(--ink); }
.chip.crit .ic { color: var(--serious); }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.label { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 20px; }
.card-head .grow { flex: 1; }
.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi { display: grid; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.kpi .value small { font-size: 13px; font-weight: 400; color: var(--ink3); letter-spacing: 0; margin-left: 3px; }
.kpi .sub { color: var(--ink3); font-size: 12px; display: flex; align-items: center; gap: 6px; min-height: 17px; }
.kpi .sub .segbar { flex: 1; }
.hero { font-size: 52px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.hero small { font-size: 16px; font-weight: 400; color: var(--ink3); letter-spacing: 0; margin-left: 6px; }

.ico {
  --sz: 28px; width: var(--sz); height: var(--sz); flex: none; display: grid; place-items: center;
  border-radius: calc(var(--sz) * 0.26); background: linear-gradient(145deg, #2c3138, #1a1d21);
  box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); font-weight: 700; font-size: calc(var(--sz) * 0.42);
}
.grade {
  --g: var(--ink3); width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--g) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 70%, transparent);
}
.grade.xl { width: 72px; height: 72px; border-radius: 18px; font-size: 40px; font-weight: 300; }

/* Charts. */
.chart { width: 100%; display: block; }
.chart svg { display: block; overflow: visible; }
.chart text { font: 400 11px var(--font); fill: var(--ink3); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart .base { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .col:hover .bar, .chart .col:focus .bar { filter: brightness(1.3); }
.chart .col:hover .hit, .chart .col:focus .hit { fill: rgba(255, 255, 255, 0.04); }
.chart .col { outline: none; }
.chart .pt .cross, .chart .pt .pdot { opacity: 0; }
.chart .pt:hover .cross, .chart .pt:hover .pdot { opacity: 1; }
.chart .cross { stroke: rgba(255, 255, 255, 0.3); stroke-width: 1; }
.chart .limit { stroke: var(--ink2); stroke-width: 1; }
.chart .limit-label { fill: var(--ink); font-weight: 600; paint-order: stroke; stroke: var(--s1); stroke-width: 5px; stroke-linejoin: round; }
.chart .end-label { fill: var(--ink); font-weight: 600; }
.chart .conn { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; }

/* Opaque, because a blurred tip would redraw its backdrop on every pointer move. */
.tip {
  position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 8px;
  background: #2a2f36; box-shadow: 0 0 0 1px var(--line2), 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 12px; white-space: nowrap; display: none;
}
.tip b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.tip span { display: block; color: var(--ink2); }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 22px minmax(0, var(--name, 120px)) 1fr var(--val, 68px); align-items: center; gap: 10px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .track { height: 8px; }
.hbar .fill { height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar .val { text-align: right; color: var(--ink2); }
.hbars.stack .hbar { grid-template-columns: 22px 1fr auto; gap: 5px 10px; }
.hbars.stack .track { grid-column: 2 / 4; }
.hbar:hover .fill { filter: brightness(1.3); }
.hbar.click { cursor: pointer; }
.hdetail { display: grid; gap: 6px; padding-left: 32px; font-size: 12px; color: var(--ink2); }
.hdetail div { display: flex; justify-content: space-between; gap: 12px; }
.hdetail span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.segbar { display: flex; gap: 2px; height: 8px; }
.segbar i { display: block; height: 100%; min-width: 3px; }
.segbar i:first-child { border-radius: 4px 0 0 4px; }
.segbar i:last-child { border-radius: 0 4px 4px 0; }
.segbar i:only-child { border-radius: 4px; }
.segbar.tall { height: 28px; }
.segbar.tall i { border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-style: normal; font-weight: 700; font-size: 12px; color: #fff; }
.segbar.tall i.dark { color: #0b0b0b; }
.segbar i:hover { filter: brightness(1.25); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.meter { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter.warn { background: rgba(250, 178, 25, 0.16); }
.meter.warn i { background: var(--warn); }
.meter.crit { background: rgba(208, 59, 59, 0.22); }
.meter.crit i { background: var(--crit); }

/* Apps. */
.split { display: flex; height: 100%; }
.applist { width: 380px; flex: none; overflow: auto; border-right: 1px solid var(--line); padding: 12px 10px 20px; }
.detail { flex: 1; min-width: 0; overflow: auto; padding: 20px 22px 28px; display: grid; gap: 12px; align-content: start; }
.group { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px; }
/* All apps stays in place. Each group header sticks under it until the next group pushes it out. */
.applist .pin { position: sticky; top: -12px; z-index: 2; margin-top: -12px; padding-top: 12px; background: var(--bg); }
.applist .group { position: sticky; top: 92px; z-index: 1; background: var(--bg); }
.group .count { color: var(--ink2); font-size: 11px; font-weight: 600; background: var(--s3); border-radius: 9px; padding: 1px 7px; }
.approw {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; text-align: left; position: relative; cursor: pointer;
}
.approw:hover { background: var(--s1); }
.approw.on { background: var(--s2); }
.approw.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.approw .who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.approw .name { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.approw .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approw .meta { color: var(--ink3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approw .live { width: 78px; display: grid; gap: 5px; justify-items: end; font-size: 12px; color: var(--ink2); }
.ratebar { width: 78px; height: 3px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.ratebar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 0.6s; }
.approw.off .ico, .approw.off .who { opacity: 0.5; }
.undecided { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 2px; }
.undecided .approw:hover { background: var(--s2); }

.app-head { display: flex; align-items: center; gap: 14px; }
.app-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.app-head .path { color: var(--ink3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.scale div { display: grid; gap: 5px; justify-items: center; font-size: 10px; color: var(--ink3); }
.scale i { display: block; width: 100%; height: 6px; background: var(--s3); }
.scale div:first-child i { border-radius: 3px 0 0 3px; }
.scale div:last-child i { border-radius: 0 3px 3px 0; }
.scale .here i { background: var(--g); }
.scale .here { color: var(--ink); font-weight: 600; }
.limit-form { display: flex; align-items: center; gap: 8px; }
.limit-form .field { width: 76px; text-align: right; }
.hostrow { display: flex; align-items: center; gap: 10px; height: 38px; border-top: 1px solid var(--line); }
.hostrow .host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hostrow .from { flex: none; font-size: 11px; color: var(--ink3); white-space: nowrap; }
.hostrow .grow { flex: 1; }
.hostrow .mark { width: 16px; display: grid; place-items: center; color: var(--ink3); }
/* Country and network owner of an address. The owner gives way first in a narrow row. */
.fact { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.fact .flag { font-size: 14px; line-height: 1; }
.fact .owner { min-width: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--ink3); }
.chip.cdn { background: var(--accent-soft); color: var(--ink); }
.credit { margin-top: 12px; font-size: 11px; color: var(--ink3); }
.credit a { color: var(--ink2); }
.hostrow.tracker .mark { color: var(--warn); }

/* Tables. */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 0 8px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); }
.table td { padding: 0 8px; height: 48px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table .flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.cell-app { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hits { display: grid; grid-template-columns: 96px 46px; align-items: center; gap: 10px; }
.hits .fill { height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hits .fill.block { background: var(--block); }
.hits .fill.zero { min-width: 0; }
.hits .n { text-align: right; }
/* Rules by profile: one Allow/Block pick per column. */
.seg.pick button { padding: 0 7px; }
/* Empty profile cell: a faint outline on the choice it inherits from Always. */
.seg.pick button.follows[data-v="allow"] { box-shadow: inset 0 0 0 1px rgba(57, 135, 229, 0.45); }
.seg.pick button.follows[data-v="allow"] .ic { color: rgba(57, 135, 229, 0.8); }
.seg.pick button.follows[data-v="block"] { box-shadow: inset 0 0 0 1px rgba(217, 89, 38, 0.5); }
.seg.pick button.follows[data-v="block"] .ic { color: rgba(217, 89, 38, 0.85); }
.table th.live, .table td.live { background: rgba(255, 255, 255, 0.03); }
.table th.live { color: var(--ink); }
.phead { display: inline-flex; align-items: center; gap: 6px; }
.cell-app .who { display: grid; gap: 1px; min-width: 0; }
.cell-app .host { color: var(--ink3); font-size: 11px; font-weight: 400; }
.table .hits { grid-template-columns: 64px 46px; }
/* Only the profile columns scroll sideways. App and Always pin left; hits, last hit, and delete pin right. */
.by-profile { overflow-x: auto; }
.by-profile .table { table-layout: fixed; width: max-content; min-width: 100%; }
.by-profile .c-app { width: 220px; }
.by-profile .c-always { width: 92px; }
.by-profile .c-profile { width: 120px; }
.by-profile .c-hits { width: 136px; }
.by-profile .c-last { width: 104px; }
.by-profile .c-del { width: 44px; }
.by-profile .c-app, .by-profile .c-always, .by-profile .c-hits, .by-profile .c-last, .by-profile .c-del {
  position: sticky; z-index: 1; background: var(--s1);
}
.by-profile .c-app { left: 0; }
.by-profile .c-always { left: 220px; box-shadow: 14px 0 12px -12px rgba(0, 0, 0, 0.95); }
.by-profile .c-hits { right: 148px; box-shadow: -14px 0 12px -12px rgba(0, 0, 0, 0.95); }
.by-profile .c-last { right: 44px; }
.by-profile .c-del { right: 0; }
.by-profile .flagged td.c-app { box-shadow: inset 3px 0 0 var(--warn); }
.cell-app .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-text { color: var(--warn); display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.by-profile .flagged td { height: 60px; }

/* Decision order. */
.flow { display: flex; align-items: stretch; gap: 0; }
.flow .step { flex: 1; display: grid; gap: 6px; justify-items: center; text-align: center; font-size: 12px; color: var(--ink2); position: relative; white-space: nowrap; }
.flow .step::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 1px; background: var(--line2); }
.flow .step:first-child::before { display: none; }
.flow .node { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--ink); font-size: 11px; font-weight: 700; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--s1); }
.flow .out { display: flex; gap: 3px; }
.flow .out i { width: 14px; height: 4px; border-radius: 2px; }

/* Profiles. */
.week { display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; align-items: center; }
.week .day { color: var(--ink3); font-size: 11px; font-weight: 600; }
.week .day.today { color: var(--ink); }
.week .lane { position: relative; height: 18px; background: var(--bg); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.week .blk { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.week .blk:hover { filter: brightness(1.25); }
.week .now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.week .hours { position: relative; height: 14px; font-size: 10px; color: var(--ink3); }
.week .hours span { position: absolute; transform: translateX(-50%); }
.profile { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.profile .top { display: flex; align-items: center; gap: 10px; }
.profile .top .field { flex: 1; font-weight: 600; font-size: 14px; }
.profile .line { display: flex; align-items: center; gap: 8px; color: var(--ink2); white-space: nowrap; }
.profile .line > span { overflow: hidden; text-overflow: ellipsis; }
.profile .line .grow { flex: 1; }
.days { display: flex; gap: 4px; }
.days button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink3); font-weight: 600; font-size: 12px; }
.days button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 30%, transparent); border-color: var(--c); color: var(--ink); }
/* A profile's colour, set by the user with the system colour panel. */
.swatch-pick { position: relative; width: 38px; height: 20px; flex: none; border-radius: 10px; background: var(--c); box-shadow: 0 0 0 1px var(--line2); cursor: pointer; }
.swatch-pick:hover { box-shadow: 0 0 0 2px var(--line2); }
.swatch-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.clock { position: relative; height: 6px; border-radius: 3px; background: var(--s3); }
.clock i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--c); }
.time-field { display: inline-flex; align-items: center; gap: 2px; }
/* One time block of a profile: its days, a bar of its hours, and its times. */
.profile .block { display: grid; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.profile .block .days button { width: 28px; height: 28px; }
.btn.sm { height: 24px; padding: 0 10px; font-size: 11px; gap: 4px; }
.time-part { height: 24px; padding: 0 2px 0 6px; font-size: 12px; }

/* Lists. */
.shield { display: flex; align-items: center; gap: 16px; }
.shield .badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--s3); color: var(--ink3); }
.shield.on .badge { background: var(--block-soft); color: var(--block); }
.listrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.listrow .who { flex: 1; min-width: 0; }
.listrow .name { font-weight: 600; }
.listrow .url { color: var(--ink3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 19px; background: var(--glass-float); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-rim), 0 16px 40px rgba(0, 0, 0, 0.6); font-weight: 600; white-space: nowrap;
}
.toast .ic { color: var(--good); }
.toast.crit .ic { color: var(--serious); }

.empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink3); text-align: center; }
.empty .ring { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink2); }
.empty b { color: var(--ink); font-size: 16px; font-weight: 600; }

/* Menu bar popover and prompt. */
.desktop {
  width: 1240px; height: 800px; border-radius: var(--win); position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 80% 0%, #1b2230 0%, #0c0e12 55%, #08090b 100%);
  box-shadow: 0 0 0 1px var(--line2);
}
.menubar { height: 28px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 16px; background: rgba(0, 0, 0, 0.35); color: var(--ink2); font-size: 12px; font-weight: 600; }
.menubar .me { color: var(--ink); background: rgba(255, 255, 255, 0.14); border-radius: 5px; padding: 3px 7px; display: flex; align-items: center; gap: 6px; }
.popover {
  position: absolute; top: 36px; right: 96px; width: 400px; padding: 16px; display: grid; gap: 14px;
  background: var(--glass-float); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-radius: 16px;
  box-shadow: var(--glass-rim), 0 30px 70px rgba(0, 0, 0, 0.7);
}
.popover .row { display: flex; align-items: center; gap: 10px; }
/* The Rules popover: placed by script under its app cell, and scrolls when an app has many hosts. */
.popover.traffic { position: fixed; right: auto; width: 440px; max-height: 420px; overflow-y: auto; z-index: 50; }
.cell-app[data-act="traffic"] { cursor: pointer; }
.popover .row .grow { flex: 1; }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.popover .approw { padding: 6px 4px; cursor: default; }
/* Four prompts side by side need a wider screen than the window. */
.desktop.wide { width: 1360px; }
.alerts { position: absolute; inset: 28px 0 0; display: flex; align-items: center; justify-content: center; gap: 28px; }
.alert {
  width: 300px; padding: 26px 22px 20px; display: grid; gap: 14px; justify-items: center; text-align: center;
  background: var(--glass-float); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-radius: 22px;
  box-shadow: var(--glass-rim), 0 30px 70px rgba(0, 0, 0, 0.7);
}
.alert h3 { margin: 0; font-size: 15px; font-weight: 700; }
.alert h3 span { display: block; font-weight: 400; color: var(--ink2); }
.alert .hostpill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; flex-wrap: wrap; }
/* Path and signer. The name and icon can be copied, but these cannot. */
.alert .origin { display: grid; gap: 2px; justify-items: center; font-size: 11px; color: var(--ink2); }
.alert .origin .bad { color: var(--block); }
.alert .origin .path span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.copy { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-width: 0; }
.copy .ic { flex: none; }
.alert .only { display: flex; align-items: center; gap: 10px; color: var(--ink2); min-height: 20px; }
.alert .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.alert .btn { height: 36px; justify-content: center; font-size: 13px; }
.alert .btn.block .ic { color: var(--block); }
.caption { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: var(--ink3); font-size: 12px; }

/* Setup. */
.setup { height: 100%; display: grid; place-content: center; justify-items: center; gap: 28px; text-align: center; }
.setup .mark { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink3); }
.setup .link { color: var(--accent); text-decoration: none; }
.setup .link:hover { text-decoration: underline; }
.setup h2 { margin: 0; font-size: 26px; font-weight: 300; letter-spacing: -0.02em; }
/* Nodes 200 px apart, as in the app. */
.steps { display: flex; gap: 0; width: 600px; }
.steps .step { flex: 1; display: grid; gap: 10px; justify-items: center; color: var(--ink3); font-weight: 600; position: relative; }
.steps .step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--s3); }
.steps .step:first-child::before { display: none; }
.steps .node { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--ink2); font-weight: 700; position: relative; z-index: 1; box-shadow: 0 0 0 6px var(--bg); }
.steps .done { color: var(--ink2); }
.steps .done .node { background: var(--accent); color: #fff; }
.steps .done + .step::before, .steps .done::before { background: var(--accent); }
.steps .now { color: var(--ink); }
.steps .now .node { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 6px var(--bg), inset 0 0 0 2px var(--accent); }
.steps .fail .node { background: var(--crit); color: #fff; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--s3); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.settings-mock { width: 380px; padding: 14px 16px; border-radius: 12px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line2); display: flex; align-items: center; gap: 12px; text-align: left; }
.settings-mock .who { flex: 1; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: rgba(208, 59, 59, 0.16); box-shadow: inset 0 0 0 1px rgba(208, 59, 59, 0.5); }
.banner .ic { color: var(--serious); }
/* Broken config notice: solid, under the toolbar of every screen, until the file is discarded. */
.notice { flex: none; gap: 12px; margin: 0 24px 4px 16px; padding: 10px 10px 10px 16px; }
.notice > .ic { flex: none; }
.notice .text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.notice .text span { color: var(--ink2); font-size: 12px; }
.notice .acts { display: flex; gap: 8px; flex: none; }
.notice .btn .ic { color: inherit; }
/* In the popover: text on top, both buttons below, full width. */
.notice.compact { margin: 0; padding: 12px; flex-wrap: wrap; align-items: flex-start; }
.notice.compact .acts { flex: 1 0 100%; }
.notice.compact .btn { flex: 1; justify-content: center; }

/* Index. */
.index { max-width: 1240px; margin: 0 auto; padding: 48px 24px 80px; display: grid; gap: 40px; }
.index h1 { margin: 0; font-size: 44px; font-weight: 300; letter-spacing: -0.03em; }
.index h2 { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.index p { margin: 8px 0 0; color: var(--ink2); max-width: 60ch; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, 384px); gap: 28px 20px; justify-content: space-between; }
.shot { display: grid; gap: 3px; color: inherit; text-decoration: none; }
.shot .frame { height: 252px; margin-bottom: 9px; border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--line2); position: relative; }
.shot iframe { width: 1280px; height: 840px; border: 0; transform: scale(0.3); transform-origin: 0 0; pointer-events: none; }
.shot:hover .frame { box-shadow: 0 0 0 1px var(--accent); }
.shot b { font-weight: 600; font-size: 14px; }
.shot span { color: var(--ink3); font-size: 12px; }
.tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.token { display: grid; gap: 6px; font-size: 11px; color: var(--ink3); }
.token i { height: 44px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line2); }
.token b { color: var(--ink); font-weight: 600; font-size: 12px; }
.specimen { display: grid; gap: 6px; }
.index p a { color: var(--accent); }
.index p code { font: inherit; color: var(--ink); background: var(--s2); padding: 1px 6px; border-radius: 4px; }

/* System settings. */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--s1); --glass-float: var(--s2); }
  .popover, .alert, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, 0.2); --line2: rgba(255, 255, 255, 0.36); --ink3: #a5a49e; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::after { transition: none !important; }
}

/* Diagnostics: one row per log entry. The detail stays on one line and shows in full on hover. */
.logrow { display: grid; grid-template-columns: 16px 128px 52px 48px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.logrow .lvl { color: var(--warn); display: grid; place-items: center; height: 18px; }
.logrow .lvl.error { color: var(--serious); }
.logrow .when { color: var(--ink2); font-size: 12px; line-height: 18px; white-space: nowrap; }
.logrow .area, .logrow .logdetail { color: var(--ink3); font: 11px/18px ui-monospace, SFMono-Regular, Menlo, monospace; }
.logrow .what { min-width: 0; display: grid; gap: 2px; }
.logrow .msg { display: flex; align-items: center; gap: 8px; font-weight: 600; line-height: 18px; }
.logrow .logdetail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logrow { cursor: pointer; }
.logrow.open .logdetail { white-space: normal; }
.logmore { display: grid; gap: 2px; padding-top: 4px; color: var(--ink3); font: 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace; }
.privacy { justify-content: flex-start; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.privacy .ic { color: var(--good); flex: none; }
.banner.info { background: var(--s1); box-shadow: inset 0 0 0 1px var(--line2); }
.banner.info .ic { color: var(--ink3); }

/* Search: an icon inside the field, and a clear button once it holds text. */
.search { position: relative; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 10px; color: var(--ink3); pointer-events: none; }
.search .field { width: 100%; padding-left: 32px; padding-right: 30px; }
.search .icon-btn { position: absolute; right: 3px; width: 24px; height: 24px; }
.applist .search { margin: 10px 0 0; }
.card-head .search { width: 240px; margin-left: 8px; }

/* Addresses: the table and the world map. */
.table.addresses th.sortable { cursor: pointer; user-select: none; }
.table.addresses th.sortable.on { color: var(--ink); }
.table.addresses td { height: 40px; }
.table.addresses td.host { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.stack { display: inline-flex; align-items: center; }
.stack > * + * { margin-left: -6px; }
.stack .more { margin-left: 4px; font-size: 11px; color: var(--ink3); }
.flowbar { display: inline-flex; align-items: center; gap: 8px; }
.flowbar i { height: 8px; border-radius: 0 4px 4px 0; background: var(--accent); }
.worldmap { display: block; width: 100%; height: auto; }
.worldmap .land { fill: var(--s3); stroke: var(--bg); stroke-width: 0.35; }
.worldmap .land.on { fill: var(--accent); cursor: pointer; }
.worldmap .land.on:hover { stroke: var(--ink); stroke-width: 0.6; }
.table.addresses .disclose { display: inline-block; width: 16px; color: var(--ink3); cursor: pointer; }
.table.addresses .stack { cursor: pointer; }
.table.addresses tr.child td { height: 34px; background: rgba(255, 255, 255, 0.02); }
.table.addresses tr.child .cell-app { padding-left: 24px; font-weight: 400; }
.mapframe { position: relative; overflow: hidden; border-radius: 8px; }
.mapframe .worldmap { touch-action: none; }
.mapzoom { position: absolute; right: 8px; bottom: 8px; display: grid; gap: 4px; padding: 4px; border-radius: 10px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line2); }
