
        /* ════════════════════════════════════════════════════════════════
           Charte Cara — SaaS L4
             Primary blue ............ #0052FF
             Bright cyan ............. #66FCF1
             Dark background ......... #0B0C10
             Light contrast .......... #F8F9FA
             Teal .................... #45A29E
             Dark gray ............... #333F50
           ════════════════════════════════════════════════════════════════ */
        :root {
            /* Brand */
            --brand-blue: #0052FF;
            --brand-cyan: #66FCF1;
            --brand-teal: #45A29E;
            --brand-ink:  #0B0C10;
            --brand-fog:  #F8F9FA;
            --brand-slate:#333F50;

            /* Surfaces — light theme par défaut */
            --bg-main: #F8F9FA;
            --bg-sidebar: rgba(255, 255, 255, 0.86);
            --bg-surface: rgba(255, 255, 255, 0.96);
            --bg-surface-hover: rgba(233, 244, 250, 0.98);
            --bg-input: rgba(255, 255, 255, 0.98);
            --bg-user-msg: linear-gradient(135deg, rgba(102, 252, 241, 0.34), rgba(0, 82, 255, 0.16));
            --bg-ai-msg: transparent;
            --bg-code: rgba(241, 247, 253, 0.98);
            --bg-file-card: rgba(245, 250, 253, 0.96);
            --bg-mission-log: rgba(235, 250, 249, 0.94);
            --bg-dropzone: rgba(102, 252, 241, 0.14);

            /* Text */
            --text-primary: var(--brand-ink);
            --text-secondary: var(--brand-slate);
            --text-tertiary: #6D7A8D;

            /* Borders */
            --border: rgba(0, 82, 255, 0.18);
            --border-light: rgba(0, 82, 255, 0.08);
            --border-strong: rgba(0, 82, 255, 0.32);

            /* Accents */
            --accent: var(--brand-blue);
            --accent-hover: #003FC9;
            --accent-soft: rgba(102, 252, 241, 0.3);
            --soft-text: #123E78;

            /* Status */
            --success: var(--brand-teal);
            --warning: #F2A93B;
            --error:   #E0445C;
            --info:    var(--brand-blue);

            /* Elevation */
            --shadow-xs: 0 1px 2px rgba(11, 12, 16, 0.04), 0 1px 3px rgba(0, 82, 255, 0.05);
            --shadow-sm: 0 4px 12px rgba(11, 12, 16, 0.06), 0 2px 6px rgba(0, 82, 255, 0.06);
            --shadow-md: 0 14px 32px rgba(11, 12, 16, 0.10), 0 6px 16px rgba(0, 82, 255, 0.08);
            --shadow-lg: 0 28px 64px rgba(11, 12, 16, 0.16), 0 12px 32px rgba(0, 82, 255, 0.10);
            --shadow-glow: 0 0 0 4px rgba(0, 82, 255, 0.12);

            /* Radius / motion */
            --radius-sm: 10px;
            --radius-md: 16px;
            --radius-lg: 22px;
            --radius-xl: 30px;
            --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* [data-theme="dark"] rules removed — DAAT est light-only.
           Voir app/static/css/index.css pour la nouvelle charte. */

        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'DAATSystem Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background:
                radial-gradient(circle at 15% 20%, rgba(0, 82, 255, 0.12), transparent 26%),
                radial-gradient(circle at 80% 12%, rgba(102, 252, 241, 0.14), transparent 24%),
                linear-gradient(180deg, #F7FAFD 0%, #EEF4F9 100%);
            color: var(--text-primary);
            height: 100vh;
            overflow: hidden;
        }
        .app { display: flex; height: 100%; }

        /* ═══ SIDEBAR ═══ */
        .sidebar {
            width: 280px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
            display: flex; flex-direction: column; flex-shrink: 0;
            transition: transform 0.3s ease;
            backdrop-filter: blur(22px);
            box-shadow: inset -1px 0 0 rgba(0, 82, 255, 0.06);
        }
        .sidebar.collapsed { transform: translateX(-280px); position: absolute; z-index: 100; height: 100%; }
        .sidebar-header { padding: 16px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
        .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; letter-spacing: -0.02em; }
        .brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
        .sidebar-actions { padding: 8px 16px 16px; }
        .new-chat-btn {
            width: 100%; background: var(--bg-surface); border: 1px solid var(--border);
            border-radius: 18px; padding: 12px 16px; cursor: pointer;
            font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--text-primary);
            text-align: left; transition: var(--transition); display: flex; align-items: center; gap: 8px;
            box-shadow: 0 0 0 1px rgba(102, 252, 241, 0.06), 0 12px 30px rgba(0, 0, 0, 0.22);
        }
        .new-chat-btn:hover { background: var(--bg-surface-hover); border-color: var(--accent); color: var(--soft-text); box-shadow: 0 0 0 1px rgba(102, 252, 241, 0.12), 0 0 26px rgba(0, 82, 255, 0.1); }
        .new-chat-btn svg { opacity: 0.5; }
        .history-section { flex: 1; overflow-y: auto; padding: 0 8px; }
        .history-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); padding: 12px 8px 6px; font-weight: 600; }
        .history-item {
            padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; color: var(--text-secondary);
            cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            transition: var(--transition); margin-bottom: 2px; position: relative;
        }
        .history-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
        .history-item.active { background: rgba(226, 244, 248, 0.92); color: var(--soft-text); font-weight: 600; border: 1px solid rgba(0, 82, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(102, 252, 241, 0.2); }
        .history-item .delete-btn {
            position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0;
            background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 1rem; padding: 2px 6px;
        }
        .history-item:hover .delete-btn { opacity: 0.6; }
        .history-item .delete-btn:hover { opacity: 1; color: var(--error); }
        .sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
        .theme-toggle {
            background: none; border: 1px solid var(--border); border-radius: 6px;
            padding: 6px 10px; cursor: pointer; font-size: 0.75rem; color: var(--text-secondary);
            transition: var(--transition); display: flex; align-items: center; gap: 4px;
        }
        .theme-toggle:hover { border-color: var(--accent); color: var(--text-primary); }
        .version-tag { font-size: 0.7rem; color: var(--text-tertiary); }

        /* ═══ MAIN ═══ */
        .main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
        .topbar {
            height: 48px; border-bottom: 1px solid var(--border-light); display: flex;
            align-items: center; padding: 0 16px; flex-shrink: 0;
            background: rgba(255, 255, 255, 0.68);
            backdrop-filter: blur(18px);
        }
        .menu-btn {
            display: none; background: none; border: none; cursor: pointer; color: var(--text-secondary);
            padding: 6px; border-radius: 6px;
        }
        .menu-btn:hover { background: var(--bg-surface-hover); }
        .topbar-title { font-size: 0.85rem; color: var(--text-secondary); margin-left: 8px; }
        .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
        .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
        .status-dot.disconnected { background: var(--error); }

        /* ═══ CHAT AREA ═══ */
        .chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
        .chat-container { max-width: 720px; margin: 0 auto; padding: 24px 20px 100px; }

        /* Welcome */
        .welcome { text-align: center; padding: 80px 20px 40px; }
        .welcome h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 8px; }
        .welcome p { color: var(--text-secondary); font-size: 0.95rem; max-width: 400px; margin: 0 auto; line-height: 1.5; }
        .quick-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
        .quick-action {
            background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
            padding: 10px 16px; cursor: pointer; font: inherit; font-size: 0.85rem; color: var(--text-secondary);
            transition: var(--transition); display: flex; align-items: center; gap: 6px;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
        }
        .quick-action:hover { border-color: var(--accent); color: var(--soft-text); background: var(--accent-soft); box-shadow: 0 0 0 1px rgba(102, 252, 241, 0.12), 0 0 22px rgba(0, 82, 255, 0.08); }

        /* Messages */
        .msg { padding: 12px 0; display: flex; gap: 12px; animation: fadeIn 0.3s ease; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
        .msg.user { justify-content: flex-end; }
        .msg.user .msg-content {
            background: var(--bg-user-msg); border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
            padding: 12px 16px; max-width: 85%; font-size: 0.925rem; line-height: 1.55;
            color: var(--soft-text);
            border: 1px solid rgba(0, 82, 255, 0.1);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
        }
        .msg.ai { align-items: flex-start; }
        .msg.ai .msg-avatar {
            min-width: 46px; height: 28px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--accent);
            color: white; display: flex; align-items: center; justify-content: center; font-size: 0.58rem;
            letter-spacing: 0.08em; font-weight: 700; flex-shrink: 0; margin-top: 2px;
        }
        .msg.ai .msg-content { flex: 1; min-width: 0; font-size: 0.925rem; line-height: 1.65; }
        .msg.ai .msg-content p { margin-bottom: 8px; }
        .msg.ai .msg-content p:last-child { margin-bottom: 0; }
        .msg.ai .msg-content strong { font-weight: 600; }
        .msg.ai .msg-content code {
            background: var(--bg-code); padding: 2px 6px; border-radius: 4px;
            font-family: 'DAATSystem Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.85em;
        }
        .msg.ai .msg-content pre {
            background: var(--bg-code); border-radius: var(--radius-sm); padding: 14px 16px;
            overflow-x: auto; margin: 10px 0; border: 1px solid var(--border);
        }
        .msg.ai .msg-content pre code { background: none; padding: 0; }
        .msg.ai .msg-content a {
            color: var(--accent);
            font-weight: 650;
            text-decoration: none;
            overflow-wrap: anywhere;
        }
        .msg.ai .msg-content a:hover { text-decoration: underline; }

        /* Mission Log — Conteneur déroulable */
        .mission-log-container {
            margin: 8px 0;
        }
        .mission-log-container details {
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .mission-log-container details summary {
            cursor: pointer; padding: 8px 12px; font-size: 0.825rem;
            color: var(--text-secondary); background: var(--bg-mission-log);
            list-style: none; display: flex; align-items: center; gap: 6px;
            user-select: none;
        }
        .mission-log-container details summary::-webkit-details-marker { display: none; }
        .mission-log-container details summary::before {
            content: '▶'; font-size: 0.65rem; transition: transform 0.2s;
            display: inline-block;
        }
        .mission-log-container details[open] summary::before { transform: rotate(90deg); }
        .mission-log-container .mission-logs-inner {
            max-height: 300px; overflow-y: auto;
        }
        .mission-log {
            background: var(--bg-mission-log); border-left: 3px solid var(--accent);
            padding: 8px 12px; margin: 0; border-radius: 0;
            font-size: 0.825rem; color: var(--text-secondary); line-height: 1.4;
        }
        .mission-log + .mission-log { border-top: 1px solid var(--border-light); }
        .mission-log.error { border-left-color: var(--error); }
        .mission-log.success { border-left-color: var(--success); }
        .mission-summary {
            padding: 10px 14px; margin: 8px 0; border-radius: var(--radius-sm);
            font-size: 0.9rem; line-height: 1.5;
        }
        .mission-summary.success {
            background: rgba(61, 139, 55, 0.08); border: 1px solid rgba(61, 139, 55, 0.2);
            color: var(--success);
        }
        .mission-summary.error {
            background: rgba(196, 78, 78, 0.08); border: 1px solid rgba(196, 78, 78, 0.2);
            color: var(--error);
        }
        .mission-summary.pending {
            background: rgba(74, 126, 181, 0.08); border: 1px solid rgba(74, 126, 181, 0.2);
            color: var(--info);
        }
        .mission-summary.has-action-link {
            display: grid;
            gap: 7px;
            max-width: 560px;
            padding: 14px;
            border-radius: 8px;
            color: var(--text-primary);
            background: var(--bg-surface);
            border: 1px solid rgba(69, 162, 158, 0.28);
            box-shadow: var(--shadow-sm);
        }
        .mission-summary.success.has-action-link {
            color: var(--text-primary);
            background: var(--bg-surface);
            border-color: rgba(69, 162, 158, 0.28);
        }
        .mission-summary-eyebrow {
            color: var(--success);
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0;
            text-transform: uppercase;
        }
        .mission-summary-title {
            color: var(--text-primary);
            font-size: 1rem;
            font-weight: 750;
            line-height: 1.25;
        }
        .mission-summary-body {
            color: var(--text-secondary);
            font-size: 0.88rem;
            line-height: 1.45;
        }
        .mission-summary-action-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 3px;
        }
        .mission-summary-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            min-height: 38px;
            padding: 8px 13px;
            border-radius: 8px;
            background: var(--accent);
            color: white !important;
            font-size: 0.86rem;
            font-weight: 750;
            box-shadow: 0 8px 18px rgba(0, 82, 255, 0.16);
            transition: var(--transition);
        }
        .mission-summary-action::after {
            content: '->';
            font-weight: 800;
            line-height: 1;
        }
        .mission-summary-action:hover {
            background: var(--accent-hover);
            text-decoration: none !important;
            transform: translateY(-1px);
        }
        .mission-summary-host {
            min-width: 0;
            max-width: 260px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--text-tertiary);
            font-size: 0.78rem;
        }

        /* File Cards */
        .file-card {
            background: var(--bg-file-card); border: 1px solid var(--border); border-radius: var(--radius-md);
            padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin: 8px 0;
            transition: var(--transition);
        }
        .file-card:hover { border-color: var(--accent); }
        .file-icon { font-size: 1.3rem; }
        .file-info { flex: 1; min-width: 0; }
        .file-name { font-size: 0.85rem; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .file-meta { font-size: 0.7rem; color: var(--text-tertiary); }
        .file-download {
            background: var(--accent); color: white; border: none; border-radius: 6px;
            padding: 6px 12px; cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 600;
            text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: var(--transition);
        }
        .file-download:hover { background: var(--accent-hover); }

        /* Email Card */
        .email-card {
            background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
            padding: 14px; margin: 8px 0;
        }
        .email-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
        .email-card-sender { font-weight: 600; font-size: 0.85rem; }
        .email-card-subject { font-size: 0.85rem; color: var(--text-secondary); }
        .email-card-body { font-size: 0.825rem; color: var(--text-secondary); line-height: 1.5; margin: 8px 0; }
        .email-card-actions { display: flex; gap: 8px; margin-top: 10px; }
        .email-card-actions button {
            background: var(--bg-surface-hover); border: 1px solid var(--border); border-radius: 6px;
            padding: 6px 12px; cursor: pointer; font: inherit; font-size: 0.8rem; transition: var(--transition);
        }
        .email-card-actions button:hover { border-color: var(--accent); }
        .email-card-actions button.primary { background: var(--accent); color: white; border-color: var(--accent); }

        /* HITL Card */
        .hitl-card {
            background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-md);
            padding: 14px; margin: 10px 0;
        }
        .hitl-card p { font-size: 0.875rem; margin-bottom: 10px; line-height: 1.5; }
        .hitl-card input {
            width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
            font: inherit; font-size: 0.85rem; background: var(--bg-surface); margin-bottom: 8px;
        }
        .hitl-card .hitl-actions { display: flex; gap: 8px; }
        .hitl-card button {
            padding: 7px 16px; border-radius: 6px; font: inherit; font-size: 0.8rem; cursor: pointer; border: 1px solid var(--border); transition: var(--transition);
        }
        .hitl-card button.approve { background: var(--accent); color: white; border-color: var(--accent); }
        .hitl-card button.cancel { background: var(--bg-surface); }
        .mission-feedback-card {
            background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
            padding: 14px; margin: 10px 0; box-shadow: var(--shadow-sm);
        }
        .mission-feedback-card p {
            font-size: 0.9rem; line-height: 1.5; margin-bottom: 12px; color: var(--text-primary);
        }
        .mission-feedback-actions { display: flex; gap: 10px; }
        .mission-feedback-btn {
            min-width: 92px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
            background: var(--bg-surface-hover); color: var(--text-primary); cursor: pointer; font: inherit;
            font-size: 0.85rem; font-weight: 600; transition: var(--transition);
        }
        .mission-feedback-btn:hover { border-color: var(--accent); }
        .mission-feedback-btn.selected-yes {
            background: rgba(61, 139, 55, 0.12); border-color: rgba(61, 139, 55, 0.35); color: var(--success);
        }
        .mission-feedback-btn.selected-no {
            background: rgba(196, 78, 78, 0.12); border-color: rgba(196, 78, 78, 0.35); color: var(--error);
        }
        .mission-feedback-card .mission-feedback-status {
            margin-top: 10px; font-size: 0.8rem; color: var(--text-secondary);
        }
        .feature-not-available-card {
            background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-hover));
            border: 1px solid var(--border);
            border-left: 4px solid #c98a19;
            border-radius: var(--radius-md);
            padding: 14px;
            margin: 10px 0;
            box-shadow: var(--shadow-sm);
        }
        .feature-not-available-card h4 {
            margin: 0 0 8px;
            font-size: 0.92rem;
            color: var(--text-primary);
        }
        .feature-not-available-card p {
            margin: 0;
            font-size: 0.86rem;
            line-height: 1.55;
            color: var(--text-secondary);
        }
        .feature-not-available-card .feature-not-available-reason {
            display: inline-flex;
            align-items: center;
            margin-top: 10px;
            font-size: 0.76rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
            color: #9a6b11;
        }
        .mission-params-card {
            background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
            padding: 14px; margin: 10px 0; box-shadow: var(--shadow-sm);
        }
        .mission-params-card h4 {
            margin: 0 0 12px; font-size: 0.92rem; color: var(--text-primary);
        }
        .mission-params-form {
            display: flex; flex-direction: column; gap: 10px;
        }
        .mission-params-field {
            display: flex; flex-direction: column; gap: 6px;
        }
        .mission-params-field label {
            font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
        }
        .mission-params-field input,
        .mission-params-field textarea {
            width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
            font: inherit; font-size: 0.84rem; background: var(--bg-input); color: var(--text-primary);
        }
        .mission-params-field textarea {
            min-height: 96px; resize: vertical;
        }
        .mission-params-submit {
            align-self: flex-start; margin-top: 4px; padding: 10px 16px; border-radius: 8px; border: none;
            background: var(--accent); color: white; font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer;
        }
        .mission-params-submit:disabled {
            opacity: 0.45; cursor: default;
        }

        /* ═══ INPUT AREA ═══ */
        .input-area {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: linear-gradient(transparent, var(--bg-main) 30%);
            padding: 0 20px 16px;
        }
        .pending-files {
            max-width: 720px; margin: 0 auto 10px; display: flex; flex-wrap: wrap; gap: 8px;
        }
        .composer-smart-paste {
            width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md);
            background: var(--bg-surface); overflow: hidden; box-shadow: var(--shadow-sm);
        }
        .composer-smart-paste summary {
            list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 12px;
            padding: 12px 14px; user-select: none;
        }
        .composer-smart-paste summary::-webkit-details-marker { display: none; }
        .composer-smart-paste summary::before {
            content: '▶'; font-size: 0.7rem; color: var(--text-tertiary); margin-top: 4px;
            transition: transform 0.2s ease;
        }
        .composer-smart-paste[open] summary::before { transform: rotate(90deg); }
        .composer-smart-paste-main { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; }
        .composer-smart-paste-icon { font-size: 1.1rem; line-height: 1.2; }
        .composer-smart-paste-title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
        .composer-smart-paste-meta { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
        .composer-smart-paste-hint { font-size: 0.76rem; color: var(--text-tertiary); margin-top: 4px; }
        .composer-smart-paste-remove {
            background: none; border: none; color: var(--text-tertiary); cursor: pointer; font: inherit;
            font-size: 1rem; line-height: 1; padding: 0; flex-shrink: 0;
        }
        .composer-smart-paste-remove:hover { color: var(--error); }
        .composer-smart-paste .paste-content {
            padding: 0 14px 14px 38px; font-size: 0.82rem; line-height: 1.55; color: var(--text-secondary);
            white-space: pre-wrap; word-break: break-word; border-top: 1px solid var(--border-light);
            max-height: 240px; overflow-y: auto;
        }
        .input-box {
            max-width: 720px; margin: 0 auto; background: var(--bg-input);
            border: 1px solid var(--border); border-radius: var(--radius-lg);
            padding: 8px 12px; display: flex; align-items: flex-end; gap: 8px;
            box-shadow: 0 0 0 1px rgba(102, 252, 241, 0.08), var(--shadow-md); transition: var(--transition);
            backdrop-filter: blur(18px);
        }
        .input-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-soft), 0 0 30px rgba(102, 252, 241, 0.12); }
        .input-box.drag-over { border-color: var(--accent); background: var(--bg-dropzone); border-style: dashed; }
        .input-box textarea {
            flex: 1; border: none; outline: none; resize: none; font: inherit; font-size: 0.925rem;
            background: transparent; color: var(--text-primary); line-height: 1.5; min-height: 24px; max-height: 200px;
        }
        .input-box textarea::placeholder { color: var(--text-tertiary); }
        .icon-btn {
            background: none; border: none; color: var(--text-tertiary); cursor: pointer;
            padding: 6px; border-radius: 6px; transition: var(--transition); flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .icon-btn:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
        .send-btn {
            background: var(--accent); color: white; border: none; border-radius: var(--radius-sm);
            width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center;
            justify-content: center; transition: var(--transition); flex-shrink: 0;
        }
        .send-btn:hover { background: var(--accent-hover); }
        .send-btn:disabled { opacity: 0.4; cursor: default; }
        .send-btn svg { width: 16px; height: 16px; }
        .pending-file {
            display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft);
            border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; color: var(--accent);
        }
        .pending-file .remove-file { cursor: pointer; opacity: 0.6; }
        .pending-file .remove-file:hover { opacity: 1; }
        .disclaimer {
            text-align: center; font-size: 0.7rem; color: var(--text-tertiary);
            margin-top: 8px; max-width: 720px; margin-left: auto; margin-right: auto;
        }

        /* ═══ TYPING INDICATOR ═══ */
        .typing-indicator { display: flex; gap: 4px; align-items: center; padding: 8px 0; }
        .typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); animation: typingBounce 1.4s ease-in-out infinite; }
        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }
        @keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

        /* ═══ RESPONSIVE ═══ */
        @media (max-width: 768px) {
            .sidebar { position: fixed; z-index: 100; height: 100%; transform: translateX(-280px); }
            .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
            .menu-btn { display: flex; }
            .overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 99; }
            .overlay.show { display: block; }
            .mission-summary.has-action-link { max-width: 100%; }
            .mission-summary-action-row { align-items: flex-start; flex-direction: column; }
            .mission-summary-action { width: 100%; }
            .mission-summary-host { max-width: 100%; }
        }
        @media (min-width: 769px) {
            .sidebar.collapsed { transform: translateX(0); position: relative; }
        }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

        /* ═══ STEP2: GLOBAL DROPZONE OVERLAY ═══ */
        .dropzone-overlay {
            position: fixed; inset: 0;
            background: var(--bg-dropzone);
            backdrop-filter: blur(4px);
            z-index: 99999;
            display: none;
            pointer-events: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border: 3px dashed var(--accent);
            transition: opacity 0.2s ease;
        }
        .dropzone-overlay.active {
            display: flex;
            pointer-events: auto;
        }
        .dropzone-overlay .drop-icon {
            font-size: 3rem;
            margin-bottom: 12px;
            animation: dropBounce 1s ease infinite;
        }
        .dropzone-overlay .drop-text {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--accent);
        }
        .dropzone-overlay .drop-hint {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 6px;
        }
        @keyframes dropBounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }

        /* ═══ STEP2: SMART PASTE (Collapsible Cell) ═══ */
        .smart-paste {
            background: var(--bg-file-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            margin: 4px 0;
            overflow: hidden;
            width: 100%;
            max-width: none;
        }
        .smart-paste summary {
            padding: 10px 14px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
            list-style: none;
            user-select: none;
        }
        .smart-paste summary::-webkit-details-marker { display: none; }
        .smart-paste summary::before {
            content: '▶';
            font-size: 0.65rem;
            color: var(--text-tertiary);
            transition: transform 0.2s ease;
        }
        .smart-paste[open] summary::before { transform: rotate(90deg); }
        .smart-paste .paste-preview {
            color: var(--text-secondary);
            font-size: 0.8rem;
            margin-left: auto;
            white-space: nowrap;
        }
        .smart-paste .paste-content {
            padding: 0 14px 12px;
            font-size: 0.825rem;
            line-height: 1.55;
            color: var(--text-secondary);
            white-space: pre-wrap;
            word-break: break-word;
            max-height: 400px;
            overflow-y: auto;
            border-top: 1px solid var(--border-light);
        }

        /* ═══ STEP2: FILE CHIP (Upload Feedback) ═══ */
        .file-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--bg-file-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            margin: 4px 0;
            font-size: 0.825rem;
            animation: fadeIn 0.3s ease;
        }
        .file-chip .chip-icon { font-size: 1.1rem; }
        .file-chip .chip-name { font-weight: 500; color: var(--text-primary); }
        .file-chip .chip-size { color: var(--text-tertiary); font-size: 0.75rem; }

        /* ═══ PLUGIN WIDGETS ═══ */
        .widget-card {
            border: 1px solid var(--border); border-radius: var(--radius-md);
            overflow: hidden; margin: 10px 0; background: var(--bg-surface);
            box-shadow: var(--shadow-sm);
        }

        /* Weather */
        .widget-weather { padding: 0; }
        .weather-main {
            display: flex; gap: 20px; padding: 20px;
            background: linear-gradient(135deg, #4A90D9 0%, #67B8DE 50%, #87CEEB 100%);
            color: white;
        }
        .weather-left { flex: 1; }
        .weather-emoji-big { font-size: 3rem; margin-bottom: 4px; }
        .weather-temp { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
        .weather-desc { font-size: 0.95rem; opacity: 0.9; margin-top: 4px; text-transform: capitalize; }
        .weather-city { font-size: 0.8rem; opacity: 0.75; margin-top: 8px; }
        .weather-right { display: flex; flex-direction: column; gap: 6px; justify-content: center; min-width: 160px; }
        .weather-detail { font-size: 0.82rem; opacity: 0.9; }
        .weather-detail strong { font-weight: 600; }
        .weather-forecast {
            display: flex; justify-content: space-around; padding: 14px 20px;
            background: var(--bg-surface); border-top: 1px solid var(--border);
        }
        .forecast-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
        .forecast-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.05em; }
        .forecast-emoji { font-size: 1.4rem; }
        .forecast-temps { font-size: 0.78rem; color: var(--text-secondary); }

        /* Finance */
        .widget-finance { padding: 0; }
        .finance-price-bar {
            display: flex; align-items: center; gap: 16px; padding: 14px 20px;
            background: var(--bg-surface); border-bottom: 1px solid var(--border);
        }
        .finance-eur { font-size: 1.3rem; font-weight: 700; }
        .finance-usd { font-size: 0.9rem; color: var(--text-secondary); }
        .finance-change { font-size: 0.85rem; font-weight: 600; margin-left: auto; }
        .tradingview-container { min-height: 400px; }

        /* Maps */
        .widget-maps { padding: 0; }
        .maps-container iframe { display: block; }
        .maps-footer {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 14px; font-size: 0.82rem; color: var(--text-secondary);
        }
        .maps-link { color: var(--accent); text-decoration: none; font-weight: 500; }
        .maps-link:hover { text-decoration: underline; }

        /* DateTime */
        .widget-datetime { padding: 0; }
        .datetime-widget {
            text-align: center; padding: 24px 20px;
            background: linear-gradient(135deg, var(--accent-soft), var(--bg-surface));
        }
        .datetime-time { font-size: 3rem; font-weight: 700; letter-spacing: -0.04em; color: var(--accent); }
        .datetime-date { font-size: 1rem; color: var(--text-secondary); margin-top: 4px; text-transform: capitalize; }
        .datetime-city { font-size: 0.82rem; color: var(--text-tertiary); margin-top: 8px; }

        .widget-error { padding: 14px; color: var(--error); font-size: 0.85rem; }

        /* Flights */
        .widget-flights { padding: 0; }
        .flights-header {
            padding: 16px 20px;
            background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 60%, #60a5fa 100%);
            color: white;
        }
        .flights-route {
            display: flex; align-items: center; gap: 12px;
            font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em;
        }
        .flights-city { font-size: 1.25rem; }
        .flights-arrow { font-size: 1.05rem; opacity: 0.9; }
        .flights-meta {
            display: flex; flex-wrap: wrap; gap: 14px;
            margin-top: 8px; font-size: 0.82rem; opacity: 0.95;
        }
        .flights-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 10px; padding: 14px;
            background: var(--bg-surface);
        }
        .flight-card {
            display: flex; flex-direction: column; gap: 6px;
            padding: 12px 14px; border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-elevated, #fff);
            color: var(--text-primary);
            text-decoration: none;
            transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
        }
        .flight-card:hover {
            border-color: var(--accent);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }
        .flight-card-top {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.82rem;
        }
        .flight-rank {
            font-weight: 700; color: var(--accent);
            min-width: 24px;
        }
        .flight-site {
            flex: 1;
            text-transform: capitalize;
            color: var(--text-secondary);
        }
        .flight-price {
            font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
        }
        .flight-price-unknown {
            font-size: 0.85rem; font-weight: 500; color: var(--text-tertiary);
        }
        .flight-airline {
            font-size: 0.85rem; color: var(--text-primary); font-weight: 500;
        }
        .flight-times {
            font-size: 0.82rem; color: var(--text-secondary);
        }
        .flight-card-bot {
            display: flex; gap: 10px; font-size: 0.75rem; color: var(--text-tertiary);
        }
        .flight-cta {
            margin-top: 4px; font-size: 0.78rem; color: var(--accent); font-weight: 600;
        }
        .flights-deeplinks {
            padding: 12px 16px 16px;
            border-top: 1px solid var(--border);
        }
        .flights-deeplinks-label {
            font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 8px;
        }
        .flights-deeplinks-row {
            display: flex; flex-wrap: wrap; gap: 8px;
        }
        .flight-deeplink-btn {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 6px 10px;
            font-size: 0.8rem; font-weight: 500;
            color: var(--accent);
            background: var(--accent-soft);
            border: 1px solid var(--accent);
            border-radius: var(--radius-sm);
            text-decoration: none;
            text-transform: capitalize;
            transition: background-color 0.15s ease;
        }
        .flight-deeplink-btn:hover {
            background: var(--accent); color: white;
        }

        /* ═══ Sprint 3: STATUS BANNER (reconnexion) ═══ */
        .status-banner {
            position: fixed; top: 0; left: 0; right: 0; z-index: 999;
            padding: 8px 16px; font-size: 0.82rem; font-weight: 500;
            text-align: center; transform: translateY(-100%);
            transition: transform 0.3s ease;
        }
        .status-banner.visible { transform: translateY(0); }
        .status-banner.disconnected {
            background: var(--error); color: white;
        }
        .status-banner.reconnecting {
            background: var(--warning); color: white;
        }
        .status-banner.reconnected {
            background: var(--success); color: white;
        }

        /* ═══ Sprint 3: MISSION SPINNER ═══ */
        .topbar-mission-status {
            display: none; align-items: center; gap: 6px;
            font-size: 0.78rem; color: var(--accent); font-weight: 500;
        }
        .topbar-mission-status.active { display: flex; }
