@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-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: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-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;
}

:root {
  color-scheme: dark;
  --bg: #0a0f15;
  --stage: #070b10;
  --text: #e8eef6;
  --muted: #9aa7b8;
  --dim: #6c7a8c;
  /* --line: rgba(255, 255, 255, 0.08); */
  --line: rgba(255, 255, 255, 0.09);
  --green: #3ddc97;
  --live: #34d399;
  --panel: var(--bg);
  --panel-2: rgba(255, 255, 255, 0.045);
  --head: var(--bg);
  --line-strong: var(--line);
  --cyan: #79b8ff;
  --danger: #ff8f84;
  --mark: var(--dim);
  --rule: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.04);
  --ring: rgba(232, 238, 246, 0.28);
  --op-border: rgba(232, 238, 246, 0.35);
  --false: #b7c3d1;
  --num: #e2b15a;
  --shadow: rgba(0, 0, 0, 0.38);
  --brand: #fff;
  --dash-border: rgba(232, 238, 246, 0.55);
  --divider: rgba(255, 255, 255, 0.14);
  --dash-hover: rgba(255, 255, 255, 0.04);
  --dot-glow: rgba(52, 211, 153, 0.16);
  --cpu: #3ddc97;
  --ram: #79b8ff;
  --ssd: #e2b15a;
  --back: #f1c881;
  --win: #34d399;
  --stakes-text: #e8eef6;
  /* --stakes-text: #98a0aaa3; */
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) {
  color-scheme: light;
  --bg: #ffffff;
  --stage: #f7f9fb;
  --text: #1c2b38;
  --muted: #5c7082;
  --dim: #6d8294;
  /* --line: rgba(20, 40, 60, 0.1); */
  --line: rgba(20, 40, 60, 0.13);
  --live: #0c9a62;
  --green: #0c9a62;
  --brand: #1c2b38;
  --panel: var(--bg);
  --panel-2: rgba(16, 40, 64, 0.05);
  --head: var(--bg);
  --line-strong: var(--line);
  --cyan: #1d6fbf;
  --danger: #d04b42;
  --mark: var(--dim);
  --rule: rgba(20, 40, 60, 0.16);
  --hover: rgba(16, 40, 64, 0.05);
  --ring: rgba(28, 43, 56, 0.22);
  --op-border: rgba(28, 43, 56, 0.28);
  --false: #8d6570;
  --num: #a87412;
  --shadow: rgba(28, 48, 68, 0.12);
  --dash-border: rgba(28, 43, 56, 0.28);
  --divider: rgba(20, 40, 60, 0.16);
  --dash-hover: rgba(16, 40, 64, 0.05);
  --dot-glow: rgba(12, 154, 98, 0.18);
  --cpu: #0c9a62;
  --ram: #1d6fbf;
  --ssd: #a87412;
  --back: #b99b65;
  --win: #0c9a62;
  --stakes-text: #1c2b38;
  /* --stakes-text: #5c7082a5; */
}

html[data-theme="navy"] {
  color-scheme: dark;
  --bg: #1d2936;
  --stage: #141e29;
  --text: #e8eef6;
  --muted: #9aa7b8;
  --dim: #6c7a8c;
  --line: rgba(255, 255, 255, 0.09);
  --green: #3ddc97;
  --live: #34d399;
  --panel: var(--bg);
  --panel-2: rgba(255, 255, 255, 0.045);
  --head: var(--bg);
  --line-strong: var(--line);
  --cyan: #79b8ff;
  --danger: #ff8f84;
  --mark: var(--dim);
  --rule: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.04);
  --ring: rgba(232, 238, 246, 0.28);
  --op-border: rgba(232, 238, 246, 0.35);
  --false: #b7c3d1;
  --num: #e2b15a;
  --shadow: rgba(0, 0, 0, 0.38);
  --brand: #fff;
  --dash-border: rgba(232, 238, 246, 0.55);
  --divider: rgba(255, 255, 255, 0.14);
  --dash-hover: rgba(255, 255, 255, 0.04);
  --dot-glow: rgba(52, 211, 153, 0.16);
  --cpu: #3ddc97;
  --ram: #79b8ff;
  --ssd: #e2b15a;
  --back: #f1c881;
  --win: #34d399;
  --stakes-text: #e8eef6;
}

html[data-theme="pitch"] {
  color-scheme: light;
  --bg: #ffffff;
  --stage: #eef8f2;
  --text: #142033;
  --muted: #4d6278;
  --dim: #6a7f94;
  --line: rgba(12, 40, 28, 0.12);
  --live: #1db954;
  --green: #1db954;
  --brand: #142033;
  --panel: #ffffff;
  --panel-2: #e7f6ec;
  --head: #ffffff;
  --line-strong: rgba(12, 40, 28, 0.16);
  --cyan: #1d6fbf;
  --danger: #d04b42;
  --mark: var(--dim);
  --rule: rgba(12, 40, 28, 0.16);
  --hover: rgba(29, 185, 84, 0.1);
  --ring: rgba(20, 32, 51, 0.22);
  --op-border: rgba(20, 32, 51, 0.28);
  --false: #8d6570;
  --num: #e06a12;
  --shadow: rgba(10, 28, 48, 0.12);
  --dash-border: rgba(20, 32, 51, 0.22);
  --divider: rgba(12, 40, 28, 0.16);
  --dash-hover: rgba(29, 185, 84, 0.1);
  --dot-glow: rgba(29, 185, 84, 0.2);
  --cpu: #1db954;
  --ram: #1d6fbf;
  --ssd: #e06a12;
  --back: #e09a3a;
  --win: #12964a;
  --stakes-text: #142033;
  --chrome: #0b1c3a;
  --chrome-text: #f4f7fb;
  --chrome-muted: #9eb0c8;
}

html[data-theme="pitch"] .chrome,
html[data-theme="pitch"] .subtabs {
  background: var(--chrome);
  color: var(--chrome-text);
}

html[data-theme="pitch"] .status {
  color: var(--chrome-muted);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="pitch"] .chrome .label,
html[data-theme="pitch"] .refresh-period,
html[data-theme="pitch"] .logout,
html[data-theme="pitch"] .theme,
html[data-theme="pitch"] .loading,
html[data-theme="pitch"] .subtabs .tab,
html[data-theme="pitch"] .nav .tab {
  color: var(--chrome-muted);
}

html[data-theme="pitch"] .chrome .clock,
html[data-theme="pitch"] .chrome .brand,
html[data-theme="pitch"] .chrome .brand-name,
html[data-theme="pitch"] .logout:hover,
html[data-theme="pitch"] .refresh-period:hover,
html[data-theme="pitch"] .refresh-period:focus,
html[data-theme="pitch"] .nav .tab:hover,
html[data-theme="pitch"] .nav .tab[aria-current="page"],
html[data-theme="pitch"] .subtabs .tab:hover,
html[data-theme="pitch"] .subtabs .tab[aria-current="page"] {
  color: var(--chrome-text);
}

html[data-theme="pitch"] .chrome .divider {
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="pitch"] .status-tools {
  background: linear-gradient(90deg, transparent, var(--chrome) 16px);
}

html[data-theme="pitch"] .nav,
html[data-theme="pitch"] .subtabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="pitch"] .nav .brand {
  background: var(--chrome);
}

html[data-theme="pitch"] .nav .brand::after {
  background: linear-gradient(90deg, var(--chrome), transparent);
}

html[data-theme="pitch"] .theme:hover {
  color: var(--chrome-text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="pitch"] .monitor-head {
  background: #1db954;
  border-bottom-color: transparent;
}

html[data-theme="pitch"] .monitor-head .monitor-title,
html[data-theme="pitch"] .monitor-head .date-field,
html[data-theme="pitch"] .monitor-head .gauge-key,
html[data-theme="pitch"] .monitor-head .legend {
  color: #fff;
}

html[data-theme="pitch"] .monitor-head .monitor-mark,
html[data-theme="pitch"] .monitor-head .control-mark {
  border-color: #fff;
}

html[data-theme="pitch"] .monitor-head .log-clear-btn {
  color: #fff;
}

html[data-theme="pitch"] .monitor-head .log-clear-btn:hover {
  color: #fff;
  opacity: 0.75;
}

html[data-theme="pitch"] .monitor-rule {
  border-top-color: rgba(255, 255, 255, 0.5);
}

html[data-theme="pitch"] .gate-submit {
  background: #f26522;
  color: #fff;
}

* { box-sizing: border-box; }

*::-webkit-scrollbar:horizontal {
  height: 0;
}

html, body {
  height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.62 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.chrome {
  flex: none;
  background: var(--bg);
}

.status {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 28px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--dim);
}

.status-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  user-select: none;
  scrollbar-width: none;
}

.status-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  gap: 16px;
  padding: 0 16px;
  padding-right: 84px;
  white-space: nowrap;
}

