/* RAIN Web UI — dark OLED dashboard theme (design system: ui-ux-pro-max).
   Self-contained: system font stacks only, no external assets. */
:root {
  --bg: #020617;
  --panel: #0F172A;
  --panel2: #1E293B;
  --border: #243349;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --soft: #64748B;
  --accent: #22C55E;
  --accent-soft: rgba(34, 197, 94, .14);
  --info: #38BDF8;
  --info-soft: rgba(56, 189, 248, .12);
  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, .12);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --code: #010409;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --glow: 0 0 10px rgba(34, 197, 94, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
code, .mono, .console, .kv-value {
  font-family: ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
}
a { color: var(--info); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  display: grid; place-items: center; color: #04140a; font-weight: 800;
  box-shadow: var(--glow);
}
.brand-name { font-weight: 700; font-size: .95rem; }
.brand-sub { color: var(--soft); font-size: .72rem; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); text-decoration: none;
  padding: 9px 11px; border-radius: 9px; margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background-color .18s, color .18s, border-color .18s;
  cursor: pointer; font-size: .92rem;
}
.nav-item svg { flex: 0 0 auto; }
.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(34, 197, 94, .35); }
.main { padding: 22px 26px 60px; max-width: 1360px; min-width: 0; }

.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar .spacer { flex: 1; }
.health-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 999px; font-size: .85rem; color: var(--muted);
}
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); }
.health-dot.ok { background: var(--accent); box-shadow: var(--glow); }
.health-dot.warn { background: var(--warn); }
.health-dot.bad { background: var(--danger); }

