/* ============================================================
   PENSÉE IA — src/styles/theme.css · Identité KWENI LABS
   Pensée est un produit KWENI LABS (charte graphique KWENI v1.0) :
   - le point Labs : un carré divisé en grille 2×2 Signal. Il reste
     vivant : en réflexion, des ondes carrées s'en propagent ; en
     écriture, il bat doucement
   - le carré comme ponctuation : conversation active, titres, curseur
   - le fil de pensée : ligne qui relie le point à la réponse
   - Montserrat partout, JetBrains Mono pour le code
   Chargée après les autres feuilles : elle a le dernier mot.
   ============================================================ */

/* ── Palette « Nuit » (sombre, univers LABS) ────────────────── */
:root {
    --bg:          #0B1020;   /* Kweni Nuit */
    --bg2:         #10172B;
    --bg3:         #161F38;
    --bg4:         #1E2945;
    --border:      rgba(238, 241, 247, 0.07);
    --border2:     rgba(238, 241, 247, 0.13);
    --accent:      #3D7BFF;   /* Kweni Signal */
    --accent2:     #2F66E0;
    --accent-dim:  rgba(61, 123, 255, 0.12);
    --accent-glow: rgba(61, 123, 255, 0.26);
    --lagune:      #7FA6FF;   /* Signal clair : dégradés du fil de pensée */
    --text:        #EEF1F7;
    --text2:       #9AA3B8;
    --text3:       #7A84A0;
    --user-bg:     rgba(61, 123, 255, 0.10);
    --user-border: rgba(61, 123, 255, 0.24);
    --code-bg:     #070B16;
    --red:         #FF6B6B;
    --yellow:      #F2C14E;
    --shadow:      0 20px 60px rgba(0, 0, 0, 0.5);
    --column:      760px;
    --font-brand:  'Montserrat', system-ui, sans-serif;
    --font-read:   'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-word:   'Montserrat', system-ui, sans-serif;
    --font-mono:   'JetBrains Mono', ui-monospace, monospace;
    --font-ui:     var(--font-read);
}

/* ── Palette « Ivoire » (clair) ─────────────────────────────── */
body[data-theme="light"] {
    --bg:          #F4F2EE;   /* Kweni Ivoire */
    --bg2:         #ECEAE5;
    --bg3:         #E2DFD8;
    --bg4:         #D8D6D0;
    --border:      rgba(28, 28, 34, 0.08);
    --border2:     rgba(28, 28, 34, 0.15);
    --accent:      #2F66E0;   /* Signal foncé : 4,6:1 sur Ivoire pour le texte */
    --accent2:     #2457D6;
    --accent-dim:  rgba(61, 123, 255, 0.11);
    --accent-glow: rgba(61, 123, 255, 0.22);
    --lagune:      #3D7BFF;
    --text:        #1C1C22;   /* Kweni Anthracite */
    --text2:       #55555E;
    --text3:       #77777F;
    --user-bg:     rgba(61, 123, 255, 0.09);
    --user-border: rgba(61, 123, 255, 0.24);
    --code-bg:     #FBFAF8;
    --red:         #CF3F3F;
    --yellow:      #A87A06;
    --shadow:      0 20px 60px rgba(28, 28, 34, 0.10);
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: var(--font-read);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(1200px 600px at 12% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--lagune) 6%, transparent), transparent 60%),
        var(--bg);
}
body::before { display: none; }
::selection { background: var(--accent-glow); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 25%, transparent) transparent; }

/* ── Le point ───────────────────────────────────────────────── */
.pz-dot { display: inline-block; vertical-align: middle; overflow: visible; color: var(--accent); }
.pz-dot .pz-core { fill: currentColor; transform-box: fill-box; transform-origin: center; }
.pz-dot .pz-wave { fill: none; stroke: currentColor; stroke-width: 5; opacity: 0; transform-box: fill-box; transform-origin: center; }

.pz-avatar { display: inline-grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; }
.pz-avatar .pz-dot { filter: drop-shadow(0 0 6px var(--accent-glow)); }

