/* =========================================================
   IPHONE FRAME & MOBILE APP SIMULATION
   Hyper-realistic Apple iPhone device with Dynamic Island
========================================================= */

.iphone-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    min-height: 0;
    position: relative;
    padding: 20px;
    overflow: visible;
}

/* Châssis Titanium de l'iPhone */
.iphone-frame {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    /* Default height to max out the container */
    aspect-ratio: 9 / 19.5;
    margin: auto;
    /* To keep it centered vertically and horizontally */
    background: #000000;
    border-radius: 54px;
    border: 12px solid #18181b;
    box-shadow:
        inset 0 0 2px 2px rgba(255, 255, 255, 0.05),
        0 0 0 2px #3f3f46,
        0 0 0 4px #27272a,
        0 30px 60px -12px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: column;
    /* overflow: hidden; Removed so buttons can show outside */
    user-select: none;
}

.iphone-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 42px;
    background: #000000;
    position: relative;
    min-height: 0;
}

/* Boutons physiques sur les tranches de l'iPhone */
.iphone-frame::before {
    /* Bouton d'alimentation (côté droit) */
    content: '';
    position: absolute;
    right: -14px;
    top: 110px;
    width: 3px;
    height: 54px;
    background: #475569;
    border-radius: 0 3px 3px 0;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.5);
}

.iphone-buttons-left {
    position: absolute;
    left: -14px;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 5;
}

.iphone-btn-silent {
    width: 3px;
    height: 24px;
    background: #475569;
    border-radius: 3px 0 0 3px;
}

.iphone-btn-volume {
    width: 3px;
    height: 44px;
    background: #475569;
    border-radius: 3px 0 0 3px;
}

/* Dynamic Island & Caméra TrueDepth */
.iphone-island {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background: #000000;
    border-radius: 20px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.1);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.iphone-camera-lens {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0c1220;
    border: 1px solid #1e293b;
    position: relative;
}

.iphone-camera-lens::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 3px;
    height: 3px;
    background: rgba(56, 189, 248, 0.6);
    border-radius: 50%;
}

/* Barre de statut iOS */
.iphone-status-bar {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px 0 28px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    z-index: 20;
    background: transparent;
}

.iphone-status-time {
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-left: 4px;
}

.iphone-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    margin-right: 4px;
}

/* En-tête de l'application NAB Mobile */
.iphone-app-header {
    background: linear-gradient(180deg, #111827 0%, rgba(17, 24, 39, 0.85) 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.iphone-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.iphone-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.iphone-user-info h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.iphone-user-info span {
    font-size: 0.65rem;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.iphone-header-btn {
    background: transparent;
    border: none;
    color: #38bdf8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    outline: none;
}

.iphone-header-btn:hover {
    background: rgba(56, 189, 248, 0.1);
}

#mobileLogoutBtn {
    color: #94a3b8;
}

#mobileLogoutBtn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

.status-dot-pulse {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #10b981;
}

.iphone-balance-pill {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 4px 8px;
    text-align: right;
}

.iphone-balance-label {
    font-size: 0.58rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.iphone-balance-val {
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
}

/* Application principale NAB Mobile */
#mobile-app-main {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
}

.iphone-app-header {
    flex-shrink: 0 !important;
}

/* Zone de discussion */
.chat-container {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 20px !important;
    padding: 14px 12px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #090d16;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    user-select: text !important;
}

.chat-container::-webkit-scrollbar {
    width: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 4px;
}

/* Bulles de conversation */
.chat-message {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 86%;
    font-size: 0.8rem;
    line-height: 1.42;
    word-break: break-word;
    animation: slideUpMsg 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpMsg {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-user {
    background: #007aff;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.msg-bot {
    background: #262628;
    color: #ffffff;
    border: none;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.msg-bot strong {
    color: #38bdf8;
    font-weight: 600;
}

/* Options dynamiques */
.dynamic-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.dynamic-btn {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dynamic-btn::after {
    content: '➔';
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.dynamic-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.dynamic-btn:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

/* Indicateur de saisie en cours (typing dots) */
.typing-bubble {
    align-self: flex-start;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 8px 12px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite both;
}

.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.1);
        opacity: 1;
    }
}

/* Zone de saisie iPhone */
.chat-input-container {
    flex-shrink: 0 !important;
    display: flex;
    padding: 10px 14px;
    background: #111827;
    border-top: 1px solid #1e293b;
    gap: 8px;
    align-items: center;
    position: relative !important;
    z-index: 15 !important;
}

.chat-input-container input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #334155;
    border-radius: 20px;
    font-size: 0.78rem;
    outline: none;
    background: #090d16;
    color: #ffffff;
    transition: all 0.2s ease;
}

.chat-input-container input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.chat-input-container button {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input-container button:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

/* Barre Home Indicator iOS en bas */
.iphone-home-bar {
    width: 130px;
    height: 5px;
    background: #ffffff;
    border-radius: 10px;
    margin: 8px auto 8px auto;
    opacity: 0.8;
}

/* Page de connexion mobile */
.mobile-login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #090d16;
    color: #ffffff;
    text-align: center;
}

.mobile-login-logo img {
    height: 48px;
    margin-bottom: 24px;
}

.mobile-login-container h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.mobile-login-container p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 32px 0;
}

.mobile-login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
}

.mobile-input {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.mobile-input:focus {
    border-color: #38bdf8;
}

.mobile-btn-primary {
    background: #38bdf8;
    color: #0c1220;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.mobile-btn-primary:hover {
    background: #0ea5e9;
}

/* Mobile Settings Modal Refined Sizing */
#mobile-settings-modal {
    padding: 20px 18px !important;
}

#mobile-settings-modal h2 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
}

#mobile-settings-modal #closeSettingsBtn {
    font-size: 1.15rem !important;
    color: #94a3b8 !important;
}

#mobile-settings-modal #closeSettingsBtn:hover {
    color: #ffffff !important;
}

#mobile-settings-modal label {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #64748b !important;
}

#mobile-settings-modal #apiKeyStatus {
    font-size: 0.65rem !important;
    text-transform: none !important;
    font-weight: normal !important;
}

#mobile-settings-modal #userApiKey {
    font-size: 0.75rem !important;
    padding: 7px 36px 7px 10px !important;
    height: 36px !important;
    border-radius: 8px !important;
    letter-spacing: 1px !important;
}

#mobile-settings-modal #userDefaultModel {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
    height: 36px !important;
    border-radius: 8px !important;
    line-height: 1.2 !important;
}

#mobile-settings-modal #saveSettingsBtn {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 9px 14px !important;
    margin-top: 6px !important;
    border-radius: 8px !important;
    letter-spacing: 0.2px !important;
}

#mobile-settings-modal #settingsMessage {
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
    text-align: center !important;
}


/* Réglage : traduction en libyen */
.settings-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #1e293b;
    background: #0f1523;
    cursor: pointer;
}

.settings-switch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.settings-switch-title {
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 600;
}

.settings-switch-hint {
    color: #64748b;
    font-size: 0.64rem;
    line-height: 1.3;
}

.settings-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    border-radius: 9999px;
    background: #334155;
    transition: background 0.2s;
}

.settings-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f8fafc;
    transition: transform 0.2s;
}

.settings-switch-input:checked+.settings-switch {
    background: #10b981;
}

.settings-switch-input:checked+.settings-switch::after {
    transform: translateX(16px);
}

.settings-switch-input:focus-visible+.settings-switch {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Indicateur de traduction : 3 points animés */
.msg-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.msg-typing span {
    width: 6px;
    font-size: 0;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    animation: typingDot 1.2s ease-in-out infinite;
}

.msg-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.msg-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingFade {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Message traduit : texte original affiché au survol */
.msg-translated {
    position: relative;
    cursor: help;
}

.msg-translated::after {
    content: "🌐 " attr(data-original);
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 5;
    width: max-content;
    max-width: 240px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 0.7rem;
    line-height: 1.35;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}

.msg-translated:hover::after,
.msg-translated:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .msg-typing span {
        animation: typingFade 1.2s ease-in-out infinite;
    }

    .msg-typing span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .msg-typing span:nth-child(3) {
        animation-delay: 0.4s;
    }
}

/* Notice système (ex. échec de traduction) */
.chat-notice {
    align-self: center;
    max-width: 92%;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 0.68rem;
    line-height: 1.35;
    text-align: center;
}

/* Informations personnelles détectées dans le chat */
.chat-message mark.pii {
    color: #ffffff;
    background: #dc2626;
    border-radius: 4px;
    padding: 0 3px;
    cursor: help;
}

/* Options déjà utilisées (choix de bénéficiaire, confirmation) */
.dynamic-btn:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.dynamic-btn.selected:disabled {
    opacity: 1;
    border-color: #10b981;
    color: #34d399;
}

/* Listes dans les messages du bot */
.chat-message .msg-list {
    margin: 4px 0 2px;
    padding-inline-start: 20px;
}

.chat-message .msg-list li {
    margin: 2px 0;
}

.chat-message .msg-list li::marker {
    color: #38bdf8;
    font-weight: 700;
}

.chat-message .msg-line+.msg-line {
    margin-top: 2px;
}

/* =========================================================
   SECURE BLOCK : données bancaires, bank <-> app uniquement
========================================================= */
.secure-block {
    --sb-accent: #94a3b8;
    --sb-soft: rgba(148, 163, 184, 0.12);
    --sb-line: rgba(148, 163, 184, 0.14);
    align-self: stretch;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    margin: 2px 0;
    border-radius: 16px;
    border: 1px solid var(--sb-line);
    border-inline-start: 3px solid var(--sb-accent);
    background: linear-gradient(180deg, var(--sb-soft) 0%, rgba(13, 20, 34, 0) 70px), #0d1422;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-size: 0.76rem;
    color: #e2e8f0;
    animation: slideUpMsg 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.secure-block.tone-emerald {
    --sb-accent: #10b981;
    --sb-soft: rgba(16, 185, 129, 0.14);
}

.secure-block.tone-blue {
    --sb-accent: #38bdf8;
    --sb-soft: rgba(56, 189, 248, 0.14);
}

.secure-block.tone-amber {
    --sb-accent: #f59e0b;
    --sb-soft: rgba(245, 158, 11, 0.14);
}

.secure-block.tone-purple {
    --sb-accent: #c084fc;
    --sb-soft: rgba(192, 132, 252, 0.14);
}

.secure-block.tone-red {
    --sb-accent: #ef4444;
    --sb-soft: rgba(239, 68, 68, 0.14);
}

.sb-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sb-svg.xs {
    width: 12px;
    height: 12px;
}

.sb-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* En-tête */
.sb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 10px;
}

.sb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--sb-accent);
    background: var(--sb-soft);
    flex-shrink: 0;
}

