/* ============================================================
   aminAi Studio — surcouche « Grok Voice » et abonnement
   Chargée après app.css et grok.css.
   ============================================================ */

/* ---------- Accès Build depuis le Studio ---------- */
.side .side-nav > a.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}
.side .side-nav > a.side-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side .side-nav > a.side-link:hover { background: var(--bg-hover); }
.side .side-nav > a.side-link .side-link-tag {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app.collapsed .side .side-nav > a.side-link {
  justify-content: center;
  padding: 10px 0;
}
.app.collapsed .side .side-nav > a.side-link span:not(.side-link-tag) { display: none; }
.app.collapsed .side .side-nav > a.side-link .side-link-tag { display: none; }

/* ============================================================
   VOIX — scène plein écran, orbe blanc, composer flottant
   ============================================================ */

/* Mode immersif : les cartes et la barre du haut disparaissent.
   Sur desktop, la barre latérale du Studio reste visible comme dans
   Chat et Imagine. Sur mobile, la scène prend toute la largeur. */
.app.voice-mode .tabbar,
.app.voice-mode #task-strip,
.app.voice-mode #upgrade-card,
.app.voice-mode #model-banner,
.app.voice-mode #workspace-top,
.app.voice-mode #pwa-install { display: none !important; }

@media (max-width: 960px) {
  .app.voice-mode { grid-template-columns: minmax(0, 1fr) !important; }
  .app.voice-mode > .stage { grid-column: 1 / -1 !important; }
  .app.voice-mode > .side { display: none !important; }
}

#voice-view {
  background: #050510;
  color: #fff;
  min-width: 0;
  overflow: hidden;
}

#voice-view .voice-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  gap: 0;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px calc(12px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background:
    radial-gradient(58vmax 50vmax at 50% 34%, rgba(90, 130, 255, 0.10), transparent 64%),
    radial-gradient(32vmax 32vmax at 50% 40%, rgba(255, 150, 60, 0.08), transparent 70%),
    #050510;
}
#voice-view .voice-stars {
  position: absolute;
  inset: -4%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  animation: am-star-drift 140s ease-in-out infinite alternate;
}
#voice-view .voice-stars span {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(200, 220, 255, 0.45);
  animation: am-star-twinkle var(--d, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* Barre supérieure minimale */
#voice-view .voice-top {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1040px;
  min-height: 44px;
  margin: 0 auto;
  font-size: 0;
  font-weight: 500;
}
#voice-view .voice-top .back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 0.18s ease, border-color 0.18s ease;
}
#voice-view .voice-top .back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
#voice-view .voice-top .back-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#voice-view .voice-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
#voice-view .voice-top-spacer {
  width: 40px;
  height: 40px;
  flex: none;
}