/* Réflexion : des ondes se propagent depuis le point */
.is-thinking .pz-avatar .pz-wave { animation: pz-wave 1.8s ease-out infinite; animation-delay: var(--d); }
.is-thinking .pz-avatar .pz-core { animation: pz-core-think 1.8s ease-in-out infinite; }
/* Écriture : le point bat */
.is-writing .pz-avatar .pz-core { animation: pz-beat 0.9s ease-in-out infinite; }
/* Accueil : respiration + ondes lentes */
.pz-dot.is-breathing { filter: drop-shadow(0 0 20px var(--accent-glow)); }
.pz-dot.is-breathing .pz-core { animation: pz-breathe 4.5s ease-in-out infinite; }
.pz-dot.is-breathing .pz-wave { animation: pz-wave 4.5s ease-out infinite; animation-delay: calc(var(--d) * 2.5); }

@keyframes pz-wave { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes pz-core-think { 0%, 100% { transform: scale(0.85); } 50% { transform: scale(1); } }
@keyframes pz-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.78); } }
@keyframes pz-breathe { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.05); } }

/* Jauge : anneau de progression autour du point */
.pz-ring { display: block; overflow: visible; }
.pz-ring-track { fill: none; stroke: var(--border2); stroke-width: 9; }
.pz-ring-arc { fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.pz-ring-core { fill: currentColor; }
.pz-ring.is-ok { color: var(--accent); }
.pz-ring.is-low { color: var(--yellow); }
.pz-ring.is-empty { color: var(--red); }

/* ── En-tête ────────────────────────────────────────────────── */
header, body[data-theme="light"] header {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
}
#activeConvTitle { font-family: var(--font-brand); font-size: 14px; font-weight: 600; color: var(--text2); letter-spacing: 0; }
#themeToggle, .agent-badge, #terminalBtn, #liveAudioBtn, #moreBtn, #sidebarToggle {
    background: transparent !important; border: 1px solid var(--border) !important; border-radius: 999px !important;
    color: var(--text2) !important; height: 34px; font-family: var(--font-brand) !important; font-size: 12.5px !important; font-weight: 600;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
#themeToggle:hover, .agent-badge:hover, #terminalBtn:hover, #liveAudioBtn:hover, #moreBtn:hover, #sidebarToggle:hover,
body.pz-term-open #terminalBtn {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important; color: var(--accent) !important; transform: none;
}
.agent-selector-menu, #morePanel, #memoryPanel {
    background: var(--bg2) !important; border: 1px solid var(--border2) !important; border-radius: 18px !important; box-shadow: var(--shadow) !important;
}
.agent-btn { font-family: var(--font-brand); font-size: 13px; font-weight: 600; border-radius: 999px; display: flex; gap: 8px; align-items: center; }
.agent-btn.active { background: var(--accent-dim); color: var(--accent); }

/* ── Barre latérale ─────────────────────────────────────────── */
#sidebar { background: color-mix(in srgb, var(--bg2) 92%, transparent); border-right: 1px solid var(--border); }
/* Le point Labs : carré en grille 2×2 (4 cellules Signal, gouttière 2 px) */
.logo-dot, .login-logo-dot {
    width: 13px; height: 13px; border-radius: 0; box-shadow: none; animation: none;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 0 / calc(50% - 1px) calc(50% - 1px) no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 0 / calc(50% - 1px) calc(50% - 1px) no-repeat,
        linear-gradient(var(--accent), var(--accent)) 0 100% / calc(50% - 1px) calc(50% - 1px) no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 100% / calc(50% - 1px) calc(50% - 1px) no-repeat;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}
.login-logo-dot { width: 16px; height: 16px; }
/* « Pensée » en ExtraBold, « IA » comme un descripteur Labs (Regular, Signal) */
.logo-text h1, .login-logo-name { font-family: var(--font-brand); font-weight: 400; letter-spacing: -0.01em; color: var(--accent); }
.logo-text h1 em, .login-logo-name em { font-family: var(--font-brand); font-style: normal; font-weight: 800; color: var(--text); }
.creator-tag { font-family: var(--font-brand); font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; font-size: 8px; }
#newConvSideBtn {
    font-family: var(--font-brand); font-weight: 700; letter-spacing: 0.01em; border-radius: 999px;
    background: var(--accent-dim); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent);
}
#newConvSideBtn:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-color: var(--accent); }
.conv-section-label { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 9.5px; color: var(--text3); }
.conv-item { border-radius: 12px; position: relative; }
.conv-item-title { font-family: var(--font-read); font-size: 13.5px; }
.conv-item.active { background: var(--bg3); }
.conv-item.active::before {
    /* le point du logo marque la conversation active */
    content: ''; display: block; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
    background: var(--accent); border-radius: 0; box-shadow: 0 0 8px var(--accent-glow); transform: none; opacity: 1;
}
.conv-item.active .conv-item-title { padding-left: 24px; }