.sb-title {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: #f8fafc;
}

.sb-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sb-accent);
    border: 1px solid var(--sb-accent);
    flex-shrink: 0;
}

.sb-intro {
    padding: 0 12px 8px;
    color: #cbd5e1;
    font-size: 0.74rem;
}

/* Valeurs */
.sb-rows {
    padding: 0 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-hero {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--sb-soft);
}

.sb-hero-label {
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.sb-hero-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    text-align: start;
    line-height: 1.15;
}

.sb-kv {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sb-line);
    border-radius: 10px;
    overflow: hidden;
}

.sb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
}

.sb-row+.sb-row {
    border-top: 1px solid var(--sb-line);
}

.sb-row-label {
    color: #94a3b8;
    font-size: 0.7rem;
}

.sb-row-value {
    font-weight: 700;
    text-align: end;
    color: #f1f5f9;
}

/* Liste */
.sb-items {
    display: flex;
    flex-direction: column;
    padding: 0 12px 4px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
}

.sb-item+.sb-item {
    border-top: 1px solid var(--sb-line);
}

.sb-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    flex-shrink: 0;
}

.sb-item-icon.tone-negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.sb-item-icon.tone-positive {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.sb-item-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.sb-item-primary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.sb-item-secondary {
    color: #64748b;
    font-size: 0.64rem;
}

.sb-item-value {
    font-weight: 700;
    white-space: nowrap;
}

.sb-item-value.tone-negative {
    color: #f87171;
}

.sb-item-value.tone-positive {
    color: #34d399;
}

.sb-summary {
    display: flex;
    justify-content: space-between;
    margin: 2px 12px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--sb-soft);
    font-weight: 800;
}

.sb-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 12px 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed var(--sb-line);
    color: #94a3b8;
}

/* Fichier */
.sb-file {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--sb-line);
    background: rgba(15, 23, 42, 0.6);
}

.sb-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--sb-accent);
    background: var(--sb-soft);
    flex-shrink: 0;
}

.sb-file-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.sb-file-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sb-file-meta {
    color: #94a3b8;
    font-size: 0.66rem;
}

.sb-file-dl {
    color: var(--sb-accent);
    display: inline-flex;
}

/* Choix */
.sb-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px 10px;
}

.sb-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--sb-line);
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sb-choice:hover:not(:disabled) {
    border-color: var(--sb-accent);
    background: var(--sb-soft);
}

.sb-choice.highlight {
    border-color: var(--sb-accent);
    background: var(--sb-soft);
}

.sb-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.66rem;
    font-weight: 800;
    color: #0b1120;
    background: var(--sb-accent);
    flex-shrink: 0;
}

.sb-choice:not(.highlight) .sb-avatar {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.18);
}

.sb-avatar.icon .sb-svg {
    width: 15px;
    height: 15px;
}

.sb-choice-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.sb-choice-label {
    font-weight: 700;
}

.sb-choice-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    color: var(--sb-accent);
}

.sb-chevron {
    color: #64748b;
    width: 14px;
    height: 14px;
}

[dir="rtl"] .sb-chevron {
    transform: scaleX(-1);
}

.sb-choice.tone-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.sb-choice.tone-danger .sb-avatar {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

/* Actions */
.sb-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.sb-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid var(--sb-line);
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}

.sb-action .sb-svg {
    width: 15px;
    height: 15px;
}

.sb-action.tone-primary {
    background: var(--sb-accent);
    border-color: var(--sb-accent);
    color: #0b1120;
}

.sb-action.tone-primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.sb-action.tone-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.sb-action.tone-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.secure-block.answered button:disabled {
    opacity: 0.35;
    cursor: default;
}

.secure-block.answered button.selected {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--sb-accent);
}

/* Pied */
.sb-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 7px 12px;
    font-size: 0.6rem;
    color: #94a3b8;
    border-top: 1px solid var(--sb-line);
    background: rgba(2, 6, 23, 0.35);
}

.sb-foot .sb-svg {
    color: var(--sb-accent);
}

.secure-block.preview button {
    cursor: default;
}

/* Aucun élément du chat ne doit être écrasé quand la conversation dépasse la hauteur */
#mobile-chat>* {
    flex-shrink: 0;
}

/* =========================================================
   SECURE BLOCK : version compacte (écran du téléphone)
========================================================= */
.secure-block {
    border-radius: 14px;
    font-size: 0.72rem;
}

.sb-head {
    gap: 8px;
    padding: 8px 10px 6px;
}

.sb-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
}

.sb-icon .sb-svg {
    width: 15px;
    height: 15px;
}

.sb-title {
    font-size: 0.78rem;
    line-height: 1.2;
}

.sb-lock {
    padding: 1px 6px;
    font-size: 0.56rem;
    gap: 3px;
}

.sb-lock .sb-svg {
    width: 10px;
    height: 10px;
}

.sb-intro {
    padding: 0 10px 6px;
    font-size: 0.7rem;
}

.sb-rows {
    padding: 0 10px 6px;
    gap: 6px;
}

.sb-hero {
    padding: 7px 10px;
    border-radius: 10px;
}

.sb-hero-label {
    font-size: 0.58rem;
}

.sb-hero-value {
    font-size: 1.05rem;
}

.sb-row {
    padding: 5px 8px;
}

.sb-row-label {
    font-size: 0.66rem;
}

.sb-items {
    padding: 0 10px 2px;
}

.sb-item {
    gap: 7px;
    padding: 5px 0;
}

.sb-item-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

.sb-summary {
    margin: 2px 10px 8px;
    padding: 6px 8px;
}

.sb-empty {
    margin: 0 10px 8px;
    padding: 7px 8px;
}

.sb-file {
    gap: 8px;
    margin: 0 10px 8px;
    padding: 7px 8px;
    border-radius: 10px;
}

.sb-file-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.sb-file-icon .sb-svg {
    width: 15px;
    height: 15px;
}

/* Choix : une seule liste groupée, séparée par des filets */
.sb-choices {
    gap: 0;
    margin: 0 10px 8px;
    padding: 0;
    border: 1px solid var(--sb-line);
    border-radius: 10px;
    overflow: hidden;
}

.sb-choice {
    gap: 8px;
    padding: 6px 8px;
    border: none;
    border-radius: 0;
    background: transparent;
}

.sb-choice+.sb-choice {
    border-top: 1px solid var(--sb-line);
}

.sb-choice.highlight {
    border-color: var(--sb-line);
}

.sb-choice.tone-danger {
    border-color: var(--sb-line);
    background: rgba(239, 68, 68, 0.06);
}

.sb-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.58rem;
}

.sb-avatar.icon .sb-svg {
    width: 12px;
    height: 12px;
}

.sb-choice-label {
    font-size: 0.72rem;
}

.sb-choice-hint {
    font-size: 0.58rem;
}

.sb-chevron {
    width: 12px;
    height: 12px;
}

.secure-block.answered button.selected {
    box-shadow: inset 0 0 0 2px var(--sb-accent);
}

.sb-actions {
    gap: 6px;
    padding: 0 10px 8px;
}

.sb-action {
    padding: 7px 8px;
    border-radius: 10px;
}

.sb-action .sb-svg {
    width: 13px;
    height: 13px;
}

.sb-foot {
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.56rem;
}

.sb-foot span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pied : texte complet sur plusieurs lignes · bordure uniforme (sans accent latéral) */
.sb-foot {
    align-items: flex-start;
    line-height: 1.35;
}

.sb-foot .sb-svg {
    margin-top: 1px;
}

.sb-foot span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.secure-block {
    border: 1px solid color-mix(in srgb, var(--sb-accent) 35%, transparent);
}

/* Saisie de code (OTP) dans un secure block */
.sb-input {
    display: flex;
    gap: 6px;
    padding: 0 10px 8px;
}

.sb-input-field {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--sb-line);
    background: rgba(2, 6, 23, 0.6);
    color: #f8fafc;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-align: center;
    outline: none;
}

.sb-input-field::placeholder {
    letter-spacing: 0.02em;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
}

.sb-input-field:focus {
    border-color: var(--sb-accent);
    box-shadow: 0 0 0 2px var(--sb-soft);
}

.sb-input-field.invalid {
    border-color: #ef4444;
}

.sb-input-submit {
    flex: 0 0 auto;
}

/* =========================================================
   THÈME CLAIR PREMIUM (écran de l'iPhone)
   Palette : surfaces neutres, un accent navy, ombres douces
========================================================= */
.iphone-screen {
    --ph-bg: #f3f5f9;
    --ph-surface: #ffffff;
    --ph-line: #e5e9f0;
    --ph-line-strong: #d6dce6;
    --ph-text: #0f1b2d;
    --ph-text-2: #5b6778;
    --ph-text-3: #8a95a5;
    --ph-accent: #0b2e5c;
    --ph-accent-2: #1d5bd8;
    --ph-shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
    --ph-shadow-md: 0 6px 20px -6px rgba(15, 27, 45, 0.14), 0 2px 6px rgba(15, 27, 45, 0.05);
    background: var(--ph-bg);
    color: var(--ph-text);
}

/* En-tête de l'app */
.iphone-screen .iphone-app-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--ph-line);
    padding: 12px 16px 10px;
}

.iphone-screen .iphone-user-info h3 {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ph-accent);
}

