:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #263349;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
  overflow-y: scroll;
  overscroll-behavior-x: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  overflow: visible;
  overscroll-behavior-x: none;
}

a {
  color: #60a5fa;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------------- Topbar & Nav ---------------- */
.topbar {
  background: #131c31;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-badge {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.brand h1 {
  font-size: 16px;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-wrap: nowrap;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
}

.divider-dot {
  color: #475569;
}

.nav-tabs {
  display: block;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--border);
  background: #131c31;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-tabs-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 9px 15px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

/* ---------------- Layout & Cards ---------------- */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 24px 48px;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.stat-val {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.stat-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.section-divider {
  border-top: 1px solid var(--border);
  margin: 14px 0 12px;
  padding-top: 12px;
}

.batch-bar {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dev-batch-action-bar {
  padding: 6px 10px;
  gap: 6px;
}
.dev-batch-action-bar .btn-row {
  gap: 5px;
}
.dev-batch-action-bar .btn-sm {
  padding: 2px 7px;
  font-size: 11.5px;
}
.dev-batch-action-bar .sel-pill {
  padding: 2px 8px;
  font-size: 11.5px;
}
.dev-batch-instant-select {
  padding: 2px 5px !important;
  font-size: 11.5px !important;
  max-width: 118px;
  border-radius: 5px !important;
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(100, 116, 139, 0.55) !important;
  color: #e2e8f0 !important;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dev-batch-instant-select:hover:not(:disabled) {
  border-color: #60a5fa !important;
  background: rgba(30, 41, 59, 0.92) !important;
}
.dev-batch-instant-select:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed;
}

.sel-pill {
  font-size: 12px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.readonly-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover {
  background: var(--primary-hover);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn-sm {
  padding: 4px 9px;
  font-size: 12px;
}
.btn-ghost {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: #334155;
}
.btn-success {
  background: var(--success);
}
.btn-success:hover {
  background: #059669;
}
.btn-warn {
  background: var(--warn);
  color: #111827;
}
.btn-warn:hover {
  background: #d97706;
}
.btn-danger {
  background: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-requeue {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(192, 132, 252, 0.48);
  color: #e9d5ff;
}
.btn-requeue:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.36);
  border-color: rgba(216, 180, 254, 0.7);
  color: #ffffff;
}
.btn-row {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 7px;
  align-items: center;
}
.btn-row-nowrap {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

/* ---------------- Forms & Single-Line Labels ---------------- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: #0f172a;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

textarea {
  width: 100%;
  font-family: Consolas, Monaco, monospace;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 11px 13px;
  margin-bottom: 12px;
}

.form-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 10px 12px;
  margin-bottom: 10px;
}

.pull-engine-param-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.65fr) minmax(132px, 1.02fr) minmax(182px, 1.42fr) minmax(156px, 1.25fr) minmax(88px, 0.72fr) minmax(108px, 0.88fr);
  gap: 10px 10px;
  margin-bottom: 6px;
  align-items: end;
}
.pull-engine-param-row input[type="number"],
.pull-engine-param-row select {
  width: 100%;
  min-width: 0;
}
@media (max-width: 1120px) {
  .pull-engine-param-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .pull-engine-param-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  min-width: 0;
}

.field > label:not(.switch-row) {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select {
  width: 100%;
}

.field-switch {
  display: flex;
  align-items: flex-end;
  padding-bottom: 5px;
  min-width: 0;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}
.help-dot:hover {
  background: var(--primary);
  color: #fff;
}

.hint-tip {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ---------------- Tables (Strict No-Wrap Support) ---------------- */
.table-wrap {
  overflow: visible;
  overflow-x: clip;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
  vertical-align: middle;
}

th.chk-col,
td.chk-col {
  width: 34px;
  text-align: center;
  padding: 8px 6px;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.45);
  white-space: nowrap;
}

td.nowrap,
table.nowrap-table td {
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

tr.row-requeue-wait td {
  background: rgba(168, 85, 247, 0.08);
}
tr.row-requeue-wait td:first-child {
  box-shadow: inset 3px 0 0 #c084fc;
}

tr.row-reassign td {
  background: rgba(249, 115, 22, 0.08);
}
tr.row-reassign td:first-child {
  box-shadow: inset 3px 0 0 #fb923c;
}

tr.row-problem td {
  background: rgba(239, 68, 68, 0.1);
}
tr.row-problem td:first-child {
  box-shadow: inset 3px 0 0 #ef4444;
}

tr.row-requeue-ok td {
  background: rgba(20, 184, 166, 0.055);
}
tr.row-requeue-ok td:first-child {
  box-shadow: inset 3px 0 0 #2dd4bf;
}

tr.row-requeue-fail td {
  background: rgba(244, 63, 94, 0.065);
}
tr.row-requeue-fail td:first-child {
  box-shadow: inset 3px 0 0 #fb7185;
}

tr.row-pending-approval td {
  background: rgba(6, 182, 212, 0.085);
}
tr.row-pending-approval td:first-child {
  box-shadow: inset 3px 0 0 #22d3ee;
}

tr.row-selected td {
  background: rgba(59, 130, 246, 0.14);
}

/* ---------------- Badges & Status Dots (6-Color System + Dynamic Animations) ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.b-ok {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.b-capturing {
  background: rgba(132, 204, 22, 0.2);
  color: #a3e635;
  border: 1px solid rgba(163, 230, 53, 0.42);
}
.b-submitting {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.45);
}
.b-yellow {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.45);
}
.b-warn {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.42);
}
.b-err {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.42);
}
.b-info {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.38);
}
.b-muted {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.st-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  background: currentColor;
}
.st-dot.dot-ok, .b-ok .st-dot { background: #34d399; color: #34d399; }
.st-dot.dot-capturing, .b-capturing .st-dot { background: #a3e635; color: #a3e635; }
.st-dot.dot-submitting, .b-submitting .st-dot { background: #22d3ee; color: #22d3ee; }
.st-dot.dot-info, .b-info .st-dot, .b-dispatch .st-dot { background: #60a5fa; color: #60a5fa; }
.st-dot.dot-yellow, .b-yellow .st-dot { background: #fde047; color: #fde047; }
.st-dot.dot-warn, .b-warn .st-dot { background: #fb923c; color: #fb923c; }
.st-dot.dot-danger, .b-err .st-dot { background: #f87171; color: #f87171; }

@keyframes stDotBreathe {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 6px currentColor;
  }
  50% {
    opacity: 0.38;
    transform: scale(0.84);
    box-shadow: 0 0 1px currentColor;
  }
}

@keyframes stDotPulseRing {
  0% {
    transform: scale(0.65);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.95);
    opacity: 0;
  }
}

.st-dot.is-breathing {
  animation: stDotBreathe 1.6s ease-in-out infinite;
}

.st-dot.is-pulsing {
  box-shadow: 0 0 6px currentColor;
}

.st-dot.is-pulsing::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: stDotPulseRing 0.9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

.filter-pill .st-dot {
  margin-right: 4px;
  top: -0.5px;
}

.cd-capturing {
  color: #a3e635;
}
.cd-submitting {
  color: #22d3ee;
}
.cd-info {
  color: #60a5fa;
}
.cd-yellow {
  color: #fde047;
}
.b-requeue {
  background: rgba(168, 85, 247, 0.22);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.5);
}
.b-reassign-run {
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.52);
}
.b-reassign-alert {
  background: rgba(239, 68, 68, 0.24);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.62);
}
.b-requeue-ok {
  background: rgba(20, 184, 166, 0.22);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.5);
}
.b-requeue-fail {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.52);
}
.b-requeue-exp {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.38);
}
.b-ios {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.48);
}
.b-ios-fallback {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.52);
}
.b-pc {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.26);
}
.b-pending {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.55);
}
.b-idle {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.36);
}

/* Compact Online Devices Table — Zero Overlap, Clean Column Fit */
#tab-devices .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
table.devices-compact-table {
  width: 100%;
  min-width: 1360px;
  table-layout: fixed;
}
table.devices-compact-table th,
table.devices-compact-table td {
  padding: 5px 4px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
table.devices-compact-table th.chk-col,
table.devices-compact-table td.chk-col {
  width: 24px;
  padding: 5px 2px;
}
table.devices-compact-table th:nth-child(2),
table.devices-compact-table td:nth-child(2) {
  width: 90px;
}
table.devices-compact-table th:nth-child(3),
table.devices-compact-table td:nth-child(3) {
  width: auto;
  min-width: 180px;
}
table.devices-compact-table th:nth-child(4),
table.devices-compact-table td:nth-child(4) {
  width: 58px;
}
table.devices-compact-table th:nth-child(5),
table.devices-compact-table td:nth-child(5) {
  width: 202px;
  overflow: hidden;
}
table.devices-compact-table th:nth-child(6),
table.devices-compact-table td:nth-child(6) {
  width: 34px;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}
table.devices-compact-table th:nth-child(7),
table.devices-compact-table td:nth-child(7) {
  width: 138px;
}
table.devices-compact-table th:nth-child(8),
table.devices-compact-table td:nth-child(8) {
  width: 244px;
  overflow: hidden;
}
table.devices-compact-table th:nth-child(9),
table.devices-compact-table td:nth-child(9) {
  width: 104px;
}
table.devices-compact-table td.dev-ip-cell {
  font-size: 11.5px;
}
table.devices-compact-table th:nth-child(10),
table.devices-compact-table td:nth-child(10) {
  width: 138px;
  overflow: hidden;
}
table.devices-compact-table th:nth-child(11),
table.devices-compact-table td:nth-child(11) {
  width: 166px;
  text-align: right;
  overflow: hidden;
}
.dev-state-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.dev-plat-badge {
  display: inline-block;
  width: 28px;
  padding: 1px 0 !important;
  font-size: 10px !important;
  text-align: center;
  box-sizing: border-box;
  flex-shrink: 0;
}
.dev-status-badge {
  display: inline-block;
  min-width: 40px;
  padding: 1px 6px !important;
  font-size: 11px !important;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.dev-status-badge.is-off-time {
  font-family: var(--mono);
  font-size: 10.5px !important;
  padding: 1px 4px !important;
  letter-spacing: -0.2px;
}
.dev-status-badge.b-ok {
  border-color: rgba(16, 185, 129, 0.38);
}
.dev-status-badge.b-warn {
  border-color: rgba(245, 158, 11, 0.42);
}
.dev-status-badge.b-err {
  border-color: rgba(239, 68, 68, 0.42);
}
.dev-status-badge.b-info {
  border-color: rgba(59, 130, 246, 0.42);
}
.dev-status-badge.b-muted {
  border-color: rgba(148, 163, 184, 0.32);
}
.ver-pair-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  vertical-align: middle;
}
.ver-chip {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 600;
  border: 1px solid transparent;
}
.ver-chip.is-base {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.28);
}
.ver-chip.is-js-match {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.32);
}
.ver-chip.is-base-diff {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}
.ver-chip.is-js-hot {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.38);
}
table.devices-compact-table .dev-id-copy {
  display: inline-flex;
  align-items: center;
  max-width: 120px;
  cursor: pointer;
  vertical-align: middle;
}
table.devices-compact-table .dev-id-copy:hover .dev-id-text {
  color: #93c5fd;
  text-decoration: underline;
}
table.devices-compact-table .dev-id-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 96px;
  vertical-align: middle;
}
table.devices-compact-table .dev-ip-cell {
  max-width: 102px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.devices-compact-table .dev-note-input {
  width: 100%;
  min-width: 52px;
  max-width: 82px;
  padding: 2px 4px;
  font-size: 11.5px;
  box-sizing: border-box;
}
table.devices-compact-table .dev-buf-input {
  width: 40px;
  padding: 2px 3px;
  font-size: 11.5px;
  text-align: center;
  box-sizing: border-box;
  vertical-align: middle;
}
table.devices-compact-table td.dev-ctrl-cell {
  white-space: nowrap;
  text-align: right;
}
table.devices-compact-table .dev-ctrl-wrap {
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
table.devices-compact-table .btn-sm {
  padding: 2px 5px;
  font-size: 11.5px;
  line-height: 1.3;
  flex-shrink: 0;
}
table.devices-compact-table .dev-cbtn {
  min-width: 34px;
  padding: 2px 4px;
}
table.devices-compact-table .dev-cbtn-sm {
  min-width: 24px;
  padding: 2px 4px;
}
table.devices-compact-table .dev-cbtn-1 {
  width: 24px;
  min-width: 24px;
  padding: 2px 0 !important;
  text-align: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
}
table.devices-compact-table .btn-row-nowrap {
  gap: 2.5px;
}

.b-warm-active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.48);
}
.btn-warm-on {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ecfdf5;
  border: 1px solid rgba(52, 211, 153, 0.55);
}
.btn-warm-on:hover:not(:disabled) {
  filter: brightness(1.1);
}
.btn-warm-armed {
  background: rgba(13, 148, 136, 0.16);
  color: #5eead4;
  border: 1px dashed rgba(45, 212, 191, 0.5);
}
tr.row-warming td {
  background: rgba(16, 185, 129, 0.045);
}
tr.row-warming td:first-child {
  box-shadow: inset 3px 0 0 #10b981;
}

.filter-pills {
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 5px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-pill:hover {
  color: var(--text);
  border-color: #64748b;
}
.filter-pill.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
  color: #bfdbfe;
}
.filter-pill[data-hfilter="requeued"].active {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
}
.filter-pill[data-hfilter="requeued_ok"].active {
  background: rgba(20, 184, 166, 0.24);
  border-color: rgba(45, 212, 191, 0.58);
  color: #5eead4;
}
.filter-pill[data-hfilter="requeued_live"].active {
  background: rgba(249, 115, 22, 0.24);
  border-color: rgba(251, 146, 60, 0.58);
  color: #fdba74;
}
.filter-pill[data-hfilter="failed"].active {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}
.filter-pill[data-hfilter="ios"].active {
  background: rgba(6, 182, 212, 0.24);
  border-color: rgba(34, 211, 238, 0.58);
  color: #67e8f9;
}
.hist-filter-bar {
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 6px 10px;
}
.hist-filter-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.hist-filter-bar .filter-pills {
  gap: 4px;
}
.hist-filter-bar .filter-pill {
  padding: 2px 7px;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1.45;
}
.hist-filter-bar .divider-dot {
  margin: 0 1px;
  opacity: 0.45;
}
.hist-filter-right {
  gap: 5px;
  margin-left: auto;
}
.hist-filter-right .btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
}
.role-owner {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.role-admin {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.role-viewer {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.mono {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.code-box {
  background: #0b1120;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: #cbd5e1;
}

/* ---------------- Auth Gate Overlay & Modals ---------------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #172554 0%, #0f172a 62%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 26px 24px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}

.auth-header {
  margin-bottom: 18px;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  margin-top: 10px;
}

.auth-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.auth-field {
  margin-bottom: 13px;
}

.auth-field label {
  display: block;
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
}

.auth-err {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin-bottom: 13px;
  display: none;
}

.auth-note {
  background: rgba(59, 130, 246, 0.13);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 12px;
  margin-bottom: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 160;
  padding: 16px;
}

.modal-backdrop.open,
.modal-backdrop.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  user-select: text;
  -webkit-user-select: text;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #1e293b;
  border: 1px solid #475569;
  padding: 10px 14px 8px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  z-index: 300;
  display: none;
  font-size: 13px;
  max-width: min(520px, calc(100vw - 32px));
  user-select: text;
  -webkit-user-select: text;
  cursor: pointer;
}

.toast-body {
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.toast-copy-hint {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(71, 85, 105, 0.5);
  font-size: 11px;
  color: #94a3b8;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* ---------------- Real-Time Countdowns, Reassign Alerts & TLS Bar ---------------- */
.cd-ok {
  color: #34d399;
}
.cd-warn {
  color: #fbbf24;
}
.cd-danger {
  color: #f87171;
  font-weight: 700;
}
.cd-queued {
  color: #60a5fa;
}
.cd-done {
  color: #cbd5e1;
}
.cd-muted {
  color: var(--muted);
}
.cd-help {
  cursor: help;
}
.cd-alert {
  border: 1px solid rgba(248, 113, 113, 0.45);
}

.live-monitor-idle {
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(71, 85, 105, 0.7);
  border-radius: 8px;
  padding: 8px 12px;
}

.live-monitor-wrap {
  max-height: none;
  overflow-y: visible;
}

.tls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.tls-config-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 8px;
  padding: 13px 14px;
  margin-bottom: 14px;
}

.tls-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 11px;
}

.tls-mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ca-auth-tip {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.verify-alert-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: var(--radius);
  padding: 11px 15px;
  margin-bottom: 14px;
}

#ovPendingAlertBar,
#ovRiskAlertBar,
#ovVerifyAlertBar,
#ovTimeoutAlertBar,
#ovSoundAlertBar {
  position: relative;
  align-items: flex-start;
}

#ovPendingAlertBar > .verify-alert-main,
#ovRiskAlertBar > .verify-alert-main,
#ovVerifyAlertBar > .verify-alert-main,
#ovTimeoutAlertBar > .verify-alert-main,
#ovSoundAlertBar > .verify-alert-main {
  flex: 1 1 100%;
  width: 100%;
}

