/* ==========================================================================
   Telegram Userbot Dashboard - Modern Dark Glassmorphic Design System
   ========================================================================== */

:root {
  --bg-dark: #070a12;
  --bg-card: rgba(18, 24, 43, 0.75);
  --bg-card-hover: rgba(24, 33, 58, 0.85);
  --bg-input: rgba(11, 15, 28, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #0ea5e9;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-telegram: #0088cc;
  --accent-cyan: #0ea5e9;
  --accent-cyan-glow: rgba(14, 165, 233, 0.25);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-ruby: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  padding: 24px;
}

/* Ambient glow backgrounds */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, var(--accent-cyan), transparent);
}
.glow-2 {
  width: 600px;
  height: 600px;
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, var(--accent-purple), transparent);
}
.glow-3 {
  width: 450px;
  height: 450px;
  bottom: -50px;
  left: 20%;
  background: radial-gradient(circle, var(--accent-emerald), transparent);
  opacity: 0.2;
}

/* Dashboard Shell */
.dashboard-container {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(14, 20, 36, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-shrink: 0;
}

.header-title-group {
  min-width: 0;
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0088cc, #00c6ff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-cyan-glow);
}
.telegram-icon {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
}

.header-title-group h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.version-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.header-right .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* User Account Pill */
.account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  white-space: nowrap;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.user-details {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.user-handle {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Bot Status Pill */
.bot-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}
.bot-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.bot-status-pill.running {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.bot-status-pill.running .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreen 2s infinite;
}
.bot-status-pill.stopped {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.bot-status-pill.stopped .status-dot {
  background: #ef4444;
}

@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-xs {
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}
.btn-large {
  padding: 13px 28px;
  font-size: 0.98rem;
}
.refresh-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.6s ease;
}
.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Visual Route Banner
   ========================================================================== */
.route-visualizer-card {
  background: linear-gradient(135deg, rgba(17, 24, 43, 0.9), rgba(12, 17, 31, 0.9));
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}
.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
}
.route-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.pipeline-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr;
  align-items: center;
  gap: 16px;
}

.pipeline-node {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.pipeline-node:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.node-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.node-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.node-role {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.node-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.target-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.topic-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Connectors */
.flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100px;
}
.flow-line {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}
.flow-pulse {
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: flowGlow 2s infinite linear;
}
@keyframes flowGlow {
  0% { left: -50%; }
  100% { left: 100%; }
}
.flow-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ==========================================================================
   Config Grid & Cards
   ========================================================================== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.channel-card, .target-card {
  grid-column: span 1;
}
.ai-card, .actions-card {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.card-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.header-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.header-icon-box.cyan {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.header-icon-box.purple {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.header-icon-box.emerald {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.badge-topics {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.input-with-icon {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.input-with-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s ease;
}
.input-with-icon:focus-within svg {
  color: var(--accent-cyan);
}
.input-with-icon input[type="text"],
.input-with-icon input {
  width: 100%;
  padding: 11px 16px 11px 44px !important;
}

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

/* Custom listbox */
.custom-select-list {
  height: 190px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  padding: 6px;
}
.custom-select-list option {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
.custom-select-list option:checked {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.35), rgba(14, 165, 233, 0.15)) !important;
  color: #38bdf8;
  font-weight: 600;
}
.custom-select-list option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.selection-footer-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}
.selection-footer-pill span {
  color: var(--text-muted);
}
.selection-footer-pill strong {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* ---------------------------------------------------------------------------
   Automation Pipeline Action Selector & Source Picker Overhaul
   --------------------------------------------------------------------------- */

/* Pipeline Mode Segmented Switcher */
.mode-segment-group {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.mode-segment-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  font-family: inherit;
}

.mode-segment-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.mode-segment-btn.active[data-action="tradelocker"] {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  font-weight: 600;
}

.mode-segment-btn.active[data-action="both"] {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.4);
  font-weight: 600;
}

.mode-segment-btn.active[data-action="forward"] {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.4);
  font-weight: 600;
}

/* Source Picker Card List (Replaces clunky <select size="4">) */
.source-picker-list {
  max-height: 185px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.source-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.source-picker-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.source-picker-card.selected {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.05));
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.12);
}

.source-picker-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.source-picker-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.source-picker-card.is-group .source-picker-icon {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.source-picker-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

.source-picker-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-picker-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.source-picker-meta .forum-badge {
  color: #38bdf8;
  font-family: inherit;
  font-weight: 500;
}

.source-picker-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.source-picker-card.selected .source-picker-radio {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
}

.source-picker-card.selected .source-picker-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f172a;
}

/* Route Action Badges on Dashboard Cards */
.badge-action-tl {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
}

.badge-action-forward {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  display: inline-flex;
  align-items: center;
}

.badge-action-both {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: inline-flex;
  align-items: center;
}

/* Source Type Selector & Group Filters */
.source-type-pill-group {
  display: inline-flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-source-tab {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-source-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-source-tab.active {
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.group-filters-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-filter-col {
  flex: 1;
  min-width: 200px;
}

.group-filter-col label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-filter-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  transition: border-color var(--transition-fast);
}

.group-filter-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.manual-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.manual-user-row input {
  max-width: 150px;
  padding: 4px 8px;
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: #fff;
  font-family: var(--font-mono);
}

/* Advanced Override Drawer */
.advanced-override {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
}
.advanced-override summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}
.advanced-override summary:hover {
  color: var(--text-main);
}
.override-inputs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.override-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.helper-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* AI Mode Toggle Tabs */
.ai-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.mode-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.mode-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(14, 165, 233, 0.08));
  border-color: var(--accent-emerald);
  box-shadow: 0 4px 20px var(--accent-emerald-glow);
}
.mode-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.mode-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}
.mode-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ollama-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Actions Card */
.actions-card {
  padding: 20px 24px;
}
.actions-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.checkbox-container input {
  display: none;
}
.checkmark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.checkbox-container input:checked ~ .checkmark {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.checkbox-container input:checked ~ .checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
.checkbox-label {
  display: flex;
  flex-direction: column;
}
.checkbox-label strong {
  font-size: 0.9rem;
}
.checkbox-label small {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Global Ollama AI Settings Card (Always Expanded)
   ========================================================================== */
.ollama-settings-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.ollama-settings-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.ollama-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.ollama-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ollama-icon {
  font-size: 1.3rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ollama-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.ollama-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
}

.ollama-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ==========================================================================
   Terminal Card
   ========================================================================== */
.terminal-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid var(--border-subtle);
}
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(18, 24, 43, 0.6);
  border-bottom: 1px solid var(--border-subtle);
}
.terminal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 10px;
}
.terminal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auto-scroll-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
}

