:root{
  color-scheme:light;
  --bg:#ffffff;
  --bg-card:#ffffff;
  --ink:#171512;
  --ink-soft:#6b6559;
  --ink-faint:#757060;   /* 4,51:1 sur --bg */
  /* Couleur secondaire : lime Rick. Le lime pur sert de fond ; sur du blanc,
     texte et contours prennent la version olive, seule lisible. */
  --accent:#d6ff4a;
  --accent-soft:#effcc6;
  --accent-deep:#4d6a00;   /* 6,4:1 sur blanc */
  --pro:#f6e7b8;
  --pro-ink:#81630f;
  --perso:#cfe3ea;
  --perso-ink:#31606f;
  --famille:#f3d3d6;
  --famille-ink:#a03f49;
  --line:#eae5d9;
  --tile:#f5f5f7;      /* gris des blocs, façon Apple */
  --tile-active:#e8e8ed;
  --shadow-sm:0 1px 2px rgba(23,21,18,.06);
  --shadow-md:0 8px 24px rgba(23,21,18,.10);
  --shadow-lg:0 20px 50px rgba(23,21,18,.22);
  --red:#d42c22;
  --green:#317d53;
  --amber:#9c621c;
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:16px;
  --radius-sm:12px;
  font-size:16px;
}

*{box-sizing:border-box;}
[hidden]{display:none !important;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}

.app{
  width:100%;
  margin:0 auto;
  height:100vh;
  height:100dvh;
  position:relative;
  display:flex;
  flex-direction:column;
  background:var(--bg);
}

/* ---------- TOPBAR ---------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px 6px;
  flex-shrink:0;
}
.logo{
  font-family:'Playfair Display',serif;
  font-style:italic;
  font-weight:800;
  font-size:26px;
  letter-spacing:1px;
  color:var(--ink);
  transform:skewX(-6deg);
}
/* Le fichier est un tracé noir : il se voit tel quel sur fond clair, et c'est
   sur fond sombre qu'il faut l'inverser. */
.logo-img{
  height:26px;width:auto;display:block;
  filter:none;
}
.icon-btn{
  width:44px;height:44px;border-radius:50%;
  border:1px solid var(--line);
  background:var(--bg-card);
  display:flex;align-items:center;justify-content:center;
  box-shadow:var(--shadow-sm);
  cursor:pointer;
}
.bluetooth-icon{color:var(--ink-soft);}

/* ---------- VIEWS ---------- */
.views{flex:1;min-height:0;position:relative;}
.view{
  position:absolute;inset:0;
  display:none;
  flex-direction:column;
}
.view.active{display:flex;}
.view-scroll{
  flex:1;overflow-y:auto;
  padding:8px 20px 140px;
  -webkit-overflow-scrolling:touch;
}
.view-scroll::-webkit-scrollbar{display:none;}

.date-line{
  font-size:12px;font-weight:700;letter-spacing:1.5px;
  color:var(--ink-faint);text-transform:uppercase;margin:4px 0 6px;
}
.greeting{
  font-family:'Cooper Hewitt','Inter',sans-serif;
  font-weight:700;letter-spacing:-.01em;
  font-size:34px;
  line-height:1.1;
  margin:0 0 18px;
  color:var(--ink);
}
.greeting em{
  font-family:'Caveat',cursive;
  font-style:normal;
  font-weight:700;
  font-size:1.3em;line-height:.8;
  color:var(--ink);
}

.searchbar{
  display:flex;align-items:center;gap:10px;
  background:var(--bg-card);
  border:1px solid var(--line);
  border-radius:999px;
  padding:14px 18px;
  margin-bottom:22px;
  box-shadow:var(--shadow-sm);
}
.search-icon{color:var(--ink-faint);font-size:18px;transform:scaleX(-1);}
.searchbar input{
  border:none;background:transparent;outline:none;
  font-size:15px;color:var(--ink);width:100%;
  font-family:'Inter',sans-serif;
}
.searchbar input::placeholder{color:var(--ink-faint);}

.section-head{
  display:flex;align-items:center;justify-content:space-between;
  margin:6px 0 12px;
}
.section-label{
  font-size:12px;font-weight:800;letter-spacing:1.2px;
  text-transform:uppercase;color:var(--ink-faint);
}
.section-label span{color:var(--ink-soft);font-weight:600;text-transform:none;letter-spacing:0;}
.section-label span.lbl{color:inherit;font-weight:inherit;text-transform:inherit;letter-spacing:inherit;}

