/* =============================================================================
   Watchtower — Cyberpunk Page Styles
   Inherits aesthetic energy from Strategy Lab. Same world, own page.
   ============================================================================= */

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

:root {
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-dim: rgba(245, 158, 11, 0.15);
    --gold-glow: rgba(245, 158, 11, 0.4);
    --cyan: #06b6d4;
    --cyan-light: #22d3ee;
    --cyan-dim: rgba(6, 182, 212, 0.15);
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --purple-dim: rgba(139, 92, 246, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --bg-deep: #080810;
    --bg-card: rgba(16, 16, 26, 0.85);
    --bg-card-hover: rgba(22, 22, 36, 0.95);
    --bg-surface: rgba(20, 20, 32, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --font-display: 'Cinzel', serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-tech: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === BACKGROUND LAYERS === */
.bg-layer { position: fixed; inset: 0; pointer-events: none; }
.bg-grid {
    z-index: -8;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-pulse 8s ease-in-out infinite;
}
@keyframes grid-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}
.bg-glow {
    z-index: -7;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(139, 92, 246, 0.07), transparent 60%),
        radial-gradient(ellipse 500px 500px at 80% 70%, rgba(6, 182, 212, 0.06), transparent 60%),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(245, 158, 11, 0.04), transparent 70%);
    animation: glow-shift 18s ease-in-out infinite;
}
@keyframes glow-shift {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50%      { background-position: 30% 70%, 70% 30%, 50% 50%; }
}
.bg-scanlines {
    z-index: -6;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px,
        rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
    animation: scanline-drift 8s linear infinite;
}
@keyframes scanline-drift { 0% { transform: translateY(0); } 100% { transform: translateY(4px); } }

/* === BLINKING LEDS === */
.led-container { position: fixed; inset: 0; z-index: -5; pointer-events: none; }
.led {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    animation: led-blink 2.4s ease-in-out infinite;
}
.led-cyan  { background: var(--cyan);  box-shadow: 0 0 10px var(--cyan); }
.led-gold  { background: var(--gold);  box-shadow: 0 0 10px var(--gold); }
.led-red   { background: var(--red);   box-shadow: 0 0 10px var(--red); }
.led-green { background: var(--green); box-shadow: 0 0 10px var(--green); }
@keyframes led-blink { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }

/* === FLOATING PARTICLES === */
.particle-container { position: fixed; inset: 0; z-index: -4; pointer-events: none; overflow: hidden; }
.particle {
    position: absolute;
    width: 2px; height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particle-float linear infinite;
}
@keyframes particle-float {
    from { transform: translateY(105vh) translateX(0); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.8; }
    to   { transform: translateY(-5vh) translateX(20px); opacity: 0; }
}

/* === FIBER OPTIC PULSES === */
.fiber-optic-container { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden; }
.fiber {
    position: absolute;
    top: -10vh; bottom: -10vh;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--cyan-glow), transparent);
    opacity: 0.3;
    animation: fiber-pulse 4s ease-in-out infinite;
}
.fiber-gold { background: linear-gradient(180deg, transparent, var(--gold-glow), transparent); }
@keyframes fiber-pulse {
    0%, 100% { opacity: 0.1; transform: translateY(-50%); }
    50%      { opacity: 0.7; transform: translateY(50%); }
}

/* === DATA STREAM === */
.data-stream-container {
    position: fixed; top: 0; bottom: 0; right: 8px;
    width: 110px; z-index: -2;
    pointer-events: none; overflow: hidden;
    opacity: 0.18;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--cyan);
}
.data-stream {
    position: absolute;
    top: -100%; left: 0; right: 0;
    line-height: 1.6;
    white-space: pre;
    text-align: right;
    animation: stream-fall linear infinite;
}
@keyframes stream-fall { from { top: -100%; } to { top: 100%; } }

/* === NAVBAR === */
.wt-navbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 24px;
    padding: 14px 28px;
    background: rgba(8, 8, 16, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(245, 158, 11, 0.08), 0 1px 0 rgba(6, 182, 212, 0.08);
}
.wt-nav-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-primary); text-decoration: none;
    font-family: var(--font-display);
    transition: filter 0.2s;
}
.wt-nav-brand:hover { filter: brightness(1.2); }
.wt-nav-brand-icon { font-size: 26px; filter: drop-shadow(0 0 8px var(--cyan-glow)); }
.wt-nav-brand-text {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, var(--cyan-light), var(--gold-light));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    letter-spacing: 0.04em;
}
.wt-nav-brand-tag {
    font-family: var(--font-tech); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.2em;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    text-transform: uppercase;
}
.wt-nav-links {
    flex: 1;
    display: flex;
    /* CP-K — stretch children so all link buttons match the tallest
       (e.g. when one wraps to two lines, the others grow with it). */
    align-items: stretch;
    gap: 8px;
    justify-content: flex-end;
}
.wt-nav-link {
    display: flex; align-items: center; gap: 8px;
    /* Baseline height keeps single-line buttons uniform when no
       sibling wraps — paired with the parent's align-items:stretch
       this guarantees consistent vertical sizing in either case. */
    min-height: 40px;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.wt-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
    border-color: var(--border-light);
}
.wt-nav-link-realm {
    background: linear-gradient(135deg, var(--purple-dim), var(--cyan-dim));
    border-color: var(--border-light);
    color: var(--text-primary);
}
.wt-nav-user {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* === MAIN === */
.wt-main {
    position: relative; z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 28px 80px;
}

/* === PAGE HEADER === */
.wt-page-header { margin-bottom: 28px; }
.wt-page-title {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 700;
    background: linear-gradient(135deg, var(--cyan-light), var(--gold-light));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}
.wt-page-subtitle { color: var(--text-secondary); font-size: 16px; }

/* === TABS === */
.wt-tabs {
    display: flex; gap: 4px;
    padding: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 32px;
}
.wt-tab {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 15px; font-weight: 500;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}
.wt-tab:not(.wt-tab-disabled):hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.wt-tab-active {
    color: var(--cyan-light);
    background: linear-gradient(135deg, var(--cyan-dim), var(--purple-dim)) !important;
    box-shadow: 0 0 0 1px var(--cyan-glow), 0 0 20px var(--cyan-glow);
}
.wt-tab-disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.55; }
.wt-tab-icon { font-size: 18px; }
.wt-tab-soon {
    font-family: var(--font-tech); font-size: 9px;
    letter-spacing: 0.18em;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* === REALM SPLIT === */
.wt-realm-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) { .wt-realm-split { grid-template-columns: 1fr; } }
.wt-realm {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}
.wt-realm::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at top, var(--realm-glow) 0%, transparent 60%);
    opacity: 0.4;
}
.wt-realm-cipher {
    --realm-glow: var(--cyan-glow);
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1), inset 0 0 40px rgba(6, 182, 212, 0.04);
}
.wt-realm-sovereign {
    --realm-glow: var(--gold-glow);
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), inset 0 0 40px rgba(245, 158, 11, 0.04);
}
.wt-realm-header {
    display: flex; align-items: baseline; gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    position: relative; z-index: 1;
}
.wt-realm-glyph { font-size: 22px; }
.wt-realm-cipher    .wt-realm-glyph { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }
.wt-realm-sovereign .wt-realm-glyph { color: var(--gold); text-shadow: 0 0 10px var(--gold-glow); }
.wt-realm-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; flex: 1; }
.wt-realm-cipher    .wt-realm-title { color: var(--cyan-light); }
.wt-realm-sovereign .wt-realm-title { color: var(--gold-light); }
.wt-realm-tag {
    font-family: var(--font-tech); font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* === CONNECTION LIST === */
.wt-connection-list {
    display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 16px;
    position: relative; z-index: 1;
}
.wt-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-style: italic;
}

/* === CONNECTION CARD === */
.wt-conn-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}
.wt-conn-card:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.wt-realm-cipher    .wt-conn-card { border-left: 3px solid var(--cyan); }
.wt-realm-sovereign .wt-conn-card { border-left: 3px solid var(--gold); }

.wt-conn-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.wt-conn-info { min-width: 0; }
.wt-conn-name {
    font-family: var(--font-tech);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}
.wt-conn-label {
    color: var(--text-muted);
    font-weight: 400;
    font-family: var(--font-body);
    letter-spacing: 0;
    margin-left: 8px;
}
.wt-conn-meta {
    display: flex; gap: 10px; align-items: center;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.wt-conn-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--font-tech);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.wt-status-active   { background: var(--green-dim); color: var(--green); }
.wt-status-error    { background: var(--red-dim);   color: var(--red); }
.wt-status-revoked  { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.wt-conn-actions { display: flex; gap: 6px; }
.wt-icon-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
}
.wt-icon-btn:hover { color: var(--text-primary); border-color: var(--border-light); background: rgba(255,255,255,0.04); }
.wt-icon-btn-danger:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }

/* === BUTTONS === */
.wt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 14px; font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
}
.wt-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.wt-btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    border-color: transparent;
    color: white;
    box-shadow: 0 0 20px rgba(139,92,246,0.3);
}
.wt-btn-primary:hover { filter: brightness(1.15); box-shadow: 0 0 28px rgba(139,92,246,0.45); }
.wt-btn-ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.wt-btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }
.wt-btn-danger { background: var(--red); border-color: var(--red); color: white; }
.wt-btn-danger:hover { filter: brightness(1.1); }
.wt-btn-cipher {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--cyan);
    color: var(--cyan-light);
}
.wt-btn-cipher:hover { background: var(--cyan-dim); box-shadow: 0 0 16px var(--cyan-glow); }
.wt-btn-sovereign {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--gold);
    color: var(--gold-light);
}
.wt-btn-sovereign:hover { background: var(--gold-dim); box-shadow: 0 0 16px var(--gold-glow); }
.wt-add-btn { width: 100%; padding: 14px; border-style: dashed; font-size: 14px; position: relative; z-index: 1; }

/* === MODAL === */
.wt-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fade-in 0.18s ease-out;
}
.wt-modal-overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.wt-modal {
    width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(139,92,246,0.2), 0 20px 60px rgba(0,0,0,0.5);
    animation: modal-pop 0.2s ease-out;
}
.wt-modal-small { max-width: 440px; }
@keyframes modal-pop {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.wt-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.wt-modal-title { font-family: var(--font-display); font-size: 20px; color: var(--text-primary); }
.wt-modal-close {
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 20px; line-height: 1;
    cursor: pointer;
}
.wt-modal-close:hover { color: var(--text-primary); border-color: var(--border-light); }
.wt-modal-form, .wt-modal-body { padding: 20px 24px; }

/* === FORM === */
.wt-form-group { margin-bottom: 16px; }
.wt-label {
    display: block;
    font-family: var(--font-tech); font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.wt-label-hint {
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-body);
    font-size: 11px;
    margin-left: 8px;
}
.wt-input, .wt-textarea, select.wt-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: border 0.15s, box-shadow 0.15s;
}
.wt-input:focus, .wt-textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-dim); }
.wt-textarea { resize: vertical; min-height: 90px; }
.wt-input-help { margin-top: 6px; font-size: 11px; color: var(--text-muted); font-style: italic; }
.wt-checkbox-row { display: flex; align-items: center; gap: 10px; }
.wt-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cyan); }
.wt-checkbox-row label {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
}
.wt-form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
}
.wt-form-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--red-dim);
    border: 1px solid var(--red);
    border-radius: 6px;
    color: var(--red);
    font-size: 13px;
    font-family: var(--font-mono);
}

/* spinner */
.wt-btn-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === MODAL WARNING === */
.wt-modal-warning {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--red-dim);
    border-left: 3px solid var(--red);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

/* === TOAST === */
.toast-container {
    position: fixed; top: 80px; right: 20px;
    z-index: 1100;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: toast-in 0.2s ease-out;
}
.toast-success { border-left: 4px solid var(--green); }
.toast-error   { border-left: 4px solid var(--red); }
.toast-info    { border-left: 4px solid var(--cyan); }
@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* =============================================================================
   WT-2 — BOTS TAB / SLOT RACK
   Functional layer: card components for slots + monitors. SVG chassis frame
   (cables, CRT bezels, master power strip illustration) lands in a polish pass.
   ============================================================================= */

/* Tab content panels — only one wt-panel visible at a time. The hidden
   attribute on <section class="wt-panel"> is set/unset by showTab() in JS. */
.wt-panel[hidden] { display: none !important; }

