/* @creme-tokens */
/* Discussion avec Poulpy, le guide d’Ocean Buddy (poulpy-assistant.js). Couleurs : jetons crème seulement.
   La feuille reste celle de l’app (ouverture, fermeture, glisser) ; ce fichier règle sa taille et tout son contenu :
   bulles, lignes de faits, cartes de spot avec photo, boutons d’action, suggestions, saisie. */

/* ---------- La feuille ---------- */
.ocean-v2 #chatSheet{background:var(--t-page);border:1px solid var(--t-line);border-radius:26px;overflow:hidden}
.ocean-v2 #chatSheet .chat-head{background:var(--t-deep);color:var(--t-on-main);padding:12px 12px 12px 14px;gap:12px;box-shadow:none}
.ocean-v2 #chatSheet .chat-head .av{width:46px;height:46px;flex:0 0 46px;border-radius:50%;background:color-mix(in srgb,var(--t-on-main) 14%,transparent)}
.ocean-v2 #chatSheet .chat-head .av svg{width:46px;height:46px}
.ocean-v2 #chatSheet .chat-head>div:nth-child(2){min-width:0;flex:1}
.ocean-v2 #chatSheet .chat-head h3{font-size:19px;line-height:1.1;letter-spacing:0;color:var(--t-on-main)}
.ocean-v2 #chatSheet #chatStatus{max-width:none;margin-top:2px;font-size:13px;line-height:1.3;font-weight:500;color:color-mix(in srgb,var(--t-on-main) 82%,transparent);opacity:1}
.ocean-v2 #chatSheet .chat-close,.ocean-v2 #chatSheet .poulpy-chat-reset{flex:0 0 44px;width:44px;height:44px;min-width:44px;margin:0;padding:0;display:grid;place-items:center;border:0;border-radius:50%;
  background:color-mix(in srgb,var(--t-on-main) 12%,transparent);color:var(--t-on-main);cursor:pointer;font-size:0}
.ocean-v2 #chatSheet .poulpy-chat-reset{margin-left:0}
/* Bouton « Urgence » : toujours dans l’en-tête, cible de 44 px, sans changer la hauteur de l’en-tête (avatar de 46 px). */
.ocean-v2 #chatSheet .poulpy-chat-sos{flex:0 0 auto;height:44px;min-width:44px;margin:0 0 0 auto;padding:0 13px 0 11px;display:inline-flex;align-items:center;gap:6px;border:0;border-radius:22px;
  background:var(--t-danger);color:var(--t-on-alert);font:750 13.5px/1 var(--body);letter-spacing:0;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ocean-v2 #chatSheet .poulpy-chat-sos svg{width:17px;height:17px;flex:0 0 17px}
.ocean-v2 #chatSheet .poulpy-chat-sos:active{transform:scale(.97)}
.ocean-v2 #chatSheet .chat-head h3,.ocean-v2 #chatSheet #chatStatus{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Feuille étroite : le bouton Urgence garde sa place sans changer la hauteur. La présentation (« Le guide d’Ocean Buddy ») n’est
   plus affichée mais reste lue par les lecteurs d’écran. Jusqu’à 430 px (tous les iPhone), le bouton perd son icône et se resserre :
   le nom « Poulpy » reste visible à partir de 380 px (iPhone de 390 à 430 px) ; en dessous, seul l’avatar reste, le nom est lu. */
