/* ORBI — mascotte et discussion (toutes les pages) */
.orbi { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.orbi > * { pointer-events: auto; }
.showroom:not([hidden]) ~ .orbi, body.sr-open .orbi { display: none; }
.orbi-fab { width: 92px; height: 92px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; border-radius: 50%; -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 10px 18px rgba(101, 29, 50, .55)); }
.orbi.is-open .orbi-fab, .orbi.is-open .orbi-tip { display: none; }
.orbi-fab:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.orbi-big { width: 92px; height: 92px; display: block; }
.orbi-fallback { position: absolute; inset: 8px; background: url(../icons/orbi.png) center / contain no-repeat; animation: orbi-float 3.2s ease-in-out infinite; }
.orbi.has-3d .orbi-fallback { display: none; }
@keyframes orbi-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.orbi-tip { position: relative; margin: 0 8px -2px 0; white-space: nowrap; background: var(--paper); color: var(--ink); border: 1px solid var(--line); padding: 5px 10px; border-radius: 12px; font-size: 12px; line-height: 1.2; font-weight: 700; box-shadow: 0 6px 16px -10px rgba(0,0,0,.45); cursor: pointer; animation: orbi-pop .45s var(--ease) both; }
.orbi-tip::after { content: ""; position: absolute; right: 34px; bottom: -6px; width: 10px; height: 10px; background: inherit; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.orbi-tip[hidden] { display: none; }
@keyframes orbi-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
.orbi-panel { width: min(380px, calc(100vw - 20px)); max-height: min(620px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .55); animation: orbi-pop .35s var(--ease) both; }
.orbi-panel[hidden] { display: none; }
.orbi-ph { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 8px; border-bottom: 1px solid var(--line); background: var(--brass-soft); }
.orbi-mini { width: 56px; height: 56px; flex: none; }
.orbi-ph b { display: block; font-family: var(--f-display); font-size: 17px; }
.orbi-ph small { color: var(--mineral); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.orbi-ph small i { width: 7px; height: 7px; border-radius: 50%; background: #4fbf6a; display: inline-block; }
.orbi-x { margin-left: auto; width: 40px; height: 40px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; border-radius: 10px; }
.orbi-x:hover { background: var(--line); }
.orbi-msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.orbi-m { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; animation: orbi-pop .3s var(--ease) both; overflow-wrap: anywhere; }
.orbi-bot { background: var(--paper); border: 1px solid var(--line); border-top-left-radius: 4px; }
.orbi-me { justify-self: end; background: var(--accent); color: var(--accent-ink); border-top-right-radius: 4px; }
.orbi-cta { display: block; margin-top: 9px; padding: 10px 12px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); text-align: center; font-weight: 700; text-decoration: none; }
.orbi-typing { display: inline-flex; gap: 4px; width: auto; }
.orbi-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--mineral); animation: orbi-dot 1s infinite; }
.orbi-typing span:nth-child(2) { animation-delay: .15s; } .orbi-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes orbi-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.orbi-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.orbi-chips:not(.all) button[data-k]:nth-of-type(n+4) { display: none; }
.orbi-chips .orbi-more { border-style: dashed; }
.orbi-chips button { flex: none; border: 1.5px solid var(--brass); color: var(--brass); background: none; border-radius: 999px; padding: 6px 11px; min-height: 34px; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.orbi-chips button:active { transform: scale(.97); }
@media (hover: hover) { .orbi-chips button:hover { background: var(--brass-soft); } }
.orbi-in { flex: none; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px) * 0); border-top: 1px solid var(--line); }
.orbi-in input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); padding: 0 12px; font: inherit; font-size: 16px; }
.orbi-in button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 16px; cursor: pointer; }
@media (max-width: 560px) { .orbi-fab, .orbi-big { width: 84px; height: 84px; } .orbi-tip { margin-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .orbi-fallback, .orbi-tip, .orbi-panel, .orbi-m { animation: none; } }
/* Téléphone : la discussion s'ouvre en haut de l'écran, loin du badge et du clavier */
@media (max-width: 700px) {
  .orbi.is-open { top: calc(env(safe-area-inset-top, 0px) + 74px); bottom: auto; left: 10px; right: 10px; align-items: stretch; }
  .orbi.is-open .orbi-panel { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 74px - 100px); }
}

/* ORBI quitte l'écran hors de l'accueil ou quand le menu est ouvert, et revient par la droite */
.orbi { transition: transform .45s var(--ease), opacity .35s; }
.orbi.orbi-away { transform: translateX(calc(100% + 40px)) rotate(25deg); opacity: 0; pointer-events: none; }
.orbi.orbi-away > * { pointer-events: none; }
.orbi.orbi-in-anim { animation: orbi-enter 1.1s cubic-bezier(.2, .9, .25, 1.15) both; }
@keyframes orbi-enter {
  0% { transform: translateX(180px) rotate(200deg) scale(.6); opacity: 0; }
  55% { transform: translateX(-18px) rotate(-15deg) scale(1.08); opacity: 1; }
  75% { transform: translateX(6px) rotate(6deg) scale(.97); }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .orbi, .orbi.orbi-in-anim { transition: none; animation: none; } }