.terminal-body {
  height: 220px;
  overflow-y: auto;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: #070a13;
  color: #cbd5e1;
}
.log-line {
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line.text-muted { color: #64748b; }
.log-line.log-info { color: #38bdf8; }
.log-line.log-warning { color: #fbbf24; }
.log-line.log-error { color: #f87171; }

/* ==========================================================================
   Telegram Forum Topics Architecture for Live Execution Logs
   ========================================================================== */
.terminal-subtitle-badge {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.terminal-topics-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(13, 18, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.terminal-topics-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}
.terminal-topics-scroll::-webkit-scrollbar {
  display: none;
}

.terminal-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
}

.terminal-topic-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.terminal-topic-pill.active {
  background: #2ea6ff;
  color: #ffffff;
  border-color: #2ea6ff;
  box-shadow: 0 0 14px rgba(46, 166, 255, 0.4);
}

.terminal-topic-pill.active .topic-count {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

.terminal-topic-pill .topic-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.terminal-topic-pill .topic-count {
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  transition: all 0.18s ease;
}

.terminal-topic-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
}

.dynamic-topic-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Specific Topic Accents */
.terminal-topic-pill[data-topic-type="primary"] {
  border-color: rgba(139, 92, 246, 0.3);
}
.terminal-topic-pill[data-topic-type="primary"].active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
}

.terminal-topic-pill[data-topic-type="emerald"] {
  border-color: rgba(16, 185, 129, 0.3);
}
.terminal-topic-pill[data-topic-type="emerald"].active {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.terminal-topic-pill[data-topic-type="cyan"] {
  border-color: rgba(6, 182, 212, 0.3);
}
.terminal-topic-pill[data-topic-type="cyan"].active {
  background: #06b6d4;
  border-color: #06b6d4;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

.terminal-topic-pill[data-topic-type="amber"] {
  border-color: rgba(245, 158, 11, 0.3);
}
.terminal-topic-pill[data-topic-type="amber"].active {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.terminal-topic-pill[data-topic-type="red"] {
  border-color: rgba(239, 68, 68, 0.3);
}
.terminal-topic-pill[data-topic-type="red"].active {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

/* Quick Search Box */
.terminal-topic-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 3px 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.terminal-topic-search:focus-within {
  border-color: #2ea6ff;
  box-shadow: 0 0 8px rgba(46, 166, 255, 0.35);
  background: rgba(0, 0, 0, 0.65);
}
.terminal-topic-search svg {
  color: #64748b;
  flex-shrink: 0;
}
.terminal-topic-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 0.74rem;
  width: 105px;
  transition: width 0.2s ease;
}
.terminal-topic-search input:focus {
  width: 145px;
}
.terminal-topic-search input::placeholder {
  color: #64748b;
}
.terminal-search-clear-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0 2px;
  line-height: 1;
}
.terminal-search-clear-btn:hover {
  color: #f1f5f9;
}

/* Active Topic Banner */
.terminal-topic-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(46, 166, 255, 0.12), rgba(15, 23, 42, 0.6));
  border-bottom: 1px solid rgba(46, 166, 255, 0.2);
  margin-bottom: 6px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.topic-active-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topic-active-tag {
  font-weight: 700;
  font-size: 0.78rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}
.topic-active-desc {
  font-size: 0.74rem;
  color: #94a3b8;
}
.btn-topic-reset {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-topic-reset:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Telegram Inline Topic Badges inside Log Lines */
.tl-log-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 6px;
  margin: 1px 0;
  transition: background 0.15s ease;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.5;
}
.tl-log-entry:hover {
  background: rgba(255, 255, 255, 0.035);
}

.tl-log-time {
  color: #475569;
  font-size: 0.72rem;
  flex-shrink: 0;
  user-select: none;
}

.tl-log-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.tl-log-badge:hover {
  filter: brightness(1.25);
  transform: translateY(-0.5px);
}

.tl-log-badge.tag-primary {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.tl-log-badge.tag-emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.tl-log-badge.tag-cyan {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}
.tl-log-badge.tag-copier {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.tl-log-badge.tag-studio {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.tl-log-badge.tag-system {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.tl-log-badge.tag-red {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.tl-log-level {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tl-log-level.lvl-info { color: #38bdf8; }
.tl-log-level.lvl-warn { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.tl-log-level.lvl-err { color: #f87171; background: rgba(248, 113, 113, 0.15); font-weight: 800; }

.tl-log-msg {
  flex: 1;
  word-break: break-word;
  color: #cbd5e1;
}
.tl-log-msg mark {
  background: rgba(46, 166, 255, 0.3);
  color: #ffffff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: rgba(18, 24, 43, 0.95);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s;
}
.toast.success {
  border-color: var(--accent-emerald);
}
.toast.error {
  border-color: var(--accent-ruby);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
  .pipeline-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .flow-connector {
    width: 100%;
    height: 30px;
  }
  .flow-line {
    width: 3px;
    height: 100%;
  }
  .config-grid {
    grid-template-columns: 1fr;
  }
  .channel-card, .target-card, .ai-card, .actions-card {
    grid-column: span 1;
  }
  .ai-mode-toggle {
    grid-template-columns: 1fr;
  }
  .ollama-settings {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Auth / Onboarding Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.25s ease;
  overscroll-behavior: contain;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: rgba(18, 24, 43, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-close,
.btn-close-modal {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.btn-close-modal:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-telegram), #00c6ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 8px 20px var(--accent-cyan-glow);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-step {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.help-box {
  display: flex;
  gap: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.help-box-title {
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.help-box-list {
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-box-list li {
  line-height: 1.45;
  color: #cbd5e1;
}

.help-box-list strong {
  color: #38bdf8;
  font-weight: 600;
}

.help-box-text a {
  color: #38bdf8;
  text-decoration: underline;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions.split {
  justify-content: space-between;
}

.btn-full {
  width: 100%;
}

.input-code {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-weight: 700;
  color: #38bdf8;
}

.code-sent-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #34d399;
}

/* ---------------------------------------------------------------------------
   Multi-Route Pipelines UI
--------------------------------------------------------------------------- */

.routes-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-header-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.routes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.route-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.route-card.paused {
  opacity: 0.65;
  filter: grayscale(0.4);
}

.route-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.route-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.route-status-indicator.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.route-status-indicator.paused {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.route-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.route-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.route-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-route-delete {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-route-delete:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.route-flow-layout {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.route-source-item {
  flex: 0 0 240px;
  max-width: 260px;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.route-source-icon {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-source-icon.is-group {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.route-source-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.route-node-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.route-source-info h5 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.route-source-info code {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.route-source-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.route-source-filter-pill {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.route-source-filter-pill.user-pill {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}

/* Animated Route Pipeline Flow Connector */
.route-flow-pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.route-pulse-track {
  width: 44px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.route-flow-pipeline.live .route-pulse-glow {
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: flowGlow 1.8s infinite linear;
}

.route-flow-pipeline.paused .route-pulse-track {
  background: rgba(255, 255, 255, 0.04);
}

.route-flow-pipeline.paused .route-pulse-glow {
  display: none;
}

.route-trans-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: var(--transition);
}

.route-flow-pipeline.live .route-trans-node {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.route-flow-pipeline.paused .route-trans-node {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.6;
}

.route-trans-icon {
  font-size: 1rem;
}

.route-trans-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.route-trans-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.route-flow-pipeline.paused .route-trans-title {
  color: var(--text-dim);
}

.route-trans-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Route Destinations Container & Cards */
.route-targets-container {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.route-targets-container.single-target {
  grid-template-columns: minmax(0, 1fr);
  max-width: 360px;
}

.target-badge-card {
  min-width: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  overflow: hidden;
}

.target-badge-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

.target-badge-icon {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.target-badge-card.target-tl-badge {
  border-color: rgba(56, 211, 159, 0.2);
  background: rgba(15, 23, 42, 0.6);
}

.target-badge-card.target-tl-badge:hover {
  border-color: rgba(56, 211, 159, 0.4);
}

.target-badge-card.target-tl-badge .target-badge-icon {
  background: rgba(56, 211, 159, 0.1);
  border-color: rgba(56, 211, 159, 0.25);
  color: #38d39f;
}

.target-badge-card.target-ch-badge .target-badge-icon {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
}

.target-badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.target-badge-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.target-badge-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}

.target-topic-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  flex-shrink: 0;
}

.target-topic-pill.channel-pill {
  background: rgba(14, 165, 233, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.target-id-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.empty-routes-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-routes-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-routes-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-routes-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Modal for Route Builder */
.route-modal-card {
  max-width: 680px;
  width: 95%;
  height: 82vh;
  max-height: 780px;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.route-modal-card .modal-body {
  padding: 18px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.route-modal-card.mode-tradelocker .source-picker-list {
  max-height: 380px;
  flex: 1;
}

.route-modal-card .modal-actions {
  padding: 16px 28px 20px;
  background: rgba(18, 24, 43, 0.98);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.targets-unified-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.targets-list-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-builder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 2px 0;
  animation: fadeIn 0.2s ease;
}

.target-builder-row + .target-builder-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 10px;
}

.target-builder-row .group-select-wrap {
  flex: 3;
}

.target-builder-row .topic-select-wrap {
  flex: 2;
}

.btn-remove-target {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-remove-target:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-add-target-inside {
  width: 100%;
  padding: 10px;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.04);
  color: var(--accent-cyan);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  margin-top: 2px;
}

.btn-add-target-inside:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   TradeLocker Visual Components & Sign-In Modal
   ========================================================================== */

/* Header Status Pill */
.tradelocker-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}
.tradelocker-pill:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}
.tl-icon {
  font-size: 1.1rem;
}
.tl-details {
  display: flex;
  flex-direction: column;
}
.tl-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}
.tl-subtext {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  line-height: 1.2;
}

/* TradeLocker Main Card */
.tradelocker-card {
  padding: 22px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: rgba(14, 25, 45, 0.65);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}
.tradelocker-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}
.tradelocker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.tradelocker-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-icon-emoji {
  font-size: 1.8rem;
}
.card-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.badge-status-mode {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-status-mode.live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Stats Grid */
.tradelocker-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat-mini-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recent Trades List */
.tradelocker-trades-summary {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.trades-list-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.trade-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}
.empty-trades-notice {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
  padding: 14px;
}

/* TradeLocker Modal Tabs */
.tl-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-top: 6px;
}
.tl-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.tl-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}
.tl-tab.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Quick Select Server Chips */
.quick-servers-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.quick-servers-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.btn-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.btn-chip:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

/* Settings Subcard */
.tl-settings-subcard {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

/* Signal Studio Modal & Builder Styles */
/* ==========================================================================
   TradeLocker Terminal & Signal Studio (Exact TradeLocker Theme)
   ========================================================================== */

.tl-modal-card {
  width: min(940px, calc(100vw - 32px));
  max-width: 940px;
  height: min(720px, calc(100vh - 40px));
  max-height: 720px;
  background: #0b0e14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 12px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  color: #e2e6f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Modal Topbar */
.tl-modal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #0e121a;
  border-bottom: 1px solid #1e2535;
}
.tl-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl-logo-svg {
  color: #3898ec;
  width: 18px;
  height: 18px;
}
.tl-topbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.tl-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tl-connection-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  padding: 3px 8px;
  border-radius: 4px;
  background: #141824;
  border: 1px solid #22293a;
  color: #38d39f;
}
.tl-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38d39f;
  box-shadow: 0 0 5px #38d39f;
}
.tl-btn-close {
  background: transparent;
  border: none;
  color: #788298;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.15s ease;
}
.tl-btn-close:hover {
  color: #ffffff;
}

/* 3-Pane Body */
.tl-modal-body {
  display: grid;
  grid-template-columns: 275px 370px 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100% - 48px);
  overflow: hidden;
  background: #0b0e14;
}
@media (max-width: 1200px) {
  .tl-modal-body {
    grid-template-columns: 260px 340px 1fr;
  }
}
@media (max-width: 960px) {
  .tl-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
  .tl-pane-instruments {
    height: 480px !important;
    min-height: 480px !important;
  }
  .tl-pane-order {
    min-height: auto;
  }
  .tl-pane-signal {
    min-height: auto;
  }
}

/* Pane Common */
.tl-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  border-right: 1px solid #1e2535;
  background: #0b0e14;
  position: relative;
}
.tl-pane-signal {
  border-right: none;
}

/* ==========================================================================
   Pane 1: Exact TradeLocker Watchlist Table (Chakra UI)
   ========================================================================== */
.tl-pane-instruments {
  background: #0c1017;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 380px;
}

/* Search Bar Row with integrated Reload Button */
.tl-search-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  background: #0e131d;
  border-bottom: 1px solid #1a2233;
  width: 100%;
  box-sizing: border-box;
}
.tl-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.tl-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #626d84;
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 2;
}
.tl-search-input,
#instrumentSearch {
  width: 100%;
  height: 30px;
  background: #141b29;
  border: 1px solid #232d42;
  border-radius: 5px;
  padding: 0 24px 0 32px !important;
  color: #e2e8f0;
  font-size: 0.76rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.tl-search-input:focus,
#instrumentSearch:focus {
  border-color: #3898ec;
  box-shadow: 0 0 0 1px rgba(56, 152, 236, 0.25);
}
.tl-search-input::placeholder,
#instrumentSearch::placeholder {
  color: #5a667d;
}
.tl-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #788298;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 2;
}
.tl-search-clear:hover {
  color: #e2e8f0;
}
.tl-tab-refresh {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: #141b29;
  border: 1px solid #232d42;
  color: #64748b;
  cursor: pointer;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}
.tl-tab-refresh:hover {
  color: #3898ec;
  border-color: #3898ec;
  background: rgba(56, 152, 236, 0.1);
}

/* Miller Columns Layout (2 Columns: Categories + Instruments) */
.tl-miller-container {
  display: grid;
  grid-template-columns: 118px 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100% - 47px);
  background: #0c1017;
  overflow: hidden;
}
.tl-miller-categories {
  display: flex;
  flex-direction: column;
  background: #090d14;
  border-right: 1px solid #1a2233;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
  padding: 3px 0;
  gap: 1px;
}
.tl-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 7px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: #828ea2;
  font-size: 0.71rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  gap: 2px;
  box-sizing: border-box;
}
.tl-cat-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.03);
}
.tl-cat-btn.active {
  color: #ffffff;
  background: #141c2c;
  border-left-color: #3898ec;
  font-weight: 600;
}
.tl-cat-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}
.tl-cat-badge {
  font-size: 0.61rem;
  font-weight: 600;
  color: #556276;
  background: #0d121c;
  padding: 1px 4px;
  border-radius: 9999px;
  flex-shrink: 0;
}
.tl-cat-btn.active .tl-cat-badge {
  color: #3898ec;
  background: rgba(56, 152, 236, 0.16);
}
.tl-miller-instruments {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #0c1017;
}

/* Scroller & Table */
.css-1idqa7w {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  min-height: 250px !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  background: #0c1017 !important;
}
.css-1dl7j1d {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative !important;
  scrollbar-width: thin !important;
  scrollbar-color: #232d42 transparent !important;
  outline: none !important;
}
.tl-viewport-content {
  width: 100% !important;
  min-width: 100% !important;
  position: relative !important;
  height: auto !important;
  display: block !important;
  overflow-x: hidden !important;
}
.chakra-table.css-vdn1ia {
  width: 100% !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.74rem !important;
  text-align: left !important;
  display: table !important;
}
.chakra-table thead.css-0 {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: #0c1017 !important;
  display: table-header-group !important;
}
.css-rlwsuo th {
  height: 34px;
  padding: 0 8px;
  font-size: 0.67rem;
  font-weight: 600;
  color: #6e7a91;
  text-transform: capitalize;
  border-bottom: 1px solid #1a2233;
  white-space: nowrap;
  user-select: none;
  background: #0c1017;
}
.css-1i9fvj {
  text-align: left;
  width: 100%;
  min-width: 100%;
}
.css-fh2asm {
  text-align: right;
  width: 75px;
  min-width: 75px;
}
.css-8vs3g1 {
  text-align: right;
  width: 52px;
  min-width: 52px;
}
.css-1rx6og2 {
  text-align: right;
  width: 58px;
  min-width: 58px;
}
.css-69lwfi {
  text-align: left;
  width: 130px;
  min-width: 110px;
}
.css-10c40xa {
  width: 8px;
  padding: 0;
}

/* Sticky Left Column (Instruments) */
th[data-style="scroll-gradient-left-sticky-column"].css-1i9fvj,
td[data-style="scroll-gradient-left-sticky-column"].css-10vzpn2 {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #0c1017;
  box-shadow: 2px 0 6px -1px rgba(0, 0, 0, 0.45);
}
tr.css-6bg83d td[data-style="scroll-gradient-left-sticky-column"].css-10vzpn2,
tr[aria-selected="true"] td[data-style="scroll-gradient-left-sticky-column"].css-10vzpn2 {
  background: #1c2844 !important;
}
tr:hover td[data-style="scroll-gradient-left-sticky-column"].css-10vzpn2 {
  background: #121824;
}
tr.css-6bg83d:hover td[data-style="scroll-gradient-left-sticky-column"].css-10vzpn2 {
  background: #1c2844 !important;
}

/* Table Rows & Cells */
.chakra-table tbody tr {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  line-height: 40px;
  cursor: pointer;
  border-bottom: 1px solid #141b29;
  background: #0c1017;
  transition: background 0.1s ease;
}
.chakra-table tbody tr:hover {
  background: #121824;
}
.chakra-table tbody tr.css-6bg83d,
.chakra-table tbody tr[aria-selected="true"] {
  background: #1c2844 !important;
  color: #ffffff;
}
.chakra-table tbody td {
  padding: 0 8px;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 40px;
  height: 40px;
}
.chakra-text.css-1v5r4m {
  color: #38d39f;
  font-family: var(--font-mono, monospace);
  font-weight: 500;
  font-size: 0.74rem;
  text-align: right;
}
.chakra-text.css-a08uv9 {
  color: #ff5b6e;
  font-family: var(--font-mono, monospace);
  font-weight: 500;
  font-size: 0.74rem;
  text-align: right;
}
.chakra-text.css-ldwlkl {
  color: #8e9ab0;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  text-align: right;
}
.css-itpzj0 {
  color: #6e7a91;
  font-size: 0.71rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.css-dmm3bu {
  width: 8px;
  padding: 0;
}

/* Stack and Circular Flag / Coin Badges */
.chakra-stack.css-hy1xfs {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  height: 100%;
}
.chakra-stack.css-1gmx9p9 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chakra-image.css-bg7i6l {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  vertical-align: middle;
  display: inline-block;
  object-fit: cover;
  flex-shrink: 0;
}
.tl-selected-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #0c1017;
  border: 1px solid #1a2233;
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 10px;
  margin-bottom: 2px;
}
.tl-selected-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tl-sm-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-sm-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  font-family: var(--font-mono, monospace);
}
.chakra-text.css-q9nc1s,
.chakra-text.css-bvljye {
  font-weight: 600;
  font-size: 0.75rem;
  color: #e2e8f0;
}
.chakra-table tbody tr.css-6bg83d .chakra-text.css-q9nc1s,
.chakra-table tbody tr.css-6bg83d .chakra-text.css-bvljye {
  color: #ffffff;
}
.tl-loading {
  text-align: center;
  padding: 24px;
  color: #6e788e;
  font-size: 0.76rem;
}

/* ==========================================================================
   Pane 2: TradeLocker Order Cockpit (Screenshots 2, 3, & 4)
   ========================================================================== */
.tl-symbol-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #0e121a;
  border-bottom: 1px solid #1e2535;
}
.tl-sym-left {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tl-sym-flag {
  font-size: 0.95rem;
}
.tl-sym-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
}
.tl-sym-desc {
  font-size: 0.7rem;
  color: #788298;
  margin-left: 4px;
}
.tl-sync-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: #788298;
  cursor: pointer;
  user-select: none;
}
.tl-sync-label input {
  accent-color: #38d39f;
  cursor: pointer;
}
.tl-order-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Market / Pending Switch (Screenshot 2) */
.tl-mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #141824;
  border: 1px solid #1e2535;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.tl-mode-btn {
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #788298;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tl-mode-btn.active {
  background: #252d3d;
  color: #ffffff;
}

/* Stepper Input */
.tl-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-field-lbl {
  font-size: 0.7rem;
  color: #788298;
  font-weight: 500;
}
.tl-stepper-box {
  display: flex;
  align-items: center;
  background: #141824;
  border: 1px solid #1e2535;
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
}
.tl-stepper-btn {
  width: 36px;
  height: 100%;
  background: transparent;
  border: none;
  color: #8490a7;
  font-size: 1rem;
  cursor: pointer;
}
.tl-stepper-btn:hover {
  color: #ffffff;
}
.tl-stepper-val {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  outline: none;
}

/* Side Buttons: Sell / Buy (Screenshots 2 & 3) */
.tl-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tl-side-button {
  height: 36px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.tl-side-sell {
  color: #ff5b6e;
  background: #1a141b;
  border-color: #381e26;
}
.tl-side-sell.active {
  background: #28141c;
  border-color: #ff5b6e;
  box-shadow: 0 0 8px rgba(255, 91, 110, 0.25);
}
.tl-side-buy {
  color: #38d39f;
  background: #101c18;
  border-color: #1a362a;
}
.tl-side-buy.active {
  background: #112d22;
  border-color: #38d39f;
  box-shadow: 0 0 8px rgba(56, 211, 159, 0.25);
}

/* Quick-Trade Rate Bar (Screenshot 4 bottom) */
.tl-quick-trade-bar {
  display: grid;
  grid-template-columns: 1fr 135px 1fr;
  gap: 6px;
  align-items: stretch;
  margin-top: 2px;
}
.tl-rate-card {
  padding: 8px 6px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.tl-rate-card:hover {
  opacity: 0.92;
}
.tl-rate-sell {
  background: #ff6b7e;
  color: #16070a;
}
.tl-rate-buy {
  background: #4ade80;
  color: #081a14;
}
.tl-rate-price {
  font-family: var(--font-mono, monospace);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
}
.tl-rate-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.tl-qty-stepper {
  display: flex;
  align-items: center;
  background: #141824;
  border: 1px solid #1e2535;
  border-radius: 6px;
  overflow: hidden;
}
.tl-qty-btn {
  width: 28px;
  height: 100%;
  background: transparent;
  border: none;
  color: #8490a7;
  font-size: 0.95rem;
  cursor: pointer;
}
.tl-qty-btn:hover {
  color: #ffffff;
}
.tl-qty-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.tl-qty-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.86rem;
  text-align: center;
  outline: none;
  padding: 0;
}
.tl-qty-unit {
  font-size: 0.62rem;
  color: #788298;
  line-height: 1;
}
.tl-spread-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #3898ec;
  text-align: center;
}

/* Stop Loss & Take Profit Cards (Screenshots 2 & 3) */
.tl-protection-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tl-card-box {
  background: #141824;
  border: 1px solid #1e2535;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tl-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.tl-badge-trail {
  font-size: 0.62rem;
  color: #8490a7;
  background: #1c2233;
  border: 1px solid #28334a;
  padding: 1px 4px;
  border-radius: 3px;
}
.tl-card-heading {
  font-size: 0.74rem;
  font-weight: 600;
  color: #e2e6f0;
  flex: 1;
  margin-left: 5px;
}
.tl-chk {
  accent-color: #38d39f;
  cursor: pointer;
}
.tl-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}
.tl-row-lbl {
  color: #788298;
}
.tl-row-input {
  width: 78px;
  background: #0b0e14;
  border: 1px solid #1e2535;
  border-radius: 4px;
  padding: 3px 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  text-align: right;
  outline: none;
}
.tl-row-input:focus {
  border-color: #3898ec;
}
.tl-row-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: #8490a7;
}
.sl-text { color: #ff5b6e !important; }
.tp-text { color: #38d39f !important; }

/* Presets Strip */
.tl-presets-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.tl-presets-caption {
  font-size: 0.7rem;
  color: #788298;
  font-weight: 500;
}
.tl-presets-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tl-preset-pill {
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid #1e2535;
  background: #141824;
  color: #8490a7;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tl-preset-pill:hover {
  color: #ffffff;
  border-color: #2b364e;
}
.tl-preset-pill.active {
  background: #252d3d;
  color: #ffffff;
  border-color: #3898ec;
}

/* Big Primary Execution Button (Screenshots 2 & 3) */
.tl-primary-trade-btn {
  height: 42px;
  border-radius: 6px;
  border: none;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
  letter-spacing: 0.02em;
}
.tl-primary-trade-btn:hover {
  opacity: 0.92;
}
.tl-btn-sell-mode {
  background: #ff5b6e;
  color: #16070a;
}
.tl-btn-buy-mode {
  background: #38d39f;
  color: #081a14;
}

/* ==========================================================================
   Pane 3: Signal Message & TradeLocker Inspector
   ========================================================================== */
.tl-signal-header {
  padding: 8px 14px;
  background: #0e121a;
  border-bottom: 1px solid #1e2535;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tl-signal-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e6f0;
}

/* Channel Style Preset Dropdown in Signal Header */
.tl-channel-select-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #080c14;
  border: 1px solid #1c2638;
  border-radius: 8px;
  padding: 4px 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.tl-channel-select-group.compact {
  padding: 2px 6px;
  gap: 5px;
  border-radius: 6px;
}
.tl-channel-dropdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #3898ec;
  white-space: nowrap;
  margin: 0;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.tl-channel-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tl-channel-style-select {
  background: #0d1424;
  border: 1px solid #23334d;
  color: #f1f5f9;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 26px 4px 9px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233898ec' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.tl-channel-style-select:hover {
  border-color: #3898ec;
  background-color: #121c32;
}
.tl-channel-style-select:focus {
  border-color: #3898ec;
  box-shadow: 0 0 0 2px rgba(56, 152, 236, 0.25);
}
.tl-channel-style-select option,
.tl-channel-style-select optgroup {
  background: #0b0f19;
  color: #f1f5f9;
  font-size: 0.78rem;
}
.tl-channel-style-select optgroup {
  color: #64748b;
  font-weight: 700;
  font-size: 0.72rem;
}
.tl-signal-actions {
  display: flex;
  gap: 6px;
}
.tl-action-btn {
  font-size: 0.72rem;
  padding: 3px 9px;
  background: #141824;
  border: 1px solid #22293a;
  border-radius: 4px;
  color: #e2e6f0;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s ease;
}
.tl-action-btn:hover {
  border-color: #3898ec;
  color: #3898ec;
}
.tl-signal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  overflow-y: auto;
  gap: 8px;
}
.tl-textarea-label {
  font-size: 0.7rem;
  color: #788298;
}
.tl-signal-textarea {
  width: 100%;
  background: #090c12;
  border: 1px solid #1e2535;
  border-radius: 5px;
  color: #e2e6f0;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  min-height: 95px;
  max-height: 125px;
  transition: border-color 0.15s ease;
}
.tl-signal-textarea:focus {
  border-color: #3898ec;
}

/* TradeLocker Inspector (Screenshot 1 & 2 Table Styling) */
.tl-inspector-wrap {
  border: 1px solid #1e2535;
  background: #0e121a;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.tl-inspector-bar {
  padding: 6px 10px;
  background: #121622;
  border-bottom: 1px solid #1e2535;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tl-inspector-caption {
  font-size: 0.68rem;
  font-weight: 700;
  color: #788298;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tl-inspector-badge {
  font-size: 0.66rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(56, 211, 159, 0.1);
  border: 1px solid rgba(56, 211, 159, 0.3);
  color: #38d39f;
}
.tl-inspector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}
.tl-inspector-table thead th {
  background: #121622;
  color: #788298;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 6px 8px;
  text-transform: uppercase;
  border-bottom: 1px solid #1e2535;
  text-align: left;
}
.tl-inspector-table tbody td {
  padding: 7px 8px;
  font-family: var(--font-mono, monospace);
  color: #e2e6f0;
  font-weight: 600;
  border-right: 1px solid #141824;
}
.tl-inspector-table tbody td:last-child {
  border-right: none;
}
.tl-alert-strip {
  padding: 8px 10px;
  font-size: 0.74rem;
  line-height: 1.4;
  border-top: 1px solid #1e2535;
  background: #141824;
}

/* Footer Action Buttons */
.tl-signal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.tl-footer-btn-outline {
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #141824;
  border: 1px solid #22293a;
  border-radius: 5px;
  color: #e2e6f0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tl-footer-btn-outline:hover {
  border-color: #3898ec;
  color: #3898ec;
}
.tl-footer-btn-primary {
  padding: 7px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #2563eb;
  border: 1px solid #3b82f6;
  border-radius: 5px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tl-footer-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   Visual Layout Switcher & Multi-Deck Grid Systems
   ========================================================================== */
.tl-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-layout-switcher {
  display: flex;
  align-items: center;
  background: #121824;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #1f293d;
  gap: 2px;
}
.tl-switcher-btn {
  background: transparent;
  border: none;
  color: #8e9cb2;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tl-switcher-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}
.tl-switcher-btn.active {
  background: #3898ec;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(56, 152, 236, 0.4);
}

/* Body Grid: Always 3 columns */
.tl-modal-body {
  display: grid !important;
  grid-template-columns: 275px 1fr !important;
  flex: 1;
  min-height: 0;
  height: calc(100% - 48px);
  overflow: hidden;
  background: #0b0e14;
}

/* Pane 2 View Switching */
.tl-pane-order {
  display: flex;
  flex-direction: column;
  background: #0e121a;
  border-right: 1px solid #1a2233;
  overflow: hidden;
  height: 100%;
}
.tl-p2-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.tl-p2-view.active {
  display: flex !important;
}

/* ==========================================================================
   OPTION A: Streamlined 3-Pane Pro Styles
   ========================================================================== */
.tl-v1-order-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100% - 46px);
  overflow-y: auto;
}
.tl-v1-quotes-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  background: #0e131d;
  border: 1px solid #1a2233;
  border-radius: 8px;
  padding: 6px;
}
.tl-v1-quote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #131926;
  transition: all 0.15s ease;
}
.tl-v1-quote-box:hover {
  transform: translateY(-1px);
}
.tl-v1-quote-sell {
  color: #ff5b6e;
}
.tl-v1-quote-sell:hover {
  border-color: #ff5b6e;
}
.tl-v1-quote-sell.active {
  background: rgba(255, 91, 110, 0.14);
  border-color: #ff5b6e;
  box-shadow: 0 0 10px rgba(255, 91, 110, 0.25);
}
.tl-v1-quote-buy {
  color: #38d39f;
}
.tl-v1-quote-buy:hover {
  border-color: #38d39f;
}
.tl-v1-quote-buy.active {
  background: rgba(56, 211, 159, 0.14);
  border-color: #38d39f;
  box-shadow: 0 0 10px rgba(56, 211, 159, 0.25);
}
.tl-v1-quote-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.tl-v1-quote-price {
  font-family: var(--font-mono, monospace);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.1;
}
.tl-v1-spread-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.tl-v1-spread-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: #8e9cb2;
}
.tl-v1-spread-label {
  font-size: 0.55rem;
  color: #536278;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tl-v1-form-section {
  background: #0e131d;
  border: 1px solid #1a2233;
  border-radius: 8px;
  padding: 10px 12px;
}
.tl-v1-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c0c9d8;
}
.tl-v1-sub-metric {
  font-size: 0.7rem;
  color: #7b899e;
}
.tl-v1-sub-metric strong {
  color: #3898ec;
  font-family: monospace;
}
.tl-v1-stepper-row {
  display: flex;
  align-items: center;
  background: #101622;
  border: 1px solid #1c2538;
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
}
.tl-v1-step-btn {
  width: 38px;
  height: 100%;
  background: transparent;
  border: none;
  color: #8e9cb2;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}
.tl-v1-step-btn:hover {
  color: #ffffff;
  background: #182236;
}
.tl-v1-step-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tl-v1-lot-input {
  width: 70px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.tl-v1-lot-unit {
  font-size: 0.7rem;
  color: #627188;
  font-weight: 600;
  text-transform: uppercase;
}
.tl-v1-quick-chips {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.tl-v1-chip {
  flex: 1;
  padding: 4px 0;
  background: #101622;
  border: 1px solid #1c2538;
  border-radius: 4px;
  color: #8e9cb2;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}
.tl-v1-chip:hover, .tl-v1-chip.active {
  background: #1c2840;
  color: #3898ec;
  border-color: #3898ec;
}
.tl-v1-protection-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0e131d;
  border: 1px solid #1a2233;
  border-radius: 8px;
  padding: 10px 12px;
}
.tl-v1-prot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tl-v1-prot-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 95px;
}
.tl-v1-prot-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #131926;
  border: 1px solid #1c2538;
  border-radius: 5px;
  padding: 0 8px;
  height: 32px;
}
.tl-v1-prot-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}
.tl-v1-prot-hint {
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: #8e9cb2;
  white-space: nowrap;
}
.tl-v1-submit-wrap {
  margin-top: auto;
  padding-top: 6px;
}
.tl-v1-execute-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.tl-v1-execute-btn.tl-btn-sell-mode {
  background: #ff4d61;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 77, 97, 0.35);
}
.tl-v1-execute-btn.tl-btn-buy-mode {
  background: #38d39f;
  color: #081a14;
  box-shadow: 0 4px 14px rgba(56, 211, 159, 0.35);
}
.tl-v1-execute-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  font-size: 0.68rem;
  color: #627188;
  font-weight: 600;
}
.tl-v1-presets-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   PANE 2: RESTRUCTURED DESIGNS (V1, V2, V3)
   ========================================================================== */

/* --- Version 1 Enhancements (TradeLocker 1:1 Pro) --- */
.tl-v1-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38d39f;
  background: rgba(56, 211, 159, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.tl-v1-fin-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0e131e;
  border: 1px solid #192233;
  border-radius: 7px;
  padding: 9px 12px;
  margin-top: 2px;
}
.tl-fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}
.tl-fin-lbl {
  color: #8e9cb2;
}
.tl-fin-val {
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}
.tl-v1-order-body .tl-v1-submit-wrap {
  margin-top: 6px;
  padding-top: 0;
}

/* --- Version 2: Modern FinTech / TradingView Visual R:R --- */
.tl-v2-category-pill {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tl-v2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: #3898ec;
  background: rgba(56, 152, 236, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
}
.tl-v2-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3898ec;
  box-shadow: 0 0 8px #3898ec;
}
.tl-v2-order-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100% - 46px);
  overflow-y: auto;
}
.tl-v2-side-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #101622;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #1a2233;
}
.tl-v2-side-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tl-v2-side-btn.tl-v2-side-sell:hover {
  background: rgba(255, 77, 97, 0.1);
  border-color: rgba(255, 77, 97, 0.3);
}
.tl-v2-side-btn.tl-v2-side-sell.active {
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.25), rgba(255, 77, 97, 0.12));
  border-color: #ff4d61;
  box-shadow: 0 0 12px rgba(255, 77, 97, 0.25);
}
.tl-v2-side-btn.tl-v2-side-buy:hover {
  background: rgba(56, 211, 159, 0.1);
  border-color: rgba(56, 211, 159, 0.3);
}
.tl-v2-side-btn.tl-v2-side-buy.active {
  background: linear-gradient(135deg, rgba(56, 211, 159, 0.25), rgba(56, 211, 159, 0.12));
  border-color: #38d39f;
  box-shadow: 0 0 12px rgba(56, 211, 159, 0.25);
}
.tl-v2-side-tag {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tl-v2-side-sell .tl-v2-side-tag { color: #ff4d61; }
.tl-v2-side-buy .tl-v2-side-tag { color: #38d39f; }
.tl-v2-side-quote {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}
.tl-v2-live-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #0d121c;
  border: 1px solid #171f2f;
  border-radius: 6px;
  padding: 6px 10px;
}
.tl-v2-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tl-v2-strip-lbl {
  font-size: 0.62rem;
  color: #718096;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.tl-v2-strip-val {
  font-size: 0.76rem;
  font-family: var(--font-mono, monospace);
  color: #e2e8f0;
}
.tl-v2-strip-divider {
  width: 1px;
  height: 18px;
  background: #1a2233;
}
.tl-v2-card {
  background: #0e131e;
  border: 1px solid #192233;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-v2-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tl-v2-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}
.tl-v2-card-chip {
  font-size: 0.68rem;
  color: #8e9cb2;
  font-family: var(--font-mono, monospace);
}
.tl-v2-rr-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 152, 236, 0.16);
  color: #3898ec;
}
.tl-v2-rr-visual-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.tl-v2-rr-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}
.tl-v2-rr-bar-track {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: #141c2c;
}
.tl-v2-rr-bar-risk {
  background: #ff4d61;
  transition: width 0.2s ease;
}
.tl-v2-rr-bar-reward {
  background: #38d39f;
  transition: width 0.2s ease;
}
.tl-v2-rr-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.tl-v2-input-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tl-v2-block-lbl {
  font-size: 0.68rem;
  font-weight: 600;
}
.tl-v2-clean-input {
  background: #131926;
  border: 1px solid #1c2538;
  border-radius: 5px;
  height: 32px;
  padding: 0 8px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}