#ovPendingAlertBar > .btn-row,
#ovRiskAlertBar > .btn-row,
#ovVerifyAlertBar > .btn-row,
#ovTimeoutAlertBar > .btn-row,
#ovSoundAlertBar > .btn-row {
  position: absolute;
  top: 9px;
  right: 14px;
}

#ovPendingAlertBar .verify-alert-title,
#ovRiskAlertBar .verify-alert-title,
#ovVerifyAlertBar .verify-alert-title,
#ovTimeoutAlertBar .verify-alert-title,
#ovSoundAlertBar .verify-alert-title {
  padding-right: 220px;
  line-height: 1.45;
}

.verify-alert-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.verify-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: #fcd34d;
}

.verify-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 6px;
  width: 100%;
}

.verify-grid-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.verify-grid-card.is-risk {
  border-color: rgba(248, 113, 113, 0.48);
}

.verify-grid-card.is-pending {
  border-color: rgba(34, 211, 238, 0.42);
}

.vgc-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.vgc-id-compact {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vgc-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.vgc-grp {
  padding: 1px 5px !important;
  font-size: 10.5px !important;
  flex-shrink: 0;
}

.vgc-time {
  display: inline-block;
  min-width: 34px;
  text-align: right;
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: #fca5a5;
  font-weight: 600;
}

.vgc-ip {
  font-size: 11px;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verify-grid-card .dev-cbtn-1 {
  width: 24px;
  min-width: 24px;
  padding: 1px 0 !important;
  font-size: 11px;
  line-height: 1.35;
  justify-content: center;
  flex-shrink: 0;
}

.verify-dev-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
}

.pending-alert-bar {
  background: rgba(6, 182, 212, 0.11);
  border-color: rgba(34, 211, 238, 0.45);
}

.pending-alert-bar .verify-alert-title {
  color: #67e8f9;
}

.pending-dev-chip {
  border-color: rgba(34, 211, 238, 0.38);
}

/* ---------------- Account Error Floating Copy Popover (Upgrade 1) ---------------- */
.acct-err-copyable {
  cursor: pointer;
  text-decoration: underline dotted rgba(248, 113, 113, 0.55);
  text-underline-offset: 2px;
}

.acct-err-popover {
  position: fixed;
  z-index: 290;
  min-width: 240px;
  max-width: min(540px, calc(100vw - 24px));
  background: #0f172a;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 9px;
  padding: 10px 12px 8px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.65);
  color: #fecaca;
  user-select: text;
  -webkit-user-select: text;
  word-break: break-all;
  cursor: pointer;
}