.feed,
.time-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.session {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  --pulse: var(--live);
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--pulse);
  animation: feed-pulse 1.6s ease-out infinite;
}

@keyframes feed-pulse {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(2.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dot::after { animation: none; }
}

.feed {
  color: var(--live);
  font-weight: 600;
}

.feed[data-state="warn"] { color: var(--ssd); }
.feed[data-state="bad"] { color: var(--danger); }

.feed[data-state="warn"] .dot {
  background: var(--ssd);
  --pulse: var(--ssd);
}

.feed[data-state="bad"] .dot {
  background: var(--danger);
  --pulse: var(--danger);
}

.feed[data-state="pause"] { color: var(--cyan); }

.feed[data-state="pause"] .dot {
  background: var(--cyan);
  --pulse: var(--cyan);
}

.feed[data-state="pause"] .feed-live { display: none; }

.divider {
  width: 1px;
  height: 12px;
  background: var(--divider);
}

.feed .divider { margin-left: 8px; }

.label { color: var(--dim); }

.clock {
  color: var(--muted);
  font-weight: 600;
}

.version {
  color: var(--dim);
  font-weight: 400;
}

.refresh-period-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.refresh-period-wrap::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -1px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--dim);
  pointer-events: none;
}

.refresh-period {
  appearance: none;
  field-sizing: content;
  width: auto;
  height: 22px;
  min-width: 0;
  padding: 0 12px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: none;
  cursor: pointer;
}

.refresh-period:hover,
.refresh-period:focus {
  outline: none;
  color: var(--text);
}

.status-tools {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 16px 0 22px;
  background: linear-gradient(90deg, transparent, var(--bg) 16px);
}

.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--muted);
  opacity: 0;
}

.loading svg {
  display: block;
}

html.is-busy .loading {
  opacity: 1;
}

html.is-busy .loading svg {
  animation: loading-spin 0.7s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.is-busy .loading svg { animation: none; }
}

.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme svg { display: block; }

.theme:hover {
  color: var(--text);
  border-color: var(--dash-border);
  background: var(--dash-hover);
}

.logout {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
}

.logout:hover { color: var(--text); }

.gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--stage);
}

.gate-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.gate-brand { align-self: flex-start; }

.gate-label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.gate-pin {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--dash-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-align: center;
}

.gate-pin:focus {
  outline: none;
  border-color: var(--live);
}

.gate-error {
  margin: -6px 0 0;
  color: #ff8f84;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.gate-submit {
  height: 38px;
  border: 0;
  border-radius: 3px;
  background: var(--live);
  color: #07140e;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.gate-submit:hover { filter: brightness(1.08); }

html[data-auth="in"] .gate { display: none; }

html:not([data-auth="in"]) .chrome,
html:not([data-auth="in"]) .stage { display: none; }

.nav {
  display: flex;
  align-items: stretch;
  height: 56px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.nav .brand {
  position: relative;
  z-index: 1;
  flex: none;
  height: 100%;
  padding: 0 8px 0 14px;
  background: var(--bg);
}

.nav .brand::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: 28px;
  height: 100%;
  background: linear-gradient(90deg, var(--bg), transparent);
  pointer-events: none;
}

.nav-scroll {
  flex: 1;
  min-width: 0;
  margin-left: -28px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  user-select: none;
  scrollbar-width: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: none;
}

.logo { display: block; border-radius: 6px; }

.logo-mark {
  position: relative;
  display: inline-flex;
  flex: none;
}

html.has-alerts .logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--danger);
  pointer-events: none;
}

.brand-name {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand);
}

.tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  min-height: 100%;
  gap: 22px;
  padding: 0 16px 0 56px;
  white-space: nowrap;
}

.tab {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover,
.tab[aria-current="page"] { color: var(--brand); }

.stage {
  flex: 1;
  min-height: 0;
  background: var(--stage);
}

#stakes[hidden],
#finances[hidden],
#config[hidden] { display: none; }

#stakes:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.stakes-pane[hidden] { display: none; }

.stakes-pane:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px;
}

#stakes .auth-board {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#stakes .stakes-filters {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

#stakes .stakes-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#stakes .stakes-filter[hidden],
#stakes .stakes-add[hidden] { display: none; }

#stakes .stakes-merge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#stakes .stakes-merge input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1.5px solid var(--dim);
  background: transparent;
  cursor: pointer;
}

#stakes .stakes-merge input:checked {
  border-color: var(--live);
  background: var(--live);
  box-shadow: inset 0 0 0 2px var(--bg);
}

#stakes .stakes-merge input:focus-visible {
  outline: 1px solid var(--live);
  outline-offset: 1px;
}

#stakes .stakes-add,
#stakes .stakes-remove {
  height: 26px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#stakes .stakes-add { padding: 0 8px; }

#stakes .stakes-add:hover,
#stakes .stakes-remove:hover { color: var(--text); }

#stakes .stakes-remove {
  width: 26px;
  padding: 0;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

#stakes .stakes-filter input {
  height: 26px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  text-transform: none;
  padding: 0 6px;
}

#stakes .stakes-filter input[type="date"] { color-scheme: inherit; }

#stakes .stakes-filter input:not([type="date"]) { width: 16ch; }

#stakes .stakes-filter input:focus {
  outline: 1px solid var(--dash-border);
  outline-offset: 0;
}

#stakes .stakes-suggest {
  position: relative;
  display: inline-flex;
}

#stakes .stakes-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 4;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  max-height: 220px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px var(--shadow);
}

#stakes .stakes-menu[hidden] { display: none; }

#stakes .stakes-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 12px/1.35 var(--mono);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
}

#stakes .stakes-check {
  width: 10px;
  height: 10px;
  border: 1px solid var(--dim);
  flex: none;
}

#stakes .stakes-option[aria-checked="true"] .stakes-check {
  background: var(--live);
  border-color: var(--live);
}

#stakes .stakes-option:hover,
#stakes .stakes-option[aria-selected="true"] { background: var(--dash-hover); }

#stakes .stakes-frame {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

#stakes .auth-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

#stakes .auth-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#stakes .stakes-bar {
  flex: none;
  width: 12px;
  margin: 6px 4px 6px 0;
  position: relative;
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

#stakes .stakes-bar.is-on {
  opacity: 1;
  pointer-events: auto;
}

#stakes .stakes-bar:focus-visible {
  outline: 1px solid var(--dash-border);
  outline-offset: 1px;
}

#stakes .stakes-thumb {
  position: absolute;
  left: 2px;
  width: 8px;
  border-radius: 4px;
  background: var(--dim);
  cursor: grab;
}

#stakes .stakes-thumb:active { cursor: grabbing; }

#stakes .auth-scroll:has(.chart-empty:not([hidden])) .auth-table { display: none; }

#stakes .chart-empty {
  position: static;
  height: 48px;
  font-size: 11px;
}

#strategies .stakes-filter select,
#strategies .stakes-filter input[type="number"],
#matrix .stakes-filter input[type="number"] {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: transparent;
  color: var(--text);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  text-transform: none;
}

#strategies .stakes-filter select {
  min-width: 108px;
  max-width: 320px;
  padding: 0 22px 0 6px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 12px) center, calc(100% - 8px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}

#strategies-strategy { width: 28ch; }

#strategies .stakes-filter input[type="number"],
#matrix .stakes-filter input[type="number"] { width: 8ch; }

#strategies .stakes-filter select:focus,
#strategies .stakes-filter input[type="number"]:focus,
#matrix .stakes-filter input[type="number"]:focus {
  outline: 1px solid var(--dash-border);
  outline-offset: 0;
}

#events .stakes-filter select,
#events .stakes-filter input[type="number"] {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: transparent;
  color: var(--text);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  text-transform: none;
}

#events .stakes-filter select {
  min-width: 108px;
  max-width: 280px;
  padding: 0 22px 0 6px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 12px) center, calc(100% - 8px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}

#events .stakes-filter input[type="number"] { width: 12ch; }

#events .stakes-filter input#events-points,
#events .stakes-filter input#events-refresh,
#events .stakes-filter input#events-leve { width: 8ch; }

#events .stakes-filter select:focus,
#events .stakes-filter input[type="number"]:focus {
  outline: 1px solid var(--dash-border);
  outline-offset: 0;
}

#stakes #events .auth-table th,
#stakes #events .auth-table th:first-child {
  cursor: pointer;
  user-select: none;
}

#events .parser-table th,
#events .parser-table td,
#events .auth-table th:first-child,
#events .auth-table td:first-child {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

#events .auth-table tbody td,
#events .auth-table tbody td:first-child {
  color: var(--stakes-text);
}

#events .auth-table tbody td.events-borrowed {
  color: var(--dim);
}

#events .auth-table tbody tr.stakes-group-open td {
  padding-top: 7px;
  padding-bottom: 7px;
  line-height: 15px;
}