/* ---------- generic components ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.card-title { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: .98rem; }
.card-title svg { color: var(--soft); }
.card-sub { color: var(--soft); font-size: .8rem; margin: -8px 0 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #04140a; border: 1px solid transparent;
  border-radius: 9px; padding: 9px 14px; font-weight: 700; font-size: .9rem;
  cursor: pointer; text-decoration: none;
  transition: background-color .18s, border-color .18s, color .18s, opacity .18s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--info); color: var(--info); }
.btn.danger { background: var(--danger); color: #1c0606; }
.btn.small { padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; font-size: .78rem; color: var(--muted); white-space: nowrap;
}
.badge.ok { color: var(--accent); border-color: rgba(34, 197, 94, .4); background: var(--accent-soft); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .4); background: var(--warn-soft); }
.badge.bad { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: var(--danger-soft); }
.badge.info { color: var(--info); border-color: rgba(56, 189, 248, .4); background: var(--info-soft); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; font-size: .87rem; }
.kv-key { color: var(--soft); }
.kv-value { color: var(--text); word-break: break-word; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.right { text-align: right; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; color: var(--soft); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px 10px; border-bottom: 1px solid rgba(36, 51, 73, .55); vertical-align: top; }
.table tr:hover td { background: rgba(30, 41, 59, .4); }

.console {
  background: var(--code); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; max-height: 460px; overflow: auto;
  font-size: .8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.console .dim { color: var(--soft); }

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--soft);
}
.skeleton { position: relative; overflow: hidden; background: var(--panel2); border-radius: 8px; min-height: 16px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(248, 250, 252, .06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- modal / toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(1, 4, 9, .72);
  display: grid; place-items: center; z-index: 60; padding: 18px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 520px; width: 100%; padding: 20px 22px;
  max-height: calc(100vh - 56px); overflow-y: auto;
}
.modal h3 { margin: 0 0 10px; font-size: 1.05rem; }
.modal p { color: var(--muted); margin: 6px 0; }
.modal .impact { background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, .35); border-radius: 9px; padding: 10px 12px; color: var(--warn); font-size: .86rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 80; }
.toast {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 10px 14px; font-size: .87rem; box-shadow: var(--shadow);
  animation: toast-in .2s ease-out;
}
.toast.ok { border-color: rgba(34, 197, 94, .5); }
.toast.err { border-color: rgba(248, 113, 113, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: .8rem;
  background: var(--panel); border: 1px solid var(--border); color: var(--soft);
}
.step-pill.active { color: var(--accent); border-color: rgba(34, 197, 94, .45); background: var(--accent-soft); }
.step-pill.done { color: var(--info); border-color: rgba(56, 189, 248, .35); }
.choice { display: grid; gap: 10px; }
.choice-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; cursor: pointer;
  transition: border-color .18s, background-color .18s;
}
.choice-item:hover { border-color: var(--info); }
.choice-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice-item input { margin-top: 3px; accent-color: var(--accent); }
.choice-title { font-weight: 700; font-size: .92rem; }
.choice-desc { color: var(--muted); font-size: .83rem; }
.choice-group-title {
  margin: 18px 0 8px; font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--soft);
}
.card > .choice-group-title:first-of-type { margin-top: 2px; }
.now-panel { border-color: rgba(56, 189, 248, .32); }
.now-panel .card-title { color: var(--info); }

/* ---------- dashboard v2 (2026-08-16 redesign) ---------- */
.dash-hero { margin: 2px 0 18px; }
.dash-hero h1 { font-size: 1.45rem; margin: 0 0 2px; font-weight: 700; letter-spacing: -.01em; }
.dash-hero .sub { color: var(--soft); font-size: .85rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 41, 59, .5), rgba(15, 23, 42, .92));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px 14px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.kpi:hover { border-color: rgba(56, 189, 248, .45); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--info)); opacity: .75;
}
.kpi-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--soft); font-size: .74rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}
.kpi-label svg { color: var(--info); }
.kpi-pct { margin-left: auto; color: var(--text); font-size: .95rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpi-value { font-size: 1.72rem; font-weight: 700; margin: 7px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-value .unit { font-size: .92rem; color: var(--muted); font-weight: 600; margin-left: 5px; }
.kpi-value .dim { color: var(--soft); font-weight: 600; }
.kpi-sub { color: var(--muted); font-size: .8rem; }
.meter { height: 6px; background: rgba(30, 41, 59, .9); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--info)); transition: width .5s ease; }
.meter.warn > i { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.meter.bad > i { background: linear-gradient(90deg, var(--danger), #ef4444); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title svg { color: var(--info); }
.section-title h2 { margin: 0; font-size: .95rem; letter-spacing: .02em; }
.section-title .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.node-card { position: relative; overflow: hidden; padding-left: 21px; }
.node-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--soft); }
.node-card.ok::before { background: var(--accent); }
.node-card.bad::before { background: var(--danger); }
.node-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.node-head svg { color: var(--soft); vertical-align: -2px; }
.node-name { font-weight: 700; font-size: .98rem; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ---------- advanced mode terminal (2026-08-16) ---------- */
.adv-card { max-width: 980px; }
.terminal {
  background: #05070c; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-top: 12px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .82rem; line-height: 1.45; color: #d7e2ee;
  height: 480px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
/* ANSI colors tuned for the dark terminal background */
.terminal .a-black { color: #64748b; }
.terminal .a-red { color: #ff6b5f; }
.terminal .a-green { color: #3fd68f; }
.terminal .a-yellow { color: #f7c948; }
.terminal .a-blue { color: #6ea8fe; }
.terminal .a-magenta { color: #d18cff; }
.terminal .a-cyan { color: #2bd9e9; }
.terminal .a-white { color: #e5edf5; }
.terminal .a-bblack { color: #94a3b8; }
.terminal .a-bred { color: #ff9a91; }
.terminal .a-bgreen { color: #6ef2b4; }
.terminal .a-byellow { color: #ffe08a; }
.terminal .a-bblue { color: #9cc3ff; }
.terminal .a-bmagenta { color: #e3b5ff; }
.terminal .a-bcyan { color: #7cecf7; }
.terminal .a-bwhite { color: #ffffff; }
.terminal .ab { font-weight: 700; }
.terminal .ln {
  color: var(--soft); display: inline-block; min-width: 4ch;
  margin-right: 12px; text-align: right; user-select: none;
}

.progress-track { height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--info)); transition: width .3s; }
.phase-list { display: grid; gap: 6px; margin: 12px 0; }
.phase {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px; border: 1px solid transparent;
  color: var(--soft); font-size: .88rem;
}
.phase.active { color: var(--text); border-color: var(--border); background: var(--panel); }
.phase.done { color: var(--accent); }

/* ---------- login ---------- */
.login-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; padding: 18px; }
.login-card { width: 100%; max-width: 380px; }
.login-card input {
  width: 100%; background: var(--code); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 11px 13px; font-size: .95rem; margin: 10px 0;
}
.login-card input:focus { outline: 2px solid rgba(34, 197, 94, .5); border-color: var(--accent); }

:focus-visible { outline: 2px solid rgba(56, 189, 248, .7); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    display: flex; gap: 4px; padding: 8px; z-index: 50;
    border-right: 0; border-top: 1px solid var(--border); overflow-x: auto;
  }
  .brand, .nav-item span.label { display: none; }
  .nav-item { margin-bottom: 0; padding: 9px 12px; }
  .main { padding: 16px 14px 90px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* ---------- file sync (Batch 3) ---------- */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 22px 16px; text-align: center; color: var(--soft);
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: rgba(34, 197, 94, .06); }
.terminal:focus { outline: 2px solid rgba(56, 189, 248, .55); outline-offset: 2px; }

/* ---------- Batch 5 ---------- */
/* Author display rules (e.g. .choice{display:grid}) must never defeat the
   hidden attribute, otherwise Show/Hide list controls appear dead. */
[hidden] { display: none !important; }
.upbar-wrap {
  height: 8px; background: rgba(255, 255, 255, .08);
  border-radius: 99px; overflow: hidden;
}
.upbar {
  height: 100%; width: 0; background: var(--accent);
  transition: width .2s ease;
}

/* ---------- Batch 4 ---------- */
/* xterm.js container: fixed height so FitAddon can compute cols/rows */
.term-x {
  height: 440px; background: #070a0f; border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 8px; overflow: hidden;
}
.term-x .xterm { height: 100%; }
/* compact scrollable item lists (File Sync) */
.choice.compact {
  max-height: 240px; overflow: auto;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
}
.choice.compact .choice-item { padding: 5px 8px; }
.choice.compact .choice-item .choice-title { font-size: .8rem; display: inline-block; max-width: 100%; }
.choice.compact .choice-item .choice-desc { display: inline; margin-left: 4px; }

/* ---------- Batch 8 §12: node Information modal ---------- */
.ni-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin: 12px 0;
}
.ni-charts { grid-template-columns: 1fr 1fr; }
.ni-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; text-align: center;
}
.ni-wide { text-align: left; }
.ni-title { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.ni-sub { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.ni-donut-pct { fill: var(--text); font-size: 15px; font-weight: 600; }
.ni-donut-lbl {
  fill: var(--muted); font-size: 9px;
  text-transform: uppercase; letter-spacing: .06em;
}
.ni-gl { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.ni-axis {
  display: flex; justify-content: space-between;
  font-size: .68rem; color: var(--muted); margin-top: 2px;
}
.ni-legend {
  display: flex; gap: 14px; align-items: center;
  font-size: .74rem; color: var(--muted); margin-top: 6px;
}
.ni-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 5px;
}
.ni-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ni-stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px;
}
.ni-stat b {
  display: block; font-size: .7rem; color: var(--muted);
  font-weight: 500; margin-bottom: 2px;
}
.ni-stat span { font-size: .8rem; }
@media (max-width: 860px) {
  .ni-grid, .ni-charts, .ni-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Batch 9: polish ---------- */
/* Live Resources: bigger type, smoother gauges, value chips */
.ni-card { padding: 14px; }
.ni-card svg circle[stroke-dasharray] { transition: stroke-dashoffset .6s ease, stroke .6s ease; }
.ni-donut-pct { font-size: 19px; }
.ni-donut-lbl { font-size: 10px; }
.ni-sub { font-size: .8rem; }
.ni-title {
  font-size: .86rem; text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ni-chip {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; font-size: .72rem;
  color: var(--accent); text-transform: none; letter-spacing: 0;
}
.ni-chip-b { color: var(--info); }
.ni-stat b { font-size: .76rem; }
.ni-stat span { font-size: .92rem; }

/* JSON syntax highlighting (coder palette) */
.tok-key { color: #7DD3FC; }
.tok-str { color: #86EFAC; }
.tok-num { color: #FCD34D; }
.tok-lit { color: #F9A8D4; }
pre.pre-wrap { white-space: pre-wrap; word-break: break-word; }
pre .ln { user-select: none; }
mark {
  background: rgba(252, 211, 77, .28); color: #FDE68A;
  border-radius: 3px; padding: 0 2px;
}

/* Terminals: single scrollbar, viewport-fitted, font toolbar */
.term-x { height: clamp(320px, calc(100vh - 320px), 780px); }
.adv-card { overflow: hidden; }
.term-bar {
  gap: 6px; margin: 0 0 6px; justify-content: flex-end;
  align-items: center;
}
.term-bar .muted { font-size: .74rem; }

/* ---------- Batch 9 §13 ---------- */
.ni-peak { stroke: var(--soft); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.sq-h {
  font-family: ui-monospace, Consolas, monospace; font-size: .74rem;
  color: var(--muted); cursor: pointer; padding: 2px 4px;
  border-radius: 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.sq-h:hover { background: var(--panel2); color: var(--text); }
.fr-code {
  background: var(--code); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; overflow: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: .8rem;
  line-height: 1.5;
}
.fr-code .frl { white-space: pre; }
.fr-code.pre-wrap .frl { white-space: pre-wrap; word-break: break-word; }
.fr-fold {
  background: none; border: none; color: var(--info);
  cursor: pointer; font-size: .7rem; padding: 0 5px;
}
.fr-fold:hover { color: var(--accent); }

/* ---------- Batch 10: single-node config editor ---------- */
.ec-editor {
  width: 100%; height: 420px; resize: vertical;
  background: var(--code); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; line-height: 1.5;
  font-family: ui-monospace, Consolas, monospace; font-size: .82rem;
  white-space: pre; overflow: auto;
}
.ec-status {
  margin-top: 4px; font-size: .72rem; color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
}
.ec-editor.ec-wrap { white-space: pre-wrap; word-break: break-word; }

/* Batch 12: live syntax colors while editing (overlay technique) */
.ec-stack { position: relative; }
.ec-stack .ec-hl {
  position: absolute; inset: 0; margin: 0; z-index: 0;
  pointer-events: none; overflow-y: scroll; overflow-x: hidden;
  border-color: transparent;
}
.ec-editor.ec-live {
  position: relative; z-index: 1;
  background: transparent; color: transparent;
  caret-color: var(--text);
}
.ec-editor.ec-live::selection { background: rgba(56, 189, 248, .3); }

/* Batch 13: View All = colored + numbered + foldable AND editable */
.ec-stack { background: var(--code); border: 1px solid var(--border); border-radius: 10px; }
.ec-stack .ec-editor { border-color: transparent; }
.ec-viewall .ec-hl-top {
  position: absolute; inset: 0; z-index: 2; margin: 0;
  pointer-events: none; overflow: hidden;
  background: transparent; border-color: transparent;
}
.ec-viewall .ec-hl-top .fr-fold { pointer-events: auto; }
.ec-viewall .ec-hl-top .ln {
  display: inline-block; width: 34px; margin-right: 8px;
  text-align: right; color: var(--muted);
}
.ec-viewall .ec-editor {
  text-indent: 42px; height: auto; overflow: hidden;
  white-space: pre-wrap; word-break: break-word;
}
.ec-viewall .ec-hl-top .frl { white-space: pre-wrap; word-break: break-word; }

/* ---------- Bot Manager (2026-08-21) ---------- */
.bm-crumb {
  color: var(--accent); text-decoration: none; font-size: .85rem;
  padding: 2px 6px; border-radius: 6px;
}
.bm-crumb:hover { background: rgba(255, 255, 255, .06); }
.bm-logbox {
  max-height: clamp(280px, calc(100vh - 320px), 640px);
  overflow: auto; margin: 0; padding: 10px 12px;
  background: var(--console-bg, #050505); border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--mono, monospace);
  font-size: 12px; line-height: 1.45; white-space: pre-wrap;
  word-break: break-word;
}
.bm-settings label.soft { display: block; font-size: .86rem; margin-bottom: 5px; }
/* text/password inputs & selects only — radio/checkbox keep their native size */
.bm-settings input:not([type="radio"]):not([type="checkbox"]), .bm-settings select {
  width: 100%; padding: 9px 12px; font-size: .95rem; line-height: 1.4;
  border-radius: 8px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text);
}
.bm-settings input:not([type="radio"]):not([type="checkbox"]):focus, .bm-settings select:focus {
  outline: 2px solid rgba(34, 197, 94, .4); border-color: var(--accent);
}
/* compact two-column mode picker (Local vs Other server) */
.bm-settings .bm-mode { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bm-settings .bm-mode .choice-item { padding: 10px 14px; }
.bm-settings .bm-mode .choice-title { font-size: .88rem; }
.bm-settings .bm-mode .choice-desc { font-size: .78rem; }
.bm-settings input::placeholder { color: var(--soft); }
.bm-settings .bm-group { margin-top: 18px; }
.bm-settings .bm-group:first-child { margin-top: 4px; }
.bm-settings .bm-group-title {
  font-size: .78rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--soft); margin-bottom: 10px;
}
.bm-settings .bm-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 16px;
}
.bm-settings .bm-span2 { grid-column: 1 / -1; }
.bm-valbox {
  max-height: min(48vh, 420px); overflow: auto;
  border: 1px solid var(--border); border-radius: 8px;
}
/* probe failure detail on unreachable node cards (2026-08-21) */
.node-err {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, .35);
  color: var(--warn); font-size: .8rem; line-height: 1.45;
  display: flex; gap: 6px; align-items: flex-start;
}
.node-err svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- Register Node Modal Form (2026-08-22) ---------- */
.reg-node-form { margin-top: 14px; }
.reg-node-form .form-group { margin-bottom: 14px; }
.reg-node-form label.soft {
  display: block; font-size: .88rem; font-weight: 500; margin-bottom: 5px; color: var(--text);
}
.reg-node-form input {
  width: 100%; padding: 10px 14px; font-size: .95rem; line-height: 1.4;
  border-radius: 8px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); box-sizing: border-box;
}
.reg-node-form input:focus {
  outline: 2px solid rgba(34, 197, 94, .4); border-color: var(--accent);
}
.reg-node-form input::placeholder { color: var(--soft); }
.reg-node-form .help-text {
  font-size: .78rem; color: var(--soft); margin: 4px 0 0; line-height: 1.35;
}
.reg-node-form .grid-2 {
  display: grid; grid-template-columns: 2fr 1fr; gap: 12px;
}