#logoutBtn { border-radius: 999px; font-family: var(--font-brand); font-weight: 600; }

/* ── Fil de conversation ────────────────────────────────────── */
#messages { padding: 12px max(16px, calc((100% - var(--column)) / 2)) 36px; gap: 30px; scroll-behavior: auto; }
.msg { max-width: 100%; animation: pz-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pz-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Message de l'utilisateur : une capsule */
.msg.user { max-width: 84%; }
.msg.user .msg-label { display: none; }
.user .bubble {
    background: var(--user-bg); border: 1px solid var(--user-border); border-radius: 22px;
    padding: 10px 18px; font-family: var(--font-read); font-size: 15px; line-height: 1.6;
}

/* Réponse de Pensée : le point + le fil de pensée */
.msg.bot { width: 100%; position: relative; padding-left: 32px; }
.msg.bot::before {
    content: ''; position: absolute; left: 9px; top: 30px; bottom: 4px; width: 1.5px; border-radius: 2px;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 45%, transparent), transparent 85%);
}
.msg.bot.is-writing::before, .msg.bot.is-thinking::before {
    background: linear-gradient(to bottom, var(--accent), var(--lagune), transparent);
    background-size: 100% 200%; animation: pz-thread 1.8s linear infinite;
}
@keyframes pz-thread { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
.msg.bot .msg-label {
    margin-left: -32px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
    font-family: var(--font-brand); text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 700; color: var(--text);
}
.pz-agent-tag {
    display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-brand); font-size: 11px; font-weight: 600;
    color: var(--accent); background: var(--accent-dim); border-radius: 999px; padding: 3px 10px 3px 8px;
}
.pz-agent-tag svg { width: 12px; height: 12px; }
.pz-pending {
    font-family: var(--font-brand); font-size: 13px; font-weight: 600; color: var(--text3);
    background: linear-gradient(90deg, var(--text3), var(--accent), var(--text3)); background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: pz-shimmer 2.2s linear infinite;
}
@keyframes pz-shimmer { to { background-position: -200% 0; } }

/* Lecture */
.bubble { font-family: var(--font-read); font-size: 15.5px; line-height: 1.75; }
.bot .bubble { background: transparent; border: none; padding: 0; border-radius: 0; }
.bot .bubble::before { display: none; }
.bot .bubble p { margin: 0 0 0.9em; }
.bot .bubble p:last-child { margin-bottom: 0; }
.bot .bubble h1, .bot .bubble h2, .bot .bubble h3 { font-family: var(--font-brand); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin: 1.4em 0 0.55em; }
.bot .bubble h1 { font-size: 1.45em; } .bot .bubble h2 { font-size: 1.22em; } .bot .bubble h3 { font-size: 1.05em; }
.bot .bubble h2::before {
    /* un carré devant les titres de section */
    content: ''; display: inline-block; width: 0.42em; height: 0.42em; margin-right: 10px; border-radius: 0;
    background: var(--accent); vertical-align: 0.12em;
}
.bot .bubble ul, .bot .bubble ol { padding-left: 1.4em; margin: 0.4em 0 1em; }
.bot .bubble li { margin: 0.3em 0; }
.bot .bubble li::marker { color: var(--accent); }
.bot .bubble blockquote { border-left: 2px solid var(--accent); padding: 2px 0 2px 16px; color: var(--text2); margin: 0.9em 0; font-family: var(--font-read); font-style: normal; font-weight: 500; font-size: 1.02em; }
.bot .bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bot .bubble hr { border: none; height: 1px; margin: 1.6em 0; background: linear-gradient(90deg, transparent, var(--border2), transparent); }
.bot .bubble table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 1em 0; font-size: 14px; display: block; overflow-x: auto; border: 1px solid var(--border2); border-radius: 14px; }
.bot .bubble th, .bot .bubble td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.bot .bubble th { background: var(--bg2); font-family: var(--font-brand); font-weight: 700; font-size: 12.5px; }
.bot .bubble tr:last-child td { border-bottom: none; }
.bubble :not(pre) > code { background: var(--accent-dim); color: var(--accent); border-radius: 6px; padding: 1px 6px; font-size: 0.86em; font-family: var(--font-mono); border: none; }
.bot .bubble strong { font-weight: 650; color: var(--text); }
.pz-streaming > :last-child::after, .pz-streaming:empty::after {
    content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: 0.05em;
    background: var(--accent); border-radius: 0; animation: pz-caret 1s ease-in-out infinite;
}
@keyframes pz-caret { 50% { opacity: 0.2; } }
.typing-bubble { background: transparent !important; border: none !important; }

