/* ImmobilIA — feuille de style commune
   Repères : surfaces sobres, séparateurs discrets, une seule couleur d'accent,
   respiration généreuse. Aucune icône décorative : chaque symbole a une fonction. */

:root {
  --bg: #000000;
  --surface: #131315;
  --surface-2: #1c1c1f;
  --surface-3: #26262a;
  --separator: rgba(120, 122, 130, 0.22);
  --separator-strong: rgba(120, 122, 130, 0.38);

  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.34);

  --accent: #0a84ff;
  --accent-hover: #339dff;
  --accent-soft: rgba(10, 132, 255, 0.14);
  --green: #30d158;
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.13);
  --orange: #ff9f0a;

  --r-sm: 7px;
  --r: 11px;
  --r-lg: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; }

/* L'attribut « hidden » doit l'emporter sur toute règle d'affichage. Sans
   cela, une classe posant un display — .btn, .alert, .card — le rend
   silencieusement inopérant, et l'élément reste visible. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.022em;
}
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------------------------------------------------------------------- icônes */

.ico {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: block;
  color: inherit;
}
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 26px; height: 26px; }

/* ------------------------------------------------------------------ contrôles */

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.4; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 13px; color: var(--label-2); font-weight: 500; }
.field .note { font-size: 12px; color: var(--label-3); }

.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--label);
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.input:hover { background: var(--surface-3); }
.input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.input::placeholder { color: var(--label-3); }
select.input { cursor: pointer; appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-2) 50%),
                    linear-gradient(135deg, var(--label-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 14.5px; font-weight: 500;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
              transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { border-color: var(--separator); color: var(--label); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--separator-strong); }
.btn-quiet { color: var(--label-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--label); }
.btn-danger { border-color: var(--separator); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: rgba(255, 69, 58, 0.4); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: var(--r-sm); }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  color: var(--label-2);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--label); }

/* ------------------------------------------------------------------- messages */

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert .ico { margin-top: 1px; }
.alert-error { background: var(--red-soft); border-color: rgba(255, 69, 58, 0.28); color: #ff9d96; }
.alert-ok { background: rgba(48, 209, 88, 0.1); border-color: rgba(48, 209, 88, 0.26); color: #7ee79a; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
  background: var(--surface-3); color: var(--label-2);
}
.tag-admin { background: rgba(255, 159, 10, 0.14); color: var(--orange); }
.tag-off { background: transparent; color: var(--label-3); box-shadow: inset 0 0 0 1px var(--separator); }

/* ----------------------------------------------------------------- connexion */

.login-wrap {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 372px; }

.login-brand { text-align: center; margin-bottom: 34px; }
.login-brand .mark {
  width: 54px; height: 54px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--label);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.login-brand h1 { font-size: 27px; letter-spacing: -0.026em; }
.login-brand p { margin-top: 6px; color: var(--label-2); font-size: 14.5px; }

.login-foot {
  margin-top: 26px; text-align: center;
  font-size: 12.5px; color: var(--label-3); line-height: 1.5;
}

/* --------------------------------------------------------------- application */

.app { display: grid; grid-template-columns: 272px 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--separator);
  display: flex; flex-direction: column; min-width: 0;
}
.sidebar-head { padding: 16px 14px 12px; }
.brand-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 18px;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em;
}
.brand-row .ico { color: var(--label); }

.conv-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.conv-group {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--label-3);
  padding: 12px 8px 6px;
}
.conv-empty {
  padding: 18px 12px; font-size: 13px; color: var(--label-3); line-height: 1.5;
}

.conv-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--label-2); font-size: 14px;
  cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.conv-item:hover { background: var(--surface-2); color: var(--label); }
.conv-item.active { background: var(--surface-3); color: var(--label); }
.conv-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.conv-item > .ico { color: var(--label-3); }
.conv-item.active > .ico { color: var(--accent); }
.conv-item .del {
  opacity: 0; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 5px; color: var(--label-3);
}
.conv-item:hover .del { opacity: 1; }
.conv-item .del:hover { color: var(--red); background: var(--red-soft); }