/* Orbe */
#voice-view .voice-hero {
  /* Orbe miniature : le centre de l'écran laisse la place au transcript. */
  --orb-size: clamp(120px, 20vmin, 190px);
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: 760px;
  /* L'orbe est en position absolue : le héros doit lui garder sa hauteur,
     sinon elle chevauche le transcript. */
  min-height: calc(var(--orb-size) + 60px);
  gap: 4px;
  margin: 0 auto;
  padding: 0 0 4px;
  overflow: visible;
}
#voice-view .orb {
  --sun-size: calc(var(--orb-size) * 0.27);
  --orbit-red: calc(var(--orb-size) * 0.23);
  --orbit-earth: calc(var(--orb-size) * 0.33);
  --orbit-blue: calc(var(--orb-size) * 0.40);
  --orbit-violet: calc(var(--orb-size) * 0.48);
  --orbit-red-time: 5.2s;
  --orbit-earth-time: 6s;
  --orbit-blue-time: 8.4s;
  --orbit-violet-time: 11.5s;
  --spec-color: rgba(228, 238, 255, 0.74);
  --spec-color-2: rgba(130, 170, 255, 0.26);
  --spec-glow: rgba(140, 180, 255, 0.30);
  --spec-radius: calc(var(--orb-size) * 0.165);
  --spec-len: calc(var(--orb-size) * 0.065);
  --orb-halo: rgba(170, 200, 255, 0.20);
  --orb-halo-soft: rgba(170, 200, 255, 0.055);
  --orb-tint: rgba(140, 180, 255, 0.13);
  --orb-tint-2: rgba(80, 110, 190, 0.09);
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--orb-size);
  height: var(--orb-size);
  margin: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
  transition: none;
  animation: none;
  -webkit-tap-highlight-color: transparent;
}
/* La taille vient du héros ; on neutralise les anciennes tailles de app.css/mobile.css. */
#voice-view .voice-hero .orb {
  --orb-size: inherit;
}
#voice-view .orb.listen,
#voice-view .orb.think,
#voice-view .orb.speak {
  animation: none;
}
#voice-view .orb::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-halo) 0%, var(--orb-halo-soft) 46%, transparent 72%);
  filter: blur(30px);
  animation: am-voice-aura 7s ease-in-out infinite;
  pointer-events: none;
}
/* Nébuleuse colorée : la phase vocale change la lumière du système. */
#voice-view .orb-glow {
  position: absolute;
  inset: -18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-halo) 0%, var(--orb-halo-soft) 48%, transparent 74%);
  filter: blur(36px);
  opacity: 0.42;
  transform: none;
  transition: opacity 0.6s ease, background 0.6s ease;
  pointer-events: none;
}
#voice-view .orb[data-voice-state="listening"] .orb-glow { opacity: 0.72; }
#voice-view .orb[data-voice-state="speaking"] .orb-glow { opacity: 0.78; }
#voice-view .orb[data-voice-state="processing"] .orb-glow { opacity: 0.65; }
#voice-view .orb.muted .orb-glow { opacity: 0.12; }
#voice-view .orb::after {
  content: "";
  position: absolute;
  inset: -2%;
  border-radius: 50%;
  border: 1px solid rgba(190, 215, 255, 0.10);
  opacity: 0.8;
  animation: none;
  pointer-events: none;
}
#voice-view .orb:hover .orb-sun { filter: brightness(1.05); }
#voice-view .orb:active .orb-sun { filter: brightness(0.96); }
/* Le système reste strictement centré au clic : pas de scale sur le conteneur. */
#voice-view .orb:hover,
#voice-view .orb:active {
  transform: translate(-50%, -50%);
}
#voice-view .orb:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 10px;
}
/* Soleil central */
#voice-view .orb-ball {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  width: var(--sun-size);
  height: var(--sun-size);
  z-index: 3;
  overflow: visible;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 28%,
    rgba(255, 251, 224, 0.95) 0%,
    rgba(255, 228, 138, 0.90) 18%,
    rgba(255, 194, 71, 0.84) 38%,
    rgba(255, 154, 31, 0.72) 62%,
    rgba(227, 90, 5, 0.58) 84%,
    rgba(90, 25, 0, 0.38) 100%
  );
  opacity: 0.86;
  box-shadow:
    0 0 14px rgba(255, 214, 120, 0.45),
    0 0 34px var(--spec-glow),
    0 0 64px var(--orb-halo),
    inset 0 0 14px rgba(255, 255, 255, 0.35),
    inset -6px -8px 20px rgba(105, 25, 0, 0.30);
  transform: translate(-50%, -50%);
  animation: am-sun-float 2s ease-in-out infinite;
  transition: box-shadow 0.6s ease, filter 0.25s ease;
}
#voice-view .orb-sun::before {
  content: "";
  position: absolute;
  inset: -46%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-halo) 0%, transparent 66%);
  filter: blur(16px);
  opacity: 0.45;
  animation: am-sun-halo 4.5s ease-in-out infinite;
  pointer-events: none;
}
#voice-view .orb-sun::after {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 10%,
    rgba(255, 255, 255, 0.28) 18%,
    transparent 30% 46%,
    rgba(255, 140, 0, 0.30) 56%,
    transparent 68% 82%,
    rgba(255, 255, 255, 0.15) 90%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: am-sun-spin 20s linear infinite;
  pointer-events: none;
}
#voice-view .orb-sun-surface {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 238, 170, 0.22) 40%, transparent 72%);
  mix-blend-mode: screen;
  animation: am-sun-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