.acct-err-popover.is-info {
  border-color: rgba(96, 165, 250, 0.52);
  color: #f1f5f9;
}

.acct-err-popover-body {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;
}

.acct-err-popover-foot {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(71, 85, 105, 0.55);
  font-size: 11px;
  color: #94a3b8;
  user-select: none;
}

/* ---------------- Web Audio Monitor Sound Controls & Modal (Upgrade 3) ---------------- */
.sound-btn-on {
  border-color: rgba(52, 211, 153, 0.48) !important;
  color: #6ee7b7 !important;
}

.sound-btn-off {
  color: var(--muted) !important;
}

.sound-modal-card {
  max-width: 680px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

.sound-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

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

.sound-vol-wrap input[type="range"] {
  width: 115px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.sound-cat-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 3px;
}

.sound-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 8px;
  padding: 8px 11px;
}

.sound-cat-info {
  min-width: 220px;
  flex: 1;
}

.sound-cat-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  padding-left: 22px;
}

.sound-cat-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sound-cat-sel {
  min-width: 175px;
  padding: 5px 8px;
  font-size: 12.5px;
}

/* ---------------- Notify Center Integration Card (Upgrade 4) ---------------- */
.nc-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.nc-topic-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(51, 65, 85, 0.68);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12.5px;
  cursor: pointer;
}

.nc-topic-item:hover {
  border-color: rgba(96, 165, 250, 0.5);
}

.nc-topic-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.nc-topic-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nc-topic-code {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: #93c5fd;
}

.nc-topic-desc {
  font-size: 11.5px;
  color: var(--muted);
}

.nc-test-result {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(6, 78, 59, 0.24);
  color: #a7f3d0;
}

.nc-test-result.is-err {
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
}

/* ---------------- KPI Card Alerts & Card 6 Smart Window Ticker ---------------- */
.stat-card {
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card.kpi-alert-warn {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.stat-card.kpi-alert-danger {
  border-color: rgba(239, 68, 68, 0.62);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.22);
}

.stat-card-win {
  overflow: visible;
}

.win-status-ticker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: pointer;
  padding-bottom: 1px;
}

.win-status-ticker::-webkit-scrollbar {
  display: none;
}

.win-ticker-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(51, 65, 85, 0.72);
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.win-ticker-chip strong {
  font-weight: 600;
  color: #cbd5e1;
}

.win-ticker-chip.has-val-info {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.42);
}
.win-ticker-chip.has-val-info strong {
  color: #bfdbfe;
}

.win-ticker-chip.has-val-warn {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.48);
}
.win-ticker-chip.has-val-warn strong {
  color: #fde68a;
}

.win-ticker-chip.has-val-danger {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
}
.win-ticker-chip.has-val-danger strong {
  color: #fecaca;
}

.win-ticker-chip.has-val-cyan {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(34, 211, 238, 0.52);
}
.win-ticker-chip.has-val-cyan strong {
  color: #a5f3fc;
}

.win-ticker-chip.has-val-ok {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.45);
}
.win-ticker-chip.has-val-ok strong {
  color: #a7f3d0;
}

@keyframes winChipPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
  45% {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.42);
  }
}

.win-ticker-chip.win-chip-flash {
  animation: winChipPulse 1.1s ease-in-out 4;
  border-color: #38bdf8 !important;
}

.win-detail-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  width: 364px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #111a2e 0%, #0b1221 100%);
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(15, 23, 42, 0.8) inset;
  font-size: 12px;
  color: var(--text);
  user-select: text;
  -webkit-user-select: text;
}

.win-pop-title {
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.72);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.win-pop-heading {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.win-pop-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.65);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.win-pop-sum-run {
  color: #34d399;
}

.win-pop-sum-sep {
  color: #475569;
}

.win-pop-sum-on {
  color: #93c5fd;
}

.win-pop-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 9px;
}