.sidebar-foot { border-top: 1px solid var(--separator); padding: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--r); text-align: left;
  transition: background 0.15s var(--ease);
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: 0;
}
.user-chip .who { flex: 1; min-width: 0; }
.user-chip .who .n {
  display: block; font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip .who .r { display: block; font-size: 12px; color: var(--label-3); }
.user-chip .ico { color: var(--label-3); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--separator);
  min-height: 57px;
}
.topbar .title {
  flex: 1; font-size: 15px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#menuBtn { display: none; }

.engine { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--label-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); flex-shrink: 0; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }

/* ------------------------------------------------------------------- panneaux */

.view { flex: 1; overflow-y: auto; }

.panel { max-width: 820px; margin: 0 auto; padding: 40px 28px 72px; }
.panel-head { margin-bottom: 30px; }
.panel-head h2 { font-size: 25px; letter-spacing: -0.024em; }
.panel-head p { color: var(--label-2); font-size: 14.5px; margin-top: 7px; max-width: 60ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--separator);
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 6px 20px 18px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 8px 10px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--label-3);
  border-bottom: 1px solid var(--separator);
}
.table td { padding: 13px 8px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .actions { text-align: right; white-space: nowrap; }
.table .sub { color: var(--label-3); font-size: 12.5px; }
.row-off .cell-identity, .row-off .cell-date { opacity: 0.45; }

.cell-identity { display: flex; align-items: center; gap: 11px; }
.cell-identity .avatar { width: 30px; height: 30px; font-size: 12px; }
.cell-identity .avatar.muted { background: var(--surface-3); color: var(--label-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ------------------------------------------------------------------ réglages */

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 0;
}
.setting-row .sub { color: var(--label-3); font-size: 13px; margin-top: 3px; }
.setting-actions { display: flex; gap: 8px; flex-shrink: 0; }

.update-progress {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; margin-top: 4px;
  background: var(--surface-2); border-radius: var(--r);
  font-size: 14px; color: var(--label-2);
}

.spinner {
  width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid var(--separator-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.log {
  margin: 14px 0 0; padding: 13px 15px;
  background: var(--surface-2); border-radius: var(--r);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: var(--label-2);
  white-space: pre-wrap; overflow-x: auto;
  max-height: 240px; overflow-y: auto;
}

/* Choix du moteur : des tuiles plutôt qu'une liste déroulante, pour que
   l'ensemble des possibilités soit visible d'un seul regard. */
.engine-grid {
  display: grid; gap: 10px; margin: 4px 0 20px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.engine-choice {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; text-align: left;
  background: var(--surface-2); border: none; border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--separator);
  color: var(--label); font: inherit; font-size: 14px;
  cursor: pointer; transition: box-shadow 0.15s ease, background 0.15s ease;
}
.engine-choice:hover { background: var(--surface-3); }
.engine-choice[aria-checked="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
}
.engine-choice .ico { flex-shrink: 0; opacity: 0.7; }
.engine-choice[aria-checked="true"] .ico { opacity: 1; }
.engine-choice-name { font-weight: 500; }
.engine-choice-name small {
  display: block; margin-top: 2px;
  font-size: 12px; font-weight: 400; color: var(--label-3);
}
.engine-choice[aria-checked="true"] .engine-choice-name small { color: inherit; opacity: 0.75; }

.field-row {
  display: grid; gap: 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ---------------------------------------------------------------------- agenda */

.agenda-card { margin-bottom: 22px; }
.agenda-day {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--label-3);
  padding: 14px 0 7px;
}
.agenda-day:first-child { padding-top: 0; }

.agenda-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 11px 12px; margin: 0 -12px;
  border-radius: var(--r-sm);
  text-align: left; color: var(--label);
  transition: background 0.15s var(--ease);
}
.agenda-item:hover { background: var(--surface-2); }
.agenda-item .ico { color: var(--label-3); margin-left: auto; }

.agenda-time {
  flex-shrink: 0; width: 58px;
  font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 500; color: var(--label-2);
}
.agenda-body { min-width: 0; }
.agenda-subject { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-detail {
  margin-top: 2px; font-size: 12.5px; color: var(--label-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.agenda-empty { font-size: 13.5px; color: var(--label-3); padding: 4px 0; }
.agenda-problem {
  padding: 11px 13px; margin-bottom: 10px;
  background: var(--red-soft); border-radius: var(--r);
  font-size: 13px; color: #ff9d96;
}

/* Bandeau de confirmation, au-dessus de toutes les vues. */
.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 13px 18px; border-radius: var(--r);
  background: var(--surface-3); color: var(--label);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--separator);
  font-size: 14px; line-height: 1.45;
}
.toast-ok .ico { color: var(--green); }
.toast-error { box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 69, 58, 0.42); }
.toast-error .ico { color: var(--red); }

/* ------------------------------------------------------------------ dialogues */

dialog {
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--label);
  padding: 26px;
  width: min(432px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.dialog-wide .log { max-height: 46vh; }

dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
dialog h3 { font-size: 18px; letter-spacing: -0.02em; }
dialog .lead { color: var(--label-2); font-size: 13.5px; margin: 6px 0 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ------------------------------------------------- parcours guidé (messagerie)

   Raccorder une boîte est le moment où l'on perd un utilisateur non technique.
   D'où un cheminement en étapes plutôt qu'un formulaire : à chaque instant une
   seule chose est demandée, et l'aide correspond au fournisseur choisi. */

.wizard { width: min(620px, calc(100vw - 32px)); }

.wizard-rail {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 24px; padding: 0; list-style: none;
}
.wizard-rail li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--label-3); white-space: nowrap;
}
.wizard-rail li::after {
  content: ""; width: 18px; height: 1px; background: var(--separator);
}
.wizard-rail li:last-child::after { display: none; }
.wizard-rail .pip {
  display: grid; place-items: center;
  width: 21px; height: 21px; border-radius: 50%;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--label-3);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.wizard-rail li[data-state="current"] { color: var(--label); }
.wizard-rail li[data-state="current"] .pip { background: var(--accent); color: #fff; box-shadow: none; }
.wizard-rail li[data-state="done"] { color: var(--label-2); }
.wizard-rail li[data-state="done"] .pip { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

.wizard-body { min-height: 268px; }

/* Choix du fournisseur */
.provider-grid {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}
.provider-choice {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; text-align: left;
  background: var(--surface-2); border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--separator);
  color: var(--label); font-size: 14px;
  transition: box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.provider-choice:hover { background: var(--surface-3); }
.provider-choice[aria-checked="true"] {
  background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent);
}
.provider-choice .ico { opacity: 0.7; }
.provider-choice[aria-checked="true"] .ico { opacity: 1; }
.provider-choice small {
  display: block; margin-top: 2px;
  font-size: 12px; color: var(--label-3);
}
.provider-choice[aria-checked="true"] small { color: inherit; opacity: 0.75; }

/* Marche à suivre chez le fournisseur */
.recipe { list-style: none; margin: 0; padding: 0; counter-reset: recipe; }
.recipe li {
  position: relative;
  counter-increment: recipe;
  padding: 0 0 18px 38px;
  font-size: 14px; line-height: 1.55;
}
.recipe li::before {
  content: counter(recipe);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--separator);
  font-size: 12.5px; font-weight: 600; color: var(--label-2);
}
.recipe li:last-child { padding-bottom: 6px; }
.recipe .recipe-title { font-weight: 500; }
.recipe .recipe-body { color: var(--label-2); margin-top: 3px; }
.recipe .recipe-link { display: inline-block; margin-top: 6px; font-size: 13.5px; }

/* Issue de secours, quand le fournisseur ferme la porte. */
.detour {
  margin-top: 6px; padding: 13px 15px;
  background: var(--accent-soft); border-radius: var(--r);
  font-size: 13.5px; line-height: 1.55; color: var(--label);
}

/* Bulle d'information : l'explication reste disponible sans encombrer. */
.help-bubble {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; margin-left: 5px;
  border-radius: 50%; vertical-align: -2px;
  background: var(--surface-3); color: var(--label-2);
  font-size: 10.5px; font-weight: 700; font-style: normal;
  cursor: help; position: relative;
}
.help-bubble:hover, .help-bubble:focus-visible { background: var(--accent); color: #fff; }
.help-bubble::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: 268px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--label);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--separator);
  font-size: 12.5px; font-weight: 400; line-height: 1.45;
  text-align: left; white-space: normal;
  opacity: 0; visibility: hidden;
  transition: opacity 0.15s var(--ease);
  z-index: 5;
}
.help-bubble:hover::after, .help-bubble:focus-visible::after { opacity: 1; visibility: visible; }

/* Réglages avancés : présents, mais repliés — presque personne n'y touchera. */
.advanced { margin-top: 4px; }
.advanced summary {
  font-size: 13px; color: var(--label-2);
  cursor: pointer; padding: 6px 0; list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸ "; color: var(--label-3); }
.advanced[open] summary::before { content: "▾ "; }
.advanced .grid-2 { margin-top: 10px; }

/* Code d'appariement Microsoft : il doit se lire de loin et se recopier sans
   erreur, y compris depuis un téléphone. */
.device-code {
  margin: 18px auto; padding: 15px 20px; width: fit-content;
  background: var(--surface-2); border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--separator);
  font-family: var(--mono); font-size: 27px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--label);
  user-select: all;
}