#events .events-columns { min-width: 168px; }

#events-open[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--live);
}

#events .events-col {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  cursor: grab;
}

#events .events-col.is-dragging { opacity: 0.45; }

#events .events-grip {
  color: var(--dim);
  font: 600 12px/1 var(--mono);
  letter-spacing: -0.12em;
  cursor: grab;
  user-select: none;
}

#events .events-col .stakes-merge { flex: 1; }

#events-books-list .stakes-merge {
  text-transform: none;
  letter-spacing: 0;
  font: 500 12px/1 var(--mono);
  color: var(--text);
}

#strategies.stakes-pane:not([hidden]) { overflow: auto; }

#strategies .auth-board {
  flex: 1 0 auto;
  min-height: 100%;
}

#strategies .strategies-body {
  flex: 1 0 420px;
  min-height: 420px;
  display: flex;
  align-items: stretch;
}

#strategies .stakes-facts {
  flex: none;
  border-top: 1px solid var(--line);
}

#strategies .stakes-facts[hidden] { display: none; }

#strategies .stakes-facts th,
#strategies .stakes-facts td {
  position: static;
  width: auto;
  max-width: 48ch;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--stakes-text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  white-space: normal;
}

#strategies .stakes-facts th {
  max-width: none;
  padding-right: 16px;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
}

#strategies .stakes-facts td { overflow-wrap: anywhere; }

#strategies .strategies-metrics {
  flex: none;
  width: 232px;
  border-collapse: collapse;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#strategies .strategies-metrics th,
#strategies .strategies-metrics td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

#strategies .strategies-metrics thead th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#strategies .strategies-metrics tbody th {
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 0.06em;
}

#strategies .strategies-metrics td { color: var(--text); }

#strategies .strategies-metrics td.strategies-up { color: var(--win); }

#strategies .strategies-metrics td.strategies-down { color: var(--danger); }

#matrix .matrix-periods {
  display: inline-flex;
  align-items: center;
}

#matrix .matrix-periods button {
  height: 26px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#matrix .matrix-periods button + button { margin-left: -1px; }

#matrix .matrix-periods button[aria-pressed="true"] {
  position: relative;
  z-index: 1;
  border-color: var(--dash-border);
  background: var(--panel-2);
  color: var(--text);
}

#matrix .matrix-periods button:hover { color: var(--text); }

#matrix .matrix-menu {
  min-width: 240px;
  max-height: 360px;
}

#matrix .matrix-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 12px/1.35 var(--mono);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  padding: 6px 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#matrix .matrix-option:hover,
#matrix .matrix-option.is-drop-before,
#matrix .matrix-option.is-drop-after { background: var(--dash-hover); }

#matrix .matrix-option.is-dragging { opacity: 0.4; }

#matrix .matrix-option.is-drop-before { box-shadow: inset 0 2px 0 var(--live); }

#matrix .matrix-option.is-drop-after { box-shadow: inset 0 -2px 0 var(--live); }

#matrix .matrix-option[aria-checked="true"] .stakes-check {
  background: var(--win);
  border-color: var(--win);
}

#matrix .matrix-grip {
  flex: none;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: -0.14em;
}

#matrix .matrix-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#matrix .matrix-frame {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

#matrix .matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  align-content: start;
  align-items: start;
  padding: 8px;
}

@media (max-width: 760px) {
  #matrix .matrix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#matrix .matrix-frame:has(.chart-empty:not([hidden])) .matrix-grid { display: none; }

#matrix .matrix-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 142px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}

#matrix .matrix-card:hover,
#matrix .matrix-card:focus-visible {
  border-color: var(--muted);
  outline: none;
}

#matrix .matrix-card-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 6px 8px 0;
}

#matrix .matrix-name {
  min-width: 0;
  color: var(--muted);
  font: 600 10px/1.3 var(--mono);
  letter-spacing: 0.03em;
  white-space: normal;
  overflow-wrap: anywhere;
}

#matrix .matrix-stats {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 8px;
  font: 600 10px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}

#matrix .matrix-roi { font-size: 10px; }

#matrix .matrix-wins,
#matrix .matrix-n { color: var(--dim); }

#matrix .matrix-up { color: var(--win); }

#matrix .matrix-down { color: var(--danger); }

#matrix .matrix-plot {
  position: relative;
  flex: none;
  height: 88px;
}

#matrix .matrix-plot canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#strategies .strategies-chart,
#strategies .strategies-chart canvas {
  min-width: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#strategies .strategies-empty {
  position: absolute;
  inset: 0;
  height: auto;
}

@media (max-width: 760px) {
  #strategies .strategies-body {
    flex: none;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  #strategies .strategies-metrics {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #strategies .strategies-chart {
    flex: none;
    height: 280px;
    min-height: 280px;
  }

  #strategies:not(.is-chart-expanded) .strategies-chart,
  #strategies:not(.is-chart-expanded) .strategies-chart canvas {
    touch-action: pan-y;
  }
}

#strategies .strategies-tools {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#strategies .strategies-fit,
#strategies .strategies-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

#strategies .strategies-zoom {
  font: 600 16px/1 var(--mono);
}

#strategies .strategies-fit:hover,
#strategies .strategies-fit:focus-visible,
#strategies .strategies-zoom:hover,
#strategies .strategies-zoom:focus-visible {
  border-color: var(--dash-border);
  color: var(--text);
  outline: none;
}

#strategies .strategies-fit svg { display: block; }

#strategies .strategies-fit .strategies-fit-collapse { display: none; }

#strategies.is-chart-expanded .strategies-fit .strategies-fit-expand { display: none; }

#strategies.is-chart-expanded .strategies-fit .strategies-fit-collapse { display: block; }

#strategies.is-chart-expanded .monitor-head,
#strategies.is-chart-expanded .stakes-filters,
#strategies.is-chart-expanded .strategies-metrics,
#strategies.is-chart-expanded .stakes-facts { display: none; }

#strategies.is-chart-expanded.stakes-pane:not([hidden]) { overflow: hidden; }

#strategies.is-chart-expanded .auth-board,
#strategies.is-chart-expanded .strategies-body,
#strategies.is-chart-expanded .strategies-chart {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

#stakes .auth-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

#stakes .auth-table th,
#stakes .auth-table td {
  width: auto;
  max-width: none;
  overflow: visible;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}

#stakes .auth-table tbody td {
  color: var(--stakes-text);
}

#stakes .auth-table th {
  cursor: pointer;
  user-select: none;
}

#stakes .auth-table th:first-child,
#stakes .auth-table td:first-child {
  width: auto;
  padding-right: 6px;
  color: var(--dim);
  cursor: default;
}

#stakes .auth-table tbody tr.auth-main { cursor: pointer; }
#stakes .auth-table tbody td.stakes-fonbet {
  cursor: pointer;
}

#stakes .auth-table tbody td.stakes-fonbet:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stakes-link-menu {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 132px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px var(--shadow);
}

.stakes-link-menu[hidden] { display: none; }

.stakes-link-menu a {
  padding: 9px 12px;
  color: var(--text);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.stakes-link-menu a:hover { background: var(--hover); }
#stakes .auth-table tbody tr.auth-main:hover { background: rgba(255, 255, 255, 0.08); }
:is(html[data-theme="light"], html[data-theme="pitch"]) #stakes .auth-table tbody tr.auth-main:hover { background: rgba(16, 40, 64, 0.09); }
#stakes .auth-table tbody tr.stakes-result-win td { color: var(--win); }
#stakes .auth-table tbody tr.stakes-result-lose td { color: var(--danger); }
#stakes .auth-table tbody tr.stakes-result-back td { color: var(--back); }
#stakes .auth-table tbody tr.stakes-monitor td { font-weight: 700; }
#stakes .auth-table tbody tr.stakes-monitor .stakes-index {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-block: -2px;
  color: var(--text);
  line-height: 1;
  vertical-align: middle;
}
#stakes .auth-table tbody tr.stakes-monitor.stakes-result-win .stakes-index { color: var(--win); }
#stakes .auth-table tbody tr.stakes-monitor.stakes-result-lose .stakes-index { color: var(--danger); }
#stakes .auth-table tbody tr.stakes-monitor.stakes-result-back .stakes-index { color: var(--back); }
#stakes .stakes-index::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
  animation: stakes-ring 1.6s ease-in-out infinite;
}
@keyframes stakes-ring {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  #stakes .stakes-index::before { animation: none; }
}
#stakes .auth-table tbody tr.stakes-group-open,
#stakes .auth-table tbody tr.stakes-child { background: var(--dash-hover); }
#stakes .auth-table td.stakes-count { color: var(--dim); font-variant-numeric: tabular-nums; }
#stakes .auth-table td.stakes-bets { font-variant-numeric: tabular-nums; }
#stakes .auth-table td.stakes-collapse {
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#stakes .auth-table tbody tr.auth-open { background: var(--dash-hover); }
#stakes .auth-table tr.auth-extra:hover { background: transparent; }