@media(max-width:480px),(min-width:960px){
  .ocean-v2 #chatSheet #chatStatus{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(max-width:430px){
  .ocean-v2 #chatSheet .poulpy-chat-sos{padding:0 12px}
  .ocean-v2 #chatSheet .poulpy-chat-sos svg{display:none}
}
@media(max-width:379px){
  .ocean-v2 #chatSheet .chat-head>div:nth-child(2){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
.ocean-v2 #chatSheet .chat-close svg,.ocean-v2 #chatSheet .poulpy-chat-reset svg{width:20px;height:20px}
.ocean-v2 #chatSheet :is(.chat-close,.poulpy-chat-reset,.poulpy-chat-sos,.pc-sos-close,.pc-sos select,.qchip,.pc-act,.pc-card,.chat-input button):focus-visible{outline:3px solid var(--t-acc);outline-offset:2px}
.ocean-v2 #chatSheet .chat-msgs:focus-visible{outline:2px solid var(--t-bright);outline-offset:-2px}

/* ---------- Fiche « Urgence » : sous l’en-tête, par-dessus la discussion ---------- */
.ocean-v2 #chatSheet .pc-sos{position:absolute;z-index:6;left:10px;right:10px;top:calc(var(--pc-head,70px) + 8px);max-height:calc(100% - var(--pc-head,70px) - 18px);overflow:auto;overscroll-behavior:contain;
  padding:12px 14px 14px;border:1px solid var(--t-line);border-radius:18px;background:var(--t-card);color:var(--t-ink);box-shadow:0 14px 40px color-mix(in srgb,var(--t-shadow) 22%,transparent)}
.ocean-v2 #chatSheet .pc-sos[hidden]{display:none}
.ocean-v2 #chatSheet .pc-sos-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 4px}
.ocean-v2 #chatSheet .pc-sos-head h4{margin:0;font:800 18px/1.2 var(--body);color:var(--t-danger)}
.ocean-v2 #chatSheet .pc-sos-head h4:focus{outline:none}
.ocean-v2 #chatSheet .pc-sos-head h4:focus-visible{outline:3px solid var(--t-acc);outline-offset:2px;border-radius:4px}
.ocean-v2 #chatSheet .pc-sos-close{flex:0 0 44px;width:44px;height:44px;margin:-6px -8px -6px 0;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:var(--t-tint);color:var(--t-ink);cursor:pointer}
.ocean-v2 #chatSheet .pc-sos-close svg{width:18px;height:18px}
.ocean-v2 #chatSheet .pc-sos-body{display:grid;gap:8px;font-size:15px;line-height:1.45;font-weight:500}
.ocean-v2 #chatSheet .pc-sos-body p{margin:0}
.ocean-v2 #chatSheet .pc-sos-body b{color:var(--t-ink);font-weight:800}
.ocean-v2 #chatSheet .pc-sos-body .pc-facts{margin:0}
.ocean-v2 #chatSheet .pc-sos-small{font-size:13px;line-height:1.4;color:var(--t-ink2)}
.ocean-v2 #chatSheet .pc-sos .pc-actions{margin-top:2px}
.ocean-v2 #chatSheet .pc-sos-pick{display:grid;gap:4px;margin-top:2px}
.ocean-v2 #chatSheet .pc-sos-pick label{font-size:13px;font-weight:700;color:var(--t-ink2)}
.ocean-v2 #chatSheet .pc-sos select{width:100%;min-height:44px;padding:8px 12px;border:1.5px solid var(--t-line);border-radius:12px;background:var(--t-page);color:var(--t-ink);font:600 16px/1.2 var(--body)}

/* ---------- Les messages ---------- */
.ocean-v2 #chatSheet .chat-msgs{flex:1;min-height:120px;padding:16px 14px 10px;gap:14px;background:var(--t-page);overscroll-behavior:contain;scroll-padding:10px}
.ocean-v2 #chatSheet .msg{max-width:100%;gap:8px;animation:none}
.ocean-v2 #chatSheet .msg.user{max-width:86%}
.ocean-v2 #chatSheet .msg-av{width:32px;height:32px;flex:0 0 32px;align-self:flex-start;margin-top:2px;background:var(--t-deep);box-shadow:none;border-radius:50%}
.ocean-v2 #chatSheet .msg-av svg{width:32px;height:32px}
.ocean-v2 #chatSheet .pc-stack{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.ocean-v2 #chatSheet .bubble2{max-width:100%;padding:12px 14px;border:1px solid var(--t-line);border-radius:6px 18px 18px 18px;background:var(--t-card);color:var(--t-ink);
  font-size:15px;line-height:1.5;font-weight:500;box-shadow:none;overflow-wrap:anywhere}