/* Résultat de la vérification */
.verdict { text-align: center; padding: 26px 8px 8px; }
.verdict .seal {
  width: 46px; height: 46px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 50%;
}
.verdict.good .seal { background: rgba(48, 209, 88, 0.14); color: var(--green); }
.verdict.bad .seal { background: var(--red-soft); color: var(--red); }
.verdict h4 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; }
.verdict p { margin-top: 7px; color: var(--label-2); font-size: 14px; line-height: 1.55; }
.verdict .remedy {
  margin: 18px auto 0; max-width: 400px; padding: 13px 15px;
  background: var(--surface-2); border-radius: var(--r);
  font-size: 13.5px; color: var(--label-2); text-align: left; line-height: 1.55;
}

.menu-list { display: flex; flex-direction: column; gap: 2px; margin: 4px -8px 0; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--label); text-align: left; width: 100%;
  transition: background 0.15s var(--ease);
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { color: var(--label-2); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .ico { color: var(--red); }

/* ------------------------------------------------------------------- échanges */

.messages { flex: 1; overflow-y: auto; padding: 32px 0 8px; }
.msg { max-width: 764px; margin: 0 auto; padding: 10px 24px; display: flex; gap: 15px; }
.msg .who { flex-shrink: 0; }
.msg .who .avatar { width: 30px; height: 30px; font-size: 12px; }
.msg .who .agent {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--label);
}
.msg .body { flex: 1; min-width: 0; padding-top: 3px; }
.msg .label { font-size: 12.5px; color: var(--label-3); margin-bottom: 4px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .text code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 13px;
}
.msg .text pre {
  background: var(--surface-2); border: 1px solid var(--separator);
  padding: 14px 16px; border-radius: var(--r); overflow-x: auto; margin: 12px 0;
}
.msg .text pre code { background: none; padding: 0; }
.msg .text strong { font-weight: 600; }
.msg-error { display: flex; align-items: flex-start; gap: 8px; color: var(--red); margin-top: 10px; font-size: 14px; }