/* Code */
.code-block-wrapper { border-radius: 16px; border: 1px solid var(--border2); background: var(--code-bg); margin: 14px 0; overflow: hidden; }
.code-header { background: color-mix(in srgb, var(--accent) 4%, transparent); padding: 7px 10px 7px 16px; border-bottom: 1px solid var(--border); }
.code-lang { font-family: var(--font-mono); text-transform: lowercase; letter-spacing: 0.02em; font-size: 11.5px; color: var(--accent); }
.run-btn, .pz-copy-code { font-family: var(--font-brand) !important; text-transform: none !important; font-size: 12px !important; font-weight: 600; border-radius: 999px !important; padding: 4px 12px !important; }
.bubble pre { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; padding: 14px 18px !important; }
body[data-theme="light"] .bubble pre { color: var(--text); }

/* Actions sous la réponse */
.msg-actions { gap: 4px; margin-top: 12px; opacity: 0.6; transition: opacity 0.2s; }
.msg.bot:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.copy-btn { font-family: var(--font-brand); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 11px; border: 1px solid transparent; background: transparent; color: var(--text2); }
.copy-btn:hover { border-color: var(--border2); color: var(--accent); }
@media (hover: none) { .msg-actions { opacity: 1; } }
.pz-pills { padding-left: 0; }
.pz-pill { font-family: var(--font-brand); font-weight: 600; border-radius: 999px; }
.pz-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Composants de l'agent ──────────────────────────────────── */
.pz-think { border-radius: 16px; background: transparent; border: 1px dashed color-mix(in srgb, var(--lagune) 40%, transparent); }
.pz-think-head { font-family: var(--font-brand); font-weight: 600; }
.pz-think-body { font-family: var(--font-read); font-style: normal; color: var(--text2); }
.pz-tool { border-radius: 16px; border: 1px solid var(--border2); background: var(--bg2); }
.pz-tool-head { font-family: var(--font-read); padding: 10px 14px; }
.pz-tool-label { font-family: var(--font-brand); font-weight: 700; }
.pz-tool-icon { color: var(--accent); }
.pz-tool[data-state="ok"] .pz-tool-status { color: var(--accent); }
.pz-tool-code, .pz-tool-log { font-family: var(--font-mono); }
.pz-sources-label { font-family: var(--font-mono); }
.pz-source-chip, .pz-trace-chip { border-radius: 999px; }
.pz-file-chip, .file-chip { border-radius: 999px !important; font-family: var(--font-brand) !important; }
.pz-preview { border-radius: 16px; }
.pz-note { font-family: var(--font-read); }

/* Plan vivant (outil update_plan) : cases carrées, comme le point Labs */
.pz-plan { border: 1px solid var(--border2); border-radius: 16px; background: var(--bg2); padding: 12px 16px 10px; margin: 6px 0 14px; }
.pz-plan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
    font-family: var(--font-brand); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text3); }
.pz-plan-count { color: var(--accent); letter-spacing: 0.05em; }
.pz-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pz-plan-list li { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-read); font-size: 13.5px; line-height: 1.45; color: var(--text2); }
.pz-plan-list li::before { content: ''; flex-shrink: 0; width: 9px; height: 9px; transform: translateY(1px); border: 1.5px solid var(--border2); }
.pz-plan-list li[data-status="done"] { color: var(--text3); text-decoration: line-through; text-decoration-color: var(--border2); }
.pz-plan-list li[data-status="done"]::before { background: var(--accent); border-color: var(--accent); }
.pz-plan-list li[data-status="in_progress"] { color: var(--text); font-weight: 600; }
.pz-plan-list li[data-status="in_progress"]::before { border-color: var(--accent); background: var(--accent-dim); animation: pz-caret 1.2s ease-in-out infinite; }
.pz-retry { margin-top: 8px; align-self: flex-start; width: auto; display: inline-flex; border: 1px solid var(--border2) !important; color: var(--accent) !important; }
.pz-retry:disabled { opacity: 0.5; cursor: default; }

