/* ============================================================
   DARK//ROUTE — main.css
   Dark ops-console aesthetic: near-black glass, cyan/green neon,
   scanlines + CRT vignette, monospace everywhere, status lights.
   Everything respects prefers-reduced-motion and stays usable
   from 1440px laptops down to 360px phones.
   ============================================================ */

:root {
  --bg0: #04070c;
  --bg1: #070d16;
  --bg2: #0b1420;
  --bg3: #0e1a29;
  --line: #12202f;
  --line-2: #1b2f42;
  --txt: #c9d7e4;
  --txt-dim: #6b8299;
  --txt-faint: #3d5266;
  --txt-bright: #eaf6ff;
  --cyan: #00e5ff;
  --cyan-soft: #7dd3fc;
  --green: #00ff9d;
  --amber: #ffb347;
  --red: #ff2d55;
  --violet: #a78bfa;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sidebar-w: 340px;
  --topbar-h: 54px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg0);
  color: var(--txt);
  font: 13.5px/1.55 var(--mono);
  overflow: hidden;
}
.mono { font-family: var(--mono); }
.dim { color: var(--txt-dim); }
.hidden { display: none !important; }
b { color: var(--txt-bright); font-weight: 700; }

::selection { background: rgba(0, 229, 255, 0.25); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #1b2f42 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #16283a; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #24405c; }
*::-webkit-scrollbar-track { background: transparent; }

/* ================= app frame + atmosphere ================= */
.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(0, 229, 255, 0.055), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0, 255, 157, 0.04), transparent 55%),
    var(--bg0);
}
/* scanlines */
.app::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.11) 2px 3px
  );
  mix-blend-mode: multiply;
  z-index: 40;
}
/* CRT vignette + faint sweep */
.app::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.42) 100%);
  z-index: 41;
}
@media (prefers-reduced-motion: reduce) {
  .app::before, .app::after { display: none; }
}

/* ================= topbar ================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(11, 20, 32, 0.92), rgba(7, 13, 22, 0.85));
  backdrop-filter: blur(6px);
  z-index: 30;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-right { flex-wrap: nowrap; }

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2.5px;
  color: var(--txt-bright);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.brand b { color: var(--cyan); }
.brand-eye {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #0e2f3f, #071018 75%);
  border: 1px solid #1d4a5c;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5), inset 0 0 5px rgba(0, 229, 255, 0.4);
  position: relative;
}
.brand-eye::after {
  content: "";
  position: absolute; inset: 4px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: eye-blink 5.5s infinite;
}
@keyframes eye-blink {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.1); }
}

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  white-space: nowrap;
  color: var(--txt-dim);
  background: rgba(11, 20, 32, 0.6);
}
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--txt-faint);
  transition: background 0.3s, box-shadow 0.3s;
}
.state-chip.off .dot { background: var(--txt-faint); }
.state-chip.mid { color: var(--cyan-soft); border-color: #1d4a5c; }
.state-chip.mid .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1s infinite; }
.state-chip.on { color: #9fe8c6; border-color: #123b2c; }
.state-chip.on .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.state-chip.warn { color: var(--amber); border-color: #4a3a1e; }
.state-chip.warn .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 0.7s infinite; }
.mode-chip.demo { color: var(--amber); border-color: #4a3a1e; background: rgba(255, 179, 71, 0.06); }
.mode-chip.live { color: var(--green); border-color: #123b2c; background: rgba(0, 255, 157, 0.05); }
@keyframes pulse { 50% { opacity: 0.45; } }

/* buttons */
button { font-family: var(--mono); cursor: pointer; }
.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--txt-dim);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 15px;
  flex: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover:not(:disabled) { color: var(--cyan); border-color: #1d4a5c; background: rgba(0, 229, 255, 0.05); }
.icon-btn:disabled { opacity: 0.32; cursor: default; }
.icon-btn.off { color: var(--txt-faint); text-decoration: line-through; }
.tb-btn {
  height: 34px;
  padding: 0 14px;
  background: rgba(11, 20, 32, 0.6);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--txt);
  font-size: 11px;
  letter-spacing: 1.5px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.tb-btn:hover { border-color: #1d4a5c; color: var(--cyan-soft); }
.tb-btn.burn {
  color: #ffb3c4;
  border-color: #57202c;
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.10), rgba(255, 45, 85, 0.04));
}
.tb-btn.burn:hover {
  border-color: var(--red);
  color: #ffdbe3;
  box-shadow: 0 0 18px rgba(255, 45, 85, 0.25);
}
.i-bars, .i-bars::before, .i-bars::after {
  width: 14px; height: 2px; border-radius: 2px; background: currentColor;
  display: block; content: ""; margin: 3px 0;
}

