/* Inter and JetBrains Mono, licensed under the SIL Open Font License (see fonts/) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --surface: #141518;
  --surface-2: #1a1c20;
  --surface-3: #24272d;
  --border: #282b31;
  --border-strong: #3a3e46;
  --row-line: rgba(255, 255, 255, .035);
  --text: #e4e6ea;
  --text-2: #a4a8b1;
  --text-3: #6e737d;
  --accent: #7ff0d4;
  --accent-soft: rgba(127, 240, 212, .12);
  --accent-line: rgba(127, 240, 212, .45);
  --selected: rgba(127, 240, 212, .1);
  --hover: rgba(255, 255, 255, .035);
  --ok: #6fdc95;
  --ok-soft: rgba(111, 220, 149, .13);
  --bad: #ff7b72;
  --bad-soft: rgba(255, 123, 114, .14);
  --warn: #e6b450;
  --warn-soft: rgba(230, 180, 80, .14);
  --mark-bg: #f2df6b;
  --mark-fg: #141414;
  --shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px var(--border-strong);
  --guide: #24262c;

  /* same colors as the terminal UI */
  --syn-message: #ffcb6b;
  --syn-submessage: #f0df8b;
  --syn-method: #eee79e;
  --syn-method-value: #dbbe5e;
  --syn-bracket: #5f9ec7;
  --syn-number: #f78c6c;
  --syn-string: #c3e88d;
  --syn-enum: #c792ea;
  --syn-bool: #74d6b0;
  --syn-type: #6b7280;
  --syn-key: #d0d3d9;

  --accent-ink: #062b23; /* text on top of the accent color */
  --control-shadow: 0 1px 0 rgba(0, 0, 0, .35);

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --row-h: 46px; /* keep in sync with ROW_HEIGHT in app.js */
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --border: #e1e4e9;
  --border-strong: #c8cdd5;
  --row-line: rgba(0, 0, 0, .05);
  --text: #1b1e23;
  --text-2: #555b65;
  --text-3: #868c96;
  --accent: #0a8a70;
  --accent-soft: rgba(10, 138, 112, .1);
  --accent-line: rgba(10, 138, 112, .45);
  --selected: rgba(10, 138, 112, .09);
  --hover: rgba(0, 0, 0, .03);
  --ok: #1a7f37;
  --ok-soft: rgba(26, 127, 55, .1);
  --bad: #cf222e;
  --bad-soft: rgba(207, 34, 46, .09);
  --warn: #9a6700;
  --warn-soft: rgba(154, 103, 0, .1);
  --mark-bg: #ffe066;
  --mark-fg: #141414;
  --shadow: 0 12px 32px rgba(20, 25, 35, .14), 0 0 0 1px var(--border-strong);
  --guide: #e5e7eb;
  --accent-ink: #ffffff;
  --control-shadow: 0 1px 2px rgba(16, 24, 40, .06);

  --syn-message: #a35b00;
  --syn-submessage: #866500;
  --syn-method: #6b5000;
  --syn-method-value: #957516;
  --syn-bracket: #2e6c9b;
  --syn-number: #c24d1c;
  --syn-string: #3a771b;
  --syn-enum: #8040b2;
  --syn-bool: #0e7a5d;
  --syn-type: #8d939d;
  --syn-key: #2a2e35;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font-ui);
  /* Inter's open digits and single storey a read better at small sizes */
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
/* stroked icons, see index.html */
.i { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code, kbd { font-family: var(--font-mono); font-size: 12px; }
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--surface-3);
  box-shadow: inset 0 -1px 0 var(--border-strong);
  color: var(--text);
  text-align: center;
  line-height: 18px;
}
mark { background: var(--mark-bg); color: var(--mark-fg); border-radius: 2px; }
.muted { color: var(--text-3); }
.grow { flex: 1; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--border-strong); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- toolbar ---------- */

.toolbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* same rounding as the image, so the outline follows its edge. It keeps the white half visible in the light theme */
.logo { display: block; flex: none; border-radius: 17.5%; box-shadow: 0 0 0 1px var(--border); }
.brand { width: 30px; height: 30px; margin-right: 4px; }