.spinner {
    width: 14px; height: 14px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth UI */
.sidebar-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.sidebar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.account-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 0 0 1px rgba(0, 82, 255, 0.05), 0 18px 40px rgba(25, 63, 117, 0.12);
    backdrop-filter: blur(16px);
}

.account-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.account-email {
    font-size: 0.76rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.account-action {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.account-action:hover {
    background: var(--accent-hover);
}

.account-action.secondary {
    background: var(--accent-soft);
    color: var(--soft-text);
    border: 1px solid var(--border);
}

.account-action.secondary:hover {
    border-color: var(--accent);
}

.account-connection-hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.account-connection-copy {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
}

.account-connections-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-connection-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-main);
}

.account-connection-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.account-connection-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.account-provider-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 82, 255, 0.1);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.account-connection-email {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.account-connection-detail {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
}

.account-connection-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.account-connection-revoke {
    min-width: 120px;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(230, 57, 70, 0.18);
    background: rgba(230, 57, 70, 0.08);
    color: #d62839;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.account-connection-revoke:hover {
    background: rgba(230, 57, 70, 0.14);
}

.account-empty-state {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(102, 252, 241, 0.18), transparent 35%),
        linear-gradient(135deg, rgba(11, 12, 16, 0.92), rgba(51, 63, 80, 0.78));
    backdrop-filter: blur(10px);
}