/* ================= body split ================= */
.body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
  overflow: hidden;
}

/* ================= sidebar / panels ================= */
.side {
  border-right: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(7, 13, 22, 0.6), rgba(4, 7, 12, 0.4));
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.panel {
  background: rgba(11, 20, 32, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.p-title {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--cyan-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #1d4a5c, transparent); }
.p-sub {
  margin: 16px 0 6px;
  font-size: 10.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--txt-dim);
  font-weight: 400;
}

/* form fields */
.f-label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin: 10px 0 4px;
}
.f-input {
  width: 100%;
  background: rgba(4, 7, 12, 0.7);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  color: var(--txt-bright);
  font: 12.5px var(--mono);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.f-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.12); }
.f-input::placeholder { color: var(--txt-faint); }
select.f-input { appearance: none; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-cell.grow2 { grid-column: span 2; }
.uri-msg { font-size: 11px; margin: 5px 0 2px; min-height: 15px; }
.uri-msg.ok { color: var(--green); }
.uri-msg.bad { color: #ff8fa8; }
.uri-msg.dim { color: var(--txt-dim); }
.f-note { font-size: 11px; color: var(--txt-dim); margin: 8px 0 0; line-height: 1.5; }
.f-note .mono { color: var(--cyan-soft); }
.lnk { color: var(--cyan); text-decoration: none; border-bottom: 1px dotted var(--cyan); cursor: pointer; }

.mode-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 14px;
}
.seg {
  padding: 9px 6px;
  background: transparent;
  border: 0;
  color: var(--txt-dim);
  font-size: 11px;
  letter-spacing: 1px;
  transition: background 0.15s, color 0.15s;
}
.seg.on { background: rgba(0, 229, 255, 0.1); color: var(--cyan); }
.seg + .seg { border-left: 1px solid var(--line-2); }

.adv { margin-top: 12px; }
.adv summary { cursor: pointer; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "▸ "; color: var(--txt-faint); }
.adv[open] summary::before { content: "▾ "; }

.btn {
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(11, 20, 32, 0.7);
  color: var(--txt);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 2px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.06s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  border-color: #1d4a5c;
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.12), rgba(0, 229, 255, 0.04));
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}
.btn.primary:hover { box-shadow: 0 0 22px rgba(0, 229, 255, 0.22); border-color: var(--cyan); }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.ghost { background: transparent; }
.btn.ghosted { background: transparent; border-style: dashed; }
.btn.tiny { padding: 5px 10px; font-size: 10px; letter-spacing: 1px; }

/* identity panel */
.exit-card {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.06), transparent 45%),
    rgba(4, 7, 12, 0.55);
}
.exit-ip { font-size: 22px; color: var(--green); letter-spacing: 1px; text-shadow: 0 0 16px rgba(0, 255, 157, 0.35); }
.exit-geo { color: var(--txt-bright); margin-top: 2px; }
.exit-asn { color: var(--txt-dim); font-size: 11px; margin-top: 2px; }
.exit-src { color: var(--txt-faint); font-size: 10.5px; margin-top: 8px; line-height: 1.45; border-top: 1px dashed var(--line); padding-top: 7px; }

.chain { font-size: 11px; line-height: 1.9; color: var(--txt-dim); word-break: break-word; }
.chain-seg {
  display: inline-block;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 7px;
  margin: 2px 1px;
  color: var(--txt-dim);
}
.chain-seg.ok { color: #9fe8c6; border-color: #123b2c; }
.chain-seg i { color: var(--txt-faint); font-style: normal; font-size: 10px; }

.viz-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 7, 12, 0.5);
  padding: 4px 2px;
}
.dns-line { font-size: 11.5px; color: var(--txt-dim); line-height: 1.5; }
.dns-line .ok, .leak-verdict.ok { color: var(--green); }