.search { position: relative; flex: 1 1 340px; max-width: 760px; display: flex; align-items: center; }
.search input {
  width: 100%;
  height: 32px;
  padding: 0 62px 0 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font: 12.5px var(--font-mono);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.search-icon { position: absolute; left: 11px; width: 14px; height: 14px; fill: var(--text-3); pointer-events: none; }
.search-btn {
  position: absolute;
  right: 5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.search-btn:hover { background: var(--surface-3); color: var(--text); }
#search-clear { right: 30px; }
#search-clear svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8; fill: none; }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggestions li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  font: 12px var(--font-mono);
  cursor: pointer;
}
.suggestions li.active { background: var(--accent-soft); color: var(--accent); }
.suggestions .hint { color: var(--text-3); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--control-shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.006em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .2s, border-color .2s, color .2s, transform .08s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .mini:focus-visible, .link:focus-visible, .status-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn .i { margin-left: -2px; color: var(--text-2); transition: color .2s; }
.btn:hover .i { color: var(--text); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.icon .i { margin: 0; }

/* clear: red, and the lid of the bin comes off */
.btn.danger:hover { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); color: var(--bad); }
.btn.danger:hover .i { color: var(--bad); }
.trash .lid { transform-box: fill-box; transform-origin: 100% 100%; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.btn:hover .trash .lid { transform: translate(1px, -1.5px) rotate(14deg); }

/* export: the arrow points into the tray */
.btn:hover .download { color: var(--accent); }
.btn:hover .download .arrow { animation: drop .9s ease-in-out infinite; }
@keyframes drop { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(1.5px); } }

/* theme: the icons of the three modes turn into each other */
.btn.theme { position: relative; overflow: hidden; }
.btn.theme .theme-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: rotate(-120deg) scale(.4);
  transition: opacity .25s, transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.theme-icon .fill { fill: currentColor; stroke: none; }
.btn.theme[data-mode="system"] .theme-icon[data-mode="system"],
.btn.theme[data-mode="light"] .theme-icon[data-mode="light"],
.btn.theme[data-mode="dark"] .theme-icon[data-mode="dark"] { opacity: 1; transform: none; }

/* the new theme spreads out from the button, see switchTheme in app.js */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.btn .chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; margin-right: -3px; color: var(--text-3); }

/* checkboxes */

.cb {
  flex: none;
  display: grid;
  place-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.cb::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--accent-ink);
  -webkit-mask: var(--check-mark) center / contain no-repeat;
  mask: var(--check-mark) center / contain no-repeat;
  transform: scale(0);
  transition: transform .15s cubic-bezier(.3, 1.5, .5, 1);
}
.cb:hover:not(:checked) { border-color: var(--text-3); }
.cb:checked { border-color: var(--accent); background: var(--accent); }
.cb:checked::before { transform: scale(1); }
.cb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
:root {
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.4 6.3 4.9 8.8l4.7-5.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s;
}
.check:hover { background: var(--hover); color: var(--text); }
.check:has(.cb:checked) { color: var(--text); }
.check.disabled { opacity: .45; cursor: not-allowed; }
.check.disabled:hover { background: none; color: var(--text-2); }
.check.disabled .cb { cursor: not-allowed; }
.check.small { height: 24px; gap: 6px; padding: 0 6px; font-size: 12px; }
.check.small .cb { width: 14px; height: 14px; border-radius: 4px; }
.check.small .cb::before { width: 9px; height: 9px; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 1px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--control-shadow);
}
.count-badge {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

/* live: a red dot sending out waves. Paused: amber. Hovering shows what a click does */
.rec-icon { display: grid; place-items: center; width: 15px; height: 15px; margin-left: -2px; }
.rec-icon > * { grid-area: 1 / 1; transition: opacity .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: ripple 2s ease-out infinite; }
/* the icons take the color of the state, amber while paused */
.btn.record .rec-icon .i, .btn.record:hover .rec-icon .i { margin: 0; color: inherit; }
.rec-play path { fill: currentColor; stroke: none; }
.rec-pause, .rec-play,
.btn.record:hover .rec-dot,
.btn.record[aria-pressed="true"] .rec-dot,
.btn.record[aria-pressed="true"]:hover .rec-pause { opacity: 0; transform: scale(.3); }
.btn.record:hover .rec-pause,
.btn.record[aria-pressed="true"] .rec-pause,
.btn.record[aria-pressed="true"]:hover .rec-play { opacity: 1; transform: none; }
.btn.record[aria-pressed="true"] { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 60%, transparent); color: var(--warn); }
.btn.record[aria-pressed="true"]:hover { border-color: var(--warn); }
@keyframes ripple {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 0%, transparent); }
}
@keyframes pulse { 50% { opacity: .35; } }
/* both labels take up space, so pausing doesn't change the width of the button and move the toolbar */
.btn.record .labels { display: grid; justify-items: center; }
.btn.record .labels > span { grid-area: 1 / 1; }
.btn.record .paused, .btn.record[aria-pressed="true"] .live { visibility: hidden; }
.btn.record[aria-pressed="true"] .paused { visibility: visible; }

