:root {
  color-scheme: dark;
  --bg: #080c13;
  --panel: #101622;
  --card: #151d2b;
  --card-alt: #1b2537;
  --border: #233044;
  --border-hi: #384c6b;
  --text: #eaf0f8;
  --muted: #8a9bb5;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --cyan: #22d3ee;
  --success: #10b981;
  --success-bg: #0f3d2e;
  --warn: #f59e0b;
  --warn-bg: #452908;
  --danger: #ef4444;
  --danger-bg: #4c1717;
  --amt: #d97706;
  --mono: "JetBrains Mono", "Consolas", "Courier New", monospace;
  --sans: "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(ellipse 75% 35% at 50% -8%, rgba(56, 189, 248, 0.08), transparent 65%),
    var(--bg);
  color: var(--text);
  font: 13px/1.48 var(--sans);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(15, 22, 34, 0.5); }
::-webkit-scrollbar-thumb { background: #293850; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3b4f6e; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.mr-auto { margin-right: auto; }
code {
  font-family: var(--mono);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #bae6fd;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Tactile Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(180deg, #2b374b 0%, #222c3d 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(0,0,0,0.3);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.06s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: linear-gradient(180deg, #35445c 0%, #2a364b 100%); border-color: rgba(255,255,255,0.15); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,0.4); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-primary { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); border-color: rgba(147,197,253,0.28); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #4f90f8 0%, #2e6cf0 100%); }
.btn-success { background: linear-gradient(180deg, #10b981 0%, #059669 100%); border-color: rgba(110,231,183,0.28); }
.btn-success:hover:not(:disabled) { background: linear-gradient(180deg, #1ec990 0%, #08a372 100%); }
.btn-warn { background: linear-gradient(180deg, #d97706 0%, #b45309 100%); border-color: rgba(253,230,138,0.25); }
.btn-warn:hover:not(:disabled) { background: linear-gradient(180deg, #e5830d 0%, #c45d0d 100%); }
.btn-danger { background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%); border-color: rgba(252,165,165,0.25); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(180deg, #e83434 0%, #c92222 100%); }
.btn-ghost { background: #192231; border-color: var(--border); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-hi); background: #222e42; }
.btn-amt { background: linear-gradient(180deg, #c26a0a 0%, #9a5007 100%); border-color: rgba(251,191,36,0.25); }
.btn-amt:hover:not(:disabled) { background: linear-gradient(180deg, #d6760e 0%, #ac5b09 100%); }
.btn.sending {
  background: linear-gradient(180deg, #0d9466 0%, #08724e 100%);
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255,255,255,0.16);
}
.btn.sending::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 6px #6ee7b7;
  display: inline-block;
  animation: pulse 1.2s infinite;
}

.input, .select-sm, .textarea {
  background: #10151e;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  outline: none;
}
.input { height: 32px; }
.select-sm { height: 30px; padding: 0 8px; }
.input:focus, .textarea:focus, .select-sm:focus { border-color: var(--primary); }
.input-w80 { width: 84px; }
.input-w160 { width: 170px; }
.input-w200 { width: 200px; }
.input-w220 { width: 240px; }
.textarea { width: 100%; resize: vertical; line-height: 1.5; }

/* Topbar */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: 4px; }
.brand-dot {
  width: 11px; height: 11px; border-radius: 3px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  box-shadow: 0 0 10px rgba(59,130,246,0.5);
}
.brand-title { font-size: 14.5px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.bridge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #121822;
  font-size: 12px;
}
.bridge-pill.online { border-color: rgba(34,197,94,0.45); background: rgba(20,83,45,0.28); color: #bbf7d0; }
.bridge-pill.offline { border-color: rgba(245,158,11,0.55); background: rgba(120,53,15,0.35); color: #fde68a; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.bridge-pill.online .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.bridge-pill.offline .status-dot {
  background: var(--warn);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hw-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.dbc-badge {
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  color: #cbd5e1;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.user-badge {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #1d2636;
  border: 1px solid var(--border);
}
.user-badge.logged {
  background: rgba(59,130,246,0.16);
  border-color: rgba(59,130,246,0.45);
  color: #bfdbfe;
}

/* Bridge Reminder Banner */
.bridge-banner {
  background: linear-gradient(90deg, rgba(146,64,14,0.38), rgba(69,26,3,0.42));
  border-bottom: 1px solid rgba(245,158,11,0.5);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bridge-banner-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--warn); color: #111;
  font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.bridge-banner-body { flex: 1; min-width: 0; }
.bridge-banner-title { font-weight: 700; color: #fef3c7; font-size: 13.5px; }
.bridge-banner-desc { color: #fde68a; font-size: 12px; margin-top: 2px; }
.bridge-banner-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }

/* Navigation & Telemetry Strip */
.navtabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 20, 31, 0.92);
}
.navtab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s, background 0.15s;
}
.nav-ico { width: 15px; height: 15px; opacity: 0.82; }
.navtab:hover { color: var(--text); background: rgba(255,255,255,0.035); }
.navtab.active {
  background: var(--bg);
  color: #fff;
  border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--primary);
  margin-bottom: -1px;
  padding-bottom: 9px;
}
.navtab.active .nav-ico { color: #60a5fa; opacity: 1; }
.tab-count {
  font-size: 11px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: #1d2738;
  border: 1px solid var(--border);
  color: #cbd5e1;
}
.nav-spacer { flex: 1; }
.metrics-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  margin-bottom: 5px;
}
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #0c121c;
  border: 1px solid var(--border);
  font-size: 11.5px;
}
.metric-k { color: var(--muted); }
.metric-v { color: #7dd3fc; font-weight: 600; }

/* Main Workspace */
.workspace {
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  display: flex;
}
.tab-pane { display: none; flex: 1; min-width: 0; min-height: 0; }
.tab-pane.active { display: flex; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 6px 18px rgba(0,0,0,0.22);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Tab 0: Func / Test Cases */
.func-layout { display: flex; gap: 12px; flex: 1; min-width: 0; min-height: 0; }
.func-sidebar { width: 290px; flex: none; gap: 8px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cat-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: #192232;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.14s;
}
.cat-chip:hover { color: var(--text); border-color: var(--border-hi); }
.cat-chip.active { background: rgba(59,130,246,0.22); border-color: var(--primary); color: #dbeafe; }
.toc-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.toc-item {
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.toc-item:hover { background: #192334; }
.toc-item.active { background: #172d4f; border-color: rgba(59,130,246,0.55); }
.toc-title { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

.func-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.case-card {
  background: linear-gradient(180deg, #172030 0%, #131b28 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 11px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 4px 14px rgba(0,0,0,0.2);
  transition: border-color 0.15s;
}
.case-card:hover { border-color: var(--border-hi); border-left-color: var(--cyan); }
.case-card[data-cat="指示灯与报警"] { border-left-color: var(--warn); }
.case-card[data-cat="专项测试"] { border-left-color: #a855f7; }
.case-card[data-cat="板端联动"] { border-left-color: var(--success); }
.case-card[data-cat="自定义"] { border-left-color: #38bdf8; }

.case-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.case-title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-title { font-size: 15.5px; font-weight: 700; margin: 0; letter-spacing: 0.15px; }
.case-cat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid #334155;
}
.vis-filter-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.vis-chip {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #101620;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.vis-chip.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.65);
  color: #dbeafe;
  font-weight: 600;
}
.vis-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.vis-tag.public {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
}
.vis-tag.private {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fcd34d;
}
.toc-vis {
  font-size: 10px;
  color: #fbbf24;
  margin-right: 4px;
}
.vis-hint {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 6px;
  background: #10151e;
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
}

.case-card-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attr-badge {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #0f1621;
  border: 1px solid var(--border);
  color: #cbd5e1;
}
.attr-badge.edited {
  border-color: rgba(59,130,246,0.45);
  background: rgba(30,58,138,0.25);
  color: #bfdbfe;
}
.line-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  margin-right: 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}
.empty-hero {
  background: linear-gradient(180deg, #151e2e 0%, #101723 100%);
  border: 1px dashed var(--border-hi);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.changed-byte {
  background: rgba(34, 211, 238, 0.22);
  color: #67e8f9;
  border-radius: 3px;
  padding: 0 2px;
}

.case-body { display: flex; gap: 14px; align-items: flex-start; }
.case-icons { display: flex; gap: 10px; flex: none; }
.case-icon-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #11161f; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
}
.case-icon-slot img { width: 44px; height: 44px; object-fit: contain; }
.case-icon-slot span { font-size: 11px; color: var(--muted); }
.case-lines { flex: 1; display: flex; flex-direction: column; gap: 4px; color: #cbd5e1; font-size: 12.8px; }
.case-lines p { margin: 0; }

.case-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.case-subbox {
  background: #131922;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-subbox.amber {
  background: rgba(69, 41, 8, 0.4);
  border-color: rgba(245, 158, 11, 0.55);
}
.sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sub-label { width: 72px; color: var(--muted); font-size: 12px; flex: none; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.lamp-log {
  background: #0d1118;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: #cbd5e1;
  max-height: 190px;
  overflow: auto;
  white-space: pre;
  margin: 0;
}

/* Tab 1: Signal Sender */
.sig-layout { display: flex; gap: 10px; flex: 1; min-width: 0; min-height: 0; }
.sig-left { width: 350px; flex: none; gap: 8px; }
.sig-right { flex: 1; gap: 6px; }
.scroll-list { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: 6px; background: #10151e; }
.msg-row {
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.msg-row:nth-child(even) { background: #141a24; }
.msg-row:hover { background: #1c2636; }
.msg-row.active { background: #1e4d8c; color: #fff; }
.msg-id { font-family: var(--mono); color: #93c5fd; width: 78px; flex: none; }
.msg-row.active .msg-id { color: #fff; }
.msg-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sig-table-head, .sig-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
}
.sig-table-head {
  background: #1f2735;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.sig-row { border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; }
.sig-row:nth-child(even) { background: #141a24; }
.sig-row.checked { background: rgba(30, 77, 140, 0.32); }
.col-chk { width: 26px; flex: none; display: flex; justify-content: center; }
.col-sname { width: 210px; flex: none; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-sval { width: 170px; flex: none; display: flex; gap: 4px; }
.col-sval input, .col-sval select { width: 100%; height: 27px; padding: 2px 6px; font-size: 12px; }
.col-sunit { width: 58px; flex: none; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.col-srange { width: 110px; flex: none; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.col-sdesc { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chk-box {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid #5a677d; background: #0e1219;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex: none;
}
.chk-box.on { background: var(--primary); border-color: var(--primary); }

/* Tab 2: Raw Frames */
.raw-layout { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; min-height: 0; }
.raw-builder { flex: none; }
.raw-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item label { font-size: 12px; color: var(--muted); }
.form-wide { grid-column: span 2; }
.form-check { justify-content: flex-end; padding-bottom: 6px; }
.raw-table-card { flex: 1; min-height: 180px; gap: 6px; }
.frame-head, .frame-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; user-select: none;
}
.frame-head { background: #1f2735; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.frame-row { cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.035); transition: background 0.12s; }
.frame-row:nth-child(even) { background: #131924; }
.frame-row.selected { background: rgba(30, 64, 124, 0.45); }
.frame-row.dirty { background: rgba(120, 53, 15, 0.25); }
.col-fstate { width: 82px; flex: none; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.col-fstate.run { color: #34d399; }
.col-fstate.pause { color: var(--muted); }
.col-fstate.run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 6px #34d399; }
.col-fname { width: 170px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-fid { width: 105px; flex: none; font-family: var(--mono); color: #93c5fd; }
.col-fdata { flex: 1; min-width: 210px; font-family: var(--mono); }
.col-fper { width: 76px; flex: none; font-family: var(--mono); color: var(--muted); }
.col-fext { width: 48px; flex: none; display: flex; justify-content: center; }
.col-fops { width: 220px; flex: none; display: flex; align-items: center; gap: 5px; }
.inline-edit {
  width: 100%;
  height: 27px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(10, 14, 21, 0.65);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.inline-edit.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.inline-edit:hover { border-color: var(--border-hi); }
.inline-edit:focus { border-color: var(--primary); background: #0a0f18; }
.frame-row.dirty .inline-edit { border-color: rgba(245, 158, 11, 0.45); }

/* Tab 3: RX/TX Monitor */
.rx-card { flex: 1; gap: 8px; }
.rx-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.rx-log {
  flex: 1; overflow: auto;
  background: #0b0f16;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
.rx-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.025);
}
.rx-line.rx { color: #86efac; }
.rx-line.tx { color: #93c5fd; }
.rx-id-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: inherit;
  border-radius: 4px;
  padding: 0 6px;
  font: inherit;
  cursor: pointer;
  flex: none;
}
.rx-id-btn:hover { background: rgba(59,130,246,0.28); border-color: var(--primary); }
.rx-agg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rx-agg-row.rx { color: #86efac; }
.rx-agg-row.tx { color: #93c5fd; }
.rx-agg-cnt { width: 64px; color: var(--muted); flex: none; }
.rx-agg-data { width: 205px; flex: none; }
.rx-agg-name { width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; color: #e2e8f0; }
.rx-agg-sigs { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mcp-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.55);
  color: #e9d5ff;
  font-weight: 600;
}

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.toolbar-inline { display: flex; align-items: center; gap: 6px; }
.hint-inline { font-size: 12px; margin-left: 4px; }

/* Statusbar */
.statusbar {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #cbd5e1;
}

/* Lasso & Toast */
#lassoBand {
  position: fixed;
  border: 1px solid #60a5fa;
  background: rgba(59,130,246,0.24);
  pointer-events: none;
  display: none;
  z-index: 60;
}
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 42px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
}
.toast {
  background: #1f2937;
  border: 1px solid var(--border-hi);
  border-left: 4px solid var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  max-width: 360px;
  font-size: 12.5px;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.ok { border-left-color: var(--success); }

/* Modals */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 10, 16, 0.72);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px rgba(0,0,0,0.6);
}
.modal-sm { max-width: 440px; }
.modal-md { max-width: 580px; }
.modal-lg { max-width: 780px; }
.modal-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-close {
  background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-body { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-tip {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #bfdbfe;
}
.auth-tabs { display: flex; gap: 6px; }
.auth-tab {
  flex: 1; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  background: #121720; color: var(--muted); cursor: pointer; font: inherit; font-weight: 600;
}
.auth-tab.active { background: #1e3a5f; border-color: var(--primary); color: #fff; }
.form-stack { display: flex; flex-direction: column; gap: 6px; }
.form-stack label, .form-grid2 label { font-size: 12px; color: var(--muted); }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid2 > div { display: flex; flex-direction: column; gap: 6px; }
.form-error { color: #fca5a5; font-size: 12px; min-height: 16px; }
.form-success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.auth-hint-accounts { font-size: 11.5px; color: var(--muted); }

.project-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #10151e;
  border: 1px solid var(--border);
}
.project-select { min-width: 150px; max-width: 240px; }

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
.admin-user-row.pending { border-color: rgba(245, 158, 11, 0.55); background: rgba(69, 41, 8, 0.25); }
.user-status-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #232c3d;
  color: #cbd5e1;
}
.user-status-pill.pending { background: rgba(245, 158, 11, 0.25); color: #fde68a; }
.user-status-pill.active { background: rgba(34, 197, 94, 0.2); color: #bbf7d0; }
.user-status-pill.rejected { background: rgba(239, 68, 68, 0.2); color: #fecaca; }

.actions-editor-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.actions-editor { display: flex; flex-direction: column; gap: 6px; }
.action-edit-row {
  display: grid;
  grid-template-columns: 110px 100px 1fr 72px 58px 54px;
  gap: 6px;
  align-items: center;
  background: #10151e;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.history-row {
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.history-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.guide-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.6; }
.exe-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.exe-card {
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exe-card p { margin: 0; font-size: 12px; line-height: 1.5; }
.exe-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .exe-cards { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .func-layout, .sig-layout { flex-direction: column; }
  .func-sidebar, .sig-left { width: 100%; max-height: 220px; }
  .action-edit-row { grid-template-columns: 1fr 1fr; }
}