/* Le système solaire reste centré : seuls les astres bougent. */
#voice-view .orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
/* Orbites et planètes */
#voice-view .orb-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: calc(var(--orbit-radius) * 2);
  height: calc(var(--orbit-radius) * 2);
  border: 1px solid rgba(200, 220, 255, 0.055);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: am-orbit var(--orbit-time) linear infinite;
  will-change: transform;
  pointer-events: none;
}
#voice-view .orb-orbit-red { --orbit-radius: var(--orbit-red); --orbit-time: var(--orbit-red-time); }
#voice-view .orb-orbit-earth { --orbit-radius: var(--orbit-earth); --orbit-time: var(--orbit-earth-time); }
#voice-view .orb-orbit-blue { --orbit-radius: var(--orbit-blue); --orbit-time: var(--orbit-blue-time); }
#voice-view .orb-orbit-violet { --orbit-radius: var(--orbit-violet); --orbit-time: var(--orbit-violet-time); }
#voice-view .orb-planet {
  position: absolute;
  left: 50%;
  top: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: am-orbit-counter var(--orbit-time) linear infinite;
  will-change: transform;
  pointer-events: none;
}
#voice-view .orb-planet-earth {
  width: calc(var(--orb-size) * 0.062);
  height: calc(var(--orb-size) * 0.062);
  background: radial-gradient(circle at 35% 30%, #eef7ff 0%, #9fc3e0 34%, #50799c 64%, #1d354e 100%);
  box-shadow: inset -3px -4px 7px rgba(0, 0, 0, 0.55), 0 0 10px rgba(130, 190, 255, 0.35);
}
#voice-view .orb-planet-red {
  width: calc(var(--orb-size) * 0.036);
  height: calc(var(--orb-size) * 0.036);
  background: radial-gradient(circle at 35% 30%, #ffd2b8 0%, #e57354 38%, #a53225 72%, #4a0f0a 100%);
  box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.55), 0 0 8px rgba(255, 120, 90, 0.30);
}
#voice-view .orb-planet-blue {
  width: calc(var(--orb-size) * 0.048);
  height: calc(var(--orb-size) * 0.048);
  background: radial-gradient(circle at 35% 30%, #e0f4ff 0%, #8cc9f2 34%, #3779ad 66%, #0b2a46 100%);
  box-shadow: inset -2px -3px 6px rgba(0, 0, 0, 0.50), 0 0 9px rgba(100, 180, 255, 0.32);
}
#voice-view .orb-planet-violet {
  width: calc(var(--orb-size) * 0.030);
  height: calc(var(--orb-size) * 0.030);
  background: radial-gradient(circle at 35% 30%, #f0ddff 0%, #c79df0 34%, #7b45b5 70%, #341154 100%);
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.50), 0 0 7px rgba(180, 120, 255, 0.32);
}
/* Anneau de la Terre, incliné et avec une ombre portée. */
#voice-view .planet-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
#voice-view .planet-ring::before,
#voice-view .planet-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 168%;
  height: 44%;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  pointer-events: none;
}
#voice-view .planet-ring::before {
  border: 2px solid rgba(205, 220, 255, 0.55);
  box-shadow: 0 0 6px rgba(170, 205, 255, 0.35);
}
#voice-view .planet-ring::after {
  border: 3px solid rgba(0, 0, 0, 0.35);
  filter: blur(2px);
  transform: translate(-50%, -42%) rotate(-18deg);
  z-index: -1;
}
#voice-view .orb-wave { display: none !important; }
#voice-view .orb-caption { display: none; }

/* ---------- Spectre vocal : couronne de rayons autour du soleil ---------- */
#voice-view .orb-spectrum {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
#voice-view .orb-spectrum span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(1.5px, calc(var(--orb-size) * 0.0065));
  height: calc(var(--spec-len) * var(--m, 1));
  margin-left: calc(var(--orb-size) * -0.00325);
  border-radius: 999px;
  background: linear-gradient(to top, transparent 0%, var(--spec-color-2) 26%, var(--spec-color) 100%);
  box-shadow: 0 0 calc(var(--orb-size) * 0.018) var(--spec-glow);
  opacity: 0.92;
  transform-origin: 50% 100%;
  transform: rotate(var(--a, 0deg)) translateY(calc(var(--spec-radius) * -1)) scaleY(var(--v, 0.1));
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

/* Couleur par phase : cyan à l'écoute, or à la réponse, violet en réflexion,
   ambre/rose quand Amina n'a pas compris, blanc bleuté en pause. */
