/* ==============================================================================
   IA USB Web - Production Interface
   Design Moderne, Souverain, Fluide et Optimisé WebGPU (iausb.com)
   ============================================================================== */

:root {
    --bg-base: #090d16;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-surface-glass: rgba(15, 23, 42, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --border-accent: rgba(79, 124, 255, 0.4);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
    height: 100%;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==============================================================================
   HEADER (Exact Match index_prod.html)
   ============================================================================== */
header {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.brand-link {
    color: #f8fafc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s;
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    user-select: none;
}

.brand-logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
}

.brand-logo-blue {
    color: #2563eb;
}

.brand-badge-web {
    font-size: 0.72rem;
    font-weight: 600;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.badge.ready {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge.loading {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.badge.speeding {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Header Commercial CTA */
.header-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.35);
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(124, 58, 237, 0.6);
    color: #ffffff;
}

.cta-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: pulseGlow 1.5s infinite;
    flex-shrink: 0;
}

.cta-text-full { display: inline; }
.cta-text-short { display: none; }

.header-compliance-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-compliance-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(79, 124, 255, 0.4);
}

.icon-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ==============================================================================
   MAIN CONTAINER (Single Column Centered Layout)
   ============================================================================== */
.main-container {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - 65px);
    height: calc(100dvh - 65px);
}

.chat-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

/* Progress bar */
.progress-container {
    background: rgba(15, 23, 42, 0.95);
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-track {
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.15s ease;
}

/* Chat Log */
.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: auto;
    contain: content;
    will-change: scroll-position;
}

.msg {
    max-width: 88%;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    word-break: break-word;
}

.msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.msg.assistant {
    align-self: flex-start;
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
}

.msg.system {
    align-self: center;
    max-width: 95%;
    font-size: 13px;
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    text-align: center;
}

/* Live Token Metrics Badge inside message */
.msg-metrics {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: #93c5fd;
}

/* Markdown Styling inside Assistant Msg */
.msg.assistant p {
    margin-bottom: 10px;
}
.msg.assistant p:last-child {
    margin-bottom: 0;
}

.msg.assistant table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
    border: 1px solid var(--border-subtle);
}

.msg.assistant th,
.msg.assistant td {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.msg.assistant th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

.msg.assistant code {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.msg.assistant pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.msg.assistant pre code {
    background: none;
    padding: 0;
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.cursor {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ==============================================================================
   PROMPT CHIPS BAR (Dynamically tailored based on profile)
   ============================================================================== */
.chips-bar {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.7);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.prompt-chip {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.prompt-chip:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 14px 18px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-textarea {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.chat-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-send {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
    box-shadow: 0 0 14px var(--primary-glow);
}

.btn-send:hover:not(:disabled) {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Footer Disclaimer */
.chat-disclaimer {
    padding: 6px 18px 10px 18px;
    background: var(--bg-surface);
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    line-height: 1.4;
    user-select: none;
    letter-spacing: 0.2px;
}

/* ==============================================================================
   ONBOARDING / SPLASH SCREEN OVERLAY (Adapted from index_prod.html)
   ============================================================================== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 14, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.active {
    display: flex;
    opacity: 1;
}

.onboarding-container {
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    max-height: 90dvh;
    background: linear-gradient(165deg, rgba(25, 27, 36, 0.96), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: cardZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardZoomIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.onboarding-top-bar {
    padding: 14px 20px;
    background: rgba(18, 19, 26, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.onboarding-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(79, 124, 255, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(79, 124, 255, 0.3);
    font-weight: 600;
}

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

.btn-switch-profile {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #93c5fd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-switch-profile:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.skip-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.skip-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.cards-deck {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Routing Screen */
.routing-screen {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.routing-screen.active {
    display: flex;
}

.routing-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    width: fit-content;
}

.card-badge.blue {
    background: rgba(79, 124, 255, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(79, 124, 255, 0.3);
}

.card-badge.green {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.routing-title, .card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
}

.routing-subtitle, .card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.routing-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 6px;
}

.routing-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.routing-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.routing-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #93c5fd;
}

.routing-card-badge.enterprise {
    color: #4ade80;
}

.routing-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.routing-card-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.routing-card-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.highlight-chip {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.routing-card-action {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #93c5fd;
    font-size: 0.82rem;
    font-weight: 600;
}

.routing-card-action.enterprise {
    color: #4ade80;
}

/* Profile Decks & Single Presentation Card */
.profile-deck {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flash-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 4px;
}

/* High Conversion Value Banners */
.conversion-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    margin: 2px 0 4px 0;
}

.conversion-banner.individual-banner {
    background: linear-gradient(90deg, rgba(79, 124, 255, 0.14) 0%, rgba(147, 197, 253, 0.06) 100%);
    border-color: rgba(79, 124, 255, 0.35);
}

.conversion-banner.enterprise-banner {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.14) 0%, rgba(74, 222, 128, 0.06) 100%);
    border-color: rgba(34, 197, 94, 0.35);
}

.banner-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: #4f7cff;
    color: #ffffff;
    flex-shrink: 0;
}

.banner-pill.enterprise {
    background: #16a34a;
}

.banner-text {
    font-size: 0.86rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.feature-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.feature-span-2 {
    grid-column: span 2;
}

.lang-flags {
    display: inline-block;
    letter-spacing: 3px;
    font-size: 0.92rem;
    margin: 0 4px;
}

.feature-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.feature-item h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
}

.feature-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.config-note-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.config-note-box.upsell-box {
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.12) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(79, 124, 255, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.config-note-box.upsell-box.enterprise {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.config-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Onboarding Bottom Bar */
.onboarding-bottom-bar {
    padding: 14px 20px;
    background: rgba(18, 19, 26, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-loading-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.card-loading-status.ready {
    color: #4ade80;
}

.mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.card-loading-status.ready .mini-spinner {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-card-nav {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-card-nav.start-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.btn-card-nav.start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* ==============================================================================
   MODALS (Compliance / RSSI & Offline Guide)
   ============================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 14, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 680px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cardZoomIn 0.2s ease-out;
}

.modal-header {
    padding: 16px 20px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-with-badge h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 4px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.modal-close-btn:hover {
    color: #ffffff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 70vh;
}

.compliance-intro {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.compliance-docs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-download-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
}

.doc-download-card:hover {
    border-color: var(--primary);
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.05);
}

.doc-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.doc-info h4 {
    font-size: 0.86rem;
    font-weight: 600;
    color: #ffffff;
}

.doc-info p {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-tag {
    margin-left: auto;
    font-size: 0.74rem;
    color: #93c5fd;
    font-weight: 600;
    white-space: nowrap;
}

.modal-footer {
    padding: 12px 20px;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.offline-hero-box {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    margin-bottom: 16px;
}

.offline-hero-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.offline-hero-box h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.offline-hero-box p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.offline-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offline-step-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.offline-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.offline-step-content strong {
    font-size: 0.86rem;
    color: #ffffff;
    display: block;
}

.offline-step-content p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==============================================================================
   RESPONSIVE QUERIES
   ============================================================================== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .cta-text-full { display: none; }
    .cta-text-short { display: inline; }
    
    .main-container {
        padding: 10px;
        height: calc(100vh - 110px);
        height: calc(100dvh - 110px);
    }
    
    .routing-cards-grid, .card-grid {
        grid-template-columns: 1fr;
    }

    .feature-span-2 {
        grid-column: span 1;
    }

    .conversion-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .chat-disclaimer {
        padding: 4px 12px 8px 12px;
        font-size: 0.66rem;
    }
    
    .msg {
        max-width: 95%;
    }
}