.tl-v2-outcome-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}
.tl-v2-outcome-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
}
.tl-v2-outcome-chip.sl-bg {
  background: rgba(255, 77, 97, 0.08);
  border: 1px solid rgba(255, 77, 97, 0.2);
  color: #8e9cb2;
}
.tl-v2-outcome-chip.tp-bg {
  background: rgba(56, 211, 159, 0.08);
  border: 1px solid rgba(56, 211, 159, 0.2);
  color: #8e9cb2;
}
.tl-v2-cta-wrap {
  margin-top: 4px;
}
.tl-v2-glowing-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff4d61, #e63946);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(255, 77, 97, 0.4);
  transition: all 0.15s ease;
}
.tl-v2-glowing-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* --- Version 3: Institutional Scalper 1-Click Execution --- */
.tl-v3-margin-meter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.tl-v3-meter-text {
  font-size: 0.65rem;
  font-family: var(--font-mono, monospace);
  color: #38d39f;
  font-weight: 700;
}
.tl-v3-meter-bar {
  width: 80px;
  height: 4px;
  background: #1a2233;
  border-radius: 2px;
  overflow: hidden;
}
.tl-v3-meter-fill {
  height: 100%;
  background: #38d39f;
}
.tl-v3-order-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100% - 46px);
  overflow-y: auto;
}
.tl-v3-scalper-bar {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.tl-v3-direct-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tl-v3-direct-sell {
  background: #ff4d61;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 77, 97, 0.35);
}
.tl-v3-direct-buy {
  background: #38d39f;
  color: #081a14;
  box-shadow: 0 4px 14px rgba(56, 211, 159, 0.35);
}
.tl-v3-direct-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.tl-v3-direct-meta {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.9;
}
.tl-v3-direct-price {
  font-size: 1.05rem;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  margin-top: 2px;
}
.tl-v3-scalp-volume {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #101622;
  border: 1px solid #1e283d;
  border-radius: 8px;
  padding: 6px;
}
.tl-v3-vol-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #718096;
  letter-spacing: 0.05em;
}
.tl-v3-vol-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.tl-v3-lot-matrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.tl-v3-matrix-btn {
  padding: 6px 0;
  background: #111724;
  border: 1px solid #1c2538;
  border-radius: 5px;
  color: #8e9cb2;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}
.tl-v3-matrix-btn:hover, .tl-v3-matrix-btn.active {
  background: #1d2a45;
  border-color: #3898ec;
  color: #3898ec;
}
.tl-v3-ladder-card {
  background: #0e131e;
  border: 1px solid #192233;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.tl-v3-ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #718096;
  letter-spacing: 0.04em;
}
.tl-v3-ladder-tag {
  font-size: 0.65rem;
  color: #3898ec;
  font-family: monospace;
}
.tl-v3-ladder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tl-v3-ladder-target {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #131926;
  border: 1px solid #1c2538;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
}
.tl-v3-safeguards-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #101622;
  border: 1px solid #182233;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 0.72rem;
}
.tl-v3-safe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #8e9cb2;
}
.tl-v3-safe-item strong {
  color: #e2e8f0;
  font-family: var(--font-mono, monospace);
}
.tl-v3-caption {
  text-align: center;
  font-size: 0.68rem;
  color: #4a5568;
  margin-top: 8px;
}