.win-pop-plat-card {
  background: rgba(30, 41, 59, 0.52);
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 8px;
  padding: 8px 10px;
}

.win-pop-plat-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
  margin-bottom: 5px;
}

.win-pop-plat-cap {
  margin-left: auto;
  font-size: 10.5px;
  color: #64748b;
}

.win-pop-plat-val {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 16px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.win-pop-plat-val strong.val-run {
  color: #34d399;
  font-weight: 700;
}

.win-pop-plat-val .val-on {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 14px;
}

.win-pop-plat-val .val-zero {
  color: #64748b;
  font-weight: 600;
  font-size: 14px;
}

.win-pop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.win-pop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(51, 65, 85, 0.52);
  color: #94a3b8;
  white-space: nowrap;
}

.win-pop-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.win-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.win-dot.dot-info { background: #60a5fa; }
.win-dot.dot-ok { background: #34d399; }
.win-dot.dot-warn { background: #fbbf24; }
.win-dot.dot-danger { background: #f87171; }
.win-dot.dot-cyan { background: #22d3ee; }
.win-dot.dot-muted { background: #64748b; }
.win-dot.dot-slate { background: #94a3b8; }

.win-pop-row strong {
  color: #64748b;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.win-pop-row.is-total-row strong {
  color: #cbd5e1;
}

.win-pop-row.is-active-info {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(30, 58, 138, 0.2);
}
.win-pop-row.is-active-info strong { color: #93c5fd; }

.win-pop-row.is-active-ok {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(6, 78, 59, 0.22);
}
.win-pop-row.is-active-ok strong { color: #6ee7b7; }

.win-pop-row.is-active-warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(120, 53, 15, 0.24);
}
.win-pop-row.is-active-warn strong { color: #fbbf24; }

.win-pop-row.is-active-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.24);
}
.win-pop-row.is-active-danger strong { color: #f87171; }

.win-pop-row.is-active-cyan {
  color: #a5f3fc;
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(22, 78, 99, 0.26);
}
.win-pop-row.is-active-cyan strong { color: #67e8f9; }

/* ---------------- Sound Active Ringing Badge & Recent History Popover ---------------- */
.sound-status-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

@keyframes soundRingPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.48);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(251, 191, 36, 0);
  }
}

.sound-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  transition: all 0.2s;
}

.sound-active-badge.is-ringing {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.8);
  color: #fde68a;
  animation: soundRingPulse 0.95s ease-in-out infinite;
}

.sound-active-badge.is-last {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(100, 116, 139, 0.52);
  color: #cbd5e1;
}

.sound-active-badge.is-last:hover {
  border-color: rgba(96, 165, 250, 0.6);
  color: #fff;
}

.snd-wave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.85);
}

.sound-alert-bar {
  background: rgba(245, 158, 11, 0.11);
  border-color: rgba(245, 158, 11, 0.42);
}

.sound-alert-bar.is-tone-danger {
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.48);
}

.sound-alert-bar.is-tone-danger .sound-alert-title {
  color: #fca5a5;
}

.sound-alert-bar.is-tone-warn {
  background: rgba(245, 158, 11, 0.11);
  border-color: rgba(245, 158, 11, 0.42);
}

.sound-alert-bar.is-tone-warn .sound-alert-title {
  color: #fcd34d;
}

.sound-alert-bar.is-tone-timeout {
  background: rgba(154, 52, 18, 0.18);
  border-color: rgba(249, 115, 22, 0.48);
}

.sound-alert-bar.is-tone-timeout .sound-alert-title {
  color: #fdba74;
}

.sound-alert-bar.is-tone-info {
  background: rgba(14, 116, 144, 0.18);
  border-color: rgba(34, 211, 238, 0.42);
}

.sound-alert-bar.is-tone-info .sound-alert-title {
  color: #67e8f9;
}

.sound-alert-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #fcd34d;
  font-size: 13px;
  font-weight: 600;
}

.sound-alert-reason {
  color: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.sound-alert-win-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.sound-alert-meta {
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 400;
}

.sound-alert-history {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(71, 85, 105, 0.55);
}

.snd-modal-history {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.stat-sub-tooltip {
  position: fixed;
  z-index: 260;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(96, 165, 250, 0.52);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #f1f5f9;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.58);
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  white-space: normal;
  word-break: break-word;
}

.sound-history-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 140;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #0f172a;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  font-size: 12px;
  user-select: text;
  -webkit-user-select: text;
}

.snd-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.75);
  color: #bfdbfe;
}

.snd-pop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 270px;
  overflow-y: auto;
}

.snd-pop-item {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 7px;
  padding: 6px 8px;
}

.snd-pop-item.is-active {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.13);
}

.snd-pop-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snd-pop-time {
  color: #93c5fd;
  font-size: 11px;
}

.snd-pop-cat {
  color: #f1f5f9;
  font-size: 12px;
}

.snd-pop-reason {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.snd-pop-empty {
  color: var(--muted);
  text-align: center;
  padding: 12px 6px;
}

/* ---------------- Sortable Table Headers (Online Devices) ---------------- */
th.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}

th.th-sortable:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.75);
}

th.th-sortable.is-sorted {
  color: #60a5fa;
}

th.th-sortable .sort-ind {
  font-size: 10.5px;
  opacity: 0.45;
  margin-left: 2px;
}

th.th-sortable.is-sorted .sort-ind {
  opacity: 1;
  color: #60a5fa;
}

th.th-dual-sort {
  user-select: none;
  white-space: nowrap;
}
.th-sub-sort {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.th-sub-sort:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.75);
}
.th-sub-sort .sort-ind {
  font-size: 10.5px;
  opacity: 0.45;
  margin-left: 2px;
}
.th-sub-sort.is-sorted {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.14);
}
.th-sub-sort.is-sorted .sort-ind {
  opacity: 1;
  color: #60a5fa;
}
.th-sub-sep {
  opacity: 0.45;
  margin: 0 2px;
}

/* ---------------- Upstream Performance Concurrency Slider & Progress Bar ---------------- */
.perf-concurrency-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.perf-concurrency-ctrl input[type="range"] {
  width: 105px;
  accent-color: var(--primary);
  cursor: pointer;
}

.perf-concurrency-ctrl input[type="number"] {
  width: 56px;
  padding: 3px 6px;
  font-size: 12.5px;
  text-align: center;
}

.perf-progress-panel {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(59, 130, 246, 0.36);
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.perf-progress-panel.is-done {
  border-color: rgba(16, 185, 129, 0.45);
}

.perf-progress-panel.is-stopped {
  border-color: rgba(245, 158, 11, 0.48);
}

.perf-progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 7px;
  font-size: 12.5px;
}

.perf-progress-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.perf-progress-right {
  color: var(--muted);
  font-size: 12px;
}

.perf-pct-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.perf-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  display: inline-block;
}

.perf-progress-panel.is-running .perf-status-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
}

.perf-progress-panel.is-done .perf-status-dot {
  background: #10b981;
}

.perf-progress-panel.is-stopped .perf-status-dot {
  background: #f59e0b;
}

.perf-progress-track {
  width: 100%;
  height: 9px;
  background: rgba(30, 41, 59, 0.95);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

@keyframes perfBarShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.perf-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #3b82f6);
  background-size: 200% 100%;
  transition: width 0.18s ease-out;
}

.perf-progress-panel.is-running .perf-progress-fill {
  animation: perfBarShimmer 1.6s linear infinite;
}