.iphone-screen .iphone-user-info span {
    color: var(--ph-text-3);
    font-size: 0.62rem;
}

.iphone-screen .status-dot-pulse {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.iphone-screen .iphone-header-btn {
    width: 32px;
    height: 32px;
    color: var(--ph-accent);
    background: #f1f4f9;
    border-radius: 10px;
}

.iphone-screen .iphone-header-btn:hover {
    background: #e6ebf3;
}

.iphone-screen #mobileLogoutBtn {
    color: var(--ph-text-2);
}

.iphone-screen #mobileLogoutBtn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Zone de conversation */
.iphone-screen .chat-container {
    background: var(--ph-bg);
    gap: 18px;
    padding: 16px 12px;
    scrollbar-color: #cfd6e0 transparent;
}

.iphone-screen .chat-container::-webkit-scrollbar-thumb {
    background-color: #cfd6e0;
}

.iphone-screen .chat-message {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 20px;
}

.iphone-screen .msg-user {
    background: linear-gradient(160deg, #13407f 0%, var(--ph-accent) 100%);
    color: #ffffff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px -4px rgba(11, 46, 92, 0.45);
}

.iphone-screen .msg-bot {
    background: var(--ph-surface);
    color: var(--ph-text);
    border: 1px solid var(--ph-line);
    border-bottom-left-radius: 6px;
    box-shadow: var(--ph-shadow-sm);
}

.iphone-screen .msg-bot strong {
    color: var(--ph-accent);
    font-weight: 700;
}

.iphone-screen .chat-message .msg-list li::marker {
    color: var(--ph-accent-2);
}

.iphone-screen .chat-notice {
    background: #fff8eb;
    border-color: #f6d9a3;
    color: #8a5a00;
}

.iphone-screen .dynamic-btn {
    background: var(--ph-surface);
    color: var(--ph-accent);
    border: 1px solid var(--ph-line-strong);
    box-shadow: var(--ph-shadow-sm);
}

.iphone-screen .dynamic-btn:hover {
    background: #f5f8fd;
    border-color: var(--ph-accent-2);
    box-shadow: var(--ph-shadow-md);
}

/* Saisie */
.iphone-screen .chat-input-container {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--ph-line);
    padding: 10px 12px 12px;
}

.iphone-screen .chat-input-container input {
    background: #f3f5f9;
    border: 1px solid transparent;
    color: var(--ph-text);
    border-radius: 22px;
    padding: 10px 16px;
}

.iphone-screen .chat-input-container input::placeholder {
    color: var(--ph-text-3);
}

.iphone-screen .chat-input-container input:focus {
    background: #ffffff;
    border-color: var(--ph-accent-2);
    box-shadow: 0 0 0 3px rgba(29, 91, 216, 0.12);
}

.iphone-screen .chat-input-container button {
    width: 38px;
    height: 38px;
    background: var(--ph-accent);
    box-shadow: 0 4px 10px -3px rgba(11, 46, 92, 0.5);
}

.iphone-screen .chat-input-container button:hover {
    filter: none;
    background: #13407f;
    transform: scale(1.04);
}

/* Connexion & réglages */
.iphone-screen .mobile-login-container {
    background: var(--ph-bg);
    color: var(--ph-text);
}

.iphone-screen .mobile-login-container p {
    color: var(--ph-text-2);
}

.iphone-screen .mobile-input {
    background: var(--ph-surface);
    border: 1px solid var(--ph-line-strong);
    color: var(--ph-text);
    border-radius: 12px;
}

.iphone-screen .mobile-input:focus {
    border-color: var(--ph-accent-2);
    box-shadow: 0 0 0 3px rgba(29, 91, 216, 0.12);
}

.iphone-screen .mobile-btn-primary {
    background: var(--ph-accent);
    color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 14px -6px rgba(11, 46, 92, 0.55);
}

.iphone-screen .mobile-btn-primary:hover {
    background: #13407f;
}

.iphone-screen #mobile-settings-modal {
    background: var(--ph-bg) !important;
}

.iphone-screen #mobile-settings-modal h2 {
    color: var(--ph-text) !important;
}

.iphone-screen #mobile-settings-modal #closeSettingsBtn {
    color: var(--ph-text-2) !important;
}

.iphone-screen #mobile-settings-modal #closeSettingsBtn:hover {
    color: var(--ph-text) !important;
}

.iphone-screen #mobile-settings-modal label {
    color: var(--ph-text-2) !important;
}

.iphone-screen #mobile-settings-modal #settingsMessage {
    color: #059669 !important;
}

.iphone-screen .settings-switch-row {
    background: var(--ph-surface);
    border-color: var(--ph-line);
    box-shadow: var(--ph-shadow-sm);
}

.iphone-screen .settings-switch-title {
    color: var(--ph-text);
}

.iphone-screen .settings-switch-hint {
    color: var(--ph-text-3);
}

.iphone-screen .settings-switch {
    background: #d6dce6;
}

.iphone-screen .settings-switch::after {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 27, 45, 0.25);
}

.iphone-screen .settings-switch-input:checked+.settings-switch {
    background: var(--ph-accent);
}

/* =========================================================
   SECURE BLOCK — version claire (iPhone + aperçus Components)
========================================================= */
.iphone-screen .secure-block,
.component-preview .secure-block {
    --sb-line: #e8ecf2;
    background: #ffffff;
    border: 1px solid #e3e8ef;
    color: #0f1b2d;
    box-shadow: 0 10px 28px -12px rgba(15, 27, 45, 0.18), 0 2px 6px rgba(15, 27, 45, 0.04);
    border-radius: 18px;
}

.iphone-screen .secure-block.tone-emerald,
.component-preview .secure-block.tone-emerald {
    --sb-accent: #047857;
    --sb-soft: #ecfdf5;
}

.iphone-screen .secure-block.tone-blue,
.component-preview .secure-block.tone-blue {
    --sb-accent: #1d5bd8;
    --sb-soft: #eff5ff;
}

.iphone-screen .secure-block.tone-amber,
.component-preview .secure-block.tone-amber {
    --sb-accent: #b45309;
    --sb-soft: #fff7eb;
}

.iphone-screen .secure-block.tone-purple,
.component-preview .secure-block.tone-purple {
    --sb-accent: #6d28d9;
    --sb-soft: #f5f1ff;
}

.iphone-screen .secure-block.tone-red,
.component-preview .secure-block.tone-red {
    --sb-accent: #b91c1c;
    --sb-soft: #fef2f2;
}

.iphone-screen .secure-block.tone-neutral,
.component-preview .secure-block.tone-neutral {
    --sb-accent: #475569;
    --sb-soft: #f1f4f8;
}

:is(.iphone-screen, .component-preview) .sb-head {
    padding: 12px 12px 8px;
}

:is(.iphone-screen, .component-preview) .sb-icon {
    background: var(--sb-soft);
    color: var(--sb-accent);
    border-radius: 10px;
}