/* ==========================================================================
   2-PANE UNIFIED WORKSTATION STYLES
   ========================================================================== */
/* ==========================================================================
   Restructured 2-Pane Workstation (5 Visual Layouts)
   ========================================================================== */

.tl-pane-station {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
}
.tl-2p-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.tl-2p-view.active {
  display: flex !important;
}

/* --- Common Station Header --- */
.tl-station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #0e121a;
  border-bottom: 1px solid #1a2233;
}
.tl-station-live-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111724;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #1c2638;
}
.tl-ticker-item {
  font-size: 0.74rem;
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
}
.tl-ticker-item small {
  color: #718096;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.tl-ticker-divider {
  width: 1px;
  height: 14px;
  background: #232f45;
}

/* --- Layout 1: Panoramic Deck --- */
.tl-station-trading-strip {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 1.35fr;
  gap: 8px;
  padding: 10px 14px;
  background: #0d1119;
  border-bottom: 1px solid #182030;
}
.tl-strip-block {
  background: #101622;
  border: 1px solid #1a2336;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tl-strip-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #8e9cb2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tl-strip-meta {
  font-size: 0.66rem;
  color: #718096;
}
.tl-strip-meta strong {
  color: #e2e8f0;
}
.tl-mode-switcher-mini {
  display: flex;
  background: #0b0e14;
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
}
.tl-mode-mini-btn {
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #718096;
  border-radius: 3px;
  cursor: pointer;
}
.tl-mode-mini-btn.active {
  background: #252d3d;
  color: #ffffff;
}
.tl-strip-quotes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.tl-strip-quote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tl-strip-quote-sell {
  background: rgba(255, 77, 97, 0.1);
  border-color: rgba(255, 77, 97, 0.25);
}
.tl-strip-quote-sell.active {
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.25), rgba(255, 77, 97, 0.12));
  border-color: #ff4d61;
  box-shadow: 0 0 10px rgba(255, 77, 97, 0.25);
}
.tl-strip-quote-buy {
  background: rgba(56, 211, 159, 0.1);
  border-color: rgba(56, 211, 159, 0.25);
}
.tl-strip-quote-buy.active {
  background: linear-gradient(135deg, rgba(56, 211, 159, 0.25), rgba(56, 211, 159, 0.12));
  border-color: #38d39f;
  box-shadow: 0 0 10px rgba(56, 211, 159, 0.25);
}
.tl-sq-dir {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tl-strip-quote-sell .tl-sq-dir { color: #ff4d61; }
.tl-strip-quote-buy .tl-sq-dir { color: #38d39f; }
.tl-sq-price {
  font-size: 0.92rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #ffffff;
  margin-top: 1px;
}

.tl-strip-prot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.tl-strip-prot-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tl-prot-lbl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.64rem;
}
.tl-prot-dist {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  font-size: 0.62rem;
}
.tl-strip-prot-input {
  background: #0d121c;
  border: 1px solid #1a2336;
  border-radius: 4px;
  height: 28px;
  padding: 0 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #ffffff;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.tl-split-left .tl-v1-quote-price {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.tl-station-signal-area {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.tl-station-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 10px;
}
.tl-signal-footer-right {
  display: flex;
  gap: 8px;
}

/* --- Layout 2: Tabbed Studio --- */
.tl-v2-subtabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: #0e121a;
  border-bottom: 1px solid #1a2233;
}
.tl-v2-tab-group {
  display: flex;
  gap: 4px;
}
.tl-v2-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #718096;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tl-v2-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}
.tl-v2-tab.active {
  color: #3898ec;
  background: #141c2c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.tl-v2-tab-content {
  display: none;
  flex-direction: column;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}
.tl-v2-tab-content.active {
  display: flex !important;
}
.tl-v2-exec-ticket {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.tl-v2-signal-station {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

/* --- Layout 3: Split Desk --- */
.tl-split-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
}
.tl-split-left {
  padding: 10px 12px;
  border-right: 1px solid #1a2233;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-split-left .tl-v1-execute-btn {
  font-size: 0.80rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 6px !important;
}
.tl-split-right {
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-split-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Layout 4: Accordion Deck --- */
.tl-accordion-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #0e121a;
  border-bottom: 1px solid #1a2233;
}
.tl-accordion-quick-pills {
  display: flex;
  gap: 6px;
}
.tl-quick-pill-sell, .tl-quick-pill-buy {
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-mono, monospace);
}
.tl-quick-pill-sell {
  background: rgba(255, 77, 97, 0.15);
  border-color: #ff4d61;
  color: #ff4d61;
}
.tl-quick-pill-buy {
  background: rgba(56, 211, 159, 0.15);
  border-color: #38d39f;
  color: #38d39f;
}
.tl-drawer-card {
  margin: 8px 12px 0;
  background: #101622;
  border: 1px solid #1a2336;
  border-radius: 7px;
  overflow: hidden;
}
.tl-drawer-header {
  padding: 8px 12px;
  background: #141c2c;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.tl-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}
.tl-drawer-chevron {
  font-size: 0.7rem;
  color: #718096;
  transition: transform 0.2s ease;
}
.tl-drawer-card.collapsed .tl-drawer-chevron {
  transform: rotate(-90deg);
}
.tl-drawer-card.collapsed .tl-drawer-body {
  display: none;
}
.tl-drawer-chip {
  font-size: 0.65rem;
  font-family: var(--font-mono, monospace);
  padding: 2px 6px;
  border-radius: 3px;
  background: #1a2538;
  color: #8e9cb2;
}
.tl-tok-chip {
  font-size: 0.68rem;
  background: #0b0e14;
  border: 1px solid #1f293d;
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tl-tok-chip small { color: #64748b; font-weight: 700; }
.tl-tok-chip strong { color: #e2e8f0; font-family: var(--font-mono, monospace); }
.tl-accordion-footer {
  margin-top: auto;
  padding: 8px 12px;
  background: #0e121a;
  border-top: 1px solid #1a2233;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Layout 5: 1-Click Scalper --- */
.tl-scalper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #0e121a;
  border-bottom: 1px solid #1a2233;
}
.tl-scalper-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
}
.tl-scalp-meter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
}
.tl-scalp-meter small { color: #718096; font-size: 0.62rem; font-weight: 700; }
.tl-scalper-deck {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.tl-scalper-action-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1fr;
  gap: 8px;
}
.tl-scalp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.tl-scalp-sell {
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.2), rgba(255, 77, 97, 0.08));
  border: 1.5px solid #ff4d61;
  color: #ff4d61;
}
.tl-scalp-sell:hover {
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.35), rgba(255, 77, 97, 0.15));
  box-shadow: 0 0 16px rgba(255, 77, 97, 0.35);
}
.tl-scalp-buy {
  background: linear-gradient(135deg, rgba(56, 211, 159, 0.2), rgba(56, 211, 159, 0.08));
  border: 1.5px solid #38d39f;
  color: #38d39f;
}
.tl-scalp-buy:hover {
  background: linear-gradient(135deg, rgba(56, 211, 159, 0.35), rgba(56, 211, 159, 0.15));
  box-shadow: 0 0 16px rgba(56, 211, 159, 0.35);
}
.tl-scalp-dir {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tl-scalp-rate {
  font-size: 1.12rem;
  font-family: var(--font-mono, monospace);
  color: #ffffff;
  margin-top: 2px;
}
.tl-scalp-sub {
  font-size: 0.62rem;
  color: #8e9cb2;
  margin-top: 1px;
}
.tl-scalp-volume-card {
  background: #101622;
  border: 1px solid #1a2336;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-scalp-ladder-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tl-ladder-chip {
  background: #101622;
  border: 1px solid #1a2336;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
}
.tl-ladder-chip strong { font-family: var(--font-mono, monospace); font-size: 0.8rem; color: #ffffff; }
.tl-ladder-chip small { color: #718096; font-size: 0.62rem; }
.tl-scalp-signal-card {
  background: #101622;
  border: 1px solid #1a2336;
  border-radius: 8px;
  padding: 8px 12px;
}
.tl-scalp-signal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Clean & Native TradeLocker Inputs (V2 & V3 Redesign)
   ========================================================================== */

/* Clean Stepper Control */
.tl-clean-stepper {
  display: flex !important;
  align-items: center !important;
  background: #090d15 !important;
  border: 1px solid #1c2638 !important;
  border-radius: 5px !important;
  height: 32px !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
  transition: border-color 0.15s ease !important;
}
.tl-clean-stepper:focus-within {
  border-color: #3898ec !important;
  box-shadow: 0 0 0 2px rgba(56, 152, 236, 0.2) !important;
}
.tl-clean-step-btn {
  width: 32px !important;
  height: 100% !important;
  background: #121824 !important;
  border: none !important;
  color: #8e9cb2 !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  user-select: none !important;
}
.tl-clean-step-btn:hover {
  background: #1c273a !important;
  color: #ffffff !important;
}
.tl-clean-stepper-input {
  flex: 1 !important;
  width: 100% !important;
  height: 30px !important;
  padding: 0 4px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  outline: none !important;
  box-shadow: none !important;
}
.tl-clean-unit-tag {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  padding-right: 8px !important;
  text-transform: uppercase !important;
  user-select: none !important;
}

/* Chips Row */
.tl-clean-chips-grid {
  display: flex !important;
  gap: 4px !important;
  margin-top: 6px !important;
}
.tl-clean-chip {
  flex: 1 !important;
  padding: 3px 0 !important;
  background: #0d121c !important;
  border: 1px solid #1c2638 !important;
  border-radius: 4px !important;
  color: #8e9cb2 !important;
  font-size: 0.70rem !important;
  font-family: var(--font-mono, monospace) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-align: center !important;
  transition: all 0.15s ease !important;
}
.tl-clean-chip:hover, .tl-clean-chip.active {
  background: #182338 !important;
  border-color: #3898ec !important;
  color: #3898ec !important;
}

/* Clean Protection Grid */
.tl-clean-prot-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.tl-clean-prot-card {
  background: #0d121c !important;
  border: 1px solid #1a2336 !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0 !important;
}
.tl-clean-prot-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.tl-clean-prot-title {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}
.tl-clean-prot-title.sl-title { color: #ff4d61 !important; }
.tl-clean-prot-title.tp-title { color: #38d39f !important; }

.tl-clean-prot-hint {
  font-family: var(--font-mono, monospace) !important;
  font-size: 0.64rem !important;
  font-weight: 600 !important;
}
.tl-clean-prot-hint.sl-hint { color: #ff4d61 !important; }
.tl-clean-prot-hint.tp-hint { color: #38d39f !important; }

.tl-clean-input-box {
  display: flex !important;
  align-items: center !important;
  background: #080c14 !important;
  border: 1px solid #182234 !important;
  border-radius: 4px !important;
  height: 28px !important;
  padding: 0 6px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.tl-clean-input-box:focus-within {
  border-color: #3898ec !important;
  box-shadow: 0 0 0 2px rgba(56, 152, 236, 0.25) !important;
}
.tl-clean-number-input {
  flex: 1 !important;
  width: 100% !important;
  height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 0.80rem !important;
  font-weight: 600 !important;
  outline: none !important;
  box-shadow: none !important;
}
.tl-clean-input-unit {
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin-left: 4px !important;
  user-select: none !important;
}

/* Clean Form Labels */
.tl-clean-form-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.tl-clean-label-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.tl-clean-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #8e9cb2 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}
.tl-clean-sub {
  font-size: 0.66rem !important;
  color: #64748b !important;
}
.tl-clean-sub strong {
  color: #3898ec !important;
}

/* Entry Price Group (Limit / Stop) */
.tl-entry-price-group {
  background: #0d121c !important;
  border: 1px solid #1e283d !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  display: flex;
  flex-direction: column !important;
  gap: 4px !important;
}
.tl-entry-price-group.hidden,
.tl-entry-price-group[style*="display: none"] {
  display: none !important;
}

/* Top View Switcher in Header */
.view-mode-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2px 4px;
  gap: 3px;
  margin-left: 12px;
}
.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  transition: all 0.2s ease;
}
.view-mode-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.view-mode-btn.active {
  background: #3898ec;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(56, 152, 236, 0.35);
}

/* ==========================================================================
   Signal-to-Broker Handshake & Audit Ledger Window
   ========================================================================== */
.audit-ledger-card {
  margin-top: 24px;
  background: rgba(13, 18, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.audit-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(18, 25, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 16px;
  flex-wrap: wrap;
}

.audit-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audit-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.audit-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-subtitle {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: #94a3b8;
}

.audit-metrics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.audit-metric-pill strong {
  font-weight: 800;
  color: #ffffff;
}
.audit-metric-pill.synced {
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.audit-metric-pill.simulated {
  border-color: rgba(6, 182, 212, 0.35);
  color: #22d3ee;
}
.audit-metric-pill.failed {
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.audit-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(10, 14, 24, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  flex-wrap: wrap;
}

.audit-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audit-filter-pill {
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.audit-filter-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f1f5f9;
}
.audit-filter-pill.active {
  background: #2ea6ff;
  border-color: #2ea6ff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(46, 166, 255, 0.35);
}

.audit-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 4px 10px;
}
.audit-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 0.74rem;
  width: 140px;
  transition: width 0.2s ease;
}
.audit-search-box input:focus {
  width: 180px;
}
.audit-search-box input::placeholder {
  color: #64748b;
}

.audit-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.audit-table thead th {
  position: sticky;
  top: 0;
  background: #111827;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  z-index: 2;
}

.audit-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}
.audit-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.audit-table td {
  padding: 10px 14px;
  vertical-align: middle;
  color: #cbd5e1;
}

.audit-time-cell {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
}
.audit-msg-id-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-top: 2px;
}

.audit-call-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.audit-call-main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.audit-side-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.audit-side-badge.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.audit-side-badge.buy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.audit-symbol-text {
  font-weight: 700;
  color: #f8fafc;
}
.audit-levels-sub {
  font-size: 0.68rem;
  color: #64748b;
  font-family: var(--font-mono);
}

.audit-account-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  white-space: nowrap;
}
.audit-account-pill.primary {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}
.audit-account-pill.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}
.audit-account-pill.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.3);
}

.audit-exec-cell {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #cbd5e1;
}

.badge-handshake {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-handshake.synced {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-handshake.simulated {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}
.badge-handshake.partial {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.badge-handshake.failed {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.badge-handshake.skipped {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-audit-raw {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-audit-raw:hover {
  background: rgba(46, 166, 255, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   RECONCILIATION LEDGER: DEMO VIEW MODES & RESPONSIVE ARCHITECTURE
   ========================================================================== */

/* Demo View Mode Selector Bar */
.audit-mode-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(11, 18, 32, 0.85);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.audit-mode-pills-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.audit-mode-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.audit-mode-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.audit-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  white-space: nowrap;
}

.audit-mode-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.audit-mode-pill.active {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Horizontal Filter Slider Bar (Mirroring Userbot Live Execution Logs) */
.audit-slider-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(13, 20, 36, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.audit-slider-arrow {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.audit-slider-arrow:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.audit-slider-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  scroll-behavior: smooth;
}

.audit-slider-scroll::-webkit-scrollbar {
  display: none;
}

.audit-slider-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
  user-select: none;
}

.audit-slider-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.16);
}

.audit-slider-pill.active {
  background: #2ea6ff;
  color: #ffffff;
  border-color: #2ea6ff;
  box-shadow: 0 2px 8px rgba(46, 166, 255, 0.35);
}

.audit-slider-pill .pill-cnt {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
  font-weight: 700;
}

.audit-slider-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
}

.audit-slider-pill.acc-pill {
  border-color: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.audit-slider-pill.acc-pill.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: #ffffff;
}

/* Horizontal Abstraction Slider (Levels of Detail) */
.audit-abstraction-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.audit-abs-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.audit-abs-track {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.audit-abs-step {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.audit-abs-step:hover {
  color: #f1f5f9;
}

.audit-abs-step.active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.audit-abs-step .step-num {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
}

.audit-abs-step.active .step-num {
  background: #38bdf8;
  color: #081a24;
  font-weight: 800;
}

.audit-abs-hint {
  font-size: 0.72rem;
  color: #64748b;
  font-style: italic;
  margin-left: auto;
}

/* Mode 1: Expandable Row Accordion Tray */
.audit-expandable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.audit-expandable-row:hover {
  background: rgba(46, 166, 255, 0.06) !important;
}

.audit-expandable-row.is-expanded {
  background: rgba(56, 189, 248, 0.08) !important;
  border-bottom: none !important;
}

.btn-row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.15s ease;
  font-size: 0.7rem;
}

.audit-expandable-row.is-expanded .btn-row-toggle {
  transform: rotate(90deg);
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.audit-expanded-tray-row {
  background: rgba(9, 14, 26, 0.95) !important;
}

.audit-expanded-tray-row td {
  padding: 0 !important;
  border-top: none !important;
}

.audit-expanded-tray {
  padding: 16px 20px;
  border-bottom: 2px solid rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.2s ease;
}

.audit-tray-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .audit-tray-grid {
    grid-template-columns: 1fr;
  }
}

.audit-tray-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-tray-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-tray-raw-text {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 140px;
  overflow-y: auto;
  margin: 0;
}

.audit-tray-orders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #cbd5e1;
}

.audit-tray-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  border-left: 2px solid #38bdf8;
}

.audit-tray-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Mode 3: Split Inspector (Master-Detail Pane) */
.audit-split-view {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  min-height: 520px;
  max-height: 700px;
}

@media (max-width: 960px) {
  .audit-split-view {
    grid-template-columns: 1fr;
  }
}

.audit-split-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
}

.audit-split-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.audit-split-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.audit-split-item.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.audit-split-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #38bdf8;
  border-radius: 4px 0 0 4px;
}

.audit-split-inspector {
  background: rgba(11, 18, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.audit-split-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mode 4: Ultra-Compact Density Mode */
.audit-table.compact-mode th {
  padding: 4px 6px !important;
  font-size: 0.64rem !important;
}

.audit-table.compact-mode td {
  padding: 3px 6px !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
}

.audit-table.compact-mode .audit-msg-id-badge {
  font-size: 0.58rem !important;
  padding: 0 3px !important;
}

.audit-table.compact-mode .audit-side-badge {
  font-size: 0.6rem !important;
  padding: 0 4px !important;
}

.audit-table.compact-mode .badge-handshake {
  font-size: 0.62rem !important;
  padding: 1px 5px !important;
}

.audit-table.compact-mode .audit-account-pill {
  font-size: 0.62rem !important;
  padding: 1px 5px !important;
}

/* Mode 5: Pure Text CLI / ASCII Mode (No icons, no rounded pills, true monospace) */
.audit-puretext-terminal {
  background: #090d16 !important;
  border: 1px solid #1e293b !important;
  border-radius: 0px !important; /* Pure square, no rounded corners */
  padding: 14px !important;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace !important;
  font-size: 0.74rem !important;
  color: #cbd5e1 !important;
  overflow-x: auto !important;
}

.audit-puretext-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #334155;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace !important;
}

.cli-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cli-title-block {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: #38bdf8;
}

.cli-prompt {
  color: #a855f7;
  font-weight: 900;
}

.cli-action-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
}

.cli-action-left {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cli-action-right {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px;
  margin-left: auto; /* Right aligned */
  flex-shrink: 0;
}

/* Unified Dimensions for all CLI controls (identical height, border, font) */
.cli-field-group {
  display: inline-flex;
  align-items: center;
  height: 28px;
  box-sizing: border-box;
  background: #090e1a;
  border: 1px solid #334155;
  border-radius: 0px !important;
  padding: 0 6px;
  gap: 5px;
}

.cli-field-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

.cli-control-select {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.72rem;
  outline: none;
  cursor: pointer;
  padding: 0;
  height: 100%;
}

.cli-control-select option {
  background: #090e1a;
  color: #e2e8f0;
}

/* Authentic Terminal Underline Slots Search Box (Wider 220px, Flashing Solid Block Cursor) */
.cli-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  box-sizing: border-box;
  background: #060a12;
  border: 1px solid #334155;
  border-radius: 0px !important;
  padding: 0 8px;
  gap: 6px;
  flex-shrink: 0;
  width: 230px; /* Spacious prominent terminal width */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: text;
  overflow: hidden;
}

.cli-search-box:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

.cli-search-prompt {
  color: #a855f7;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  user-select: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Slots Wrapper displaying actual discrete character slots */
.cli-slots-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-grow: 1;
  height: 20px;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}

/* Individual Terminal Underline Slot */
.cli-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 18px;
  box-sizing: border-box;
  border-bottom: 2px solid #334155; /* Discrete Underline Slot */
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: #38bdf8;
  text-shadow: 0 0 4px rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
  line-height: 1;
}

.cli-slot.has-char {
  border-bottom-color: #38bdf8;
}

/* Authentic Flashing Solid Block Cursor (VT100 / Retro Terminal) */
@keyframes cli-solid-block-flash {
  0%, 65% {
    opacity: 1;
  }
  66%, 100% {
    opacity: 0;
  }
}

.cli-slot.has-cursor::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: 14px;
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
  animation: cli-solid-block-flash 0.9s step-end infinite;
  z-index: 1;
}

/* Invert text when cursor sits on top of existing character */
.cli-slot.has-cursor.has-char {
  color: #060a12 !important;
  text-shadow: none !important;
}

.cli-slot.has-cursor.has-char .cli-char {
  position: relative;
  z-index: 2;
  color: #060a12;
  font-weight: 900;
}

.cli-char-placeholder {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.65;
}

/* Invisible Native Input covering the entire box for 100% reliable keyboard/focus handling */
.cli-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0 !important;
  cursor: text;
  background: transparent;
  border: none !important;
  outline: none !important;
  z-index: 5;
}

/* Monochrome Outline Action Buttons (Identical 28px Height, Zero Neon Colors) */
.btn-cli-action {
  height: 28px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  color: #94a3b8 !important;
  border: 1px solid #334155 !important;
  border-radius: 0px !important;
  padding: 0 8px !important;
  font-family: inherit !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.12s ease !important;
  flex-shrink: 0 !important;
}

.btn-cli-action:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #f8fafc !important;
}

