/* =====================================================================
   SOPH Slack — charte Sophia Engineering
   Noir / blanc ; le dégradé « spectre » signale ce qui relève de l'IA
   (avatars des salariés IA) et l'élément actif. Rien d'autre n'est décoré.
   Points de rupture : téléphone < 700 px, tablette < 1100 px, ordinateur au-delà.
   ===================================================================== */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url('/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mist: #f4f4f4;
  --line: #e6e6e6;
  --line-strong: #cfcfcf;
  --muted: #6b6b6b;
  --sidebar-text: #bdbdbd;
  --sidebar-hover: #1c1c1c;
  --sidebar-active: #262626;
  --focus: #3ca6f5;
  --danger: #c4000a;
  --success: #12795f;
  --mention-bg: #fff6c2;
  --s1: #ff0712; --s2: #fd792b; --s3: #f8e617; --s4: #bee319; --s5: #2ac6a1; --s6: #3ca6f5; --s7: #312357;
  --spectrum: linear-gradient(90deg, #ff0712, #fd792b, #f8e617, #bee319, #2ac6a1, #3ca6f5, #312357);
  --spectrum-ring: conic-gradient(from 200deg, #ff0712, #fd792b, #f8e617, #bee319, #2ac6a1, #3ca6f5, #312357, #ff0712);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Inter', sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 272px;
  --thread-w: 380px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

/* ---------- Typographie ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0.005em;
}
.subtitle { font-size: 1rem; font-weight: 700; }
.hint, .pane-subtitle, .field-hint, .result-count { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.form-error { color: var(--danger); font-size: 0.9rem; font-weight: 500; }
.notice { font-size: 0.875rem; background: var(--mist); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 42px; padding: 0 1.1rem; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 18px; height: 18px; }
.btn span[data-icon] { display: grid; }
.btn-sm { min-height: 34px; padding: 0 0.9rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2b2b2b; }
.btn-secondary { background: var(--paper); border-color: var(--ink); }
.btn-secondary:hover { background: var(--mist); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--mist); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-google { width: 100%; background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn-google:hover { background: var(--mist); }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: inherit;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--mist); }
.icon-btn-dark { color: var(--sidebar-text); }
.icon-btn-dark:hover { background: var(--sidebar-hover); color: #fff; }

/* ---------- Champs ---------- */
.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper);
  font-size: 1rem; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(60, 166, 245, 0.35); }
input[readonly] { background: var(--mist); color: var(--muted); }
select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23000' stroke-width='1.8'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
}
.form-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.form-status { font-size: 0.9rem; font-weight: 500; color: var(--success); }
.form-status.error { color: var(--danger); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 0.7rem; font-weight: 600; cursor: pointer; }
/* La vraie case à cocher couvre tout le libellé : clic, toucher et outils d'accessibilité l'atteignent. */
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); flex: none; transition: background 0.15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--ink); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }

.search { position: relative; display: block; }
.search > span { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.search svg { width: 18px; height: 18px; }
.search input { padding-left: 2.4rem; }

/* ---------- Avatars ---------- */
.avatar {
  --size: 36px;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-grid; place-items: center; background: #e9e9e9 center / cover no-repeat;
  color: var(--ink); font-weight: 700; font-size: calc(var(--size) * 0.4); line-height: 1;
}
.avatar-sm { --size: 30px; }
.avatar-lg { --size: 52px; }
/* Salarié IA : anneau spectre — la signature visuelle de l'application. */
.avatar.bot { isolation: isolate; background-color: var(--ink); color: #fff; box-shadow: 0 0 0 2px var(--paper); }
.avatar.bot::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--spectrum-ring); z-index: -1; }
.sidebar .avatar.bot { box-shadow: 0 0 0 2px var(--ink); }
.ai-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 0.4rem; border-radius: 4px;
  background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.ai-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--spectrum-ring); vertical-align: -1px; flex: none; }

/* =====================================================================
   Connexion
   ===================================================================== */
.login { height: 100%; display: grid; grid-template-columns: minmax(320px, 5fr) 6fr; overflow-y: auto; }
.login-brand {
  position: relative; background: var(--ink); color: #fff; padding: clamp(2rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem;
}
.login-brand::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--spectrum); }
.login-logo { width: 150px; }
.login-pitch { display: grid; gap: 1rem; max-width: 26ch; }
.login-pitch p { font-size: 1.15rem; color: #d6d6d6; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; color: #bdbdbd; font-size: 0.95rem; }
.login-points li { display: flex; gap: 0.6rem; align-items: center; }
.login-points li::before { content: ''; width: 12px; height: 2px; background: #fff; flex: none; }
.login-points li:has(.ai-dot)::before { display: none; }
.login-panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem); background: var(--paper); }
.login-card { width: min(400px, 100%); display: grid; gap: 1.25rem; }
.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* =====================================================================
   Application : coquille
   ===================================================================== */
.shell {
  position: relative; height: 100%;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr);
}
.spectrum-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--spectrum); z-index: 5; pointer-events: none; }

