:root {
  --cream: #f6efe3;
  --cream-2: #efe5d4;
  --paper: #fffaf2;
  --ink: #2d2620;
  --ink-soft: #6b6055;
  --terracotta: #c8674a;
  --terracotta-deep: #a84e35;
  --sage: #7f9472;
  --sage-deep: #5f7553;
  --gold: #d9a441;
  --line: #e3d7c4;
  --shadow: 28px 28px 60px rgba(90, 70, 50, 0.16);
  --radius: 26px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 12% 0%, #fbf4e8 0%, transparent 55%),
    radial-gradient(120% 100% at 100% 8%, #f4e6d0 0%, transparent 50%),
    radial-gradient(140% 120% at 85% 100%, #efe7da 0%, transparent 55%),
    var(--cream);
  overflow-x: hidden;
}

/* grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 50%; color: var(--terracotta);
  background: var(--paper); box-shadow: 0 6px 18px rgba(160, 90, 60, 0.18);
}
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 27px;
  letter-spacing: 0.5px; font-optical-sizing: auto;
}
.topbar-meta { display: flex; align-items: center; gap: 22px; text-align: right; }
.today { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); font-size: 19px; }
.status {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--paper); padding: 9px 16px; border-radius: 999px;
  font-weight: 500; font-size: 15px; color: var(--sage-deep);
  border: 1px solid var(--line);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 rgba(127, 148, 114, 0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(127,148,114,.5);} 70%{box-shadow:0 0 0 9px rgba(127,148,114,0);} 100%{box-shadow:0 0 0 0 rgba(127,148,114,0);} }

/* ---------- Layout ---------- */
.page {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto;
  padding: 6px clamp(16px, 3vw, 48px) 40px;
  display: flex; flex-direction: column; gap: clamp(16px, 2.4vw, 30px);
}
.stage {
  display: grid; grid-template-columns: 1.35fr 1fr;
  gap: clamp(16px, 2.4vw, 32px); align-items: stretch;
}
.grid {
  display: grid; grid-template-columns: 1.55fr 1fr;
  gap: clamp(16px, 2.4vw, 32px); align-items: start;
}

/* ---------- Companion ---------- */
.companion {
  background: linear-gradient(160deg, var(--paper), var(--cream-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 2.6vw, 38px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: 440px;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.orb-wrap { padding: 14px 0 6px; }
.orb {
  position: relative; width: 184px; height: 184px; display: grid; place-items: center;
}
.orb-core {
  width: 120px; height: 120px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f6c9a0, var(--terracotta) 55%, var(--terracotta-deep) 100%);
  box-shadow: inset -8px -10px 26px rgba(120,50,30,.45), 0 14px 34px rgba(180,90,60,.35);
  transition: transform .4s ease;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{transform:scale(1);} 50%{transform:scale(1.05);} }
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(200, 103, 74, 0.35);
  opacity: 0;
}
.orb-ring--2 { inset: -22px; border-color: rgba(127,148,114,.3); }

/* states */
.orb[data-state="listening"] .orb-core { background: radial-gradient(circle at 35% 30%, #cfe0c0, var(--sage) 55%, var(--sage-deep) 100%); animation: breathe 1.4s ease-in-out infinite; }
.orb[data-state="listening"] .orb-ring,
.orb[data-state="speaking"] .orb-ring { animation: ripple 1.8s ease-out infinite; }
.orb[data-state="listening"] .orb-ring--2,
.orb[data-state="speaking"] .orb-ring--2 { animation: ripple 1.8s .6s ease-out infinite; }
.orb[data-state="speaking"] .orb-core { animation: breathe 0.9s ease-in-out infinite; }
.orb[data-state="thinking"] .orb-core { animation: spin 1.1s linear infinite, breathe 5s ease-in-out infinite; background: radial-gradient(circle at 35% 30%, #f3d9a8, var(--gold) 60%, #b9842b 100%); }
@keyframes ripple { 0%{ transform: scale(.85); opacity:.8;} 100%{ transform: scale(1.35); opacity:0;} }
@keyframes spin { to { transform: rotate(360deg); } }

.speaker-state {
  font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 500; line-height: 1.35; margin: 18px 0 6px; max-width: 30ch; color: var(--ink);
}

.transcript {
  width: 100%; max-width: 560px; margin: 10px auto 6px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 230px; overflow-y: auto; padding: 4px;
}
.transcript:empty { display: none; }
.bubble {
  padding: 13px 18px; border-radius: 18px; font-size: 18px; line-height: 1.5;
  max-width: 88%; animation: pop .35s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98);} to{opacity:1;transform:none;} }
.bubble.user { align-self: flex-end; background: var(--ink); color: #fdf6ea; border-bottom-right-radius: 6px; }
.bubble.egeria { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }

/* ---------- Controls ---------- */
.controls { display: flex; align-items: center; gap: 14px; margin: 20px 0 6px; }
.mic {
  display: inline-flex; align-items: center; gap: 12px;
  background: linear-gradient(160deg, var(--terracotta), var(--terracotta-deep));
  color: #fff6ee; border: none; cursor: pointer;
  padding: 18px 34px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: 21px;
  box-shadow: 0 12px 26px rgba(168, 78, 53, 0.35);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.mic:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(168,78,53,.42); }
.mic:active { transform: translateY(0) scale(.98); }
.mic[data-active="true"] { background: linear-gradient(160deg, var(--sage), var(--sage-deep)); box-shadow: 0 0 0 6px rgba(127,148,114,.25), 0 12px 26px rgba(95,117,83,.4); }
.mic[data-active="true"] .mic-label::after { content: "…"; }

.ghost-btn {
  background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft);
  padding: 14px 22px; border-radius: 999px; cursor: pointer; font-size: 16px; font-weight: 500;
  font-family: var(--font-body); transition: border-color .2s, color .2s;
}
.ghost-btn:hover { border-color: var(--terracotta); color: var(--terracotta-deep); }

/* ---------- Suggestions ---------- */
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.chip {
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-body); font-size: 16px; transition: all .18s ease;
}
.chip:hover { background: var(--ink); color: #fdf6ea; border-color: var(--ink); transform: translateY(-1px); }

/* ---------- Type fallback ---------- */
.type-fallback { display: flex; gap: 8px; width: 100%; max-width: 560px; margin-top: 22px; }
.type-fallback input {
  flex: 1; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--paper); font-family: var(--font-body); font-size: 17px; color: var(--ink);
}
.type-fallback input:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.type-fallback button {
  border: none; background: var(--ink); color: #fdf6ea; padding: 0 22px; border-radius: 14px;
  cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 16px;
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: clamp(18px, 2vw, 28px); }
.card {
  background: linear-gradient(160deg, var(--paper), var(--cream-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 26px 22px;
  animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
.card:nth-child(2) { animation-delay: .12s; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.card-sub { color: var(--ink-soft); font-size: 14px; font-style: italic; font-family: var(--font-display); }

/* Agenda */
.agenda { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.agenda li {
  display: flex; align-items: center; gap: 14px; padding: 13px 8px;
  border-bottom: 1px dashed var(--line);
}
.agenda li:last-child { border-bottom: none; }
.agenda .time {
  font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--terracotta-deep);
  min-width: 56px;
}
.agenda .ev-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 18px; }
.agenda .ev-title { font-weight: 500; }
.agenda .ev-note { font-size: 14px; color: var(--ink-soft); }
.agenda li.done .ev-title { text-decoration: line-through; color: var(--ink-soft); }

/* People */
.people { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.people li { display: flex; align-items: center; gap: 13px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 19px; color: #fff; flex-shrink: 0;
}
.person-info { flex: 1; line-height: 1.3; }
.person-name { font-weight: 600; }
.person-role { font-size: 14px; color: var(--ink-soft); }
.presence { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.presence.online { background: var(--sage); box-shadow: 0 0 0 3px rgba(127,148,114,.2); }
.presence.away { background: var(--gold); }
.presence.offline { background: var(--line); }

.alert-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(200,103,74,.1); color: var(--terracotta-deep); border: 1.5px solid rgba(200,103,74,.35);
  padding: 14px; border-radius: 16px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 17px; transition: all .18s ease;
}
.alert-btn:hover { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fdf6ea; padding: 15px 26px; border-radius: 14px;
  font-size: 17px; z-index: 50; opacity: 0; pointer-events: none; transition: all .3s ease;
  box-shadow: 0 14px 34px rgba(0,0,0,.25); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   SALON CONNECTÉ — le store en temps réel
   ============================================================ */
.stage { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }

/* Compteur du store */
.readout {
  background: linear-gradient(160deg, var(--paper), var(--cream-2));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; align-items: center; text-align: center;
}
.readout-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.gauge {
  width: 100%; max-width: 280px; height: 10px; border-radius: 999px; margin: 16px 0 4px;
  background: #e7dcc8; overflow: hidden;
}
.gauge-fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  transition: width 1.4s cubic-bezier(.45,.05,.25,1);
}
.pct { font-family: var(--font-display); font-weight: 600; line-height: 1; margin-top: 8px;
  font-size: clamp(56px, 8vw, 92px); color: var(--ink); }
.pct-sign { font-size: .42em; color: var(--ink-soft); margin-left: 4px; }
.readout-label { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); font-size: 18px; margin-top: 2px; }

/* Curseur */
#storeSlider {
  -webkit-appearance: none; appearance: none; width: 100%; max-width: 300px; height: 8px;
  border-radius: 999px; margin: 22px 0 6px; cursor: pointer;
  background: linear-gradient(90deg, var(--sage-deep), var(--gold));
}
#storeSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--terracotta); box-shadow: 0 4px 12px rgba(0,0,0,.2); cursor: pointer;
}
#storeSlider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%; background: var(--paper);
  border: 3px solid var(--terracotta); box-shadow: 0 4px 12px rgba(0,0,0,.2); cursor: pointer;
}

/* La pièce */
.room {
  position: relative; height: clamp(280px, 34vw, 420px);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  /* mur + sol */
  background:
    linear-gradient(180deg, #ead9bf 0%, #e4d0b1 62%, #c89b6d 62%, #b98a59 100%);
}
.room::before { /* plinthe */
  content: ""; position: absolute; left: 0; right: 0; top: 62%; height: 6px;
  background: rgba(90,60,35,.25);
}

/* La fenêtre */
.window {
  position: absolute; left: 50%; top: 8%; transform: translateX(-50%);
  width: min(62%, 520px); height: 52%;
  border-radius: 12px 12px 6px 6px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(80,50,20,.25), inset 0 0 0 2px rgba(255,255,255,.35);
  background: #bcd7e8;
}
.window-view {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #9ec9e6 0%, #cfe7f2 55%, #e7f1d8 72%, #cfe3a8 100%);
  transition: filter 1.4s ease;
}
.sun {
  position: absolute; top: 16%; right: 18%; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #ffd66b 60%, rgba(255,214,107,0) 72%);
  box-shadow: 0 0 40px 12px rgba(255,213,107,.55); animation: sunGlow 6s ease-in-out infinite;
}
@keyframes sunGlow { 0%,100%{transform:scale(1);opacity:.95;} 50%{transform:scale(1.08);opacity:1;} }
.cloud { position: absolute; height: 16px; border-radius: 999px; background: rgba(255,255,255,.85);
  box-shadow: 18px 4px 0 -2px rgba(255,255,255,.85), -16px 5px 0 -3px rgba(255,255,255,.8); }
.cloud-1 { top: 22%; left: 14%; width: 46px; animation: drift 26s linear infinite; }
.cloud-2 { top: 38%; left: 50%; width: 34px; animation: drift 34s linear infinite reverse; }
@keyframes drift { from{transform:translateX(-30px);} to{transform:translateX(60px);} }
.hill { position: absolute; bottom: 0; border-radius: 50% 50% 0 0; }
.hill-1 { left: -8%; width: 70%; height: 38%; background: #a7c47e; }
.hill-2 { right: -10%; width: 65%; height: 30%; background: #8fb169; }
.tree { position: absolute; bottom: 18%; left: 22%; width: 16px; height: 28px; background: #7a5a3a; border-radius: 3px; }
.tree::before { content:""; position:absolute; left:50%; top:-26px; transform:translateX(-50%); width:42px; height:42px; border-radius:50%; background:#6f9a52; box-shadow:0 6px 0 -4px #5f8a45; }

/* Le store (volet roulant) */
.store {
  position: absolute; left: 0; right: 0; top: 0; height: 0;
  background:
    repeating-linear-gradient(180deg, #e4d3ad 0px, #e4d3ad 12px, #d3bf91 12px, #d3bf91 15px);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.18);
  transition: height 1.6s cubic-bezier(.45,.05,.25,1);
  z-index: 3;
}
.store-rail {
  position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background: linear-gradient(180deg, #b39a64, #8f7644);
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
}
/* Croisillons de la fenêtre par-dessus */
.window-frame {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  border: 7px solid #f3ece0; border-radius: 12px 12px 6px 6px;
  box-shadow: inset 0 0 0 1px rgba(120,90,50,.25);
}
.window-frame::before, .window-frame::after {
  content: ""; position: absolute; background: #f3ece0;
}
.window-frame::before { left: 50%; top: 0; bottom: 0; width: 7px; transform: translateX(-50%); }
.window-frame::after { top: 50%; left: 0; right: 0; height: 7px; transform: translateY(-50%); }
/* Caisson du store, toujours visible en haut de la fenêtre */
.store-box {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; z-index: 5;
  background: repeating-linear-gradient(90deg, #b39a64 0 6px, #a98e57 6px 8px);
  box-shadow: 0 6px 14px rgba(80,50,20,.4), inset 0 -3px 5px rgba(0,0,0,.25);
}
.store-box::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -3px; height: 4px;
  background: rgba(40,25,10,.5); border-radius: 0 0 4px 4px;
}
.window-sill {
  position: absolute; left: -6%; bottom: -10px; width: 112%; height: 12px; z-index: 5;
  background: linear-gradient(180deg, #f3ece0, #d9c9ac); border-radius: 4px;
  box-shadow: 0 8px 16px rgba(80,50,20,.25);
}

/* Pénombre quand le store se ferme */
.room-dim {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: radial-gradient(120% 90% at 50% 20%, rgba(20,16,40,.0), rgba(15,12,35,.0));
  background-color: rgba(20,16,38,0); transition: background-color 1.6s ease;
}

/* Déco pièce */
.room-plant { position: absolute; left: 4%; bottom: 4%; font-size: clamp(38px, 6vw, 64px); z-index: 6; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.room-lamp { position: absolute; right: 6%; bottom: 8%; width: 14px; height: 90px; z-index: 6;
  background: linear-gradient(180deg, #6b5640, #4a3a29); border-radius: 4px; }
.room-lamp::before { content:""; position:absolute; top:-26px; left:50%; transform:translateX(-50%);
  width:0; height:0; border-left:32px solid transparent; border-right:32px solid transparent;
  border-bottom:34px solid #c08a4a; border-radius:6px; box-shadow:0 0 26px 6px rgba(255,200,120,.0); transition: box-shadow 1.2s; }
.room[data-open="0"] .room-lamp::before,
.room[data-open="25"] .room-lamp::before { box-shadow:0 0 30px 10px rgba(255,200,120,.55); }

/* Contrôles */
.home-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.home-btn {
  flex: 1; min-width: 140px;
  background: var(--paper); border: 1.5px solid var(--line); color: var(--ink);
  padding: 16px 18px; border-radius: 16px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 18px; transition: all .18s ease;
}
.home-btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.home-btn--accent { background: linear-gradient(160deg, var(--sage), var(--sage-deep)); color: #fff; border-color: transparent; }
.home-btn--accent:hover { box-shadow: 0 12px 24px rgba(95,117,83,.35); }
.home-hint { margin-top: 12px; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); font-size: 16px; }

/* ---------- Agenda repliable ---------- */
.card-toggle {
  width: 100%; background: none; border: none; cursor: pointer; font: inherit; color: inherit;
  text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-toggle > span:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chevron { color: var(--ink-soft); font-size: 18px; transition: transform .3s ease; }
.agenda-card[data-open="false"] .agenda { display: none; }
.agenda-card[data-open="false"] .card-toggle { margin-bottom: 0; }
.agenda-card[data-open="true"] .chevron { transform: rotate(180deg); }
.agenda-card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%,100%{ box-shadow: var(--shadow);} 30%{ box-shadow: 0 0 0 3px rgba(217,164,65,.5), var(--shadow);} }

/* ============================================================
   DÉMO + VISUALISEUR + AMBIANCE
   ============================================================ */
.demo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(160deg, var(--terracotta), var(--terracotta-deep));
  color: #fff6ee; border: none; cursor: pointer; padding: 11px 20px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 20px rgba(168, 78, 53, 0.35);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.demo-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(168, 78, 53, 0.45); }
.demo-btn[data-running="true"] { background: linear-gradient(160deg, #8a8175, #5f584d); box-shadow: none; }
.demo-ico { font-size: 11px; }

/* Visualiseur audio circulaire autour de l'orbe */
.orb-wrap { position: relative; display: grid; place-items: center; padding: 18px 0 6px; }
.viz {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 300px; height: 300px; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .5s ease;
}
.orb-wrap.active .viz { opacity: 1; }
.orb { position: relative; z-index: 2; }
.orb-core { box-shadow: inset -8px -10px 26px rgba(120,50,30,.45), 0 14px 34px rgba(180,90,60,.35),
            0 0 calc(20px + var(--level, 0) * 70px) calc(var(--level, 0) * 14px) rgba(255, 170, 120, calc(.2 + var(--level, 0) * .6)); }

/* Rayon de soleil entrant par la fenêtre */
.sunbeam {
  position: absolute; z-index: 2; top: 9%; left: 50%; width: 58%; height: 86%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,240,200,.6) 0%, rgba(255,238,195,.12) 60%, rgba(255,238,195,0) 100%);
  clip-path: polygon(32% 0, 68% 0, 100% 100%, 0 100%);
  filter: blur(7px); mix-blend-mode: screen; pointer-events: none; opacity: .5;
  transition: opacity 1.4s ease;
}

/* Vignette pour donner de la profondeur à la pièce */
.room::after {
  content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none;
  border-radius: var(--radius); box-shadow: inset 0 0 90px rgba(40,25,10,.28);
}

/* Notification d'un proche */
.notif {
  position: fixed; top: 80px; left: 50%; z-index: 60;
  transform: translateX(-50%) translateY(-160%);
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(160deg, var(--paper), var(--cream-2));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 22px 14px 14px; box-shadow: 0 22px 54px rgba(80,50,30,.3);
  width: 384px; max-width: 92vw;
  transition: transform .55s cubic-bezier(.2,.9,.2,1);
}
.notif[hidden] { display: none; }
.notif.show { transform: translateX(-50%) translateY(0); }
.notif-avatar {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, var(--terracotta), var(--terracotta-deep)); color: #fff;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 21px;
  animation: ring 1.6s ease-out infinite;
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(200,103,74,.55); }
  70% { box-shadow: 0 0 0 15px rgba(200,103,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,103,74,0); }
}
.notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-head { display: flex; align-items: center; gap: 9px; }
.notif-name { font-weight: 700; font-size: 17px; }
.notif-tag { font-size: 12px; color: var(--terracotta-deep); background: rgba(200,103,74,.13); padding: 2px 9px; border-radius: 999px; }
.notif-text { color: var(--ink-soft); font-size: 15px; line-height: 1.4; }

/* Pendant la démo, on guide le regard */
body.demo-on .demo-btn { animation: none; }

/* ============================================================
   ÉMOTIONS — l'orbe se teinte selon l'humeur d'Egeria
   ============================================================ */
.orb[data-emotion="joie"] .orb-core { background: radial-gradient(circle at 35% 30%, #ffe9a8, #e6b53e 55%, #c4901d 100%); }
.orb[data-emotion="tendresse"] .orb-core { background: radial-gradient(circle at 35% 30%, #ffdde6, #e0849b 55%, #bb617a 100%); }
.orb[data-emotion="calme"] .orb-core { background: radial-gradient(circle at 35% 30%, #d4e3c6, #8aa279 55%, #5f7553 100%); }
.orb[data-emotion="inquietude"] .orb-core { background: radial-gradient(circle at 35% 30%, #d2deec, #6d86a8 55%, #4c648a 100%); }
.orb[data-emotion="enthousiasme"] .orb-core { background: radial-gradient(circle at 35% 30%, #ffd2a6, #f0883a 55%, #d2691e 100%); }
.orb[data-emotion="neutre"] .orb-core { background: radial-gradient(circle at 35% 30%, #f6c9a0, var(--terracotta) 55%, var(--terracotta-deep) 100%); }

.orb[data-emotion="joie"] .orb-ring { border-color: rgba(230,181,62,.4); }
.orb[data-emotion="tendresse"] .orb-ring { border-color: rgba(224,132,155,.4); }
.orb[data-emotion="calme"] .orb-ring { border-color: rgba(127,148,114,.4); }
.orb[data-emotion="inquietude"] .orb-ring { border-color: rgba(109,134,168,.4); }
.orb[data-emotion="enthousiasme"] .orb-ring { border-color: rgba(240,136,58,.4); }

/* Pastille d'humeur */
.mood {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 4px auto 0; padding: 5px 15px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  animation: pop .35s ease both;
}
.mood[hidden] { display: none; }
.mood .mood-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mood-color, var(--terracotta)); }

/* ============================================================
   CYCLE JOUR / NUIT — la fenêtre vit au rythme des heures
   ============================================================ */
.demo-btn--alt { background: linear-gradient(160deg, var(--sage), var(--sage-deep)); box-shadow: 0 8px 20px rgba(95,117,83,.32); }
.demo-btn--alt:hover { box-shadow: 0 12px 26px rgba(95,117,83,.42); }

.window-view { transition: filter 1.4s ease, background 2.2s ease; }

/* Lune + étoiles */
.moon {
  position: absolute; top: 16%; right: 20%; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fdf6e3, #e8e0c8 70%, #cfc6aa 100%);
  box-shadow: 0 0 26px 6px rgba(245,240,220,.5), inset -6px -4px 0 -2px rgba(180,175,150,.4);
  opacity: 0; transition: opacity 1.8s ease;
}
.stars {
  position: absolute; top: 6%; left: 8%; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity 1.8s ease;
  box-shadow:
    18px 14px 0 0 #fff, 52px 6px 0 -1px #fff, 86px 24px 0 0 #fff, 124px 10px 0 -1px #fdf,
    162px 30px 0 0 #fff, 196px 8px 0 -1px #fff, 224px 28px 0 0 #fff, 40px 44px 0 -1px #fff,
    100px 54px 0 0 #fff, 150px 46px 0 -1px #fff, 200px 58px 0 0 #fff, 70px 72px 0 -1px #fff,
    180px 74px 0 0 #fff, 120px 88px 0 -1px #fff, 30px 96px 0 0 #fff, 230px 70px 0 -1px #fff;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{ filter: brightness(1);} 50%{ filter: brightness(.55);} }

/* --- AUBE --- */
.room[data-phase="aube"] .window-view { background: linear-gradient(180deg, #f6b98a 0%, #f7d7b6 42%, #d8e4c2 100%); }
.room[data-phase="aube"] .sun { top: 46%; right: 24%; background: radial-gradient(circle, #fff2cf, #ffb27a 60%, rgba(255,178,122,0) 72%); box-shadow: 0 0 46px 14px rgba(255,180,120,.5); }

/* --- JOUR (défaut) --- */
.room[data-phase="jour"] .window-view { background: linear-gradient(180deg, #9ec9e6 0%, #cfe7f2 55%, #e7f1d8 72%, #cfe3a8 100%); }

/* --- COUCHANT --- */
.room[data-phase="couchant"] .window-view { background: linear-gradient(180deg, #e8825a 0%, #f0a866 32%, #d98a6e 60%, #7e6a8f 100%); }
.room[data-phase="couchant"] .sun { top: 52%; right: 22%; background: radial-gradient(circle, #fff0c4, #ff9248 58%, rgba(255,146,72,0) 72%); box-shadow: 0 0 54px 18px rgba(255,130,70,.55); }
.room[data-phase="couchant"] .hill-1 { background: #7e8a5e; }
.room[data-phase="couchant"] .hill-2 { background: #6a7850; }

/* --- NUIT --- */
.room[data-phase="nuit"] .window-view { background: linear-gradient(180deg, #0e1d3c 0%, #1b2c54 50%, #2b3a5e 100%); }
.room[data-phase="nuit"] .sun { opacity: 0; }
.room[data-phase="nuit"] .moon { opacity: 1; }
.room[data-phase="nuit"] .stars { opacity: 1; }
.room[data-phase="nuit"] .cloud { opacity: .25; }
.room[data-phase="nuit"] .hill-1 { background: #2a3a30; }
.room[data-phase="nuit"] .hill-2 { background: #233029; }
.room[data-phase="nuit"] .tree { background: #20281f; }

/* Voile d'ambiance intérieure selon le moment */
.room::before { transition: background .4s; } /* plinthe (déjà définie) */
.ambient {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: var(--radius);
  background: #0b1430; opacity: 0; transition: opacity 2s ease;
}
.room[data-phase="couchant"] .ambient { background: #3a1f3a; opacity: .14; }
.room[data-phase="nuit"] .ambient { background: #0b1430; opacity: .4; }

/* Lampe : peut être allumée volontairement (le soir) */
.room.lamp-on .room-lamp::before,
.room[data-phase="nuit"] .room-lamp::before { box-shadow: 0 0 34px 12px rgba(255,200,120,.6); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .stage, .grid { grid-template-columns: 1fr; }
  .topbar-meta .today { display: none; }
  .companion { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   PANNEAU « CE QUE JE PEUX FAIRE »
   ============================================================ */
.actions { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.action {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 13px 15px; border-radius: 16px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; font-weight: 500;
  text-align: left; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.action:hover { transform: translateY(-2px); border-color: var(--terracotta); box-shadow: 0 10px 22px rgba(168,78,53,.14); }
.action:active { transform: translateY(0) scale(.99); }
.action-ic {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(160deg, #fdeede, #f7e0c9);
}
.person-row { cursor: pointer; border-radius: 14px; transition: background .2s ease; }
.person-row:hover { background: var(--cream-2); }

/* ============================================================
   MESSAGERIE & APPELS — conversation avec un proche
   ============================================================ */
.convo {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: end center;
  background: rgba(45, 38, 32, 0.42); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  padding: 0 16px 16px;
}
.convo.show { opacity: 1; pointer-events: auto; }
.convo-card {
  width: 100%; max-width: 440px; max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 24px 24px 20px 20px; box-shadow: 0 -10px 50px rgba(60,45,30,.28);
  overflow: hidden; transform: translateY(24px); transition: transform .3s ease;
}
.convo.show .convo-card { transform: translateY(0); }
@media (min-width: 720px) { .convo { place-items: center; } .convo-card { border-radius: 24px; } }

.convo-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.convo-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
}
.convo-id { flex: 1; line-height: 1.25; }
.convo-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; display: block; }
.convo-status { font-size: 13px; color: var(--ink-soft); }
.convo-close {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--cream); color: var(--ink-soft); font-size: 16px;
}
.convo-close:hover { background: var(--ink); color: #fdf6ea; border-color: var(--ink); }

.convo-body {
  flex: 1; min-height: 180px; overflow-y: auto;
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 78%; padding: 11px 15px; border-radius: 18px;
  font-size: 16px; line-height: 1.4; word-wrap: break-word;
}
.msg.them { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: linear-gradient(160deg, var(--terracotta), var(--terracotta-deep)); color: #fff; border-bottom-right-radius: 6px; }
.msg.new { animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.convo-empty { color: var(--ink-soft); font-style: italic; text-align: center; margin: auto; }

.convo-compose {
  display: flex; gap: 10px; padding: 12px 14px;
  background: var(--paper); border-top: 1px solid var(--line);
}
.convo-compose input {
  flex: 1; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--cream); font: inherit; font-size: 16px; color: var(--ink);
}
.convo-compose input:focus { outline: none; border-color: var(--terracotta); }
.convo-compose button {
  width: 46px; height: 46px; flex: none; border-radius: 50%; cursor: pointer; border: none;
  background: linear-gradient(160deg, var(--terracotta), var(--terracotta-deep)); color: #fff; font-size: 18px;
}
.convo-compose button:hover { filter: brightness(1.06); }

/* Vue appel */
.convo-call { padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.call-pulse { position: relative; width: 84px; height: 84px; }
.call-pulse span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--sage); opacity: 0; animation: callPulse 1.8s ease-out infinite;
}
.call-pulse span:nth-child(2) { animation-delay: .6s; }
.call-pulse span:nth-child(3) { animation-delay: 1.2s; }
.convo-call[data-state="live"] .call-pulse span { border-color: var(--terracotta); }
@keyframes callPulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.2); opacity: 0; } }
.call-text { font-family: var(--font-display); font-size: 19px; color: var(--ink); text-align: center; }
.call-hang {
  padding: 12px 26px; border-radius: 14px; cursor: pointer; border: none;
  background: #b23b2c; color: #fff; font: inherit; font-size: 16px; font-weight: 600;
}
.call-hang:hover { filter: brightness(1.08); }

/* Choix du destinataire */
.convo-pick { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.pick-title { font-family: var(--font-display); font-size: 19px; color: var(--ink); }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
.pick-btn:hover { border-color: var(--terracotta); transform: translateY(-1px); }
.pick-info { line-height: 1.25; }

/* L'attribut hidden doit toujours l'emporter, même sur display:flex/grid */
[hidden] { display: none !important; }

/* ============================================================
   BADGE COÛT — estimation live (tarifs publics Mistral)
   ============================================================ */
.cost-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: #fdf6ea;
  padding: 9px 15px; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: default;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(45,38,32,.18);
}
.cost-ic {
  display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 13px; font-weight: 800;
}
.cost-val { letter-spacing: .2px; }
@media (max-width: 760px) { .topbar-meta .cost-pill { font-size: 14px; padding: 8px 12px; } }

/* Détail du coût (popover sous la pastille) */
.cost-wrap { position: relative; }
.cost-pill { border: none; font-family: var(--font-body); }
.cost-pill:hover { filter: brightness(1.08); }
.cost-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 300px; padding: 16px 18px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 44px rgba(60,45,30,.24);
}
.cost-pop h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.cost-lines { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.cost-lines li {
  display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto;
  column-gap: 10px; align-items: baseline;
}
.cp-ic { grid-row: 1 / 3; font-size: 18px; align-self: center; }
.cp-name { font-weight: 600; color: var(--ink); font-size: 15px; }
.cp-name em { font-style: normal; color: var(--ink-soft); font-weight: 500; font-size: 13px; }
.cp-amt { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-amt.cp-free { color: var(--sage-deep); font-size: 14px; }
.cp-sub { grid-column: 2 / 4; color: var(--ink-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cost-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink);
}
.cost-total span:last-child { font-variant-numeric: tabular-nums; }
.cost-note { margin-top: 8px; font-size: 12px; color: var(--ink-soft); font-style: italic; }

/* Coche animée d'une prise de médicaments */
.agenda li.just-done { animation: medDone 1.5s ease; }
@keyframes medDone {
  0% { background: rgba(127,148,114,.35); }
  100% { background: transparent; }
}

/* ============================================================
   VISAGE D'EGERIA — yeux + sourcils + bouche (lip-sync)
   ============================================================ */
.face { position: absolute; width: 120px; height: 120px; z-index: 3; pointer-events: none; overflow: visible; }
.eye {
  fill: #3d1e13; transform-box: fill-box; transform-origin: center;
  transition: transform .2s ease;
  transform: scaleY(0.12); /* yeux fermés au repos */
}
.orb[data-state="listening"] .eye,
.orb[data-state="thinking"] .eye,
.orb[data-state="speaking"] .eye { transform: scaleY(1); animation: blink 4.6s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }

.brow {
  fill: none; stroke: #3d1e13; stroke-width: 3.4; stroke-linecap: round;
  opacity: 0; transform-box: fill-box; transform-origin: center;
  transition: opacity .25s ease, transform .25s ease;
}
.orb[data-emotion="inquietude"] .brow { opacity: .85; }
.orb[data-emotion="inquietude"] .brow-l { transform: rotate(14deg) translateY(-1px); }
.orb[data-emotion="inquietude"] .brow-r { transform: rotate(-14deg) translateY(-1px); }
.orb[data-emotion="joie"] .brow,
.orb[data-emotion="enthousiasme"] .brow { opacity: .6; transform: translateY(-3px); }

.mouth {
  fill: none; stroke: #3d1e13; stroke-width: 5; stroke-linecap: round;
  transform-box: fill-box; transform-origin: center;
}
/* lip-sync réel : la bouche s'ouvre selon le niveau audio (--level) */
.orb[data-lip="audio"] .mouth { transform: scaleY(calc(0.35 + var(--level, 0) * 2.4)); }
/* repli sans analyseur : battement régulier */
.orb[data-lip="flap"] .mouth { animation: talk .24s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(0.5); } to { transform: scaleY(1.6); } }

/* pulsation douce quand la musique joue */
.orb.music .orb-ring { animation: ripple 3s ease-out infinite; }
.orb.music .orb-ring--2 { animation: ripple 3s 1.2s ease-out infinite; }

/* ============================================================
   MÉTÉO — badge + pluie / neige dans la fenêtre
   ============================================================ */
.weather-badge {
  position: absolute; top: 14px; left: 14px; z-index: 7;
  display: flex; align-items: center; gap: 9px; padding: 8px 13px;
  border-radius: 15px; background: rgba(255,250,242,.85); backdrop-filter: blur(4px);
  box-shadow: 0 6px 16px rgba(60,45,30,.16);
}
.wb-ic { font-size: 22px; }
.wb-txt { display: flex; flex-direction: column; line-height: 1.1; }
.wb-temp { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.wb-cond { font-size: 12px; color: var(--ink-soft); text-transform: capitalize; }

.precip { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; z-index: 4; }
.room[data-weather="cloud"] .sun { opacity: .45; }
.room[data-weather="rain"] .sun,
.room[data-weather="storm"] .sun,
.room[data-weather="snow"] .sun,
.room[data-weather="fog"] .sun { opacity: 0; }

.room[data-weather="rain"] .precip,
.room[data-weather="storm"] .precip {
  opacity: 1;
  background-color: rgba(38,48,68,.30);
  background-image: repeating-linear-gradient(112deg, transparent 0 7px, rgba(255,255,255,.5) 7px 8px);
  background-size: 64px 64px;
  animation: rainMove .5s linear infinite;
}
.room[data-weather="storm"] .precip { background-color: rgba(18,22,42,.44); }
@keyframes rainMove { to { background-position: -32px 64px; } }

.room[data-weather="snow"] .precip {
  opacity: 1; background-color: rgba(220,230,240,.16);
  background-image:
    radial-gradient(2.6px 2.6px at 20% 10%, #fff 99%, transparent),
    radial-gradient(2.6px 2.6px at 60% 30%, #fff 99%, transparent),
    radial-gradient(2px 2px at 80% 22%, #fff 99%, transparent),
    radial-gradient(2.6px 2.6px at 42% 55%, #fff 99%, transparent);
  background-size: 130px 130px;
  animation: snowFall 7s linear infinite;
}
@keyframes snowFall { to { background-position: 0 130px, 0 130px, 0 130px, 0 130px; } }

.room[data-weather="fog"] .precip { opacity: 1; background: rgba(228,232,236,.5); }

/* ============================================================
   MUSIQUE — pastille d'ambiance
   ============================================================ */
.music-chip {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 8px;
  padding: 7px 14px; border-radius: 999px; background: var(--sage); color: #fff;
  font-size: 14px; font-weight: 600; animation: musicPulse 2.2s ease-in-out infinite;
}
@keyframes musicPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(127,148,114,.5); } 50% { box-shadow: 0 0 0 9px rgba(127,148,114,0); } }
.music-stop { width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(255,255,255,.28); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; }
.music-stop:hover { background: rgba(255,255,255,.5); }

/* ============================================================
   SOS — écran d'alerte d'urgence
   ============================================================ */
.action--sos { border-color: #e7b0a5; color: #b23b2c; }
.action--sos .action-ic { background: linear-gradient(160deg, #f6ccc4, #eda99d); }
.action--sos:hover { border-color: #d94330; box-shadow: 0 10px 22px rgba(217,67,48,.18); }

.sos {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px;
  background: rgba(70,15,10,.55); backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.sos.show { opacity: 1; pointer-events: auto; }
.sos-card {
  position: relative; width: 100%; max-width: 400px; text-align: center; padding: 30px 26px 26px;
  background: var(--paper); border-radius: 24px; border: 2px solid rgba(217,67,48,.25);
  box-shadow: 0 24px 60px rgba(0,0,0,.4); transform: translateY(16px); transition: transform .3s ease;
}
.sos.show .sos-card { transform: translateY(0); }
.sos-ring {
  position: absolute; top: 24px; left: 50%; width: 78px; height: 78px; margin-left: -39px;
  border-radius: 50%; border: 3px solid #d94330; animation: sosPulse 1.4s ease-out infinite;
}
@keyframes sosPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.sos-ico { font-size: 44px; position: relative; }
.sos-card h2 { font-family: var(--font-display); font-size: 26px; color: #b23b2c; margin: 6px 0 4px; }
.sos-sub { color: var(--ink-soft); margin-bottom: 18px; }
.sos-steps { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.sos-steps li { display: flex; align-items: center; gap: 11px; font-size: 15px; color: var(--ink-soft); transition: color .3s; }
.sos-steps li.done { color: var(--ink); }
.sos-tick {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; background: var(--cream-2); color: var(--ink-soft); transition: background .3s, color .3s;
}
.sos-steps li.done .sos-tick { background: var(--sage); color: #fff; }
.sos-actions { display: flex; flex-direction: column; gap: 10px; }
.sos-call { padding: 14px; border-radius: 14px; background: #d94330; color: #fff; font-weight: 700; text-decoration: none; font-size: 18px; }
.sos-call:hover { filter: brightness(1.07); }
.sos-cancel { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--cream); color: var(--ink-soft); cursor: pointer; font: inherit; }
.sos-cancel:hover { background: var(--cream-2); }