.audit-puretext-table {
  width: 100%;
  border-collapse: collapse;
  font-family: inherit;
  white-space: nowrap;
}

.audit-puretext-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #334155;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

.audit-puretext-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #1e293b;
  font-size: 0.72rem;
  color: #e2e8f0;
}

.audit-puretext-table tr:hover {
  background: rgba(56, 189, 248, 0.06);
  cursor: pointer;
}

.audit-puretext-table tr.selected {
  background: rgba(56, 189, 248, 0.12);
}

.cli-badge {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cli-badge.buy { color: #34d399; }
.cli-badge.sell { color: #f87171; }
.cli-badge.synced { color: #34d399; }
.cli-badge.simulated { color: #22d3ee; }
.cli-badge.failed { color: #f87171; }
.cli-badge.skipped { color: #94a3b8; }

/* CLI Inline Drawer */
.cli-drawer-pane {
  display: none;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #334155;
}

.cli-drawer-pane.active {
  display: block;
}

.cli-drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
}

.cli-drawer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .cli-drawer-split {
    grid-template-columns: 1fr;
  }
}

.cli-pre-box {
  background: #04060b;
  border: 1px solid #1e293b;
  padding: 8px;
  color: #93c5fd;
  font-family: inherit;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
}

/* Mode 6: Responsive Cards Grid */
.audit-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.audit-card-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.18s ease;
}

.audit-card-item:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.audit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-card-call {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
}

.audit-card-meta-lbl {
  color: #64748b;
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.audit-card-meta-val {
  color: #f1f5f9;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* General Responsiveness */
.audit-table-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
}

.audit-table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.audit-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.audit-table {
  width: 100%;
  min-width: 860px;
}

/* Abstraction Level Column Control */
.audit-table.abs-level-1 th:nth-child(2),
.audit-table.abs-level-1 td:nth-child(2),
.audit-table.abs-level-1 th:nth-child(5),
.audit-table.abs-level-1 td:nth-child(5) {
  display: none !important;
}

.audit-table.abs-level-2 th:nth-child(5) .detailed-orders,
.audit-table.abs-level-2 td:nth-child(5) .detailed-orders {
  display: none !important;
}

/* ==========================================================================
   MESSAGE STUDIO & TELEGRAM LIVE PREVIEW (MODULAR LEGO-BLOCK BUILDER)
   ========================================================================== */

.message-studio-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.5));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 24px;
}

.studio-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.studio-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.studio-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.studio-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-studio-action, .btn-studio-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-studio-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.btn-studio-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-studio-save {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-studio-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}

/* Studio Nav Bar */
.studio-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 14px;
}

.studio-event-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.studio-tab:hover {
  color: #fff;
}

.studio-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.studio-mode-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-mode-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.studio-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* Main Studio Grid */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 22px;
}