/* === Membership gate banner === */
.wt-membership-gate {
    max-width: 560px;
    margin: 32px auto;
    padding: 32px 28px;
    text-align: center;
    background: linear-gradient(180deg, rgba(239,68,68,0.08), rgba(239,68,68,0.02));
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 16px;
    box-shadow: 0 0 32px rgba(239,68,68,0.12);
}
.wt-gate-icon {
    font-size: 40px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(239,68,68,0.5));
}
.wt-gate-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.wt-gate-copy {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* === Limits / usage strip === */
.wt-bots-meta {
    display: flex;
    gap: 12px;
    padding: 16px 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.wt-bots-meta-cell {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wt-bots-meta-label {
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.wt-bots-meta-value {
    font-family: var(--font-tech);
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

/* === Slot rack === */
.wt-slot-rack {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    padding: 8px 0 32px;
}

.wt-slot {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 14px;
    padding: 18px;
    min-height: 240px;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

/* Empty bay — dashed outline + INSERT CARD glow */
.wt-slot-empty {
    border-style: dashed;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: rgba(16, 16, 26, 0.4);
}
.wt-slot-empty:hover {
    border-color: var(--cyan);
    color: var(--cyan-light);
    box-shadow: 0 0 24px rgba(6,182,212,0.18);
    background: rgba(6,182,212,0.04);
}
.wt-slot-glyph {
    font-size: 44px;
    opacity: 0.5;
    margin-bottom: 6px;
    line-height: 1;
}
.wt-slot-cta {
    font-family: var(--font-tech);
    font-size: 12px;
    letter-spacing: 0.22em;
    margin-bottom: 10px;
}
.wt-slot-index {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

/* Realm-skinned occupied slots */
.wt-slot-cipher {
    border-color: var(--cyan);
    box-shadow: 0 0 18px rgba(6,182,212,0.12);
    background: linear-gradient(180deg, rgba(6,182,212,0.04), rgba(16,16,26,0.85));
}
.wt-slot-cipher .wt-slot-name { color: var(--cyan-light); }

.wt-slot-sovereign {
    border-color: var(--gold);
    box-shadow: 0 0 18px rgba(245,158,11,0.12);
    background: linear-gradient(180deg, rgba(245,158,11,0.04), rgba(16,16,26,0.85));
}
.wt-slot-sovereign .wt-slot-name { color: var(--gold-light); }

/* Slot internals */
.wt-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.wt-slot-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mode badge */
.wt-slot-mode {
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.18em;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid;
    text-transform: uppercase;
    flex-shrink: 0;
}
.wt-mode-off  { color: var(--text-muted);    border-color: var(--border-light); background: rgba(255,255,255,0.03); }
.wt-mode-test { color: #60a5fa;              border-color: rgba(96,165,250,0.5);  background: rgba(96,165,250,0.10); }
.wt-mode-live { color: var(--green);         border-color: rgba(16,185,129,0.5);  background: rgba(16,185,129,0.10); box-shadow: 0 0 10px rgba(16,185,129,0.25); }

/* Slot body — symbols + stats */
.wt-slot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.wt-slot-symbols {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    word-break: break-word;
}
.wt-slot-stat-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}
.wt-pnl-positive { color: var(--green); }
.wt-pnl-negative { color: var(--red); }

.wt-slot-status {
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 4px 0;
}
.wt-status-running { color: var(--green); }
.wt-status-stopped { color: var(--text-muted); }
.wt-status-error   { color: var(--red); }
.wt-status-halted  { color: #f59e0b; }

/* Slot actions */
.wt-slot-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}
.wt-btn-action {
    flex: 1;
    padding: 7px 8px;
    font-family: var(--font-tech);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.wt-btn-action:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.wt-btn-action-start  { color: var(--green); border-color: rgba(16,185,129,0.3); }
.wt-btn-action-start:hover  { background: rgba(16,185,129,0.10); }
.wt-btn-action-stop   { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.wt-btn-action-stop:hover   { background: rgba(251,191,36,0.10); }
.wt-btn-action-delete { color: var(--red); border-color: rgba(239,68,68,0.3); flex: 0 0 auto; padding: 7px 12px; }
.wt-btn-action-delete:hover { background: rgba(239,68,68,0.10); }

/* Mode toggle row (off/test/live mini-buttons) */
.wt-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
}
.wt-mode-btn {
    flex: 1;
    padding: 5px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-tech);
    font-size: 9px;
    letter-spacing: 0.18em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.wt-mode-btn:hover { color: var(--text-primary); }
.wt-mode-btn.wt-mode-btn-active { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.wt-mode-btn.wt-mode-btn-active.wt-mode-btn-test { color: #60a5fa; }
.wt-mode-btn.wt-mode-btn-active.wt-mode-btn-live { color: var(--green); box-shadow: inset 0 0 8px rgba(16,185,129,0.2); }

/* === Kill-all bar === */
.wt-kill-bar {
    margin-top: 32px;
    padding: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.wt-kill-all {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 56px;
    font-family: var(--font-tech);
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    color: white;
    border: 2px solid #ef4444;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(239,68,68,0.35);
    transition: all 0.2s;
}
.wt-kill-all:hover {
    box-shadow: 0 0 40px rgba(239,68,68,0.65);
    transform: translateY(-1px);
}
.wt-kill-icon { font-size: 18px; }
.wt-kill-label {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.22em;
}
.wt-kill-sub {
    font-size: 10px;
    font-family: var(--font-body);
    letter-spacing: 0.04em;
    opacity: 0.85;
    text-transform: none;
}

/* Form row for side-by-side fields in deploy modal */
.wt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }


/* =============================================================================
   WT-2 UI REBUILD — Bot grid (toaster cards), slot bays, switchboard, chassis
   ============================================================================= */

/* Bigger page header — title floor 64px, navbar scaled to match */
.wt-page-title    { font-size: 72px; line-height: 1.05; letter-spacing: 0.02em; font-weight: 800; }
.wt-page-subtitle { font-size: 18px; line-height: 1.5; }
.wt-page-header   { margin-bottom: 44px; }
@media (max-width: 720px) {
    .wt-page-title { font-size: 56px; }
}

/* Scale navbar up to match Strategy Lab — bigger brand text + icon, more padding */
.wt-navbar { padding: 20px 32px; gap: 28px; }
.wt-nav-brand-icon { font-size: 36px; }
.wt-nav-brand-text { font-size: 28px; letter-spacing: 0.04em; }
.wt-nav-brand-tag  { font-size: 11px; padding: 3px 10px; }
.wt-nav-link       { font-size: 14px; padding: 8px 14px; }

/* Nav link tag style (carry-over from inline span) */
.wt-nav-link-tag {
    color: var(--text-muted);
    font-family: var(--font-tech, monospace);
    font-size: 9px;
    letter-spacing: 0.2em;
    margin-left: 4px;
}

/* Realm copy under the realm header */
.wt-realm-copy {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
    padding: 0 4px;
}
/* "Submit a request" links — explicit cyan #06b6d4 (readable on dark) */
.wt-realm-copy a { color: #06b6d4; text-decoration: underline; }
.wt-realm-copy a:hover { color: #22d3ee; }
.wt-realm-sovereign .wt-realm-copy a { color: var(--gold-light); }
.wt-realm-sovereign .wt-realm-copy a:hover { color: #fbbf24; }

/* Logout button + user badge in navbar (matches SL pattern) */
.wt-nav-user { display: flex; align-items: center; gap: 12px; }
.wt-user-badge {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
}
.wt-btn-logout {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
    font-family: var(--font-tech, monospace);
    font-size: 12px; letter-spacing: 0.12em;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.wt-btn-logout:hover { background: rgba(239,68,68,0.25); }

/* Realm picker tiles in Deploy New Bot modal */
.wt-realm-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-realm-option {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.wt-realm-option:hover { border-color: var(--cyan-mid, #2dd4bf); }
.wt-realm-option input[type=radio] { display: none; }
.wt-realm-option-glyph { font-size: 24px; }
.wt-realm-option-label { font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.wt-realm-option-tag   { font-family: var(--font-tech, monospace); font-size: 10px; color: var(--text-muted); letter-spacing: 0.12em; margin-left: 4px; }
.wt-realm-option[data-realm="cipher"]    .wt-realm-option-glyph { color: var(--cyan-light); }
.wt-realm-option[data-realm="sovereign"] .wt-realm-option-glyph { color: var(--gold-light); }
.wt-realm-option-active {
    border-color: var(--cyan-mid, #2dd4bf);
    background: rgba(45,212,191,0.08);
    box-shadow: inset 0 0 0 1px rgba(45,212,191,0.4);
}
.wt-realm-option-active[data-realm="sovereign"] {
    border-color: var(--gold-mid, #d4a017);
    background: rgba(212,160,23,0.08);
    box-shadow: inset 0 0 0 1px rgba(212,160,23,0.4);
}

/* Inline empty-state CTA inside the modal */
.wt-form-empty {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(251,191,36,0.06);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.wt-link-btn {
    background: none; border: none;
    color: #06b6d4;
    font: inherit; padding: 0; margin-left: 4px;
    cursor: pointer; text-decoration: underline;
}
.wt-link-btn:hover { color: #22d3ee; }

/* Toolbar above bot grid. CP-M kept the single-line / nowrap layout;
   CP-O reverts justify-content to space-between so the +New Bot /
   Kill All buttons sit on the right edge with the empty space
   between them and the stat row. */
.wt-bots-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 18px;
    margin-bottom: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
}
.wt-bots-meta {
    display: flex;
    gap: 14px;
    flex-wrap: nowrap;
    flex-shrink: 0;        /* don't squash the stat row */
    min-width: 0;
}
.wt-bots-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;   /* keep label + value on their own lines, no internal wrap */
    width: auto;           /* content-sized */
}
.wt-bots-meta-label {
    font-size: 10px; letter-spacing: 0.18em;
    color: var(--text-muted); text-transform: uppercase;
}
.wt-bots-meta-value {
    font-family: var(--font-tech, monospace);
    font-size: 16px; color: var(--text-primary);
}
.wt-bots-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.wt-kill-all-inline { background: var(--red-mid, #b91c1c); color: white; }

/* Chassis frame */
.wt-chassis { position: relative; padding: 22px; }
.wt-chassis-svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}

/* Bot grid — responsive */
.wt-bot-grid {
    position: relative; z-index: 1;
    display: grid; gap: 18px;
    grid-template-columns: 1fr;
}
.wt-bot-grid[data-count="2"], .wt-bot-grid[data-count="3"] {
    grid-template-columns: repeat(2, 1fr);
}
.wt-bot-grid[data-count="4"], .wt-bot-grid[data-count="5"] {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 1100px) {
    .wt-bot-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
    .wt-bot-grid[data-count="6"], .wt-bot-grid[data-count="7"],
    .wt-bot-grid[data-count="8"], .wt-bot-grid[data-count="9"],
    .wt-bot-grid[data-count="10"] { grid-template-columns: repeat(3, 1fr); }
}

/* Empty grid state */
.wt-bot-empty {
    grid-column: 1 / -1;
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 56px 24px;
    text-align: center;
}
.wt-bot-empty-glyph { font-size: 40px; opacity: 0.6; margin-bottom: 12px; }
.wt-bot-empty-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.wt-bot-empty-copy {
    color: var(--text-secondary); font-size: 14px;
    max-width: 480px; margin: 0 auto 20px;
}

/* Bot card */
.wt-bot {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 16px 14px;
    display: flex; flex-direction: column; gap: 12px;
    transition: border-color 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.wt-bot-cipher    { border-top: 3px solid var(--cyan-mid, #2dd4bf); }
.wt-bot-sovereign { border-top: 3px solid var(--gold-mid, #d4a017); }

/* States */
.wt-bot-dormant   { opacity: 0.62; filter: grayscale(0.55); }
.wt-bot-armed     { opacity: 1; }
.wt-bot-running-test { box-shadow: 0 0 0 1px rgba(45,212,191,0.45), 0 0 24px -6px rgba(45,212,191,0.55); animation: wt-pulse-cyan 2.4s ease-in-out infinite; }
.wt-bot-running-live { box-shadow: 0 0 0 1px rgba(34,197,94,0.55), 0 0 28px -6px rgba(34,197,94,0.7); animation: wt-pulse-green 2.4s ease-in-out infinite; }
.wt-bot-error        { box-shadow: 0 0 0 1px rgba(239,68,68,0.5); border-top-color: rgba(239,68,68,0.7); }
@keyframes wt-pulse-cyan  { 0%,100% { box-shadow: 0 0 0 1px rgba(45,212,191,0.4), 0 0 16px -6px rgba(45,212,191,0.45); } 50% { box-shadow: 0 0 0 1px rgba(45,212,191,0.7), 0 0 32px -4px rgba(45,212,191,0.7); } }
@keyframes wt-pulse-green { 0%,100% { box-shadow: 0 0 0 1px rgba(34,197,94,0.45), 0 0 18px -6px rgba(34,197,94,0.5); } 50% { box-shadow: 0 0 0 1px rgba(34,197,94,0.7), 0 0 36px -4px rgba(34,197,94,0.75); } }

/* Header bar */
.wt-bot-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
}
.wt-bot-name {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    cursor: text; padding: 2px 4px; border-radius: 4px;
}
.wt-bot-name:hover { background: rgba(255,255,255,0.04); }
.wt-bot-name-input {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    background: transparent;
    border: 1px solid var(--cyan-mid, #2dd4bf);
    color: var(--text-primary);
    padding: 2px 4px; border-radius: 4px;
    outline: none;
}
.wt-bot-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.wt-bot-realm, .wt-bot-state, .wt-bot-mode {
    font-family: var(--font-tech, monospace);
    font-size: 10px; letter-spacing: 0.1em;
    padding: 3px 8px; border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.wt-bot-cipher .wt-bot-realm    { color: var(--cyan-light); border-color: rgba(45,212,191,0.4); }
.wt-bot-sovereign .wt-bot-realm { color: var(--gold-light); border-color: rgba(212,160,23,0.4); }
.wt-mode-test { color: var(--cyan-light); border-color: rgba(45,212,191,0.4); }
.wt-mode-live { color: #4ade80; border-color: rgba(74,222,128,0.5); }
.wt-mode-off  { color: var(--text-muted); }

/* WT-NEXT-1 — regime badge on the bot card, sits in the badges row
   next to realm/state/mode. Color reflects detected trend; ⚡ marker
   appears alongside on volatility=spike. */
.wt-bot-regime {
    font-family: var(--font-tech, monospace);
    font-size: 10px; letter-spacing: 0.08em;
    padding: 3px 8px; border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 4px;
}
.wt-regime-bull    { color: #10b981; border-color: rgba(16,185,129,0.45); background: rgba(16,185,129,0.06); }
.wt-regime-bear    { color: #ef4444; border-color: rgba(239,68,68,0.45);  background: rgba(239,68,68,0.06);  }
.wt-regime-neutral { color: #f59e0b; border-color: rgba(245,158,11,0.45); background: rgba(245,158,11,0.06); }
.wt-regime-spike   { font-size: 11px; }

/* WT-NEXT-1 — 5-segment confidence bar inside the regime badge.
   Tier buckets:  ≤40% red · 41-60% amber · 61-80% realm-tinted ·
   81-100% bright realm-tinted. Empty segments draw a thin outline so
   the bar shape is always visible. */
.wt-regime-bar {
    display: inline-flex; gap: 1px;
    vertical-align: middle;
    margin: 0 2px;
}
.wt-regime-bar-seg {
    display: inline-block;
    width: 5px; height: 8px;
    border: 1px solid currentColor;
    background: transparent;
    opacity: 0.35;
    border-radius: 1px;
}
.wt-regime-bar-seg.wt-regime-bar-fill {
    opacity: 1;
}
.wt-regime-bar-tier1 .wt-regime-bar-fill { background: #ef4444; border-color: #ef4444; }
.wt-regime-bar-tier2 .wt-regime-bar-fill { background: #f59e0b; border-color: #f59e0b; }
.wt-regime-bar-tier3.wt-regime-realm-cipher    .wt-regime-bar-fill { background: rgba(6, 182, 212, 0.7);  border-color: rgba(6, 182, 212, 0.7); }
.wt-regime-bar-tier3.wt-regime-realm-sovereign .wt-regime-bar-fill { background: rgba(245, 158, 11, 0.7); border-color: rgba(245, 158, 11, 0.7); }
.wt-regime-bar-tier4.wt-regime-realm-cipher    .wt-regime-bar-fill { background: #06b6d4; border-color: #06b6d4; }
.wt-regime-bar-tier4.wt-regime-realm-sovereign .wt-regime-bar-fill { background: #f59e0b; border-color: #f59e0b; }

/* WT-NEXT-1 — pending-switch banner. Amber pulse to draw the eye;
   inline Confirm/Reject + Discord pointer. Sits between halt-banner
   and the symbol strip. */
.wt-bot-pending-switch {
    display: flex; gap: 10px;
    align-items: flex-start;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 6px 0;
    animation: wt-pending-pulse 2.4s ease-in-out infinite;
}
@keyframes wt-pending-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.0); }
    50%      { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }
}
.wt-pending-icon { font-size: 18px; line-height: 1; padding-top: 2px; color: #f59e0b; }
.wt-pending-body { flex: 1; min-width: 0; }
.wt-pending-title  { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.wt-pending-reason { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.wt-pending-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; flex-wrap: wrap;
}
.wt-pending-discord {
    font-size: 11px; color: var(--text-muted); font-style: italic;
}
.wt-pending-or { font-size: 11px; color: var(--text-muted); }
.wt-btn-tight  { padding: 4px 12px; font-size: 11px; }

/* Subtle outline-glow on the card itself when pending */
.wt-bot.wt-bot-pending {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

/* Slot bays inside the bot */
.wt-bot-slots {
    display: flex; gap: 8px; flex-wrap: wrap;
    background: rgba(0,0,0,0.16);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}
.wt-slot-bay {
    flex: 1 1 calc(50% - 8px);
    min-width: 130px;
    min-height: 64px;
    background: rgba(0,0,0,0.22);
    border: 1px dashed rgba(255,255,255,0.10);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 4px;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.wt-slot-bay.wt-slot-empty:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.25);
}
.wt-slot-empty { align-items: center; justify-content: center; text-align: center; }
.wt-slot-empty .wt-slot-glyph { font-size: 22px; opacity: 0.55; }
.wt-slot-empty .wt-slot-cta { font-size: 11px; letter-spacing: 0.1em; }
.wt-slot-empty .wt-slot-index { font-size: 9px; color: var(--text-muted); letter-spacing: 0.18em; }

.wt-slot-loaded {
    border-style: solid;
    cursor: default;
    background: rgba(255,255,255,0.04);
}
.wt-bot-cipher    .wt-slot-loaded { border-color: rgba(45,212,191,0.35); }
.wt-bot-sovereign .wt-slot-loaded { border-color: rgba(212,160,23,0.35); }
.wt-slot-active {
    background: rgba(45,212,191,0.10);
    box-shadow: inset 0 0 0 1px rgba(45,212,191,0.45);
}
.wt-bot-sovereign .wt-slot-active {
    background: rgba(212,160,23,0.10);
    box-shadow: inset 0 0 0 1px rgba(212,160,23,0.45);
}
.wt-slot-loaded .wt-slot-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wt-slot-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 9px; letter-spacing: 0.16em;
    color: var(--text-muted);
}
.wt-slot-active-marker {
    color: var(--cyan-light);
    font-weight: 700;
}
.wt-bot-sovereign .wt-slot-active-marker { color: var(--gold-light); }
.wt-slot-actions {
    margin-top: auto;
    display: flex; gap: 4px; justify-content: flex-end;
}
.wt-slot-make-active, .wt-slot-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 22px; height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px; line-height: 1;
}
.wt-slot-remove:hover { color: #f87171; border-color: rgba(248,113,113,0.5); }

/* Switching pill below slots */
.wt-bot-switch {
    align-self: flex-start;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-tech, monospace);
    font-size: 11px; letter-spacing: 0.1em;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.wt-bot-switch:hover { color: var(--text-primary); border-color: var(--cyan-mid, #2dd4bf); }
.wt-bot-switch-warn {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.5);
    background: rgba(251,191,36,0.06);
}

/* Companion monitor */
.wt-bot-monitor {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr 1.6fr;
    gap: 8px;
    background: rgba(0,0,0,0.22);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}
.wt-monitor-cell { display: flex; flex-direction: column; gap: 1px; }
.wt-monitor-label { font-size: 9px; letter-spacing: 0.18em; color: var(--text-muted); text-transform: uppercase; }
.wt-monitor-value { font-family: var(--font-tech, monospace); font-size: 14px; color: var(--text-primary); }
.wt-monitor-small { font-size: 11px; color: var(--text-secondary); }
.wt-pnl-positive { color: #4ade80; }
.wt-pnl-negative { color: #f87171; }
.wt-monitor-spark { color: var(--cyan-mid, #2dd4bf); height: 22px; }
.wt-monitor-spark svg { width: 100%; height: 100%; }

/* Mode toggle — three independent pills, not a slider.
 * Each pill carries its own bg + border + color so the trio reads as
 * three distinct options. Active state = full saturation + glow.
 * Inactive = dimmed version of the same hue. */
.wt-bot-modes {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
}
.wt-bot-modes .wt-mode-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    font-family: var(--font-tech, monospace);
    font-size: 11px; letter-spacing: 0.18em; font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.wt-bot-modes .wt-mode-btn:hover { filter: brightness(1.18); }

/* OFF — dark gray, muted */
.wt-bot-modes .wt-mode-btn-off {
    background: rgba(60,60,72,0.35);
    border-color: rgba(120,120,140,0.28);
    color: rgba(200,200,210,0.55);
}
.wt-bot-modes .wt-mode-btn-off.wt-mode-btn-active {
    background: rgba(60,60,72,0.85);
    border-color: rgba(180,180,200,0.55);
    color: #ffffff;
    box-shadow: 0 0 12px -3px rgba(180,180,200,0.4);
}

/* TEST — dark blue, cyan #06b6d4 */
.wt-bot-modes .wt-mode-btn-test {
    background: rgba(8,30,50,0.45);
    border-color: rgba(6,182,212,0.25);
    color: rgba(6,182,212,0.55);
}
.wt-bot-modes .wt-mode-btn-test.wt-mode-btn-active {
    background: rgba(6,182,212,0.16);
    border-color: rgba(6,182,212,0.7);
    color: #06b6d4;
    box-shadow: 0 0 16px -3px rgba(6,182,212,0.55);
}

/* LIVE — dark green, bright green */
.wt-bot-modes .wt-mode-btn-live {
    background: rgba(8,30,16,0.5);
    border-color: rgba(34,197,94,0.25);
    color: rgba(74,222,128,0.55);
}
.wt-bot-modes .wt-mode-btn-live.wt-mode-btn-active {
    background: rgba(34,197,94,0.18);
    border-color: rgba(74,222,128,0.7);
    color: #4ade80;
    box-shadow: 0 0 16px -3px rgba(74,222,128,0.55);
}

/* Bot controls */
.wt-bot-controls {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
}
.wt-bot-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-tech, monospace);
    font-size: 11px; letter-spacing: 0.12em;
    padding: 8px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.wt-bot-btn:hover  { border-color: var(--cyan-mid, #2dd4bf); }
.wt-bot-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wt-bot-btn-start  { color: #4ade80; border-color: rgba(74,222,128,0.4); }
.wt-bot-btn-stop   { color: #f87171; border-color: rgba(248,113,113,0.5); }
.wt-bot-btn-danger { color: #f87171; }

/* Switchboard modal */
.wt-modal-wide .wt-modal { max-width: 720px; }
.wt-modal-wide { max-width: 720px; }
.wt-modal.wt-modal-wide, .wt-modal-overlay > .wt-modal-wide { max-width: 720px; width: 90vw; }
.wt-modal-blurb { color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 0 0 14px; }
.wt-modal-subtitle { color: var(--text-muted); font-size: 14px; font-weight: 400; margin-left: 6px; }

.wt-sb-loaded {
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 18px;
}
.wt-sb-loaded-title { font-size: 11px; letter-spacing: 0.16em; color: var(--text-muted); margin-bottom: 6px; }
.wt-sb-loaded-row {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 0;
    font-size: 13px;
}
.wt-sb-loaded-active { color: var(--cyan-light); }
.wt-sb-loaded-idx { font-family: var(--font-tech, monospace); color: var(--text-muted); font-size: 11px; min-width: 24px; }
.wt-sb-loaded-name { flex: 1; }
.wt-sb-loaded-tag { font-size: 9px; letter-spacing: 0.18em; color: var(--cyan-light); }

.wt-sb-info-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
    color: rgba(186, 230, 253, 0.88);
    font-size: 11.5px;
    line-height: 1.45;
}
.wt-sb-info-note-icon {
    font-size: 13px;
    line-height: 1.3;
    color: rgba(56, 189, 248, 0.85);
    flex-shrink: 0;
}
.wt-sb-info-note-text { color: rgba(186, 230, 253, 0.88); }

.wt-sb-modes {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-bottom: 18px;
}
.wt-sb-mode {
    text-align: left;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.wt-sb-mode:hover { border-color: var(--cyan-mid, #2dd4bf); }
.wt-sb-mode-active {
    border-color: var(--cyan-mid, #2dd4bf);
    background: rgba(45,212,191,0.06);
}
.wt-sb-mode-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.wt-sb-mode-blurb { color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.wt-sb-sparkle { background: linear-gradient(135deg, var(--cyan-light), var(--gold-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.wt-sb-panel {
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.wt-sb-panel-title { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.wt-sb-default-list { color: var(--text-secondary); font-size: 13px; line-height: 1.6; padding-left: 18px; margin: 0 0 12px; }

.wt-sb-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.wt-sb-rule {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr auto 1.4fr 0.8fr auto;
    gap: 6px; align-items: center;
}
.wt-sb-rule-arrow { color: var(--text-muted); font-size: 11px; padding: 0 2px; }
.wt-sb-rule-join { font-family: var(--font-tech, monospace); }

.wt-sb-risk { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.wt-sb-risk-label { color: var(--text-secondary); font-size: 13px; }
.wt-sb-risk-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.wt-sb-risk-btn:hover { color: var(--text-primary); border-color: var(--cyan-mid, #2dd4bf); }
.wt-sb-risk-active { background: rgba(45,212,191,0.12); color: var(--cyan-light); border-color: rgba(45,212,191,0.5); }

.wt-sb-chat {
    background: rgba(0,0,0,0.32);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    height: 240px;
    overflow-y: auto;
    margin-bottom: 8px;
    font-size: 13px; line-height: 1.55;
}
.wt-sb-chat-empty { color: var(--text-muted); font-style: italic; }
.wt-sb-msg { margin-bottom: 12px; }
.wt-sb-msg-role { font-size: 10px; letter-spacing: 0.18em; color: var(--text-muted); margin-bottom: 2px; }
.wt-sb-msg-user .wt-sb-msg-body { color: var(--text-primary); }
.wt-sb-msg-assistant .wt-sb-msg-body { color: var(--text-secondary); }
.wt-sb-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.wt-sb-input-row .wt-input { flex: 1; }
.wt-sb-disclaimer { font-size: 11px; color: var(--text-muted); font-style: italic; margin: 4px 0 0; }

/* WT-NEXT-1 — Grok "thinking" indicator shown inside #sb-chat while
   the /switchboard/ai POST is in flight. Animated trailing dots so
   the user knows the request is alive, not stalled. */
.wt-sb-thinking {
    margin-top: 8px;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
    background: rgba(139, 92, 246, 0.06);
    border-left: 2px solid var(--purple, #8b5cf6);
    border-radius: 0 4px 4px 0;
}
.wt-sb-thinking::after {
    content: "";
    display: inline-block;
    width: 1.5em;
    text-align: left;
    animation: wt-sb-thinking-dots 1.2s steps(4, end) infinite;
}
@keyframes wt-sb-thinking-dots {
    0%   { content: ""; }
    25%  { content: "."; }
    50%  { content: ".."; }
    75%  { content: "..."; }
    100% { content: ""; }
}

/* Strategy picker */
.wt-strategy-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.wt-strategy-card {
    text-align: left;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--text-primary);   /* explicit — buttons inherit OS chrome otherwise */
    transition: border-color 0.15s, background 0.15s;
}
.wt-strategy-card:hover {
    border-color: var(--cyan-mid, #2dd4bf);
    background: rgba(45,212,191,0.05);
}
.wt-strategy-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.wt-strategy-meta {
    display: flex; gap: 8px; flex-wrap: wrap;
    font-family: var(--font-tech, monospace);
    font-size: 10px; letter-spacing: 0.1em;
    color: rgba(255,255,255,0.7);   /* readable on dark bg */
}
.wt-strategy-meta span { color: rgba(255,255,255,0.7); }
.wt-strategy-realm { color: #06b6d4; font-weight: 600; }
.wt-strategy-card[data-realm="sovereign"] .wt-strategy-realm { color: #f59e0b; }
.wt-strategy-card[data-realm="sovereign"]:hover {
    border-color: var(--gold-mid, #d4a017);
    background: rgba(212,160,23,0.05);
}

/* CP-E — type + timeframe badges on the Watchtower strategy picker. */
.wt-strategy-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
    margin-bottom: 6px;
}
.wt-type-badge, .wt-tf-badge {
    padding: 3px 9px;
    border-radius: 4px;
    font-family: var(--font-tech, monospace);
    font-size: 10px;
    letter-spacing: 0.12em;
    border: 1px solid;
    white-space: nowrap;
}
.wt-type-badge {
    font-weight: 600;
    background: rgba(6,182,212,0.12);
    color: var(--cyan);
    border-color: rgba(6,182,212,0.45);
}
.wt-tf-badge {
    font-weight: 500;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.78);
    border-color: rgba(255,255,255,0.12);
}
.wt-strategy-card[data-realm="sovereign"] .wt-type-badge {
    background: rgba(245,158,11,0.12);
    color: var(--gold);
    border-color: rgba(245,158,11,0.45);
}
.wt-strategy-card[data-realm="cipher"]    .wt-tf-badge { border-color: rgba(6,182,212,0.30); }
.wt-strategy-card[data-realm="sovereign"] .wt-tf-badge { border-color: rgba(245,158,11,0.30); }

/* =========================================================================
   Trades tab — audit-log surface (CP-B / WT-3)
   Read-only table; numerals in Orbitron to match the rest of the data UI.
   ========================================================================= */
.wt-trades-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    flex-wrap: wrap;
}
.wt-trades-filter { display: flex; gap: 6px; }
.wt-trades-filter-pill {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.wt-trades-filter-pill:hover { color: var(--text-primary); border-color: var(--border-light); }
.wt-trades-filter-active {
    color: var(--text-primary);
    border-color: var(--cyan);
    background: var(--cyan-dim);
}
.wt-trades-meta { display: flex; align-items: center; gap: 12px; }
.wt-trades-count {
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
}
.wt-btn-sm { padding: 6px 14px; font-size: 11px; }

.wt-trades-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
}
.wt-trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-primary);
}
.wt-trades-table thead { background: rgba(255,255,255,0.025); }
.wt-trades-th {
    text-align: left;
    padding: 12px 14px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-muted, rgba(226,232,240,0.55));
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.wt-trades-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.wt-trades-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.wt-trades-table td {
    padding: 11px 14px;
    vertical-align: middle;
    white-space: nowrap;
}
.wt-trades-num { text-align: right; font-family: var(--font-tech); }
.wt-trades-time { color: var(--text-secondary); font-family: var(--font-tech); font-size: 11px; }
.wt-trades-bot { color: var(--text-primary); font-weight: 500; }
.wt-trades-symbol { font-family: var(--font-tech); font-weight: 600; letter-spacing: 0.04em; }

.wt-trades-side {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.14em;
    font-weight: 600;
}
.wt-trades-side-buy  { background: var(--green-dim); color: var(--green); }
.wt-trades-side-sell { background: var(--red-dim);   color: var(--red);   }

.wt-trades-pnl-positive { color: var(--green); }
.wt-trades-pnl-negative { color: var(--red); }
.wt-trades-pnl-null     { color: var(--text-muted, rgba(226,232,240,0.4)); }

.wt-trades-mode {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.18em;
    font-weight: 600;
    border: 1px solid;
}
.wt-trades-mode-test { color: var(--cyan);  border-color: var(--cyan);  background: var(--cyan-dim);  }
.wt-trades-mode-live { color: var(--green); border-color: var(--green); background: var(--green-dim); }

.wt-trades-empty {
    text-align: center;
    padding: 36px 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================
   SL-V4 — Trades tab P&L summary + equity curve
   ============================================================ */

/* Bot filter <select> matches the realm/mode pill row visually. */
.wt-trades-bot-select {
    background: rgba(10, 10, 15, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s;
}
.wt-trades-bot-select:hover  { border-color: rgba(139, 92, 246, 0.55); }
.wt-trades-bot-select:focus  { outline: none; border-color: var(--purple); }

/* P&L summary strip — six cards across at desktop, wraps gracefully. */
.wt-trades-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
    --stat-accent: var(--purple);
}
.wt-trades-stats-cipher    { --stat-accent: var(--cyan); }
.wt-trades-stats-sovereign { --stat-accent: var(--gold); }

.wt-stat {
    position: relative;
    background: linear-gradient(160deg, rgba(17, 17, 26, 0.85), rgba(22, 22, 34, 0.85));
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 8px;
    padding: 12px 14px;
    overflow: hidden;
}
.wt-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--stat-accent);
    opacity: 0.55;
}
.wt-stat-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.wt-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.wt-stat-value.wt-stat-pos    { color: var(--green); }
.wt-stat-value.wt-stat-neg    { color: var(--red); }
.wt-stat-value.wt-stat-muted  { color: var(--text-secondary); opacity: 0.55; }

/* Open-position badge, used inside the P&L cell of the table. */
.wt-trades-open-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-family: 'Orbitron', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--purple);
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(139, 92, 246, 0.45);
    text-transform: uppercase;
}
.wt-trades-pnl-open  { color: var(--text-secondary); opacity: 0.75; }

/* Equity curve container — title row + Chart.js canvas + empty state. */
.wt-equity-wrap {
    background: linear-gradient(160deg, rgba(17, 17, 26, 0.85), rgba(22, 22, 34, 0.85));
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}
.wt-equity-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.wt-equity-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}
.wt-equity-sub {
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    margin-left: 8px;
    font-weight: 400;
    letter-spacing: 0;
}
.wt-equity-toggle { display: flex; gap: 6px; }
.wt-equity-pill {
    background: rgba(10, 10, 15, 0.6);
    color: var(--text-secondary);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 4px;
    padding: 4px 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.wt-equity-pill:hover { color: var(--text-primary); border-color: var(--border-light); }
.wt-equity-pill-active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--purple);
}
.wt-equity-pill[data-view="cipher"].wt-equity-pill-active     { background: rgba(6, 182, 212, 0.18);  border-color: var(--cyan); }
.wt-equity-pill[data-view="sovereign"].wt-equity-pill-active  { background: rgba(245, 158, 11, 0.18); border-color: var(--gold); }

.wt-equity-canvas-wrap {
    position: relative;
    height: 180px;
    width: 100%;
}
.wt-equity-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
.wt-equity-empty {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 0 24px;
    font-size: 0.88rem;
}
.wt-equity-empty[style*="block"] { display: flex !important; }

/* CP-J — chip input (create-bot modal + edit-symbols modal). */
.wt-chip-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    background: var(--bg-surface);
    min-height: 38px;
    position: relative;
}
.wt-chip-input:focus-within { border-color: var(--cyan, #06b6d4); }
.wt-chip-input[data-realm="sovereign"]:focus-within { border-color: var(--gold, #f59e0b); }

.wt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.06em;
    border: 1px solid;
}
.wt-chip-input[data-realm="cipher"]    .wt-chip { background: rgba(6,182,212,0.12);  color: var(--cyan); border-color: rgba(6,182,212,0.45); }
.wt-chip-input[data-realm="sovereign"] .wt-chip { background: rgba(245,158,11,0.12); color: var(--gold); border-color: rgba(245,158,11,0.45); }
.wt-chip-input:not([data-realm]) .wt-chip,
.wt-chip-input[data-realm=""] .wt-chip { background: rgba(255,255,255,0.05); color: var(--text-secondary); border-color: var(--border); }

.wt-chip-remove {
    background: none; border: none; color: inherit;
    cursor: pointer; font-size: 14px; padding: 0; line-height: 1;
    opacity: 0.7;
}
.wt-chip-remove:hover { opacity: 1; }

.wt-chip-input-text {
    flex: 1; min-width: 100px;
    background: none; border: none; outline: none;
    color: var(--text-primary);
    font-family: var(--font-tech);
    font-size: 12px;
    padding: 4px 2px;
}

.wt-chip-suggestions {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.wt-chip-suggestion {
    padding: 8px 12px;
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}
.wt-chip-suggestion:hover,
.wt-chip-suggestion-active { background: rgba(255,255,255,0.06); }

/* Bot card symbol strip (read-only display + Edit affordance). */
.wt-bot-symbols {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    margin: 6px 12px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
}
.wt-bot-symbol-chip {
    padding: 2px 7px;
    border-radius: 3px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.06em;
    border: 1px solid;
}
.wt-bot-cipher    .wt-bot-symbol-chip { background: rgba(6,182,212,0.10);  color: var(--cyan); border-color: rgba(6,182,212,0.35); }
.wt-bot-sovereign .wt-bot-symbol-chip { background: rgba(245,158,11,0.10); color: var(--gold); border-color: rgba(245,158,11,0.35); }
.wt-bot-symbols-empty {
    font-family: var(--font-tech);
    font-size: 10px;
    color: var(--text-muted, rgba(226,232,240,0.45));
    letter-spacing: 0.06em;
}
.wt-bot-symbols-edit {
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-muted, rgba(226,232,240,0.55));
    border-radius: 3px;
    padding: 1px 7px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.06em;
    cursor: pointer;
    margin-left: auto;
}
.wt-bot-symbols-edit:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* Halt banner inside an errored / halted bot card — surfaces halt_reason
   from the circuit-breaker path (CP-C). */
.wt-bot-halt-banner {
    margin: 8px 12px 0;
    padding: 8px 12px;
    background: var(--red-dim);
    border: 1px solid var(--red);
    border-radius: 6px;
    color: var(--red);
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.06em;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================================
   CP-K — market summary ticker (sticky, just below the navbar).
   ========================================================================= */
.wt-ticker {
    position: sticky;
    top: 64px;     /* below navbar */
    z-index: 90;
    overflow: hidden;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
}
.wt-ticker-track {
    display: inline-flex;
    gap: 28px;
    white-space: nowrap;
    will-change: transform;
    animation: wt-ticker-scroll 60s linear infinite;
    padding-left: 100%;
}
.wt-ticker:hover .wt-ticker-track { animation-play-state: paused; }
@keyframes wt-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
    .wt-ticker-track { animation: none; padding-left: 0; }
}

.wt-ticker-item {
    display: inline-flex; align-items: baseline; gap: 8px;
    font-family: var(--font-tech);
    font-size: 12px;
    letter-spacing: 0.04em;
}
.wt-ticker-symbol { font-weight: 600; }
.wt-ticker-symbol.realm-cipher    { color: var(--cyan); }
.wt-ticker-symbol.realm-sovereign { color: var(--gold); }
.wt-ticker-price  { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.wt-ticker-change { font-size: 11px; }
.wt-ticker-change.up   { color: var(--green); }
.wt-ticker-change.down { color: var(--red); }
.wt-ticker-change.flat { color: var(--text-muted, rgba(226,232,240,0.5)); }
.wt-ticker-error { color: var(--text-muted, rgba(226,232,240,0.4)); font-style: italic; }

/* CP-L — market-status badges (CLOSED / AH / PM). Both ticker pills
   and bot-card data window use the same badge classes. */
.wt-mkt-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-tech);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    border: 1px solid;
    margin-left: 4px;
    vertical-align: 1px;
}
.wt-mkt-badge-closed      { color: rgba(245,158,11,0.75); border-color: rgba(245,158,11,0.45); background: rgba(245,158,11,0.07); }
.wt-mkt-badge-after_hours { color: var(--gold);          border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.10); }
.wt-mkt-badge-pre_market  { color: var(--gold);          border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.10); }
/* When market is closed, mute the price color so it reads as "stale" */
.wt-ticker-item.is-closed .wt-ticker-price,
.wt-ticker-item.is-closed .wt-ticker-change { opacity: 0.55; }

/* =========================================================================
   CP-K — bot card data window (indicator readings + matrix-rain bg).
   ========================================================================= */
.wt-bot-data-window {
    position: relative;
    margin: 8px 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0,0,0,0.32);
    overflow: hidden;
    min-height: 64px;
}
.wt-bot-data-window::before {
    /* Background matrix — vertical character stream. Cipher = cyan
       cyberpunk; Sovereign = gold ledger. */
    content: "0 1 9 F 7 0 1 4 8 A C 0 5 0 1 9 F 7 D 1 4 8 A C E";
    position: absolute;
    inset: 0;
    font-family: var(--font-tech, monospace);
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 0.12em;
    word-spacing: 4px;
    white-space: pre-wrap;
    pointer-events: none;
    opacity: 0.10;
    color: var(--text-primary);
    animation: wt-matrix-rain 14s linear infinite;
}
.wt-bot-cipher    .wt-bot-data-window::before { color: var(--cyan); }
.wt-bot-sovereign .wt-bot-data-window::before { color: var(--gold); }
@keyframes wt-matrix-rain {
    from { transform: translateY(-50%); }
    to   { transform: translateY(0%);   }
}
@media (prefers-reduced-motion: reduce) {
    .wt-bot-data-window::before { animation: none; }
}

.wt-data-readings {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    z-index: 1;
}
.wt-data-cell { display: flex; flex-direction: column; gap: 2px; }
.wt-data-label {
    font-family: var(--font-tech);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted, rgba(226,232,240,0.5));
}
.wt-data-value {
    font-family: var(--font-tech);
    font-size: 13px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.wt-data-value-sub {
    font-family: var(--font-tech);
    font-size: 10px;
    color: var(--text-secondary);
}
.wt-data-empty {
    grid-column: 1 / -1;
    font-family: var(--font-tech);
    font-size: 10px;
    color: var(--text-muted, rgba(226,232,240,0.45));
    font-style: italic;
}

/* =========================================================================
   CP-K — fleet activity feed (below bot grid).
   ========================================================================= */
.wt-feed {
    margin-top: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
}
.wt-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.wt-feed-title {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}
.wt-feed-count {
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--text-muted, rgba(226,232,240,0.55));
}
.wt-feed-list {
    list-style: none; padding: 0; margin: 0;
    max-height: 240px;
    overflow-y: auto;
}
.wt-feed-item {
    display: flex; gap: 10px; align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-family: var(--font-tech);
    font-size: 11.5px;
    color: var(--text-secondary);
}
.wt-feed-item:last-child { border-bottom: none; }
.wt-feed-time { color: var(--text-muted, rgba(226,232,240,0.45)); flex-shrink: 0; min-width: 56px; }
.wt-feed-msg  { color: var(--text-primary); flex: 1; }
.wt-feed-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted, rgba(226,232,240,0.45));
    font-style: italic;
    font-family: var(--font-tech);
    font-size: 11.5px;
}

/* ============================================================
   Auto-execute settings (Switchboard modal, WT-NEXT-1)
   ============================================================ */
.wt-sb-auto-exec {
    margin: 12px 0 16px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
}
.wt-sb-auto-exec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.wt-sb-auto-exec-text { flex: 1 1 auto; min-width: 0; }
.wt-sb-auto-exec-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.wt-sb-auto-exec-blurb {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}
.wt-sb-auto-exec-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.wt-sb-auto-exec-indicator {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}
.wt-sb-auto-exec-on  { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.wt-sb-auto-exec-off { color: var(--text-secondary); background: rgba(148, 163, 184, 0.10); }

/* Toggle switch */
.wt-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.wt-switch input { opacity: 0; width: 0; height: 0; }
.wt-switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: rgba(148, 163, 184, 0.35);
    transition: background 0.2s;
    border-radius: 24px;
}
.wt-switch-slider::before {
    content: ""; position: absolute;
    height: 18px; width: 18px; left: 3px; top: 3px;
    background: #f1f5f9; border-radius: 50%;
    transition: transform 0.2s;
}
.wt-switch input:checked + .wt-switch-slider { background: #22c55e; }
.wt-switch input:checked + .wt-switch-slider::before { transform: translateX(20px); }
.wt-switch input:disabled + .wt-switch-slider { opacity: 0.5; cursor: not-allowed; }

/* Consent dialog */
.wt-sb-consent {
    margin: 12px 0 16px;
    padding: 16px;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
}
.wt-sb-consent-card { display: block; }
.wt-sb-consent-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.wt-sb-consent-body {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
}

/* ============================================================
   WT-INTEL — TradingView per-card chart toggle + container
   ============================================================ */
.wt-bot-chart-toggle {
    font-family: var(--font-tech, monospace);
    font-size: 10px; letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    background: transparent;
    color: var(--cyan-light);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.wt-bot-chart-toggle:hover {
    background: rgba(45, 212, 191, 0.12);
}
.wt-bot-sovereign .wt-bot-chart-toggle {
    border-color: rgba(212, 160, 23, 0.45);
    color: var(--gold-light);
}
.wt-bot-sovereign .wt-bot-chart-toggle:hover {
    background: rgba(212, 160, 23, 0.10);
}
.wt-bot-chart {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
    height: 500px;
    width: 100%;
    /* TradingView's autosize handles internal layout, but on very
       narrow cards (single-column mobile grids) drop a bit of height
       so the chart isn't a 500px column dominating the card. */
    min-height: 360px;
}
.wt-bot-chart[hidden] { display: none; }
@media (max-width: 640px) {
    .wt-bot-chart { height: 400px; }
}
@media (max-width: 420px) {
    .wt-bot-chart { height: 340px; }
}
.wt-chart-frame   { width: 100%; height: 100%; }
.wt-chart-loading {
    height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted, rgba(226,232,240,0.5));
    font-family: var(--font-tech, monospace);
    font-size: 12px;
}
.wt-chart-fallback {
    height: 100%;
    padding: 16px;
    display: flex; flex-direction: column; justify-content: center;
    gap: 10px;
}
.wt-chart-fb-row {
    display: flex; align-items: baseline; gap: 14px;
    font-family: var(--font-tech, monospace);
    font-variant-numeric: tabular-nums;
}
.wt-chart-fb-symbol {
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.06em;
}
.wt-chart-fb-price {
    font-size: 22px;
    color: var(--text-primary);
    font-weight: 600;
}
.wt-chart-fb-change         { font-size: 12px; }
.wt-chart-fb-change.up      { color: var(--green, #4ade80); }
.wt-chart-fb-change.down    { color: var(--red,   #ef4444); }
.wt-chart-fb-change.flat    { color: var(--text-muted, rgba(226,232,240,0.5)); }
.wt-chart-fb-note {
    color: var(--text-muted, rgba(226,232,240,0.55));
    font-family: var(--font-tech, monospace);
    font-size: 11px;
    line-height: 1.4;
}

/* ============================================================
   WT-INTEL — Market Intelligence panel (4-section 2x2 grid)
   ============================================================ */
.wt-intel {
    margin-top: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.wt-intel-toggle {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
}
.wt-intel-toggle:hover { background: rgba(45, 212, 191, 0.04); }
.wt-intel-title {
    font-family: var(--font-display, sans-serif);
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--cyan-light, #5eead4);
}
.wt-intel-caret {
    font-family: var(--font-tech, monospace);
    font-size: 11px;
    color: var(--text-muted, rgba(226,232,240,0.5));
}
.wt-intel-body { padding: 8px 16px 16px; }
.wt-intel-body[hidden] { display: none; }

.wt-intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 720px) {
    .wt-intel-grid { grid-template-columns: 1fr; }
}

.wt-intel-section {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 8px;
    padding: 10px 12px 12px;
    min-height: 120px;
}
.wt-intel-h {
    margin: 0 0 8px;
    font-family: var(--font-tech, monospace);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cyan-light, #5eead4);
}
.wt-intel-content { min-height: 60px; }
.wt-intel-placeholder, .wt-intel-error {
    font-family: var(--font-tech, monospace);
    font-size: 11.5px;
    color: var(--text-muted, rgba(226,232,240,0.5));
    font-style: italic;
}
.wt-intel-error { color: #fca5a5; font-style: normal; }
.wt-intel-stale {
    display: inline-block; margin-left: 8px;
    font-family: var(--font-tech, monospace);
    font-size: 10px;
    color: var(--text-muted, rgba(226,232,240,0.5));
    border: 1px solid rgba(226,232,240,0.2);
    padding: 0 6px; border-radius: 3px;
}

/* A. Fear & Greed */
.wt-fng {
    display: flex; align-items: center; gap: 14px;
    padding: 4px 2px;
}
.wt-fng-value {
    font-family: var(--font-display, sans-serif);
    font-size: 38px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.wt-fng-meta  { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.wt-fng-label {
    font-family: var(--font-tech, monospace);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}
.wt-fng-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.wt-fng-bar > span {
    display: block; height: 100%;
    background: currentColor;
    transition: width 0.3s ease;
}
.wt-fng-ef { color: #ef4444; }   /* extreme fear   */
.wt-fng-f  { color: #f97316; }   /* fear           */
.wt-fng-n  { color: #facc15; }   /* neutral        */
.wt-fng-g  { color: #84cc16; }   /* greed          */
.wt-fng-eg { color: #22c55e; }   /* extreme greed  */

/* B. Sessions */
.wt-sess-list { list-style: none; padding: 0; margin: 0; }
.wt-sess-row {
    display: grid;
    grid-template-columns: 22px auto 1fr auto;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    font-family: var(--font-tech, monospace);
    font-size: 11.5px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wt-sess-row:last-child { border-bottom: none; }
.wt-sess-glyph { font-size: 13px; }
.wt-sess-name  { color: var(--text-primary); letter-spacing: 0.06em; }
.wt-sess-state {
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 1px 6px;
    border-radius: 3px;
}
.wt-sess-open  .wt-sess-state {
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.4);
    background: rgba(74,222,128,0.08);
}
.wt-sess-closed .wt-sess-state {
    color: var(--text-muted, rgba(226,232,240,0.5));
    border: 1px solid rgba(226,232,240,0.15);
}
.wt-sess-closed .wt-sess-name, .wt-sess-closed .wt-sess-glyph { opacity: 0.55; }
.wt-sess-hours { color: var(--text-muted, rgba(226,232,240,0.5)); }

/* C. Economic calendar */
.wt-cal-list { list-style: none; padding: 0; margin: 0; }
.wt-cal-row {
    display: grid;
    grid-template-columns: 16px 1fr auto auto;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    font-family: var(--font-tech, monospace);
    font-size: 11.5px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wt-cal-row:last-child { border-bottom: none; }
.wt-cal-impact          { font-size: 11px; text-align: center; }
.wt-cal-impact-high     { color: #ef4444; }
.wt-cal-impact-med      { color: #facc15; }
.wt-cal-impact-low      { color: var(--text-muted, rgba(226,232,240,0.5)); }
.wt-cal-event           { color: var(--text-primary); }
.wt-cal-when            { color: var(--text-muted, rgba(226,232,240,0.5)); font-variant-numeric: tabular-nums; }
.wt-cal-days            { color: var(--cyan-light, #5eead4); min-width: 56px; text-align: right; }
.wt-cal-source {
    margin-top: 6px;
    font-family: var(--font-tech, monospace);
    font-size: 10px;
    color: var(--text-muted, rgba(226,232,240,0.45));
    font-style: italic;
}

/* D. Quick snapshot */
.wt-snap-list { list-style: none; padding: 0; margin: 0; }
.wt-snap-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 10px;
    padding: 5px 0;
    font-family: var(--font-tech, monospace);
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-variant-numeric: tabular-nums;
}
.wt-snap-row:last-child { border-bottom: none; }
.wt-snap-symbol         { font-weight: 600; letter-spacing: 0.04em; }
.wt-snap-symbol.realm-cipher    { color: var(--cyan, #2dd4bf); }
.wt-snap-symbol.realm-sovereign { color: var(--gold, #d4a017); }
.wt-snap-price          { color: var(--text-primary); }
.wt-snap-change         { font-size: 11px; }
.wt-snap-change.up      { color: var(--green, #4ade80); }
.wt-snap-change.down    { color: var(--red,   #ef4444); }
.wt-snap-change.flat    { color: var(--text-muted, rgba(226,232,240,0.5)); }

/* ============================================================
   Switching-Log CP-2 — runtime switching-event feed.
   Lives inside #panel-switching; reuses the Trades toolbar pill
   class for filter chips (.wt-trades-filter-pill) so toolbar
   spacing matches Trades exactly. Rows themselves are a richer
   multi-line variant of .wt-feed-item with a colored left rail
   indicating event_type.
   ============================================================ */
.wt-swev-toolbar {
    /* Allow the wider 5-pill type filter to wrap on narrow viewports
       without breaking the realm + bot select alignment. */
    flex-wrap: wrap;
}

.wt-swev-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wt-swev-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--text-secondary);
}
.wt-swev-row:hover { border-color: var(--border-light); }

.wt-swev-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.wt-swev-time {
    color: var(--text-muted, rgba(226,232,240,0.45));
    font-size: 11px;
    letter-spacing: 0.02em;
}

.wt-swev-type {
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Event-type rails + badges. Color follows lifecycle severity:
   regime change is informational (purple), suggested is awaiting
   (cyan), executed is success (green), rejected is amber warn,
   expired is muted red. */
.wt-swev-type-regime    { border-left-color: var(--purple);                                    }
.wt-swev-type-regime    .wt-swev-type { color: var(--purple-light); background: var(--purple-dim);                }
.wt-swev-type-suggested { border-left-color: var(--cyan);                                      }
.wt-swev-type-suggested .wt-swev-type { color: var(--cyan-light);   background: var(--cyan-dim);                  }
.wt-swev-type-executed  { border-left-color: var(--green);                                     }
.wt-swev-type-executed  .wt-swev-type { color: var(--green);        background: var(--green-dim);                 }
.wt-swev-type-rejected  { border-left-color: var(--gold);                                      }
.wt-swev-type-rejected  .wt-swev-type { color: var(--gold-light);   background: var(--gold-dim);                  }
.wt-swev-type-expired   { border-left-color: var(--red);                                       }
.wt-swev-type-expired   .wt-swev-type { color: var(--red);          background: var(--red-dim);                   }
.wt-swev-type-unknown   { border-left-color: var(--border);                                    }
.wt-swev-type-unknown   .wt-swev-type { color: var(--text-muted);   background: rgba(255,255,255,0.04);           }

.wt-swev-bot {
    font-weight: 600;
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
}
.wt-swev-bot-cipher    { color: var(--cyan-light); box-shadow: inset 0 0 0 1px var(--cyan-dim); }
.wt-swev-bot-sovereign { color: var(--gold-light); box-shadow: inset 0 0 0 1px var(--gold-dim); }

.wt-swev-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}
.wt-swev-arrow {
    color: var(--text-muted, rgba(226,232,240,0.4));
    font-weight: 700;
    padding: 0 2px;
}
.wt-swev-trigger {
    color: var(--text-muted, rgba(226,232,240,0.55));
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.03);
    margin-left: 4px;
}

/* Trend chips (used both in REGIME_CHANGE detail line and the
   regime-snapshot badge for non-regime events). Matches the bot-card
   regime badge color tokens. */
.wt-swev-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 3px;
    background: rgba(255,255,255,0.03);
}
.wt-swev-trend-bull    { color: var(--green);     box-shadow: inset 0 0 0 1px var(--green-dim);  }
.wt-swev-trend-bear    { color: var(--red);       box-shadow: inset 0 0 0 1px var(--red-dim);    }
.wt-swev-trend-neutral { color: var(--gold);      box-shadow: inset 0 0 0 1px var(--gold-dim);   }
.wt-swev-trend-unknown { color: var(--text-muted, rgba(226,232,240,0.5)); }

.wt-swev-regime {
    margin-left: auto;          /* push regime + conf cluster to the right of the head row */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 3px;
    background: rgba(255,255,255,0.03);
}
.wt-swev-regime.wt-swev-trend-bull    { color: var(--green); box-shadow: inset 0 0 0 1px var(--green-dim); }
.wt-swev-regime.wt-swev-trend-bear    { color: var(--red);   box-shadow: inset 0 0 0 1px var(--red-dim);   }
.wt-swev-regime.wt-swev-trend-neutral { color: var(--gold);  box-shadow: inset 0 0 0 1px var(--gold-dim);  }

.wt-swev-conf {
    font-size: 11px;
    color: var(--text-muted, rgba(226,232,240,0.55));
    font-family: var(--font-tech);
}

.wt-swev-reasoning {
    margin-top: 6px;
    padding-left: 8px;
    border-left: 2px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 11.5px;
    line-height: 1.4;
}

.wt-swev-empty {
    list-style: none;
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted, rgba(226,232,240,0.5));
    font-family: var(--font-tech);
    font-size: 12px;
    font-style: italic;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* ============================================================
   Switching-Log CP-3 — regime sparkline on the bot card.
   Sits next to the live regime badge (same .wt-bot-badges row).
   Reads bot.regime_history (cap 5 trend transitions). Hidden when
   the list is empty so we don't clutter pre-cutover cards.
   ============================================================ */
.wt-bot-spark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    /* No cursor:help here — it moved to .wt-spark-dot so the cursor
       only changes on a real per-dot hover target (avoids the wrapper
       title-shadowing problem that suppressed dot tooltips). */
    /* Match the badge row's vertical rhythm. */
    min-height: 22px;
}
.wt-spark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 0 4px currentColor;
    transition: transform 120ms ease;
    /* 20260524c — removed cursor:help. The custom tooltip is now the
       only feedback affordance; the help cursor was misleading once we
       moved off the native title= tooltip. */
    cursor: default;
}
.wt-spark-dot:hover {
    transform: scale(1.4);
}
/* Inline legend (Option A, 20260524b). Sits to the right of the dots,
   small + muted so it reads as supporting metadata not a primary chip. */
.wt-spark-legend {
    margin-left: 6px;
    font-family: var(--font-tech);
    font-size: 10.5px;
    color: var(--text-muted, rgba(226,232,240,0.55));
    letter-spacing: 0.02em;
    white-space: nowrap;
    user-select: none;
}

/* 20260524c — custom sparkline tooltip. Single floating element
   injected once into <body> by watchtower.js. Positioned via JS
   on each mouseover; opacity-faded via CSS. Dual-layer arrow
   (cyan border outer + dark fill inner) points down toward the dot.
   The wrapper transform centers horizontally and lifts above the
   dot so the JS only has to set the {top,left} anchor point. */
#wt-spark-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: #1a1a2e;
    border: 1px solid var(--cyan);
    border-radius: 4px;
    padding: 5px 9px;
    font-family: var(--font-display, "Rajdhani", sans-serif);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--text-primary, #e2e8f0);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px var(--cyan-glow, rgba(6,182,212,0.4));
    white-space: nowrap;
    opacity: 0;
    transition: opacity 100ms ease;
    transform: translate(-50%, calc(-100% - 9px));
    transform-origin: bottom center;
    /* While opacity is 0 we don't want the box to absorb any pointer
       events even though pointer-events:none is already set — belt
       + braces for the case where a future style override happens. */
    visibility: hidden;
}
#wt-spark-tooltip.wt-spark-tooltip-visible {
    opacity: 1;
    visibility: visible;
}
/* Dual-layer arrow: outer cyan border triangle + inner dark fill
   triangle, with the fill 1px shorter so a 1px cyan rim shows. */
#wt-spark-tooltip::after,
#wt-spark-tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    border: solid transparent;
    transform: translateX(-50%);
}
#wt-spark-tooltip::after {
    top: 100%;
    border-width: 6px;
    border-top-color: var(--cyan);
}
#wt-spark-tooltip::before {
    /* Inner fill triangle, positioned 1px higher so the cyan border
       shows around the rim instead of being painted over. */
    top: 100%;
    margin-top: -1px;
    border-width: 5px;
    border-top-color: #1a1a2e;
    z-index: 1;
}
.wt-spark-dot-bull    { background: var(--green); color: var(--green); }
.wt-spark-dot-bear    { background: var(--red);   color: var(--red);   }
.wt-spark-dot-neutral { background: var(--gold);  color: var(--gold);  }
.wt-spark-dot-unknown { background: var(--text-muted, rgba(226,232,240,0.4)); color: transparent; }