.perf-progress-panel.is-done .perf-progress-fill {
  background: linear-gradient(90deg, #059669, #34d399);
}

.perf-progress-panel.is-stopped .perf-progress-fill {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

/* ---------------- History Tab Pagination Footer ---------------- */
.hist-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
}

/* ---------------- Dispatch & Risk Dropdown + Inline Description + Linked Params ---------------- */
.mode-policy-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-policy-block {
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
}

.mode-select-row {
  display: grid;
  grid-template-columns: minmax(230px, 285px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.mode-desc-box {
  background: rgba(30, 41, 59, 0.58);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 12.2px;
  line-height: 1.5;
  color: #cbd5e1;
}

.mode-desc-box.is-warn {
  background: rgba(120, 53, 15, 0.22);
  border-color: rgba(245, 158, 11, 0.42);
  border-left-color: #f59e0b;
  color: #fde68a;
}

.mode-linked-params {
  margin-top: 10px;
  margin-bottom: 2px;
  padding-top: 10px;
  border-top: 1px dashed rgba(71, 85, 105, 0.55);
}

@media (max-width: 760px) {
  .mode-select-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ---------------- Window Custom Alias & Centralized JS Script Version Center ---------------- */
.win-term-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
  overflow: hidden;
}

.win-term-cell > .badge {
  flex-shrink: 0;
  margin-right: 0 !important;
}

.win-term-cell > .win-id-pair {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none !important;
}

.win-id-pair {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-alias-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.42);
  color: #67e8f9;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  flex-shrink: 0;
}

.win-alias-tag.is-empty {
  background: rgba(71, 85, 105, 0.25);
  border-color: rgba(100, 116, 139, 0.45);
  color: #94a3b8;
  font-weight: 600;
}

.win-short-id {
  color: #94a3b8;
  font-size: 11.5px;
  flex-shrink: 0;
}

.win-shopee-tag {
  display: inline-block;
  min-width: 0;
  max-width: 110px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.win-shopee-tag:hover {
  border-color: rgba(251, 191, 36, 0.85);
  background: rgba(245, 158, 11, 0.28);
  color: #fef3c7;
}

.win-shopee-tag.is-empty {
  background: rgba(71, 85, 105, 0.25);
  border-color: rgba(100, 116, 139, 0.45);
  color: #94a3b8;
  font-weight: 500;
}

.win-shopee-tag.is-empty:hover {
  border-color: rgba(148, 163, 184, 0.72);
  background: rgba(71, 85, 105, 0.38);
  color: #cbd5e1;
}

table.devices-compact-table .win-shopee-tag {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  padding: 0 4px;
}

.dev-alias-input {
  width: 46px;
  padding: 2px 3px !important;
  font-size: 11.5px !important;
  border-radius: 5px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid rgba(71, 85, 105, 0.72) !important;
  color: #e2e8f0 !important;
  font-weight: 500;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dev-alias-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.dev-alias-input:focus {
  border-color: #38bdf8 !important;
  outline: none;
}

.dev-script-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.dev-script-select {
  width: 72px;
  padding: 2px 2px !important;
  font-size: 11px !important;
  border-radius: 5px !important;
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid rgba(71, 85, 105, 0.75) !important;
  color: #cbd5e1 !important;
  flex-shrink: 0;
}

.dev-script-select.is-pinned {
  border-color: rgba(251, 191, 36, 0.55) !important;
  background: rgba(120, 53, 15, 0.28) !important;
  color: #fde68a !important;
  font-weight: 600;
}

.dev-script-dot {
  display: inline-block;
  min-width: 50px;
  padding: 1px 4px;
  border-radius: 4px;
  font-family: Consolas, Monaco, monospace;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dev-script-dot.is-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.dev-script-dot.is-sync {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.38);
}

.dev-script-dot.is-err {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.45);
}

.dev-script-dot.is-muted {
  background: rgba(71, 85, 105, 0.24);
  color: #94a3b8;
  border: 1px solid rgba(71, 85, 105, 0.48);
}

.script-code-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

/* Compact Script Version Center Table — Zero Horizontal Scrollbar */
#tab-scripts,
#tab-scripts .card {
  max-width: 100%;
  overflow-x: clip;
}
#tab-scripts .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  overflow-x: clip;
}
#tab-scripts table.nowrap-table,
table.scripts-compact-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}
#tab-scripts table.nowrap-table th,
#tab-scripts table.nowrap-table td,
table.scripts-compact-table th,
table.scripts-compact-table td {
  padding: 6px 5px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
#tab-scripts table.nowrap-table th:nth-child(1),
#tab-scripts table.nowrap-table td:nth-child(1),
table.scripts-compact-table .sc-col-ver {
  width: 96px;
}
.sc-ver-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
#tab-scripts table.nowrap-table th:nth-child(2),
#tab-scripts table.nowrap-table td:nth-child(2),
table.scripts-compact-table .sc-col-plat {
  width: 64px;
}
#tab-scripts table.nowrap-table th:nth-child(3),
#tab-scripts table.nowrap-table td:nth-child(3),
table.scripts-compact-table .sc-col-title {
  width: 200px;
  max-width: 200px;
}
#tab-scripts table.nowrap-table .sc-title-main,
#tab-scripts table.nowrap-table .sc-title-note,
table.scripts-compact-table .sc-title-main,
table.scripts-compact-table .sc-title-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#tab-scripts table.nowrap-table .sc-title-note,
table.scripts-compact-table .sc-title-note {
  font-size: 11px;
  margin-top: 1px;
}
#tab-scripts table.nowrap-table th:nth-child(4),
#tab-scripts table.nowrap-table td:nth-child(4),
table.scripts-compact-table .sc-col-state {
  width: 78px;
}
#tab-scripts table.nowrap-table th:nth-child(5),
#tab-scripts table.nowrap-table td:nth-child(5),
table.scripts-compact-table .sc-col-usage {
  width: 134px;
}
.sc-usage-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#tab-scripts table.nowrap-table th:nth-child(6),
#tab-scripts table.nowrap-table td:nth-child(6),
table.scripts-compact-table .sc-col-size {
  width: 58px;
}
#tab-scripts table.nowrap-table th:nth-child(7),
#tab-scripts table.nowrap-table td:nth-child(7),
table.scripts-compact-table .sc-col-sha {
  width: 86px;
}
#tab-scripts table.nowrap-table th:nth-child(8),
#tab-scripts table.nowrap-table td:nth-child(8),
table.scripts-compact-table .sc-col-time {
  width: 112px;
}
#tab-scripts table.nowrap-table th:nth-child(9),
#tab-scripts table.nowrap-table td:nth-child(9),
table.scripts-compact-table .sc-col-sync {
  width: 84px;
  text-align: center;
  overflow: visible;
}
.sc-sync-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 68px;
  margin: 0 auto;
  white-space: nowrap;
}
.sc-sync-chk {
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}
.sc-clear-btn {
  width: 40px;
  min-width: 40px;
  padding: 2px 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  text-align: center;
  justify-content: center;
  flex-shrink: 0;
}
#tab-scripts table.nowrap-table th:nth-child(10),
#tab-scripts table.nowrap-table td:nth-child(10),
table.scripts-compact-table .sc-col-act {
  width: 245px;
  text-align: left;
  overflow: visible;
}
#tab-scripts table.nowrap-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
#tab-scripts table.nowrap-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.09);
}
#tab-scripts table.nowrap-table tbody tr.row-selected td {
  background: rgba(59, 130, 246, 0.22) !important;
}
#tab-scripts table.nowrap-table .btn-sm,
table.scripts-compact-table .btn-sm {
  padding: 2px 6px;
  font-size: 11.5px;
  line-height: 1.3;
}
#tab-scripts table.nowrap-table .btn-row-nowrap,
table.scripts-compact-table .btn-row-nowrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  justify-content: flex-end;
}
.sc-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.sc-act-vsep {
  display: inline-block;
  width: 2px;
  height: 15px;
  border-radius: 1px;
  background: rgba(148, 163, 184, 0.8);
  margin: 0 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

.script-code-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 410px;
  font-family: Consolas, "Cascadia Mono", Monaco, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.52;
  background: #090e1a !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(59, 130, 246, 0.32) !important;
  border-radius: 8px !important;
  padding: 11px 13px !important;
  tab-size: 2;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  overflow-x: hidden;
}

#scriptCodeFileTabs {
  gap: 0;
  flex-wrap: wrap;
}