#stakes .auth-table tr.auth-extra td {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  padding: 0;
}

#stakes .stakes-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 32px;
  width: 0;
  min-width: 100%;
  box-sizing: border-box;
  padding: 4px 14px 16px;
}

#stakes .stakes-facts table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

#stakes .auth-table .stakes-facts th,
#stakes .auth-table .stakes-facts td {
  position: static;
  width: auto;
  max-width: 48ch;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--stakes-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  white-space: normal;
}

#stakes .auth-table .stakes-facts th {
  max-width: none;
  padding-right: 16px;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
}

#stakes .auth-table .stakes-facts td {
  overflow-wrap: anywhere;
}

#stakes .auth-table .stakes-facts tr.stakes-fact-blank td {
  height: calc(1.45em + 4px);
  padding: 0;
}

#config:not([hidden]) {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.control[hidden] { display: none; }

.control:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.control-pane[hidden] { display: none; }

.control-pane:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
  padding: 8px;
  overflow: auto;
}

.control-cards {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.control-card {
  --cmd-btn: 148px;
  flex: none;
  width: 100%;
  max-width: none;
  min-width: max-content;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.control-card:not(.control-add):not(:has(> .control-extra))::before {
  content: "";
  order: 1;
  flex: none;
  width: 88px;
}

.control-card > .control-extra { order: 1; }

.control-card:not(.control-add)::after {
  content: "";
  order: 2;
  flex: 1 1 0;
  min-width: 0;
  height: 0;
}

.control-card > .control-mark {
  flex: none;
  margin-inline: calc((16px - 9px) / 2);
}

.control-slot {
  position: relative;
  flex: 100 1 var(--cmd-btn);
  height: 28px;
  width: auto;
  max-width: calc(var(--cmd-btn) * 2);
  min-width: var(--cmd-btn);
}

.control-slot .control-button { width: 100%; }

.control-card .monitor-head {
  min-height: 26px;
  gap: 8px;
  padding: 0 10px;
}

.control-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
}

.control-button {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--dash-border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.control-button:hover:not(:disabled) {
  border-color: var(--live);
  color: var(--live);
}

.control-button:disabled {
  color: var(--dim);
  cursor: default;
}

.control-card .monitor-title,
.control-card .gauge-key {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-card > .gauge-key {
  flex: 0 1 220px;
  width: 220px;
  min-width: 140px;
  max-width: 220px;
}

.control-foot,
.control-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-confirm {
  justify-content: space-between;
  gap: 8px;
}

.control-confirm[hidden],
.control-card.is-confirming .control-foot { display: none; }

.control-run {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  height: 28px;
}

.control-run[hidden] { display: none; }

.control-card.is-running-confirm .control-slot > .control-button {
  visibility: hidden;
}

.control-ask {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.control-run-actions {
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.control-run-yes,
.control-run .control-cancel {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--dash-border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.control-run-yes:hover,
.control-run .control-cancel:hover {
  border-color: var(--live);
  color: var(--live);
}

.control-cancel {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.control-cancel:hover { color: var(--text); }

.control-confirm .control-delete { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-confirm .control-delete { color: #d04b42; }

.control-status {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1em;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.control-status.is-error { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-status.is-error { color: #d04b42; }

.control-tail {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 248px;
  min-width: 0;
}

.control-tail .control-status { flex: none; }

.control-extra {
  position: relative;
  flex: none;
  width: 88px;
  height: 28px;
}

.control-extra > .control-delete {
  width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.control-extra > .control-delete:hover { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-extra > .control-delete:hover { color: #d04b42; }

.control-card.is-confirming .control-extra > .control-delete { visibility: hidden; }

.control-extra .control-confirm {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 4px;
}

.control-extra .control-confirm[hidden] { display: none; }

.control-extra .control-confirm .control-delete,
.control-extra .control-confirm .control-cancel {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  border: 1px solid var(--dash-border);
  border-radius: 0;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.control-extra .control-confirm .control-cancel { color: var(--text); }

.control-extra .control-confirm .control-cancel:hover,
.control-extra .control-confirm .control-delete:hover {
  border-color: var(--live);
  color: var(--live);
}

.control-info-wrap {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
}

.control-info {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
}

.control-info:hover,
.control-info[aria-expanded="true"] { color: var(--cyan); }

.control-tip {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.control-tip[hidden] { display: none; }

.control-add {
  min-height: 0;
}

.control-add:not(.is-open) {
  max-width: none;
  padding: 0 10px;
  background: transparent;
  border-color: transparent;
}

.control-add:not(.is-open)::after {
  content: "";
  flex: 1 1 calc(248px + 220px + 88px + 36px);
  height: 0;
}

.control-add:not(.is-open) .control-add-toggle {
  flex: 100 1 var(--cmd-btn);
  width: auto;
  min-width: var(--cmd-btn);
  margin-left: 28px;
}

.control-add.is-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 420px;
  padding: 0;
}

.control-add-toggle {
  width: 100%;
  max-width: calc(var(--cmd-btn) * 2);
}

.control-add.is-open .control-add-toggle { display: none; }

.control-add .control-create { display: none; }

.control-add.is-open .control-create {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.control-add .control-body {
  justify-content: flex-start;
  gap: 8px;
}

.control-add.is-open .monitor-head { cursor: pointer; }

.control-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.control-field-label,
.control-file-prefix {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.control-file-prefix {
  flex: none;
  padding-left: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.control-field input,
.control-field textarea,
.control-file {
  height: 28px;
  border: 1px solid var(--dash-border);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.control-field textarea {
  height: 72px;
  padding: 6px 8px;
  resize: vertical;
}

.control-field input {
  width: 100%;
  padding: 0 8px;
}

.control-field textarea { width: 100%; }

.control-field input:focus,
.control-field textarea:focus,
.control-file:focus-within {
  outline: none;
  border-color: var(--live);
}

.control-file {
  display: flex;
  align-items: center;
  min-width: 0;
}

.control-file input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.control-file input:focus { outline: none; }

.control-delete {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.control-delete:hover { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-delete:hover { color: #d04b42; }

.control-card[data-state="running"] .control-status,
.control-card[data-state="success"] .control-status {
  color: var(--live);
}

.control-card[data-state="error"] .control-status {
  color: #ff8f84;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-card[data-state="error"] .control-status {
  color: #d04b42;
}

.control-mark {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--dim);
  flex: none;
}

.control-card[data-state="running"] .control-mark {
  border-color: var(--live);
  background: var(--live);
  animation: control-burn 1.1s ease-in-out infinite;
}

.control-card[data-state="success"] .control-mark {
  border-color: var(--live);
  background: var(--live);
  box-shadow: 0 0 0 3px var(--dot-glow);
}

.control-card[data-state="error"] .control-mark {
  border-color: #ff8f84;
  background: #ff8f84;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .control-card[data-state="error"] .control-mark {
  border-color: #d04b42;
  background: #d04b42;
}

@keyframes control-burn {
  0%, 100% {
    box-shadow: 0 0 0 3px var(--dot-glow);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
    opacity: 0.45;
  }
}

.control-log {
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
}

#command-log {
  flex: none;
  padding: 6px 10px 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}

.log-clear-btn {
  margin-left: auto;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  flex: none;
}

.log-clear-btn:hover { color: var(--danger); }

#log-clear.confirm {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 11, 16, 0.55);
}

#log-clear.confirm[hidden] { display: none; }

#log-clear .confirm-card {
  width: min(420px, 100%);
  padding: 18px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: 0 24px 70px var(--shadow);
}

#log-clear .confirm-card p {
  margin: 0 0 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

#log-clear .confirm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#log-clear .confirm-actions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--op-border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: none;
  cursor: pointer;
}

#log-clear .confirm-actions button:hover {
  color: var(--text);
  background: var(--hover);
}

#log-clear #log-clear-yes { color: var(--danger); }

#log-clear .confirm-actions[hidden] { display: none; }

.command-log-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.command-log-tag {
  color: var(--text);
  font-weight: 600;
}

.command-log-tag.start { color: var(--live); }

.command-log-tag.stop { color: #ff8f84; }

.command-log-tag.restart { color: var(--ssd); }

.command-log-tag.clear { color: var(--ram); }

:is(html[data-theme="light"], html[data-theme="pitch"]) .command-log-tag.stop { color: #d04b42; }

.command-log-empty { color: var(--dim); }

.radar[hidden] { display: none; }

.other[hidden] { display: none; }

.other:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.api[hidden],
.logs[hidden] { display: none; }

.logs:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: auto;
  min-height: 0;
}

.api:not([hidden]) {
  display: flex;
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 12px;
}

.api-rail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
}

.api-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.api-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.api-row:hover { background: var(--dash-hover); }

.api-link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 48px;
  padding: 8px 12px;
  color: var(--muted);
  font: 13px/1.3 var(--mono);
  text-decoration: none;
}

.api-row:hover .api-link { color: var(--text); }

.api-link-name,
.api-link-url {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-link-url {
  color: var(--dim);
  font-size: 11px;
}

.api-row-delete {
  flex: none;
  margin-right: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.api-row-delete:hover,
.api-row-delete.is-confirm { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .api-row-delete:hover,
:is(html[data-theme="light"], html[data-theme="pitch"]) .api-row-delete.is-confirm { color: #d04b42; }

.api-add {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-top: 1px solid var(--line);
}

.api-add input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.api-add input:focus { outline: none; }
.api-add input::placeholder { color: var(--dim); }

.api-add button {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--dash-border);
  background: transparent;
  color: var(--text);
  font: 16px/1 var(--mono);
  cursor: pointer;
}

.api-add button:hover {
  border-color: var(--live);
  color: var(--live);
}

.api-form-error {
  flex: none;
  margin: 0;
  padding: 0 12px 10px;
  color: #ff8f84;
  font: 11px/1.4 var(--mono);
}

.api-form-error[hidden] { display: none; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .api-form-error { color: #d04b42; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .logs-bad { color: #d04b42; }

.logs-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 14px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.logs-line { overflow-wrap: anywhere; }

.logs-time { color: var(--dim); }

.logs-name {
  color: var(--text);
  font-weight: 600;
}

.logs-ok { color: var(--live); }
.logs-bad { color: #ff8f84; }

.radar:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: auto;
  min-height: 0;
}

.radar-date {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  min-width: 0;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  white-space: nowrap;
  scrollbar-width: none;
}

.radar-date > * { flex: none; }

.avg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.avg-toggle input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1.5px solid var(--dim);
  background: transparent;
  cursor: pointer;
}

.avg-toggle input:checked {
  border-color: var(--cpu);
  background: var(--cpu);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.avg-toggle input:focus {
  outline: none;
  border-color: var(--live);
}

.subtabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 44px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.parser-pane {
  flex: 1;
  min-height: 0;
}

.parser-pane[hidden] { display: none; }

#parsers:not([hidden]),
#mergers:not([hidden]),
#processes:not([hidden]),
#analysers:not([hidden]) {
  display: block;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
}

.parser-board {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
}

.parser-scroll {
  position: relative;
  overflow: auto;
}

#parsers .parser-scroll,
#mergers .parser-scroll,
#processes .parser-scroll,
#analysers .parser-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

#parsers .parser-scroll::-webkit-scrollbar,
#mergers .parser-scroll::-webkit-scrollbar,
#processes .parser-scroll::-webkit-scrollbar,
#analysers .parser-scroll::-webkit-scrollbar {
  height: 0;
  display: none;
}

.parser-scroll:has(.chart-empty:not([hidden])) { min-height: 160px; }

.parser-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.parser-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

.parser-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.parser-table tbody tr:hover { background: var(--dash-hover); }

.parser-table th:first-child,
.parser-table td:first-child {
  width: 40px;
  padding-right: 6px;
  color: var(--dim);
}

.parser-table th:nth-child(2),
.parser-table td:nth-child(2) {
  width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parser-table th:nth-child(3),
.parser-table td:nth-child(3) { width: auto; }

#parsers .parser-table,
#processes .parser-table,
#analysers .parser-table,
#mergers .parser-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

#parsers .parser-table th,
#parsers .parser-table td,
#processes .parser-table th,
#processes .parser-table td,
#analysers .parser-table th,
#analysers .parser-table td,
#mergers .parser-table th,
#mergers .parser-table td {
  width: auto;
  padding-left: 6px;
  padding-right: 6px;
}

#mergers .parser-table th { letter-spacing: 0.04em; }

#parsers .parser-table th:nth-child(n+3),
#parsers .parser-table td:nth-child(n+3),
#processes .parser-table th:nth-child(n+3),
#processes .parser-table td:nth-child(n+3),
#analysers .parser-table th:nth-child(n+3),
#analysers .parser-table td:nth-child(n+3),
#mergers .parser-table th:nth-child(n+3),
#mergers .parser-table td:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}

#mergers tr.merger-main td,
#parsers tr.merger-main td,
#processes tr.merger-main td,
#analysers tr.merger-main td { border-bottom: none; }

#mergers .parser-table tr.merger-chart td,
#parsers .parser-table tr.merger-chart td,
#processes .parser-table tr.merger-chart td,
#analysers .parser-table tr.merger-chart td {
  width: auto;
  padding: 0 6px 12px;
  text-align: left;
  white-space: normal;
  color: var(--text);
}

#mergers tbody tr.merger-main:hover + tr.merger-chart,
#mergers tbody tr.merger-main:has(+ tr.merger-chart:hover),
#parsers tbody tr.merger-main:hover + tr.merger-chart,
#parsers tbody tr.merger-main:has(+ tr.merger-chart:hover),
#processes tbody tr.merger-main:hover + tr.merger-chart,
#processes tbody tr.merger-main:has(+ tr.merger-chart:hover),
#analysers tbody tr.merger-main:hover + tr.merger-chart,
#analysers tbody tr.merger-main:has(+ tr.merger-chart:hover) {
  background: var(--dash-hover);
}

#processes .parser-table th:nth-child(2),
#processes .parser-table td:nth-child(2),
#analysers .parser-table th:nth-child(2),
#analysers .parser-table td:nth-child(2) { width: auto; }

.parser-table th:nth-child(4),
.parser-table td:nth-child(4),
.parser-table th:nth-child(5),
.parser-table td:nth-child(5),
.parser-table th:nth-child(6),
.parser-table td:nth-child(6),
.parser-table th:last-child,
.parser-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.parser-table th:nth-child(4),
.parser-table td:nth-child(4) { width: 72px; }

.parser-table th:nth-child(5),
.parser-table td:nth-child(5) { width: 76px; }

.parser-table th:nth-child(6),
.parser-table td:nth-child(6) { width: 100px; }

.parser-table th:last-child,
.parser-table td:last-child { width: 128px; }

.parser-spark-wrap {
  position: relative;
  height: 36px;
}

.parser-spark {
  display: block;
  width: 100%;
  height: 36px;
  color: var(--cpu);
  cursor: crosshair;
}

.parser-spark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.parser-guide {
  stroke: var(--dash-border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.parser-await {
  /* stroke: #8f1d1d; */
  stroke: var(--danger);
  stroke-width: 1;
  stroke-dasharray: 3 2.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.parser-error {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #ff8f84;
  pointer-events: none;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .parser-error { background: #d04b42; }

.parser-tip {
  position: fixed;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--dash-border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
}

.parser-tip[hidden] { display: none; }

.parser-tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.parser-tip-dot.info { background: var(--cpu); }

.parser-tip-dot.error { background: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .parser-tip-dot.error { background: #d04b42; }

.parser-table td.parser-ok { color: var(--dim); }

.parser-table td.parser-other { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .parser-table td.parser-other { color: #d04b42; }

.todo[hidden] { display: none; }

.todo:not([hidden]) {
  display: flex;
  flex: 1;
  height: auto;
  min-height: 0;
  gap: 12px;
  padding: 12px;
}

.todo-rail,
.todo-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
}

.todo-rail {
  flex: none;
  width: 232px;
}

.todo-board {
  flex: 1;
  min-width: 0;
}

.todo-lists {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.todo-list {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 13px/1.4 var(--mono);
  text-align: left;
  cursor: pointer;
}

.todo-list:hover { background: var(--dash-hover); color: var(--text); }

.todo-list.is-active {
  color: var(--text);
  background: var(--dash-hover);
  box-shadow: inset 2px 0 0 var(--live);
}

.todo-list-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-list-count {
  flex: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.todo-new-list {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-top: 1px solid var(--line);
}

.todo-new-list input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.todo-new-list input:focus { outline: none; }

.todo-new-list input::placeholder { color: var(--dim); }

.todo-new-list button {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--dash-border);
  background: transparent;
  color: var(--text);
  font: 16px/1 var(--mono);
  cursor: pointer;
}

.todo-new-list button:hover {
  border-color: var(--live);
  color: var(--live);
}

.todo-head {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.todo-title {
  flex: 1 1 180px;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 600 17px/1.2 var(--mono);
  letter-spacing: -0.02em;
}

.todo-title:focus { outline: none; }

.todo-title:disabled { color: var(--dim); }

.todo-count,
.todo-status,
.todo-done-count {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#todo-sort {
  flex: none;
  min-width: 118px;
}

#todo-sort:disabled { opacity: 0.5; }

.todo-text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.todo-text-btn:hover { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .todo-text-btn:hover { color: #d04b42; }

.todo-add {
  flex: none;
  display: grid;
  grid-template-columns: 22px 18px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 4px 12px 4px 8px;
  border-bottom: 1px solid var(--line);
}

.todo-add input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.todo-add input:focus { outline: none; }

.todo-add input::placeholder { color: var(--dim); }

.todo-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.todo-task { border-bottom: 1px solid var(--line); }

.todo-task-main {
  display: grid;
  grid-template-columns: 22px 18px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 4px 12px 4px 8px;
}

.todo-task-main:hover { background: var(--dash-hover); }

.todo-grip {
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-image: radial-gradient(currentColor 1px, transparent 1.15px);
  background-size: 5px 5px;
  background-position: center;
  background-repeat: repeat;
  color: var(--dim);
  cursor: grab;
  touch-action: none;
}

.todo-grip:disabled,
.todo-grip-spacer {
  visibility: hidden;
  pointer-events: none;
}

.todo-grip:active { cursor: grabbing; }

.todo-check {
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--dim);
  border-radius: 50%;
  background: transparent;
  color: #07140e;
  cursor: pointer;
}

.todo-check:hover,
.todo-check:focus-visible { border-color: var(--live); }

.todo-check.is-on {
  border-color: var(--live);
  background: var(--live);
}

.todo-check-ghost {
  border-style: dashed;
  cursor: default;
}

.todo-title-field {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.todo-title-field:focus { outline: none; }

.todo-task.is-done .todo-title-field {
  color: var(--dim);
  text-decoration: line-through;
}

.todo-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.todo-due,
.todo-subcount {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.todo-due.is-today { color: var(--live); }

.todo-due.is-overdue { color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .todo-due.is-overdue { color: #d04b42; }

.todo-star {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  opacity: 0;
}

.todo-task:hover .todo-star,
.todo-task:focus-within .todo-star,
.todo-star.is-on,
.todo-star:focus-visible { opacity: 1; }

.todo-star.is-on { color: var(--ssd); }

.todo-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px 68px;
}

.todo-notes {
  width: 100%;
  min-height: 68px;
  max-height: 400px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 13px/1.5 var(--mono);
  resize: vertical;
}

.todo-notes:focus,
.todo-due-input:focus { outline: none; border-color: var(--live); }

.todo-notes::placeholder,
.todo-sub-add input::placeholder { color: var(--dim); }

.todo-sub {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 22px;
  column-gap: 10px;
  align-items: center;
  min-height: 34px;
}

.todo-sub-title,
.todo-sub-add input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.todo-sub-title:focus,
.todo-sub-add input:focus { outline: none; }

.todo-sub.is-done .todo-sub-title {
  color: var(--dim);
  text-decoration: line-through;
}

.todo-sub-add input { padding-left: 28px; }

.todo-sub-delete {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 14px/1 var(--mono);
  cursor: pointer;
  opacity: 0;
}

.todo-sub:hover .todo-sub-delete,
.todo-sub:focus-within .todo-sub-delete,
.todo-sub-delete:focus-visible { opacity: 1; }

.todo-sub-delete:hover { color: #ff8f84; }

.todo-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.todo-due-input {
  height: 28px;
  max-width: 156px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  accent-color: var(--live);
}

.todo-delete { margin-left: auto; }

.todo-done-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.todo-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.todo-done-toggle:hover { color: var(--text); }

.todo-done-toggle svg { transition: transform 0.15s ease; }

.todo-done-toggle.is-open svg { transform: rotate(90deg); }

.todo-placeholder {
  background: var(--dash-hover);
  box-shadow: inset 0 0 0 1px var(--line);
}

.todo-task.is-lifted {
  position: fixed;
  z-index: 6;
  background: var(--bg);
  border: 1px solid var(--dash-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .todo-task.is-lifted {
  box-shadow: 0 12px 28px rgba(16, 40, 64, 0.16);
}

body.todo-dragging { user-select: none; cursor: grabbing; }

.todo-check:focus-visible,
.todo-star:focus-visible,
.todo-list:focus-visible,
.todo-grip:focus-visible,
.todo-done-toggle:focus-visible,
.todo-text-btn:focus-visible {
  outline: 1px solid var(--live);
  outline-offset: 2px;
}

@media (hover: none) {
  .todo-star { opacity: 0.55; }
  .todo-star.is-on { opacity: 1; }
  .todo-sub-delete { opacity: 0.7; }
}

@media (max-width: 760px) {
  .todo:not([hidden]) {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }

  .todo-rail {
    width: auto;
    flex-direction: row;
    min-height: 44px;
  }

  .todo-rail .monitor-head { display: none; }

  .todo-lists {
    display: flex;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .todo-list {
    width: auto;
    flex: none;
    max-width: 220px;
  }

  .todo-new-list {
    width: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .todo-new-list input { width: 108px; flex: none; }
}

.faq[hidden] { display: none; }

.faq:not([hidden]) {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  height: auto;
  min-height: 0;
  column-gap: 12px;
  padding: 12px;
}

.faq-bar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 0;
}

.faq-back {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.faq-back:hover { color: var(--text); }

.faq-search {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.faq-search:focus { outline: none; border-color: var(--live); }

.faq-search::placeholder { color: var(--dim); }

.faq-status {
  flex: none;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-mode,
.faq-delete {
  flex: none;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.faq-mode:hover,
.faq-delete:hover { color: var(--text); border-color: var(--dash-border); }

.faq-delete.is-armed { color: #ff8f84; border-color: #ff8f84; }

:is(html[data-theme="light"], html[data-theme="pitch"]) .faq-delete.is-armed { color: #d04b42; border-color: #d04b42; }

.faq-mode:disabled { opacity: 0.5; }

.faq-rail,
.faq-board {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
}

.faq-rail { grid-column: 1; grid-row: 2; }

.faq-board { grid-column: 2; grid-row: 1 / span 2; }

.faq-topics {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.faq-topics > .faq-empty { padding: 14px 12px; }

.faq-topic {
  display: flex;
  align-items: stretch;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
}

.faq-topic.is-active { box-shadow: inset 2px 0 0 var(--live); }

.faq-topic.is-active .faq-topic-hit { color: var(--text); background: var(--dash-hover); }

.faq-grip {
  flex: none;
  width: 28px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-image: radial-gradient(currentColor 1px, transparent 1.15px);
  background-size: 5px 5px;
  background-position: center;
  background-repeat: repeat;
  color: var(--dim);
  cursor: grab;
  touch-action: none;
}

.faq-grip:active { cursor: grabbing; }

.faq-topic-hit {
  flex: 1;
  min-width: 0;
  padding: 8px 12px 8px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 13px/1.4 var(--mono);
  text-align: left;
  cursor: pointer;
}

.faq:not(.is-editing) .faq-topic-hit { padding-left: 12px; }

.faq-topic-hit:hover { background: var(--dash-hover); color: var(--text); }

.faq-topic-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-add[hidden],
.faq-head[hidden] { display: none; }

.faq-add {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-top: 1px solid var(--line);
}

.faq-add input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.faq-add input:focus { outline: none; }

.faq-add input::placeholder { color: var(--dim); }

.faq-add button {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 16px/1 var(--mono);
  cursor: pointer;
}

.faq-add button:hover { color: var(--text); border-color: var(--dash-border); }

.faq-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.faq-heading,
.faq-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font: 600 16px/1.3 var(--sans);
}

.faq-heading {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-title {
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
}

.faq-title:focus { outline: none; }

.faq-view,
.faq-editor {
  flex: 1;
  min-height: 0;
}

.faq-view {
  overflow: auto;
  padding: 16px 20px 36px;
  color: var(--text);
  font: 15px/1.65 var(--sans);
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.faq-view > :first-child { margin-top: 0; }

.faq-view h1,
.faq-view h2,
.faq-view h3 {
  margin: 1.05em 0 0.35em;
  font-weight: 600;
  line-height: 1.3;
}

.faq-view h1 { font-size: 22px; }

.faq-view h2 { font-size: 18px; }

.faq-view h3 { font-size: 15px; }

.faq-view p { margin: 0.55em 0; }

.faq-view ul,
.faq-view ol { margin: 0.45em 0; padding-left: 1.3em; }

.faq-view li { margin: 0.15em 0; }

.faq-view a { color: var(--cyan); }

.faq-view code {
  padding: 0.1em 0.35em;
  background: var(--panel-2);
  font: 0.9em/1.5 var(--mono);
}

.faq-view pre {
  margin: 0.8em 0;
  padding: 12px 14px;
  overflow: auto;
  background: var(--stage);
  border: 1px solid var(--line);
}

.faq-view pre code {
  padding: 0;
  background: none;
  font-size: 13px;
}

.faq-view blockquote {
  margin: 0.7em 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.faq-view hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1em 0;
}

.faq-empty {
  margin: 0;
  color: var(--dim);
  font: 13px/1.5 var(--mono);
}

.faq-mark {
  background: rgba(226, 177, 90, 0.42);
  color: inherit;
  padding: 0;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .faq-mark { background: rgba(168, 116, 18, 0.28); }

.faq-editor { position: relative; }

.faq-editor-back,
.faq-editor-input {
  box-sizing: border-box;
  margin: 0;
  padding: 16px 18px 32px;
  border: 0;
  font: 14px/1.6 var(--mono);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  tab-size: 2;
}

.faq-editor-back {
  position: absolute;
  inset: 0;
  overflow: auto;
  color: transparent;
  pointer-events: none;
  scrollbar-width: none;
}

.faq-editor-back .faq-mark { color: transparent; }

.faq-editor-input {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  resize: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
}

.faq-editor-input:focus { outline: none; }

.faq-placeholder {
  background: var(--dash-hover);
  box-shadow: inset 0 0 0 1px var(--line);
}

.faq-topic.is-lifted {
  position: fixed;
  z-index: 6;
  background: var(--bg);
  border: 1px solid var(--dash-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

:is(html[data-theme="light"], html[data-theme="pitch"]) .faq-topic.is-lifted {
  box-shadow: 0 12px 28px rgba(16, 40, 64, 0.16);
}

body.faq-dragging { user-select: none; cursor: grabbing; }

.faq-mode:focus-visible,
.faq-delete:focus-visible,
.faq-back:focus-visible,
.faq-grip:focus-visible,
.faq-topic-hit:focus-visible,
.faq-search:focus-visible {
  outline: 1px solid var(--live);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .faq:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .faq-bar,
  .faq-rail,
  .faq-board { grid-column: 1; }

  .faq-board { grid-row: 2; }

  .faq:not(.is-reading) .faq-board { display: none; }

  .faq.is-reading .faq-rail { display: none; }

  .faq.is-reading .faq-back { display: inline-flex; }
}

.monitor[hidden] { display: none; }

.monitor:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.monitor-pane[hidden] { display: none; }

.monitor-pane:not([hidden]) {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 12px;
  padding: 12px;
}

#status.monitor-pane:not([hidden]),
#live-parsers.monitor-pane:not([hidden]) {
  flex-direction: column;
  overflow: auto;
}

#status .parser-board,
#live-parsers .parser-board {
  flex: none;
  min-width: 0;
}

#status .parser-scroll,
#live-parsers .parser-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

#status .parser-table,
#live-parsers .parser-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

#status .parser-scroll:has(.chart-empty:not([hidden])),
#live-parsers .parser-scroll:has(.chart-empty:not([hidden])) {
  min-height: 0;
}

#status .parser-scroll:has(.chart-empty:not([hidden])) .parser-table,
#live-parsers .parser-scroll:has(.chart-empty:not([hidden])) .parser-table {
  display: none;
}

#status .chart-empty,
#live-parsers .chart-empty {
  position: static;
  height: 32px;
  font-size: 11px;
}

#status .parser-table th,
#status .parser-table td,
#live-parsers .parser-table th,
#live-parsers .parser-table td {
  white-space: nowrap;
}

#status .parser-table th:nth-child(2),
#status .parser-table td:nth-child(2),
#live-parsers .parser-table th:nth-child(2),
#live-parsers .parser-table td:nth-child(2) {
  width: auto;
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
}

#status .parser-table th:nth-child(3),
#status .parser-table td:nth-child(3),
#status .parser-table th:nth-child(4),
#status .parser-table td:nth-child(4) {
  width: 120px;
  text-align: right;
}

#live-parsers .parser-table th:nth-child(3),
#live-parsers .parser-table td:nth-child(3) {
  width: 190px;
  text-align: left;
}

#live-parsers .parser-table th:nth-child(4),
#live-parsers .parser-table td:nth-child(4),
#live-parsers .parser-table th:nth-child(5),
#live-parsers .parser-table td:nth-child(5) {
  width: 110px;
  text-align: right;
}

#status .parser-table th:nth-child(5),
#status .parser-table td:nth-child(5) {
  width: 88px;
  text-align: center;
}

.status-flag {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--dim);
}

.status-flag-ok { background: var(--cpu); }
.status-flag-warn { background: var(--ssd); }
.status-flag-bad { background: var(--danger); }

#auth.monitor-pane:not([hidden]) {
  flex-direction: column;
  overflow: hidden;
}

#auth .auth-board {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#auth .auth-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

#auth .auth-scroll:has(.chart-empty:not([hidden])) .auth-table { display: none; }

#auth .chart-empty {
  position: static;
  height: 48px;
  font-size: 11px;
}

#auth .auth-table { table-layout: fixed; }

#auth .auth-table th,
#auth .auth-table td {
  width: auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#auth .auth-table th:first-child,
#auth .auth-table td:first-child {
  width: 36px;
  color: var(--dim);
}

#auth .auth-table th:nth-child(2),
#auth .auth-table td:nth-child(2) { width: 168px; }

#auth .auth-table th:nth-child(3),
#auth .auth-table td:nth-child(3) { width: 118px; }

#auth .auth-table th:nth-child(4),
#auth .auth-table td:nth-child(4) { width: 118px; }

#auth .auth-table tbody tr.auth-main { cursor: pointer; }

#auth .auth-table tbody tr.auth-open { background: var(--dash-hover); }

#auth .auth-table tr.auth-extra:hover { background: transparent; }

#auth .auth-table tr.auth-extra td {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  padding: 0 14px 16px;
}

.auth-ok { color: var(--cpu); font-weight: 600; }
.auth-bad { color: var(--danger); font-weight: 600; }

.auth-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px 28px;
  padding-top: 4px;
}

.auth-group-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-line {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.auth-line span { color: var(--dim); }

.auth-line b {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.monitor-history,
.gauge {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
}

.monitor-history {
  flex: 1;
  min-width: 0;
}

.monitor-side {
  flex: none;
  width: 232px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gauge { flex: 1; min-width: 0; }

.monitor-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.monitor-mark {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--dim);
  border-radius: 0;
  flex: none;
}

.monitor-title,
.date-field,
.gauge-key,
.legend {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.gauge-key {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--dim);
}

.monitor-rule {
  flex: 1;
  border-top: 1px dashed var(--divider);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.swatch {
  width: 14px;
  height: 2px;
  border-radius: 0;
}

.swatch-cpu { background: var(--cpu); }
.swatch-ram { background: var(--ram); }
.swatch-ssd { background: var(--ssd); }

.chart-wrap,
.gauge-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.chart-wrap { cursor: crosshair; }

.chart-wrap canvas,
.gauge-body canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chart-empty[hidden] { display: none; }

.chart-tip {
  position: absolute;
  z-index: 2;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid var(--dash-border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  pointer-events: none;
  white-space: pre;
}

.chart-tip[hidden] { display: none; }

.gauge-readout {
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  margin: 0;
  transform: translateY(-50%);
  text-align: center;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.03em;
  pointer-events: none;
}

.gauge-total {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 10px;
  max-width: calc(100% - 20px);
  margin: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.monitor-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.monitor-host {
  flex: none;
  margin: 0;
  padding: 0 14px 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.monitor-host:empty { display: none; }

#monitor-date,
#monitor-window,
#radar-date,
#radar-range,
#logs-date,
#logs-file,
#logs-time,
#todo-sort {
  appearance: none;
  height: 28px;
  min-width: 132px;
  padding: 0 26px 0 8px;
  border: 1px solid var(--dash-border);
  border-radius: 0;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

#logs-file { min-width: 196px; }

#logs-time {
  min-width: 108px;
  width: 108px;
  padding-right: 8px;
  background-image: none;
}

#logs-time::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

#monitor-date:hover,
#monitor-date:focus,
#monitor-window:hover,
#monitor-window:focus,
#radar-date:hover,
#radar-date:focus,
#radar-range:hover,
#radar-range:focus,
#logs-date:hover,
#logs-date:focus,
#logs-time:hover,
#logs-time:focus,
#logs-file:hover,
#logs-file:focus,
#todo-sort:hover,
#todo-sort:focus {
  outline: none;
  border-color: var(--live);
}

@media (max-width: 760px) {
  .control-cards {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .control-add.is-open { min-width: 0; }
}

@media (max-width: 640px) {
  .control-pane:not([hidden]) { overflow: auto; }

  .control-card { max-width: none; }

  .monitor-pane:not([hidden]) {
    flex-direction: column;
    overflow: auto;
  }

  .monitor-history {
    flex: none;
    height: 420px;
  }

  .monitor-side {
    width: auto;
    flex: none;
    flex-direction: row;
    height: 240px;
  }

  .gauge:not(.control-card) .gauge-key,
  .monitor .gauge-key { display: none; }
}

@media (max-width: 760px) {
  .status { letter-spacing: 0.08em; }

  .status-track { padding-left: 12px; }
}

/* config editor */
#config .stack {
  width: auto;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#config .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  overflow: hidden;
}

#config .stack > .panel { flex: none; }

#config .stack > .panel:first-child { min-width: 0; }

#config .panel-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--head);
}

#config .stack > .panel:first-child > .panel-head {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  scrollbar-width: none;
}

#config .stack > .panel:first-child > .panel-head::-webkit-scrollbar {
  height: 0;
  display: none;
}

#config .stack > .panel:first-child > .panel-head > :not(.rule) {
  flex-shrink: 0;
}

#config .stack > .panel:first-child > .panel-head .rule {
  flex: 1 0 16px;
}

#config .stack > .panel:first-child > .panel-head #meta {
  max-width: none;
}

#config .head-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

#config .head-btn svg { display: block; }

#config .head-btn:hover {
  color: var(--text);
  border-color: var(--op-border);
  background: var(--hover);
}

#config .head-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

#config .head-btn:disabled:hover {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

#config #delete-file:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(255, 143, 132, 0.45);
}

#config .file-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  flex: none;
}

#config .file-list, #config .file-name {
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
}

#config .file-list, #config .file-list option {
  color: var(--dim);
}

#config .file-list { cursor: pointer; }

#config .file-list {
  appearance: none;
  max-width: 18ch;
  padding: 6px 16px 6px 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236c7a8c' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 8px 5px;
}

#config .file-name {
  field-sizing: content;
  min-width: 12ch;
  max-width: 24ch;
  padding: 6px 0;
  outline: none;
}

#config .file-list:hover, #config .file-name:hover, #config .file-name:focus {
  border-color: var(--op-border);
}

#config .file-name:hover, #config .file-name:focus {
  color: var(--text);
}

:is(html[data-theme="light"], html[data-theme="pitch"]) #config .file-list {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236d8294' d='M0 0l5 6 5-6z'/></svg>");
}

#config .mark {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--mark);
  border-radius: 0;
  flex: none;
}

#config .title, #config #meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#config button.title {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#config button.title:hover { color: var(--text); }

#config .rule {
  flex: 1;
  border-top: 1px dashed var(--rule);
}

#config #meta {
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

#config .confirm {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 11, 16, 0.55);
}

#config .confirm[hidden] { display: none; }

#config .confirm-card {
  width: min(380px, 100%);
  padding: 18px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: 0 24px 70px var(--shadow);
}

#config .confirm-card p {
  margin: 0 0 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

#config .confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#config .confirm-actions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--op-border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

#config .confirm-actions button:hover {
  color: var(--text);
  background: var(--hover);
}

#config #confirm-ok {
  color: var(--danger);
  border-color: rgba(255, 143, 132, 0.45);
}

#config #meta[data-state="saving"] { color: var(--cyan); }
#config #meta[data-state="saved"] { color: var(--green); }
#config #meta[data-state="error"] { color: var(--danger); letter-spacing: 0.04em; text-transform: none; }

#config #tree { overflow: visible; }

#config #log {
  overflow: visible;
  padding: 8px 14px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}

#config .notes-panel > .panel-head {
  padding: 0;
  gap: 0;
}

#config .notes-panel:not(.is-open) > .panel-head { border-bottom: 0; }

#config .notes-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#config .notes-toggle:hover { color: var(--text); }

#config .notes-toggle:hover .title { color: var(--text); }

#config .notes-toggle .title { flex: none; }

#config .notes-chevron {
  width: 0;
  height: 0;
  margin-left: auto;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  transform-origin: 35% 55%;
  flex: none;
  transition: transform 160ms ease;
}

#config .notes-panel.is-open .notes-chevron { transform: rotate(90deg); }

#config .notes-body { padding: 10px 14px 14px; }

#config .notes-body[hidden] { display: none; }

#config .notes-input {
  display: block;
  width: 100%;
  min-height: 128px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.55 var(--mono);
  resize: none;
  overflow: hidden;
}

#config .notes-input::placeholder { color: var(--dim); }

#config .notes-input:focus { outline: none; }

#config .log-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#config .log-tag {
  font-weight: 600;
}

#config .log-tag.edit { color: var(--cyan); }
#config .log-tag.add { color: var(--green); }
#config .log-tag.delete { color: var(--danger); }
#config .log-tag.rename { color: var(--num); }

#config .log-empty { color: var(--dim); }

#config .row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

#config .row:hover { background: var(--hover); }

#config .row.selected {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--ring);
  cursor: default;
}

#config .lead {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#config .tail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: 68%;
}

#config .twist {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}

#config .twist i {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent var(--green);
  transform-origin: 35% 55%;
}

#config .twist.expanded i { transform: rotate(90deg); }

#config .twist.just-opened i { animation: twist-open 160ms ease; }

#config .twist.just-closed i { animation: twist-close 160ms ease; }

#config .twist.array i { border-left-color: var(--cyan); }

#config .slide {
  display: grid;
  animation: slide-out 240ms ease forwards;
}

#config .slide.slide-in {
  animation: slide-in 240ms ease forwards;
  pointer-events: none;
}

#config .slide-inner {
  min-height: 0;
  overflow: hidden;
}