#voice-view .orb[data-voice-state="listening"] {
  --spec-color: #c9f8ff;
  --spec-color-2: #1cc8f0;
  --spec-glow: rgba(45, 205, 255, 0.55);
  --orb-halo: rgba(70, 200, 255, 0.34);
  --orb-halo-soft: rgba(70, 200, 255, 0.09);
  --orb-tint: rgba(45, 200, 255, 0.27);
  --orb-tint-2: rgba(38, 90, 240, 0.22);
}
#voice-view .orb[data-voice-state="speaking"] {
  --spec-color: #ffe7b0;
  --spec-color-2: #f59e0b;
  --spec-glow: rgba(255, 175, 64, 0.62);
  --orb-halo: rgba(255, 190, 90, 0.36);
  --orb-halo-soft: rgba(255, 190, 90, 0.10);
  --orb-tint: rgba(255, 185, 80, 0.33);
  --orb-tint-2: rgba(255, 110, 40, 0.22);
}
#voice-view .orb[data-voice-state="processing"] {
  --spec-color: #ecd9ff;
  --spec-color-2: #8b5cf6;
  --spec-glow: rgba(160, 110, 255, 0.58);
  --orb-halo: rgba(170, 120, 255, 0.34);
  --orb-halo-soft: rgba(170, 120, 255, 0.09);
  --orb-tint: rgba(165, 115, 255, 0.30);
  --orb-tint-2: rgba(70, 60, 220, 0.22);
}
#voice-view .orb[data-voice-state="idle"] {
  --spec-color: rgba(255, 240, 200, 0.72);
  --spec-color-2: rgba(255, 170, 80, 0.24);
  --spec-glow: rgba(255, 180, 90, 0.30);
  --orb-halo: rgba(255, 190, 110, 0.20);
  --orb-halo-soft: rgba(255, 190, 110, 0.06);
  --orb-tint: rgba(255, 190, 110, 0.12);
  --orb-tint-2: rgba(255, 140, 60, 0.08);
}
#voice-view .orb.muted {
  --spec-color: rgba(205, 210, 220, 0.46);
  --spec-color-2: rgba(130, 140, 160, 0.16);
  --spec-glow: rgba(160, 170, 190, 0.16);
  --orb-halo: rgba(180, 190, 210, 0.12);
  --orb-halo-soft: rgba(180, 190, 210, 0.03);
  --orb-tint: rgba(150, 160, 180, 0.06);
  --orb-tint-2: transparent;
}

/* États : le système reste centré ; seuls le soleil et les rayons réagissent. */
#voice-view .orb.listen .orb-sun { animation-duration: 1.5s; }
#voice-view .orb.listen .orb-sun::after { animation-duration: 12s; }
#voice-view .orb.think .orb-sun { animation-duration: 1.2s; }
#voice-view .orb.think .orb-sun::after { animation-duration: 4.5s; }
#voice-view .orb.think .orb-orbit { border-color: rgba(190, 170, 255, 0.10); }
#voice-view .orb.speak .orb-sun { animation-duration: 1.25s; }
#voice-view .orb.speak .orb-sun::after { animation-duration: 5s; }
#voice-view .orb.speak .orb-sun-surface { animation-duration: 0.9s; }
#voice-view .orb.orb-speaking .orb-sun::after { animation-duration: 5s; }
#voice-view .orb.muted { filter: saturate(0.4) brightness(0.72); }

/* Amina n'a pas compris : halo rose et ondulation, sans déplacer le système. */
#voice-view .orb.unsure {
  --spec-color: #ffd9b0;
  --spec-color-2: #fb7185;
  --spec-glow: rgba(255, 130, 120, 0.62);
  --orb-halo: rgba(255, 130, 120, 0.38);
  --orb-halo-soft: rgba(255, 170, 100, 0.10);
  --orb-tint: rgba(255, 130, 110, 0.32);
  --orb-tint-2: rgba(255, 190, 90, 0.22);
  animation: none;
}
#voice-view .orb.unsure .orb-sun { filter: brightness(1.05) saturate(1.03); }
#voice-view .orb.unsure .orb-sun::before { opacity: 1; }
#voice-view .orb.unsure::after {
  inset: -6px;
  border: 2px solid rgba(255, 140, 120, 0.55);
  opacity: 1;
  animation: am-voice-ripple 1.15s ease-out infinite;
}
#voice-view .orb.unsure .orb-spectrum span { opacity: 1; }

/* Statut : discret, uniquement quand il y a un vrai message. */
#voice-view #voice-status {
  position: static;
  left: auto;
  top: auto;
  z-index: 3;
  transform: none;
  min-height: 0;
  max-width: min(46ch, 92%);
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  transition: color 0.4s ease;
}
#voice-view #voice-status:empty { display: none; }

/* Indicateurs STT / TTS : petits, discrets, dans l'univers des planètes. */
#voice-view .voice-io {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 24px;
  margin: 6px 0 0;
}
#voice-view .voice-io-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
  color: #8f97a6;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