:is(.iphone-screen, .component-preview) .sb-title {
    color: #0f1b2d;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

:is(.iphone-screen, .component-preview) .sb-intro {
    color: #5b6778;
}

:is(.iphone-screen, .component-preview) .sb-hero {
    background: linear-gradient(135deg, var(--sb-soft) 0%, #ffffff 100%);
    border: 1px solid color-mix(in srgb, var(--sb-accent) 14%, #ffffff);
}

:is(.iphone-screen, .component-preview) .sb-hero-label {
    color: #5b6778;
}

:is(.iphone-screen, .component-preview) .sb-hero-value {
    color: #0f1b2d;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

:is(.iphone-screen, .component-preview) .sb-kv {
    border-color: var(--sb-line);
    background: #fbfcfe;
}

:is(.iphone-screen, .component-preview) .sb-row-label {
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .sb-row-value {
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-item-primary {
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-item-secondary {
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .sb-item-icon {
    background: #f1f4f8;
    color: #5b6778;
}

:is(.iphone-screen, .component-preview) .sb-item-icon.tone-negative {
    background: #fef2f2;
    color: #b91c1c;
}

:is(.iphone-screen, .component-preview) .sb-item-icon.tone-positive {
    background: #ecfdf5;
    color: #047857;
}

:is(.iphone-screen, .component-preview) .sb-item-value {
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-item-value.tone-negative {
    color: #b91c1c;
}

:is(.iphone-screen, .component-preview) .sb-item-value.tone-positive {
    color: #047857;
}

:is(.iphone-screen, .component-preview) .sb-summary {
    background: var(--sb-soft);
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-empty {
    color: #8a95a5;
    border-color: var(--sb-line);
}

:is(.iphone-screen, .component-preview) .sb-file {
    background: #fbfcfe;
    border-color: var(--sb-line);
}

:is(.iphone-screen, .component-preview) .sb-file-name {
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-file-meta {
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .sb-choices {
    border-color: var(--sb-line);
    background: #ffffff;
}

:is(.iphone-screen, .component-preview) .sb-choice {
    color: #0f1b2d;
    background: #ffffff;
}

:is(.iphone-screen, .component-preview) .sb-choice:hover:not(:disabled) {
    background: #f7f9fc;
}

:is(.iphone-screen, .component-preview) .sb-choice.highlight {
    background: var(--sb-soft);
}

:is(.iphone-screen, .component-preview) .sb-choice:not(.highlight) .sb-avatar {
    background: #eef2f7;
    color: #334155;
}

:is(.iphone-screen, .component-preview) .sb-avatar {
    color: #ffffff;
}

:is(.iphone-screen, .component-preview) .sb-chevron {
    color: #b3bcc9;
}

:is(.iphone-screen, .component-preview) .sb-choice.tone-danger {
    color: #b91c1c;
    background: #fffafa;
}

:is(.iphone-screen, .component-preview) .sb-choice.tone-danger .sb-avatar {
    background: #fee2e2;
    color: #b91c1c;
}

:is(.iphone-screen, .component-preview) .sb-action {
    border-color: #d6dce6;
    color: #0f1b2d;
    border-radius: 12px;
}

:is(.iphone-screen, .component-preview) .sb-action.tone-primary {
    background: #0b2e5c;
    border-color: #0b2e5c;
    color: #ffffff;
    box-shadow: 0 6px 14px -6px rgba(11, 46, 92, 0.55);
}

:is(.iphone-screen, .component-preview) .sb-action.tone-danger {
    color: #b91c1c;
    border-color: #f3c7c7;
    background: #ffffff;
}

:is(.iphone-screen, .component-preview) .sb-action.tone-danger:hover:not(:disabled) {
    background: #fef2f2;
}

:is(.iphone-screen, .component-preview) .sb-input-field {
    background: #f3f5f9;
    border: 1px solid transparent;
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-input-field:focus {
    background: #ffffff;
    border-color: #1d5bd8;
    box-shadow: 0 0 0 3px rgba(29, 91, 216, 0.12);
}

:is(.iphone-screen, .component-preview) .sb-input-field::placeholder {
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .secure-block.answered button:disabled {
    opacity: 0.4;
}

:is(.iphone-screen, .component-preview) .secure-block.answered button.selected {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--sb-accent);
}

:is(.iphone-screen, .component-preview) .sb-foot {
    background: #f8fafc;
    border-top: 1px solid var(--sb-line);
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .sb-foot .sb-svg {
    color: var(--sb-accent);
}

/* =========================================================
   iPhone clair : version compacte + lisibilité (contrastes ≥ 4.5:1)
========================================================= */
.iphone-screen {
    --ph-text-2: #4a5566;
    --ph-text-3: #5f6b7c;
}

.iphone-screen .iphone-app-header {
    padding: 8px 12px 7px;
}

.iphone-screen .iphone-user-info h3 {
    font-size: 0.82rem;
}

.iphone-screen .iphone-user-info span {
    font-size: 0.6rem;
    color: var(--ph-text-3);
}

.iphone-screen .iphone-header-actions {
    gap: 6px !important;
}

.iphone-screen .iphone-header-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 9px;
}

.iphone-screen .iphone-header-btn svg {
    width: 15px;
    height: 15px;
}

.iphone-screen .chat-container {
    gap: 16px;
    padding: 10px 10px 12px;
}

.iphone-screen .chat-message {
    font-size: 0.76rem;
    line-height: 1.45;
    padding: 8px 12px;
    border-radius: 16px;
}

.iphone-screen .msg-user {
    border-bottom-right-radius: 5px;
}

.iphone-screen .msg-bot {
    border-bottom-left-radius: 5px;
    color: #0f1b2d;
}

.iphone-screen .chat-message .msg-list {
    margin: 2px 0 0;
    padding-inline-start: 18px;
}

.iphone-screen .chat-message .msg-list li {
    margin: 1px 0;
}

/* Données personnelles dans une bulle marine : contour lisible au lieu d'un aplat rouge */
.iphone-screen .msg-user mark.pii {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px #fca5a5;
}

.iphone-screen .chat-input-container {
    padding: 8px 10px 10px;
    gap: 6px;
}

.iphone-screen .chat-input-container input {
    padding: 8px 14px;
    font-size: 0.76rem;
}

.iphone-screen .chat-input-container button {
    width: 34px;
    height: 34px;
}

/* =========================================================
   Secure block : compact, lisible, et différenciable des bulles
   - en-tête teinté dans la couleur du composant
   - bordure teintée (les bulles restent blanches à bordure grise)
========================================================= */
:is(.iphone-screen, .component-preview) .secure-block {
    border: 1px solid color-mix(in srgb, var(--sb-accent) 32%, #ffffff);
    border-radius: 16px;
    box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--sb-accent) 45%, transparent), 0 1px 3px rgba(15, 27, 45, 0.05);
}

:is(.iphone-screen, .component-preview) .sb-head {
    gap: 8px;
    padding: 8px 10px;
    background: var(--sb-soft);
    border-bottom: 1px solid color-mix(in srgb, var(--sb-accent) 18%, #ffffff);
}

:is(.iphone-screen, .component-preview) .sb-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--sb-accent);
    color: #ffffff;
}

:is(.iphone-screen, .component-preview) .sb-icon .sb-svg {
    width: 14px;
    height: 14px;
}

:is(.iphone-screen, .component-preview) .sb-title {
    font-size: 0.76rem;
    color: color-mix(in srgb, var(--sb-accent) 70%, #0f1b2d);
}

:is(.iphone-screen, .component-preview) .sb-intro {
    padding: 8px 10px 0;
    font-size: 0.7rem;
    color: #4a5566;
}

:is(.iphone-screen, .component-preview) .sb-rows {
    padding: 8px 10px 8px;
    gap: 6px;
}

:is(.iphone-screen, .component-preview) .sb-intro+.sb-rows {
    padding-top: 6px;
}

:is(.iphone-screen, .component-preview) .sb-hero {
    padding: 6px 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e3e8ef;
}

:is(.iphone-screen, .component-preview) .sb-hero-label {
    font-size: 0.6rem;
    color: #4a5566;
}

:is(.iphone-screen, .component-preview) .sb-hero-value {
    font-size: 1.02rem;
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-kv {
    background: #ffffff;
    border-color: #e3e8ef;
    border-radius: 10px;
}

:is(.iphone-screen, .component-preview) .sb-row {
    padding: 5px 9px;
}

:is(.iphone-screen, .component-preview) .sb-row-label {
    font-size: 0.66rem;
    color: #4a5566;
}

:is(.iphone-screen, .component-preview) .sb-row-value {
    font-size: 0.72rem;
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .sb-items {
    padding: 4px 10px 2px;
}

:is(.iphone-screen, .component-preview) .sb-item {
    padding: 5px 0;
}

:is(.iphone-screen, .component-preview) .sb-item-primary {
    font-size: 0.72rem;
}

:is(.iphone-screen, .component-preview) .sb-item-secondary {
    font-size: 0.62rem;
    color: #5f6b7c;
}

:is(.iphone-screen, .component-preview) .sb-summary {
    margin: 2px 10px 8px;
    padding: 6px 9px;
    font-size: 0.72rem;
}

:is(.iphone-screen, .component-preview) .sb-empty {
    color: #4a5566;
}

:is(.iphone-screen, .component-preview) .sb-file {
    margin: 8px 10px;
    padding: 7px 9px;
}

:is(.iphone-screen, .component-preview) .sb-file-meta {
    color: #5f6b7c;
}

:is(.iphone-screen, .component-preview) .sb-choices {
    margin: 8px 10px;
}

:is(.iphone-screen, .component-preview) .sb-intro+.sb-choices-slot+.sb-choices,
:is(.iphone-screen, .component-preview) .sb-choices {
    margin-top: 6px;
}

:is(.iphone-screen, .component-preview) .sb-choice {
    padding: 6px 9px;
}

:is(.iphone-screen, .component-preview) .sb-choice-label {
    font-size: 0.72rem;
}

:is(.iphone-screen, .component-preview) .sb-choice-hint {
    font-size: 0.6rem;
}

:is(.iphone-screen, .component-preview) .sb-chevron {
    color: #8a95a5;
}

:is(.iphone-screen, .component-preview) .sb-input {
    padding: 0 10px 8px;
}

:is(.iphone-screen, .component-preview) .sb-actions {
    padding: 0 10px 8px;
    gap: 6px;
}

:is(.iphone-screen, .component-preview) .sb-action {
    padding: 7px 8px;
    font-size: 0.72rem;
}

/* Pied : lisible (taille et contraste relevés) */
:is(.iphone-screen, .component-preview) .sb-foot {
    gap: 5px;
    padding: 6px 10px;
    font-size: 0.62rem;
    line-height: 1.35;
    color: #4a5566;
    background: #f7f9fc;
}

/* Secure blocks : sans ombre */
:is(.iphone-screen, .component-preview) .secure-block {
    box-shadow: none;
}

/* OTP : champ sur toute la largeur, Valider et Annuler côte à côte */
.sb-input {
    padding-bottom: 6px;
}

.sb-input-field {
    width: 100%;
}

.sb-actions .sb-action {
    flex: 1 1 0;
    min-width: 0;
}

/* =========================================================
   Ratio de l'iPhone verrouillé : aucun contenu ne peut élargir l'écran.
   Un élément avec aspect-ratio prend par défaut la largeur minimale de son
   contenu (min-width: auto) : on la neutralise sur toute la chaîne.
========================================================= */
.iphone-wrapper {
    min-width: 0;
}

.iphone-frame {
    min-width: 0;
    min-height: 0;
    flex-shrink: 0;
}

.iphone-screen,
#mobile-app-main,
#mobile-login-screen,
#mobile-settings-modal,
.iphone-screen .chat-container,
.iphone-screen .chat-input-container {
    min-width: 0;
    max-width: 100%;
}

.iphone-screen {
    width: 100%;
}

.iphone-screen .chat-container>* {
    min-width: 0;
    max-width: 100%;
}

.iphone-screen .chat-message {
    max-width: 86%;
    overflow-wrap: anywhere;
}

.iphone-screen .chat-input-container input {
    width: 100%;
    min-width: 0;
}

/* Secure blocks : toujours contenus dans la largeur de l'écran */
.iphone-screen .secure-block {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.iphone-screen .secure-block * {
    min-width: 0;
}

.iphone-screen .sb-title,
.iphone-screen .sb-intro,
.iphone-screen .sb-row-value,
.iphone-screen .sb-hero-value,
.iphone-screen .sb-file-name,
.iphone-screen .sb-choice-label {
    overflow-wrap: anywhere;
}

.iphone-screen .sb-item-value,
.iphone-screen .sb-summary>span:last-child {
    white-space: nowrap;
    flex-shrink: 0;
}

.iphone-screen .sb-input-field {
    width: 100%;
    box-sizing: border-box;
}

/* Traitement en cours (réponse de la banque / de l'assistant) */
.msg-loading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 11px 14px;
    align-self: flex-start;
}

.msg-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    font-size: 0;
    background: #8a95a5;
    animation: typingDot 1.2s ease-in-out infinite;
}

.msg-loading span:nth-child(2) {
    animation-delay: 0.15s;
}

.msg-loading span:nth-child(3) {
    animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    .msg-loading span {
        animation: typingFade 1.2s ease-in-out infinite;
    }

    .msg-loading span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .msg-loading span:nth-child(3) {
        animation-delay: 0.4s;
    }
}

/* Code OTP : une case par chiffre */
.sb-input {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.sb-otp {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.sb-otp-cell {
    flex: 1 1 0;
    min-width: 0;
    max-width: 40px;
    aspect-ratio: 4 / 5;
    padding: 0;
    border-radius: 10px;
    border: 1.5px solid #d6dce6;
    background: #f7f9fc;
    color: #0f1b2d;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    outline: none;
    caret-color: var(--sb-accent);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.sb-otp-cell.filled {
    background: #ffffff;
    border-color: color-mix(in srgb, var(--sb-accent) 45%, #d6dce6);
}

.sb-otp-cell:focus {
    background: #ffffff;
    border-color: var(--sb-accent);
    box-shadow: 0 0 0 3px var(--sb-soft);
}

.sb-otp.invalid .sb-otp-cell:not(.filled) {
    border-color: #dc2626;
    background: #fef2f2;
}

.sb-otp-cell:disabled {
    opacity: 0.6;
}

.sb-otp-hint {
    text-align: center;
    font-size: 0.6rem;
    color: #5f6b7c;
}

.sb-input-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================================
   MODE DÉMO : chips d'opérations (message d'accueil + barre défilante)
========================================================= */
.iphone-screen .demo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 9999px;
    border: 1px solid #d6dce6;
    background: #ffffff;
    color: #0b2e5c;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.iphone-screen .demo-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.iphone-screen .demo-chip:hover {
    background: #eef3fb;
    border-color: #9fb3d1;
}

.iphone-screen .demo-chip:active {
    background: #e2eaf6;
}

.iphone-screen .demo-chip-icon {
    width: 13px;
    height: 13px;
    color: #1d5bd8;
}

/* Dans le message d'accueil */
.iphone-screen .msg-bot .demo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

/* Barre au-dessus de la saisie */
.iphone-screen .demo-chipbar {
    flex-shrink: 0;
    min-width: 0;
    padding: 6px 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e5e9f0;
}

.iphone-screen .demo-chipbar-track {
    display: flex;
    gap: 6px;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    cursor: grab;
    touch-action: pan-x;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.iphone-screen .demo-chipbar-track::-webkit-scrollbar {
    display: none;
}

.iphone-screen .demo-chipbar-track.dragging {
    cursor: grabbing;
}

.iphone-screen .demo-chipbar-track.dragging .demo-chip {
    pointer-events: none;
}

.iphone-screen .demo-chipbar-track .demo-chip {
    scroll-snap-align: start;
    background: #f3f5f9;
    border-color: transparent;
}

.iphone-screen .demo-chipbar-track .demo-chip:hover {
    background: #e6ecf5;
}

.iphone-screen .demo-chipbar+.chat-input-container {
    border-top: none;
}

/* En-tête : le texte s'écarte du coin arrondi de l'écran */
.iphone-screen .iphone-app-header {
    padding: 10px 14px 8px 22px;
}

.iphone-screen .iphone-brand {
    padding-inline-start: 2px;
}

/* =========================================================
   RÉGLAGES : version compacte
========================================================= */
.iphone-screen #mobile-settings-modal {
    padding: 16px 16px !important;
}

.iphone-screen #mobile-settings-modal>div:first-child {
    margin: 10px 0 10px !important;
}

.iphone-screen #mobile-settings-modal h2 {
    font-size: 0.9rem !important;
}

.iphone-screen #mobile-settings-modal>div:nth-child(2) {
    gap: 9px !important;
}

.iphone-screen #mobile-settings-modal label:not(.settings-switch-row) {
    font-size: 0.62rem !important;
    letter-spacing: 0.4px !important;
    margin-bottom: 4px !important;
}

.iphone-screen #mobile-settings-modal #userApiKey,
.iphone-screen #mobile-settings-modal #userDefaultModel {
    height: 32px !important;
    font-size: 0.7rem !important;
    border-radius: 9px !important;
}

/* Les lignes à switch ne doivent pas hériter des majuscules des libellés */
.iphone-screen #mobile-settings-modal label.settings-switch-row {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 8px 10px;
    gap: 10px;
    border-radius: 10px;
}

.iphone-screen .settings-switch-title {
    font-size: 0.72rem;
    font-weight: 700;
}

.iphone-screen .settings-switch-hint {
    font-size: 0.6rem;
    line-height: 1.3;
}

.iphone-screen .settings-switch {
    width: 32px;
    height: 18px;
}

.iphone-screen .settings-switch::after {
    width: 14px;
    height: 14px;
}

.iphone-screen .settings-switch-input:checked+.settings-switch::after {
    transform: translateX(14px);
}

.iphone-screen #mobile-settings-modal #saveSettingsBtn {
    margin-top: 2px !important;
    padding: 8px 12px !important;
    font-size: 0.74rem !important;
    border-radius: 10px !important;
}

/* =========================================================
   RTL (arabe) : sens d'écriture de tout l'écran du téléphone
========================================================= */
.iphone-screen .iphone-app-header {
    padding-inline: 22px 14px;
}

.iphone-screen .iphone-user-info {
    align-items: flex-start;
    text-align: start;
}

.iphone-screen[dir="rtl"] .msg-user {
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 5px;
}

.iphone-screen[dir="rtl"] .msg-bot {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 5px;
}

.iphone-screen[dir="rtl"] .chat-input-container button svg,
.iphone-screen[dir="rtl"] #mobileLogoutBtn svg {
    transform: scaleX(-1);
}

.iphone-screen[dir="rtl"] .msg-translated::after {
    right: auto;
    left: 0;
}



.iphone-screen[dir="rtl"] #mobile-settings-modal label:not(.settings-switch-row) {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.iphone-screen[dir="rtl"] .settings-switch-input:checked+.settings-switch::after {
    transform: translateX(-14px);
}

.iphone-screen[dir="rtl"] .settings-switch::after {
    left: auto;
    right: 2px;
}

/* =========================================================
   ÉCHELLE MOBILE RÉELLE : tout l'écran de l'iPhone réduit (~15-20 %)
========================================================= */

/* En-tête */
.iphone-screen .iphone-app-header {
    padding: 7px 12px 6px 18px;
    padding-inline: 18px 12px;
}

.iphone-screen .iphone-user-info h3 {
    font-size: 0.74rem;
}

.iphone-screen .iphone-user-info span {
    font-size: 0.56rem;
    gap: 3px;
}

.iphone-screen .status-dot-pulse {
    width: 5px;
    height: 5px;
}

.iphone-screen .iphone-header-actions {
    gap: 5px !important;
}

.iphone-screen .iphone-header-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
}

.iphone-screen .iphone-header-btn svg {
    width: 13px;
    height: 13px;
}

/* Conversation */
.iphone-screen .chat-container {
    gap: 14px;
    padding: 8px 8px 10px;
}

.iphone-screen .chat-message {
    font-size: 0.7rem;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 14px;
}

.iphone-screen .msg-user {
    border-bottom-right-radius: 4px;
}

.iphone-screen .msg-bot {
    border-bottom-left-radius: 4px;
}

.iphone-screen[dir="rtl"] .msg-user {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 4px;
}

.iphone-screen[dir="rtl"] .msg-bot {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}

.iphone-screen .chat-notice {
    font-size: 0.6rem;
    padding: 5px 8px;
}

.iphone-screen .msg-loading {
    padding: 8px 11px;
    gap: 3px;
}

.iphone-screen .msg-loading span {
    width: 5px;
    height: 5px;
}

.iphone-screen .msg-typing {
    padding: 8px 11px;
}

.iphone-screen .msg-typing span {
    width: 5px;
    height: 5px;
}

/* Chips du mode démo */
.iphone-screen .demo-chip {
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.6rem;
}

.iphone-screen .demo-chip-icon {
    width: 11px;
    height: 11px;
}

.iphone-screen .msg-bot .demo-chips {
    gap: 4px;
    margin-top: 6px;
}

.iphone-screen .demo-chipbar {
    padding: 5px 0;
}

.iphone-screen .demo-chipbar-track {
    gap: 5px;
    padding: 0 8px;
}

/* Saisie */
.iphone-screen .chat-input-container {
    padding: 6px 8px 8px;
    gap: 6px;
}

.iphone-screen .chat-input-container input {
    padding: 7px 12px;
    font-size: 0.7rem;
    border-radius: 18px;
}

.iphone-screen .chat-input-container button {
    width: 30px;
    height: 30px;
}

.iphone-screen .chat-input-container button svg {
    width: 13px;
    height: 13px;
}

/* Connexion */
.iphone-screen .mobile-login-container {
    padding: 18px;
}

.iphone-screen .mobile-login-logo img {
    height: 38px;
    margin-bottom: 16px;
}

.iphone-screen .mobile-login-container h2 {
    font-size: 1.05rem;
}

.iphone-screen .mobile-login-container p {
    font-size: 0.7rem;
    margin-bottom: 22px;
}

.iphone-screen .mobile-login-form {
    gap: 10px;
}

.iphone-screen .mobile-input {
    padding: 9px 12px;
    font-size: 0.76rem;
    border-radius: 10px;
}

.iphone-screen .mobile-btn-primary {
    padding: 10px;
    font-size: 0.78rem;
    border-radius: 10px;
}

/* Secure blocks */
:is(.iphone-screen, .component-preview) .secure-block {
    font-size: 0.66rem;
    border-radius: 14px;
}

:is(.iphone-screen, .component-preview) .sb-head {
    gap: 7px;
    padding: 6px 9px;
}

:is(.iphone-screen, .component-preview) .sb-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

:is(.iphone-screen, .component-preview) .sb-icon .sb-svg {
    width: 12px;
    height: 12px;
}

:is(.iphone-screen, .component-preview) .sb-title {
    font-size: 0.7rem;
}

:is(.iphone-screen, .component-preview) .sb-intro {
    padding: 6px 9px 0;
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-rows {
    padding: 6px 9px;
    gap: 5px;
}

:is(.iphone-screen, .component-preview) .sb-intro+.sb-rows {
    padding-top: 5px;
}

:is(.iphone-screen, .component-preview) .sb-hero {
    padding: 5px 8px;
    border-radius: 9px;
}

:is(.iphone-screen, .component-preview) .sb-hero-label {
    font-size: 0.54rem;
}

:is(.iphone-screen, .component-preview) .sb-hero-value {
    font-size: 0.9rem;
}

:is(.iphone-screen, .component-preview) .sb-kv {
    border-radius: 9px;
}

:is(.iphone-screen, .component-preview) .sb-row {
    padding: 4px 8px;
    gap: 8px;
}

:is(.iphone-screen, .component-preview) .sb-row-label {
    font-size: 0.6rem;
}

:is(.iphone-screen, .component-preview) .sb-row-value {
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-items {
    padding: 2px 9px;
}

:is(.iphone-screen, .component-preview) .sb-item {
    gap: 6px;
    padding: 4px 0;
}

:is(.iphone-screen, .component-preview) .sb-item-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

:is(.iphone-screen, .component-preview) .sb-item-icon .sb-svg {
    width: 10px;
    height: 10px;
}

:is(.iphone-screen, .component-preview) .sb-item-primary {
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-item-secondary {
    font-size: 0.56rem;
}

:is(.iphone-screen, .component-preview) .sb-item-value {
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-summary {
    margin: 2px 9px 6px;
    padding: 5px 8px;
    font-size: 0.64rem;
    border-radius: 8px;
}

:is(.iphone-screen, .component-preview) .sb-empty {
    margin: 0 9px 6px;
    padding: 6px 8px;
    font-size: 0.62rem;
}

:is(.iphone-screen, .component-preview) .sb-file {
    gap: 7px;
    margin: 6px 9px;
    padding: 6px 8px;
    border-radius: 9px;
}

:is(.iphone-screen, .component-preview) .sb-file-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

:is(.iphone-screen, .component-preview) .sb-file-icon .sb-svg {
    width: 13px;
    height: 13px;
}

:is(.iphone-screen, .component-preview) .sb-file-name {
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-file-meta {
    font-size: 0.56rem;
}

:is(.iphone-screen, .component-preview) .sb-choices {
    margin: 5px 9px 6px;
    border-radius: 9px;
}

:is(.iphone-screen, .component-preview) .sb-choice {
    gap: 7px;
    padding: 5px 8px;
}

:is(.iphone-screen, .component-preview) .sb-avatar {
    width: 20px;
    height: 20px;
    font-size: 0.5rem;
}

:is(.iphone-screen, .component-preview) .sb-avatar.icon .sb-svg {
    width: 10px;
    height: 10px;
}

:is(.iphone-screen, .component-preview) .sb-choice-label {
    font-size: 0.64rem;
}

:is(.iphone-screen, .component-preview) .sb-choice-hint {
    font-size: 0.54rem;
}

:is(.iphone-screen, .component-preview) .sb-chevron {
    width: 11px;
    height: 11px;
}

:is(.iphone-screen, .component-preview) .sb-input {
    padding: 0 9px 5px;
    gap: 3px;
}

:is(.iphone-screen, .component-preview) .sb-otp {
    gap: 5px;
}

:is(.iphone-screen, .component-preview) .sb-otp-cell {
    max-width: 32px;
    font-size: 0.88rem;
    border-radius: 8px;
}

:is(.iphone-screen, .component-preview) .sb-otp-hint {
    font-size: 0.54rem;
}

:is(.iphone-screen, .component-preview) .sb-actions {
    gap: 5px;
    padding: 0 9px 7px;
}

:is(.iphone-screen, .component-preview) .sb-action {
    gap: 4px;
    padding: 6px 7px;
    font-size: 0.64rem;
    border-radius: 9px;
}

:is(.iphone-screen, .component-preview) .sb-action .sb-svg {
    width: 11px;
    height: 11px;
}

:is(.iphone-screen, .component-preview) .sb-foot {
    gap: 4px;
    padding: 5px 9px;
    font-size: 0.56rem;
}

:is(.iphone-screen, .component-preview) .sb-foot .sb-svg {
    width: 10px;
    height: 10px;
}

/* Bouton Envoyer en mode Stop pendant un traitement */
.iphone-screen .chat-input-container button.is-stop {
    background: #b91c1c;
    box-shadow: 0 4px 10px -3px rgba(185, 28, 28, 0.5);
    animation: stopPulse 1.6s ease-in-out infinite;
}

.iphone-screen .chat-input-container button.is-stop:hover {
    background: #991b1b;
}

.iphone-screen .chat-input-container button.is-stop svg {
    width: 11px;
    height: 11px;
    transform: none;
}

@keyframes stopPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.35);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(185, 28, 28, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .iphone-screen .chat-input-container button.is-stop {
        animation: none;
    }
}

/* =========================================================
   MODE DÉMO : icône à gauche de la saisie + bottom sheet des opérations
========================================================= */
.iphone-screen .chat-input-container .demo-launcher {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #eef2f8;
    color: #0b2e5c;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s;
}

.iphone-screen .chat-input-container .demo-launcher:hover {
    background: #e2e9f4;
    transform: none;
    filter: none;
}

.iphone-screen .chat-input-container .demo-launcher svg {
    width: 14px;
    height: 14px;
    transform: none;
}

.iphone-screen .demo-sheet {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.iphone-screen .demo-sheet[hidden] {
    display: none;
}

.iphone-screen .demo-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, 0.32);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.iphone-screen .demo-sheet-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 72%;
    padding: 6px 0 10px;
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(15, 27, 45, 0.16);
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.iphone-screen .demo-sheet.open .demo-sheet-backdrop {
    opacity: 1;
}

.iphone-screen .demo-sheet.open .demo-sheet-panel {
    transform: translateY(0);
}

.iphone-screen .demo-sheet-handle {
    align-self: center;
    width: 32px;
    height: 4px;
    margin-bottom: 6px;
    border-radius: 9999px;
    background: #d6dce6;
}

.iphone-screen .demo-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 6px;
}

.iphone-screen .demo-sheet-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #0f1b2d;
}

.iphone-screen .demo-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f4f8;
    color: #4a5566;
    cursor: pointer;
}

.iphone-screen .demo-sheet-close .sb-svg {
    width: 12px;
    height: 12px;
}

.iphone-screen .demo-sheet-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 6px;
}

.iphone-screen .demo-sheet-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 6px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #0f1b2d;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.iphone-screen .demo-sheet-item+.demo-sheet-item {
    border-top: 1px solid #eef1f5;
    border-radius: 0;
}

.iphone-screen .demo-sheet-item:hover,
.iphone-screen .demo-sheet-item:focus-visible {
    background: #f5f8fd;
    outline: none;
}

.iphone-screen .demo-sheet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: #0b2e5c;
    background: #eaf0f8;
    flex-shrink: 0;
}

.iphone-screen .demo-sheet-icon .sb-svg {
    width: 13px;
    height: 13px;
}

.iphone-screen .demo-sheet-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.iphone-screen .demo-sheet-label {
    font-size: 0.68rem;
    font-weight: 700;
}

.iphone-screen .demo-sheet-sample {
    font-size: 0.58rem;
    color: #5f6b7c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iphone-screen .demo-sheet-chevron {
    width: 11px;
    height: 11px;
    color: #8a95a5;
}

.iphone-screen .demo-sheet[dir="rtl"] .demo-sheet-chevron {
    transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {

    .iphone-screen .demo-sheet-panel,
    .iphone-screen .demo-sheet-backdrop {
        transition: none;
    }
}

/* Saisie : plus basse, bouton plus petit, dégagée des coins arrondis de l'écran */
.iphone-screen .chat-input-container {
    padding: 6px 16px 14px;
    gap: 6px;
}

.iphone-screen .chat-input-container input {
    height: 30px;
    padding: 0 12px;
    font-size: 0.68rem;
    border-radius: 15px;
    box-sizing: border-box;
}

.iphone-screen .chat-input-container button {
    position: relative;
    width: 28px;
    height: 28px;
}

.iphone-screen .chat-input-container button svg {
    width: 12px;
    height: 12px;
}

.iphone-screen .chat-input-container .demo-launcher {
    width: 28px;
    height: 28px;
}

.iphone-screen .chat-input-container .demo-launcher svg {
    width: 13px;
    height: 13px;
}

/* Stop : anneau qui tourne tant que le traitement est en cours */
.iphone-screen .chat-input-container button.is-stop {
    animation: none;
    box-shadow: none;
}

.iphone-screen .chat-input-container button.is-stop svg {
    width: 9px;
    height: 9px;
}

.iphone-screen .chat-input-container button.is-stop::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(185, 28, 28, 0.18);
    border-top-color: #b91c1c;
    animation: stopSpin 0.9s linear infinite;
    pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
    .iphone-screen .chat-input-container button.is-stop::after {
        animation: stopFade 1.2s ease-in-out infinite;
        border-color: #b91c1c;
    }
}

@keyframes stopFade {
    50% {
        opacity: 0.25;
    }
}

/* =========================================================
   SUR SMARTPHONE : seule l'app mobile s'affiche, en plein écran
   (pas d'en-tête du simulateur, pas de colonnes NAB / AI / LLM, pas de cadre iPhone)
========================================================= */
@media (max-width: 768px) {

    html,
    body.nab-simulator-frontpage {
        height: 100dvh !important;
        overflow: hidden !important;
    }

    body.nab-simulator-frontpage {
        padding: 0 !important;
        background: #f3f5f9 !important;
    }

    body.nab-simulator-frontpage .app-header,
    body.nab-simulator-frontpage #node-bank,
    body.nab-simulator-frontpage #node-ai,
    body.nab-simulator-frontpage #node-llm,
    body.nab-simulator-frontpage .flow-packet {
        display: none !important;
    }

    body.nab-simulator-frontpage .architecture-container {
        display: block;
        height: 100%;
        gap: 0;
        overflow: hidden;
    }

    body.nab-simulator-frontpage #node-mobile {
        height: 100%;
        min-height: 0;
    }

    .iphone-wrapper {
        padding: 0;
        height: 100%;
    }

    .iphone-frame {
        width: 100%;
        height: 100%;
        max-width: none;
        aspect-ratio: auto;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: #f3f5f9;
    }

    .iphone-frame::before,
    .iphone-buttons-left {
        display: none;
    }

    .iphone-screen {
        border-radius: 0;
    }

    /* Zones sûres des téléphones à encoche / barre d'accueil */
    .iphone-screen .iphone-app-header {
        padding-top: calc(8px + env(safe-area-inset-top));
        padding-inline: calc(14px + env(safe-area-inset-left)) calc(12px + env(safe-area-inset-right));
    }

    .iphone-screen .chat-input-container {
        padding: 6px calc(10px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
    }

    .iphone-screen #mobile-settings-modal {
        border-radius: 0 !important;
    }

    /* Champ à 16px minimum : empêche le zoom automatique d'iOS à la saisie */
    .iphone-screen .chat-input-container input,
    .iphone-screen .mobile-input,
    .iphone-screen .sb-otp-cell {
        font-size: 16px;
    }

    .iphone-screen .chat-input-container input {
        height: 36px;
    }

    .iphone-screen .chat-input-container button,
    .iphone-screen .chat-input-container .demo-launcher {
        width: 34px;
        height: 34px;
    }

    .prompt-page {
        display: none !important;
    }
}

/* Déconnecté : l app est masquée (le style inline display:none doit toujours gagner) */
#mobile-app-main[style*="display: none"] {
    display: none !important;
}

/* Smartphone : textes à taille lisible (toutes les tailles de l'app sont en rem) */
@media (max-width: 768px) {
    html:has(body.nab-simulator-frontpage) {
        font-size: 125%;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .iphone-screen .iphone-header-btn {
        width: 34px;
        height: 34px;
    }

    .iphone-screen .iphone-header-btn svg {
        width: 17px;
        height: 17px;
    }

    .iphone-screen .sb-icon {
        width: 26px;
        height: 26px;
    }

    .iphone-screen .sb-icon .sb-svg {
        width: 15px;
        height: 15px;
    }

    .iphone-screen .sb-avatar {
        width: 26px;
        height: 26px;
    }

    .iphone-screen .sb-otp-cell {
        max-width: 44px;
    }

    .iphone-screen .demo-chip-icon,
    .iphone-screen .demo-sheet-icon .sb-svg {
        width: 15px;
        height: 15px;
    }

    .iphone-screen .demo-sheet-icon {
        width: 32px;
        height: 32px;
    }
}

/* RTL : le message du client reste toujours à droite, l'assistant à gauche (comme en LTR) */
.iphone-screen[dir="rtl"] .msg-user {
    align-self: flex-start;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 14px;
}

.iphone-screen[dir="rtl"] .msg-bot,
.iphone-screen[dir="rtl"] .msg-loading {
    align-self: flex-end;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 14px;
}

.iphone-screen[dir="rtl"] .msg-translated::after {
    left: auto;
    right: 0;
}

/* Smartphone : échelle encore agrandie (texte de base 18px -> 22px, éléments fixes agrandis) */
@media (max-width: 768px) {
    html:has(body.nab-simulator-frontpage) {
        font-size: 137.5%;
    }

    .iphone-screen .iphone-header-btn {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .iphone-screen .iphone-header-btn svg {
        width: 19px;
        height: 19px;
    }

    .iphone-screen .status-dot-pulse {
        width: 7px;
        height: 7px;
    }

    .iphone-screen .chat-container {
        gap: 18px;
        padding: 12px 12px 14px;
    }

    .iphone-screen .chat-message {
        padding: 9px 13px;
        border-radius: 18px;
    }

    .iphone-screen .chat-input-container input {
        height: 44px;
        padding: 0 16px;
        border-radius: 22px;
    }

    .iphone-screen .chat-input-container button,
    .iphone-screen .chat-input-container .demo-launcher {
        width: 42px;
        height: 42px;
    }

    .iphone-screen .chat-input-container button svg,
    .iphone-screen .chat-input-container .demo-launcher svg {
        width: 18px;
        height: 18px;
    }

    .iphone-screen .chat-input-container button.is-stop svg {
        width: 13px;
        height: 13px;
    }

    .iphone-screen .sb-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .iphone-screen .sb-icon .sb-svg {
        width: 17px;
        height: 17px;
    }

    .iphone-screen .sb-avatar {
        width: 30px;
        height: 30px;
    }

    .iphone-screen .sb-avatar.icon .sb-svg {
        width: 14px;
        height: 14px;
    }

    .iphone-screen .sb-item-icon {
        width: 26px;
        height: 26px;
    }

    .iphone-screen .sb-item-icon .sb-svg {
        width: 14px;
        height: 14px;
    }

    .iphone-screen .sb-file-icon {
        width: 34px;
        height: 34px;
    }

    .iphone-screen .sb-otp-cell {
        max-width: 48px;
    }

    .iphone-screen .sb-chevron {
        width: 15px;
        height: 15px;
    }

    .iphone-screen .sb-action .sb-svg {
        width: 15px;
        height: 15px;
    }

    .iphone-screen .sb-foot .sb-svg {
        width: 13px;
        height: 13px;
    }

    .iphone-screen .demo-chip {
        padding: 6px 12px;
    }

    .iphone-screen .demo-chip-icon {
        width: 17px;
        height: 17px;
    }

    .iphone-screen .demo-sheet-icon {
        width: 36px;
        height: 36px;
    }

    .iphone-screen .demo-sheet-icon .sb-svg {
        width: 18px;
        height: 18px;
    }

    .iphone-screen .demo-sheet-close {
        width: 32px;
        height: 32px;
    }

    .iphone-screen .demo-sheet-item {
        padding: 11px 8px;
    }
}

/* =========================================================
   BANNIÈRE : "ouvrir sur PC" (mobile) / "essayer sur mobile" (PC)
   Centrée à l'écran, fond orangé, overlay global, une fois par session
========================================================= */
.device-hint {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 12, 20, 0.62);
    backdrop-filter: blur(3px);
    font-family: 'Cairo', 'Cairo Play', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.device-hint.show {
    opacity: 1;
    pointer-events: auto;
}

.device-hint-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(145deg, #fb923c 0%, #f97316 55%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 24px 60px -16px rgba(234, 88, 12, 0.55), 0 8px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(10px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-hint.show .device-hint-card {
    transform: none;
}

.device-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    flex-shrink: 0;
}

.device-hint-icon .sb-svg {
    width: 20px;
    height: 20px;
}

.device-hint-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.device-hint-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.device-hint-text {
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

.device-hint-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.device-hint-btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.device-hint-btn.primary {
    background: #ffffff;
    border-color: #ffffff;
    color: #c2410c;
}

.device-hint-btn:hover {
    filter: brightness(1.06);
}

.device-hint-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .device-hint,
    .device-hint-card {
        transition: none;
        transform: none;
    }
}

/* =========================================================
   RÔLE "CLIENT" : uniquement l'iPhone, centré, sur PC comme sur mobile
========================================================= */
body.nab-client-mode .app-header,
body.nab-client-mode #node-bank,
body.nab-client-mode #node-ai,
body.nab-client-mode #node-llm,
body.nab-client-mode .flow-packet,
body.nab-client-mode .prompt-page,
body.nab-client-mode .device-hint {
    display: none !important;
}

body.nab-client-mode .architecture-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

body.nab-client-mode #node-mobile {
    flex: 0 1 auto;
    width: auto;
    height: 100%;
}

/* =========================================================
   FILE DE DEMANDES : bannière d'avancement + proposition de la suivante
   (style neutre, distinct des secure blocks : aucune donnée bancaire)
========================================================= */
.iphone-screen .intent-banner {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 12px 7px;
    background: #eef3fb;
    border-bottom: 1px solid #d9e3f2;
    color: #0b2e5c;
}

.iphone-screen .intent-banner[hidden] {
    display: none;
}

.iphone-screen .intent-banner-main {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iphone-screen .intent-banner-toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.iphone-screen .intent-banner-step {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 800;
}

.iphone-screen .intent-banner-next {
    font-size: 0.62rem;
    color: #3a4b66;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iphone-screen .intent-banner-chevron {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transform: rotate(90deg);
    color: #6b7a90;
}

.iphone-screen .intent-banner-toggle[aria-expanded="true"] .intent-banner-chevron {
    transform: rotate(-90deg);
}

.iphone-screen .intent-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #dde6f3;
    color: #0b2e5c;
    cursor: pointer;
}

.iphone-screen .intent-banner-close .sb-svg {
    width: 11px;
    height: 11px;
}

.iphone-screen .intent-banner-bar {
    display: flex;
    gap: 3px;
}

.iphone-screen .intent-banner-bar .seg {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #cfd9e8;
}

.iphone-screen .intent-banner-bar .seg.done {
    background: #0b2e5c;
}

.iphone-screen .intent-banner-bar .seg.active {
    background: #1d5bd8;
}

.iphone-screen .intent-banner-bar .seg.skipped,
.iphone-screen .intent-banner-bar .seg.cancelled {
    background: #9aa7b8;
}

.iphone-screen .intent-banner-bar .seg.failed {
    background: #b91c1c;
}

.iphone-screen .intent-banner-list {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.iphone-screen .intent-banner-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    color: #3a4b66;
}

.iphone-screen .intent-banner-list li span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iphone-screen .intent-banner-list li em {
    font-style: normal;
    color: #6b7a90;
}

.iphone-screen .intent-banner-list li.done {
    color: #0b2e5c;
}

.iphone-screen .intent-banner-list li.active {
    font-weight: 700;
    color: #1d5bd8;
}

.iphone-screen .intent-banner-list li.failed {
    color: #b91c1c;
}

.iphone-screen .intent-btn {
    padding: 5px 10px;
    border-radius: 9px;
    border: 1px solid #c9d4e4;
    background: #ffffff;
    color: #0b2e5c;
    font: inherit;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
}

.iphone-screen .intent-btn.primary {
    background: #0b2e5c;
    border-color: #0b2e5c;
    color: #ffffff;
}

.iphone-screen .intent-btn.small {
    padding: 3px 9px;
    font-size: 0.6rem;
}

.iphone-screen .intent-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.iphone-screen .intent-proposal {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.iphone-screen .intent-proposal-actions {
    display: flex;
    gap: 6px;
}

.iphone-screen .intent-proposal.closed {
    opacity: 0.7;
}

/* Mode démo : chip / ligne « plan d'action » mise en avant */
.iphone-screen .demo-chip.plan {
    background: #0b2e5c;
    border-color: #0b2e5c;
    color: #ffffff;
}

.iphone-screen .demo-chip.plan .demo-chip-icon {
    color: #ffffff;
}

.iphone-screen .demo-chip.plan:hover {
    background: #13407f;
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-icon {
    background: #0b2e5c;
    color: #ffffff;
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-label {
    color: #0b2e5c;
}

/* =========================================================
   GABARIT, CANAL "ASSISTANT" : cartes du plan d'action (AI Backend, aucune donnée bancaire)
   Même structure que les secure blocks, style distinct : pas de fond teinté, bordure neutre en pointillés
========================================================= */
:is(.iphone-screen, .component-preview) .secure-block.channel-assistant {
    border: 1px dashed #c9d4e4;
    background: #ffffff;
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-head {
    background: #ffffff;
    border-bottom: 1px solid #eef1f5;
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-icon {
    background: var(--sb-soft);
    color: var(--sb-accent);
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-title {
    color: #0f1b2d;
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-intro {
    color: #0f1b2d;
    font-size: 0.7rem;
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-foot {
    background: #fbfcfe;
}

:is(.iphone-screen, .component-preview) .secure-block.channel-assistant .sb-foot .sb-svg {
    color: #1d5bd8;
}

.iphone-screen .secure-block.channel-assistant.closed {
    opacity: 0.75;
}

.iphone-screen .secure-block.channel-assistant .sb-head:empty {
    display: none;
}

/* Bloc d'action périmé : plus cliquable, visuellement estompé */
.iphone-screen .secure-block.expired {
    opacity: 0.6;
}

.iphone-screen .secure-block.expired button,
.iphone-screen .secure-block.expired input {
    cursor: not-allowed;
    pointer-events: none;
}

.iphone-screen .secure-block.expired button.selected {
    opacity: 1;
}

.iphone-screen .demo-chips button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* OTP simulé (test) : toast en pilule bleu primaire façon Dynamic Island, copié et fermé au clic */
.iphone-otp-toast {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 170px;
    max-width: calc(100% - 24px);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 6px 6px 18px;
    direction: ltr;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #3b7cf0 0%, #1d5bd8 55%, #1549b5 100%);
    box-shadow: 0 10px 26px rgba(29, 91, 216, 0.35);
    color: #fff;
    font: inherit;
    text-align: start;
    cursor: pointer;
    z-index: 30;
    animation: otpToastIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.iphone-otp-toast[hidden] {
    display: none;
}

.iphone-otp-toast.leaving {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.92);
    transition: opacity 0.2s, transform 0.2s;
}

.iphone-otp-text {
    order: 1;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.iphone-otp-label {
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.iphone-otp-toast .iphone-otp-code {
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.iphone-otp-copy {
    order: 2;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.iphone-otp-toast:hover .iphone-otp-copy {
    background: rgba(255, 255, 255, 0.34);
}

@keyframes otpToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -14px) scale(0.85);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* OTP : message de validation dans le même bloc */
.sb-otp-feedback {
    margin-top: 6px;
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.35;
}

.sb-otp-feedback.is-error {
    color: #dc2626;
}

.sb-otp-feedback.is-notice {
    color: #047857;
}

.sb-otp-feedback[hidden] {
    display: none;
}

.sb-otp-resend {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 600;
    cursor: pointer;
}

.sb-otp-resend .sb-svg {
    width: 11px;
    height: 11px;
}

.sb-otp-resend:disabled {
    color: #94a3b8;
    cursor: default;
}

.sb-otp.invalid .sb-otp-cell {
    border-color: #dc2626;
    background: #fef2f2;
}

.sb-otp.shake {
    animation: otpShake 0.35s ease;
}

@keyframes otpShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

/* Valeurs multiples (numéros, horaires) : un élément par bloc, jamais coupé */
.sb-hero-value,
.sb-row-value {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 5px;
    row-gap: 1px;
}

.sb-row-value {
    justify-content: flex-end;
}

.sb-chunk {
    white-space: nowrap;
    unicode-bidi: isolate;
}

.sb-chunk-sep {
    opacity: 0.4;
    font-weight: 400;
}

/* Libellés mixtes (anglais + noms arabes) : sens de lecture propre à chaque libellé */
.sb-item-primary {
    unicode-bidi: plaintext;
    text-align: start;
}

.sb-item-value,
.sb-summary span[dir="ltr"] {
    unicode-bidi: isolate;
    white-space: nowrap;
}

/* Formulaire à choix (gabarit) */
.sb-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 6px 0 2px;
}

.sb-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sb-form-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
}

.sb-form-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sb-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sb-chip:hover:not(:disabled) {
    border-color: var(--sb-accent, #1d5bd8);
}

.sb-chip.selected {
    background: var(--sb-accent, #1d5bd8);
    border-color: var(--sb-accent, #1d5bd8);
    color: #fff;
}

.sb-chip:disabled {
    cursor: default;
    opacity: 0.7;
}

.sb-form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border-radius: 9px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    outline: none;
}

.sb-form-input:focus {
    border-color: var(--sb-accent, #1d5bd8);
    box-shadow: 0 0 0 3px rgba(29, 91, 216, 0.12);
}

.sb-form-empty {
    font-size: 0.66rem;
    color: #94a3b8;
}

/* Relevé : date à côté de l'icône, libellé au-dessus du montant en fin de ligne (gauche en arabe) */
.sb-item {
    padding: 5px 0;
    gap: 8px;
}

.sb-item .sb-item-secondary {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sb-item-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    max-width: 62%;
    line-height: 1.25;
}

.sb-item-end .sb-item-primary {
    max-width: 100%;
    font-size: 0.66rem;
    text-align: end;
    unicode-bidi: plaintext;
}

.sb-item-end .sb-item-value {
    font-size: 0.7rem;
}

/* Opérations disponibles : liste compacte (une ligne par opération), sans défilement */
.iphone-screen .demo-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
    padding: 0 10px 12px;
}

.iphone-screen .demo-sheet-item {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 6px;
    border: none;
    border-radius: 0;
    background: transparent;
}

.iphone-screen .demo-sheet-item+.demo-sheet-item {
    border-top: 1px solid #eef1f5;
    border-radius: 0;
}

.iphone-screen .demo-sheet-item:not(.plan) .demo-sheet-sample {
    display: none;
}

.iphone-screen .demo-sheet-item .demo-sheet-label {
    font-size: 0.66rem;
    line-height: 1.25;
}

.iphone-screen .demo-sheet-icon {
    width: 24px;
    height: 24px;
}

/* Plan d'action : mis en avant en bleu primaire */
.iphone-screen .demo-sheet-item.plan {
    margin-bottom: 4px;
    padding: 8px 10px;
    border-radius: 11px;
    background: #1d5bd8;
    color: #fff;
}

.iphone-screen .demo-sheet-item.plan+.demo-sheet-item {
    border-top: none;
}

.iphone-screen .demo-sheet-item.plan:hover,
.iphone-screen .demo-sheet-item.plan:focus-visible {
    background: #184fc0;
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-label {
    color: #fff;
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-sample {
    color: rgba(255, 255, 255, 0.8);
}

.iphone-screen .demo-sheet-item.plan .demo-sheet-chevron {
    color: rgba(255, 255, 255, 0.85);
}

/* Formulaire compact : marges alignées sur le bloc, grilles fixes, champs révélés un par un */
.secure-block .sb-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0 10px 8px;
}

.secure-block .sb-form+.sb-otp-feedback {
    margin: -2px 10px 8px;
}

.sb-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: sbFieldIn 0.22s ease-out;
}

.sb-form-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #64748b;
}

.sb-form-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.sb-form-field[data-field="mode"] .sb-form-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sb-chip {
    min-width: 0;
    height: 28px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 0.64rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-form-input {
    height: 30px;
    padding: 0 10px;
}

@keyframes sbFieldIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Valeur copiable (code de recharge…) */
.sb-hero-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sb-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #1d5bd8;
    cursor: pointer;
    transition: all 0.15s;
}

.sb-copy:hover {
    border-color: #1d5bd8;
    background: #eaf1fd;
}

.sb-copy.copied {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

.sb-copy .sb-svg {
    width: 13px;
    height: 13px;
}

.iphone-screen .secure-block.expired button.sb-copy {
    cursor: pointer;
    pointer-events: auto;
}

/* Numéro à recharger : un choix par ligne, numéro complet (masqué) jamais tronqué */
.sb-form-field[data-field="phoneTarget"] .sb-form-chips {
    grid-template-columns: 1fr;
}

.sb-form-field[data-field="phoneTarget"] .sb-chip {
    height: 30px;
    padding: 0 10px;
    text-align: start;
    overflow: visible;
}

.sb-form-field[data-field="phoneTarget"] .sb-chip bdi {
    unicode-bidi: plaintext;
}

.sb-form-field[data-field="phoneTarget"] .sb-chip[data-value="other"] {
    border-style: dashed;
    color: #1d5bd8;
}

.sb-form-field[data-field="phoneTarget"] .sb-chip[data-value="other"].selected {
    color: #fff;
    border-style: solid;
}