@keyframes slide-out {
  from { grid-template-rows: 0fr; }
  to { grid-template-rows: 1fr; }
}

@keyframes slide-in {
  from { grid-template-rows: 1fr; }
  to { grid-template-rows: 0fr; }
}

@keyframes twist-open {
  from { transform: rotate(0deg); }
  to { transform: rotate(90deg); }
}

@keyframes twist-close {
  from { transform: rotate(90deg); }
  to { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  #config .slide { animation: none; grid-template-rows: 1fr; }
  #config .slide.slide-in { grid-template-rows: 0fr; }
  #config .twist.just-opened i, #config .twist.just-closed i { animation: none; }
}

#config .twist.spacer { visibility: hidden; pointer-events: none; }

#config .key, #config .key-input, #config .value, #config .value-input {
  font-family: var(--mono);
  font-size: 13px;
}

#config .key, #config .key-input {
  min-width: 0;
  flex: 1;
  color: var(--text);
}

#config .key {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#config .ops {
  display: flex;
  gap: 2px;
  flex: none;
}

#config .op {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: 15px/1 var(--mono);
  cursor: pointer;
}

#config .op svg { display: block; }

#config .op:hover {
  color: var(--text);
  border-color: var(--op-border);
  background: var(--hover);
}

#config .op.danger:hover { color: var(--danger); border-color: rgba(255, 143, 132, 0.45); }