#voice-view .voice-io-chip b {
  color: #e9e9e9;
  font-weight: 700;
  letter-spacing: 0.14em;
}
#voice-view .voice-io-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #6f7681;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}
#voice-view .voice-io-chip[data-state="listen"] {
  color: #b9f7d3;
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.07);
}
#voice-view .voice-io-chip[data-state="listen"] .voice-io-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
}
#voice-view .voice-io-chip[data-state="busy"] {
  color: #ffe3a8;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.07);
}
#voice-view .voice-io-chip[data-state="busy"] .voice-io-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.9);
  animation: am-voice-io-pulse 1s ease-in-out infinite;
}
#voice-view .voice-io-chip[data-state="speak"] {
  color: #c8dcff;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.09);
}
#voice-view .voice-io-chip[data-state="speak"] .voice-io-dot {
  background: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.95);
  animation: am-voice-io-pulse 0.85s ease-in-out infinite;
}
#voice-view .voice-io-chip[data-state="error"] {
  color: #ffb4ae;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}
#voice-view .voice-io-chip[data-state="error"] .voice-io-dot {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.9);
}
#voice-view .voice-io-chip[data-state="off"] { opacity: 0.5; }
@keyframes am-voice-io-pulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.35); opacity: 1; }
}
html[data-theme="light"] #voice-view .voice-io-chip {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #5b6472;
}
html[data-theme="light"] #voice-view .voice-io-chip b { color: #111; }

#voice-view .voice-permission {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--orb-size) * 0.54);
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  box-sizing: border-box;
  margin: 0;
  padding: 9px 10px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-elev-2) 94%, transparent);
  color: var(--text);
  font-family: inherit;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
#voice-view .voice-permission.hidden { display: none; }
#voice-view .voice-permission .vp-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #ffb06a;
  box-shadow: 0 0 10px rgba(255, 176, 106, 0.7);
}
#voice-view .voice-permission .vp-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
#voice-view .voice-permission strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
#voice-view .voice-permission span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
#voice-view .voice-permission button {
  flex: none;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.16s ease, transform 0.16s ease;
}
#voice-view .voice-permission button:hover { background: var(--bg-active); }
#voice-view .voice-permission button:active { transform: scale(0.97); }
#voice-view[data-voice-state="listening"] #voice-status { color: rgba(190, 240, 255, 0.62); }
#voice-view[data-voice-state="speaking"] #voice-status { color: rgba(255, 225, 170, 0.66); }
#voice-view[data-voice-state="processing"] #voice-status { color: rgba(225, 205, 255, 0.64); }
#voice-view.unsure #voice-status { color: rgba(255, 200, 180, 0.78); }

/* Le bouton d'autorisation micro n'est plus utilisé : le geste se fait sur l'orbe. */
#voice-view .voice-activation { display: none !important; }

/* On garde le DOM des leçons et du diagnostic pour le JS, sans les afficher.
   Le transcript, lui, est maintenant visible : c'est le fil de discussion. */
#voice-view .lecons-panel,
#voice-view #lecons-toggle,
#voice-view #stt-lang { display: none !important; }
#voice-view #voice-latency { display: block; margin-top: 1px; }

#voice-view #transcript {
  display: flex !important;
  flex: 1 1 auto;
  width: min(760px, calc(100% - 28px));
  height: auto;
  min-height: 170px;
  max-height: none;
  margin: 2px auto 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
  scroll-behavior: smooth;
}
#voice-view #transcript:empty { display: flex !important; }
#voice-view #transcript:empty::before {
  content: "La conversation s’affichera ici en temps réel.";
  display: block;
  width: 100%;
  margin: auto;
  color: rgba(255, 255, 255, 0.34);
  font-size: 12.5px;
  text-align: center;
}
html[data-theme="light"] #voice-view #transcript {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.025);
}
html[data-theme="light"] #voice-view #transcript:empty::before {
  color: rgba(15, 23, 42, 0.42);
}