/* ── Accueil ────────────────────────────────────────────────── */
#welcomeScreen { gap: 8px; padding-bottom: 8px; }
.welcome-logo { width: 64px; height: 64px; margin-bottom: 18px; }
.welcome-logo svg { fill: none; animation: none; filter: none; width: 64px; height: 64px; }
.welcome-question {
    font-family: var(--font-brand); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
    font-size: clamp(28px, 5vw, 42px); max-width: 640px; color: var(--text); background: none; -webkit-text-fill-color: currentColor;
}
.welcome-question em { font-family: var(--font-brand); font-style: normal; font-weight: 800; color: var(--accent); }
#welcomeSub { font-family: var(--font-read) !important; font-style: normal; font-weight: 400; font-size: 17px !important; letter-spacing: 0 !important; color: var(--text2) !important; margin-top: 2px !important; }
#suggestions { max-width: var(--column); width: 100%; margin: 0 auto; padding: 4px 16px 12px; justify-content: center; flex-wrap: wrap; gap: 8px; }
.suggestion {
    font-family: var(--font-brand) !important; font-weight: 600; font-size: 13px !important; border-radius: 999px !important;
    background: var(--bg2) !important; border: 1px solid var(--border) !important; color: var(--text2) !important;
    padding: 9px 16px 9px 14px !important; display: inline-flex; align-items: center; gap: 9px; transition: all 0.2s;
}
.suggestion::before { content: ''; width: 6px; height: 6px; border-radius: 0; background: var(--accent); flex-shrink: 0; }
.suggestion:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important; color: var(--text) !important; background: var(--accent-dim) !important; }

/* ── Zone de saisie : la grande capsule ─────────────────────── */
#inputArea, body[data-theme="light"] #inputArea { background: linear-gradient(to top, var(--bg) 65%, transparent); padding: 6px 16px 10px; }
#uploadPreview, .input-card { max-width: var(--column); margin-left: auto; margin-right: auto; }
.input-card {
    background: var(--bg2); border: 1px solid var(--border2); border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}
body[data-theme="light"] .input-card { background: #FFFFFF; box-shadow: 0 10px 40px rgba(15, 26, 22, 0.08); }
.input-card:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--border2)); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22), 0 0 0 4px var(--accent-dim); }
.input-text-row { padding: 16px 22px 4px; }
#userInput { font-family: var(--font-read); font-size: 15.5px; }
#userInput::placeholder { color: var(--text3); }
.input-actions-row { padding: 6px 10px 10px 14px; }
#uploadBtn, #micBtn { border: 1px solid var(--border) !important; background: transparent; color: var(--text2); border-radius: 999px; }
#uploadBtn:hover, #micBtn:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important; color: var(--accent); background: var(--accent-dim); }
#sendBtn { background: var(--accent); width: 38px; height: 38px; border-radius: 999px; }
#sendBtn svg { fill: #FFFFFF; }
#sendBtn:hover { background: var(--accent2); box-shadow: 0 6px 20px var(--accent-glow); transform: none; }
#sendBtn.hidden-action { background: var(--bg4); opacity: 1; }
#sendBtn.hidden-action svg { fill: var(--text3); }
#sendBtn.pz-stop { background: var(--red); }
#sendBtn.pz-stop svg { fill: #FFFFFF; }
.attached-chip { border-radius: 999px !important; font-family: var(--font-brand) !important; }
footer { border-top: none; background: transparent; font-family: var(--font-mono); letter-spacing: 0.04em; font-size: 10px; padding: 0 16px 10px; color: var(--text3); }
footer em { color: var(--text2); font-style: normal; font-weight: 600; }
footer { font-family: var(--font-brand); text-transform: uppercase; letter-spacing: 0.18em; font-size: 9px; }
.pz-endorse { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-weight: 700; }
.pz-endorse svg { width: 10px; height: 10px; }

