/* Le studio en direct (studio.php) : fond nuit, scène du QG des agents. */
:root { --nuit: #0b1020; --texte: #eef0f7; --doux: #a9b3c7; --violet: #9a6cff; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--nuit); color: var(--texte); font: 15px/1.5 -apple-system, system-ui, sans-serif; }
a { color: #cbb7f4; }
:focus-visible { outline: 3px solid #8d53ff; outline-offset: 2px; }
[hidden] { display: none !important; }
.barre { display: flex; align-items: center; gap: 14px; padding: 12px max(16px, 3vw); border-bottom: 1px solid #1d2a48; flex-wrap: wrap; }
.barre img { height: 30px; width: auto; display: block; }
.barre .titre { font-weight: 700; }
.barre .compte { margin-left: auto; color: var(--doux); font-size: 13px; }
main { max-width: 1560px; margin: 0 auto; padding: 16px max(12px, 2.5vw) 32px; }
.note { color: var(--doux); font-size: 13px; max-width: 760px; margin: 14px auto 0; text-align: center; }
.pied { color: var(--doux); font-size: 13px; text-align: center; margin: 10px 0 0; }
.ferme { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b1020b8; pointer-events: none; }
.ferme p { background: #142038; border: 1px solid #2c3650; border-radius: 12px; padding: 12px 18px; margin: 0 16px; text-align: center; }
  .studio { background: var(--nuit); border-radius: 18px; overflow: hidden; border: 1px solid #24334c; box-shadow: 0 12px 35px #172a441c; }
  .studio-tete { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #f5f3ff; background: #142038; flex-wrap: wrap; }
  .studio-tete h1 { font-size: 17px; margin: 0; }
  .commandes { margin-left: auto; display: flex; gap: 6px; align-items: center; }
  .commandes button { border: 1px solid #5d6580; background: #243149; color: #fff; border-radius: 8px; padding: 4px 11px; min-height: 32px; }
  .commandes button:hover { background: #2f3d5a; }
  .commandes output { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; color: #dfe4f0; font-size: 13px; }
  .vue { position: relative; overflow: hidden; height: min(80vh, max(380px, 46vw)); min-height: 380px; touch-action: none; cursor: grab; background: var(--nuit); }
  .vue.glisse { cursor: grabbing; }
  #c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  #monde { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
  #calque { position: absolute; inset: 0; pointer-events: none; }
  /* enseigne : logo d'origine sur une surface ivoire, sans déformation */
  .enseigne { position: absolute; background: #fffaf1; border: 1px solid #e3d3b8; border-radius: 3px; padding: 4px 6px; box-shadow: 0 2px 0 #00000022; }
  .enseigne img { display: block; width: 100%; height: auto; }
  /* grand écran mural (aligné sur le mur droit) */
  .ecran { position: absolute; background: #151c48; border: 2px solid #7738ed; border-radius: 2px; color: #eee9ff;
           display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 4px 8px; text-align: center; pointer-events: auto; cursor: pointer; font: 600 7px/1.25 -apple-system, system-ui, sans-serif; }
  .ecran:hover { border-color: #cbb7f4; }
  .ecran .e-legende { font-size: 7px; letter-spacing: .6px; color: #cbb7f4; text-transform: uppercase; }
  .ecran .e-version { font-size: 17px; font-weight: 800; letter-spacing: .2px; }
  .ecran .e-barre { width: 84%; height: 6px; border-radius: 2px; background: #2b3470; overflow: hidden; border: .5px solid #5c4bb0; }
  .ecran .e-barre i { display: block; height: 100%; background: #9a6cff; }
  .ecran .e-barre.vide { background: repeating-linear-gradient(90deg, #2b3470 0 3px, #222a5c 3px 6px); }
  .ecran .e-note { font-size: 6.5px; color: #d8d2f2; }
  /* bandeaux nom + fonction : taille CSS stable, au-dessus de la tête */
  /* bandeau compact sur deux lignes : nom (et état), puis fonction en plus petit */
  .bandeau { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: flex-start; pointer-events: auto; white-space: nowrap; max-width: 116px;
             background: #fff8ec; color: #152a46; border: 1px solid #d4c1a1; border-left: 3px solid var(--accent, #7738ed); border-radius: 4px;
             font: 10px/1.15 -apple-system, system-ui, sans-serif; padding: 1px 4px 1px 3px; box-shadow: 0 1px 3px #10203f40; z-index: 1; text-align: left; }
  .bandeau .l1 { display: flex; align-items: center; gap: 3px; max-width: 100%; }
  .bandeau b { font-weight: 700; letter-spacing: .1px; overflow: hidden; text-overflow: ellipsis; }
  .bandeau .fn { display: block; max-width: 100%; color: #4f5a6b; font-size: 8.5px; overflow: hidden; text-overflow: ellipsis; }
  .bandeau .et { font-size: 7px; color: #2f7d5b; }
  .bandeau .et.repos { color: #8a8f99; }
  .bandeau.attend { background: #ffe2c2; border-color: #e89a52; z-index: 2; }
  .bandeau.attend .et { color: #a94b08; font-size: 9px; }
  .bandeau.discret { opacity: .9; }
  .bandeau.appel { background: #efe6fc; border-color: #9a6cff; z-index: 3; opacity: 1; }
  .bandeau.appel .et { color: #5a22c0; font-size: 9px; }
  .bandeau[aria-pressed="true"] { outline: 2px solid #ae7efc; outline-offset: 1px; z-index: 4; }
  .bandeau:hover { z-index: 5; }
  .lien { position: absolute; width: 1px; background: #fff8ecaa; pointer-events: none; }
  /* bulle de conversation : une seule ouverte, texte jamais réduit */
  .bulle { position: absolute; width: min(330px, calc(100% - 24px)); max-height: 280px; overflow: auto; background: #fffdf8; color: #182941; border: 1px solid #cbb7ee;
           border-radius: 12px; box-shadow: 0 10px 40px #060f3550; padding: 10px 12px 12px; pointer-events: auto; z-index: 8; font-size: 14px; line-height: 1.5; }
  .bulle.dock { left: 10px !important; right: 10px; bottom: 10px; top: auto !important; width: auto; max-height: 45%; }
  .bulle .b-tete { display: flex; gap: 8px; align-items: baseline; padding-right: 26px; }
  .bulle .b-tete strong { font-size: 13px; }
  .bulle .b-tete small { color: #6a7384; font-size: 12px; }
  .bulle .type { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eee6fa; color: #573296; margin: 4px 0 0; }
  .bulle p { margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .bulle .actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .bulle .actions button { background: #eee6fa; color: #4b278a; border: 0; border-radius: 7px; padding: 5px 10px; }
  .bulle .fermer { position: absolute; right: 6px; top: 4px; background: none; border: 0; font-size: 20px; line-height: 1; padding: 2px 6px; color: #5d6879; }
  .bulle.auto { width: min(260px, calc(100% - 24px)); }
  .bulle.auto p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.studio { background: var(--nuit); border-color: #1d2a48; }
.studio-tete h1 { font-size: 16px; }
.ecran { cursor: default; }
.bulle .type { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eee6fa; color: #573296; }
/* Fiche d'un agent : libellés fixes, jamais de texte reçu */
.fiche { position: absolute; top: 10px; right: 10px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; z-index: 10; background: #fffdf8; color: #182941; border: 1px solid #cbb7ee; border-radius: 12px; box-shadow: 0 14px 40px #060f3560; padding: 14px 16px; cursor: auto; touch-action: auto; font-size: 14px; line-height: 1.45; }
.fiche h2 { font-size: 18px; margin: 0; padding-right: 64px; }
.fiche h2:focus { outline: none; }
.fiche-fn { margin: 0 0 6px; color: #5d6879; }
.fiche-pres { margin: 0 0 10px; }
.fiche-fermer { position: absolute; top: 10px; right: 10px; background: #eee6fa; color: #4b278a; border: 0; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.fiche dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0 0 10px; }
.fiche dt { color: #5d6879; }
.fiche dd { margin: 0; font-weight: 600; }
.fiche h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #5d6879; margin: 8px 0 4px; }
.fiche ul { list-style: none; padding: 0; margin: 0; }
.fiche li { padding: 5px 0; border-top: 1px solid #eee6fa; display: flex; flex-direction: column; }
.fiche-meta { color: #5d6879; font-size: 12px; }
.fiche-note { color: #5d6879; font-size: 12px; margin: 8px 0 0; }
@media (max-width: 720px) {
  .fiche { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 70vh; border-radius: 14px 14px 0 0; z-index: 50; }
}
@media (max-width: 720px) {
  .barre { padding: 10px 14px; gap: 10px; }
  .barre img { height: 26px; }
  main { padding: 12px 10px 24px; }
  .vue { height: 50vh; min-height: 330px; }
  .commandes { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