/* Composer flottant */
#voice-view #voice-type.voice-composer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 0 0 auto;
  width: min(680px, calc(100% - 8px));
  max-height: none;
  margin: 0 auto;
  padding: 10px 10px 8px;
  gap: 2px;
  overflow: visible;
  background: rgba(22, 22, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
#voice-view #voice-type.voice-composer:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
}
#voice-view #voice-type.voice-composer textarea {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 132px;
  min-height: 26px;
  padding: 7px 10px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
}
#voice-view #voice-type.voice-composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}
#voice-view #voice-type.voice-composer .attachment-list { grid-column: 1 / -1; }
#voice-view #voice-type.voice-composer .voice-type-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  flex-wrap: nowrap;
}
#voice-view #voice-type.voice-composer .voice-scroll {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}
#voice-view #voice-type.voice-composer .composer-menu-wrap { flex: none; }
#voice-view #voice-type.voice-composer .plus-btn,
#voice-view #voice-type.voice-composer .voice-round {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
  flex: none;
  transition: background 0.16s ease, color 0.16s ease;
}
#voice-view #voice-type.voice-composer .plus-btn:hover,
#voice-view #voice-type.voice-composer .voice-round:hover {
  background: rgba(255, 255, 255, 0.1);
}
#voice-view #voice-type.voice-composer .voice-round svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#voice-view #voice-type.voice-composer .voice-round .mic-off-icon { display: none; }
#voice-view #voice-type.voice-composer .voice-round.muted {
  background: rgba(255, 92, 82, 0.16);
  color: #ff9b93;
}
#voice-view #voice-type.voice-composer .voice-round.muted .mic-on-icon { display: none; }
#voice-view #voice-type.voice-composer .voice-round.muted .mic-off-icon { display: block; }

#voice-view .voice-settings-wrap {
  position: relative;
  flex: none;
  margin-left: auto;
  min-width: 0;
}
#voice-view #voice-type .voice-settings-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0;
  font-weight: 500;
  transition: background 0.16s ease;
}
#voice-view #voice-type .voice-settings-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}
#voice-view #voice-type .voice-settings-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#voice-view #voice-type .voice-settings-toggle #voice-settings-label { display: none; }

#voice-view #voice-type.voice-composer #voice-send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  margin: 0 0 0 2px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  flex: none;
  transition: transform 0.16s ease, background 0.16s ease;
}
#voice-view #voice-type.voice-composer #voice-send:hover { background: #e8e8e8; }
#voice-view #voice-type.voice-composer #voice-send:active { transform: scale(0.94); }
#voice-view #voice-type.voice-composer #voice-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #000;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#voice-view .voice-settings-menu {
  background: #151515;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
}
#voice-view .composer-menu {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

#voice-view .voice-settings-menu .vs-model {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
#voice-view .voice-settings-menu .vs-model.hidden { display: none; }
#voice-view .voice-settings-menu .vs-model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#voice-view .voice-settings-menu .vs-model-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border: 1px solid rgba(142, 162, 196, 0.55);
  border-radius: 999px;
  color: #b9c8e0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#voice-view .voice-settings-menu .vs-model select {
  border-color: rgba(255, 255, 255, 0.18);
  background: #101010;
}
#voice-view .voice-settings-menu .vs-model-state {
  margin: 0;
  color: #b9c8e0;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#voice-view .voice-settings-menu .vs-model-note {
  margin: 0;
  color: #8f8f8f;
  font-size: 11px;
  line-height: 1.4;
}

#voice-view .voice-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes am-voice-aura {
  0%, 100% { opacity: 0.28; transform: scale(0.94); }
  50% { opacity: 0.62; transform: scale(1.06); }
}
@keyframes am-voice-ripple {
  0% { transform: scale(0.98); opacity: 0.75; }
  70% { transform: scale(1.17); opacity: 0; }
  100% { transform: scale(1.17); opacity: 0; }
}
@keyframes am-sun-float {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, calc(-50% - 3px)) scale(1.015); }
}
@keyframes am-sun-spin {
  to { transform: rotate(360deg); }
}
@keyframes am-sun-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.96); }
  50% { opacity: 0.68; transform: scale(1.04); }
}
@keyframes am-sun-halo {
  0%, 100% { opacity: 0.30; transform: scale(0.96); }
  50% { opacity: 0.62; transform: scale(1.06); }
}
@keyframes am-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes am-orbit-counter {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}
@keyframes am-star-twinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.25); }
}
@keyframes am-star-drift {
  from { transform: translate3d(-1.2%, -0.8%, 0); }
  to { transform: translate3d(1.2%, 0.8%, 0); }
}