.toolbar-spacer { flex: 1; }

/* ---------- layout ---------- */

.main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, var(--list-width, 50%)) 1px minmax(360px, 1fr);
}

.splitter { position: relative; z-index: 5; background: var(--border); cursor: col-resize; transition: background .12s; }
.splitter::before { content: ""; position: absolute; inset: 0 -4px; }
.splitter:hover, .splitter.dragging { background: var(--accent); }

/* ---------- log ---------- */

.log { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }

.log-head, .row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto 66px; column-gap: 12px; }
.log-head {
  flex: none;
  align-items: center;
  height: 28px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
}
.log-head .end { justify-self: end; }
.sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  height: 20px;
  margin: 0 -5px;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.sort:hover { background: var(--hover); color: var(--text-2); }
.sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.sort.active { color: var(--text); }
.sort-arrow {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: transform .15s, opacity .12s;
}
.sort:hover .sort-arrow { opacity: .5; }
.sort.active .sort-arrow { opacity: 1; color: var(--accent); }
.sort.desc .sort-arrow { transform: rotate(180deg); }

.viewport { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; outline: none; }
.sizer { width: 1px; }
.rows { position: absolute; top: 0; left: 0; right: 0; }

.row {
  height: var(--row-h);
  grid-template-rows: 20px 18px;
  align-content: center;
  padding: 0 12px;
  border-left: 2px solid transparent;
  box-shadow: inset 0 -1px 0 var(--row-line);
  cursor: pointer;
}
.row:hover { background: var(--hover); }
.row.selected { background: var(--selected); border-left-color: var(--accent); }
.row > span { min-width: 0; }
.row .time { grid-area: 1 / 1; align-self: center; color: var(--text-2); font: 12px var(--font-mono); }
.row .rpc { grid-area: 2 / 1; align-self: center; overflow: hidden; color: var(--text-3); font: 11px var(--font-mono); white-space: nowrap; text-overflow: ellipsis; }
.row .method { grid-area: 1 / 2; display: flex; align-items: baseline; gap: 7px; overflow: hidden; white-space: nowrap; }
.row .method .name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; }
.row .method .value { color: var(--text-3); font: 11px var(--font-mono); }
.row .status { grid-area: 1 / 3; justify-self: end; align-self: center; }
.row .size { grid-area: 1 / 4; justify-self: end; align-self: center; color: var(--text-3); font: 11.5px var(--font-mono); }
.row .preview {
  grid-area: 2 / 2 / 3 / 5;
  align-self: center;
  overflow: hidden;
  color: var(--text-3);
  font: 11.5px var(--font-mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row .preview .req { color: var(--text-2); }
.row .preview .arrow { margin: 0 8px; color: var(--accent); opacity: .7; }

.status-badge {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font: 600 10.5px/17px var(--font-mono);
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.status-badge.ok { background: var(--ok-soft); color: var(--ok); }
.status-badge.bad { background: var(--bad-soft); color: var(--bad); }
.status-badge.warn { background: var(--warn-soft); color: var(--warn); }
.status-badge.muted { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-3); }

.proxy-tag {
  padding: 0 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px currentColor;
  color: var(--syn-enum);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 15px;
  text-transform: uppercase;
}

.log-empty {
  position: absolute;
  inset: 28px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-3);
  text-align: center;
  pointer-events: none;
}
.log-empty > * { pointer-events: auto; }
.log-empty .logo { width: 56px; height: 56px; margin-bottom: 4px; }
.log-empty .title { color: var(--text-2); font-size: 15px; font-weight: 600; }
.log-empty code { padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text); user-select: all; }