.ocean-v2 #chatSheet .msg.user .bubble2{border:0;border-radius:18px 18px 6px 18px;background:var(--t-main);color:var(--t-on-main)}
.ocean-v2 #chatSheet .bubble2 p{margin:0}
.ocean-v2 #chatSheet .bubble2 p+p,.ocean-v2 #chatSheet .bubble2 ul+p{margin-top:8px}
.ocean-v2 #chatSheet .bubble2 b{color:var(--t-main);font-weight:750}
.ocean-v2 #chatSheet .pc-facts{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:0}
.ocean-v2 #chatSheet .pc-facts li{padding:8px 0;border-top:1px solid color-mix(in srgb,var(--t-line) 70%,transparent);font-size:14.5px;line-height:1.42}
.ocean-v2 #chatSheet .pc-facts li b{display:block;font-size:13px;line-height:1.3;color:var(--t-ink2);font-weight:700}
.ocean-v2 #chatSheet .pc-note{margin:2px 0 0;padding:1px 0 1px 10px;border-left:3px solid var(--t-acc);font-size:13px;line-height:1.4;color:var(--t-ink2)}

/* « Poulpy écrit… » */
.ocean-v2 #chatSheet .typing .bubble2{display:flex;align-items:center;gap:5px;padding:11px 14px}
.ocean-v2 #chatSheet .typing .bubble2 i{width:7px;height:7px;border-radius:50%;background:var(--t-bright);animation:pcDot 1s ease-in-out infinite}
.ocean-v2 #chatSheet .typing .bubble2 i:nth-child(2){animation-delay:.14s}
.ocean-v2 #chatSheet .typing .bubble2 i:nth-child(3){animation-delay:.28s}
.ocean-v2 #chatSheet .pc-typing{margin-left:6px;font-size:13px;color:var(--t-ink2)}
@keyframes pcDot{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}

/* Arrivée progressive d’une réponse */
.ocean-v2 #chatSheet .pc-in{animation:pcIn .24s cubic-bezier(.25,.8,.25,1) both}
@keyframes pcIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---------- Cartes de spot ---------- */
.ocean-v2 #chatSheet .pc-cards{width:100%;display:grid;gap:8px}
.ocean-v2 #chatSheet .pc-card{width:100%;min-height:88px;display:flex;align-items:center;gap:12px;padding:8px 12px 8px 8px;border:1px solid var(--t-line);border-radius:16px;background:var(--t-card);
  color:var(--t-ink);text-align:left;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ocean-v2 #chatSheet .pc-card:active{background:var(--t-tint)}
.ocean-v2 #chatSheet .pc-card-ph{flex:0 0 76px;width:76px;height:76px;border-radius:12px;overflow:hidden;background:var(--t-tint)}
.ocean-v2 #chatSheet .pc-card-ph img{width:100%;height:100%;display:block;object-fit:cover}
.ocean-v2 #chatSheet .pc-card-ph.is-empty{background:linear-gradient(160deg,var(--t-bright),var(--t-deep))}
.ocean-v2 #chatSheet .pc-card-tx{min-width:0;flex:1;display:grid;gap:2px}
.ocean-v2 #chatSheet .pc-card-tx b{font-size:15.5px;line-height:1.2;font-weight:750;color:var(--t-ink)}
.ocean-v2 #chatSheet .pc-card-tx small{font-size:13px;line-height:1.3;color:var(--t-ink2)}
.ocean-v2 #chatSheet .pc-card-tags{font-size:12.5px;line-height:1.3;color:var(--t-ink2)}
.ocean-v2 #chatSheet .pc-card-line{font-size:13px;line-height:1.3;font-weight:650;color:var(--t-main)}

/* ---------- Boutons d’action ---------- */
.ocean-v2 #chatSheet .pc-actions{display:flex;flex-wrap:wrap;gap:8px}
.ocean-v2 #chatSheet .pc-act{min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border:1px solid var(--t-main);border-radius:14px;background:transparent;color:var(--t-main);
  font:700 14px/1.2 var(--body);text-decoration:none;text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ocean-v2 #chatSheet .pc-act:first-child{border-color:var(--t-cta);background:var(--t-cta);color:var(--t-cta-ink)}