.pill{
  border:none;border-radius:999px;padding:9px 16px;
  font-size:13px;font-weight:700;cursor:pointer;
  font-family:'Inter',sans-serif;
}
.pill-gold{
  background:#ffffff;
  color:var(--ink);
  border:1px solid var(--line);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.pill-gold:hover{background:var(--accent-soft);}
.pill-gold:active{transform:scale(.97);}

/* category cards */
.cat-row{
  display:flex;gap:12px;overflow-x:auto;padding-bottom:4px;margin-bottom:26px;
}
.cat-row::-webkit-scrollbar{display:none;}
.cat-card{
  flex:0 0 130px;
  height:150px;
  border-radius:var(--radius-lg);
  padding:16px;
  position:relative;
  overflow:hidden;
  cursor:pointer;
  display:flex;flex-direction:column;justify-content:flex-end;
  background:var(--tile);color:var(--ink);
  border:none;
  transition:transform .15s ease, background .15s ease;
}
.cat-card:active{transform:scale(.97);}
.cat-card:hover{background:var(--tile-active);}
.cat-card.selected{background:var(--accent-soft);box-shadow:inset 0 0 0 2px var(--accent);}
.cat-card.selected:hover{background:var(--accent-soft);}
.cat-icon-wrap{
  width:34px;height:34px;border-radius:10px;
  background:rgba(255,255,255,.55);
  display:flex;align-items:center;justify-content:center;
  font-size:17px;
}
.cat-name{font-weight:800;font-size:15px;}
.cat-count{font-size:12px;font-weight:600;opacity:.8;}

.cat-card-actions{
  position:absolute;top:10px;right:10px;
  display:flex;gap:4px;z-index:1;
}
.cat-icon-btn{
  width:22px;height:22px;border-radius:50%;padding:0;
  background:rgba(255,255,255,.55);border:none;
  display:flex;align-items:center;justify-content:center;
  font-size:11px;cursor:pointer;color:inherit;
  opacity:.85;
}
.cat-icon-btn .mask-icon{width:12px;height:12px;}
.cat-icon-btn:hover{opacity:1;background:rgba(255,255,255,.85);}
.cat-delete:hover{color:var(--red);}

.cat-card-add{
  flex:0 0 74px;height:150px;border-radius:var(--radius-lg);
  border:none;background:var(--tile);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  color:var(--ink-faint);cursor:pointer;
}
.cat-card-add:active{transform:scale(.97);}
.cat-add-icon{font-size:26px;font-weight:700;line-height:1;}
.cat-add-label{font-size:12px;font-weight:700;}
.cat-deco{
  position:absolute;right:-14px;bottom:-16px;font-size:70px;opacity:.18;
}

/* memo grid */
.memo-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:14px;
}
.memo-card{
  background:var(--tile);
  border:none;
  border-radius:var(--radius-lg);
  padding:18px 18px 16px;
  cursor:pointer;
  display:flex;flex-direction:column;gap:8px;
  min-height:196px;
  transition:background .15s ease, transform .15s ease;
}
.memo-card:hover{background:var(--tile-active);}
/* mémo tout juste enregistré : apparaît avec un halo lime */
.memo-card.is-new{animation:memoNew 2.6s cubic-bezier(.2,.8,.2,1) both;}
@keyframes memoNew{
  0%{opacity:0;transform:translateY(12px) scale(.96);box-shadow:0 0 0 0 rgba(214,255,74,0);}
  15%{opacity:1;transform:none;box-shadow:0 0 0 4px var(--accent);}
  70%{box-shadow:0 0 0 4px var(--accent);}
  100%{box-shadow:0 0 0 0 rgba(214,255,74,0);}
}
@media (prefers-reduced-motion: reduce){ .memo-card.is-new{animation:none;box-shadow:0 0 0 4px var(--accent);} }
.memo-card:active{transform:scale(.99);}
.memo-card-top{display:flex;align-items:center;justify-content:space-between;min-height:26px;}
.memo-card-actions{display:flex;align-items:center;gap:4px;}
.memo-icon-btn{
  width:26px;height:26px;
  background:none;border:none;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;cursor:pointer;color:var(--ink-faint);
}
.memo-drag-handle{cursor:grab;letter-spacing:-2px;}
.memo-drag-handle:active{cursor:grabbing;}
/* la poignée n'encombre la carte qu'au survol (souris) */
@media (hover:hover){
  .memo-drag-handle{opacity:0;transition:opacity .15s ease;}
  .memo-card:hover .memo-drag-handle{opacity:1;}
}
.memo-delete:hover{color:var(--red);}
.memo-badge{
  font-size:10px;font-weight:800;letter-spacing:.3px;
  padding:3px 8px;border-radius:999px;
  background:var(--accent);color:var(--ink);
}
.memo-badge.busy{background:#fff;color:var(--amber);}
.memo-meta{font-size:12px;color:var(--ink-faint);font-weight:600;}
.memo-title{
  font-weight:800;font-size:16px;line-height:1.3;color:var(--ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.memo-excerpt{
  font-size:13px;line-height:1.5;color:var(--ink-soft);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.memo-excerpt.muted{color:var(--ink-faint);font-style:italic;}
.memo-card-foot{display:flex;align-items:center;gap:10px;margin-top:auto;padding-top:6px;min-width:0;}
.memo-play{
  width:34px;height:34px;border-radius:50%;flex-shrink:0;
  background:#fff;border:none;
  display:flex;align-items:center;justify-content:center;
  font-size:11px;cursor:pointer;color:var(--ink);
  box-shadow:0 1px 3px rgba(23,21,18,.08);
  transition:background .15s ease, transform .15s ease;
}
.memo-play:hover{background:var(--accent);transform:scale(1.06);}
.memo-dur{font-size:12px;font-weight:700;color:var(--ink-soft);font-variant-numeric:tabular-nums;}
.cat-tag{
  display:inline-block;font-size:10px;font-weight:800;letter-spacing:.5px;
  padding:3px 8px;border-radius:999px;text-transform:uppercase;
}
.cat-team-tag{
  position:absolute;top:12px;left:12px;
  font-size:9px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;
  background:rgba(255,255,255,.6);color:inherit;
  padding:2px 7px;border-radius:999px;opacity:.9;
}
.memo-tags{display:flex;align-items:center;gap:6px;margin-left:auto;min-width:0;overflow:hidden;}
.memo-author{font-size:10px;font-weight:700;color:var(--ink-faint);}
.cat-tag.pro{background:var(--pro);color:var(--pro-ink);}
.cat-tag.perso{background:var(--perso);color:var(--perso-ink);}
.cat-tag.famille{background:var(--famille);color:var(--famille-ink);}

.empty-state{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  padding:50px 20px 20px;color:var(--ink-faint);
}
.empty-icon{
  width:64px;height:64px;border-radius:50%;background:var(--bg-card);
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;
  font-size:26px;margin-bottom:16px;
}
.empty-title{font-weight:800;font-size:16px;color:var(--ink);margin-bottom:6px;}
.empty-caption{font-size:13px;line-height:1.5;max-width:260px;}

/* ---------- AGENDA ---------- */
.agenda-title{font-family:'Playfair Display',serif;font-weight:800;font-size:28px;margin:10px 0 2px;}
.agenda-sub{font-size:14px;color:var(--ink-faint);margin-bottom:20px;}
.calendar{
  background:var(--bg-card);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:16px 8px;box-shadow:var(--shadow-sm);margin-bottom:24px;
}
.cal-row{display:grid;grid-template-columns:repeat(7,1fr);}
.cal-dow{text-align:center;font-size:11px;font-weight:800;color:var(--ink-faint);padding-bottom:10px;}
.cal-day{
  text-align:center;font-size:14px;font-weight:600;color:var(--ink);
  padding:8px 0;cursor:pointer;position:relative;
}
.cal-day.other{color:var(--ink-faint);opacity:.4;}
.cal-day .num{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:50%;
}
.cal-day.today .num{background:var(--accent);color:var(--ink);font-weight:800;}
.cal-day .dot{
  width:4px;height:4px;border-radius:50%;background:var(--ink-faint);
  margin:3px auto 0;
}
.cal-day.has-event .dot{background:var(--accent-deep);}

.agenda-list{display:flex;flex-direction:column;gap:12px;}
.agenda-item{
  background:var(--bg-card);border:1px solid var(--line);border-radius:var(--radius-md);
  padding:14px 16px;box-shadow:var(--shadow-sm);display:flex;gap:12px;align-items:flex-start;
}
.agenda-item .dot-ind{width:8px;height:8px;border-radius:50%;background:var(--accent-deep);margin-top:6px;flex-shrink:0;}
.agenda-item-title{font-weight:700;font-size:14px;}
.agenda-item-sub{font-size:12px;color:var(--ink-faint);margin-top:2px;}

/* ---------- DEMANDER À RICK ---------- */
.chat-scroll{flex:1;overflow-y:auto;padding:8px 20px 190px;}
.chat-scroll::-webkit-scrollbar{display:none;}
.chat-intro,.chat-list{max-width:760px;margin:0 auto;}
.chat-suggest{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px;}
.chat-chip{
  border:none;background:var(--tile);color:var(--ink);
  border-radius:16px;padding:12px 16px;text-align:left;
  font:500 14px 'Inter',sans-serif;cursor:pointer;
  transition:background .15s ease;
}
.chat-chip:hover{background:var(--tile-active);}
.chat-list{display:flex;flex-direction:column;gap:14px;padding-top:6px;}
.chat-msg{max-width:88%;font-size:15px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word;}
.chat-msg.user{
  align-self:flex-end;background:var(--ink);color:#fff;
  padding:10px 16px;border-radius:20px 20px 6px 20px;
}
.chat-msg.rick{
  align-self:flex-start;background:var(--tile);color:var(--ink);
  padding:14px 18px;border-radius:20px 20px 20px 6px;
}
/* Animations de la conversation */
.chat-msg{animation:msgIn .32s cubic-bezier(.2,.8,.2,1) both;}
.chat-msg.user{transform-origin:bottom right;}
.chat-msg.rick{transform-origin:bottom left;}
@keyframes msgIn{
  from{opacity:0;transform:translateY(10px) scale(.96);}
  to{opacity:1;transform:none;}
}
.chat-msg.leaving{animation:msgOut .2s ease-in both;}
@keyframes msgOut{to{opacity:0;transform:translateY(-6px) scale(.97);}}

.chat-msg.typing{display:flex;gap:5px;align-items:center;padding:16px 18px;}
.chat-msg.typing span{
  width:7px;height:7px;border-radius:50%;background:var(--ink-faint);
  animation:dot 1.1s ease-in-out infinite;
}
.chat-msg.typing span:nth-child(2){animation-delay:.15s;}
.chat-msg.typing span:nth-child(3){animation-delay:.3s;}
@keyframes dot{
  0%,60%,100%{transform:translateY(0);opacity:.45;}
  30%{transform:translateY(-5px);opacity:1;}
}

/* curseur qui clignote au bout du texte pendant que Rick écrit */
.chat-msg.streaming::after{
  content:"";display:inline-block;width:2px;height:1.05em;margin-left:2px;
  vertical-align:-2px;background:var(--accent-deep);border-radius:1px;
  animation:caret .9s steps(1) infinite;
}
@keyframes caret{50%{opacity:0;}}

.chat-intro{transition:opacity .25s ease, transform .25s ease, max-height .35s ease;max-height:600px;overflow:hidden;}
.chat-intro.gone{opacity:0;transform:translateY(-8px);max-height:0;pointer-events:none;}

.chat-send{transition:transform .25s cubic-bezier(.2,1.6,.4,1), background .2s ease, color .2s ease, box-shadow .2s ease;}
.chat-send:not(:disabled):hover{transform:scale(1.08);}
.chat-send:not(:disabled):active{transform:scale(.92);}
.chat-send-ico{
  width:18px;height:18px;display:block;background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 19V5'/><path d='M5.5 11.5L12 5l6.5 6.5'/></svg>") center/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 19V5'/><path d='M5.5 11.5L12 5l6.5 6.5'/></svg>") center/contain no-repeat;
  transition:transform .25s cubic-bezier(.2,1.6,.4,1);
}
.chat-send:not(:disabled):hover .chat-send-ico{transform:translateY(-2px);}
.chat-chip:active{transform:scale(.97);}

@media (prefers-reduced-motion: reduce){
  .chat-msg,.chat-msg.leaving,.chat-msg.typing span,.chat-msg.streaming::after{animation:none;}
  .chat-intro{transition:none;}
}
.chat-msg.error{background:#fdecea;color:var(--red);}
.chat-bar{
  position:absolute;left:20px;right:20px;bottom:calc(100% + 14px);
  max-width:760px;margin:0 auto;
  display:none;align-items:flex-end;gap:8px;
  background:var(--tile);border-radius:26px;padding:8px 8px 8px 18px;
  box-shadow:var(--shadow-md);z-index:400;
}
.chat-bar textarea{
  flex:1;border:none;background:transparent;outline:none;resize:none;
  font:15px/1.4 'Inter',sans-serif;color:var(--ink);
  padding:9px 0;max-height:140px;
}
.chat-send,.chat-reset{
  flex:0 0 38px;height:38px;border-radius:50%;border:none;cursor:pointer;
  font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.chat-send{background:var(--accent);color:var(--ink);box-shadow:0 4px 12px rgba(150,190,20,.35);}
.chat-send:disabled{background:var(--tile-active);color:#b4b2ab;box-shadow:none;cursor:default;}
.chat-reset{background:#fff;color:var(--ink-soft);}

body[data-view="chat"] .chat-bar,body[data-view="library"] .chat-bar{display:flex;}
/* mobile : la barre sert aussi de recherche sur la Library, on dégage le bas */
#view-library .view-scroll{padding-bottom:210px;}
.chat-bar{flex-wrap:wrap;}
.chat-bar textarea{min-width:0;}

/* ---- mémos glissés dans la barre ---- */
.chat-attach{flex-basis:100%;display:flex;flex-wrap:wrap;gap:6px;padding:2px 0 4px;}
.chat-att{
  display:inline-flex;align-items:center;gap:6px;max-width:100%;
  background:var(--accent-soft);color:var(--ink);
  border-radius:999px;padding:5px 6px 5px 10px;font-size:12px;font-weight:600;
  animation:attIn .28s cubic-bezier(.2,.8,.2,1) both;
}
.chat-att-ico{font-size:12px;}
.chat-att-t{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px;}
.chat-att-d{color:var(--ink-faint);font-weight:500;white-space:nowrap;}
.chat-att-x{
  width:20px;height:20px;border-radius:50%;border:none;cursor:pointer;
  background:rgba(23,21,18,.08);color:var(--ink-soft);font-size:14px;line-height:1;
  display:flex;align-items:center;justify-content:center;padding:0;
}
.chat-att-x:hover{background:var(--ink);color:#fff;}
.chat-att.leaving{animation:attOut .16s ease-in both;}
@keyframes attIn{from{opacity:0;transform:scale(.85) translateY(4px);}to{opacity:1;transform:none;}}
@keyframes attOut{to{opacity:0;transform:scale(.85);}}

/* pièces jointes dans la bulle envoyée */
.chat-msg-att{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;white-space:normal;}
.chat-msg.user .chat-att{background:rgba(255,255,255,.14);color:#fff;padding-right:10px;animation:none;}
.chat-msg.user .chat-att-d{color:rgba(255,255,255,.6);}

/* glisser-déposer : la barre se signale dès qu'on attrape une carte */
.chat-drop-hint{
  position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:2;
  display:flex;align-items:center;justify-content:center;
  font:700 14px 'Inter',sans-serif;color:var(--ink);
  background:var(--accent);opacity:0;transform:scale(.98);
  transition:opacity .18s ease, transform .18s ease;
}
.chat-bar{transition:box-shadow .2s ease, transform .2s ease;}
body.memo-dragging .chat-bar{
  box-shadow:0 0 0 2px var(--accent), 0 0 0 7px rgba(214,255,74,.35), var(--shadow-md);
  animation:dropPulse 1.4s ease-in-out infinite;
}
body.memo-dragging .chat-drop-hint{opacity:.55;transform:none;}
.chat-bar.drop-over{transform:scale(1.02);animation:none !important;}
.chat-bar.drop-over .chat-drop-hint{opacity:1;}
@keyframes dropPulse{
  0%,100%{box-shadow:0 0 0 2px var(--accent), 0 0 0 5px rgba(214,255,74,.25), var(--shadow-md);}
  50%{box-shadow:0 0 0 2px var(--accent), 0 0 0 11px rgba(214,255,74,.4), var(--shadow-md);}
}
.chat-bar.just-dropped{animation:dropBounce .35s cubic-bezier(.2,.8,.2,1);}
@keyframes dropBounce{0%{transform:scale(1.03);}100%{transform:none;}}

.memo-card[draggable="true"]{-webkit-user-drag:element;}
.memo-card.dragging{opacity:.45;transform:scale(.97);}
.drag-ghost{
  position:fixed;top:-200px;left:-200px;z-index:-1;
  max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  background:var(--ink);color:#fff;border-radius:999px;padding:9px 16px;
  font:700 13px 'Inter',sans-serif;box-shadow:var(--shadow-md);
}

/* fiche mémo : deux actions côte à côte */
.detail-cta{display:flex;gap:10px;margin-top:4px;}
.detail-cta .detail-analyze{margin-top:0;flex:1;}
.detail-ask{
  flex:1;padding:15px;border:none;border-radius:999px;cursor:pointer;
  background:var(--ink);color:#fff;font:700 15px 'Inter',sans-serif;
  transition:transform .15s ease, opacity .15s ease;
}
.detail-ask:hover{opacity:.9;}
.detail-ask:active{transform:scale(.98);}

@media (prefers-reduced-motion: reduce){
  .chat-att,.chat-att.leaving,.chat-bar.just-dropped,body.memo-dragging .chat-bar{animation:none;}
}

/* ---------- STORE ---------- */
.store-title{font-family:'Playfair Display',serif;font-weight:800;font-size:28px;margin:10px 0 16px;}
.chip-row{display:flex;gap:10px;overflow-x:auto;margin-bottom:22px;padding-bottom:2px;}
.chip-row::-webkit-scrollbar{display:none;}
.chip{
  flex:0 0 auto;padding:10px 16px;border-radius:999px;border:1px solid var(--line);
  background:var(--bg-card);font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;
  /* sans ça, un <button> retombe sur le noir du navigateur : illisible sur la
     puce sombre. --ink suit le thème : blanc cassé en sombre, encre en clair. */
  color:var(--ink);
}
.chip.active{background:#ffffff;color:var(--ink);border-color:var(--line);box-shadow:0 2px 8px rgba(0,0,0,.08);}
/* Deuxième rangée : les professions, plus discrètes que les familles. */
.chip-row-sub{margin-top:-14px;margin-bottom:22px;}
.chip-pro{padding:8px 14px;font-size:12px;font-weight:600;background:transparent;color:var(--ink-soft);}
.chip-pro.active{background:var(--accent-soft);color:var(--ink);border-color:transparent;box-shadow:none;}
.ext-soon{color:var(--ink-soft);}
.ext-btn-soon{background:transparent;border:1px dashed var(--line);color:var(--ink-soft);}
.ext-btn-soon:disabled{opacity:1;color:var(--green);border-style:solid;}
/* le <select> reprend l'allure des champs de saisie */
.login-select{appearance:none;-webkit-appearance:none;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,var(--ink-soft) 50%),linear-gradient(135deg,var(--ink-soft) 50%,transparent 50%);
  background-position:calc(100% - 19px) calc(50% + 2px),calc(100% - 14px) calc(50% + 2px);
  background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:38px;}

.ext-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:26px;}
.ext-card{
  background:var(--bg-card);border:1px solid var(--line);border-radius:var(--radius-md);
  padding:16px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:14px;
}
.ext-top{display:flex;justify-content:space-between;align-items:flex-start;}
.ext-icon{
  width:44px;height:44px;border-radius:12px;background:#fff;
  display:flex;align-items:center;justify-content:center;font-size:20px;
  overflow:hidden;box-shadow:0 1px 3px rgba(23,21,18,.1);
}
.ext-icon img{width:30px;height:30px;object-fit:contain;display:block;}
.ext-check{font-size:16px;}
.ext-name{font-weight:800;font-size:14px;}
.ext-desc{font-size:12px;color:var(--ink-faint);line-height:1.4;}
.ext-status{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;}
.status-dot{width:7px;height:7px;border-radius:50%;}
.status-dot.active{background:var(--green);}
.status-dot.pending{background:var(--amber);}
.ext-btn{
  align-self:flex-start;border:1px solid var(--line);border-radius:999px;padding:8px 16px;
  font-size:12px;font-weight:800;cursor:pointer;
  background:#ffffff;color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.ext-btn.connected{background:var(--bg);color:var(--green);border:1px solid var(--line);}
.ext-btn.loading{opacity:.6;}

/* ---------- MAP ---------- */
#view-map{padding:0;}
#mapEl{position:absolute;inset:0;background:#f2f2ef;z-index:0;}
#mapEl.adding{cursor:crosshair;}
#mapEl.adding .leaflet-grab{cursor:crosshair;}

/* commandes : pastille blanche verticale, comme la barre latérale */
.map-tools{
  position:absolute;right:16px;top:16px;z-index:410;
  display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px;
  background:color-mix(in srgb, #fff 88%, transparent);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-radius:999px;box-shadow:var(--shadow-md);
}
.map-tool{
  width:40px;height:40px;border-radius:50%;border:none;background:none;cursor:pointer;
  font:500 22px/1 'Inter',sans-serif;color:var(--ink);
  display:flex;align-items:center;justify-content:center;
  transition:background .15s ease;
}
.map-tool:hover{background:var(--tile);}
.map-tools-sep{width:20px;height:1px;background:var(--line);margin:4px 0;}
.map-locate-ico{
  width:20px;height:20px;display:block;background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='7'/><circle cx='12' cy='12' r='2.2' fill='black'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3'/></svg>") center/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='7'/><circle cx='12' cy='12' r='2.2' fill='black'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3'/></svg>") center/contain no-repeat;
}
.map-tool.busy .map-locate-ico{animation:spin 1s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

.map-add{
  position:absolute;right:16px;bottom:196px;z-index:410;
  display:flex;align-items:center;gap:6px;
  border:none;border-radius:999px;padding:12px 18px;cursor:pointer;
  background:var(--accent);color:var(--ink);font:700 14px 'Inter',sans-serif;
  box-shadow:0 8px 22px rgba(150,190,20,.4);
  transition:transform .2s cubic-bezier(.2,1.4,.4,1), background .15s ease, color .15s ease;
}
.map-add span{font-size:16px;line-height:1;}
.map-add:hover{transform:translateY(-2px);}
.map-add.active{background:var(--ink);color:#fff;box-shadow:var(--shadow-md);}

.map-add-hint{
  position:absolute;left:50%;top:16px;transform:translateX(-50%);z-index:420;
  display:flex;align-items:center;gap:10px;white-space:nowrap;
  background:var(--ink);color:#fff;border-radius:999px;padding:8px 8px 8px 16px;
  font:600 13px 'Inter',sans-serif;box-shadow:var(--shadow-md);
  animation:msgIn .25s cubic-bezier(.2,.8,.2,1) both;
}
.map-add-hint-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);animation:dot 1.1s ease-in-out infinite;}
.map-add-hint button{border:none;border-radius:999px;padding:6px 12px;cursor:pointer;background:rgba(255,255,255,.14);color:#fff;font:600 12px 'Inter',sans-serif;}
.map-add-hint button:hover{background:rgba(255,255,255,.25);}

/* épingle lime et position */
.rick-pin{background:none;border:none;}
.rick-pin span{
  display:block;width:30px;height:30px;margin:0 auto;
  background:var(--accent);border:3px solid var(--ink);
  border-radius:50% 50% 50% 0;transform:rotate(-45deg);
  box-shadow:0 6px 14px rgba(23,21,18,.25);
}
.rick-pin span::after{
  content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px 0 0 -4px;
  border-radius:50%;background:var(--ink);
}
.rick-me{background:none;border:none;}
.rick-me span{
  position:relative;display:block;width:22px;height:22px;border-radius:50%;
  background:var(--ink);border:4px solid var(--accent);box-shadow:0 2px 8px rgba(23,21,18,.3);
}
.rick-me span::before{
  content:"";position:absolute;inset:-4px;border-radius:50%;background:var(--accent);
  z-index:-1;animation:micRing 2s ease-out infinite;
}

/* onde partagée (point de position, disques des coins) */
@keyframes micRing{
  0%{transform:scale(1);opacity:.45;}
  70%,100%{transform:scale(1.28);opacity:0;}
}

/* panneau des rappels */
.map-sheet{
  position:absolute;left:0;right:0;bottom:0;z-index:400;
  background:#fff;border-radius:26px 26px 0 0;
  box-shadow:0 -10px 30px rgba(23,21,18,.12);
  padding:10px 20px 110px;max-height:60%;overflow-y:auto;
}
.sheet-handle{width:36px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 12px;}
.sheet-row{display:flex;justify-content:space-between;align-items:center;cursor:pointer;gap:12px;}
.sheet-title{font-weight:800;font-size:16px;}
.sheet-sub{font-size:12px;color:var(--ink-faint);margin-top:2px;}
.chevron{
  width:30px;height:30px;border-radius:50%;background:var(--tile);color:var(--ink-soft);
  display:flex;align-items:center;justify-content:center;font-size:14px;
  transition:transform .25s ease;
}
.map-sheet.open .chevron{transform:rotate(180deg);}
.reminder-list{margin-top:14px;display:flex;flex-direction:column;gap:8px;}
.reminder-item{
  display:flex;align-items:center;gap:4px;
  background:var(--tile);border-radius:16px;padding:4px 6px 4px 4px;
  transition:background .15s ease;
}
.reminder-item:hover{background:var(--tile-active);}
.reminder-go{
  flex:1;min-width:0;display:flex;align-items:center;gap:10px;text-align:left;
  border:none;background:none;cursor:pointer;padding:8px 10px;
  font:600 14px 'Inter',sans-serif;color:var(--ink);
}
.reminder-pin{
  flex-shrink:0;width:12px;height:12px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);
  background:var(--accent);border:2px solid var(--ink);
}
.reminder-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reminder-del{
  width:28px;height:28px;border-radius:50%;border:none;background:none;cursor:pointer;
  color:var(--ink-faint);font-size:18px;line-height:1;
}
.reminder-del:hover{background:#fff;color:var(--red);}
.reminder-empty{font-size:13px;line-height:1.5;color:var(--ink-faint);padding:4px 2px;}

/* Leaflet aux couleurs de l'app */
#mapEl .leaflet-tile-pane{filter:grayscale(1) brightness(1.06) contrast(.88);}
.leaflet-container{font-family:'Inter',sans-serif;}
.leaflet-popup-content-wrapper{border-radius:14px;box-shadow:var(--shadow-md);}
.leaflet-popup-content{margin:10px 14px;font:700 13px 'Inter',sans-serif;color:var(--ink);}
.leaflet-popup-tip{box-shadow:none;}
.leaflet-control-attribution{background:rgba(255,255,255,.7) !important;border-radius:8px 0 0 0;font-size:10px;}

/* ---------- BOTTOM NAV ---------- */
.bottombar{
  position:absolute;left:0;right:0;bottom:18px;
  padding:0 20px;
  display:flex;align-items:center;justify-content:center;gap:8px;
  z-index:500;
}
.navpill{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  border:none;background:none;
  border-radius:999px;
  padding:0 8px;height:48px;min-width:52px;
  font-size:10px;font-weight:700;color:var(--ink-faint);
  transition:background .2s ease,color .2s ease;
  cursor:pointer;
}
.nav-icon{
  width:22px;height:22px;display:block;
  background-color:currentColor;
  -webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;
}
.icon-library{-webkit-mask-image:url('images/icon-library.png');mask-image:url('images/icon-library.png');}
.icon-agenda{-webkit-mask-image:url('images/icon-agenda.png');mask-image:url('images/icon-agenda.png');}
.icon-store{-webkit-mask-image:url('images/icon-store.png');mask-image:url('images/icon-store.png');}
.icon-chat{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/></svg>");}
.icon-map{-webkit-mask-image:url('images/icon-map.png');mask-image:url('images/icon-map.png');}
.mask-icon{
  width:16px;height:16px;display:block;
  background-color:currentColor;
  -webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;
}
.icon-trash{-webkit-mask-image:url('images/bin.png');mask-image:url('images/bin.png');}
.icon-edit{-webkit-mask-image:url('images/modifier.png');mask-image:url('images/modifier.png');}
.icon-micro{-webkit-mask-image:url('images/micro.png');mask-image:url('images/micro.png');}
.navpill.active{
  /* lime translucide façon verre : on devine la pastille blanche dessous */
  background:linear-gradient(160deg, rgba(214,255,74,.62), rgba(214,255,74,.38));
  backdrop-filter:blur(10px) saturate(1.4);-webkit-backdrop-filter:blur(10px) saturate(1.4);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), inset 0 0 0 1px rgba(214,255,74,.55), 0 4px 14px rgba(150,190,20,.18);
  color:var(--ink);
}
.bottombar-wrap{
  flex:1;min-width:0;display:flex;justify-content:space-between;align-items:center;
  height:60px;
  background:color-mix(in srgb, var(--bg-card) 80%, transparent);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-radius:999px;box-shadow:var(--shadow-md);padding:0 8px;gap:2px;
}
.mic-fab{
  flex-shrink:0;
  width:60px;height:60px;border-radius:50%;border:none;
  background:var(--accent);
  box-shadow:0 8px 24px rgba(150,190,20,.45);
  color:#171512;font-size:18px;cursor:pointer;   /* icône foncée : le blanc ne se lit pas sur le lime */
  display:flex;align-items:center;justify-content:center;
  margin-left:6px;
}
.mic-icon{width:26px;height:26px;}
.mic-inner{display:flex;align-items:center;justify-content:center;}
.mic-label{display:none;}
.icon-upload{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 15V3'/><path d='M7 8l5-5 5 5'/><path d='M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 15V3'/><path d='M7 8l5-5 5 5'/><path d='M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/></svg>");}
.import-fab{display:none;}   /* desktop seulement */

/* ---------- OVERLAY / RECORD SHEET ---------- */
.overlay{
  position:absolute;inset:0;background:rgba(0,0,0,.35);
  z-index:900;display:flex;align-items:flex-end;
}
.overlay[hidden]{display:none;}
.record-sheet{
  width:100%;background:var(--bg-card);
  border-radius:28px 28px 0 0;
  padding:14px 24px 34px;
  box-shadow:var(--shadow-lg);
  display:flex;flex-direction:column;align-items:center;
  max-height:88%;overflow-y:auto;
}
.record-pill{
  display:flex;align-items:center;gap:8px;
  background:var(--bg);border-radius:999px;padding:8px 16px;
  font-size:11px;font-weight:800;letter-spacing:1px;color:var(--ink-soft);
  margin:8px 0 20px;
}
.rec-dot{width:9px;height:9px;border-radius:50%;background:var(--red);animation:pulse 1.2s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.3;}}
.tab-audio-toggle{
  display:flex;align-items:center;gap:8px;
  border:1px solid var(--line);background:var(--bg);
  border-radius:999px;padding:8px 14px;margin-bottom:14px;
  font-size:12px;font-weight:700;color:var(--ink-soft);cursor:pointer;
}
.tab-audio-toggle.active{background:var(--accent-soft);border-color:var(--accent-deep);color:var(--accent-deep);}
.tab-audio-toggle:disabled{opacity:.5;cursor:not-allowed;}
.record-timer{font-size:52px;font-weight:800;letter-spacing:1px;margin-bottom:20px;font-variant-numeric:tabular-nums;}

.waveform{width:100%;height:24px;margin-bottom:24px;display:flex;align-items:center;}
.wave-bars{display:flex;align-items:center;gap:3px;width:100%;overflow:hidden;}
.wave-bars span{
  flex:0 0 3px;height:6px;border-radius:2px;
  background:linear-gradient(180deg,var(--accent),var(--perso-ink));
  transition:height .1s ease;
}

.transcript-box{
  width:100%;min-height:110px;background:var(--bg);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:18px;margin-bottom:26px;
}
.transcript-placeholder{color:var(--ink-faint);font-size:14px;margin:0;text-align:center;}
#transcriptText{font-size:14px;line-height:1.5;margin:0;color:var(--ink);}
.transcript-box{max-height:190px;overflow-y:auto;}

/* transcription live à deux voix : micro d'un côté, son de la visio de l'autre */
.transcript-live{display:flex;flex-direction:column;gap:8px;text-align:left;}
.tr-line{display:block;}
.tr-line.pending{opacity:.55;font-style:italic;}
.tr-who{
  display:inline-block;margin-right:7px;
  font-size:9px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;
  padding:2px 7px;border-radius:999px;vertical-align:1px;
}
.tr-who.me{background:var(--accent-soft);color:var(--accent-deep);}
.tr-who.them{background:var(--perso);color:var(--perso-ink);}

.record-controls{display:flex;justify-content:center;gap:36px;margin-bottom:14px;}
.rec-btn-col{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:12px;font-weight:700;color:var(--ink-soft);}
.round-btn{width:60px;height:60px;border-radius:50%;border:none;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;}
.round-btn-light{background:var(--bg);border:1px solid var(--line);}
.round-btn-stop{
  width:76px;height:76px;background:var(--red);color:#fff;
  box-shadow:0 0 0 10px rgba(224,72,63,.15),0 8px 20px rgba(224,72,63,.4);
}
.stop-square{width:22px;height:22px;background:#fff;border-radius:4px;display:block;}
.record-footnote{font-size:12px;color:var(--ink-faint);text-align:center;}

/* ---------- LOGIN GATE ---------- */
.login-overlay{align-items:center;justify-content:center;background:var(--bg);z-index:1000;}
.login-sheet{
  width:calc(100% - 40px);max-width:360px;border-radius:24px;
  padding:36px 28px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:14px;
}
.login-logo-img{
  height:34px;width:auto;filter:none;
}
.login-sub{font-size:14px;color:var(--ink-soft);margin:0;}
.auth-form{width:100%;display:flex;flex-direction:column;gap:12px;margin-top:6px;}
.login-input{
  width:100%;border:1px solid var(--line);border-radius:14px;
  padding:13px 16px;font-size:15px;font-family:'Inter',sans-serif;
  background:var(--bg-card);color:var(--ink);
}
.login-input:focus{outline:none;border-color:var(--accent-deep);}
.login-submit{width:100%;padding:13px;font-size:14px;}
.login-note{font-size:11px;color:var(--ink-faint);margin:0;line-height:1.4;}

/* onglets connexion / inscription */
.auth-tabs{
  display:flex;width:100%;gap:4px;padding:4px;
  background:var(--bg);border:1px solid var(--line);border-radius:999px;
}
.auth-tab{
  flex:1;border:none;background:none;border-radius:999px;padding:9px 6px;
  font-family:'Inter',sans-serif;font-size:12px;font-weight:800;
  color:var(--ink-faint);cursor:pointer;
}
.auth-tab.active{background:var(--bg-card);color:var(--ink);box-shadow:var(--shadow-sm);}
.auth-label{
  font-size:10px;font-weight:800;letter-spacing:1px;text-transform:uppercase;
  color:var(--ink-faint);text-align:left;margin-top:2px;
}
.auth-choice{display:flex;gap:6px;}
.auth-opt{
  flex:1;border:1px solid var(--line);background:var(--bg);border-radius:12px;
  padding:9px 4px;font-family:'Inter',sans-serif;font-size:11px;font-weight:700;
  color:var(--ink-soft);cursor:pointer;
}
.auth-opt.active{border-color:var(--accent-deep);color:var(--accent-deep);background:var(--accent-soft);}
.auth-error{
  margin:0;font-size:12px;font-weight:600;color:var(--red);
  background:color-mix(in srgb, var(--red) 12%, transparent);
  border-radius:10px;padding:8px 10px;
}

/* ---------- COMPTE ---------- */
.topbar-actions{display:flex;align-items:center;gap:8px;}
#btnAccount svg{color:var(--ink-soft);}
.account-sheet{align-items:stretch;gap:0;}
.account-head{display:flex;align-items:center;gap:12px;margin:6px 0 18px;}
.account-avatar{
  width:48px;height:48px;border-radius:50%;flex-shrink:0;
  background:var(--accent-soft);color:var(--accent-deep);
  display:flex;align-items:center;justify-content:center;
  font-size:16px;font-weight:800;letter-spacing:.5px;
}
.account-avatar.small{width:34px;height:34px;font-size:12px;}
.account-name{font-weight:800;font-size:17px;}
.account-email{font-size:12px;color:var(--ink-faint);}
.account-rows{display:flex;flex-direction:column;gap:2px;margin-bottom:18px;}
.account-row{
  display:flex;justify-content:space-between;align-items:baseline;gap:14px;
  padding:10px 0;border-bottom:1px solid var(--line);font-size:13px;
}
.account-row span{color:var(--ink-faint);flex-shrink:0;}
.account-row strong{text-align:right;font-weight:700;}
.account-action{width:100%;padding:13px;margin-bottom:8px;}
.pill-ghost{background:var(--bg);color:var(--ink);border:1px solid var(--line);}
.pill-ghost:hover{background:var(--bg-card);}
.pill-danger{
  background:color-mix(in srgb, var(--red) 12%, transparent);
  color:var(--red);border:1px solid color-mix(in srgb, var(--red) 30%, transparent);
}

/* ---------- PANNEAU ÉQUIPE ---------- */
.team-sheet{align-items:stretch;}
.team-code{
  font-size:12px;font-weight:800;letter-spacing:1px;
  background:var(--accent-soft);color:var(--accent-deep);
  padding:4px 10px;border-radius:999px;
}
.team-label-row{display:flex;justify-content:space-between;align-items:center;}
.mini-btn{
  border:1px solid var(--line);background:var(--bg-card);border-radius:999px;
  padding:5px 12px;font-family:'Inter',sans-serif;font-size:11px;font-weight:800;
  color:var(--ink);cursor:pointer;text-transform:none;letter-spacing:0;
}
.mini-btn:hover{background:var(--bg);}
.team-cats{display:flex;flex-direction:column;gap:8px;margin-top:10px;}
.team-cat{
  display:flex;justify-content:space-between;align-items:center;
  border-radius:12px;padding:10px 12px;background:var(--bg);
  border:1px solid var(--line);
}
.team-cat-name{font-size:13px;font-weight:700;}
.team-cat-actions{display:flex;gap:4px;}
.team-members{display:flex;flex-direction:column;gap:10px;margin-top:12px;}
.team-member{
  border:1px solid var(--line);border-radius:14px;padding:12px;background:var(--bg);
}
.team-member-head{display:flex;align-items:center;gap:10px;}
.team-member-id{flex:1;min-width:0;}
.team-member-name{font-size:13px;font-weight:800;}
.team-member-mail{font-size:11px;color:var(--ink-faint);overflow:hidden;text-overflow:ellipsis;}
.role-badge{
  font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;
  padding:3px 8px;border-radius:999px;background:var(--perso);color:var(--perso-ink);
}
.role-badge.admin{background:var(--accent-soft);color:var(--accent-deep);}
.team-access-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.team-access{
  display:flex;align-items:center;gap:6px;cursor:pointer;
  border:1px solid var(--line);border-radius:999px;padding:5px 10px;
  font-size:11px;font-weight:700;color:var(--ink-soft);background:var(--bg-card);
}
.team-access.on{border-color:var(--accent-deep);color:var(--accent-deep);background:var(--accent-soft);}
.team-access input{accent-color:var(--accent-deep);margin:0;}
.team-role-btn{
  margin-top:10px;border:none;background:none;padding:0;
  font-family:'Inter',sans-serif;font-size:11px;font-weight:800;
  color:var(--ink-faint);cursor:pointer;text-decoration:underline;
}
.team-role-btn:hover{color:var(--accent-deep);}

/* ---------- DETAIL SHEET ---------- */
.detail-sheet{align-items:stretch;}
.detail-header{display:flex;justify-content:space-between;align-items:center;margin:6px 0 14px;}
.detail-header-actions{display:flex;align-items:center;gap:10px;}
.detail-date{font-size:12px;font-weight:700;color:var(--ink-faint);letter-spacing:.2px;}
.cat-badge{font-size:11px;font-weight:800;padding:4px 10px;border-radius:999px;}
.cat-badge.pro{background:var(--pro);color:var(--pro-ink);}
.cat-badge.perso{background:var(--perso);color:var(--perso-ink);}
.cat-badge.famille{background:var(--famille);color:var(--famille-ink);}
.detail-title{
  font-family:'Playfair Display',serif;font-size:28px;line-height:1.15;
  margin:0 0 16px;color:var(--ink);
}
.detail-status{font-size:13px;color:var(--amber);margin:-8px 0 14px;}

/* lecteur : une pastille grise, bouton rond, onde décorative, durée */
.detail-player{
  display:flex;align-items:center;gap:14px;width:100%;
  border:none;background:var(--tile);border-radius:999px;
  padding:8px 18px 8px 8px;margin-bottom:22px;cursor:pointer;
  font-family:'Inter',sans-serif;transition:background .15s ease;
}
.detail-player:hover{background:var(--tile-active);}
.detail-player-btn{
  width:40px;height:40px;border-radius:50%;flex-shrink:0;
  background:var(--ink);color:#fff;font-size:13px;
  display:flex;align-items:center;justify-content:center;
}
.detail-player-wave{
  flex:1;height:22px;opacity:.3;background-color:var(--ink);
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22' preserveAspectRatio='none'><rect x='0' y='9.0' width='3' height='4.0' rx='1.5'/><rect x='5' y='4.1' width='3' height='13.8' rx='1.5'/><rect x='10' y='2.2' width='3' height='17.7' rx='1.5'/><rect x='15' y='4.1' width='3' height='13.8' rx='1.5'/><rect x='20' y='7.9' width='3' height='6.1' rx='1.5'/><rect x='25' y='7.4' width='3' height='7.2' rx='1.5'/><rect x='30' y='7.8' width='3' height='6.3' rx='1.5'/><rect x='35' y='7.2' width='3' height='7.5' rx='1.5'/><rect x='40' y='4.6' width='3' height='12.8' rx='1.5'/><rect x='45' y='4.9' width='3' height='12.1' rx='1.5'/><rect x='50' y='8.7' width='3' height='4.6' rx='1.5'/><rect x='55' y='4.2' width='3' height='13.5' rx='1.5'/><rect x='60' y='1.2' width='3' height='19.6' rx='1.5'/><rect x='65' y='2.2' width='3' height='17.7' rx='1.5'/><rect x='70' y='6.3' width='3' height='9.4' rx='1.5'/><rect x='75' y='7.3' width='3' height='7.4' rx='1.5'/><rect x='80' y='5.5' width='3' height='11.0' rx='1.5'/><rect x='85' y='7.1' width='3' height='7.9' rx='1.5'/><rect x='90' y='7.9' width='3' height='6.2' rx='1.5'/><rect x='95' y='6.5' width='3' height='9.1' rx='1.5'/><rect x='100' y='8.3' width='3' height='5.5' rx='1.5'/><rect x='105' y='5.6' width='3' height='10.9' rx='1.5'/><rect x='110' y='2.0' width='3' height='18.0' rx='1.5'/><rect x='115' y='1.9' width='3' height='18.3' rx='1.5'/><rect x='120' y='5.5' width='3' height='11.0' rx='1.5'/><rect x='125' y='7.2' width='3' height='7.6' rx='1.5'/><rect x='130' y='3.6' width='3' height='14.7' rx='1.5'/><rect x='135' y='3.7' width='3' height='14.5' rx='1.5'/><rect x='140' y='6.7' width='3' height='8.5' rx='1.5'/><rect x='145' y='8.1' width='3' height='5.7' rx='1.5'/><rect x='150' y='7.6' width='3' height='6.8' rx='1.5'/><rect x='155' y='7.9' width='3' height='6.2' rx='1.5'/><rect x='160' y='4.5' width='3' height='13.1' rx='1.5'/><rect x='165' y='3.1' width='3' height='15.7' rx='1.5'/><rect x='170' y='5.5' width='3' height='10.9' rx='1.5'/><rect x='175' y='7.4' width='3' height='7.2' rx='1.5'/><rect x='180' y='2.8' width='3' height='16.4' rx='1.5'/><rect x='185' y='1.5' width='3' height='18.9' rx='1.5'/><rect x='190' y='4.1' width='3' height='13.7' rx='1.5'/><rect x='195' y='8.4' width='3' height='5.2' rx='1.5'/><rect x='200' y='6.8' width='3' height='8.5' rx='1.5'/><rect x='205' y='7.2' width='3' height='7.6' rx='1.5'/><rect x='210' y='8.0' width='3' height='6.0' rx='1.5'/><rect x='215' y='5.6' width='3' height='10.8' rx='1.5'/><rect x='220' y='6.2' width='3' height='9.6' rx='1.5'/><rect x='225' y='8.0' width='3' height='6.0' rx='1.5'/><rect x='230' y='3.4' width='3' height='15.3' rx='1.5'/><rect x='235' y='1.0' width='3' height='19.9' rx='1.5'/></svg>") center/100% 100% no-repeat;
  mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22' preserveAspectRatio='none'><rect x='0' y='9.0' width='3' height='4.0' rx='1.5'/><rect x='5' y='4.1' width='3' height='13.8' rx='1.5'/><rect x='10' y='2.2' width='3' height='17.7' rx='1.5'/><rect x='15' y='4.1' width='3' height='13.8' rx='1.5'/><rect x='20' y='7.9' width='3' height='6.1' rx='1.5'/><rect x='25' y='7.4' width='3' height='7.2' rx='1.5'/><rect x='30' y='7.8' width='3' height='6.3' rx='1.5'/><rect x='35' y='7.2' width='3' height='7.5' rx='1.5'/><rect x='40' y='4.6' width='3' height='12.8' rx='1.5'/><rect x='45' y='4.9' width='3' height='12.1' rx='1.5'/><rect x='50' y='8.7' width='3' height='4.6' rx='1.5'/><rect x='55' y='4.2' width='3' height='13.5' rx='1.5'/><rect x='60' y='1.2' width='3' height='19.6' rx='1.5'/><rect x='65' y='2.2' width='3' height='17.7' rx='1.5'/><rect x='70' y='6.3' width='3' height='9.4' rx='1.5'/><rect x='75' y='7.3' width='3' height='7.4' rx='1.5'/><rect x='80' y='5.5' width='3' height='11.0' rx='1.5'/><rect x='85' y='7.1' width='3' height='7.9' rx='1.5'/><rect x='90' y='7.9' width='3' height='6.2' rx='1.5'/><rect x='95' y='6.5' width='3' height='9.1' rx='1.5'/><rect x='100' y='8.3' width='3' height='5.5' rx='1.5'/><rect x='105' y='5.6' width='3' height='10.9' rx='1.5'/><rect x='110' y='2.0' width='3' height='18.0' rx='1.5'/><rect x='115' y='1.9' width='3' height='18.3' rx='1.5'/><rect x='120' y='5.5' width='3' height='11.0' rx='1.5'/><rect x='125' y='7.2' width='3' height='7.6' rx='1.5'/><rect x='130' y='3.6' width='3' height='14.7' rx='1.5'/><rect x='135' y='3.7' width='3' height='14.5' rx='1.5'/><rect x='140' y='6.7' width='3' height='8.5' rx='1.5'/><rect x='145' y='8.1' width='3' height='5.7' rx='1.5'/><rect x='150' y='7.6' width='3' height='6.8' rx='1.5'/><rect x='155' y='7.9' width='3' height='6.2' rx='1.5'/><rect x='160' y='4.5' width='3' height='13.1' rx='1.5'/><rect x='165' y='3.1' width='3' height='15.7' rx='1.5'/><rect x='170' y='5.5' width='3' height='10.9' rx='1.5'/><rect x='175' y='7.4' width='3' height='7.2' rx='1.5'/><rect x='180' y='2.8' width='3' height='16.4' rx='1.5'/><rect x='185' y='1.5' width='3' height='18.9' rx='1.5'/><rect x='190' y='4.1' width='3' height='13.7' rx='1.5'/><rect x='195' y='8.4' width='3' height='5.2' rx='1.5'/><rect x='200' y='6.8' width='3' height='8.5' rx='1.5'/><rect x='205' y='7.2' width='3' height='7.6' rx='1.5'/><rect x='210' y='8.0' width='3' height='6.0' rx='1.5'/><rect x='215' y='5.6' width='3' height='10.8' rx='1.5'/><rect x='220' y='6.2' width='3' height='9.6' rx='1.5'/><rect x='225' y='8.0' width='3' height='6.0' rx='1.5'/><rect x='230' y='3.4' width='3' height='15.3' rx='1.5'/><rect x='235' y='1.0' width='3' height='19.9' rx='1.5'/></svg>") center/100% 100% no-repeat;
  transform-origin:center;
}
.detail-player.playing .detail-player-wave{opacity:.7;animation:wave 1s ease-in-out infinite alternate;}
@keyframes wave{from{transform:scaleY(.7);}to{transform:scaleY(1.1);}}
.detail-player-time{font-size:13px;font-weight:700;color:var(--ink-soft);font-variant-numeric:tabular-nums;}

.detail-block{margin-bottom:22px;}
.detail-label{
  display:flex;align-items:baseline;justify-content:space-between;
  font-size:11px;font-weight:800;letter-spacing:1px;text-transform:uppercase;
  color:var(--ink-faint);margin-bottom:10px;
}
.edit-hint{font-weight:600;text-transform:none;letter-spacing:0;color:var(--ink-faint);font-size:11px;opacity:.8;}

.detail-cats{display:flex;flex-wrap:wrap;gap:8px;}
.detail-cat{
  border:none;background:var(--tile);color:var(--ink-soft);
  border-radius:999px;padding:8px 14px;cursor:pointer;
  font:600 13px 'Inter',sans-serif;transition:background .15s ease,color .15s ease;
}
.detail-cat:hover{background:var(--tile-active);color:var(--ink);}
.detail-cat.active{background:var(--ink);color:#fff;}
.detail-cat-empty{font-size:13px;color:var(--ink-faint);}

.detail-transcript{
  font-size:15px;line-height:1.65;color:var(--ink);white-space:pre-wrap;margin:0;
  background:var(--tile);border-radius:18px;padding:16px 18px;outline:none;
  max-height:40vh;overflow-y:auto;transition:box-shadow .15s ease;
}
.detail-transcript:focus{box-shadow:0 0 0 2px var(--ink);}
.tr-speaker{font-weight:700;color:var(--ink-soft);}

.action-chips{display:flex;flex-wrap:wrap;gap:8px;}
.action-chip{background:var(--tile);border-radius:999px;padding:8px 14px;font-size:12px;font-weight:700;}
#detailSummary{margin:0;font-size:15px;line-height:1.6;color:var(--ink);}

.detail-analyze{
  width:100%;padding:15px;margin-top:4px;border:none;border-radius:999px;cursor:pointer;
  background:var(--accent);color:var(--ink);font:700 15px 'Inter',sans-serif;
  transition:transform .15s ease, filter .15s ease;
}
.detail-analyze:hover{filter:brightness(.96);}
.detail-analyze:active{transform:scale(.98);}
.detail-analyze.secondary{background:var(--tile);color:var(--ink-soft);}

.memo-play[data-nodata="1"]{opacity:.35;}

/* drag & drop: drag the handle icon onto a category card */
.cat-card{transition:transform .12s ease, box-shadow .12s ease;}
.cat-card.drag-over{
  transform:scale(1.03);
  box-shadow:0 0 0 3px var(--accent-deep), var(--shadow-md);
}

/* ---------- APPAREILS RICK ---------- */
.device-count{
  font-size:11px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;
  color:var(--ink-soft);background:var(--bg);border:1px solid var(--line);
  padding:5px 10px;border-radius:999px;
}
.device-list{display:flex;flex-direction:column;gap:10px;margin:18px 0 16px;}
.device-row{
  display:flex;align-items:center;gap:12px;
  background:var(--bg-card);border:1px solid var(--line);
  border-radius:var(--radius-md);padding:12px 14px;
}
.device-dot{
  flex:0 0 auto;width:9px;height:9px;border-radius:50%;
  background:var(--green);box-shadow:0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent);
}
.device-main{flex:1;min-width:0;}
.device-label{font-size:14px;font-weight:700;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.device-meta{font-size:11px;color:var(--ink-soft);margin-top:2px;}
.device-cat{
  flex:0 0 auto;font-size:11px;font-weight:700;padding:5px 10px;border-radius:999px;
  background:var(--pro);color:var(--pro-ink);white-space:nowrap;
  max-width:140px;overflow:hidden;text-overflow:ellipsis;
}
.device-cat-none{background:transparent;color:var(--ink-soft);border:1px dashed var(--line);}
.device-actions{flex:0 0 auto;display:flex;gap:4px;}
.device-empty{text-align:center;padding:26px 10px;color:var(--ink-soft);}
.device-empty .empty-icon{font-size:26px;margin-bottom:8px;}
.device-empty .empty-title{font-size:14px;font-weight:700;color:var(--ink);margin-bottom:4px;}
.device-empty .empty-caption{font-size:12.5px;line-height:1.5;max-width:none;margin:0 auto;}
.device-add{width:100%;}
.device-sheet{max-height:88vh;overflow-y:auto;}


/* ---------- DESKTOP LAYOUT ---------- */
/* Contenu élargi pour grand écran, mais menu du bas identique au mobile (photo de référence) */
@media (min-width:900px){
  body{overflow:auto;}
  .app{height:100vh;}
  .topbar{padding:24px 40px 10px;}
  /* La barre de recherche et les titres suivent la largeur de l'écran : seules
     les grilles se densifient, pour ne pas étirer une carte sur 2 000 px. */
  .view-scroll{padding:8px 40px 140px;}

  .greeting{font-size:44px;}
  .cat-row{overflow-x:visible;flex-wrap:wrap;}
  .cat-card{flex:1 1 200px;max-width:280px;height:170px;}
  .memo-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));}
  .ext-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));}

  .overlay{align-items:center;justify-content:center;}
  .record-sheet, .detail-sheet{max-width:520px;border-radius:28px;}
  .device-sheet{max-width:620px;}

  /* carte en grand bloc arrondi, dans les marges, au-dessus de la barre du bas */
  #mapEl{inset:4px 40px 104px;border-radius:28px;overflow:hidden;box-shadow:0 0 0 1px var(--line);}
  .map-tools{right:56px;top:20px;}
  .map-add{right:56px;bottom:124px;}
  .map-add-hint{top:auto;bottom:124px;left:56px;transform:none;}
  .map-sheet{
    left:56px;right:auto;top:20px;bottom:auto;width:320px;max-height:calc(100% - 150px);
    border-radius:22px;padding:16px 16px 14px;
    background:color-mix(in srgb, #fff 90%, transparent);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    box-shadow:var(--shadow-md);
  }
  .map-sheet .sheet-handle{display:none;}

  .nav-icon{width:30px;height:30px;}
  .chat-scroll{padding:8px 40px 130px;}

  /* Navigation : colonne flottante à gauche, même pastille qu'en bas. */
  .app{padding-left:96px;padding-right:96px;}   /* même marge des deux côtés */
  .bottombar-wrap{
    position:fixed;left:20px;top:50%;transform:translateY(-50%);
    flex-direction:column;justify-content:center;
    width:72px;height:auto;padding:14px 0;gap:12px;border-radius:36px;
  }
  .bottombar-wrap .navpill{padding:0;width:58px;height:58px;border-radius:22px;font-size:10px;gap:4px;}
  .bottombar-wrap .nav-icon{width:24px;height:24px;}
  .navpill[data-view="chat"]{display:none;}

  /* À la place de la nav : la saisie « Demander à Rick », toujours là. */
  .chat-bar,body[data-view="chat"] .chat-bar{
    display:flex;position:relative;flex:0 1 720px;margin:0;
    min-height:60px;align-items:center;padding:10px 10px 10px 24px;border-radius:30px;
    background:color-mix(in srgb, var(--bg-card) 80%, transparent);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    box-shadow:var(--shadow-md);
  }
  .chat-bar textarea{padding:8px 0;}
  .chat-reset{background:var(--tile);}

  .bottombar{padding:0 210px;}
  .navpill{font-size:11px;gap:6px;}
  .bottombar-wrap{flex:none;}

  /* Importer : disque gris ancré dans le coin bas gauche, dont on ne voit
     qu'un quart. Au survol, il sort de son coin. */
  .import-fab{
    position:fixed;left:-130px;bottom:-130px;z-index:600;
    width:280px;height:280px;margin:0;padding:0;display:block;
    border:none;border-radius:50%;cursor:pointer;color:var(--ink);
    background:var(--tile-active);box-shadow:0 0 40px rgba(23,21,18,.08);
    transition:transform .45s cubic-bezier(.2,1.4,.4,1), box-shadow .3s ease, background .2s ease;
  }
  .import-fab::before{
    content:"";position:absolute;inset:0;border-radius:50%;
    z-index:-1;pointer-events:none;background:var(--tile-active);
    animation:micRing 4.4s ease-out infinite;
  }
  @keyframes micRing{
    0%{transform:scale(1);opacity:.45;}
    70%,100%{transform:scale(1.28);opacity:0;}
  }
  /* icône centrée sur le quart visible (150 px de côté au repos), texte dessous */
  .import-fab .mic-inner{
    position:absolute;top:88px;right:88px;width:0;height:0;display:block;
    transition:transform .45s cubic-bezier(.2,1.4,.4,1);
  }
  .import-fab .mic-icon{
    position:absolute;left:-17px;top:-17px;width:34px;height:34px;
    transition:transform .35s cubic-bezier(.2,1.6,.4,1);
  }
  .import-fab .mic-label{
    display:block;position:absolute;top:26px;left:0;transform:translate(-50%,-4px);
    font:700 22px/1 'Caveat',cursive;color:var(--ink);white-space:nowrap;
    opacity:0;transition:opacity .25s ease, transform .3s ease;
  }
  .import-fab:hover,.import-fab:focus-visible,.import-fab.drop-over{transform:translate(46px,-46px);box-shadow:0 0 50px rgba(23,21,18,.14);outline:none;}
  .import-fab.drop-over{background:var(--accent-soft);}
  .import-fab:hover::before{animation-duration:1.6s;}
  .import-fab:hover .mic-inner,.import-fab.drop-over .mic-inner{transform:translate(-20px,12px);}
  .import-fab:hover .mic-icon,.import-fab.drop-over .mic-icon{transform:scale(1.2) translateY(-3px);}
  .import-fab:hover .mic-label,.import-fab.drop-over .mic-label{opacity:1;transform:translate(-50%,0);}
  .import-fab:active{transform:translate(46px,-46px) scale(.96);}

  /* Enregistrer : disque lime dans le coin bas droit, pendant du disque
     gris d'import à gauche (mêmes dimensions, même animation). */
  .mic-fab{
    position:fixed;right:-130px;bottom:-130px;z-index:600;
    width:280px;height:280px;margin:0;padding:0;display:block;
    border:none;border-radius:50%;cursor:pointer;color:var(--ink);
    background:var(--accent);box-shadow:0 0 40px rgba(150,190,20,.35);
    transition:transform .45s cubic-bezier(.2,1.4,.4,1), box-shadow .3s ease;
  }
  .mic-fab::before,.mic-fab::after{
    content:"";position:absolute;inset:0;border-radius:50%;
    z-index:-1;pointer-events:none;background:var(--accent);
    animation:micRing 3.2s ease-out infinite;
  }
  .mic-fab::after{animation-delay:1.6s;}
  .mic-fab .mic-inner{
    position:absolute;top:88px;left:88px;width:0;height:0;display:block;
    transition:transform .45s cubic-bezier(.2,1.4,.4,1);
  }
  .mic-fab .mic-icon{
    position:absolute;left:-17px;top:-17px;width:34px;height:34px;
    transition:transform .35s cubic-bezier(.2,1.6,.4,1);
  }
  .mic-fab .mic-label{
    display:block;position:absolute;top:26px;left:0;transform:translate(-50%,-4px);
    font:700 22px/1 'Caveat',cursive;color:var(--ink);white-space:nowrap;
    opacity:0;transition:opacity .25s ease, transform .3s ease;
  }
  .mic-fab:hover,.mic-fab:focus-visible{transform:translate(-46px,-46px);box-shadow:0 0 60px rgba(150,190,20,.55);outline:none;}
  .mic-fab:hover::before,.mic-fab:hover::after{animation-duration:1.4s;}
  .mic-fab:hover::after{animation-delay:.7s;}
  .mic-fab:hover .mic-inner{transform:translate(20px,12px);}
  .mic-fab:hover .mic-icon{transform:scale(1.2) rotate(-8deg);}
  .mic-fab:hover .mic-label{opacity:1;transform:translate(-50%,0);}
  .mic-fab:active{transform:translate(-46px,-46px) scale(.96);}

  @media (prefers-reduced-motion: reduce){
    .import-fab::before,.mic-fab::before,.mic-fab::after{animation:none;opacity:0;}
  }
}
@media (min-width:1500px){
  .topbar{padding:26px 64px 10px;}
  .view-scroll{padding:8px 64px 150px;}
}


/* ============ DÉMO SANS COMPTE ============ */
/* Le bouton de connexion n'existe que tant qu'on n'a pas de compte ; les
   réglages et le Bluetooth, eux, n'ont pas de sens sans compte. */
.pill-login{display:none;}
body.is-demo .pill-login{
  display:inline-flex;align-items:center;
  height:34px;padding:0 16px;border-radius:999px;
  background:var(--ink);color:var(--bg);
  font-size:12.5px;font-weight:700;letter-spacing:.01em;
  border:none;cursor:pointer;white-space:nowrap;
}
/* opacité plutôt qu'une couleur figée : le bouton s'inverse en thème sombre */
body.is-demo .pill-login:hover{opacity:.86;}
body.is-demo #btnAccount,
body.is-demo #btnBluetooth{display:none;}

/* En démo, la popup se referme : on rend la main à la démo derrière. */
.login-overlay.is-demo{background:rgba(20,18,14,.55);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);}
.login-sheet{position:relative;}
.login-close{
  position:absolute;top:12px;right:14px;
  width:32px;height:32px;border-radius:50%;
  border:none;background:transparent;cursor:pointer;
  font-size:22px;line-height:1;color:var(--ink-faint);
}
.login-close:hover{background:rgba(0,0,0,.06);color:var(--ink);}

/* État de la transcription live : sans ça, un micro refusé ou une session
   AssemblyAI tombée ne se voient nulle part — l'écran reste sur « Parlez… ». */
.stt-status{
  margin:8px 2px 0;font-size:12px;line-height:1.45;
  color:var(--ink-faint);
}
.stt-status.ok{color:var(--green);}
.stt-status.warn{color:var(--amber);}
.stt-status.err{color:var(--red);}

/* Métier desservi par un connecteur, sous son nom. */
.ext-pro{
  margin:2px 0 4px;font-size:11px;font-weight:600;letter-spacing:.02em;
  color:var(--accent-deep);
}

/* ============ FENÊTRES INTÉGRÉES (remplacent prompt/confirm/alert) ============ */
.ui-overlay{
  position:fixed;inset:0;z-index:1200;
  display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(23,21,18,.32);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  animation:uiFade .16s ease both;
}
.ui-overlay[hidden]{display:none;}
.ui-overlay.closing{animation:uiFadeOut .14s ease both;}
.ui-dialog{
  width:100%;max-width:420px;background:#fff;border-radius:26px;
  padding:24px 24px 20px;box-shadow:var(--shadow-lg);
  display:flex;flex-direction:column;gap:14px;
  animation:uiPop .24s cubic-bezier(.2,1.2,.4,1) both;
}
.ui-overlay.closing .ui-dialog{animation:uiPopOut .14s ease both;}
@keyframes uiFade{from{opacity:0;}to{opacity:1;}}
@keyframes uiFadeOut{to{opacity:0;}}
@keyframes uiPop{from{opacity:0;transform:translateY(10px) scale(.96);}to{opacity:1;transform:none;}}
@keyframes uiPopOut{to{opacity:0;transform:scale(.97);}}
.ui-title{font:800 19px/1.25 'Inter',sans-serif;color:var(--ink);}
.ui-title:empty{display:none;}
.ui-msg{font-size:14px;line-height:1.55;color:var(--ink-soft);white-space:pre-line;margin-top:-6px;}
.ui-title:empty + .ui-msg{margin-top:0;color:var(--ink);font-size:15px;}
.ui-fields{display:flex;flex-direction:column;gap:8px;}
.ui-fields:empty{display:none;}
.ui-label{font-size:11px;font-weight:800;letter-spacing:1px;text-transform:uppercase;color:var(--ink-faint);margin-top:6px;}
.ui-input{
  width:100%;border:none;border-radius:14px;background:var(--tile);
  padding:14px 16px;font:500 15px 'Inter',sans-serif;color:var(--ink);outline:none;
  transition:box-shadow .15s ease;
}
.ui-input:focus{box-shadow:0 0 0 2px var(--ink);}
.ui-emojis{display:flex;flex-wrap:wrap;gap:6px;}
.ui-emoji{
  width:40px;height:40px;border-radius:12px;border:none;cursor:pointer;
  background:var(--tile);font-size:19px;
  transition:transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.ui-emoji:hover{background:var(--tile-active);transform:scale(1.06);}
.ui-emoji.on{background:var(--accent-soft);box-shadow:inset 0 0 0 2px var(--accent);}
.ui-toggle{display:flex;gap:4px;background:var(--tile);border-radius:14px;padding:4px;}
.ui-seg{
  flex:1;border:none;border-radius:11px;padding:10px 8px;cursor:pointer;background:none;
  font:600 13px 'Inter',sans-serif;color:var(--ink-soft);
}
.ui-seg.on{background:#fff;color:var(--ink);box-shadow:var(--shadow-sm);}
.ui-choices{display:flex;flex-direction:column;gap:6px;max-height:50vh;overflow-y:auto;}
.ui-choice{
  text-align:left;border:none;border-radius:14px;padding:13px 16px;cursor:pointer;
  background:var(--tile);font:600 14px 'Inter',sans-serif;color:var(--ink);
  transition:background .15s ease;
}
.ui-choice:hover{background:var(--tile-active);}
.ui-choice.on{background:var(--accent-soft);box-shadow:inset 0 0 0 2px var(--accent);}
.ui-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px;}
.ui-btn{
  border:none;border-radius:999px;padding:12px 20px;cursor:pointer;
  font:700 14px 'Inter',sans-serif;
  transition:transform .15s ease, background .15s ease, opacity .15s ease;
}
.ui-btn:active{transform:scale(.97);}
.ui-cancel{background:var(--tile);color:var(--ink-soft);}
.ui-cancel:hover{background:var(--tile-active);color:var(--ink);}
.ui-ok{background:var(--accent);color:var(--ink);}
.ui-ok:hover{filter:brightness(.96);}
.ui-ok:disabled{background:var(--tile-active);color:#b4b2ab;cursor:default;}
.ui-ok.danger{background:var(--red);color:#fff;}

/* petites notifications */
.ui-toasts{
  position:fixed;left:50%;bottom:110px;transform:translateX(-50%);z-index:1300;
  display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;
  width:max-content;max-width:calc(100vw - 32px);
}
.ui-toast{
  background:var(--ink);color:#fff;border-radius:999px;padding:11px 18px;
  font:600 13px 'Inter',sans-serif;box-shadow:var(--shadow-md);text-align:center;
  animation:uiPop .24s cubic-bezier(.2,1.2,.4,1) both;
}
.ui-toast.out{animation:uiPopOut .22s ease both;}

@media (prefers-reduced-motion: reduce){
  .ui-overlay,.ui-dialog,.ui-toast,.ui-overlay.closing,.ui-overlay.closing .ui-dialog,.ui-toast.out{animation:none;}
}