.lat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lat-now { font-size: 15px; color: var(--cyan); }
.spark-wrap { margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; background: rgba(4, 7, 12, 0.5); padding: 3px; }

/* leak list */
.leak-list { margin-top: 8px; }
.leak-row {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 7px;
  background: rgba(4, 7, 12, 0.4);
  animation: leak-in 0.3s ease;
}
@keyframes leak-in { from { opacity: 0; transform: translateY(4px); } }
.leak-name { font-size: 11px; letter-spacing: 1px; color: var(--txt-bright); }
.leak-verdict { font-size: 11px; margin: 3px 0 2px; }
.leak-verdict.ok { color: var(--green); }
.leak-verdict.warn { color: var(--amber); }
.leak-verdict.bad { color: var(--red); }
.leak-verdict.checking { color: var(--cyan-soft); animation: pulse 1s infinite; }
.leak-row:has(.leak-verdict.ok) { border-left-color: #123b2c; }
.leak-row:has(.leak-verdict.bad) { border-left-color: var(--red); }
.leak-row:has(.leak-verdict.warn) { border-left-color: #4a3a1e; }
.leak-detail { font-size: 10.5px; color: var(--txt-dim); line-height: 1.5; }

/* log stream */
.log-filter { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.logchip {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--txt-faint);
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: 1px;
  padding: 2px 7px;
}
.logchip.on { color: var(--cyan); border-color: #1d4a5c; background: rgba(0, 229, 255, 0.07); }
.log-stream {
  height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 4, 8, 0.72);
  padding: 7px 9px;
  font-size: 10.8px;
  line-height: 1.7;
}
.log-line { display: flex; gap: 7px; align-items: baseline; }
.log-line.bad .log-msg { color: #ff8fa8; }
.log-ts { color: var(--txt-faint); flex: none; font-size: 10px; }
.log-tag {
  flex: none;
  font-size: 9px;
  letter-spacing: 1px;
  border-radius: 3px;
  padding: 0 4px;
  border: 1px solid transparent;
  min-width: 38px;
  text-align: center;
}
.tag-socks { color: var(--cyan); border-color: #1d4a5c; }
.tag-relay { color: var(--violet); border-color: #3d3466; }
.tag-http { color: var(--green); border-color: #123b2c; }
.tag-dns { color: #ffd98a; border-color: #4a3a1e; }
.tag-sec { color: #7dd3fc; border-color: #1d4a5c; }
.tag-fx { color: var(--txt-dim); border-color: var(--line-2); }
.tag-bad { color: var(--red); border-color: #57202c; }
.log-msg { color: var(--txt); word-break: break-word; min-width: 0; }

/* ================= main / browser surface ================= */
.main {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 0;
}

/* tab strip */
.tabstrip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 0;
  background: linear-gradient(180deg, rgba(11, 20, 32, 0.5), transparent);
}
.tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
  padding-bottom: 7px;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-width: 130px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  background: rgba(7, 13, 22, 0.7);
  color: var(--txt-dim);
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.tab::after { /* incognito ghost tint */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 18px rgba(167, 139, 250, 0.05);
  pointer-events: none;
}
.tab.active {
  background: rgba(14, 26, 41, 0.95);
  color: var(--txt-bright);
  border-color: var(--line-2);
  box-shadow: 0 -1px 0 var(--cyan) inset, 0 6px 14px -8px rgba(0, 229, 255, 0.35);
}
.tab:hover { color: var(--txt); }
.tab.loading .tab-title::after {
  content: " ▮";
  color: var(--cyan);
  animation: pulse 0.8s infinite;
}
.tab-fav { flex: none; display: inline-flex; }
.tab-fav-dot {
  width: 17px; height: 17px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #06121c;
}
.tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}
.tab-close {
  flex: none;
  width: 17px; height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--txt-faint);
  font-size: 9px;
}
.tab-close:hover { color: var(--red); background: rgba(255, 45, 85, 0.12); }
.new-tab { margin-bottom: 7px; }

/* navbar */
.navbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(7, 13, 22, 0.55);
}
.addr-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 4, 8, 0.8);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.addr-wrap:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1); }
.addr-scheme { color: var(--green); font-size: 11px; flex: none; }
.addr {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--txt-bright);
  font: 12.5px var(--mono);
  padding: 9px 0;
}
.addr::placeholder { color: var(--txt-faint); }
.addr-ghost { flex: none; opacity: 0.5; font-size: 13px; filter: grayscale(0.3); }
.navbar .btn.primary { padding: 8px 16px; }

/* viewport */
.viewport { position: relative; min-height: 0; }
.view-pane {
  position: absolute;
  inset: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view-pane.incognito { box-shadow: inset 0 0 60px rgba(167, 139, 250, 0.045); }
.view-chrome {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.6);
  min-height: 27px;
  flex-wrap: wrap;
}
.vchip {
  font-size: 9.5px;
  letter-spacing: 1px;
  border: 1px solid var(--line-2);
  color: var(--txt-dim);
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
}
.vchip b { font-weight: 600; }
.vchip.dim b { color: var(--txt-dim); }
.vchip.warn { color: var(--amber); border-color: #4a3a1e; }
.vchip.warn b { color: var(--amber); }
.vchip.err { color: #ff8fa8; border-color: #57202c; }
.vchip.err b { color: #ff8fa8; }
.vchip.demo { color: var(--amber); border-color: #4a3a1e; }
.vchip.demo b { color: var(--amber); }
.view-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg1);
}
.ghost-mark {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--txt-faint);
  opacity: 0.55;
  pointer-events: none;
  z-index: 3;
}

/* loading overlay */
.view-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 10, 0.82);
  backdrop-filter: blur(2px);
  z-index: 5;
}
.view-loader.on { display: flex; }
.vl-card { text-align: center; max-width: 460px; padding: 20px; }
.vl-spin { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.vl-spin span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: vl-bounce 1s infinite ease-in-out;
}
.vl-spin span:nth-child(2) { animation-delay: 0.15s; }
.vl-spin span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vl-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
.vl-title { color: var(--txt-bright); letter-spacing: 1.5px; font-size: 13px; }
.vl-url { color: var(--cyan-soft); font-size: 11px; margin-top: 4px; word-break: break-all; }
.vl-elapsed { color: var(--green); font-size: 12px; margin-top: 8px; }
.vl-sub { color: var(--txt-faint); font-size: 10.5px; margin-top: 10px; }