#config .value, #config .value-input {
  width: auto;
  max-width: 100%;
  text-align: right;
  color: var(--muted);
}

#config .value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#config .value.true, #config .value-input[data-state="true"] { color: var(--green); }
#config .value.false, #config .value-input[data-state="false"] { color: var(--false); }
#config .value.null, #config .value-input[data-state="null"] { color: var(--dim); }
#config .value.num, #config .value-input[data-state="num"] { color: var(--num); }
#config .value.inf, #config .value-input[data-state="inf"] { color: var(--cyan); }

#config input.value-input, #config input.key-input, #config select.value-input {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  outline: none;
  color: inherit;
}

#config input.key-input {
  flex: 1;
  field-sizing: content;
  min-width: 6ch;
}

#config select.value-input, #config input.value-input {
  field-sizing: content;
  min-width: 4ch;
}

#config select.value-input {
  appearance: none;
  cursor: pointer;
  text-align: right;
  text-align-last: right;
  padding-left: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239aa7b8' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 8px 5px;
}

#config input.value-input { min-width: 8ch; }

#config select.type-input {
  appearance: none;
  cursor: pointer;
  flex: none;
  width: auto;
  field-sizing: content;
  padding: 0 14px 0 0;
  border: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2379b8ff' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 8px 5px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  text-align-last: right;
}

#config input.value-input:focus, #config input.key-input:focus, #config select.value-input:focus, #config select.type-input:focus {
  box-shadow: inset 0 -1px 0 rgba(61, 220, 151, 0.7);
}

#config .empty {
  margin: 0;
  padding: 22px 14px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#config :focus-visible {
  outline: 2px solid rgba(61, 220, 151, 0.8);
  outline-offset: 2px;
}

#config input:focus-visible, #config select:focus-visible { outline: none; }

:is(html[data-theme="light"], html[data-theme="pitch"]) #config select.value-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%235c7082' d='M0 0l5 6 5-6z'/></svg>");
}

:is(html[data-theme="light"], html[data-theme="pitch"]) #config select.type-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%231d6fbf' d='M0 0l5 6 5-6z'/></svg>");
}

@media (max-width: 720px) {
  #config .stack { padding: 12px; gap: 12px; }
  #config .row { gap: 8px; padding-right: 12px; }
  #config .tail { max-width: 70%; }
  #config .file-name { max-width: 16ch; }
}
