:root {
            --tesla-red: #cc0000;
            --spacex-blue: #005288;
            --carbon-dark: #0a0a0c;
            --panel-bg: #141418;
            --border-glow: #22252a;
            --text-glow: #00e5ff;
            --text-white: #f5f5f7;
            --text-muted: #8e8e93;
            --success-neon: #00ff66;
        }

        body {
            font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--carbon-dark);
            color: var(--text-white);
            overflow-x: hidden;
        }

        /* Top Mastery Telemetry Header */
        header {
            background-color: #000000;
            border-bottom: 1px solid var(--border-glow);
            padding: 15px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            letter-spacing: 1px;
        }

        .brand-title { 
            font-size: 22px; 
            font-weight: 900; 
            text-transform: uppercase;
            background: linear-gradient(90deg, #ffffff 0%, #888888 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .brand-title span { color: var(--tesla-red); -webkit-text-fill-color: initial; }

        /* Navigation Matrix */
        nav {
            background-color: var(--panel-bg);
            border-bottom: 1px solid var(--border-glow);
            display: flex;
            padding: 0 20px;
            overflow-x: auto;
        }

        nav button {
            background: none;
            border: none;
            padding: 16px 20px;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            cursor: pointer;
            color: var(--text-muted);
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-bottom: 2px solid transparent;
            white-space: nowrap;
        }

        nav button:hover {
            color: var(--text-white);
            background: rgba(255, 255, 255, 0.02);
        }

        nav button.active {
            color: var(--text-white);
            border-bottom: 2px solid var(--text-glow);
            background: linear-gradient(180deg, rgba(0, 229, 255, 0) 0%, rgba(0, 229, 255, 0.05) 100%);
        }

        /* Structural Core Grid */
        .wrapper {
            max-width: 1400px;
            margin: 30px auto;
            padding: 0 20px;
            display: grid;
            grid-template-columns: 3fr 1.1fr;
            gap: 30px;
        }

        .tab-panel {
            display: none;
            background: var(--panel-bg);
            padding: 35px;
            border-radius: 4px;
            border: 1px solid var(--border-glow);
        }

        .tab-panel.active { display: block; }

        h2 { 
            font-size: 20px;
            text-transform: uppercase; 
            letter-spacing: 2px;
            color: var(--text-white); 
            margin-top: 0;
            margin-bottom: 25px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        h2::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 18px;
            background: var(--tesla-red);
        }

        /* Form Subsystem controls */
        .form-row { margin-bottom: 24px; }
        .form-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        label { 
            display: block; 
            font-weight: 600; 
            margin-bottom: 8px; 
            color: var(--text-muted); 
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        input, select {
            width: 100%;
            padding: 14px;
            background: #0a0a0c;
            border: 1px solid #2d3139;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
            color: var(--text-white);
            transition: all 0.2s ease;
        }

        input:focus, select:focus {
            outline: none;
            border-color: var(--text-glow);
            box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
        }

        .btn-primary {
            background-color: #ffffff;
            color: #000000;
            padding: 14px 28px;
            border: none;
            border-radius: 4px;
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-primary:hover { 
            background-color: var(--text-glow);
            color: #000000;
            box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
        }

        .success-banner {
            display: none;
            background-color: rgba(0, 255, 102, 0.1);
            color: var(--success-neon);
            padding: 15px;
            border: 1px solid var(--success-neon);
            border-radius: 4px;
            margin-top: 20px;
            font-weight: bold;
            font-size: 14px;
            letter-spacing: 0.5px;
        }

        /* Structural Sidebar Units */
        .sidebar { display: flex; flex-direction: column; gap: 20px; }
        .ad-card {
            background: var(--panel-bg);
            border: 1px solid var(--border-glow);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .ad-card img { width: 100%; height: 180px; object-fit: cover; filter: grayscale(40%) contrast(110%); }
        .ad-card-content { padding: 20px; }
        .ad-card h4 { color: var(--text-white); margin: 0 0 8px 0; text-transform: uppercase; letter-spacing: 1px; font-size: 14px;}
        .ad-card p { font-size: 13px; margin: 0; color: var(--text-muted); line-height: 1.5; }

        /* Telemetry Stream Pod */
        .bot-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 300px;
            background: var(--panel-bg);
            border: 1px solid var(--border-glow);
            border-radius: 4px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            overflow: hidden;
        }

        .bot-header { 
            background: #000000; 
            color: var(--text-white); 
            padding: 12px 15px; 
            font-weight: bold; 
            font-size: 11px; 
            text-transform: uppercase; 
            letter-spacing: 1px;
            border-bottom: 1px solid var(--border-glow);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .bot-header::before {
            content: '';
            width: 6px;
            height: 6px;
            background: var(--success-neon);
            border-radius: 50%;
            display: inline-block;
        }
        .bot-chat { height: 160px; padding: 15px; font-size: 13px; background: #0c0c0e; overflow-y: auto; color: var(--text-muted); font-family: monospace;}
        .bot-input { display: flex; border-top: 1px solid var(--border-glow); }
        .bot-input input { border: none; padding: 12px; flex-grow: 1; border-radius: 0; background: transparent; font-size: 13px;}
        .bot-input button { background: #1c1d22; border: none; padding: 0 20px; cursor: pointer; color: var(--text-white); font-weight: bold; font-size: 11px; text-transform: uppercase;}

        /* Tactical Telemetry Cards */
        .account-templates {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }
        .acc-card {
            flex: 1;
            padding: 20px;
            border: 1px solid var(--border-glow);
            border-radius: 4px;
            background: #18181c;
        }
        .acc-card h4 { margin: 0 0 10px 0; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;}
        .acc-card p { margin: 0; color: var(--text-white); font-size: 22px; font-family: monospace; }
        
        /* High-fidelity Data Matrix Table */
        .txn-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            font-size: 13px;
        }
        .txn-table th, .txn-table td {
            padding: 14px;
            text-align: left;
            border-bottom: 1px solid var(--border-glow);
        }
        .txn-table th {
            background-color: #0c0c0e;
            color: var(--text-muted);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .txn-table tbody tr { transition: background-color 0.2s ease; cursor: pointer; }
        .txn-table tbody tr:hover { background-color: rgba(255, 255, 255, 0.02); }
        
        .txn-out { color: #ff3b30; font-weight: bold; font-family: monospace; }
        .txn-in { color: var(--success-neon); font-weight: bold; font-family: monospace; }

        /* Allocation UI Modules */
        .allocation-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }
        .pool-card {
            background: #0c0c0e;
            border: 1px solid var(--border-glow);
            padding: 25px;
            border-radius: 4px;
            position: relative;
            cursor: pointer;
        }
        .pool-card.selected {
            border-color: var(--text-glow);
            background: linear-gradient(135deg, #0c0c0e 0%, rgba(0, 229, 255, 0.03) 100%);
        }
        .pool-badge {
            position: absolute;
            top: 20px; right: 20px;
            background: var(--spacex-blue);
            color: white;
            font-size: 10px;
            padding: 4px 8px;
            border-radius: 2px;
            text-transform: uppercase;
            font-weight: bold;
            letter-spacing: 0.5px;
        }
        .pool-badge.tesla { background: var(--tesla-red); }
        .pool-title { font-size: 18px; font-weight: bold; margin-bottom: 5px; text-transform: uppercase; }
        .pool-metrics { font-family: monospace; color: var(--text-glow); font-size: 14px; margin-bottom: 15px;}
        
        /* Custom Progress Bars */
        .progress-container {
            background: #1c1d22;
            height: 6px;
            border-radius: 3px;
            overflow: hidden;
            margin: 15px 0;
        }
        .progress-bar { height: 100%; background: var(--text-glow); width: 0%; transition: width 1s ease; }
        .progress-bar.red-bar { background: var(--tesla-red); }

        /* Tesla Vehicle Cards Grid */
        .vehicle-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        .vehicle-card {
            background: #0c0c0e;
            border: 1px solid var(--border-glow);
            border-radius: 4px;
            padding: 20px;
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .vehicle-card:hover {
            border-color: var(--tesla-red);
        }
        .vehicle-card.selected {
            border-color: var(--tesla-red);
            background: linear-gradient(135deg, #0c0c0e 0%, rgba(204, 0, 0, 0.05) 100%);
        }
        .vehicle-name {
            font-size: 18px;
            font-weight: bold;
            text-transform: uppercase;
            margin-bottom: 5px;
            color: var(--text-white);
        }
        .vehicle-price {
            font-family: monospace;
            color: var(--success-neon);
            font-size: 15px;
            font-weight: bold;
            margin-bottom: 10px;
        }
        .vehicle-specs {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 15px;
            line-height: 1.6;
        }

        /* Cryptographic Overlay System (Modals) */
        .modal-overlay {
            display: none; 
            position: fixed; 
            top: 0; left: 0; 
            width: 100%; height: 100%;
            background: rgba(0,0,0,0.85); 
            backdrop-filter: blur(4px);
            z-index: 2000; 
            justify-content: center; 
            align-items: center;
        }
        .modal-content {
            background: var(--panel-bg); 
            padding: 35px; 
            border-radius: 4px; 
            width: 520px;
            border: 1px solid var(--border-glow);
            box-shadow: 0 20px 50px rgba(0,0,0,0.6);
            text-align: center;
        }
        .modal-content h2 { border-bottom: none; justify-content: center; margin-bottom: 15px; }
        .modal-content h2::before { display: none; }
        
        .receipt-box { 
            text-align: left; 
            margin: 25px 0; 
            padding: 20px; 
            background: #0a0a0c; 
            border: 1px solid var(--border-glow); 
            font-family: monospace;
            font-size: 13px;
        }
        .receipt-box p { margin: 10px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #1c1d22; padding-bottom: 8px;}
        .receipt-box p:last-child { border-bottom: none; }
        .receipt-box span { font-weight: bold; color: var(--text-white); }
        
        .btn-secondary {
            background-color: transparent;
            color: var(--text-muted);
            padding: 14px 24px;
            border: 1px solid var(--border-glow);
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-left: 10px;
            transition: all 0.2s ease;
        }
        .btn-secondary:hover { color: var(--text-white); border-color: #8e8e93; }
/* ---------- platform additions ---------- */
.panel { background: var(--panel-bg); padding: 35px; border-radius: 4px; border: 1px solid var(--border-glow); }
a { color: var(--text-glow); text-decoration: none; }
.badge-pill { font-size:10px; padding:3px 8px; border-radius:2px; text-transform:uppercase; font-weight:bold; letter-spacing:0.5px; }
.status-settled { color: var(--success-neon); }
.status-pending { color:#e5c158; }
.status-rejected, .status-failed { color:#ff3b30; }
.nav-badge { background:var(--tesla-red); color:#fff; font-size:9px; padding:2px 6px; border-radius:2px; margin-left:6px; }
.notif-bell { position:relative; cursor:pointer; }
.notif-dot { position:absolute; top:6px; right:6px; width:7px; height:7px; background:var(--tesla-red); border-radius:50%; }
.stat-number { font-family:monospace; font-size:26px; color:var(--text-white); }
.pool-tag { display:inline-block; font-size:10px; font-family:monospace; color:var(--text-muted); border:1px solid var(--border-glow); padding:2px 6px; border-radius:2px; margin-right:5px; }

/* ---------- side menu navigation (user + admin) ---------- */
.layout { max-width:1400px; margin:0 auto; padding:0 20px; display:flex; gap:25px; align-items:flex-start; }
.side-nav { width:235px; flex-shrink:0; background:var(--panel-bg); border:1px solid var(--border-glow);
    border-radius:4px; margin-top:30px; padding:10px 0; position:sticky; top:20px; max-height:calc(100vh - 60px); overflow-y:auto; }
.side-nav-title { padding:10px 20px 6px; font-size:10px; color:var(--text-muted); letter-spacing:2px; text-transform:uppercase; }
.side-nav a { display:block; padding:11px 20px; color:var(--text-muted); font-size:12px; text-transform:uppercase;
    letter-spacing:1.2px; font-weight:600; border-left:2px solid transparent; }
.side-nav a:hover { color:var(--text-white); background:rgba(255,255,255,0.02); }
.side-nav a.active { color:var(--text-white); border-left-color:var(--text-glow);
    background:linear-gradient(90deg, rgba(0,229,255,0.07), transparent); }
.layout .wrapper { margin-top:30px; flex:1; max-width:none; padding:0; }
@media (max-width:900px) {
    .layout { flex-direction:column; }
    .side-nav { width:100%; position:static; max-height:none; display:flex; flex-wrap:wrap; margin-top:15px; }
    .side-nav a { border-left:none; border-bottom:2px solid transparent; }
    .side-nav a.active { border-bottom-color:var(--text-glow); }
    .side-nav-title { width:100%; }
}

/* bulletproof pool selection — pure CSS, JS only syncs the form */
.pool-radio:checked + .pool-card { border-color: var(--text-glow); background: linear-gradient(135deg,#0c0c0e 0%,rgba(0,229,255,0.05) 100%); }
.pool-radio:checked + .vehicle-card { border-color: var(--tesla-red); background: linear-gradient(135deg,#0c0c0e 0%,rgba(204,0,0,0.06) 100%); }

/* pool cards as labels — native click-to-select, zero JS required */
label.pool-card, label.vehicle-card { display: block; }

/* ---------- mobile drawer + chat fab + small-screen fit ---------- */
#side-toggle{display:none;background:none;border:1px solid var(--border-glow);color:var(--text-white);padding:7px 12px;cursor:pointer;font-size:17px;border-radius:3px;line-height:1;}
#side-toggle:hover{border-color:var(--text-glow);color:var(--text-glow);}
#side-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.65);z-index:1400;}
#chat-fab{position:fixed;bottom:20px;right:20px;width:56px;height:56px;border-radius:50%;background:var(--panel-bg);border:1px solid var(--text-glow);color:var(--text-glow);cursor:pointer;z-index:1800;box-shadow:0 8px 24px rgba(0,0,0,0.55);display:flex;align-items:center;justify-content:center;transition:transform 0.15s ease;}
#chat-fab:hover{transform:scale(1.07);background:rgba(0,229,255,0.08);}
.bot-container{display:none;}
.bot-container.open{display:block;}
.layout .wrapper{min-width:0;}
main{min-width:0;}
@media (max-width:900px){
    #side-toggle{display:inline-block;}
    .layout{flex-direction:column;padding:0 12px;}
    .layout .wrapper{margin-top:15px;}
    .side-nav{position:fixed;top:0;left:0;height:100%;width:255px;margin:0;z-index:1500;transform:translateX(-105%);transition:transform 0.25s ease;border-radius:0;max-height:none;overflow-y:auto;}
    .side-nav.open{transform:none;box-shadow:20px 0 60px rgba(0,0,0,0.6);}
    #side-overlay.show{display:block;}
    body.locked{overflow:hidden;}
    .form-grid-2,.allocation-grid{grid-template-columns:1fr;}
    .txn-table{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch;}
    .account-templates{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
    .acc-card{min-width:0;padding:16px;}
    .acc-card p{font-size:17px !important;word-break:break-word;}
    h1{font-size:34px !important;}
    .tab-panel{padding:22px 16px;}
    .panel{padding:22px 16px;}
    .txn-table th,.txn-table td{padding:11px 12px;font-size:12px;}
    header{padding:12px 15px;flex-wrap:wrap;gap:10px;}
}
@media (max-width:640px){
    .account-templates{grid-template-columns:1fr;}
    .vehicle-grid{grid-template-columns:1fr;}
    .wrapper{display:block;padding:0 10px;}
    .sidebar{margin-top:20px;}
    h1{font-size:27px !important;}
    h2{font-size:17px;}
    .txn-table th,.txn-table td{padding:10px;font-size:11px;}
    .btn-primary,.btn-secondary{width:100%;margin:6px 0 0 0;}
    .modal-content{width:94%;padding:22px 18px;}
    input,select{font-size:16px;}
    .brand-title{font-size:18px;}
    .bot-container{left:10px;right:10px;width:auto;bottom:86px;}
    #chat-fab{bottom:16px;right:16px;}
    .pool-metrics,.vehicle-price{font-size:13px;}
}

/* ---------- phones: tables fit ALL columns, nothing cut off ---------- */
@media (max-width:640px){
    .txn-table{display:table;table-layout:fixed;width:100%;white-space:normal;overflow:visible;font-size:10px;border-collapse:collapse;}
    .txn-table th,.txn-table td{display:table-cell;white-space:normal;word-break:break-word;overflow-wrap:anywhere;padding:7px 5px !important;font-size:10px !important;text-align:left;}
    .txn-table th{font-size:8px !important;letter-spacing:0.4px;text-transform:uppercase;}
    .txn-table input,.txn-table select{width:100% !important;min-width:0;padding:5px !important;margin:2px 0;font-size:11px;}
    .txn-table button{padding:4px 6px !important;font-size:9px !important;margin:2px 2px 2px 0;}
    .txn-table form{display:block;margin:2px 0;}
}

/* ---------- phones: row cards with labels + 2 pools per row ---------- */
@media (max-width:640px){
    .txn-table, .txn-table tbody { display:block; width:100%; }
    .txn-table thead { display:none; }
    .txn-table tr { display:block; border:1px solid var(--border-glow); border-radius:4px; margin-bottom:10px; padding:8px 12px; background:#101014; }
    .txn-table td { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; border:none; padding:6px 0 !important; font-size:11px !important; white-space:normal; word-break:break-word; overflow-wrap:anywhere; }
    .txn-table td::before { content:attr(data-label); color:var(--text-muted); font-size:9px; text-transform:uppercase; letter-spacing:1px; flex-shrink:0; padding-top:2px; min-width:70px; }
    .txn-table td > span, .txn-table td > small { word-break:break-word; }
    .txn-table form { display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; margin:0; }
    .txn-table input, .txn-table select { width:auto !important; flex:1 1 80px; min-width:70px; padding:6px !important; font-size:11px; margin:0; }
    .txn-table button { flex:0 0 auto; }

    .vehicle-grid, .allocation-grid { grid-template-columns:1fr 1fr !important; gap:10px; }
    .vehicle-card, .pool-card { padding:12px; }
    .vehicle-card img, .pool-card img { height:80px; width:calc(100% + 24px) !important; margin:-12px -12px 10px !important; }
    .vehicle-name, .pool-title { font-size:12px; }
    .vehicle-price, .pool-metrics { font-size:11px; margin-bottom:6px; }
    .vehicle-specs { font-size:10px; margin-bottom:8px; }
    .pool-badge { top:8px; right:8px; font-size:8px; }
}

/* ---------- homepage card rows: 2 per row on phones ---------- */
@media (max-width:640px){
    .stats-grid { grid-template-columns:1fr 1fr !important; }
    .stats-grid .acc-card p { font-size:15px !important; }
    .stats-grid .acc-card h4 { font-size:10px; }
}

/* ---------- phones: table rows as label-above-value cards (overflow-proof) ---------- */
@media (max-width:640px){
    .txn-table, .txn-table tbody { display:block; width:100%; }
    .txn-table thead { display:none !important; }
    .txn-table tr { display:block; width:100%; box-sizing:border-box; border:1px solid var(--border-glow); border-radius:4px; margin-bottom:10px; padding:10px 12px; background:#101014; }
    .txn-table td { display:block; width:100%; box-sizing:border-box; border:none; padding:5px 0 !important; font-size:11px !important; white-space:normal; word-break:break-word; overflow-wrap:anywhere; text-align:left; line-height:1.5; }
    .txn-table td::before { display:block; content:attr(data-label); color:var(--text-muted); font-size:9px; text-transform:uppercase; letter-spacing:1px; margin-bottom:2px; }
    .txn-table td form { display:flex; flex-wrap:wrap; gap:5px; margin:0; justify-content:flex-start; }
    .txn-table input, .txn-table select { flex:1 1 90px; min-width:0; width:auto !important; padding:7px !important; font-size:12px !important; margin:0; }
    .txn-table button { flex:0 0 auto; padding:6px 10px !important; font-size:10px !important; white-space:nowrap; }
}

/* ---------- v10: overflow-proof forms + box-sizing on buttons ---------- */
.btn-primary, .btn-secondary, .modal-content { box-sizing:border-box; max-width:100%; }
.txn-table button, .txn-table input, .txn-table select { box-sizing:border-box; }

@media (max-width:640px){
    /* action controls stack full-width inside row cards — nothing can clip */
    .txn-table td form { display:block; width:100%; }
    .txn-table td form input,
    .txn-table td form select,
    .txn-table td form button { display:block; width:100% !important; margin:4px 0; padding:9px !important; font-size:12px !important; }
    .txn-table td form button { white-space:normal; }
    /* hero/CTA anchors respect padding inside width */
    a.btn-primary, a.btn-secondary { width:100%; box-sizing:border-box; }
}

/* ---------- v11: action rows 3-per-button + inline-style-proof controls ---------- */
@media (max-width:640px){
    .txn-table td form.adj-form { display:block !important; width:100%; }
    .txn-table td form.adj-form input,
    .txn-table td form.adj-form select,
    .txn-table td form.adj-form button {
        display:block !important; width:100% !important; margin:4px 0 !important;
        padding:10px !important; font-size:13px !important; box-sizing:border-box;
    }
    .txn-table td form.mini-form {
        display:inline-block !important; width:31.5%; margin:3px 0.5% !important;
        vertical-align:top; box-sizing:border-box;
    }
    .txn-table td form.mini-form button {
        display:block !important; width:100% !important; padding:9px 2px !important;
        font-size:9px !important; white-space:nowrap; box-sizing:border-box;
    }
    a.mini-btn {
        display:inline-block !important; width:31.5%; margin:3px 0.5% !important;
        box-sizing:border-box; text-align:center; padding:9px 2px;
        border:1px solid var(--text-glow); color:var(--text-glow);
        font-size:9px; font-weight:700; letter-spacing:1px; text-transform:uppercase;
        border-radius:2px; text-decoration:none;
    }
}

/* ---------- v12: actions cell = flexbox, exact 3 buttons per row ---------- */
@media (max-width:640px){
    .txn-table td:last-child { display:flex !important; flex-wrap:wrap; gap:6px; align-items:stretch; }
    .txn-table td:last-child::before { flex:0 0 100%; }
    .txn-table td form.adj-form { flex:0 0 100%; }
    .txn-table td form.mini-form { flex:0 0 calc(33.333% - 4px); margin:0 !important; width:auto !important; }
    .txn-table td form.mini-form button { width:100% !important; }
    .txn-table td a.mini-btn { flex:0 0 calc(33.333% - 4px); margin:0 !important; width:auto !important; box-sizing:border-box; }
}

/* ---------- v13: full-width mobile columns ---------- */
@media (max-width:900px){
    .layout { align-items:stretch !important; }
}
.stats-grid { display:grid !important; }
@media (max-width:640px){
    .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
    .stats-grid .acc-card p { font-size:15px !important; }
    .stats-grid .acc-card h4 { font-size:10px; }
}

/* ---------- v14: toggle switches for 0/1 settings ---------- */
.switch { position:relative; display:inline-block; width:52px; height:26px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:#1c1d22; border:1px solid var(--border-glow); border-radius:26px; cursor:pointer; transition:background 0.2s, border-color 0.2s; }
.switch .slider::before { content:''; position:absolute; width:20px; height:20px; left:3px; top:2px; background:var(--text-muted); border-radius:50%; transition:transform 0.2s, background 0.2s; }
.switch input:checked + .slider { background:rgba(0,255,102,0.15); border-color:var(--success-neon); }
.switch input:checked + .slider::before { transform:translateX(25px); background:var(--success-neon); }

/* ---------- status colors: green settled / yellow pending / red rejected ---------- */
.status-approved, .status-settled, .status-completed, .status-active,
.status-verified, .status-credited {
    color: var(--success-neon) !important;
}
.status-rejected, .status-failed, .status-banned, .status-defaulted, .status-closed {
    color: #ff3b30 !important;
}
.status-pending, .status-processing, .status-routing, .status-queued,
.status-awaiting, .status-cancelled, .status-paused, .status-unverified,
.status-upcoming, .status-held {
    color: #e5c158 !important;
}

/* ---------- support console above live-chat icon ---------- */
#chat-fab { bottom: 96px !important; }
.bot-container { bottom: 96px !important; }
@media (max-width:640px){
    #chat-fab { bottom: 90px !important; }
    .bot-container { bottom: 90px !important; }
}

/* ---------- v16: support console stacked clearly above live chat ---------- */
#chat-fab { bottom: 120px !important; right: 16px !important; }
.bot-container { bottom: 120px !important; right: 16px !important; }
@media (max-width:640px){
    #chat-fab { bottom: 108px !important; right: 12px !important; }
    .bot-container { left: 10px; right: 10px; width: auto; bottom: 108px !important; }
}