/* statusbar */
.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-top: 1px solid var(--line-2);
  background: rgba(4, 7, 12, 0.85);
  font-size: 10.5px;
  color: var(--txt-dim);
  white-space: nowrap;
  overflow: hidden;
}
.statusbar b { color: var(--cyan-soft); font-weight: 400; }
.sb-sep { width: 1px; height: 12px; background: var(--line-2); flex: none; }
.sb-spacer { flex: 1; }

/* ================= modals ================= */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(3px);
  z-index: 100;
  padding: 18px;
}
.modal.open { display: flex; }
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0c1624, #080f1a);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 229, 255, 0.05);
  animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.modal-card h2 { margin: 0 0 6px; font-size: 15px; letter-spacing: 3px; color: var(--txt-bright); }
.modal-card h2 .dim { letter-spacing: 0; font-weight: 400; font-size: 11px; }
.modal-card h3 { margin: 20px 0 6px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan-soft); }
.modal-card p, .modal-card li { font-size: 12.5px; line-height: 1.65; color: var(--txt); }
.modal-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--txt-dim);
}
.modal-x:hover { color: var(--red); border-color: #57202c; }
.modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; }

.h-list { margin-top: 10px; }
.h-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.h-row:hover { border-color: #1d4a5c; background: rgba(0, 229, 255, 0.04); }
.h-title { color: var(--txt-bright); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-url { grid-row: 2; color: var(--cyan-soft); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-when { grid-row: 1; color: var(--txt-faint); font-size: 10.5px; align-self: center; }
.mini-x {
  grid-row: 1 / span 2;
  align-self: center;
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--txt-faint);
}
.mini-x:hover { color: var(--red); }
.panel-empty { color: var(--txt-dim); font-size: 12px; padding: 12px 4px; }

/* docs */
.docs-card { width: min(760px, 100%); }
.proto li { margin: 6px 0; }
.code {
  background: rgba(2, 4, 8, 0.85);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  font-size: 11.3px;
  line-height: 1.6;
  overflow-x: auto;
  color: #b8e2f5;
  white-space: pre;
}
.htable { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 6px; }
.htable th { text-align: left; color: var(--txt-dim); font-weight: 400; letter-spacing: 1.5px; font-size: 10px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.htable td { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--txt); line-height: 1.5; }
.htable td.ok { color: var(--green); }
.htable td.sim { color: var(--amber); }
.htable td.warn { color: #ff8fa8; }
.plist { padding-left: 18px; }
.plist li { margin: 5px 0; }

/* shortcuts */
.keys-grid { margin-top: 10px; }
.keys-row { display: flex; align-items: center; gap: 14px; padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.keys-kbd { min-width: 130px; display: flex; gap: 3px; align-items: center; }
.keys-kbd kbd {
  background: #101b29;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  font: 10.5px var(--mono);
  color: var(--cyan-soft);
}
.keys-label { color: var(--txt-dim); font-size: 12px; }
.keys-note { color: var(--txt-faint); font-size: 11px; line-height: 1.6; margin: 12px 0 4px; }

/* burn modal */
.burn-card { border-color: #57202c; box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 50px rgba(255, 45, 85, 0.08); }
.burn-title { color: #ffb3c4 !important; }
.burn-warn { color: var(--amber); font-size: 12.5px; line-height: 1.7; }
.burn-abort { color: var(--green); }
.hold-wrap { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hold-btn {
  position: relative;
  overflow: hidden;
  padding: 16px 30px;
  border-radius: 10px;
  border: 1px solid var(--red);
  color: #ffdbe3;
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.16), rgba(255, 45, 85, 0.05));
  font-size: 13px;
  letter-spacing: 3px;
  transition: box-shadow 0.2s;
}
.hold-btn.holding { box-shadow: 0 0 34px rgba(255, 45, 85, 0.4); }
.hold-ring { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.hold-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 45, 85, 0.65), rgba(255, 120, 60, 0.65));
  transform-origin: left;
  transform: scaleX(0);
}
.hold-txt { position: relative; z-index: 2; }
.hold-btn:disabled { opacity: 0.85; cursor: default; }

/* ================= toasts ================= */
.toasts {
  position: fixed;
  bottom: 44px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(8, 15, 26, 0.95);
  color: var(--txt);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: #123b2c; color: #9fe8c6; }
.toast.bad { border-color: #57202c; color: #ffb3c4; }
.toast.warn { border-color: #4a3a1e; color: var(--amber); }

/* ================= boot overlay ================= */
.boot-ov {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(900px 500px at 50% 30%, rgba(0, 229, 255, 0.05), transparent 70%),
    rgba(2, 4, 8, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: boot-in 0.25s ease;
}
@keyframes boot-in { from { opacity: 0; } }
.boot-card {
  width: min(560px, calc(100vw - 40px));
  border: 1px solid #1d4a5c;
  border-radius: 14px;
  background: rgba(6, 12, 20, 0.9);
  padding: 26px 30px;
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.08), inset 0 0 40px rgba(0, 229, 255, 0.03);
}
.boot-title { letter-spacing: 5px; font-size: 13px; color: var(--cyan); margin-bottom: 18px; animation: pulse 1.4s infinite; }
.boot-lines { min-height: 130px; display: flex; flex-direction: column; gap: 4px; }
.boot-line { font-size: 12px; color: var(--txt); display: flex; gap: 8px; animation: boot-line-in 0.2s ease; }
@keyframes boot-line-in { from { opacity: 0; transform: translateX(-6px); } }
.boot-line.ok { color: #9fe8c6; }
.boot-line.warn { color: var(--amber); }
.boot-line.bad { color: #ff8fa8; }
.boot-line.dim { color: var(--txt-dim); }
.boot-bullet { color: var(--cyan); flex: none; }
.boot-line.ok .boot-bullet { color: var(--green); }
.boot-line.bad .boot-bullet { color: var(--red); }
.boot-bar {
  margin-top: 18px;
  height: 4px;
  border-radius: 3px;
  background: rgba(0, 229, 255, 0.1);
  overflow: hidden;
}
.boot-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.3s ease;
}
.boot-ov.boot-out { animation: boot-out 0.55s ease forwards; }
.boot-ov.boot-out-fail { animation: boot-out 0.55s ease forwards; }
.boot-ov.boot-fail .boot-card { border-color: #57202c; box-shadow: 0 0 60px rgba(255, 45, 85, 0.1); }
@keyframes boot-out { to { opacity: 0; transform: scale(1.04); filter: blur(3px); } }

/* ================= burn overlay ================= */
.burn-ov {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}
.burn-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.burn-word {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(26px, 6vw, 64px);
  letter-spacing: 14px;
  color: #ffdbe3;
  text-shadow: 0 0 30px rgba(255, 45, 85, 0.8), 0 0 90px rgba(255, 80, 40, 0.5);
  animation: burn-word 1.2s ease-out, burn-shake 0.1s 8;
}
.burn-sub {
  position: absolute;
  top: calc(50% + clamp(24px, 5vw, 52px)); left: 50%;
  transform: translateX(-50%);
  font-size: clamp(10px, 1.6vw, 13px);
  letter-spacing: 4px;
  color: rgba(255, 179, 180, 0.85);
  white-space: nowrap;
}
@keyframes burn-word {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); filter: blur(8px); }
  25% { opacity: 1; filter: blur(0); }
  75% { opacity: 1; }
  100% { opacity: 0.9; }
}
@keyframes burn-shake {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% + 2px), -50%); }
  75% { transform: translate(calc(-50% - 2px), -50%); }
}
.burn-ov.burn-out { animation: burn-fade 0.6s ease forwards; }
@keyframes burn-fade { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .burn-word, .burn-sub { animation: none; }
  .brand-eye::after { animation: none; }
  .vl-spin span, .state-chip.mid .dot, .state-chip.warn .dot, .leak-verdict.checking { animation: none; }
  .boot-ov.boot-out, .boot-ov.boot-out-fail, .burn-ov.burn-out { animation: none; opacity: 0; }
}

/* ================= drawer (mobile) ================= */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.6);
  z-index: 45;
}
.drawer-toggle { display: none; }

/* ================= responsive ================= */
@media (max-width: 1080px) {
  :root { --sidebar-w: 300px; }
  .log-stream { height: 180px; }
}
@media (max-width: 900px) {
  .body { display: block; position: relative; }
  .side {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    right: 0;
    width: min(360px, 92vw);
    z-index: 50;
    transform: translateX(102%);
    transition: transform 0.25s ease;
    background: rgba(5, 9, 16, 0.985);
    border-right: 0;
    border-left: 1px solid var(--line-2);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  }
  body.drawer-open .side { transform: translateX(0); }
  body.drawer-open .drawer-backdrop { display: block; opacity: 1; }
  .drawer-toggle { display: inline-flex; }
  .drawer-backdrop { display: none; opacity: 0; transition: opacity 0.25s; }
  .drawer-backdrop.on { display: block; opacity: 1; }
  .tb-btn { padding: 0 10px; }
  .brand { font-size: 13px; letter-spacing: 1.5px; }
  .mode-chip { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 6px; gap: 4px; overflow: hidden; }
  .tb-left { gap: 4px; }
  .tb-right { gap: 4px; }
  #btnLeak, #btnHelp { display: none; }      /* leak check lives in the drawer + shortcut; help via '?' */
  .state-chip span:last-child { display: none; }  /* keep the light, drop text */
  .brand { font-size: 0; letter-spacing: 0; gap: 6px; } /* eye mark remains */
  .icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .tb-btn.burn { padding: 0 8px; letter-spacing: 0.5px; font-size: 10px; }
  .tab { min-width: 110px; max-width: 160px; }
  .navbar { padding: 7px 8px; gap: 5px; }
  .navbar .btn.primary { padding: 8px 12px; letter-spacing: 1px; }
  .addr-ghost { display: none; }
  .view-pane { inset: 5px 6px; }
  .ghost-mark { display: none; }
  .statusbar { gap: 8px; }
  .statusbar .dim, #sbReq { display: none; }
  .modal-card { padding: 18px 16px; }
  .keys-row { gap: 8px; }
  .keys-kbd { min-width: 96px; flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .f-grid { grid-template-columns: 1fr; }
  .f-cell.grow2 { grid-column: span 1; }
  .tab { min-width: 96px; }
}

/* focus visibility */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; border-radius: 4px; }