/* ---------- Voix : téléphone ---------- */
@media (max-width: 960px) {
  #voice-view .voice-stage {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  #voice-view .voice-hero {
    gap: 10px;
    padding: 4px 0;
  }
  #voice-view .voice-hero { --orb-size: clamp(250px, 66vmin, 350px); }
  #voice-view #voice-type.voice-composer {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 8px 7px;
    border-radius: 24px;
  }
  #voice-view #voice-type.voice-composer textarea {
    max-height: 96px;
    padding: 6px 8px 4px;
  }
  #voice-view #voice-type.voice-composer .voice-type-bar { min-height: 38px; }
  #voice-view #voice-type.voice-composer .plus-btn,
  #voice-view #voice-type.voice-composer .voice-round,
  #voice-view #voice-type .voice-settings-toggle,
  #voice-view #voice-type.voice-composer #voice-send {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  #voice-view .voice-settings-menu {
    right: -2px;
    width: min(360px, calc(100vw - 26px));
    max-height: min(64dvh, 500px);
  }
}
@media (max-width: 380px) {
  #voice-view .voice-hero { --orb-size: clamp(225px, 64vmin, 300px); }
  #voice-view .voice-stage { padding-left: 7px; padding-right: 7px; }
  #voice-view #voice-type.voice-composer { padding: 7px 7px 6px; }
}
@media (max-height: 620px) and (orientation: landscape) {
  #voice-view .voice-hero { gap: 4px; }
  #voice-view .voice-hero { --orb-size: clamp(200px, 52vmin, 280px); }
  #voice-view .voice-top { min-height: 38px; }
  #voice-view .voice-top .back-btn { width: 34px; height: 34px; }
  #voice-view .voice-top-spacer { width: 34px; height: 34px; }
  #voice-view #voice-type.voice-composer textarea { max-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  #voice-view .orb,
  #voice-view .orb::before,
  #voice-view .orb::after,
  #voice-view .orb-core,
  #voice-view .orb-ball,
  #voice-view .orb-sun::before,
  #voice-view .orb-sun::after,
  #voice-view .orb-sun-surface,
  #voice-view .orb-orbit,
  #voice-view .orb-planet,
  #voice-view .voice-stars,
  #voice-view .voice-stars span { animation: none !important; }
  #voice-view .orb-orbit-red { transform: translate(-50%, -50%) rotate(35deg); }
  #voice-view .orb-orbit-earth { transform: translate(-50%, -50%) rotate(155deg); }
  #voice-view .orb-orbit-blue { transform: translate(-50%, -50%) rotate(245deg); }
  #voice-view .orb-orbit-violet { transform: translate(-50%, -50%) rotate(310deg); }
  #voice-view .orb-spectrum span { transition: none; }
  #voice-view .orb.unsure,
  #voice-view .orb.unsure::after { animation: none !important; }
}

/* ============================================================
   ABONNEMENT — noir et blanc, cartes premium
   ============================================================ */

#plans-view.plans {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: #000;
  color: #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
#plans-view.plans::-webkit-scrollbar { width: 8px; }
#plans-view.plans::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
#plans-view .plans-wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
#plans-view .plans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
}
#plans-view #plans-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
#plans-view #plans-back:hover { background: rgba(255, 255, 255, 0.12); }
#plans-view #plans-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#plans-view .plans-brand {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.035em;
}
#plans-view .plans-brand i {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.38);
  font-style: normal;
  font-weight: 500;
}
#plans-view .plans-head-spacer { width: 40px; height: 40px; }

#plans-view .plans-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 680px;
  margin: clamp(30px, 7vh, 72px) auto 0;
  text-align: center;
}
#plans-view .plans-mark { display: none; }
#plans-view .plans-kicker {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
#plans-view .plans-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 5.6vw, 62px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
#plans-view .plans-lede {
  max-width: 46ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.55;
  text-wrap: balance;
}

#plans-view .plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin-top: clamp(28px, 5vh, 48px);
}
#plans-view .plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background: linear-gradient(180deg, #151515 0%, #0b0b0b 100%);
  color: #fff;
  gap: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
#plans-view .plan-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}
#plans-view .plan-card.popular {
  border-color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #1c1c1c 0%, #0b0b0b 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 26px 70px rgba(255, 255, 255, 0.055);
}
#plans-view .plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}
#plans-view .plan-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
#plans-view .plan-card .badge {
  flex: none;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#plans-view .plan-card .blurb {
  min-height: 40px;
  margin: 9px 0 18px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13.5px;
  line-height: 1.5;
}
#plans-view .plan-card .price {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 4vw, 50px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.055em;
}
#plans-view .plan-card .price small {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
#plans-view .plan-card .plan-credits {
  margin: 9px 0 20px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 12.5px;
}
#plans-view .plan-card .choose {
  width: 100%;
  min-height: 46px;
  margin: 0 0 22px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