.typing::after {
  content: ""; display: inline-block;
  width: 7px; height: 15px; margin-left: 2px;
  background: var(--accent); border-radius: 1.5px;
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.empty { max-width: 560px; margin: 11vh auto 0; text-align: center; padding: 20px; }
.empty .mark {
  width: 52px; height: 52px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 14px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.empty h2 { font-size: 24px; letter-spacing: -0.024em; }
.empty p { color: var(--label-2); margin: 8px 0 30px; }
.chips { display: flex; flex-direction: column; gap: 8px; }
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--separator);
  color: var(--label); padding: 13px 16px; border-radius: var(--r);
  font-size: 14px; text-align: left;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover { background: var(--surface-2); border-color: var(--separator-strong); }
.chip .ico { color: var(--label-3); }

/* ---------------------------------------------------------------- assistants */

.empty-wide { max-width: 760px; }

.assistant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.assistant-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--r); text-align: left;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.assistant-card:hover { background: var(--surface-2); border-color: var(--separator-strong); }
.assistant-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.assistant-card .glyph {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-3); color: var(--label);
}
.assistant-card.selected .glyph { background: var(--accent); color: #fff; }
.assistant-card .n { font-size: 14px; font-weight: 550; }
.assistant-card .d { font-size: 12.5px; color: var(--label-3); margin-top: 3px; line-height: 1.45; }

.assistant-banner {
  max-width: 764px; margin: 0 auto 10px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: 999px; font-size: 13px; color: var(--label-2);
  width: fit-content;
}
.assistant-banner .ico { color: var(--accent); }
.assistant-banner .drop {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; color: var(--label-3);
}
.assistant-banner .drop:hover { background: var(--surface-3); color: var(--label); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.chip-row .chip { flex: 0 1 auto; }

.cell-assistant { display: flex; align-items: center; gap: 12px; }
.cell-assistant .glyph {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-2); color: var(--label);
}

/* ------------------------------------------------------------------- cockpit */

.panel-wide { max-width: 940px; }
.cockpit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.cockpit-head .setting-actions { align-items: center; }

.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 2px; }
.section-head .ico { color: var(--label-3); }
.section-head h3 { font-size: 16px; letter-spacing: -0.018em; }
.section-head .count {
  font-size: 12px; font-weight: 600; color: var(--label-2);
  background: var(--surface-3); border-radius: 20px; padding: 2px 9px;
}
.section-head .hint { font-size: 12.5px; color: var(--label-3); margin-left: auto; }