/* ---------- Barre latérale ---------- */
.sidebar { background: var(--ink); color: #fff; display: flex; flex-direction: column; min-height: 0; padding-top: 3px; }
.sidebar-head { display: flex; align-items: center; gap: 0.75rem; padding: 1.1rem 1.1rem 0.9rem; }
.sidebar-logo { width: 84px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 0.75rem; margin: -0.35rem; padding: 0.35rem; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sidebar-brand:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar-brand:active { opacity: 0.7; }
.sidebar-product { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--sidebar-text); letter-spacing: 0.01em; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0.6rem 1rem; scrollbar-color: #333 transparent; }
.nav-group { margin-bottom: 1.4rem; }
.nav-group-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.2rem 0.3rem 0.6rem; }
.nav-group-head h2 { font-size: 0.85rem; font-weight: 600; color: var(--sidebar-text); }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  position: relative; width: 100%; min-height: 38px; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.35rem 0.6rem; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--sidebar-text); text-align: left; cursor: pointer; font-size: 0.95rem;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item[aria-current="true"] { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item[aria-current="true"]::before {
  content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--spectrum);
}
.nav-item .glyph { width: 18px; display: grid; place-items: center; opacity: 0.8; flex: none; }
.nav-item .glyph svg { width: 16px; height: 16px; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.not-member { color: #8a8a8a; }
.nav-item.unread { color: #fff; font-weight: 700; }
.nav-item.unread::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; }
.nav-item .avatar { --size: 24px; font-size: 0.7rem; }
.nav-item .avatar:not(.bot) { background-color: #2f2f2f; color: #fff; }
.presence {
  position: absolute; left: 1.95rem; bottom: 0.3rem; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--ink); background: #5a5a5a;
}
.presence.online { background: #2ac6a1; }
.nav-empty { padding: 0.3rem 0.6rem; color: #8a8a8a; font-size: 0.875rem; }

.sidebar-foot { border-top: 1px solid #222; padding: 0.6rem 0.6rem calc(0.6rem + var(--safe-bottom)); display: grid; gap: 0.3rem; }
.nav-admin {
  display: flex; align-items: center; gap: 0.6rem; min-height: 40px; padding: 0 0.6rem;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sidebar-text); cursor: pointer; font-weight: 500;
}
.nav-admin span { display: grid; }
.nav-admin svg { width: 18px; height: 18px; }
.nav-admin:hover, .nav-admin[aria-current="true"] { background: var(--sidebar-active); color: #fff; }
.me { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.2rem 0.3rem 0.5rem; }
.me .avatar:not(.bot) { background-color: #2a2a2a; color: #fff; }
.me-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-status { display: flex; align-items: center; gap: 0.35rem; color: var(--sidebar-text); font-size: 0.78rem; }
.ws-status { width: 8px; height: 8px; border-radius: 50%; background: #6b6b6b; }
.ws-status[data-state="connected"] { background: #2ac6a1; }

.nav-group-actions { display: flex; gap: 2px; }
.members-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 34px; padding: 0 0.65rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.members-btn:hover { background: var(--mist); }
.members-btn span[data-icon] { display: grid; }
.members-btn svg { width: 16px; height: 16px; }
.archived-banner {
  display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 1.5rem calc(1rem + var(--safe-bottom)); padding: 0.8rem 1rem;
  border-radius: var(--radius); background: var(--ink); color: #fff;
}
.archived-banner span[data-icon] { display: grid; }
.archived-banner svg { width: 20px; height: 20px; }
.archived-banner p { flex: 1; font-size: 0.9rem; }
.archived-banner .btn-secondary { background: transparent; color: #fff; border-color: #fff; }

/* Résumés : bandeau « ce que j'ai manqué » et fenêtre de résumé (signal IA : filet arc-en-ciel) */
.missed-banner {
  display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 1.5rem 0; padding: 0.55rem 0.6rem 0.55rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); position: relative; overflow: hidden;
}
.missed-banner::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--spectrum); }
.missed-banner span[data-icon] { display: grid; }
.missed-banner svg { width: 18px; height: 18px; }
.missed-banner p { flex: 1; font-size: 0.9rem; font-weight: 600; }
.summary-body { display: grid; gap: 0.5rem; line-height: 1.55; }
.summary-body h3 { font-size: 0.8rem; font-weight: 700; margin-top: 0.4rem; }
.summary-body ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.summary-body .summary-lead { font-weight: 700; }
.summary-author { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.summary-meta { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.summary-pending { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.summary-pending::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--spectrum-ring);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .summary-pending::before { animation: none; } }

/* Décisions tracées */
.decision-tag {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.6rem; margin-top: 0.35rem; padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--ink); background: var(--mist); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.85rem;
}
.decision-tag svg { width: 16px; height: 16px; }
.decision-tag span[data-icon] { display: grid; }
.decision-tag strong { font-weight: 700; }
.decision-tag .decision-meta { color: var(--muted); font-size: 0.8rem; }
.decision-tag .decision-remove { margin-left: auto; border: 0; background: none; padding: 0; font: inherit; font-size: 0.8rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.decision-ged { font-weight: 600; font-size: 0.8rem; }
.decision-quote { margin: 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--line-strong); color: var(--muted); font-size: 0.9rem; max-height: 8rem; overflow: auto; white-space: pre-wrap; }
.document-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.document-chip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.6rem; padding: 0.4rem 0.7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.85rem; width: fit-content; max-width: 100%;
}
.document-chip span[data-icon] { display: grid; }
.document-chip svg { width: 16px; height: 16px; }
.document-chip a.decision-ged { color: var(--ink); }
.document-failed { color: var(--danger, #c0262d); font-size: 0.8rem; font-weight: 600; }
.choice-group { border: 0; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.choice-group legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.3rem; }
.choice { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.choice input { width: auto; }
.chip-ai { display: inline-flex; align-items: center; gap: 0.35rem; }
.chip-ai span[data-icon] { display: grid; }
.chip-ai svg { width: 14px; height: 14px; }
.hit-score { font-weight: 600; color: var(--ink); }
.search-answer {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.6rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.9rem; position: relative; overflow: hidden;
}
.search-answer::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--spectrum); }
.search-answer span[data-icon] { display: grid; }
.search-answer svg { width: 16px; height: 16px; }
/* Visionneuse de fichiers techniques */
.att-image { position: relative; padding: 0; cursor: zoom-in; }
.att-annotations { position: absolute; left: 0.4rem; bottom: 0.4rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 600; }
.dialog.viewer { width: min(1100px, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); }
.viewer-shell { display: grid; gap: 0.8rem; min-height: 0; }
.viewer-head .pane-title { flex: 1; min-width: 0; }
.viewer-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { min-height: 200px; max-height: calc(100dvh - 9rem); overflow: auto; }
.annot-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.annot-canvas { background: var(--mist); border-radius: var(--radius); padding: 0.5rem; display: grid; place-items: center; }
.annot-stage { position: relative; display: inline-block; line-height: 0; user-select: none; touch-action: none; }
.annot-stage img { max-width: 100%; max-height: calc(100dvh - 12rem); display: block; }
.annot-stage.drawing { cursor: crosshair; }
.annot-overlay { position: absolute; inset: 0; pointer-events: none; }
.annot-box { position: absolute; border: 2px solid #ff0712; background: rgba(255, 7, 18, 0.08); border-radius: 3px; }
.annot-box.draft { border-style: dashed; }
.annot-box .annot-num { position: absolute; top: -0.7rem; left: -0.7rem; }
.annot-num { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.3rem; border-radius: 999px; background: #ff0712; color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1; }
.annot-side { display: grid; gap: 0.7rem; align-content: start; }
.annot-tools { display: flex; gap: 0.5rem; }
.annot-tools .btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.annot-tools svg { width: 16px; height: 16px; }
.annot-form { display: grid; gap: 0.5rem; }
.annot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.annot-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: start; padding: 0.55rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.875rem; }
.pdf-pages { display: grid; gap: 0.8rem; justify-items: center; background: var(--mist); padding: 0.8rem; border-radius: var(--radius); }
.pdf-page { width: 100%; max-width: 900px; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.stl-dims { font-weight: 600; margin-bottom: 0.5rem; }
.stl-stage { height: min(60dvh, 520px); border-radius: var(--radius); overflow: hidden; background: var(--mist); }
.stl-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.stl-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.5rem; }
@media (max-width: 760px) {
  .annot-layout { grid-template-columns: 1fr; }
}
/* Projet suivi par le canal */
.project-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 32px; padding: 0 0.75rem; flex: none; max-width: 16rem;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 600; font-size: 0.8rem; cursor: pointer;
}
.project-chip:hover { background: var(--mist); }
a.project-chip { color: inherit; text-decoration: none; }
.project-chip span[data-icon] { display: grid; }
.project-chip svg { width: 15px; height: 15px; }
#channel-project-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.project-channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.project-channel { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.project-channel .meta { flex: 1; min-width: 0; display: grid; }
.project-channel .meta span { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 760px) {
  .project-chip { max-width: 9rem; }
  .field-pair { grid-template-columns: 1fr; }
}
/* Revue de conception */
#viewer-review { display: inline-flex; align-items: center; gap: 0.35rem; }
#viewer-review[hidden] { display: none; }
#viewer-review svg { width: 15px; height: 15px; }
.review-details { display: grid; gap: 0.3rem; }
.review-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.review-file { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font: inherit; font-size: 0.8rem; font-weight: 600; }
button.review-file { cursor: pointer; }
.review-file span[data-icon], .review-file .glyph { display: grid; }
.review-file svg { width: 14px; height: 14px; }
.block-checklist { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.9rem; display: grid; gap: 0.6rem; max-width: 640px; }
.checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.verdict { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: #fff; }
.verdict-conforme { background: var(--success); }
.verdict-reserves { background: #b25e00; }
.verdict-non_conforme { background: var(--danger); }
.checklist-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; font-size: 0.875rem; }
.check-mark { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; font-weight: 700; font-size: 0.75rem; color: #fff; }
.check-ok .check-mark { background: var(--success); }
.check-warning .check-mark { background: #b25e00; }
.check-ko .check-mark { background: var(--danger); }
.check-na .check-mark { background: var(--muted); }
.check-text { display: grid; }
.check-label { font-weight: 600; }
.check-note { color: var(--muted); font-size: 0.82rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Messages programmés et rappels */
.choice small { color: var(--muted); font-size: 0.8rem; margin-left: auto; text-transform: none; }
.choice-group input[type="datetime-local"] { margin-top: 0.2rem; }
.planner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.planner-item { display: grid; gap: 0.35rem; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.planner-item.failed { border-color: var(--danger); }
.planner-when { font-weight: 700; font-size: 0.85rem; }
.planner-when::first-letter { text-transform: uppercase; }
.planner-content p { margin: 0; }
.planner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.planner-reschedule input { min-height: 32px; padding: 0.2rem 0.4rem; font-size: 0.85rem; width: auto; }
.reminder-alert {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 60; width: min(420px, calc(100vw - 2rem));
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 0.7rem; padding: 0.8rem 0.9rem;
  background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.reminder-alert span[data-icon] { display: grid; }
.reminder-alert svg { width: 20px; height: 20px; }
.reminder-alert p { font-size: 0.875rem; overflow-wrap: anywhere; }
.reminder-alert .btn-secondary { background: transparent; color: #fff; border-color: #fff; }
.reminder-alert .icon-btn { color: #fff; }
/* Messages vocaux */
.voice-bar { display: none; align-items: center; gap: 0.6rem; padding: 0.35rem 0.4rem 0.35rem 0.6rem; }
.composer.recording .composer-row { display: none; }
.composer.recording .voice-bar { display: flex; }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff0712; animation: pulse 1.2s ease-in-out infinite; }
.voice-status { font-weight: 600; font-size: 0.9rem; }
.voice-clock { font-variant-numeric: tabular-nums; color: var(--muted); flex: 1; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .voice-dot { animation: none; } }
.att-voice { display: grid; gap: 0.4rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); width: min(420px, 100%); }
.att-voice audio { width: 100%; height: 36px; }
.voice-label { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.voice-label span[data-icon], .voice-label .glyph { display: grid; }
.voice-label svg { width: 14px; height: 14px; }
.voice-transcript { font-size: 0.9rem; line-height: 1.5; border-left: 3px solid var(--line-strong); padding-left: 0.6rem; }
.voice-pending { font-size: 0.85rem; color: var(--muted); font-style: italic; }
/* Traduction à la volée */
.translation { margin-top: 0.35rem; padding: 0.45rem 0.7rem; border-left: 3px solid #3ca6f5; background: var(--mist); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; display: grid; gap: 0.2rem; max-width: 640px; }
.translation-meta { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.translation-meta span[data-icon], .translation-meta .glyph { display: grid; }
.translation-meta svg { width: 13px; height: 13px; }
.translation-text { font-size: 0.95rem; }
.translation-hide { margin-left: auto; border: 0; background: none; padding: 0; font: inherit; font-size: 0.78rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.translation .translation-hide:only-of-type { justify-self: start; }
/* Statuts personnalisés */
.me-status-row {
  display: flex; align-items: center; width: calc(100% - 0.4rem); margin: 0.15rem 0.2rem 0; padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-sm); background: none; color: #fff; font: inherit; text-align: left; cursor: pointer;
}
.me-status-row:hover { background: rgba(255, 255, 255, 0.08); }
.me-custom-status { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-custom-status.is-empty { color: var(--sidebar-text); text-decoration: underline; text-underline-offset: 2px; }
.status-badge { display: inline-block; margin-left: 0.3rem; font-size: 0.9em; line-height: 1; cursor: default; }
.status-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.status-preset { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); font: inherit; font-size: 0.85rem; cursor: pointer; }
.status-preset:hover { background: var(--mist); }
.status-fields { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem; }
.status-emoji input { text-align: center; font-size: 1.1rem; }
.user-delete-zone { display: grid; gap: 0.5rem; justify-items: start; }
/* GED */
.ged-chip .ged-chip-label { font-weight: 700; }
.ged-chip #channel-ged-label { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-menu {
  position: fixed; z-index: 70; min-width: 220px; padding: 0.35rem; display: grid; gap: 0.15rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.attach-menu button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.55rem 0.7rem; border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; color: var(--ink);
}
.attach-menu button:hover, .attach-menu button:focus-visible { background: var(--mist); }
.attach-menu span[data-icon], .attach-menu .glyph { display: grid; }
.attach-menu svg { width: 16px; height: 16px; }
.ged-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.875rem; }
.ged-crumb { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ged-crumb.current { text-decoration: none; font-weight: 700; cursor: default; }
.ged-sep { color: var(--muted); }
.ged-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.35rem; }
.ged-list .hint { padding: 0.6rem; }
.ged-open { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 0.6rem; align-items: center; width: 100%; padding: 0.5rem 0.6rem; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; text-align: left; cursor: pointer; }
.ged-item.folder .ged-open { grid-template-columns: auto 1fr; }
.ged-open:hover { background: var(--mist); }
.ged-open input { width: auto; grid-row: span 2; }
.ged-open span[data-icon], .ged-open .glyph { display: grid; grid-row: span 2; }
.ged-open svg { width: 18px; height: 18px; }
.ged-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-meta { grid-column: -2 / -1; color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-path { font-weight: 600; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pending-ged { font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--ink); color: #fff; }
.app-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.app-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.app-item.disabled { opacity: 0.7; }
.app-meta { display: grid; min-width: 0; }
.app-meta span { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.app-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ged-item.folder { display: flex; align-items: center; }
.ged-item.folder .ged-open { flex: 1; }
.ged-check { display: grid; place-items: center; padding-left: 0.6rem; }
.ged-check input { width: auto; }
.ged-item.file { display: flex; align-items: center; gap: 0.4rem; }
.ged-item.file > .ged-open { flex: 1; cursor: default; }
.ged-file-actions { display: flex; align-items: center; gap: 0.2rem; padding-right: 0.3rem; }
.att-ged-folder .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-badge.app-badge { background: transparent; color: var(--ink); border: 1px solid currentColor; }
a.btn-secondary, a.btn-ghost { color: var(--ink); text-decoration: none; }
.decisions-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.decisions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; max-height: 60vh; overflow: auto; }
.decision-item { display: grid; gap: 0.3rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); }
.decision-item h3 { font-size: 0.95rem; font-weight: 700; }
.decision-item p { font-size: 0.875rem; }
.decision-item .decision-meta { color: var(--muted); font-size: 0.8rem; }
.decision-item .decision-foot { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* Navigateur de canaux */
/* Plus spécifique que .dialog (déclarée plus bas) : sinon la largeur standard l'emporterait. */
.dialog.dialog-wide { width: min(640px, calc(100vw - 2rem)); }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--mist); gap: 2px; justify-self: start; }
.segmented button { border: 0; background: none; padding: 0.4rem 0.9rem; border-radius: 999px; font-weight: 600; font-size: 0.875rem; cursor: pointer; color: var(--muted); }
.segmented button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.browse-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; max-height: min(460px, 55dvh); overflow-y: auto; }
.browse-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius); }
.browse-item .glyph { width: 20px; display: grid; place-items: center; }
.browse-item .glyph svg { width: 18px; height: 18px; }
.browse-item .info { flex: 1; min-width: 0; display: grid; }
.browse-item .info strong { font-weight: 600; }
.browse-item .info span { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-item .actions { display: flex; gap: 0.4rem; flex: none; }
.member-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 0.45rem; border-radius: 4px; background: var(--mist); font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-left: 0.35rem; }

/* Paramètres du canal */
.settings-block { padding-top: 1rem; border-top: 1px solid var(--line); }
.member-list .role { color: var(--muted); font-size: 0.8rem; }
.member-list .member-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }

/* Déclencheur de recherche */
.search-trigger {
  display: flex; align-items: center; gap: 0.55rem; margin: 0 0.85rem 0.5rem; min-height: 38px; padding: 0 0.7rem;
  border: 1px solid #2a2a2a; border-radius: 8px; background: #141414; color: #9a9a9a; cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: #444; color: #fff; }
.search-trigger span[data-icon] { display: grid; }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger-label { flex: 1; }
.search-trigger kbd { font: inherit; font-size: 0.72rem; padding: 0.05rem 0.35rem; border: 1px solid #333; border-radius: 4px; color: #8a8a8a; }
.nav-item.muted { opacity: 0.6; }

/* ---------- Volets ---------- */
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); padding-top: 3px; }
.pane-head {
  display: flex; align-items: center; gap: 0.75rem; min-height: 68px;
  padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--line);
}
.pane-title { flex: 1; min-width: 0; }
.pane-title .title, .pane-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn, .phone-only { display: none !important; }
.head-tools { display: contents; }
.tool-label { display: none; }

.empty { margin: auto; max-width: 34ch; text-align: center; display: grid; gap: 0.5rem; padding: 2rem; color: var(--muted); }
.empty .title { color: var(--ink); }

/* ---------- Conversation ---------- */
.conversation { position: relative; }
.channel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.5rem 0.5rem; display: flex; flex-direction: column; }
.messages > .message-list { margin-top: auto; }
.load-older { align-self: center; margin-bottom: 0.75rem; }
.message-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.message-list > .day {
  display: flex; align-items: center; gap: 0.8rem; margin: 0.9rem 0 0.4rem;
  color: var(--muted); font-size: 0.8rem; font-weight: 600;
}
.message-list > .day::before, .message-list > .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.message {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 0.75rem;
  padding: 0.45rem 0.6rem; margin: 0 -0.6rem; border-radius: var(--radius-sm);
}
.message:hover { background: #fafafa; }
.message .avatar { --size: 38px; margin-top: 2px; }
.message.continued { padding-top: 0.05rem; }
.message.continued > .avatar { visibility: hidden; height: 0; }
.message.continued .message-meta { display: none; }
.message-meta { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.message-author { font-weight: 700; }
.message-meta time { color: var(--muted); font-size: 0.78rem; }
.message-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-content a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.md-code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.88em; padding: 0.05em 0.35em; border-radius: 4px; background: var(--mist); border: 1px solid var(--line); }
.md-block { display: block; margin: 0.35rem 0; padding: 0.6rem 0.75rem; overflow-x: auto; white-space: pre; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.85rem; border-radius: 8px; background: var(--mist); border: 1px solid var(--line); }
.mention { background: var(--mention-bg); border-radius: 4px; padding: 0 0.2rem; font-weight: 600; }
.message-actions { margin-top: 0.15rem; }
.thread-link {
  display: inline-flex; align-items: center; gap: 0.35rem; border: 0; background: none; padding: 0.15rem 0;
  color: var(--ink); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.thread-link svg { width: 15px; height: 15px; }
.thread-link.has-replies { text-decoration: underline; text-underline-offset: 3px; }
.composer {
  display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 1.5rem calc(1rem + var(--safe-bottom));
  padding: 0.4rem; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--paper);
}
.composer-row { display: flex; align-items: flex-end; gap: 0.35rem; }
.attach-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.attach-btn:hover { background: var(--mist); color: var(--ink); }
.attach-btn svg { width: 20px; height: 20px; }
.send-btn:disabled { background: var(--line-strong); cursor: progress; }

/* Fichiers en attente d'envoi */
.pending-files { list-style: none; margin: 0; padding: 0.2rem 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pending-file {
  display: flex; align-items: center; gap: 0.45rem; max-width: 260px; padding: 0.3rem 0.35rem 0.3rem 0.6rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--mist); font-size: 0.85rem;
}
.pending-file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pending-file .size { color: var(--muted); white-space: nowrap; }
.pending-file.uploading { opacity: 0.6; }
.pending-file.uploading .size::after { content: ' · envoi…'; }
.pending-file.failed { border-color: var(--danger); color: var(--danger); }
.pending-file .icon-btn { width: 26px; height: 26px; }
.pending-file .icon-btn svg { width: 14px; height: 14px; }

/* Glisser-déposer */
.channel { position: relative; }
.drop-zone {
  position: absolute; inset: 0.75rem; z-index: 6; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--ink); border-radius: 16px; background: rgba(255, 255, 255, 0.92);
  font-weight: 600; font-size: 1.1rem;
}

/* Pièces jointes d'un message */
.attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.att-image { display: block; max-width: min(360px, 100%); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--mist); }
.att-image img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }
.att-file {
  display: flex; align-items: center; gap: 0.7rem; width: min(340px, 100%); padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
.att-file .file-icon { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.att-file .file-icon svg { width: 18px; height: 18px; }
.att-file .meta { flex: 1; min-width: 0; display: grid; }
.att-file .meta strong { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file .meta span { color: var(--muted); font-size: 0.8rem; }
.att-file .icon-btn { width: 34px; height: 34px; }
.att-ged {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.2rem; font-size: 0.78rem; font-weight: 600;
  color: var(--success);
}
.att-ged::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--spectrum-ring); }
.att-ged a { color: inherit; }
.att-block { display: grid; gap: 0.15rem; max-width: 100%; }
.composer:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(60, 166, 245, 0.25); }
.composer textarea {
  flex: 1; border: 0; padding: 0.5rem 0; min-height: 40px; max-height: 40vh; resize: none; box-shadow: none; line-height: 1.45;
}
.composer textarea:focus { box-shadow: none; }
.send-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--ink); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.send-btn svg { width: 18px; height: 18px; }
.composer-error { margin: -0.5rem 1.5rem 0.8rem; }
.join-hint { margin: 0.5rem 1.5rem 1rem; padding: 0.75rem 1rem; background: var(--mist); border-radius: var(--radius); color: var(--muted); }

/* Suggestions de mentions (@) au-dessus du compositeur */
.mention-suggest {
  list-style: none; margin: 0 1.5rem -0.2rem; padding: 0.3rem; display: grid; gap: 2px; max-height: 260px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.mention-suggest .person[aria-selected="true"] { background: var(--mist); }
.thread .mention-suggest { margin-inline: 1.25rem; }

/* Barre d'actions d'un message (survol sur ordinateur, bouton « ⋯ » au doigt) */
.message { position: relative; }
.msg-toolbar {
  position: absolute; top: -0.9rem; right: 0.6rem; z-index: 2; display: flex; gap: 2px; padding: 2px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  opacity: 0; transition: opacity 0.1s;
}
.message:hover > .msg-toolbar, .message:focus-within > .msg-toolbar, .msg-toolbar:has([aria-expanded="true"]) { opacity: 1; }
.msg-toolbar .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.msg-toolbar .icon-btn svg { width: 17px; height: 17px; }
.msg-more { display: none; }
@media (hover: none) {
  .msg-toolbar { display: none; }
  .message { padding-right: 2.3rem; }
  .msg-more { display: inline-grid; position: absolute; top: 0.2rem; right: 0.2rem; width: 34px; height: 34px; color: var(--muted); }
}
.edited { color: var(--muted); font-size: 0.78rem; }

/* Réactions */
.reactions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.reaction {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 28px; padding: 0 0.55rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--mist); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.reaction[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
.reaction:hover { border-color: var(--line-strong); }
.reaction-add { color: var(--muted); padding: 0 0.45rem; }
.reaction-add svg { width: 16px; height: 16px; }

.emoji-picker {
  position: fixed; z-index: 30; display: grid; grid-template-columns: repeat(6, 38px); gap: 2px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.emoji-picker button, .sheet-reactions button {
  width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.emoji-picker button:hover, .emoji-picker button:focus-visible, .sheet-reactions button:hover { background: var(--mist); }
.sheet-reactions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sheet-reactions button { width: auto; height: 46px; }
.sheet-actions { display: grid; gap: 0.4rem; }
.sheet-actions .btn { justify-content: flex-start; }

/* Modification en place */
.edit-form { display: grid; gap: 0.4rem; margin-top: 0.2rem; }
.edit-form textarea { min-height: 70px; resize: vertical; }
.edit-actions { display: flex; gap: 0.4rem; align-items: center; font-size: 0.8rem; color: var(--muted); }

/* En train d'écrire */
.typing { min-height: 1.3rem; margin: 0 1.5rem -0.3rem; font-size: 0.8rem; color: var(--muted); font-style: italic; }
.thread .typing { margin-inline: 1.25rem; }

/* ---------- Fil ---------- */
.thread { width: var(--thread-w); border-left: 1px solid var(--line); }
.thread-list { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; align-content: start; }
.thread-list > .message:first-child { padding-bottom: 0.9rem; margin-bottom: 0.6rem; border-bottom: 1px solid var(--line); border-radius: 0; }
.thread .composer { margin-inline: 1.25rem; }
/* Fil agrandi : il prend la place du canal, avec une colonne de lecture confortable. */
.shell.thread-wide > #conversation-pane { display: none; }
.shell.thread-wide > .thread { grid-column: 2 / -1; width: auto; border-left: 0; }
.shell.thread-wide .thread-list { padding-inline: max(1.25rem, calc((100% - 52rem) / 2)); }
.shell.thread-wide .thread .composer, .shell.thread-wide .thread .typing, .shell.thread-wide .thread .mention-suggest {
  margin-inline: max(1.25rem, calc((100% - 52rem) / 2));
}
.expand-thread[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Recherche ---------- */
.search-pane { grid-column: 2 / -1; }
.search-bar { flex: 1; min-width: 0; }
.search-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--line); }
.search-filters select { width: auto; min-height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem; font-size: 0.9rem; }
.chip-toggle {
  min-height: 36px; padding: 0 0.9rem; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--paper); font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.chip-toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.search-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem 2rem; display: grid; gap: 0.75rem; align-content: start; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-width: 900px; }
.search-hit {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0.75rem; width: 100%; padding: 0.8rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: left; cursor: pointer;
}
.search-hit:hover, .search-hit:focus-visible { border-color: var(--ink); }
.search-hit .avatar { --size: 36px; }
.search-hit .hit-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem; font-size: 0.85rem; color: var(--muted); }
.search-hit .hit-meta strong { color: var(--ink); font-size: 0.95rem; }
.search-hit .hit-channel { font-weight: 600; color: var(--ink); }
.search-hit .hit-text { margin-top: 0.15rem; white-space: pre-wrap; overflow-wrap: anywhere; }
mark { background: var(--mention-bg); color: inherit; border-radius: 3px; padding: 0 0.1rem; font-weight: 600; }
.message.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 40% { background: var(--mention-bg); } 100% { background: transparent; } }
.push-box { display: grid; gap: 0.4rem; padding: 0.9rem; border-radius: var(--radius); background: var(--mist); }
.personal-tokens { display: grid; gap: 0.5rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.personal-tokens-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.personal-tokens-head .subtitle { margin: 0; }
.personal-tokens .hint { margin: 0; }
.token-list .token-text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.token-list .token-text small { color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.token-list li.is-expired strong { color: var(--muted); text-decoration: line-through; }

/* =====================================================================
   Administration
   ===================================================================== */
.admin { grid-column: 2 / -1; }
.close-admin { flex: none; }
.tabs { display: flex; gap: 0.25rem; padding: 0 1.5rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; flex: none; padding: 0.85rem 0.9rem; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0; height: 3px; border-radius: 2px; background: var(--ink); }
.admin-body { flex: 1; overflow-y: auto; padding: 1.5rem; background: var(--mist); }
.tab-panel { max-width: 1200px; margin: 0 auto; display: grid; gap: 1rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.narrow { max-width: 620px; width: 100%; }
.field-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.field-row .grow { flex: 1 1 220px; }
.field-row .port { flex: 0 0 110px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.toolbar .search { flex: 1 1 240px; }
.toolbar select { width: auto; flex: 0 1 auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap;
  padding: 0.7rem 1rem; background: #fafafa; border-bottom: 1px solid var(--line);
}
.user-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.92rem; }
.user-table tr:last-child td { border-bottom: 0; }
.user-table tbody tr[data-user-id] { cursor: pointer; }
.user-table tbody tr[data-user-id]:hover { background: #fafafa; }
.user-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.user-open { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: grid; min-width: 0; }
.user-open strong { font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.user-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.user-open span { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 0.55rem; border-radius: 999px; background: var(--mist); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 500; }
.role-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1.5px solid var(--ink); white-space: nowrap; }
.role-pill.admin { background: var(--ink); color: #fff; }
.role-pill.guest { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.status.disabled { color: var(--muted); }
.status.disabled::before { background: var(--line-strong); }
.dim { color: var(--muted); }
.empty-row td { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* Équipes */
.teams-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1rem; align-items: start; }
.teams-list-col { display: grid; gap: 1rem; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.team-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  text-align: left; cursor: pointer;
}
.team-item:hover { border-color: var(--line-strong); }
.team-item[aria-current="true"] { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.team-item strong { display: block; font-weight: 600; }
.team-item small { color: var(--muted); }
.count { color: var(--muted); font-weight: 500; }
.team-detail { display: grid; gap: 1rem; }
#team-editor { display: grid; gap: 1rem; }
.inline-form { display: flex; gap: 0.5rem; }
.inline-form select { flex: 1; }
.member-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.member-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.member-list li:last-child { border-bottom: 0; }
.member-list .name { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.member-list .empty-members { color: var(--muted); }
/* Équipe ajoutée au canal : une ligne dépliable. */
.member-list li.team-row { display: block; padding: 0; }
.team-row-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; }
.team-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.team-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.team-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; }
.team-avatar svg { width: 15px; height: 15px; }
.team-chevron { flex: none; display: grid; transform: rotate(180deg); transition: transform 0.15s; color: var(--muted); }
.team-chevron svg { width: 16px; height: 16px; }
.team-toggle[aria-expanded="true"] .team-chevron { transform: rotate(-90deg); }
.member-list.team-members { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding-left: 1.4rem; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger-zone > span { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.danger-text { color: var(--danger); font-size: 0.875rem; }

/* =====================================================================
   Fenêtres
   ===================================================================== */
.dialog {
  width: min(480px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.5rem;
  border: 0; border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); border-radius: 0; overflow-y: auto; }
.drawer[open] { animation: drawer-in 0.22s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }

.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; min-width: 0; }
.choices legend { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.choice {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.85rem; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius);
}
.choice:has(input:checked) { border-color: var(--ink); background: #fafafa; }
.choice input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; padding: 0; accent-color: var(--ink); flex: none; }
.choice span { display: grid; }
.choice small { color: var(--muted); font-size: 0.84rem; }
.team-checks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.token-box { display: grid; gap: 0.5rem; padding: 0.9rem; border-radius: var(--radius); background: var(--mist); }
.token-value { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.85rem; background: var(--paper) !important; color: var(--ink) !important; cursor: text !important; }
.token-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.85em; background: var(--mist); padding: 0.05rem 0.3rem; border-radius: 4px; }
.team-check { position: relative; }
.team-check input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.team-check span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 0.8rem; border-radius: 999px;
  border: 1.5px solid var(--line-strong); font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.team-check input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.team-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.user-identity { display: flex; align-items: center; gap: 0.9rem; }
.user-identity .meta { display: grid; min-width: 0; }
.user-identity .meta span { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }

.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: min(420px, 55dvh); overflow-y: auto; }
.person {
  width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.6rem;
  border: 0; border-radius: var(--radius-sm); background: none; text-align: left; cursor: pointer;
}
.person:hover, .person:focus-visible { background: var(--mist); }
.person .who { flex: 1; min-width: 0; display: grid; }
.person .who strong { font-weight: 600; }
.person .who span { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + var(--safe-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 0.7rem 1.1rem; border-radius: 999px; font-weight: 500; font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: calc(100vw - 2rem);
}

/* =====================================================================
   Tablette (700 – 1099 px) : le fil devient un tiroir au-dessus du canal
   ===================================================================== */
@media (max-width: 1099px) {
  :root { --sidebar-w: 240px; }
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .thread {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--thread-w), 100%); z-index: 4;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.12);
  }
  .teams-layout { grid-template-columns: 1fr; }
  .shell.thread-wide > .thread { position: static; box-shadow: none; }
}

/* =====================================================================
   Téléphone (< 700 px) : un écran à la fois (liste → canal → fil)
   ===================================================================== */
@media (max-width: 699px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { gap: 1.25rem; padding: 1.5rem 1.25rem 1.75rem; }
  .login-logo { width: 110px; }
  .login-points { display: none; }
  .login-panel { place-items: start center; padding: 1.75rem 1.25rem 2.5rem; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell > .sidebar, .shell > .pane { grid-column: 1; grid-row: 1; }
  .shell[data-screen="search"] > :not(#search-view):not(.spectrum-bar),
  .shell[data-screen="tasks"] > :not(#tasks-view):not(.spectrum-bar),
  .shell[data-screen="list"] > .pane,
  .shell[data-screen="conversation"] > .sidebar, .shell[data-screen="conversation"] > #thread-pane, .shell[data-screen="conversation"] > #admin-view,
  .shell[data-screen="thread"] > .sidebar, .shell[data-screen="thread"] > #conversation-pane, .shell[data-screen="thread"] > #admin-view,
  .shell[data-screen="admin"] > .sidebar, .shell[data-screen="admin"] > #conversation-pane, .shell[data-screen="admin"] > #thread-pane { display: none !important; }
  /* Fiche d'une tâche : seule à l'écran quand elle est ouverte, absente des autres écrans */
  .shell[data-screen="task"] > :not(#task-panel):not(.spectrum-bar) { display: none !important; }
  .shell:not([data-screen="task"]) > #task-panel { display: none !important; }
  .thread { position: static; width: auto; box-shadow: none; border: 0; }
  .expand-thread { display: none; }
  .admin { grid-column: 1; }

  .sidebar-head { padding: 1rem 1rem 0.75rem; }
  .nav-item { min-height: 46px; font-size: 1rem; }
  .back-btn { display: inline-grid !important; margin-left: -0.5rem; }
  .phone-only { display: inline-grid !important; }
  .close-thread, .close-admin { display: none; }
  .search-filters { padding: 0.6rem 0.75rem; }
  .search-filters select { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .search-body { padding: 0.75rem 0.75rem 1.5rem; }
  .search-trigger kbd { display: none; }
  .search-pane, .tasks-pane { grid-column: 1; }
  .tasks-body { padding: 0.75rem; }
  .task-quick { margin: 0 0.75rem 0.6rem; }
  .pane-head { min-height: 60px; padding: 0.5rem 0.75rem; gap: 0.25rem; position: relative; }
  .pane-head .back-btn { margin-left: -0.25rem; }
  .members-btn { min-height: 38px; padding: 0 0.6rem; }
  /* Menu « ⋯ » des actions secondaires du canal */
  .head-tools {
    display: none; position: absolute; top: calc(100% - 0.25rem); right: 0.5rem; z-index: 6;
    flex-direction: column; align-items: stretch; gap: 2px; min-width: 15rem; max-width: calc(100vw - 1rem); padding: 0.35rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  }
  .head-tools.open { display: flex; }
  .head-tools .icon-btn, .head-tools .project-chip {
    display: flex; align-items: center; justify-content: flex-start; gap: 0.7rem; width: 100%; max-width: none; height: 44px;
    padding: 0 0.75rem; border: 0; border-radius: 8px; font-size: 0.95rem; font-weight: 500; text-align: left;
  }
  .head-tools .icon-btn:hover, .head-tools .project-chip:hover { background: var(--mist); }
  .head-tools .icon-btn svg { width: 20px; height: 20px; flex: none; }
  .head-tools .tool-label { display: inline; }
  .head-tools #channel-ged-label, .head-tools #channel-project-label { flex: 1; min-width: 0; }

  /* Messages : gouttière d'avatar réduite */
  .message { grid-template-columns: 32px minmax(0, 1fr); column-gap: 0.6rem; }
  .message .avatar { --size: 32px; }

  /* Saisie : le texte occupe toute la largeur, les boutons passent dessous */
  .composer-row { flex-wrap: wrap; row-gap: 0.15rem; }
  .composer-row textarea { order: -1; flex: 1 1 100%; min-width: 0; }
  .composer-row .send-btn { margin-left: auto; }
  .title { font-size: 1.35rem; }
  .messages { padding: 0.75rem 1rem 0.25rem; }
  .composer { margin: 0.4rem 0.75rem calc(0.75rem + var(--safe-bottom)); }
  .archived-banner { margin-inline: 0.75rem; }
  .missed-banner { margin-inline: 0.75rem; }
  .browse-item { flex-wrap: wrap; }
  .browse-item .actions { width: 100%; justify-content: flex-end; }
  .members-btn #channel-member-count { display: none; }
  .composer-error, .join-hint, .mention-suggest, .thread .mention-suggest, .typing, .thread .typing { margin-inline: 0.75rem; }
  .thread-list { padding: 0.75rem 1rem; }
  .thread .composer { margin-inline: 0.75rem; }

  .tabs { padding: 0 0.5rem; }
  .admin-body { padding: 1rem 0.75rem calc(1rem + var(--safe-bottom)); }
  .toolbar .search { flex-basis: 100%; }
  .toolbar select { flex: 1 1 calc(50% - 0.3rem); min-width: 0; }
  .list-head .btn { flex: 1 1 100%; order: -1; }

  /* Le tableau devient une liste de fiches. */
  .table-wrap { background: none; border: 0; overflow: visible; }
  .user-table thead { display: none; }
  .user-table, .user-table tbody { display: grid; gap: 0.6rem; }
  .user-table tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.9rem; padding: 0.85rem 0.9rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .user-table td { display: block; padding: 0; border: 0; font-size: 0.85rem; }
  .user-table td:first-child { flex: 1 1 100%; }
  .user-table td.col-teams { flex: 1 1 100%; order: 5; }
  .user-table td.col-teams:has(.dim) { display: none; }
  .user-table td.col-last { margin-left: auto; color: var(--muted); }
  .user-table tr.empty-row { display: block; }

  .dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; padding: 1.25rem 1.25rem calc(1.25rem + var(--safe-bottom)); }
  .drawer { height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .drawer .dialog-head { top: -1.25rem; margin: -1.25rem -1.25rem 0; padding: 1rem 1.25rem 0.75rem; }
  .dialog-actions .btn { flex: 1; }
  .kind-switch { grid-template-columns: 1fr; }
}

/* Lien d'action discret (barre latérale) */
.link-btn { border: 0; background: none; padding: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Tiroirs : l'en-tête reste visible au défilement */
.drawer .dialog-head {
  position: sticky; top: -1.5rem; z-index: 2; margin: -1.5rem -1.5rem 0; padding: 1.25rem 1.5rem 0.9rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
}

/* Champs en lecture seule (droits insuffisants) */
input:disabled, select:disabled, textarea:disabled { background: var(--mist); color: var(--muted); cursor: not-allowed; }
.choice:has(input:disabled) { cursor: not-allowed; opacity: 0.7; }

/* =====================================================================
   Blocs des salariés IA
   ===================================================================== */
.blocks { display: grid; gap: 0.5rem; margin-top: 0.45rem; max-width: 620px; }
.block { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.85rem; background: var(--paper); }
.block-actions { border-left: 3px solid var(--ink); }
.block-actions.decided { border-left-color: var(--success); background: #fafafa; }
.block-text { margin-bottom: 0.5rem; font-weight: 500; }
.block-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.decision { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--success); font-weight: 600; }
.decision-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--success); color: #fff; font-size: 0.75rem; }
.block-sources { background: #fafafa; }
.sources-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.35rem; }
.sources-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.confidence { font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; }
.confidence.high { background: #e3f4ee; color: var(--success); }
.confidence.medium { background: #fff4d6; color: #7a5a00; }
.confidence.low { background: #fde7e7; color: var(--danger); }
.sources-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.sources-list a { color: var(--ink); font-weight: 600; }
.source-ref { color: var(--muted); font-size: 0.82rem; }
.source-excerpt { display: block; color: var(--muted); font-size: 0.84rem; font-style: italic; }
.block-document { display: flex; align-items: center; gap: 0.75rem; }
.block-document .file-icon { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.block-document .file-icon svg { width: 18px; height: 18px; }
.block-document .meta { flex: 1; min-width: 0; display: grid; }
.block-document .doc-kind { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.block-document .meta span:last-child { font-size: 0.8rem; color: var(--muted); }

/* =====================================================================
   Tâches confiées aux salariés IA
   ===================================================================== */
.task-card { display: grid; gap: 0.45rem; max-width: 620px; margin-top: 0.2rem; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); position: relative; overflow: hidden; }
.task-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--spectrum-ring); }
.task-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.task-who { flex: 1; min-width: 0; }
.task-who strong { color: var(--ink); }
.task-status { display: inline-flex; align-items: center; height: 22px; padding: 0 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.task-status.tone-idle { background: var(--mist); color: var(--muted); }
.task-status.tone-active { background: #e6f2fd; color: #155e9c; }
.task-status.tone-review { background: #fff4d6; color: #7a5a00; }
.task-status.tone-done { background: #e3f4ee; color: var(--success); }
.task-status.tone-failed { background: #fde7e7; color: var(--danger); }
.task-title { font-weight: 700; }
.task-desc, .task-note { color: var(--muted); font-size: 0.9rem; white-space: pre-wrap; }
.task-review { font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: 6px; background: var(--mist); }
.task-progress { height: 6px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.task-progress span { display: block; height: 100%; background: var(--spectrum); transition: width 0.4s ease; }
.task-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rework-form { display: grid; gap: 0.4rem; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; max-height: min(460px, 60dvh); overflow-y: auto; }
.task-row { width: 100%; display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: left; cursor: pointer; }
.task-row:hover { border-color: var(--ink); }
.task-row-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-who { color: var(--muted); font-size: 0.85rem; }
.inline-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.inline-check input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--ink); }

/* Vue Tâches : interrupteur Discussions | Tâches, barre latérale des filtres, volet */
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0.85rem 0.7rem; padding: 3px; border-radius: 9px; background: var(--sidebar-hover); }
.view-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 32px; padding: 0 0.5rem;
  border: 0; border-radius: 7px; background: transparent; color: var(--sidebar-text); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.view-switch button:hover { color: #fff; }
.view-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; }
.tasks-count, .nav-count.badge-hot {
  min-width: 20px; height: 20px; padding: 0 0.4rem; border-radius: 999px; background: var(--s3); color: var(--ink);
  font-size: 0.75rem; font-weight: 700; font-style: normal; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.tasks-nav .nav-group { margin-top: 1.2rem; margin-bottom: 0; }
.tasks-nav .nav-item .label { flex: 1; }
.nav-count { font-style: normal; font-size: 0.85rem; color: #8a8a8a; font-variant-numeric: tabular-nums; }
.nav-item[aria-current="true"] .nav-count { color: #fff; }
.nav-item[aria-current="true"] .nav-count.badge-hot { color: var(--ink); }
.project-dot { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.tasks-pane { grid-column: 2 / -1; }
.tasks-pane .pane-head .title { font-family: var(--font-display); font-weight: 700; font-size: 2.75rem; line-height: 0.95; }
.tasks-head-tools { display: flex; align-items: center; gap: 0.5rem; }
.tasks-body { flex: 1; min-height: 0; overflow: auto; padding: 1rem 1.5rem; }

/* Vue Tâches : en-tête, kanban (colonnes soulignées par le spectre), cartes, liste */
.tasks-pane .pane-head { align-items: flex-end; padding-top: 1.1rem; padding-bottom: 1rem; }
.tasks-pane .pane-head .pane-subtitle { margin-top: 0.35rem; }
.tasks-head-tools { align-self: center; }
.layout-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; gap: 2px; }
.layout-switch button {
  min-height: 30px; padding: 0 0.75rem; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  font: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.layout-switch button:hover { color: var(--ink); }
.layout-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Saisie rapide d'une tâche, sous l'en-tête */
.task-quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.7rem; margin: 0 1.5rem 0.9rem;
  padding: 0.15rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper);
}
.task-quick:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(60, 166, 245, 0.35); }
.quick-plus { color: var(--muted); font-size: 1.1rem; line-height: 1; }
.task-quick input { flex: 1; min-width: 0; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 0.95rem; }
.task-quick input:focus { border: 0; box-shadow: none; }
.task-quick input::placeholder { color: var(--muted); }
.quick-preview { flex: 1 0 100%; margin: 0 0 0.45rem 1.8rem; color: var(--muted); font-size: 0.8125rem; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 0.9rem; align-items: start; overflow-x: auto; }
.kanban-col { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.kanban-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 0.5rem; border-bottom: 4px solid; }
.kanban-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kanban-count { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-1 .kanban-head { border-image: linear-gradient(90deg, var(--s1), var(--s2)) 1; }
.col-2 .kanban-head { border-image: linear-gradient(90deg, var(--s3), var(--s4)) 1; }
.col-3 .kanban-head { border-image: linear-gradient(90deg, var(--s5), var(--s6)) 1; }
.col-4 .kanban-head { border-image: linear-gradient(90deg, var(--s6), var(--s7)) 1; }
.kanban-cards { display: flex; flex-direction: column; gap: 0.65rem; min-height: 90px; border-radius: 10px; }
.kanban-col.drop-ok .kanban-cards { outline: 2px dashed var(--s6); outline-offset: 4px; background: rgba(60, 166, 245, 0.07); }
.kanban-empty { margin: 0; padding: 0.4rem 0; color: var(--muted); font-size: 0.85rem; }

.task-tile {
  display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); cursor: pointer;
}
.task-tile[draggable="true"] { cursor: grab; }
.task-tile:hover { border-color: var(--line-strong); }
.task-tile:focus-visible, .task-line:focus-visible { outline: 2px solid var(--s6); outline-offset: 2px; }
.task-tile.dragging { opacity: 0.45; }
.task-tile.wait { border-color: #000; box-shadow: inset 3px 0 0 var(--s6); }
.task-tile.final { background: var(--mist); border-color: transparent; color: var(--muted); }
.task-tile.struck .tile-title { text-decoration: line-through; text-decoration-color: #bbb; }
.tile-title { font-size: 0.92rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.tile-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.5rem; font-size: 0.78rem; color: var(--muted); }
.tile-wait { color: var(--ink); font-weight: 600; }
.tile-due.late { color: var(--danger); font-weight: 600; }
.tile-tag {
  max-width: 120px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 0.72rem; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-tile.final .tile-tag { color: var(--muted); }
.tile-tag.tag-failed { border-color: var(--danger); color: var(--danger); }
.tile-who { display: inline-flex; margin-left: auto; }
.avatar-tile { --size: 24px; }
.tile-bar { height: 4px; border-radius: 2px; background: var(--mist); overflow: hidden; }
.tile-bar i { display: block; height: 100%; background: var(--spectrum); background-size: 400px 100%; }

.task-lines { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.task-line {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 90px 170px 130px; gap: 0.75rem; align-items: center;
  padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); cursor: pointer;
}
.task-line:last-child { border-bottom: 0; }
.task-line:hover { background: var(--mist); }
.task-line.final .line-title { color: var(--muted); }
.task-line .task-status { justify-self: start; }
.line-title { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-who { display: flex; align-items: center; gap: 0.45rem; min-width: 0; font-size: 0.85rem; }
.line-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-project { display: flex; align-items: center; gap: 0.4rem; min-width: 0; font-size: 0.82rem; color: var(--muted); }

/* Écrans étroits : une colonne par écran, défilement horizontal avec accrochage */
@media (max-width: 819px) {
  .kanban { display: flex; gap: 0.75rem; scroll-snap-type: x mandatory; }
  .kanban-col { flex: 0 0 100%; scroll-snap-align: start; }
  .task-line { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.5rem 0.75rem; }
  .line-who span:last-child, .line-project { display: none; }
  .tasks-pane .pane-head .title { font-size: 2rem; }
  .tasks-pane .pane-head { flex-wrap: wrap; align-items: center; }
  .tasks-head-tools { flex: 1 0 100%; justify-content: space-between; }
}

/* Avis sur les réponses IA */
.feedback { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.fb-label { margin-right: 0.2rem; }
.fb-btn { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 26px; padding: 0 0.45rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.fb-btn:hover { border-color: var(--line-strong); }
.fb-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--mist); }
.fb-form { display: grid; gap: 0.4rem; max-width: 520px; margin-top: 0.35rem; }

/* Fiche d'un salarié IA */
.link-author { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.link-author:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-section { display: grid; gap: 0.5rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.contract { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; font-size: 0.9rem; }
.contract dt { color: var(--muted); }
.contract dd { margin: 0; font-weight: 500; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
.stat { display: grid; padding: 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fafafa; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.stat-label { font-size: 0.8rem; font-weight: 600; }
.stat-hint { font-size: 0.75rem; color: var(--muted); }

/* =====================================================================
   Étiquettes de canal et canaux épinglés
   ===================================================================== */
.label-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 22px; padding: 0 0.55rem; border-radius: 999px;
  background: var(--mist); border: 1px solid var(--line); color: var(--ink); font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.label-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.channel-labels { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.pane-title .channel-labels { flex-wrap: nowrap; overflow: hidden; }

/* Filtre (barre latérale, fond noir) */
.label-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: 0.1rem 0.2rem 0.9rem; padding: 0.55rem 0.65rem;
  border: 1px solid #2a2a2a; border-radius: 8px; background: #141414; font-size: 0.8rem; color: #9a9a9a;
}
.label-filter-active { display: contents; }
.label-filter-bar .label-chip, .label-filter-panel .label-toggle { background: #1f1f1f; border-color: #333; color: #fff; }
.label-filter-bar .link-btn { margin-left: auto; font-size: 0.8rem; }
.label-filter-panel { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.15rem 0.2rem 0.7rem 0.6rem; }
.label-filter-panel[hidden] { display: none; }
.label-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 30px; padding: 0 0.65rem; border-radius: 999px; border: 1px solid #333;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.label-toggle[aria-pressed="true"] { background: #fff !important; color: var(--ink) !important; border-color: #fff !important; }
.label-filter-empty { margin: 0; color: #8a8a8a; font-size: 0.8rem; }
.icon-btn.is-active { color: #fff; background: #2a2a2a; }
.pane-head .icon-btn.is-active, .head-tools .icon-btn.is-active { color: var(--ink); background: var(--mist); }

/* Édition (paramètres du canal) */
.label-editor-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.label-editor-list li { display: inline-flex; align-items: center; gap: 0.1rem; }
.label-remove { width: 26px; height: 26px; }
.label-remove svg { width: 14px; height: 14px; }
#label-editor-input { flex: 1; min-width: 10rem; }

/* =====================================================================
   Rangement GED à l'envoi et fichiers du canal
   ===================================================================== */
.ged-filing { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; padding: 0.15rem 0.35rem 0; font-size: 0.85rem; }
.ged-filing[hidden] { display: none; }
.ged-filing .inline-check { font-size: 0.85rem; white-space: normal; }
.ged-filing-folder { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; max-width: 100%; color: var(--muted); }
.ged-filing-folder svg { width: 15px; height: 15px; flex: none; }
.ged-filing .link-btn { color: var(--ink); font-size: 0.85rem; }
.ged-filing-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }

.files-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.file-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.4rem 0.4rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.file-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.75rem; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.file-main:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.file-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--mist); }
.file-thumb-icon { display: grid; place-items: center; color: var(--ink); }
.file-thumb-icon svg { width: 20px; height: 20px; }
.file-text { min-width: 0; display: grid; }
.file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-text span { color: var(--muted); font-size: 0.8rem; }
.file-actions { display: flex; flex: none; }
.file-actions .icon-btn svg { width: 18px; height: 18px; }
#files-more { justify-self: center; }

/* =====================================================================
   Fiche d'une tâche (panneau de droite ; plein écran sur téléphone)
   ===================================================================== */
@media (min-width: 700px) {
  .task-panel { width: min(440px, 100%); }
}
@media (min-width: 1100px) {
  .task-panel { grid-column: 3; grid-row: 1; }
  .shell.task-panel-open > .tasks-pane { grid-column: 2; }
}
.task-panel:focus { outline: none; }
.task-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.1rem; }
.task-fields { display: grid; gap: 1rem; align-content: start; }
.task-fields input:not([type="checkbox"]), .task-fields select, .task-fields textarea { min-height: 36px; padding: 0.3rem 0.6rem; font-size: 0.9rem; }
.task-panel-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.05; overflow-wrap: anywhere; }
.task-fields input.task-panel-title { min-height: 0; padding: 0.15rem 0.4rem; margin: -0.15rem -0.4rem; border-color: transparent; font-size: 1.75rem; }
input.task-panel-title:hover { border-color: var(--line-strong); }
.task-rows { display: grid; gap: 0.6rem; }
.fiche-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.6rem; align-items: start; font-size: 0.9rem; }
.fiche-row > .fiche-label { padding-top: 0.4rem; }
.fiche-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.fiche-value { min-width: 0; padding-top: 0.3rem; overflow-wrap: anywhere; }
.task-fields select { padding-right: 2rem; }
.fiche-value:has(> input, > select) { padding-top: 0; }
.task-person { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.task-project-name { display: inline-flex; align-items: center; gap: 0.5rem; }
.task-check { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; }
.task-check input { flex: none; width: 18px; height: 18px; min-height: 0; margin-top: 2px; padding: 0; accent-color: var(--ink); }
.task-check input:disabled { cursor: not-allowed; }
.task-panel .link-btn { color: #1e55a8; text-align: left; }
.task-delegate { margin-top: 0.45rem; }
.delegate-form, .task-rework { display: grid; gap: 0.5rem; }
.task-block { display: grid; gap: 0.35rem; }
.task-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; }
.empty-text { color: var(--muted); }
.task-moves { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.task-moves .fiche-label { margin-right: 0.2rem; }
.task-actions-block { gap: 0.6rem; }

.task-thread { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.task-thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.task-event { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--muted); font-size: 0.82rem; font-style: italic; }
.task-event time { flex: none; font-size: 0.75rem; font-style: normal; }
.task-reply-error { margin: 0 1.25rem 0.4rem; }
.task-panel .composer { margin-top: 0.4rem; }
@media (max-width: 699px) {
  .task-panel-scroll { padding: 0.9rem 1rem; }
  .task-reply-error { margin-inline: 0.75rem; }
  .fiche-row { grid-template-columns: 6.25rem minmax(0, 1fr); }
}