.new-pill {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #062b23;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
:root[data-theme="light"] .new-pill { color: #fff; }
/* sorted newest first, new rows show up at the top */
.new-pill.top { top: 42px; bottom: auto; }

/* ---------- inspector ---------- */

.inspector { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.inspector-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-3);
  text-align: center;
}
.inspector-empty svg { width: 34px; height: 34px; margin-bottom: 4px; fill: none; stroke: var(--border-strong); stroke-width: 1.6; stroke-linecap: round; }
.inspector-empty .title { color: var(--text-2); font-size: 15px; font-weight: 600; }

.inspector-head { flex: none; padding: 14px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ih-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ih-method { color: var(--syn-method); font: 600 15px var(--font-mono); word-break: break-all; }
:root[data-theme="light"] .ih-method { color: var(--text); }
.ih-value { color: var(--syn-method-value); font: 13px var(--font-mono); }
.ih-actions { display: flex; gap: 6px; margin-left: auto; }
.ih-via { margin-top: 4px; color: var(--syn-enum); font: 12px var(--font-mono); }
.ih-meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin-top: 6px; color: var(--text-3); font: 12px var(--font-mono); }
.ih-meta .sep { margin: 0 8px; opacity: .6; }

.inspector-tools {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tree-tools { display: flex; align-items: center; gap: 6px; }

.tabs { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); }
.tabs button {
  padding: 3px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }

.mini {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--control-shadow);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.mini:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }

.inspector-body { flex: 1; min-height: 0; overflow: auto; transition: opacity .15s; }
/* otherwise both share the height and the empty state sits in the upper half */
.inspector-empty:not([hidden]) ~ .inspector-body { display: none; }
.inspector-body.loading { opacity: .45; }
.inspector-message { padding: 32px 16px; color: var(--text-3); text-align: center; }

.section + .section { border-top: 1px solid var(--border); }
.section-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 16px 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.section:not(.open) .section-head { border-bottom: 0; }
.section-title { color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.section-name { overflow: hidden; color: var(--syn-message); font: 600 13px var(--font-mono); white-space: nowrap; text-overflow: ellipsis; }
.section-size { color: var(--text-3); font: 12px var(--font-mono); white-space: nowrap; }
.section-actions { display: flex; gap: 4px; margin-left: auto; }
.section-actions .mini { height: 22px; padding: 0 7px; font-size: 11px; }
.section-body { display: none; padding: 10px 16px 16px; }
.section.open .section-body { display: block; }
.section-head .tw::before, .tl.x .tw::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .12s;
}
.section-head .tw { width: 12px; color: var(--text-3); text-align: center; }
.section.open > .section-head .tw::before, .tn.open > .tl .tw::before { transform: rotate(90deg); }

.note-box {
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
}
.empty-message { color: var(--text-3); font: 12.5px var(--font-mono); }

/* tree */

.tree { font: 12.5px/20px var(--font-mono); }
.tl { position: relative; padding-left: 16px; border-radius: 4px; white-space: pre-wrap; word-break: break-word; }
.tl .tw { position: absolute; left: 0; top: 0; width: 14px; color: var(--text-3); text-align: center; }
.tl.x { cursor: pointer; }
.tl.x:hover { background: var(--hover); }
.tc { display: none; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--guide); }
.tn.open > .tc { display: block; }
.tn.open > .tl .pv { display: none; }
.ty { margin-right: 7px; color: var(--syn-type); font-style: italic; }
.ty.msg { color: var(--syn-submessage); font-style: normal; }
.no-types .ty { display: none; }
.k { color: var(--syn-key); }
.k.idx { color: var(--text-3); }
.c { margin-right: 7px; color: var(--text-3); }
.v.str { color: var(--syn-string); }
.v.num { color: var(--syn-number); }
.v.enum { color: var(--syn-enum); }
.v.bool { color: var(--syn-bool); }
.v.null { color: var(--text-3); }
.note { margin-left: 7px; color: var(--text-3); font-size: 11px; }
.pv { margin-left: 7px; color: var(--text-3); }
.count { margin-left: 5px; color: var(--text-3); }

/* code views */