#plans-view .plan-card .choose:hover { background: #e7e7e7; }
#plans-view .plan-card .choose:active { transform: scale(0.985); }
#plans-view .plan-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  list-style: none;
}
#plans-view .plan-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.4;
}
#plans-view .plan-card li i {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
}
#plans-view .plan-card li i::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}
#plans-view .plans-note {
  max-width: none;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}
#plans-view .plans-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 12px;
}
#plans-view .plans-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
#plans-view .plans-trust svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#plans-view .plans-fine {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.26);
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  #plans-view .plan-grid { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
  #plans-view .plan-card .blurb { min-height: 0; }
  #plans-view .plans-hero { margin-top: 34px; }
}
@media (max-width: 520px) {
  #plans-view .plans-wrap { width: calc(100% - 24px); padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
  #plans-view .plans-hero { margin-top: 26px; gap: 11px; }
  #plans-view .plans-hero h2 { font-size: clamp(32px, 10vw, 44px); }
  #plans-view .plan-grid { gap: 12px; margin-top: 26px; }
  #plans-view .plan-card { padding: 22px 20px 20px; border-radius: 22px; }
  #plans-view .plan-card .price { font-size: 42px; }
  #plans-view .plans-trust { gap: 9px 16px; font-size: 11px; }
  #plans-view .plans-trust span:last-child { display: none; }
}

/* ============================================================
   INSTALLATION PWA
   ============================================================ */
.pwa-install {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  z-index: 80;
  width: min(440px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.62);
  color: #fff;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.pwa-install.hidden,
.pwa-install[hidden] { display: none !important; }
.pwa-install img {
  flex: none;
  border-radius: 11px;
}
.pwa-install-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.pwa-install-copy strong {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.pwa-install-copy span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-install-go {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.pwa-install-go:hover { background: #e8e8e8; }
.pwa-install-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pwa-install-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

#app-view[data-view="voice"] ~ #pwa-install,
#app-view[data-view="plans"] ~ #pwa-install { display: none !important; }

.pwa-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pwa-sheet.hidden,
.pwa-sheet[hidden] { display: none !important; }
.pwa-sheet-card {
  position: relative;
  width: min(390px, 100%);
  padding: 26px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: #141414;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.72);
  color: #fff;
  text-align: center;
}
.pwa-sheet-card img {
  border-radius: 14px;
}
.pwa-sheet-card h2 {
  margin: 12px 0 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.pwa-sheet-card ol {
  display: grid;
  gap: 9px;
  margin: 18px 0 22px;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.62);
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
}
.pwa-sheet-card ol strong { color: #fff; font-weight: 600; }
.pwa-sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.pwa-sheet-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.pwa-sheet-card .primary {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.pwa-sheet-card .primary:hover { background: #e8e8e8; }

@media (min-width: 961px) {
  .pwa-install { bottom: 18px; }
}

/* ============================================================
   CARTE D'ABONNEMENT — ne doit jamais passer devant la saisie
   ============================================================ */
#upgrade-card {
  background:
    radial-gradient(120px 80px at 20% 0%, rgba(255, 255, 255, 0.1), transparent 70%),
    #141414;
}
@media (min-width: 961px) {
  #upgrade-card { bottom: 180px; }
}
@media (max-width: 960px) {
  #upgrade-card { display: none !important; }
  /* La carte est masquée : on retire aussi les marges qui lui étaient réservées. */
  .app.show-upgrade #chat-view:not(.home) { padding-bottom: 0; }
  .app.show-upgrade .imagine.home { padding-bottom: 0; }
  .app.show-upgrade .imagine.feed .composer,
  .app.show-upgrade .imagine.viewing .composer { bottom: 12px; }
}
body:has(#composer:focus-within) #upgrade-card,
body:has(#voice-type:focus-within) #upgrade-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* Avertissements de configuration OAuth dans Connecteurs. */
.link-sheet .mod-warn {
  padding: 10px 12px;
  border: 1px solid rgba(255, 190, 110, 0.28);
  border-radius: 10px;
  background: rgba(255, 170, 60, 0.08);
  color: #f0c37c;
  font-size: 12.5px;
  line-height: 1.5;
}
html[data-theme="light"] .link-sheet .mod-warn {
  border-color: rgba(160, 100, 0, 0.25);
  background: #fff4e0;
  color: #7a4b00;
}