.script-ui-preview-wrap {
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  background: #0b1120;
  overflow: hidden;
}
.script-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}
.sp-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.sp-vsep {
  display: inline-block;
  width: 2px;
  height: 20px;
  border-radius: 1px;
  background: rgba(148, 163, 184, 0.85);
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.3);
  margin: 0 16px;
  vertical-align: middle;
  flex-shrink: 0;
}
.script-preview-stage {
  padding: 14px;
  background: radial-gradient(circle at top left, rgba(30, 41, 59, 0.7), #090d16);
}
.sp-browser-Viewport {
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}
.sp-browser-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.sp-dots {
  display: inline-flex;
  gap: 5px;
}
.sp-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #475569;
}
.sp-dots i:nth-child(1) { background: #ef4444; }
.sp-dots i:nth-child(2) { background: #f59e0b; }
.sp-dots i:nth-child(3) { background: #10b981; }
.sp-url-bar {
  flex: 1;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #334155;
}
.sp-page-canvas {
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  min-height: 540px;
  background: linear-gradient(180deg, #eef2f6 0%, #e2e8f0 100%);
  align-items: start;
}
@media (max-width: 960px) {
  .sp-page-canvas {
    grid-template-columns: 1fr;
  }
}
.sp-shadow-mount {
  min-height: 480px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.sp-mock-pdp {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.sp-mock-breadcrumb {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}
.sp-mock-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sp-mock-img {
  height: 140px;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  color: #64748b;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}
.sp-mock-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.sp-mock-price {
  font-size: 18px;
  font-weight: 800;
  color: #ee4d2d;
  margin-bottom: 12px;
}
.sp-mock-spec {
  font-size: 12.2px;
  line-height: 1.65;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

/* ---------------- Immediate Dispatch & 10-Column Online Devices Upgrades ---------------- */
.btn-dispatch {
  background: linear-gradient(135deg, #ea580c, #dc2626);
  border-color: rgba(251, 146, 60, 0.75);
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}
.btn-dispatch:hover:not(:disabled) {
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-color: rgba(253, 186, 116, 0.92);
  color: #ffffff;
}
.b-dispatch {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.85), rgba(220, 38, 38, 0.85));
  color: #ffffff;
  border: 1px solid rgba(251, 146, 60, 0.72);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.ico-bolt {
  width: 13px;
  height: 13px;
  fill: #ffffff;
  stroke: rgba(124, 45, 18, 0.92);
  stroke-width: 0.75px;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.72));
  vertical-align: -2px;
  margin-right: 2px;
  flex-shrink: 0;
}

.dev-batch-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dev-win-id-cell {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.dev-copy-id-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 54px;
  padding: 2px 4px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  white-space: nowrap;
}
.dev-copy-id-btn:hover {
  border-color: #60a5fa;
  color: #bfdbfe;
}

.dev-today-sw-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
  max-width: 100%;
}
.dev-today-sw-cell:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}
.dev-today-nums {
  font-weight: 600;
  flex-shrink: 0;
}
.dev-sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(100, 116, 139, 0.32);
  font-size: 10.5px;
  line-height: 1.3;
  flex-shrink: 0;
}
.dev-sw-badge.is-empty {
  opacity: 0.55;
  border-color: rgba(71, 85, 105, 0.22);
}
.dev-sw-badge .sw-dot {
  color: #64748b;
  margin: 0 1px;
}
.sw-val.is-rest {
  color: #38bdf8;
  font-weight: 600;
}
.sw-val.is-work {
  color: #34d399;
  font-weight: 600;
}
.sw-val.is-warn {
  color: #fbbf24;
  font-weight: 700;
}
.sw-val.is-danger {
  color: #f87171;
  font-weight: 700;
}
.sw-val.is-muted {
  color: #64748b;
}

.dev-group-select {
  padding: 2px 2px !important;
  font-size: 11.5px !important;
  width: 50px;
  min-width: 0;
  max-width: 50px;
}

.dev-par-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dev-par-quick-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.65);
}

.dev-par-qbtn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  border-right: 1px solid rgba(51, 65, 85, 0.65);
}
.dev-par-qbtn:last-child {
  border-right: none;
}
.dev-par-qbtn:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.16);
}
.dev-par-qbtn.active {
  background: #2563eb;
  color: #ffffff;
}

.no-spin-input::-webkit-outer-spin-button,
.no-spin-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spin-input {
  -moz-appearance: textfield;
}

.dev-par-input {
  width: 26px !important;
  padding: 2px 2px !important;
  font-size: 11.5px !important;
  text-align: center;
  font-family: Consolas, Monaco, monospace;
}

.dev-par-cfg-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.dev-interval-input {
  width: 32px !important;
  padding: 2px 2px !important;
  font-size: 11.5px !important;
  text-align: center;
  font-family: Consolas, Monaco, monospace;
  flex-shrink: 0;
}

.dev-inflight-pill {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: Consolas, Monaco, monospace;
  background: rgba(71, 85, 105, 0.25);
  color: #94a3b8;
  border: 1px solid rgba(71, 85, 105, 0.45);
}
.dev-inflight-pill.is-busy {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.42);
}
.dev-inflight-pill.is-burst {
  background: rgba(234, 88, 12, 0.24);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.6);
  font-weight: 700;
}

.dev-autoresume-chip {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.dev-autoresume-chip.is-auto {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
.dev-autoresume-chip.is-manual {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.dev-incident-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.dev-incident-cell {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 118px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.dev-incident-cell:hover {
  border-color: #60a5fa;
  background: rgba(30, 41, 59, 0.85);
}
.dev-incident-cell .inc-line {
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dev-incident-cell .inc-sep {
  color: #64748b;
  font-size: 11px;
}
.dev-incident-cell .inc-line.is-zero {
  color: #94a3b8;
}
.dev-incident-cell .inc-line.has-hist {
  color: #cbd5e1;
}
.dev-incident-cell .inc-line.has-slider {
  color: #facc15;
}
.dev-incident-cell .inc-line.has-risk {
  color: #f87171;
}
.dev-incident-cell .inc-ico {
  display: inline-block;
  font-style: normal;
  line-height: 1;
  margin-right: 1px;
}
.dev-incident-cell .inc-ico.is-gray {
  filter: grayscale(100%) opacity(0.42);
}
.dev-incident-cell .inc-sub {
  color: #94a3b8;
  font-size: 10.5px;
}

.dev-risk-sleep-select {
  padding: 2px 2px !important;
  font-size: 11px !important;
  width: 56px;
  border-radius: 5px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid rgba(148, 163, 184, 0.38) !important;
  color: #cbd5e1 !important;
  flex-shrink: 0;
  cursor: pointer;
}
.dev-risk-sleep-select.has-active-risk {
  background: #ffffff !important;
  border: 1px solid #ef4444 !important;
  color: #dc2626 !important;
  font-weight: 700 !important;
}
.dev-risk-sleep-select option {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 500;
}
.dev-risk-sleep-select option[value="unfreeze"] {
  color: #dc2626 !important;
  font-weight: 700;
}
.dev-risk-sleep-select option:disabled {
  color: #94a3b8 !important;
}

/* Compact Live Monitor Table (#tab-overview) — Zero Horizontal Scrollbar */
#ovLiveTableWrap {
  overflow: visible;
  overflow-x: clip;
}
#ovLiveTableWrap table.nowrap-table {
  width: 100%;
  table-layout: fixed;
}
#ovLiveTableWrap table.nowrap-table th,
#ovLiveTableWrap table.nowrap-table td {
  padding: 6px 5px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#ovLiveTableWrap table.nowrap-table th.chk-col,
#ovLiveTableWrap table.nowrap-table td.chk-col {
  width: 28px;
  padding: 6px 2px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(2),
#ovLiveTableWrap table.nowrap-table td:nth-child(2) {
  width: 106px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(3),
#ovLiveTableWrap table.nowrap-table td:nth-child(3) {
  width: 168px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(4),
#ovLiveTableWrap table.nowrap-table td:nth-child(4) {
  width: 130px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(5),
#ovLiveTableWrap table.nowrap-table td:nth-child(5) {
  width: 118px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(6),
#ovLiveTableWrap table.nowrap-table td:nth-child(6) {
  width: 60px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(7),
#ovLiveTableWrap table.nowrap-table td:nth-child(7) {
  width: 150px;
}
#ovLiveTableWrap table.nowrap-table th:nth-child(9),
#ovLiveTableWrap table.nowrap-table td:nth-child(9) {
  width: 148px;
  overflow: visible;
}

/* Unified 10-Column Aligned Layout for History (#tab-history) & Incidents (#tab-incidents) — Zero Horizontal Scrollbar */
#tab-history .table-wrap,
#tab-incidents .table-wrap {
  overflow: visible;
  overflow-x: clip;
}
#tab-history .table-wrap table.nowrap-table,
#tab-incidents .table-wrap table.nowrap-table {
  width: 100%;
  table-layout: fixed;
}
#tab-history .table-wrap table.nowrap-table thead th,
#tab-incidents .table-wrap table.nowrap-table thead th {
  position: sticky;
  top: var(--topbar-sticky-offset, 49px);
  z-index: 25;
  background: #131c31;
  box-shadow: inset 0 -1px 0 rgba(71, 85, 105, 0.9), 0 3px 8px rgba(2, 6, 23, 0.42);
}
.th-trace-chk {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.th-trace-chk:hover {
  border-color: rgba(96, 165, 250, 0.75);
  color: #f8fafc;
}
.th-trace-chk input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #3b82f6;
  cursor: pointer;
}
.th-trace-chk.is-active {
  border-color: rgba(59, 130, 246, 0.85);
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}
#tab-history .table-wrap table.nowrap-table th,
#tab-history .table-wrap table.nowrap-table td,
#tab-incidents .table-wrap table.nowrap-table th,
#tab-incidents .table-wrap table.nowrap-table td {
  padding: 6px 5px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#tab-history .table-wrap table.nowrap-table th.chk-col,