.brief { display: flex; flex-direction: column; gap: 8px; }
.brief-item {
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--r); padding: 14px 16px;
  transition: border-color 0.15s var(--ease);
}
.brief-item:hover { border-color: var(--separator-strong); }
.brief-item.urgent { border-left: 2px solid var(--orange); }

.brief-top { display: flex; align-items: baseline; gap: 10px; }
.brief-top .who { font-weight: 550; font-size: 14.5px; }
.brief-top .when { font-size: 12px; color: var(--label-3); margin-left: auto; white-space: nowrap; }
.brief-subject { font-size: 13px; color: var(--label-3); margin-top: 2px; }
.brief-summary { font-size: 14px; color: var(--label-2); margin-top: 8px; line-height: 1.5; }

.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fact {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); color: var(--label-2);
}
.fact b { font-weight: 600; color: var(--label); }
.fact.warn { background: rgba(255, 159, 10, 0.13); color: var(--orange); }

.brief-actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }

.cockpit-empty { text-align: center; padding: 56px 20px; }
.cockpit-empty .mark {
  width: 48px; height: 48px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 13px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--separator);
}
.cockpit-empty h3 { font-size: 19px; }
.cockpit-empty p { color: var(--label-2); margin-top: 8px; font-size: 14px; }
.cockpit-empty .btn { margin-top: 22px; }

/* ------------------------------------------------- réponse prête à envoyer */

.reply-bar {
  max-width: 764px; margin: 0 auto 10px;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(10, 132, 255, 0.32);
  border-radius: var(--r);
  font-size: 13.5px; color: var(--label);
}
.reply-bar .ico { color: var(--accent); }
.reply-bar .reply-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer { padding: 14px 24px 16px; }
.composer-box {
  max-width: 764px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: 16px; padding: 9px 9px 9px 16px;
  transition: border-color 0.18s var(--ease);
}
.composer-box:focus-within { border-color: var(--separator-strong); }
#input {
  flex: 1; resize: none; background: none; border: none; outline: none;
  max-height: 200px; padding: 6px 0; font-size: 15px; line-height: 1.5;
}
#input::placeholder { color: var(--label-3); }
.send {
  display: grid; place-items: center;
  width: 33px; height: 33px; flex-shrink: 0;
  border-radius: 50%; background: var(--accent); color: #fff;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease);
}
.send:hover:not(:disabled) { background: var(--accent-hover); }
.send:active:not(:disabled) { transform: scale(0.93); }
.send.stop { background: var(--surface-3); color: var(--label); }
.hint {
  max-width: 764px; margin: 9px auto 0; text-align: center;
  font-size: 12px; color: var(--label-3);
}

/* ------------------------------------------------------------------ adaptatif */

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; width: 272px; height: 100vh;
    transform: translateX(-100%); transition: transform 0.28s var(--ease);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 30;
    background: rgba(0, 0, 0, 0.55);
  }
  #menuBtn { display: grid; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel { padding: 28px 20px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
