    /* ── CSS Variables ── */
    :root {
      --bg: #f5f7fb;
      --bg-card: #ffffff;
      --bg-subtle: #f1f5f9;
      --bg-subtle-2: #e9edf5;
      --bg-code: #0f172a;
      --bg-sidebar: #0b1020;
      --bg-sidebar-hover: #151b33;
      --bg-topbar: rgba(255,255,255,0.85);
      --border: #e5e7eb;
      --border-strong: #d1d5db;
      --border-dark: rgba(255,255,255,0.08);
      --text-primary: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --text-on-dark: #e8ecf5;
      --text-on-dark-muted: #8089a3;
      --text-on-accent: #ffffff;
      --indigo: #4f46e5;
      --indigo-hover: #4338ca;
      --violet: #7c3aed;
      --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
      --brand-grad-vivid: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
      --brand-grad-soft: linear-gradient(135deg, rgba(79,70,229,0.10), rgba(124,58,237,0.10));
      --blue: #2563eb;
      --blue-bg: #eff6ff;
      --blue-border: #bfdbfe;
      --green: #16a34a;
      --green-bg: #f0fdf4;
      --green-border: #bbf7d0;
      --amber: #d97706;
      --amber-bg: #fffbeb;
      --amber-border: #fde68a;
      --red: #dc2626;
      --red-bg: #fef2f2;
      --red-border: #fecaca;
      --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
      --radius-xs: 6px;
      --radius-sm: 8px;
      --radius: 12px;
      --radius-lg: 16px;
      --radius-pill: 999px;
      --shadow-sm: 0 1px 2px rgba(17,24,39,0.04);
      --shadow: 0 1px 3px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.04);
      --shadow-md: 0 8px 24px -12px rgba(17,24,39,0.12), 0 1px 2px rgba(17,24,39,0.04);
      --shadow-lg: 0 20px 48px -20px rgba(17,24,39,0.20), 0 2px 4px rgba(17,24,39,0.04);
      --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      --sidebar-w: 240px;
      --topbar-h: 56px;
    }

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

    body {
      font-family: var(--font-sans);
      background:
        radial-gradient(900px 500px at 15% -8%, rgba(79,70,229,0.08), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, rgba(124,58,237,0.05), transparent 60%),
        var(--bg);
      background-attachment: fixed;
      color: var(--text-primary);
      line-height: 1.5;
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-size: 13.5px;
    }

    button { font-family: inherit; }
    input, select { font-family: inherit; }

    /* ═══════════════════════════════════════════════════════════════
       LAYOUT — sidebar + topbar + main
       ═══════════════════════════════════════════════════════════════ */
    .app-layout {
      display: grid;
      grid-template-columns: var(--sidebar-w) 1fr;
      min-height: 100vh;
    }

    /* ── Sidebar ── */
    .sidebar {
      background: var(--bg-sidebar);
      color: var(--text-on-dark);
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 0;
      height: 100vh;
      border-right: 1px solid rgba(255,255,255,0.04);
      background-image:
        radial-gradient(600px 300px at -10% -10%, rgba(99,102,241,0.22), transparent 60%),
        radial-gradient(400px 300px at 110% 100%, rgba(236,72,153,0.10), transparent 60%),
        linear-gradient(180deg, #0b1020 0%, #0a0e1c 100%);
    }
    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 18px 18px 22px;
      border-bottom: 1px solid var(--border-dark);
    }
    .brand-mark {
      width: 32px;
      height: 32px;
      border-radius: 9px;
      background: var(--brand-grad-vivid);
      box-shadow: 0 6px 18px -4px rgba(139,92,246,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 800;
      font-size: 13px;
      letter-spacing: -0.02em;
    }
    .brand-text {
      display: flex;
      flex-direction: column;
      line-height: 1.1;
    }
    .brand-name {
      font-size: 14px;
      font-weight: 700;
      color: #fff;
      letter-spacing: -0.01em;
    }
    .brand-sub {
      font-size: 11px;
      color: var(--text-on-dark-muted);
    }

    .nav {
      padding: 14px 10px;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .nav-section {
      font-size: 10px;
      font-weight: 600;
      color: var(--text-on-dark-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 12px 12px 6px;
    }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 9px 12px;
      border-radius: var(--radius-sm);
      color: var(--text-on-dark-muted);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: var(--transition);
      background: none;
      border: none;
      text-align: left;
      width: 100%;
    }
    .nav-item:hover {
      background: var(--bg-sidebar-hover);
      color: #fff;
    }
    .nav-item.active {
      background: linear-gradient(90deg, rgba(99,102,241,0.22), rgba(99,102,241,0.08));
      color: #fff;
      box-shadow: inset 2px 0 0 #6366f1;
    }
    .nav-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* Live run card in sidebar */
    .live-run-card {
      margin: 12px;
      padding: 14px;
      background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(124,58,237,0.08));
      border: 1px solid rgba(139,92,246,0.25);
      border-radius: var(--radius);
      position: relative;
      overflow: hidden;
    }
    .live-run-card.idle {
      background: rgba(255,255,255,0.03);
      border-color: rgba(255,255,255,0.06);
    }
    .live-run-card::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(200px 80px at 50% 0%, rgba(139,92,246,0.25), transparent 70%);
      opacity: 0;
      transition: var(--transition);
      pointer-events: none;
    }
    .live-run-card.running::before { opacity: 1; }
    .live-run-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--text-on-dark-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 10px;
    }
    .live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--text-on-dark-muted);
    }
    .live-run-card.running .live-dot {
      background: #10b981;
      box-shadow: 0 0 0 3px rgba(16,185,129,0.22);
      animation: pulse 1.6s infinite;
    }
    .live-run-card.running .live-run-label { color: #d1d5eb; }
    .live-run-id {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-on-dark-muted);
      word-break: break-all;
      margin-bottom: 8px;
    }
    .live-run-elapsed {
      font-size: 20px;
      font-weight: 700;
      color: #fff;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.01em;
      margin-bottom: 10px;
    }
    .live-run-channel {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      color: var(--text-on-dark-muted);
      background: rgba(255,255,255,0.04);
      padding: 3px 8px;
      border-radius: var(--radius-pill);
    }

    /* ── Topbar ── */
    .topbar {
      height: var(--topbar-h);
      background: var(--bg-topbar);
      backdrop-filter: saturate(180%) blur(12px);
      -webkit-backdrop-filter: saturate(180%) blur(12px);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 28px;
      gap: 16px;
      position: sticky;
      top: 0;
      z-index: 50;
    }
    .crumbs {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .crumb-sep { color: var(--text-muted); opacity: 0.6; }
    .crumb-current { color: var(--text-primary); font-weight: 600; }

    .topbar-spacer { flex: 1; }

    .tenant-select {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px 6px 12px;
      background: var(--bg-subtle);
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
      font-size: 12px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--transition);
    }
    .tenant-select:hover { background: var(--bg-subtle-2); }
    .tenant-avatar {
      width: 18px; height: 18px;
      border-radius: 5px;
      background: var(--brand-grad);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }

    .conn-pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 11.5px;
      color: var(--text-secondary);
      padding: 5px 11px 5px 9px;
      background: var(--bg-subtle);
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
    }
    .conn-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--text-muted);
    }
    .conn-dot.connected {
      background: var(--green);
      box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
    }
    .conn-dot.connecting { background: var(--amber); animation: pulse 1.5s infinite; }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.35; }
    }

    .user-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--brand-grad);
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 6px -2px rgba(79,70,229,0.45);
    }

    .icon-btn {
      width: 30px;
      height: 30px;
      border-radius: var(--radius-sm);
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-muted);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }
    .icon-btn:hover {
      background: var(--bg-subtle);
      color: var(--text-primary);
      border-color: var(--border);
    }

    /* ── Main content ── */
    .main {
      padding: 22px 28px 40px;
      max-width: 1680px;
      margin: 0 auto;
      width: 100%;
    }
    .main-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }
    .main-title {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--text-primary);
    }
    .main-subtitle {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 3px;
    }
    .main-actions { display: flex; gap: 8px; }

    /* ═══════════════════════════════════════════════════════════════
       BUTTONS
       ═══════════════════════════════════════════════════════════════ */
    .btn {
      font-family: var(--font-sans);
      font-size: 12.5px;
      font-weight: 500;
      padding: 8px 14px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-card);
      color: var(--text-primary);
      cursor: pointer;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      /* Centre the label. Without this, any button that is given a width (or
         stretched by a flex/grid parent) renders its text flush left, because
         inline-flex defaults to justify-content: flex-start. */
      justify-content: center;
      gap: 6px;
      text-align: center;
    }
    .btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
    .btn-primary {
      background: var(--brand-grad);
      color: var(--text-on-accent);
      border-color: transparent;
      box-shadow: 0 1px 2px rgba(79,70,229,0.3), inset 0 1px 0 rgba(255,255,255,0.18);
      font-weight: 600;
    }
    .btn-primary:hover {
      box-shadow: 0 6px 18px -4px rgba(79,70,229,0.5), inset 0 1px 0 rgba(255,255,255,0.22);
      transform: translateY(-1px);
      background: var(--brand-grad);
    }
    .btn-primary:active { transform: translateY(0); }
    .btn-lg { padding: 11px 22px; font-size: 13.5px; }
    .btn-sm { padding: 5px 11px; font-size: 11.5px; }
    .btn-ghost {
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-secondary);
    }
    .btn-ghost:hover {
      background: var(--bg-subtle);
      color: var(--text-primary);
      border-color: var(--border);
    }

    /* ═══════════════════════════════════════════════════════════════
       HERO — run control (form/chat + live KPIs)
       ═══════════════════════════════════════════════════════════════ */
    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 340px;
      gap: 18px;
      margin-bottom: 18px;
    }

    .hero-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .hero-head {
      padding: 16px 22px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
    }
    .hero-head-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
      letter-spacing: -0.005em;
    }
    .hero-head-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 1px;
    }

    /* Segmented pill */
    .channel-switch {
      position: relative;
      display: inline-flex;
      padding: 4px;
      background: var(--bg-subtle);
      border-radius: var(--radius-pill);
      border: 1px solid var(--border);
    }
    .seg-thumb {
      position: absolute;
      top: 4px;
      left: 4px;
      width: calc(50% - 4px);
      height: calc(100% - 8px);
      background: var(--brand-grad);
      border-radius: var(--radius-pill);
      box-shadow: 0 2px 8px -2px rgba(79,70,229,0.5);
      transition: transform var(--transition);
      z-index: 0;
    }
    .channel-switch[data-active="chatbot"] .seg-thumb { transform: translateX(100%); }
    .channel-tab {
      position: relative;
      z-index: 1;
      font-size: 12px;
      font-weight: 600;
      padding: 7px 18px;
      border: none;
      background: none;
      color: var(--text-secondary);
      cursor: pointer;
      white-space: nowrap;
      border-radius: var(--radius-pill);
      transition: color var(--transition);
    }
    .channel-tab:hover:not(.active) { color: var(--text-primary); }
    .channel-tab.active { color: #fff; }

    .channel-panel { display: none; padding: 22px; flex: 1; }
    .channel-panel.active {
      display: flex;
      flex-direction: column;
      animation: panel-fade 0.25s ease-out;
    }
    @keyframes panel-fade {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Form */
    .form-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px 18px;
    }
    .form-group { display: flex; flex-direction: column; gap: 6px; }
    .form-group.full { grid-column: 1 / -1; }
    .form-label {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-secondary);
    }
    .form-input, .form-select, .form-control {
      font-size: 13px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--text-primary);
      outline: none;
      transition: var(--transition);
      appearance: none;
      -webkit-appearance: none;
    }
    .form-select {
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 34px;
    }
    .form-input:focus, .form-select:focus, .form-control:focus {
      border-color: var(--indigo);
      box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
    }
    .form-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 22px;
      padding-top: 18px;
      border-top: 1px solid var(--border);
    }
    .form-hint {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Chat */
    .chat-container {
      display: flex;
      flex-direction: column;
      gap: 14px;
      flex: 1;
    }
    .chat-messages {
      flex: 1;
      min-height: 280px;
      max-height: 360px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--bg-subtle);
    }
    .chat-msg {
      max-width: 78%;
      padding: 10px 14px;
      border-radius: 14px;
      font-size: 13px;
      line-height: 1.45;
      word-wrap: break-word;
    }
    .chat-msg.bot {
      align-self: flex-start;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-bottom-left-radius: 4px;
      box-shadow: var(--shadow-sm);
    }
    .chat-msg.user {
      align-self: flex-end;
      background: var(--brand-grad);
      color: var(--text-on-accent);
      border-bottom-right-radius: 4px;
      box-shadow: 0 4px 12px -4px rgba(79,70,229,0.45);
    }
    .chat-msg.thinking {
      align-self: flex-start;
      background: var(--bg-card);
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-style: italic;
      border-bottom-left-radius: 4px;
    }
    .chat-input-row {
      display: flex;
      gap: 8px;
    }
    .chat-input-row input {
      flex: 1;
      font-size: 13px;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--text-primary);
      outline: none;
      transition: var(--transition);
    }
    .chat-input-row input:focus {
      border-color: var(--indigo);
      box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
    }

    /* ── Live KPIs column (right side of hero) ── */
    .kpi-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      padding: 18px 20px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .kpi-card-head {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .kpi-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 0;
      border-top: 1px solid var(--border);
    }
    .kpi-row:first-of-type { border-top: none; padding-top: 4px; }
    .kpi-label {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 12.5px;
      color: var(--text-secondary);
      font-weight: 500;
    }
    .kpi-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      background: var(--bg-subtle);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .kpi-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .kpi-value {
      font-size: 16px;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    .kpi-value.idle { color: var(--text-muted); font-weight: 500; }

    .status-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: var(--radius-pill);
      font-size: 11.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .status-chip::before {
      content: '';
      width: 6px; height: 6px;
      border-radius: 50%;
      background: currentColor;
    }
    .status-chip.idle { background: var(--bg-subtle); color: var(--text-muted); }
    .status-chip.processing {
      background: rgba(79,70,229,0.10);
      color: var(--indigo);
    }
    .status-chip.processing::before { animation: pulse 1.2s infinite; }
    .status-chip.complete { background: var(--green-bg); color: var(--green); }
    .status-chip.error { background: var(--red-bg); color: var(--red); }

    /* ═══════════════════════════════════════════════════════════════
       PIPELINE — horizontal timeline with animated connectors
       ═══════════════════════════════════════════════════════════════ */
    .pipeline-section {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
      margin-bottom: 18px;
    }
    .section-head {
      padding: 16px 22px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
    }
    .section-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .section-title-sub {
      font-size: 11.5px;
      font-weight: 500;
      color: var(--text-muted);
    }

    .progress-bar {
      height: 6px;
      background: var(--bg-subtle);
      position: relative;
      overflow: hidden;
    }
    .progress-fill {
      position: absolute;
      inset: 0 auto 0 0;
      width: 0%;
      background: var(--brand-grad-vivid);
      transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 0 12px rgba(139,92,246,0.5);
    }

    .pipeline {
      display: flex;
      align-items: stretch;
      padding: 26px 24px 24px;
      gap: 0;
      overflow-x: auto;
    }
    .pipeline-stage {
      flex: 1;
      min-width: 120px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      position: relative;
    }
    .stage-node {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: var(--bg-card);
      border: 2px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      z-index: 1;
    }
    .stage-node svg {
      width: 20px; height: 20px;
      stroke: currentColor; stroke-width: 2; fill: none;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .stage-name {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-secondary);
      text-align: center;
    }
    .stage-status {
      font-size: 10.5px;
      color: var(--text-muted);
      text-align: center;
      font-variant-numeric: tabular-nums;
    }

    /* Connector between stages */
    .pipeline-stage:not(:last-child)::after {
      content: '';
      position: absolute;
      top: 26px;
      left: calc(50% + 26px);
      right: calc(-50% + 26px);
      height: 2px;
      background: var(--border);
      z-index: 0;
    }
    .pipeline-stage.done:not(:last-child)::after,
    .pipeline-stage.warning:not(:last-child)::after {
      background: var(--brand-grad);
      box-shadow: 0 0 8px rgba(139,92,246,0.4);
    }

    .pipeline-stage.active .stage-node {
      border-color: var(--indigo);
      background: #fff;
      color: var(--indigo);
      box-shadow: 0 0 0 4px rgba(79,70,229,0.15), 0 8px 20px -6px rgba(79,70,229,0.4);
      animation: ring-pulse 2s infinite;
    }
    .pipeline-stage.active .stage-name { color: var(--indigo); }
    .pipeline-stage.active .stage-status { color: var(--indigo); }
    @keyframes ring-pulse {
      0%, 100% { box-shadow: 0 0 0 4px rgba(79,70,229,0.15), 0 8px 20px -6px rgba(79,70,229,0.4); }
      50% { box-shadow: 0 0 0 8px rgba(79,70,229,0.08), 0 8px 20px -6px rgba(79,70,229,0.4); }
    }

    .pipeline-stage.done .stage-node {
      background: var(--brand-grad);
      border-color: transparent;
      color: #fff;
      box-shadow: 0 6px 16px -4px rgba(79,70,229,0.45);
    }
    .pipeline-stage.done .stage-name { color: var(--text-primary); }
    .pipeline-stage.done .stage-status { color: var(--green); font-weight: 600; }

    .pipeline-stage.warning .stage-node {
      background: var(--amber-bg);
      border-color: var(--amber);
      color: var(--amber);
    }
    .pipeline-stage.warning .stage-name { color: var(--amber); }
    .pipeline-stage.warning .stage-status { color: var(--amber); font-weight: 600; }

    .pipeline-stage.error .stage-node {
      background: var(--red-bg);
      border-color: var(--red);
      color: var(--red);
    }
    .pipeline-stage.error .stage-name { color: var(--red); }
    .pipeline-stage.error .stage-status { color: var(--red); font-weight: 600; }

    /* ═══════════════════════════════════════════════════════════════
       LOWER SPLIT — event log (left) + output delivery (right)
       ═══════════════════════════════════════════════════════════════ */
    .lower-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
      gap: 18px;
      margin-bottom: 18px;
    }

    .panel {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* ── Event timeline ── */
    .event-log {
      flex: 1;
      padding: 8px 0;
      min-height: 320px;
      max-height: 420px;
      overflow-y: auto;
      mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
      -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    }
    .event-log .empty {
      color: var(--text-muted);
      font-style: italic;
      padding: 30px 22px;
      text-align: center;
      font-size: 13px;
    }
    .log-entry {
      display: grid;
      grid-template-columns: 32px 60px 1fr;
      align-items: start;
      gap: 12px;
      padding: 10px 22px;
      position: relative;
      transition: background 0.15s;
    }
    .log-entry:hover { background: var(--bg-subtle); }
    .log-entry::before {
      content: '';
      position: absolute;
      left: 37px;
      top: 28px;
      bottom: -10px;
      width: 2px;
      background: var(--border);
    }
    .log-entry:last-child::before { display: none; }
    .log-icon {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 1px;
      position: relative;
      z-index: 1;
      background: var(--bg-subtle);
      color: var(--text-muted);
      border: 2px solid var(--bg-card);
    }
    .log-icon svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .log-entry.info .log-icon { background: var(--blue-bg); color: var(--blue); }
    .log-entry.success .log-icon { background: var(--green-bg); color: var(--green); }
    .log-entry.warning .log-icon { background: var(--amber-bg); color: var(--amber); }
    .log-entry.error .log-icon { background: var(--red-bg); color: var(--red); }

    .log-time {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-muted);
      padding-top: 3px;
      font-variant-numeric: tabular-nums;
    }
    .log-msg {
      font-size: 12.5px;
      color: var(--text-primary);
      line-height: 1.5;
      padding-top: 2px;
      word-wrap: break-word;
    }
    .log-msg.warning { color: var(--amber); }
    .log-msg.error { color: var(--red); }

    /* ── Output delivery list ── */
    .output-list {
      display: flex;
      flex-direction: column;
      padding: 6px 0;
      flex: 1;
    }
    .output-row {
      padding: 14px 22px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.15s;
    }
    .output-row:last-child { border-bottom: none; }
    .output-row:hover { background: var(--bg-subtle); }
    .output-row-head {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .output-icon {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-sm);
      background: var(--bg-subtle);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .output-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .output-row.delivered .output-icon {
      background: var(--green-bg);
      color: var(--green);
    }
    .output-main { flex: 1; min-width: 0; }
    .output-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
    }
    .output-desc {
      font-size: 11.5px;
      color: var(--text-muted);
      margin-top: 1px;
    }
    .output-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      border-radius: var(--radius-pill);
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      background: var(--bg-subtle);
      color: var(--text-muted);
    }
    .output-chip::before {
      content: '';
      width: 5px; height: 5px;
      border-radius: 50%;
      background: currentColor;
    }
    .output-row.delivered .output-chip {
      background: var(--green-bg);
      color: var(--green);
    }
    .output-chevron {
      color: var(--text-muted);
      transition: transform 0.2s;
      flex-shrink: 0;
    }
    .output-row.open .output-chevron { transform: rotate(90deg); color: var(--indigo); }

    .output-preview {
      display: none;
      margin-top: 12px;
      padding: 14px;
      background: var(--bg-subtle);
      border-radius: var(--radius-sm);
      font-size: 12.5px;
      color: var(--text-secondary);
      line-height: 1.6;
    }
    .output-row.open .output-preview { display: block; }
    .output-preview pre {
      background: var(--bg-code);
      color: #e2e8f0;
      border-radius: var(--radius-sm);
      padding: 14px 16px;
      font-family: var(--font-mono);
      font-size: 11.5px;
      overflow-x: auto;
      white-space: pre;
      line-height: 1.6;
    }
    .preview-field { margin-bottom: 4px; }
    .preview-field strong { color: var(--text-primary); font-size: 11.5px; font-weight: 600; }
    .preview-badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: var(--radius-pill);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .preview-badge.green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
    .preview-badge.amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
    .preview-badge.blue { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
    .file-item {
      font-family: var(--font-mono);
      font-size: 11.5px;
      padding: 4px 0;
      color: var(--text-secondary);
    }
    .file-new {
      font-size: 9px;
      font-weight: 700;
      color: var(--green);
      margin-left: 8px;
      padding: 1px 6px;
      background: var(--green-bg);
      border-radius: 4px;
      letter-spacing: 0.05em;
    }
    .slack-preview-box {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 12px 14px;
    }
    .slack-bot {
      font-weight: 700;
      font-size: 13px;
      color: var(--text-primary);
      margin-bottom: 6px;
    }
    .slack-bot-tag {
      font-size: 9px;
      background: var(--blue-bg);
      color: var(--blue);
      padding: 2px 6px;
      border-radius: 4px;
      margin-left: 6px;
      font-weight: 600;
      letter-spacing: 0.05em;
    }
    .toast-preview {
      background: var(--bg-card);
      border: 1px solid var(--green-border);
      border-left: 3px solid var(--green);
      border-radius: var(--radius-sm);
      padding: 12px 16px;
    }

    /* ═══════════════════════════════════════════════════════════════
       RUN SUMMARY FLOATING TOAST
       ═══════════════════════════════════════════════════════════════ */
    .run-summary {
      position: fixed;
      right: 28px;
      bottom: 28px;
      width: 360px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      padding: 20px;
      z-index: 200;
      transform: translateX(calc(100% + 40px));
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .run-summary.visible { transform: translateX(0); }
    .run-summary::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: var(--brand-grad-vivid);
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .run-summary-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .run-summary-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .run-summary-title svg {
      width: 18px; height: 18px;
      color: var(--green);
      stroke: currentColor; stroke-width: 2.5; fill: none;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .run-summary-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin: 14px 0;
    }
    .run-summary-stat {
      background: var(--bg-subtle);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
    }
    .run-summary-stat .label {
      font-size: 10.5px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 3px;
    }
    .run-summary-stat .value {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      font-variant-numeric: tabular-nums;
    }
    .run-summary-actions {
      display: flex;
      gap: 6px;
      margin-top: 4px;
    }
    .run-summary-actions .btn { flex: 1; justify-content: center; }

    /* Toggle switch */
    .toggle {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      cursor: pointer;
      font-size: 12.5px;
      color: var(--text-secondary);
      font-weight: 500;
      user-select: none;
      padding: 6px 12px;
      border-radius: var(--radius-pill);
      border: 1px solid var(--border);
      background: var(--bg-card);
      transition: var(--transition);
    }
    .toggle:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
    .toggle input { position: absolute; opacity: 0; pointer-events: none; }
    .toggle-track {
      position: relative;
      width: 32px;
      height: 18px;
      background: var(--border-strong);
      border-radius: var(--radius-pill);
      transition: background var(--transition);
      flex-shrink: 0;
    }
    .toggle-thumb {
      position: absolute;
      top: 2px; left: 2px;
      width: 14px;
      height: 14px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
      transition: transform var(--transition);
    }
    .toggle input:checked ~ .toggle-track { background: var(--brand-grad); }
    .toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(14px); }
    .toggle input:checked ~ .toggle-label { color: var(--indigo); }
    .toggle-label { font-weight: 600; }

    /* ═══════════════ Rules / tab views ═══════════════ */
    .rules-view { display: none; }
    .rules-view.active { display: block; }
    .main.dashboard-hidden > *:not(.rules-view) { display: none !important; }

    /* ═══════════════ Integrations view ═══════════════ */
    .integrations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .integ-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
    .integ-card-header { display: flex; align-items: center; justify-content: space-between; }
    .integ-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
    .integ-card-type { font-size: 11px; color: var(--text-muted); }
    .integ-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .integ-dot.ok { background: var(--green); }
    .integ-dot.degraded { background: var(--amber); }
    .integ-dot.unavailable { background: var(--red); }
    .integ-dot.unknown { background: var(--text-muted); }
    .integ-status-label { font-size: 12px; color: var(--text-muted); }
    .integ-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 16px 0 8px; }

    /* ═══════════════ Metrics KPI chips ═══════════════ */
    .kpi-chip { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 18px; min-width: 140px; }
    .kpi-chip-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
    .kpi-chip-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }

    /* ═══════════════ Settings ═══════════════ */
    .settings-section-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }

    .rules-note {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 10px 14px;
      background: var(--amber-bg);
      border: 1px solid var(--amber-border);
      color: var(--amber);
      border-radius: var(--radius);
      font-size: 12.5px;
      margin-bottom: 16px;
    }
    .rules-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

    .rules-table-wrap {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
    }
    .rules-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .rules-table thead th {
      text-align: left;
      padding: 12px 18px;
      font-size: 10.5px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border-bottom: 1px solid var(--border);
      background: var(--bg-subtle);
    }
    .rules-table tbody td {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      color: var(--text-primary);
      vertical-align: middle;
    }
    .rules-table tbody tr:last-child td { border-bottom: none; }
    .rules-table tbody tr:hover { background: var(--bg-subtle); }
    .rules-table .rule-name { font-weight: 600; }
    .rules-table .rule-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
    .rules-table .rule-cond {
      font-family: var(--font-mono);
      font-size: 11.5px;
      background: var(--bg-subtle);
      padding: 2px 8px;
      border-radius: var(--radius-xs);
      color: var(--text-secondary);
    }

    .sev-chip {
      display: inline-flex;
      align-items: center;
      padding: 2px 9px;
      border-radius: var(--radius-pill);
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .sev-chip.low { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
    .sev-chip.medium { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
    .sev-chip.high { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
    .sev-chip.critical { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

    .rules-table tr.rules-group td {
      background: var(--bg-subtle);
      padding: 10px 18px;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }
    .rules-group-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--indigo);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .rules-group-hint {
      margin-left: 10px;
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 500;
    }
    .rules-table tr.rule-row.builtin { background: transparent; }
    .rules-table tr.rule-row.builtin:hover { background: var(--bg-subtle); }
    .builtin-chip {
      display: inline-flex;
      align-items: center;
      padding: 3px 9px;
      border-radius: var(--radius-pill);
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      background: rgba(79,70,229,0.10);
      color: var(--indigo);
      border: 1px solid rgba(79,70,229,0.25);
    }

    .rules-empty {
      padding: 60px 20px;
      text-align: center;
      color: var(--text-muted);
    }
    .rules-empty svg {
      width: 40px; height: 40px;
      stroke: var(--text-muted); stroke-width: 1.5; fill: none;
      stroke-linecap: round; stroke-linejoin: round;
      margin-bottom: 12px;
    }
    .rules-empty .empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
    .rules-empty .empty-sub { font-size: 12.5px; margin-bottom: 16px; }

    .icon-action {
      background: transparent;
      border: 1px solid transparent;
      border-radius: var(--radius-xs);
      padding: 5px 7px;
      cursor: pointer;
      color: var(--text-muted);
      transition: var(--transition);
    }
    .icon-action:hover { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border); }
    .icon-action.danger:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
    .icon-action svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

    /* Drawer for create/edit */
    .drawer-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.35);
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--transition);
      z-index: 300;
    }
    .drawer-backdrop.visible { opacity: 1; pointer-events: auto; }

    .drawer {
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      width: 440px;
      max-width: 100%;
      background: var(--bg-card);
      box-shadow: var(--shadow-lg);
      transform: translateX(100%);
      transition: transform var(--transition);
      z-index: 301;
      display: flex;
      flex-direction: column;
    }
    .drawer.visible { transform: translateX(0); }
    .drawer-head {
      padding: 18px 22px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .drawer-title { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
    .drawer-body {
      flex: 1;
      padding: 20px 22px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .drawer-foot {
      padding: 14px 22px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      background: var(--bg-subtle);
    }
    .inline-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

    /* Simulation banner */
    .sim-banner {
      display: none;
      align-items: center;
      gap: 10px;
      padding: 10px 16px;
      margin-bottom: 16px;
      background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(124,58,237,0.06));
      border: 1px solid rgba(79,70,229,0.25);
      border-radius: var(--radius);
      color: var(--indigo);
      font-size: 12.5px;
      font-weight: 500;
    }
    .sim-banner.visible { display: flex; }
    .sim-banner svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

    /* ═══════════════════════════════════════════════════════════════
       RESPONSIVE — narrow screens
       ═══════════════════════════════════════════════════════════════ */
    @media (max-width: 1200px) {
      .hero { grid-template-columns: 1fr; }
      .lower-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 960px) {
      :root { --sidebar-w: 64px; }
      .brand-text, .nav-section, .nav-item span, .live-run-card { display: none; }
      .nav-item { justify-content: center; padding: 10px; }
      .form-grid { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 640px) {
      .form-grid { grid-template-columns: 1fr; }
      .main { padding: 16px; }
    }

    /* Scrollbar polish */
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
      background: var(--border-strong);
      border-radius: 10px;
      border: 3px solid var(--bg-card);
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

    /* Login overlay */
    #loginOverlay {
      position: fixed; inset: 0; z-index: 10000;
      background: var(--bg-body, #0f1115);
      display: none; align-items: center; justify-content: center;
    }
    #loginOverlay.visible { display: flex; }
    .login-card {
      width: 100%; max-width: 380px; padding: 32px 28px;
      background: var(--bg-card, #1a1d24); border: 1px solid var(--border, #2a2e37);
      border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    }
    .login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
    .login-brand .brand-mark {
      width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
      background: var(--accent, #6366f1); color: #fff; font-weight: 700; font-size: 14px;
    }
    .login-title { font-size: 18px; font-weight: 700; color: var(--text, #e6e8ec); }
    .login-sub { font-size: 12.5px; color: var(--text-muted, #9aa0aa); margin: 4px 0 22px; }
    .login-field { margin-bottom: 14px; }
    .login-field label { display: block; font-size: 12px; color: var(--text-muted, #9aa0aa); margin-bottom: 6px; }
    .login-field input {
      width: 100%; padding: 10px 12px; font-size: 13px; box-sizing: border-box;
      background: var(--bg-input, #12141a); color: var(--text, #e6e8ec);
      border: 1px solid var(--border, #2a2e37); border-radius: 8px;
    }
    .login-btn {
      width: 100%; margin-top: 8px; padding: 11px; font-size: 13.5px; font-weight: 600;
      background: var(--accent, #6366f1); color: #fff; border: none; border-radius: 8px; cursor: pointer;
    }
    .login-btn:hover { filter: brightness(1.08); }
    .login-msg { font-size: 12.5px; color: #f87171; margin-top: 12px; min-height: 16px; text-align: center; }

    /* ── Tenant switcher dropdown (shared: portal + operator) ── */
    .tenant-switcher-wrap { position: relative; }
    .tenant-switcher-menu {
      position: absolute; right: 0; top: calc(100% + 6px); z-index: 200;
      min-width: 240px; max-height: 360px; overflow-y: auto;
      background: var(--bg-panel, #fff); border: 1px solid var(--border, #e2e8f0);
      border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px;
    }
    .tenant-switcher-item {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
      padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text, #1e293b);
    }
    .tenant-switcher-item:hover { background: var(--bg-subtle, #f1f5f9); }
    .tenant-switcher-item.active { background: var(--bg-subtle-2, #e2e8f0); font-weight: 600; }
    .tenant-switcher-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tenant-switcher-status {
      font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
      padding: 2px 7px; border-radius: 999px; flex: none;
    }
    .tenant-switcher-status.active { background: var(--green-bg, #dcfce7); color: var(--green, #16a34a); }
    .tenant-switcher-status.pending { background: var(--amber-bg, #fef3c7); color: var(--amber, #d97706); }
    .tenant-switcher-status.suspended { background: var(--red-bg, #fee2e2); color: var(--red, #dc2626); }
    .tenant-switcher-empty { padding: 10px 12px; font-size: 12px; color: var(--text-muted, #94a3b8); }
    .tenant-switcher-operator {
      display: block; margin-top: 4px; padding: 8px 10px; border-top: 1px solid var(--border, #e2e8f0);
      font-size: 12px; color: var(--accent, #6366f1); text-decoration: none;
    }
    .tenant-switcher-operator:hover { text-decoration: underline; }

    /* ── Notification Channels panel (Settings) ── */
    #notifChannelsList { display: flex; flex-direction: column; gap: 12px; }
    .notif-row {
      border: 1px solid var(--border, #e2e8f0);
      border-radius: 10px;
      padding: 14px 16px;
      background: var(--bg-subtle, #f8fafc);
    }
    .notif-row--disabled { opacity: 0.55; }
    .notif-row-toggle { align-items: flex-start; gap: 12px; }
    .notif-target-wrap { margin: 12px 0 0 46px; max-width: 440px; }
    .notif-target-label {
      display: block; font-size: 11px; font-weight: 600;
      color: var(--text-muted, #64748b); margin-bottom: 5px;
      text-transform: uppercase; letter-spacing: .03em;
    }
    .notif-target {
      display: block; width: 100%; box-sizing: border-box;
      padding: 8px 11px; font-size: 13px; line-height: 1.4;
      border: 1px solid var(--border, #cbd5e1); border-radius: 7px;
      background: var(--bg-panel, #fff); color: var(--text, #1e293b);
      font-family: inherit;
    }
    .notif-target:focus {
      outline: none; border-color: var(--accent, #6366f1);
      box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    }
    textarea.notif-target { resize: vertical; min-height: 62px; }
    .notif-target::placeholder { color: var(--text-muted, #94a3b8); }
    /* Read-only note under a target input — used for the webhook's API-managed
       header names, which have no input of their own (values are secrets). */
    .notif-target-hint {
      display: block; margin-top: 5px;
      font-size: 11.5px; line-height: 1.45;
      color: var(--text-muted, #64748b);
    }