/* ── Signature « par KWENI LABS » (À propos) ────────────────── */
.pz-labs-sign { display: flex; align-items: center; gap: 10px; }
.pz-labs-sign svg { width: 22px; height: 22px; flex-shrink: 0; }
.pz-labs-sign .pz-rule { width: 1px; align-self: stretch; background: var(--border2); }
.pz-labs-sign small { display: block; font-family: var(--font-brand); font-size: 7.5px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text3); }
.pz-labs-sign strong { display: block; font-family: var(--font-brand); font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; color: var(--text); }

/* ── Usage (comme Claude : discret, seulement quand il faut prévenir) ── */
#alertBanner.pz-usage-line {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    max-width: var(--column, 768px); width: 100%; margin: 0 auto 6px; padding: 6px 8px 6px 14px;
    background: transparent; border: none; border-radius: 999px;
    font-family: var(--font-read); font-size: 12.5px; letter-spacing: 0; text-align: left; color: var(--text2);
}
#alertBanner.pz-usage-line::before { content: ''; width: 6px; height: 6px; border-radius: 0; flex-shrink: 0; background: var(--yellow); }
#alertBanner.pz-usage-line.empty::before { background: var(--red); }
#alertBanner.pz-usage-line > span { flex: 1; min-width: 0; }
#alertBanner.pz-usage-line strong { color: var(--text); font-weight: 600; }
.pz-usage-more {
    background: none; border: 1px solid var(--border2); border-radius: 999px; color: var(--text2);
    font-family: var(--font-brand); font-size: 11.5px; font-weight: 600; padding: 3px 10px; cursor: pointer; flex-shrink: 0;
}
.pz-usage-more:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.pz-usage-panel {
    position: absolute; top: 52px; right: 8px; width: 300px; max-width: calc(100vw - 32px); z-index: 310;
    background: var(--bg2); border: 1px solid var(--border2); border-radius: 18px; box-shadow: var(--shadow); padding: 16px;
}
.pz-usage-panel[hidden] { display: none; }
.pz-usage-title { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 12px; }
.pz-usage-head { display: flex; align-items: center; gap: 14px; }
.pz-usage-big { font-family: var(--font-brand); font-size: 28px; font-weight: 700; line-height: 1; color: var(--text); }
.pz-usage-of { font-family: var(--font-read); font-size: 12.5px; color: var(--text2); margin-top: 4px; }
.pz-usage-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--font-read); font-size: 12.5px; color: var(--text2); }
.pz-usage-row strong { color: var(--text); font-weight: 600; }
.pz-usage-help { margin: 10px 0 0; font-family: var(--font-read); font-size: 11.5px; line-height: 1.5; color: var(--text3); }
#usageBtn .pz-ring { flex-shrink: 0; }

/* ── Connexion ──────────────────────────────────────────────── */
.login-card { border-radius: 28px; }
.login-logo-name { font-family: var(--font-brand); }
.login-input { font-family: var(--font-read); border-radius: 999px; padding-left: 18px; }
#loginBtn { font-family: var(--font-brand); border-radius: 999px; font-weight: 700; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 680px) {
    /* En-tête : icônes seules, le titre de la conversation garde la place */
    header { padding: 8px 10px; }
    .header-right { gap: 4px; }
    #themeToggle, .agent-badge, #terminalBtn, #liveAudioBtn, #moreBtn, #sidebarToggle {
        width: 34px; min-width: 34px; padding: 0 !important; justify-content: center;
    }
    #agentBadgeLabel, .pz-term-btn-label { display: none; }
    #liveAudioBtn { font-size: 0 !important; gap: 0 !important; }
    #liveAudioBtn span { width: 8px !important; height: 8px !important; }
    #activeConvTitle { font-size: 13.5px; text-align: left; padding: 0 6px; }
    #messages { padding: 8px 14px 24px; gap: 24px; }
    .msg.bot { padding-left: 26px; }
    .msg.bot .msg-label { margin-left: -26px; gap: 8px; }
    .msg.bot::before { left: 8px; }
    .bubble { font-size: 15px; }
    .msg.user { max-width: 90%; }
    #inputArea { padding: 4px 10px 8px; }
    .input-card { border-radius: 26px; }
    .welcome-question { font-size: clamp(26px, 8vw, 34px); }
    footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pz-dot *, .msg.bot::before, .pz-pending { animation: none !important; }
}