.ocean-v2 #chatSheet .pc-act.is-call{border-color:var(--t-danger);background:var(--t-danger);color:var(--t-on-alert)}
.ocean-v2 #chatSheet .pc-act.is-call2{border-color:var(--t-danger);background:transparent;color:var(--t-danger)}
.ocean-v2 #chatSheet .pc-act:active{transform:scale(.97)}
/* Bouton d’appel d’une réponse de sécurité, juste sous sa première phrase, dans la bulle : visible sans défiler (v19). */
.ocean-v2 #chatSheet .bubble2 .pc-call-early{margin:10px 0 2px}
.ocean-v2 #chatSheet .bubble2 .pc-call-early+p,.ocean-v2 #chatSheet .bubble2 .pc-call-early+ul{margin-top:10px}

/* ---------- Suggestions ---------- */
.ocean-v2 #chatSheet .chat-quick{flex:0 0 auto;display:flex;gap:8px;padding:8px 14px 10px;overflow-x:auto;background:var(--t-page);scrollbar-width:none}
.ocean-v2 #chatSheet .chat-quick[hidden]{display:none}
.ocean-v2 #chatSheet .chat-quick .qchip{flex:0 0 auto;min-height:42px;padding:10px 15px;border:1px solid var(--t-line);border-radius:21px;background:var(--t-card);color:var(--t-main);
  font:650 14px/1.2 var(--body);white-space:nowrap;box-shadow:none;cursor:pointer}
.ocean-v2 #chatSheet .chat-quick .qchip:active{background:var(--t-tint);transform:scale(.97)}

/* ---------- Confidentialité et saisie ---------- */
.ocean-v2 #chatSheet .poulpy-chat-privacy{margin:0;padding:8px 16px;border-top:1px solid var(--t-line);background:var(--t-page);color:var(--t-ink2);font-size:12px;line-height:1.4}
.ocean-v2 #chatSheet .chat-input{gap:8px;padding:8px 12px 12px;border-top:0;background:var(--t-page)}
.ocean-v2 #chatSheet .chat-input input{min-width:0;min-height:46px;padding:10px 16px;border:1.5px solid var(--t-line);border-radius:23px;background:var(--t-card);color:var(--t-ink);font-size:16px}
.ocean-v2 #chatSheet .chat-input input::placeholder{color:var(--t-ink2);opacity:1}
.ocean-v2 #chatSheet .chat-input input:focus{border-color:var(--t-bright);outline:none}
.ocean-v2 #chatSheet .chat-input button{flex:0 0 46px;width:46px;height:46px;min-height:46px;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:var(--t-cta);color:var(--t-cta-ink);box-shadow:none;cursor:pointer}
.ocean-v2 #chatSheet .chat-input button svg{width:20px;height:20px}

/* ---------- Téléphone : la feuille prend la hauteur disponible, au-dessus de la barre d’onglets ---------- */
@media(max-width:959px){
  .ocean-v2 #chatSheet .chat-head{gap:8px}
  .ocean-v2 #chatSheet{top:calc(env(safe-area-inset-top,0px) + 10px)!important;bottom:calc(var(--as-tab-h,62px) + var(--as-tab-bottom,14px) + 10px)!important;left:10px!important;right:10px!important;
    width:auto!important;height:auto!important;max-height:none!important;border-radius:26px!important}
}
@media(min-width:960px){
  .ocean-v2 #chatSheet{width:440px;height:min(720px,calc(100dvh - 130px))}
}
@media(prefers-reduced-motion:reduce){
  .ocean-v2 #chatSheet .pc-in,.ocean-v2 #chatSheet .typing .bubble2 i{animation:none}
}
.reduce-motion #chatSheet .pc-in,.reduce-motion #chatSheet .typing .bubble2 i{animation:none}