.auth-gate.hidden {
    display: none;
}

.auth-card {
    width: min(100%, 420px);
    background: var(--bg-surface);
    border: 1px solid rgba(102, 252, 241, 0.18);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 0 0 1px rgba(0, 82, 255, 0.16), 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(102, 252, 241, 0.14);
    color: var(--soft-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-card h2 {
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.auth-copy {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-tab {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-main);
    color: var(--text-secondary);
    padding: 10px 12px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form-hidden {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.92rem;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
}

.auth-field textarea,
.auth-field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.92rem;
}

.auth-field textarea:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
}

.auth-submit {
    margin-top: 4px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 252, 241, 0.9), rgba(69, 162, 158, 0.85));
    color: var(--soft-text);
    padding: 12px 14px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-submit {
    background: var(--accent-soft);
    color: var(--soft-text);
    border: 1px solid var(--border);
}

.secondary-submit:hover {
    border-color: var(--accent);
    background: rgba(102, 252, 241, 0.12);
}

.auth-submit:disabled {
    opacity: 0.55;
    cursor: default;
}

.auth-feedback {
    min-height: 22px;
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.auth-feedback.error {
    color: var(--error);
}

.auth-feedback.success {
    color: var(--success);
}

.auth-helper {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.auth-helper:empty {
    display: none;
}

.auth-copy-compact {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-inline-actions {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 4px;
}

.auth-link-btn {
    background: transparent;
    border: 0;
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link-btn:hover {
    color: var(--text-primary);
}

.auth-field-hidden {
    display: none !important;
}

body.auth-locked {
    overflow: hidden;
}

body.auth-locked .app {
    filter: blur(10px) saturate(0.9);
    pointer-events: none;
    user-select: none;
}

.account-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 28px 20px 120px;
}

.account-workspace.hidden {
    display: none;
}

.account-page {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.account-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 26px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(102, 252, 241, 0.16), transparent 38%),
        linear-gradient(135deg, rgba(235, 245, 250, 0.96), rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(0, 82, 255, 0.12);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.account-page-eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(102, 252, 241, 0.26);
    color: #123E78;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-hero h1 {
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
    color: #0F1724;
}

.account-hero p {
    max-width: 620px;
    color: #44556A;
    line-height: 1.6;
}

.account-page-close {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    color: #123E78;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.account-page-close:hover {
    border-color: var(--accent);
}

.account-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-section-tab {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.account-section-tab.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--soft-text);
    box-shadow: 0 0 18px rgba(102, 252, 241, 0.08);
}

.account-feedback {
    min-height: 22px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.account-feedback.success {
    color: var(--success);
}

.account-feedback.error {
    color: var(--error);
}

.account-section {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.account-section.active {
    display: flex;
}

.account-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.account-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.account-card-highlight {
    background:
        linear-gradient(135deg, rgba(0, 82, 255, 0.1), rgba(102, 252, 241, 0.08)),
        var(--bg-surface);
}

.account-card-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.account-card strong {
    display: block;
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.account-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.account-columns {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.account-card-header h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.account-kv {
    display: grid;
    gap: 12px;
}

.account-kv div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.account-kv div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.account-kv dt {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.account-kv dd {
    font-size: 0.86rem;
    font-weight: 600;
    text-align: right;
}

.account-quick-actions {
    display: grid;
    gap: 10px;
}

.account-quick-action {
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.account-quick-action:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--soft-text);
}

.account-form-card {
    min-height: 100%;
}

.account-danger-card {
    border-color: rgba(224, 68, 92, 0.32);
    background: rgba(224, 68, 92, 0.05);
}

.account-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-field-wide {
    grid-column: 1 / -1;
}

.account-submit {
    justify-self: start;
}

.account-danger-submit {
    justify-self: start;
    width: fit-content;
    border: 1px solid rgba(224, 68, 92, 0.38);
    border-radius: 14px;
    padding: 13px 18px;
    background: rgba(224, 68, 92, 0.12);
    color: var(--error);
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
}

.account-danger-submit:hover {
    border-color: var(--error);
    background: rgba(224, 68, 92, 0.18);
}

.account-danger-submit:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.account-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.account-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--bg-main);
    overflow: hidden;
}

.account-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #66FCF1);
    border-radius: inherit;
}

.account-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.account-checklist {
    display: grid;
    gap: 10px;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.account-toggle-list {
    display: grid;
    gap: 12px;
}

.account-toggle {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border);
}

.account-toggle strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.account-toggle span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.account-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.billing-overview {
    display: grid;
    gap: 12px;
}

.billing-pill {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(102, 252, 241, 0.14);
    color: var(--soft-text);
    font-size: 0.8rem;
    font-weight: 700;
}

.billing-overview-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.billing-overview-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.billing-overview-line span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.billing-overview-line strong {
    font-size: 0.86rem;
    text-align: right;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 22px;
        border-radius: 20px;
    }

    .account-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-workspace {
        padding: 18px 14px 110px;
    }

    .account-hero {
        flex-direction: column;
    }

    .account-hero h1 {
        font-size: 1.6rem;
    }

    .account-summary-grid,
    .account-columns,
    .account-form-grid {
        grid-template-columns: 1fr;
    }

    .account-connection-hero {
        grid-template-columns: 1fr;
    }

    .account-connection-item {
        flex-direction: column;
    }

    .account-connection-revoke {
        width: 100%;
    }
}

/* v10.4 — Bouton stop mission (visible seulement quand .topbar-mission-status est .active) */
.mission-stop-btn {
    margin-left: 8px;
    background: rgba(224, 68, 92, 0.12);
    color: var(--error);
    border: 1px solid rgba(224, 68, 92, 0.32);
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.mission-stop-btn:hover {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 68, 92, 0.32);
}

/* v10.4 — Polish SaaS : focus rings, scrollbar, brand button base
   ::selection est désormais gérée dans css/base/_selection.css. */

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
    border-color: var(--accent) !important;
}

/* Scrollbars premium (WebKit) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--brand-teal));
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
    opacity: 0.6;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-hover), var(--brand-teal));
    background-clip: padding-box;
}

/* ════════════════════════════════════════════════════════════════════════════
   v10.4 — RPA panel UX premium (transitions split-screen + intégration)
   Le panel injecté en JS (script.js → setupRpaPanel) hérite de styles
   minimaux. On le renforce ici pour qu'il s'intègre à la charte et que
   l'arrivée/départ soient fluides au lieu d'un display:none/flex brutal.
   ════════════════════════════════════════════════════════════════════════════ */
body.rpa-active .app {
    padding-right: 46vw;
    transition: padding-right 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
@media (max-width: 900px) {
    body.rpa-active .app {
        padding-right: 0 !important;
        padding-bottom: 60vh !important;
    }
}

#rpa-panel {
    /* On override le display:flex/none en gardant le panel toujours dans
       le DOM ; l'animation se fait via transform + opacity pour une
       transition GPU-accelerated propre. */
    display: flex !important;
    transform: translateX(102%);
    opacity: 0;
    visibility: hidden;
    transition:
        transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.30s ease-out,
        visibility 0.42s linear !important;
    background: linear-gradient(180deg, #0E1118 0%, var(--brand-ink, #0B0C10) 100%) !important;
    border-left: 1px solid var(--border, rgba(0, 82, 255, 0.32)) !important;
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55), -2px 0 8px rgba(102, 252, 241, 0.10) !important;
}
#rpa-panel.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}
#rpa-panel header {
    background: rgba(15, 18, 26, 0.92) !important;
    border-bottom: 1px solid rgba(102, 252, 241, 0.10) !important;
    padding: 12px 16px !important;
}
#rpa-panel .rp-status {
    color: var(--brand-fog, #F8F9FA) !important;
    font-weight: 500 !important;
    letter-spacing: 0.2px;
}
#rpa-panel .rp-status::before {
    background: var(--brand-cyan, #66FCF1) !important;
    box-shadow: 0 0 8px var(--brand-cyan, #66FCF1) !important;
}
#rpa-panel.blocked .rp-status::before {
    background: var(--warning, #F2A93B) !important;
    box-shadow: 0 0 8px var(--warning, #F2A93B) !important;
}
#rpa-panel .rp-url {
    color: var(--brand-cyan, #66FCF1) !important;
    background: rgba(102, 252, 241, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(102, 252, 241, 0.14);
}
#rpa-panel button.rp-close {
    width: 28px; height: 28px;
    border-radius: 8px;
    transition: all var(--transition, .18s ease);
}
#rpa-panel button.rp-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--brand-fog, #fff) !important;
    transform: scale(1.05);
}
#rpa-panel .rp-frame-wrap {
    /* Sprint UX — le wrap remplit toute la hauteur restante (cf. flex:1
       1 auto pose dans script.js) ; l'image est centree dedans en
       object-fit:contain. Le fond reprend la teinte du panneau pour
       qu'il n'y ait plus de bande noire visible sous le screencast. */
    background: linear-gradient(180deg,
        rgba(20, 24, 32, 0.96) 0%,
        rgba(28, 32, 42, 0.96) 100%) !important;
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(102, 252, 241, 0.04);
    /* On force flex:1 ici aussi : l'override CSS de style.css ne doit
       pas pouvoir remettre un flex:0 ou un aspect-ratio rigide. */
    flex: 1 1 auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
}
#rpa-panel img.rp-frame {
    transition: opacity 0.3s ease-out;
    border-radius: 4px;
}
#rpa-panel .rp-frame-placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 14px !important;
}
#rpa-panel .rp-action {
    background: rgba(15, 18, 26, 0.92) !important;
    border-top: 1px solid rgba(102, 252, 241, 0.08) !important;
    padding: 10px 16px !important;
    color: rgba(255, 255, 255, 0.70) !important;
}
#rpa-panel .rp-action-text {
    color: var(--brand-fog, #F8F9FA) !important;
}
#rpa-panel .rp-input-hint {
    color: rgba(102, 252, 241, 0.6) !important;
    font-size: 10.5px !important;
}
/* Cacher l'ancien bandeau "blocked" du panel (les actions migrent dans
   une bulle chat dédiée — cf. cara_polish.js). On garde la structure
   pour ne pas casser le code JS qui la référence. */