@media (max-width: 1080px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Lego Blocks Section */
.lego-section {
  margin-bottom: 20px;
}

.lego-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lego-blocks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lego-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.lego-card-wide {
  grid-column: 1 / -1;
}

.lego-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.lego-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
}

.lego-label input[type="checkbox"],
.lego-pill-toggle input[type="checkbox"],
.lego-acc-chip input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.lego-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  outline: none;
  box-sizing: border-box;
}

.lego-subrow {
  margin-top: 6px;
}

.lego-sublabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.lego-mini-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  outline: none;
}

.lego-accounts-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.lego-acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lego-acc-chip:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.lego-badge-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lego-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lego-pill-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Template Markdown Editor */
.template-editor-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.editor-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.editor-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.var-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.var-chip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.var-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.studio-textarea {
  width: 100%;
  background: rgba(10, 15, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-family: 'JetBrains Mono', 'Fira Code', var(--font-mono, monospace);
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

.studio-textarea:focus {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

/* Telegram Phone Simulator */
.phone-simulator-card {
  background: #17212b; /* Exact Telegram Dark Theme background */
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.phone-header-bar {
  background: #242f3d; /* Telegram top bar */
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
}

.phone-top-meta {
  margin-bottom: 8px;
}

.phone-sample-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  margin-top: 4px;
}

.tg-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.tg-back-arrow {
  font-size: 18px;
  color: #6ab2f2;
  cursor: pointer;
}

.tg-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tg-chat-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.tg-chat-sub {
  font-size: 11px;
  color: #7f91a4;
}

.tg-dots {
  color: #7f91a4;
  font-size: 16px;
}

/* Telegram Canvas & Bubble */
.tg-canvas {
  background: #0e1621; /* Telegram chat wallpaper dark */
  padding: 16px 14px;
  flex: 1;
  min-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.tg-msg-bubble {
  background: #182533; /* Telegram received message bubble */
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  max-width: 95%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
  word-break: break-word;
}

.tg-msg-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tg-author-name {
  font-size: 12px;
  font-weight: 700;
  color: #6ab2f2; /* Telegram Bot Name Blue */
}

.tg-bot-badge {
  font-size: 9px;
  font-weight: 700;
  background: #2b5278;
  color: #76a9db;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.tg-msg-content {
  font-size: 12.5px;
  line-height: 1.45;
  color: #f5f5f5;
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tg-msg-content b, .tg-msg-content strong {
  font-weight: 700;
  color: #ffffff;
}

.tg-msg-content code {
  background: rgba(255, 255, 255, 0.08);
  color: #6ab2f2;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
}

.tg-msg-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.tg-time {
  font-size: 10px;
  color: #708499;
}

.tg-checkmarks {
  font-size: 11px;
  color: #539eec;
}



