:root{--navy:#0c1c39;--accent:#0ea5e9;--bg:#0b1220;--ink:#e7eef7}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--ink)}
.v-center{min-height:100dvh;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.8rem;padding:1.5rem;text-align:center}
.v-center h1{margin:0;font-size:1.5rem}
#code{font-size:2rem;letter-spacing:.5rem;text-align:center;width:9rem;padding:.6rem;border-radius:12px;border:1px solid #33415a;background:#0f1a2e;color:var(--ink)}
label[for=code]{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#8aa0bd}
button{font:inherit;border:0;border-radius:12px;padding:.8rem 1.2rem;background:var(--accent);color:#04121f;font-weight:800;cursor:pointer}
.v-err{color:#fca5a5;font-size:.9rem}
#call{position:fixed;inset:0;background:#000}
#remote{width:100%;height:100%;object-fit:cover}
.v-pip{position:absolute;top:12px;right:12px;width:28vw;max-width:140px;border-radius:12px;border:2px solid #ffffff55;object-fit:cover}
.v-controls{position:fixed;left:0;right:0;bottom:calc(16px + env(safe-area-inset-bottom));display:flex;gap:1rem;justify-content:center}
.v-controls button{width:56px;height:56px;border-radius:50%;background:#ffffff22;color:#fff;font-size:1.3rem;padding:0;backdrop-filter:blur(6px)}
.v-controls .on{background:var(--accent);color:#04121f}
.v-controls .off{background:#ef444488}
.v-controls .v-hang{background:#ef4444}

/* ── Console technicien ───────────────────────────────────────────────── */
.visio-console select,.visio-console #client{font:inherit;padding:.7rem;border-radius:12px;border:1px solid #33415a;background:#0f1a2e;color:var(--ink);min-width:min(90vw,340px)}
.v-ac{position:relative;min-width:min(90vw,340px)}
.v-aclist{position:absolute;left:0;right:0;top:calc(100% + 4px);background:#0f1a2e;border:1px solid #33415a;border-radius:12px;overflow:hidden;z-index:5;text-align:left}
.v-aclist button{display:block;width:100%;text-align:left;background:transparent;color:var(--ink);border-radius:0;padding:.6rem .8rem;font-weight:500}
.v-aclist button:hover{background:#1e2b45}
.v-chip{font-size:.85rem;color:#8aa0bd}
.v-code{font-size:2.4rem;font-weight:900;letter-spacing:.4rem;color:var(--accent)}
.v-shot{background:#fff;color:#000;font-size:1.6rem}
.v-shots{position:fixed;left:8px;bottom:calc(84px + env(safe-area-inset-bottom));display:flex;gap:6px}
.v-shots img{width:54px;height:54px;object-fit:cover;border-radius:8px;border:2px solid #fff}
#catmodal{position:fixed;inset:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:10}
/* display:flex ci-dessus écrase l'attribut hidden → sans ce rappel, le calque reste sur TOUS les boutons. */
#catmodal[hidden]{display:none}
.v-modal{background:#0f1a2e;padding:1.2rem;border-radius:16px;display:flex;flex-direction:column;gap:.5rem;min-width:240px}
.v-modal button{background:#1e2b45;color:var(--ink)}
.v-modal .v-cancel{background:transparent;color:#8aa0bd}
.v-note{position:fixed;top:16px;left:50%;transform:translateX(-50%);background:#0f1a2e;padding:.6rem 1rem;border-radius:10px;z-index:20}

/* ── Disposition des flux selon le rôle ───────────────────────────────────── */
/* CLIENT : sa caméra arrière EN GRAND ; l'audio du support passe par #remote (masqué, sans vidéo). */
.visio-client #local{position:absolute;inset:0;width:100%;height:100%;max-width:none;border:0;border-radius:0;object-fit:cover}
.visio-client #remote{display:none}
/* SUPPORT : pas de caméra technicien → sa vignette locale est masquée ; il voit le client en grand (#remote). */
.visio-console #local{display:none}

/* ── Chat basique (texte + photos), commun client/support ─────────────────── */
.ch-panel{position:fixed;right:8px;left:auto;bottom:calc(84px + env(safe-area-inset-bottom));width:min(92vw,320px);display:flex;flex-direction:column;background:#0f1a2e;border:1px solid #33415a;border-radius:12px;z-index:30;box-shadow:0 8px 30px #0007;overflow:hidden}
/* Idem #catmodal : le display:flex écrase hidden → le panneau resterait ouvert en permanence. */
.ch-panel[hidden]{display:none}
.ch-head{display:flex;justify-content:space-between;align-items:center;padding:.35rem .6rem;border-bottom:1px solid #33415a;font-weight:800;font-size:.78rem}
.ch-close{background:transparent;color:#8aa0bd;font-size:.9rem;padding:.1rem .4rem;border:0;cursor:pointer}
.ch-msgs{overflow-y:auto;max-height:34vh;padding:.5rem;display:flex;flex-direction:column;gap:.3rem}
.ch-empty{padding:.5rem;text-align:center;color:#5b6b84;font-size:.78rem}
.ch-msg{max-width:82%;padding:.35rem .55rem;border-radius:10px;background:#1e2b45;color:var(--ink);font-size:.83rem;line-height:1.3;align-self:flex-start;word-break:break-word}
.ch-msg.me{align-self:flex-end;background:var(--accent);color:#04121f}
.ch-msg img{display:block;max-width:150px;border-radius:6px;cursor:pointer}
.ch-bar{display:flex;gap:.4rem;padding:.45rem;border-top:1px solid #33415a;align-items:center}
.ch-photo{cursor:pointer;font-size:1.2rem;line-height:1}
.ch-text{flex:1;min-width:0;font:inherit;font-size:.85rem;padding:.4rem .7rem;border-radius:999px;border:1px solid #33415a;background:#0b1220;color:var(--ink);outline:none}
.ch-text:focus{border-color:var(--accent)}
.ch-send{background:var(--accent);color:#04121f;border:0;border-radius:999px;width:34px;height:34px;font-weight:900;padding:0;cursor:pointer;flex:none}
/* pastille « non lu » sur le bouton chat */
.v-controls .has-unread{position:relative}
.v-controls .has-unread::after{content:'';position:absolute;top:8px;right:8px;width:10px;height:10px;border-radius:50%;background:#ef4444;border:2px solid #04121f}

/* ── Éditeur d'annotation d'image (plein écran) ───────────────────────────── */
.an-ov{position:fixed;inset:0;z-index:60;background:#05070d;display:flex;flex-direction:column}
.an-bar{display:flex;align-items:center;gap:.4rem;padding:.5rem;background:#0f1a2e;border-bottom:1px solid #33415a;flex-wrap:wrap}
.an-t,.an-undo{width:38px;height:38px;border:1px solid #33415a;background:#1e2b45;color:#e7eef7;border-radius:9px;font-size:1rem;cursor:pointer;flex:none;display:inline-flex;align-items:center;justify-content:center;line-height:1;padding:0}
.an-t.on{background:var(--accent);color:#04121f;border-color:var(--accent)}
.an-colors{display:flex;gap:.3rem;margin:0 .3rem}
.an-c{width:24px;height:24px;border-radius:50%;border:2px solid #ffffff55;cursor:pointer;padding:0}
.an-c.on{border-color:#fff;box-shadow:0 0 0 2px var(--accent)}
.an-sp{flex:1 1 auto}
.an-cancel,.an-ok{font:inherit;font-weight:800;border:0;border-radius:9px;padding:.5rem .9rem;cursor:pointer}
.an-cancel{background:transparent;color:#8aa0bd}
.an-ok{background:var(--accent);color:#04121f}
.an-stage{flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:.5rem;touch-action:none}
.an-cv{max-width:100%;max-height:100%;touch-action:none;cursor:crosshair;background:#000;border-radius:6px}