#tab-history .table-wrap table.nowrap-table td.chk-col,
#tab-incidents .table-wrap table.nowrap-table th.chk-col,
#tab-incidents .table-wrap table.nowrap-table td.chk-col {
  width: 28px;
  padding: 6px 2px;
}
/* Col 2: 日期 / 时间 */
#tab-history .table-wrap table.nowrap-table th:nth-child(2),
#tab-history .table-wrap table.nowrap-table td:nth-child(2),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(2),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(2) {
  width: 102px;
  padding-left: 3px;
  padding-right: 3px;
}
/* Col 3: 终端 / 窗口 */
#tab-history .table-wrap table.nowrap-table th:nth-child(3),
#tab-history .table-wrap table.nowrap-table td:nth-child(3),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(3),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(3) {
  width: 216px;
}
/* Col 4: 版本 (底包 / JS) */
#tab-history .table-wrap table.nowrap-table th:nth-child(4),
#tab-history .table-wrap table.nowrap-table td:nth-child(4),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(4),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(4) {
  width: 96px;
}
/* Col 5: 分组 */
#tab-history .table-wrap table.nowrap-table th:nth-child(5),
#tab-history .table-wrap table.nowrap-table td:nth-child(5),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(5),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(5) {
  width: 50px;
}
/* Col 6: 聚星任务源 / 事件类型 */
#tab-history .table-wrap table.nowrap-table th:nth-child(6),
#tab-history .table-wrap table.nowrap-table td:nth-child(6),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(6),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(6) {
  width: 120px;
}
/* Col 7: DealID / 同类间隔 */
#tab-history .table-wrap table.nowrap-table th:nth-child(7),
#tab-history .table-wrap table.nowrap-table td:nth-child(7),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(7),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(7) {
  width: 74px;
}
/* Col 8 + Col 9: total width locked at 268px across both tables so Col 1..7 & Col 10..11 stay 100% aligned */
/* History: Col 8 商品 (168px) + Col 9 状态 (100px) = 268px */
#tab-history .table-wrap table.nowrap-table th:nth-child(8),
#tab-history .table-wrap table.nowrap-table td:nth-child(8) {
  width: 168px;
}
#tab-history .table-wrap table.nowrap-table th:nth-child(9),
#tab-history .table-wrap table.nowrap-table td:nth-child(9) {
  width: 100px;
}
/* Incidents: Col 8 关联任务 (78px) + Col 9 状态 (190px) = 268px */
#tab-incidents .table-wrap table.nowrap-table th:nth-child(8),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(8) {
  width: 78px;
}
#tab-incidents .table-wrap table.nowrap-table th:nth-child(9),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(9) {
  width: 190px;
}
/* Col 10: 耗时 / S·W节奏 & 触发时 S·W节奏 */
#tab-history .table-wrap table.nowrap-table th:nth-child(10),
#tab-history .table-wrap table.nowrap-table td:nth-child(10),
#tab-incidents .table-wrap table.nowrap-table th:nth-child(10),
#tab-incidents .table-wrap table.nowrap-table td:nth-child(10) {
  width: 210px;
}
.hist-item-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.hist-item-wrap .inc-task-compact {
  flex: 1 1 auto;
  min-width: 0;
}
.inc-task-compact {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.sc-dl-domain-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.sc-dl-domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
}
.sc-dl-domain-row.is-current {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(37, 99, 235, 0.12);
}
.sc-dl-domain-info {
  min-width: 0;
  flex: 1 1 auto;
}
.sc-dl-domain-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sc-dl-domain-url {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-dl-domain-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.incident-modal-card {
  max-width: 820px;
  width: 95%;
}
.inc-summary-bar {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.inc-sum-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ---------------- 6-Category Intercept Lists (🛡️ 拦截名单) ---------------- */
.bl-global-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 13px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9px;
}

.bl-global-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bl-global-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

.bl-delay-inputs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bl-delay-num {
  width: 68px !important;
  padding: 3px 7px !important;
  font-size: 12.5px !important;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.bl-delay-unit {
  font-size: 12px;
  color: #cbd5e1;
}

.bl-global-hint {
  font-size: 11.5px;
  white-space: normal;
}

.bl-add-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 10px;
}

.bl-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.bl-add-title {
  font-size: 13px;
  font-weight: 600;
  color: #38bdf8;
  white-space: nowrap;
}

.bl-add-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  flex: 1;
}

.bl-add-opt-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bl-add-opt-item label {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

.bl-add-opt-item select,
.bl-add-opt-item input[type="text"] {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
}

.bl-add-opt-note input[type="text"] {
  width: 210px;
}

.bl-add-overwrite {
  font-size: 12px;
  white-space: nowrap;
}

.bl-add-textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
}

.bl-add-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.bl-add-foot .hint-tip {
  white-space: normal;
  font-size: 11.5px;
}

.bl-threshold-ctrl,
.bl-scope-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
}

.bl-threshold-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin: 0;
}

.bl-threshold-ctrl.is-off .bl-threshold-label {
  color: #94a3b8;
  opacity: 0.78;
}

.bl-threshold-input {
  width: 30px !important;
  padding: 2px 2px !important;
  font-size: 11.5px !important;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bl-threshold-input::-webkit-outer-spin-button,
.bl-threshold-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bl-scope-select {
  padding: 2px 4px !important;
  font-size: 11.5px !important;
  min-width: 54px;
}

.bl-autoadd-ctrl,
.bl-enable-ctrl {
  white-space: nowrap;
  gap: 4px;
  font-size: 11.5px;
}

.bl-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 10px;
}

.bl-cat-card {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bl-cat-card:hover {
  background: rgba(30, 41, 59, 0.68);
}

.bl-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bl-cat-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bl-cat-icon {
  font-size: 15px;
}

.bl-cat-name {
  font-size: 13.5px;
  color: #f8fafc;
}

.bl-cat-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.bl-cat-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  padding: 6px 8px;
}