#rpa-panel .rp-blocked {
    display: none !important;
}

/* v10.4 — Animation reveal pour le bouton Extraction API qui apparaît à la demande */
@keyframes ext-reveal {
    0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
    60%  { opacity: 1; transform: translateY(-2px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
#api-ext-trigger.reveal-anim {
    animation: ext-reveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.4);
    animation-fill-mode: forwards;
}
#api-ext-trigger.reveal-anim::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 24px;
    box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.45);
    animation: ext-pulse 1.6s ease-out 0.4s 2;
    pointer-events: none;
}
@keyframes ext-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.45); }
    100% { box-shadow: 0 0 0 14px rgba(0, 82, 255, 0); }
}

/* Restyle du trigger Extraction API pour coller à la charte */
#api-ext-trigger {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal)) !important;
    border-radius: var(--radius-md) !important;
    padding: 9px 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    box-shadow: var(--shadow-md) !important;
    transition: transform var(--transition), box-shadow var(--transition);
}
#api-ext-trigger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
    background: linear-gradient(135deg, var(--accent-hover), var(--brand-teal)) !important;
}
#api-ext-panel {
    border-radius: var(--radius-md) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}
#api-ext-panel button {
    background: var(--brand-blue) !important;
    border-radius: 8px !important;
}
#api-ext-panel button.secondary {
    background: var(--brand-slate) !important;
}