.code { margin: 0; font: 12.5px/19px var(--font-mono); white-space: pre-wrap; word-break: break-word; tab-size: 2; }
.code .s { color: var(--syn-string); }
.code .n { color: var(--syn-number); }
.code .b { color: var(--syn-bool); }
.code .e { color: var(--syn-enum); }
.code .k { color: var(--syn-key); }
.code .p { color: var(--syn-bracket); }

/* ---------- statusbar ---------- */

.statusbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 6px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-3);
  font: inherit;
}
.status-item .i { width: 13px; height: 13px; }
button.status-item { cursor: pointer; transition: background .12s, color .12s; }
button.status-item:hover { background: var(--hover); color: var(--text); }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.conn.connected { color: var(--text-2); }
.conn.connected .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.disconnected { color: var(--bad); }
.conn.disconnected .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); animation: pulse 1.2s ease-in-out infinite; }
.receiver code { color: var(--text-2); font-size: 11.5px; }
.receiver:hover code { color: var(--text); }
.paused-note { color: var(--warn); }
.stats { padding: 0 8px; font-variant-numeric: tabular-nums; }
.stats b { color: var(--text-2); font-weight: 600; }
.stats .sep { margin: 0 7px; opacity: .5; }

/* ---------- popovers ---------- */

.popover { position: fixed; z-index: 50; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }

.methods-pop { display: flex; flex-direction: column; width: 400px; max-width: calc(100vw - 16px); max-height: min(70vh, 580px); }
.pop-search { padding: 10px 10px 6px; }
.pop-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  font: 12.5px var(--font-mono);
  outline: none;
}
.pop-search input:focus { border-color: var(--accent-line); }
.pop-actions { display: flex; align-items: center; gap: 12px; padding: 0 12px 8px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 500; }
.link { padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }
.methods-list { flex: 1; margin: 0; padding: 4px; overflow: auto; list-style: none; }
.methods-list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto 48px 40px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.methods-list li:hover { background: var(--hover); }
.methods-list li:hover .cb:not(:checked) { border-color: var(--text-3); }
.methods-list li.off .name { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.methods-list li.none { display: block; padding: 16px; color: var(--text-3); text-align: center; cursor: default; }
.methods-list .cb { pointer-events: none; }
.methods-list .name { overflow: hidden; font: 12px var(--font-mono); white-space: nowrap; text-overflow: ellipsis; }
.methods-list .count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
/* how often a method was called compared to the busiest one */
.methods-list .meter { height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.methods-list .meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); opacity: .8; }
.methods-list li.off .meter span { background: var(--text-3); opacity: .5; }
.methods-list .only {
  visibility: hidden;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
}
.methods-list li:hover .only { visibility: visible; }
.methods-list .only:hover { color: var(--accent); border-color: var(--accent-line); }

.help-pop { width: 560px; max-width: calc(100vw - 16px); max-height: calc(100vh - 80px); overflow: auto; padding: 6px 18px 14px; }
.help-pop h3 { margin: 14px 0 8px; color: var(--text-3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.help-pop table { width: 100%; border-collapse: collapse; }
.help-pop td { padding: 4px 12px 4px 0; vertical-align: top; }
.help-pop td:first-child { white-space: nowrap; }
.help-pop .keys td:nth-child(odd) { white-space: nowrap; }
.help-pop code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
.help-pop p { margin: 8px 0 0; font-size: 12px; }

.toast {
  position: fixed;
  bottom: 44px;
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  font-size: 12.5px;
  font-weight: 550;
}

/* ---------- login ---------- */

.login-page { align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 340px;
  padding: 32px 28px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .25);
  text-align: center;
}
.login-card .logo { width: 64px; height: 64px; margin-bottom: 14px; }
.login-card h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.login-card p { margin: 6px 0 0; }
.login-input {
  width: 100%;
  height: 38px;
  margin-top: 22px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-error { align-self: stretch; padding: 7px 10px; border-radius: 7px; background: var(--bad-soft); color: var(--bad); font-size: 12.5px; font-weight: 500; }
p.login-error { margin-top: 10px; }
.login-button {
  justify-content: center;
  width: 100%;
  height: 38px;
  margin-top: 14px;
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.login-button:hover { border-color: transparent; background: var(--accent); filter: brightness(1.08); }
.login-button:disabled { opacity: .7; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 55%) 1px minmax(0, 1fr); }
  .splitter { cursor: default; pointer-events: none; }
  .splitter::before { display: none; }
}