.bl-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bl-stat-num {
  font-size: 15px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #f8fafc;
}

.bl-stat-lbl {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.bl-cat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
  font-size: 11.5px;
}

/* Compact 10-Column Intercept List Table (#tab-blacklist) — Zero Horizontal Scrollbar */
#tab-blacklist .table-wrap {
  overflow: visible;
  overflow-x: clip;
}
#tab-blacklist .table-wrap table.nowrap-table {
  width: 100%;
  table-layout: fixed;
}
#tab-blacklist .table-wrap table.nowrap-table th,
#tab-blacklist .table-wrap table.nowrap-table td {
  padding: 6px 5px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#tab-blacklist .table-wrap table.nowrap-table th.chk-col,
#tab-blacklist .table-wrap table.nowrap-table td.chk-col {
  width: 28px;
  padding: 6px 2px;
}
/* Col 2: 加入时间 / 最近命中 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(2),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(2) {
  width: 132px;
}
/* Col 3: 所属名单 / 结算 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(3),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(3) {
  width: 120px;
}
/* Col 4: 粒度 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(4),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(4) {
  width: 82px;
}
/* Col 5: 店铺 / 商品 ID */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(5),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(5) {
  width: 215px;
}
/* Col 6: 回传聚星代码 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(6),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(6) {
  width: 136px;
}
/* Col 7: 今日 / 累计拦截 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(7),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(7) {
  width: 132px;
}
/* Col 8: 来源终端 / 子账号 */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(8),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(8) {
  width: 182px;
}
/* Col 10: 操作 (移除按钮固定不越界) */
#tab-blacklist .table-wrap table.nowrap-table th:nth-child(10),
#tab-blacklist .table-wrap table.nowrap-table td:nth-child(10) {
  width: 64px;
  text-align: center;
  overflow: visible;
}

/* ---------------- Strategy Center (Inline Expandable Accordion) ---------------- */
.strat-acc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.strat-sync-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(71, 85, 105, 0.55);
  margin-right: 4px;
}

.strat-sync-lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.strat-acc-item {
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.strat-acc-item:hover {
  border-color: rgba(96, 165, 250, 0.5);
}

.strat-acc-item.is-default {
  border-left: 3px solid #10b981;
}

.strat-acc-item.is-expanded {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
}

.strat-acc-summary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
}

.strat-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

@media (max-width: 1180px) {
  .strat-acc-head {
    flex-wrap: wrap;
  }
}

.strat-acc-summary:hover {
  background: rgba(30, 41, 59, 0.52);
}

.strat-acc-item.is-expanded .strat-acc-summary {
  background: rgba(37, 99, 235, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.32);
}

.strat-acc-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  flex: 1;
}

.strat-acc-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.strat-acc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(51, 65, 85, 0.6);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.strat-acc-item.is-expanded .strat-acc-arrow {
  background: #2563eb;
  color: #ffffff;
}

.strat-acc-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}

.strat-acc-note {
  font-size: 11.5px;
  color: #94a3b8;
  padding-left: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strat-acc-metrics {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: 26px;
}

.strat-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.52);
  border: 1px solid rgba(71, 85, 105, 0.55);
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
}

.strat-acc-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.strat-inline-switches {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
}

.strat-inline-countries {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.strat-inline-ctry-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  flex-shrink: 0;
}

.strat-inline-countries .ctry-multi-picker {
  gap: 4px !important;
}

.strat-inline-countries .ctry-pill {
  padding: 2px 7px;
  font-size: 11.5px;
}

.strat-acc-body {
  padding: 15px 16px 16px;
  background: rgba(2, 6, 23, 0.42);
}

.strat-module-panel {
  width: 100%;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px 16px;
}

.strat-subsec-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}

.strat-acc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.strat-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px 13px;
}

.strat-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px 13px;
}

.strat-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 13px;
}

.strat-col-span-2 {
  grid-column: span 2;
}

.strat-col-span-3 {
  grid-column: span 3;
}

.strat-col-span-4 {
  grid-column: span 4;
}

@media (max-width: 900px) {
  .strat-grid-4,
  .strat-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .strat-col-span-3,
  .strat-col-span-4 {
    grid-column: span 2;
  }
}

.strat-switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 7px;
  padding: 7px 11px;
  min-height: 36px;
}

.strat-switch-box.is-highlight {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.16);
}

/* ---------------- Unified Dark Glassmorphism Confirm / Prompt Modal ---------------- */
.ui-dialog-backdrop {
  z-index: 260;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ui-dialog-card {
  max-width: 460px;
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  padding: 20px 22px 18px;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.65);
}

.ui-dialog-card.is-danger {
  border-color: rgba(248, 113, 113, 0.42);
}

.ui-dialog-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.ui-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 14px;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
}

.ui-dialog-card.is-danger .ui-dialog-icon {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.ui-dialog-title {
  margin-bottom: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: #f8fafc;
}

.ui-dialog-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.75);
  border-radius: 8px;
  padding: 11px 13px;
  max-height: min(55vh, 360px);
  overflow-y: auto;
  cursor: pointer;
}

.ui-dialog-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
}

.ui-dialog-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.ui-dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ---------------- Full-Width Narrow Runtime Status Strip (Position A) ---------------- */
#tab-overview > .grid-cards {
  margin-bottom: 10px;
}

.runtime-strip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 5px 12px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.88) 100%);
  border: 1px solid rgba(51, 65, 85, 0.85);
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
  overflow-x: auto;
  scrollbar-width: none;
}

.runtime-strip-bar::-webkit-scrollbar {
  display: none;
}

.runtime-strip-bar.is-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(90deg, rgba(69, 26, 3, 0.35) 0%, rgba(30, 41, 59, 0.9) 100%);
}

.runtime-strip-bar.is-danger {
  border-color: rgba(248, 113, 113, 0.65);
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.35) 0%, rgba(30, 41, 59, 0.9) 100%);
}

.rt-strip-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.rt-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.42);
  flex-shrink: 0;
}

.rt-ico {
  font-size: 12px;
  line-height: 1;
  user-select: none;
  opacity: 0.92;
}

.rt-mode-pill.is-warn {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.rt-mode-pill.is-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}

.rt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
  display: inline-block;
  flex-shrink: 0;
}

.rt-mode-pill.is-warn .rt-dot {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.85);
}

.rt-mode-pill.is-danger .rt-dot {
  background: #f87171;
  box-shadow: 0 0 7px rgba(248, 113, 113, 0.9);
}

.rt-sep {
  color: rgba(71, 85, 105, 0.85);
  font-size: 11px;
  user-select: none;
  flex-shrink: 0;
}

.rt-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rt-lbl {
  color: #94a3b8;
  font-size: 11.5px;
}

.rt-item strong {
  color: #f1f5f9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rt-item strong.rt-val-ok {
  color: #e2e8f0;
}

.rt-item strong.rt-val-warn {
  color: #fbbf24;
}

.rt-item strong.rt-val-danger {
  color: #f87171;
}

.rt-sub {
  color: #94a3b8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rt-strip-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.rt-btn {
  appearance: none;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(71, 85, 105, 0.78);
  color: #cbd5e1;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.rt-btn:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #fff;
  background: rgba(30, 58, 138, 0.38);
}

.rt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rt-btn.is-on {
  background: rgba(6, 78, 59, 0.42);
  border-color: rgba(52, 211, 153, 0.52);
  color: #6ee7b7;
}

.rt-btn.is-on:hover:not(:disabled) {
  background: rgba(6, 95, 70, 0.62);
  border-color: #34d399;
  color: #a7f3d0;
}

.rt-btn.rt-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  font-size: 12.5px;
  border-radius: 6px;
}

.rt-btn.is-dirty {
  border-color: rgba(56, 189, 248, 0.65);
  color: #7dd3fc;
}

.rt-btn.is-dirty::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.9);
}





