:root {
  --ink: #0f172a;
  --paper: #f1f5f9;
  --accent: #2563eb;
  --warm: #64748b;
  --line: #cbd5e1;
  --detail-block-border: #e2e8f0;
  --board-banner-bg: #f8fafc;
  --board-background-image: none;
  --sticky-low: #e9f5f6;
  --sticky-medium: #f8f9f6;
  --sticky-high: #fff7ed;
  --sticky-critical: #f58f96;
  --sticky-low-border: #c5d8db;
  --sticky-medium-border: #d9e0d9;
  --sticky-high-border: #f0b97a;
  --sticky-critical-border: #e89090;
  --sticky-low-text: #334155;
  --sticky-medium-text: #334155;
  --sticky-high-text: #9a3412;
  --sticky-critical-text: #5c0a0a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  background-image:
    linear-gradient(90deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px);
  background-size:
    var(--board-grid-size, 28px) var(--board-grid-size, 28px),
    var(--board-grid-size, 28px) var(--board-grid-size, 28px);
  background-position:
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px),
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px);
}

body.light-effects-mode {
  background-image: none;
}

h1,
h2,
h3,
strong {
  font-family: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

body.sms-reminders-feature-disabled .sms-feature-ui {
  display: none !important;
}

.startup-view {
  display: grid;
  place-items: center;
}

.startup-card {
  color: #475569;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.95rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.auth-card {
  width: min(480px, 92vw);
  margin: 7vh auto;
  background: rgba(246, 242, 233, 0.95);
  border: 2px solid #f0dfca;
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 16px 50px rgba(25, 49, 52, 0.18);
}

.auth-card h1 {
  margin: 0;
}

.subtitle {
  margin-top: 0.3rem;
  color: #37535d;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1rem 0;
}

.tab {
  flex: 1;
  border: 1px solid #b8cad0;
  background: #e7f0f2;
  border-radius: 10px;
  padding: 0.55rem;
  cursor: pointer;
}

.tab.active {
  border-color: var(--accent);
  background: #cdecee;
}

.auth-form {
  display: grid;
  gap: 0.7rem;
}

.auth-form label {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
}

/* >= 16px : empêche l'auto-zoom iOS au focus (qui ne se réinitialise jamais
   ensuite et décalait l'entête sous la barre d'URL après connexion). */
.auth-form input,
.auth-form select,
.auth-form textarea {
  font-size: 16px;
}

input,
textarea,
select {
  border: 1px solid #b8b3aa;
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  background: #fffdf8;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
}

button:hover {
  filter: none;
  background: #d8e1ec;
}

button.ghost {
  background: #f7f7f7;
}

button.icon-btn {
  width: 2.2rem;
  min-width: 2.2rem;
  padding: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.icon-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  display: block;
}

.lucide-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: none !important;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex: 0 0 auto;
  pointer-events: none;
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.title-with-icon.title-with-icon-lg {
  gap: 0.42rem;
}

button.danger {
  background: #fee2e2;
  color: #991b1b;
}

.error {
  min-height: 1.2rem;
  color: #b02525;
}

.network-error-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 1rem;
  background: #7f1d1d;
  color: #fef2f2;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
}

.network-error-banner.hidden {
  display: none;
}

.network-error-retry-btn {
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  color: inherit;
  font-size: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.network-error-retry-btn:hover {
  background: rgba(255,255,255,0.28);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: nowrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(71, 92, 102, 0.24);
  background: var(--board-banner-bg, #f8fafc);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
}

.topbar-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.65rem;
  flex: 1 1 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 8rem;
  height: auto;
  flex: 0 0 auto;
}

/* La marque « ee » (favicon) n'est utilisée que sur mobile (voir media query). */
.brand-logo-mark {
  display: none;
}

/* Conservé dans le DOM pour la machinerie de changement de tableau (la modale
   board-switch écrit dans sa value puis dispatch « change »), mais jamais affiché. */
.board-select-hidden {
  display: none;
}

/* Bouton favoris : visible uniquement sur mobile (le desktop a la barre de favoris). */
.topbar-favorites-toggle {
  display: none;
}

.topbar-board-name {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-width: 0;
  max-width: min(46vw, 520px);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  background: #eef3f9;
  cursor: pointer;
}

.topbar-board-name:hover,
.topbar-board-name:focus-visible {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e3a8a;
}

.topbar-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex: 0 0 auto;
}

.topbar-views-separator {
  width: 1px;
  height: 1.35rem;
  background: #d2dce8;
  margin: 0 0.2rem;
  flex: 0 0 auto;
}

/* Bookmark bar */
.topbar-bookmarks-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.bookmark-bar-sep {
  width: 1px;
  height: 1.35rem;
  background: #d2dce8;
  flex-shrink: 0;
  align-self: center;
  margin-right: 0.15rem;
}

.bookmark-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #c7d9e5;
  background: #eef6fb;
  color: #2d5a72;
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.bookmark-chip:hover {
  background: #dbeef7;
  border-color: #85b8d4;
}

.bookmark-chip.active {
  background: #c2e2f5;
  border-color: #4a9ec4;
  color: #1a3d54;
  font-weight: 600;
}

.bookmark-chip-overflow {
  background: #f0f4f8;
  border-color: #b0bec5;
  color: #546e7a;
  font-weight: 600;
  flex-shrink: 0;
}

.bookmark-chip-overflow:hover {
  background: #e2e8ee;
  border-color: #78909c;
}

/* Star button in detail panel */
.card-main-bookmark-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.card-main-bookmark-btn:hover {
  color: #f59e0b;
  border-color: #fcd34d;
  background: #fffbeb;
}

.card-main-bookmark-btn.active {
  color: #f59e0b;
  background: #fffbeb;
  border-color: #fcd34d;
}

.card-main-bookmark-btn.active .lucide-icon {
  fill: #f59e0b;
}

/* Spécificité renforcée : sinon `.card-main-head-actions > button:hover` (0,2,1)
   écrase l'état favori (amber) dès que le curseur reste sur l'étoile après le clic.
   L'amber dépend UNIQUEMENT de `.active` (pas du survol seul), pour qu'un décochage
   repasse l'étoile au neutre même curseur posé dessus. */
.card-main-head-actions > button.card-main-bookmark-btn.active,
.card-main-head-actions > button.card-main-bookmark-btn.active:hover {
  color: #f59e0b;
  background: #fffbeb;
  border-color: #fcd34d;
}

.card-main-head-actions > button.card-main-bookmark-btn.active .lucide-icon {
  fill: #f59e0b;
}

/* Bookmarks overflow dialog */
.bookmarks-overflow-dialog {
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 280px;
  max-width: 380px;
  width: 90vw;
}

.bookmarks-overflow-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bookmarks-overflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.bookmarks-overflow-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.bookmarks-overflow-list {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0;
  max-height: 60vh;
  overflow-y: auto;
}

.bookmarks-overflow-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  font-size: 0.88rem;
  color: #334155;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s;
}

.bookmarks-overflow-item:hover {
  background: #f1f5f9;
  color: #1e3a5f;
}

.pill {
  border: 1px solid #a8bcc2;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  background: #e5f2f4;
}

.topbar-icon-toggle,
.topbar-icon-nav,
.topbar-quick-add-toggle,
.topbar-note-toggle,
.topbar-menu-toggle {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #334155;
}

.topbar-icon-toggle.active,
.topbar-icon-toggle[aria-pressed="true"],
.topbar-icon-nav.active,
.topbar-icon-nav[aria-pressed="true"],
.topbar-quick-add-toggle[aria-expanded="true"],
.topbar-note-toggle.active,
.topbar-menu-toggle[aria-expanded="true"] {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.topbar-popover-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  z-index: 30;
}

.topbar-quick-add-panel {
  max-width: min(96vw, 860px);
}

.topbar-menu-panel {
  width: min(1200px, calc(100vw - 1.2rem));
  max-width: calc(100vw - 1.2rem);
}

.topbar-mobile-menu-actions {
  display: none;
}

.topbar-menu-separator {
  width: 1px;
  height: 1.35rem;
  background: #d2dce8;
  flex: 0 0 auto;
}

.topbar-menu-user-btn {
  border: 1px solid #a8bcc2;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
  background: #e5f2f4;
}

.topbar-menu-user-btn:hover,
.topbar-menu-user-btn:focus-visible {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.topbar-light-effects-toggle.active {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #075985;
}

.topbar-menu-panel #logout-btn.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.topbar-menu-panel #logout-btn.danger:hover,
.topbar-menu-panel #logout-btn.danger:focus-visible {
  border-color: #fca5a5;
  background: #fecaca;
}

.topbar-popover-panel select,
.topbar-popover-panel input {
  width: auto;
}

#board-select {
  min-width: 190px;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  white-space: nowrap;
}

.btn-with-icon .lucide-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  min-height: calc(100vh - 70px);
  transition: grid-template-columns 160ms ease;
}

.workspace.with-details {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0;
  min-width: 0;
  height: calc(100vh - 70px);
}

.board-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.view-switch {
  display: inline-flex;
  border: 1px solid #bcc9cd;
  border-radius: 999px;
  padding: 0.12rem;
  background: rgba(255, 255, 255, 0.72);
}

.view-switch button {
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: transparent;
}

.view-switch button.active {
  background: linear-gradient(180deg, #d8f1f3, #bfe8eb);
  color: #154048;
}

.filters-wrap {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.55rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.filter-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.25rem 0.4rem;
  min-width: min(160px, 80vw);
}

.filter-block strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  color: #446069;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.filter-list .empty {
  margin: 0;
  padding: 0.25rem 0.45rem;
  border-style: solid;
  font-size: 0.78rem;
}

.filter-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.71rem;
  color: #7a9aa5;
}

.filter-list label {
  border: 1px solid #8797a3;
  border-radius: 999px;
  background: rgba(135, 151, 163, 0.2);
  padding: 0.18rem 0.42rem;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.78rem;
}

.filter-list .critical-filter-toggle {
  border-color: #d55d5d;
  background: rgba(255, 220, 220, 0.85);
  color: #a02424;
  font-weight: 700;
}

.filter-list .critical-filter-toggle.critical-active {
  background: #ffd7d7;
  box-shadow: 0 0 0 1px rgba(190, 43, 43, 0.24);
}

#calendar-filter-tags-wrap label:has(input:checked) {
  box-shadow: 0 0 0 2px currentColor;
  font-weight: 600;
}

.filter-control-stack {
  display: grid;
  gap: 0.3rem;
}

.filter-control-row {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: minmax(0, 1fr) 90px;
}

#clear-tag-filters-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.list-sort-wrap {
  border: 1px solid #c7d2d6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
  padding: 0.3rem 0.45rem;
  display: inline-grid;
  gap: 0.15rem;
  min-width: 220px;
}

.list-sort-wrap label {
  font-size: 0.78rem;
  color: #446069;
}

.list-sort-wrap select {
  width: 100%;
}

#canvas-scroll {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 240px;
  overflow: hidden;
  border-radius: 0;
  border: none;
  cursor: default;
  touch-action: none;
  background-color: #ffffff;
  background-image:
    var(--board-background-image, none),
    linear-gradient(90deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px);
  background-size:
    cover,
    var(--board-grid-size, 28px) var(--board-grid-size, 28px),
    var(--board-grid-size, 28px) var(--board-grid-size, 28px);
  background-repeat:
    no-repeat,
    repeat,
    repeat;
  background-position:
    center center,
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px),
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px);
}

body.light-effects-mode #canvas-scroll {
  background-image: var(--board-background-image, none);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

/* Desktop : quand le panneau détail ouvre la 2e colonne, #canvas-scroll rétrécit et
   `cover center` recentrait l'image (effet de « déplacement »). On fixe la couche
   image au viewport pour qu'elle reste immobile (le panneau la recouvre simplement).
   La grille reste en `scroll` (positionnée par les offsets de pan). Non appliqué en
   mobile : pas de split (détail plein écran) et `attachment: fixed` y est instable. */
@media (min-width: 1081px) {
  #canvas-scroll {
    background-attachment: fixed, scroll, scroll;
  }
  body.light-effects-mode #canvas-scroll {
    background-attachment: fixed;
  }
}

#canvas-scroll.pan-ready {
  cursor: grab;
}

#canvas-scroll.pan-ready #board-canvas,
#canvas-scroll.pan-ready #board-canvas * {
  cursor: grab !important;
}

#canvas-scroll.panning {
  cursor: grabbing;
}

#canvas-scroll.panning #board-canvas,
#canvas-scroll.panning #board-canvas * {
  cursor: grabbing !important;
}

#board-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 3200px;
  height: 2200px;
  background: transparent;
  transform-origin: 0 0;
  will-change: transform;
}

.alias-string {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.alias-string-svg {
  position: absolute;
  inset: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.alias-string-line {
  stroke: #3b82f6;
  stroke-width: 2;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  fill: none;
  opacity: 0.65;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5))
    drop-shadow(0 2px 3px rgba(15, 23, 42, 0.18));
}

.board-thread {
  position: absolute;
  pointer-events: none;
  --thread-color: #64748b;
  z-index: 6;
}

.board-thread-svg {
  position: absolute;
  inset: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.board-thread-line {
  stroke: var(--thread-color, #64748b);
  stroke-width: 2.6;
  stroke-linecap: round;
  fill: none;
  opacity: 1;
  filter: none;
  pointer-events: stroke;
  cursor: grab;
}

.board-thread-hit-line {
  stroke: transparent;
  stroke-width: 18;
  stroke-linecap: round;
  fill: none;
  pointer-events: stroke;
  cursor: grab;
}

.board-thread-arrow-marker path {
  fill: var(--thread-color, #64748b);
}

.board-thread-dashed .board-thread-line {
  stroke-dasharray: 8 7;
}

.board-thread-straight .board-thread-line {
  stroke-width: 2.2;
  opacity: 1;
  filter: none;
}

.board-thread-straight .board-thread-pin {
  display: none;
  pointer-events: none;
}

.board-thread-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  transform: translate(-50%, -82%);
  border: none;
  background: transparent;
  color: var(--thread-color, #64748b);
  padding: 0;
  cursor: grab;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.28))
    drop-shadow(0 3px 4px rgba(15, 23, 42, 0.3));
}

.board-thread-pin .lucide-icon {
  width: 1.68rem;
  height: 1.68rem;
  stroke-width: 2.2;
}

.board-thread.selected .board-thread-line {
  stroke-width: 3.2;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45))
    drop-shadow(0 2px 4px rgba(15, 23, 42, 0.4));
}

.board-thread.selected .board-thread-pin {
  transform: translate(-50%, -82%) scale(1.07);
}

.board-thread-pin.pin-selected {
  filter: drop-shadow(0 0 4px #1d7880) drop-shadow(0 0 8px rgba(29, 120, 128, 0.4));
  transform: translate(-50%, -82%) scale(1.15);
}

.board-thread-straight.selected .board-thread-pin {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: inline-flex;
  border: 2px solid #334155;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.28);
  filter: none;
}

.board-thread-straight.selected .board-thread-pin::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: inherit;
  background: #334155;
}

.board-thread-straight.selected .board-thread-pin .lucide-icon {
  display: none;
}

.board-thread-straight.selected .board-thread-pin:hover,
.board-thread-straight.selected .board-thread-pin:active {
  transform: translate(-50%, -50%) scale(1.12);
}

.board-thread-straight.selected .board-thread-pin.pin-selected {
  transform: translate(-50%, -50%) scale(1.16);
  box-shadow: 0 0 0 4px rgba(51, 65, 85, 0.16), 0 1px 5px rgba(15, 23, 42, 0.28);
}

.board-thread:active .board-thread-line,
.board-thread-pin:active {
  cursor: grabbing;
}

.board-thread-draft .board-thread-line {
  stroke-dasharray: 6 5;
  opacity: 1;
}

.board-thread-draft {
  pointer-events: none;
}

.board-thread-draft .board-thread-pin-end {
  opacity: 0.8;
}

.alias-string.filter-dimmed .alias-string-line {
  stroke: #cbd5e1;
  opacity: 0.28;
  filter: none;
}

.board-thread.filter-dimmed .board-thread-line {
  stroke: #e2e8f0;
  opacity: 1;
  filter: none;
}

body.light-effects-mode .alias-string-line,
body.light-effects-mode .board-thread-line,
body.light-effects-mode .board-thread-pin,
body.light-effects-mode .board-thread.selected .board-thread-line,
body.light-effects-mode .board-thread-pin.pin-selected {
  filter: none;
}

.board-thread.filter-dimmed .board-thread-pin {
  color: #cbd5e1;
  opacity: 0.32;
  filter: none;
}

.card-connector-anchor-layer {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.card-connector-anchor {
  position: absolute;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  border: 2px solid #1d7880;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

.card-connector-anchor::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: #1d7880;
}

.card-connector-anchor-target {
  border-color: #2563eb;
  pointer-events: none;
}

.card-connector-anchor-target::after {
  background: #2563eb;
}

.card-connector-anchor.active {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  box-shadow: 0 0 0 4px rgba(29, 120, 128, 0.16), 0 2px 8px rgba(15, 23, 42, 0.24);
}

.card-connector-anchor-target.active {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), 0 2px 8px rgba(15, 23, 42, 0.24);
}

body.light-effects-mode .card-connector-anchor {
  box-shadow: none;
}

.board-thread-context-tooltip {
  position: absolute;
  z-index: 16;
  min-width: 180px;
  display: grid;
  gap: 0.35rem;
  border: 1px solid #95a8b0;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 10px 24px rgba(22, 39, 45, 0.24);
  padding: 0.42rem;
}

.board-thread-context-title {
  font-size: 0.8rem;
  color: #33545d;
}

.board-thread-context-delete,
.board-thread-context-arrow {
  border: none !important;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  font-size: 0.8rem;
  text-align: left;
}

.board-thread-context-delete {
  background: #fee2e2;
  color: #991b1b;
}

.board-thread-context-arrow {
  background: #eef2f7;
  color: #334155;
}

.board-thread-context-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 8px;
  padding: 0.28rem 0.42rem;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
}

.board-thread-context-check input {
  margin: 0;
}

.board-thread-context-palette {
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 0.28rem;
  padding: 0.18rem 0.08rem;
}

.board-thread-context-color {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 1px solid rgba(51, 65, 85, 0.28) !important;
  border-radius: 999px;
  padding: 0;
  background: var(--connector-option-color, #334155);
  cursor: pointer;
}

.board-thread-context-color.selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1d7880;
}

.selection-marquee {
  position: absolute;
  border: 1px dashed rgba(30, 80, 86, 0.7);
  background: rgba(15, 135, 144, 0.08);
  pointer-events: none;
  z-index: 8;
}

.create-card-tooltip {
  position: absolute;
  z-index: 14;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: min(560px, 92vw);
  border: 1px solid #9ab0b7;
  border-radius: 9px;
  background: rgba(255, 252, 244, 0.97);
  box-shadow: 0 8px 20px rgba(20, 37, 42, 0.22);
  padding: 0.24rem 0.42rem;
  font-size: 0.78rem;
  color: #2b434b;
  line-height: 1.2;
}

.create-card-tooltip-yes {
  border: 1px solid #7ea2ad;
  border-radius: 8px;
  background: linear-gradient(180deg, #ebfbff, #d0edf3);
  color: #12414a;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.08rem 0.45rem;
}

.create-card-tooltip-yes:hover {
  filter: brightness(0.96);
}

.card-context-tooltip {
  position: absolute;
  z-index: 15;
  min-width: 250px;
  max-width: min(360px, 78vw);
  display: grid;
  gap: 0.38rem;
  border: 1px solid #95a8b0;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 10px 24px rgba(22, 39, 45, 0.24);
  padding: 0.45rem 0.5rem;
  color: #223940;
}

.card-context-title {
  font-size: 0.8rem;
  color: #33545d;
}

.card-context-tooltip label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.77rem;
  color: #3f5f68;
}

.card-context-urgent {
  display: grid;
  gap: 0.15rem;
}

.card-context-urgent strong {
  font-size: 0.77rem;
  color: #3f5f68;
}

.card-context-urgent-content {
  border: 1px solid #d1dcdf;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.3rem 0.38rem;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #27424a;
  max-height: 4.2em;
  overflow: auto;
  overflow-wrap: anywhere;
}

.card-context-urgent-content.muted {
  color: #607b83;
}

.card-context-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.card-context-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  gap: 0.32rem;
  border: none;
  background: #e2e8f0;
  color: #0f172a;
}

.card-context-actions .card-context-icon-action {
  width: 2.2rem;
  min-width: 2.2rem;
  padding: 0.45rem;
}

.card-context-actions .card-context-bookmark.is-active {
  color: #8a6500;
  background: #fef3c7;
}

.card-context-actions .card-context-bookmark.is-active .lucide-icon {
  fill: currentColor !important;
}

.card-context-archive {
  border-color: #cc6a6a;
  background: linear-gradient(180deg, #ffe8e8, #ffd2d2);
  color: #7d1f1f;
}

.text-context-tooltip {
  position: absolute;
  z-index: 16;
  min-width: 190px;
  max-width: min(320px, 78vw);
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 0.45rem 0.5rem;
  color: #223940;
}

.text-context-open-btn,
.text-context-connector-btn,
.text-context-archive-btn,
.text-context-delete-btn {
  width: 100%;
  justify-content: center;
  border: none !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
  text-align: center;
}

.text-context-open-btn:hover,
.text-context-open-btn:focus-visible,
.text-context-connector-btn:hover,
.text-context-connector-btn:focus-visible,
.text-context-archive-btn:hover,
.text-context-archive-btn:focus-visible,
.text-context-delete-btn:hover,
.text-context-delete-btn:focus-visible {
  background: #d8e1ec !important;
}

.text-context-connector-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tag-edit-tooltip {
  position: fixed;
  z-index: 40;
  min-width: 240px;
  max-width: min(360px, 80vw);
  display: grid;
  gap: 0.4rem;
  border: 1px solid #95a8b0;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 10px 24px rgba(22, 39, 45, 0.24);
  padding: 0.45rem 0.5rem;
  color: #223940;
}

.tag-edit-title {
  font-size: 0.8rem;
  color: #33545d;
}

.tag-edit-tooltip label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.77rem;
  color: #3f5f68;
}

.tag-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-edit-actions .tag-edit-hide,
.tag-edit-actions .tag-edit-archive,
.tag-edit-actions .tag-edit-delete {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
}

.tag-edit-actions .tag-edit-archive {
  border-color: #f6d8a8;
  background: #fff7ed;
  color: #92400e;
}

.tag-edit-actions .tag-edit-delete {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.detail-item-context-tooltip {
  position: fixed;
  z-index: 40;
  min-width: 170px;
  max-width: min(320px, 76vw);
  display: grid;
  gap: 0.3rem;
  border: 1px solid #95a8b0;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 10px 24px rgba(22, 39, 45, 0.24);
  padding: 0.3rem;
}

.detail-item-context-delete {
  border: none !important;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.8rem;
  text-align: left;
}

.detail-item-context-archive {
  border: none !important;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.8rem;
  text-align: left;
}

.rich-editor-link-context-tooltip {
  position: fixed;
  z-index: 46;
  min-width: 180px;
  max-width: min(320px, 78vw);
  display: grid;
  gap: 0.25rem;
  border: 1px solid #95a8b0;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 10px 24px rgba(22, 39, 45, 0.24);
  padding: 0.3rem;
}

.rich-editor-link-context-tooltip button {
  border: none !important;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  font-size: 0.8rem;
  text-align: left;
}

.rich-editor-link-context-main {
  display: grid;
}

.rich-editor-link-context-url {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #ffffff;
  color: #174dc7;
  text-decoration: underline;
  padding: 0.38rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rich-editor-link-context-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.rich-editor-link-context-actions .icon-btn {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rich-editor-link-context-actions .rich-editor-link-format-btn,
.rich-editor-link-context-actions .rich-editor-link-add {
  border: none !important;
  border-radius: 8px;
  padding: 0.28rem 0.52rem;
  min-height: 2rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sticky {
  position: absolute;
  border: 1px solid rgba(45, 47, 45, 0.25);
  border-radius: 10px;
  padding: 0.45rem;
  --board-hotness-glow-reach: calc(var(--board-grid-size, 28px) * 1.95);
  --board-hotness-glow: 0 0 0 rgba(0, 0, 0, 0);
  box-shadow:
    0 10px 22px rgba(22, 40, 43, 0.22),
    var(--board-hotness-glow);
  transition: transform 120ms ease, box-shadow 120ms ease;
  user-select: none;
  cursor: default;
  z-index: 3;
}

.sticky.sticky-visual-sized {
  height: var(--card-visual-height);
  min-height: var(--card-visual-height);
  overflow: hidden;
}

.sticky.has-visual-color .sticky-chapo,
.sticky.has-visual-color .sticky-dates {
  color: inherit;
  opacity: 0.78;
}

.sticky.sticky-title-only {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.45rem, 4%, 1.5rem);
}

.sticky.sticky-title-only .sticky-title {
  margin: 0;
  max-width: 100%;
  font-size: var(--card-title-only-font-size, 1rem);
  font-weight: 750;
  line-height: 1.06;
  text-align: center;
  text-wrap: balance;
}

/* Élément non déplaçable (droits insuffisants) : reste cliquable pour ouvrir, mais pas de drag. */
.not-draggable {
  cursor: pointer;
}

.sticky.hotness-glow-hot {
  --board-hotness-glow:
    0
    0
    calc(var(--board-hotness-glow-reach) * 0.98)
    calc(var(--board-hotness-glow-reach) * -0.12)
    rgba(249, 115, 22, 0.88);
}

.sticky.hotness-glow-critical {
  --board-hotness-glow:
    0
    0
    calc(var(--board-hotness-glow-reach) * 1.08)
    calc(var(--board-hotness-glow-reach) * -0.1)
    rgba(220, 38, 38, 0.92);
}

body.light-effects-mode .sticky,
body.light-effects-mode .floating-item {
  --board-hotness-glow: 0 0 0 rgba(0, 0, 0, 0);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
  transition: none;
}

body.light-effects-mode .sticky.hotness-glow-hot,
body.light-effects-mode .sticky.hotness-glow-critical {
  --board-hotness-glow: 0 0 0 rgba(0, 0, 0, 0);
}

.sticky.alias-instance {
  border-style: dashed;
  border-color: #94a3b8;
}

.floating-item {
  position: absolute;
  border: 1px solid rgba(45, 47, 45, 0.25);
  border-radius: 0 0 12px 12px;
  padding: 0.42rem 0.45rem;
  box-shadow: 0 10px 22px rgba(22, 40, 43, 0.22);
  transition: transform 120ms ease, box-shadow 120ms ease;
  user-select: none;
  cursor: default;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.36rem;
  z-index: 4;
}

.floating-item.dragging {
  cursor: default;
  box-shadow: 0 18px 30px rgba(22, 40, 43, 0.35);
  transform: rotate(0.9deg);
}

body.light-effects-mode .sticky.dragging,
body.light-effects-mode .floating-item.dragging {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transform: none;
}

.floating-item.floating-item-visual.dragging {
  transform: none;
}

.floating-item.floating-item-event {
  background: #ecfeff;
}

.floating-item.floating-item-event.archived {
  background: #e2e5e8;
  border-color: #b2bcc2;
  opacity: 0.72;
}

.floating-item.floating-item-note {
  background: #f8fafc;
}

.floating-item.floating-item-task {
  background: #f0fdf4;
}

.floating-item.floating-item-task.floating-item-priority-low {
  background: var(--sticky-low);
  border-color: var(--sticky-low-border, var(--sticky-low));
  color: var(--sticky-low-text, #0f172a);
}

.floating-item.floating-item-task.floating-item-priority-medium {
  background: var(--sticky-medium);
  border-color: var(--sticky-medium-border, var(--sticky-medium));
  color: var(--sticky-medium-text, #0f172a);
}

.floating-item.floating-item-task.floating-item-priority-high {
  background: var(--sticky-high);
  border-color: var(--sticky-high-border, var(--sticky-high));
  color: var(--sticky-high-text, #0f172a);
}

.floating-item.floating-item-task.floating-item-priority-critical {
  background: var(--sticky-critical);
  border-color: var(--sticky-critical-border, var(--sticky-critical));
  color: var(--sticky-critical-text, #5c0a0a);
}

.floating-item.floating-item-event.selected,
.floating-item.floating-item-note.selected,
.floating-item.floating-item-task.selected {
  outline: 2px solid #1d7880;
  outline-offset: 2px;
}

.floating-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  min-width: 0;
}

.floating-item-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.22);
  background: rgba(255, 255, 255, 0.68);
  color: #334155;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 700;
  padding: 0.1rem 0.44rem;
  white-space: nowrap;
}

.floating-item-kind .lucide-icon {
  width: 0.76rem;
  height: 0.76rem;
}

.floating-item-title {
  min-width: 0;
  align-self: start;
  font-size: 0.86rem;
  line-height: 1.25;
  color: #1f2937;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.floating-item-date {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.74rem;
  line-height: 1.15;
  color: #0f4f66;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(15, 79, 102, 0.2);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.12rem 0.42rem;
  width: fit-content;
  max-width: 100%;
}

.floating-item-date .lucide-icon {
  width: 0.76rem;
  height: 0.76rem;
}

.floating-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem 0.2rem;
}

.floating-item.task-focus {
  border-color: #1d7880;
  box-shadow: 0 0 0 1px rgba(29, 120, 128, 0.28), 0 18px 30px rgba(22, 40, 43, 0.25);
}

.floating-item.floating-item-visual {
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  z-index: 1;
}

.floating-item.floating-item-visual.floating-item-visual-style-shadowed {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.floating-item.floating-item-visual.floating-item-visual-style-shadowed.selected {
  box-shadow: 0 0 0 2px rgba(29, 120, 128, 0.34), 0 12px 24px rgba(22, 40, 43, 0.24);
}

body.light-effects-mode .floating-item.floating-item-visual,
body.light-effects-mode .floating-item.floating-item-visual.floating-item-visual-style-shadowed,
body.light-effects-mode .floating-item.floating-item-visual.floating-item-visual-style-shadowed.selected {
  box-shadow: none;
}

body.light-effects-mode .floating-item.floating-item-visual.selected,
body.light-effects-mode .floating-item.floating-item-visual.floating-item-visual-style-raw.selected {
  outline: 2px solid rgba(29, 120, 128, 0.5);
  outline-offset: 1px;
  box-shadow: none;
}

.floating-item.floating-item-visual.floating-item-visual-style-raw {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.floating-item.floating-item-visual.floating-item-visual-style-raw.selected {
  outline: 2px solid rgba(29, 120, 128, 0.5);
  outline-offset: 1px;
  box-shadow: none;
}

.floating-item.floating-item-visual.floating-item-visual-style-raw .floating-item-visual-image,
.floating-item.floating-item-visual.floating-item-visual-style-raw .floating-item-visual-empty {
  border-radius: 0;
}

.floating-item-visual-media {
  width: 100%;
  height: 100%;
  display: block;
}

.floating-item-visual-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.floating-item-visual-empty {
  width: 100%;
  height: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.78rem;
  background: #f8fafc;
}

.floating-item-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border: none !important;
  border-radius: 3px;
  padding: 0;
  background: rgba(71, 85, 105, 0.68) !important;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 100ms ease;
}

.floating-item.floating-item-visual.selected .floating-item-resize-handle,
.floating-item.floating-item-visual:hover .floating-item-resize-handle {
  opacity: 1;
}

body.light-effects-mode .floating-item-resize-handle,
body.light-effects-mode .card-pin {
  transition: none;
}

.floating-item.filter-dimmed {
  background: #f8fafc !important;
  border-color: rgba(203, 213, 225, 0.68) !important;
  color: #94a3b8 !important;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.1) !important;
  opacity: 0.42;
  filter: grayscale(1) saturate(0.12);
}

.floating-item.floating-item-visual.filter-dimmed {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  opacity: 0.22;
}

.floating-item.filter-dimmed .floating-item-title,
.floating-item.filter-dimmed .floating-item-date,
.floating-item.filter-dimmed .floating-item-kind {
  color: #94a3b8 !important;
}

#canvas-scroll.visual-file-drop-active {
  box-shadow: inset 0 0 0 3px rgba(29, 120, 128, 0.45);
}

.board-text-block {
  position: absolute;
  z-index: 2;
  width: max-content;
  padding: 0.12rem 0.2rem;
  line-height: 1.28;
  white-space: pre-wrap;
  cursor: default;
  user-select: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.board-text-block-box {
  width: 220px;
  height: 96px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #9fb2bb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-sizing: border-box;
}

.board-text-block-box-preset-1 {
  border-radius: 6px;
}

.board-text-block-box-preset-2 {
  background: #f8fafc;
}

.board-text-block-box-preset-3 {
  background: #f5fbff;
  border-width: 2px;
}

.board-text-block-box-preset-4 {
  background: #f8fbf6;
  border-width: 2px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

.board-text-block-box-preset-5 {
  background: #fffaf0;
  border-width: 2px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.board-text-block.selected {
  outline: 2px solid #1d7880;
  outline-offset: 3px;
  border-radius: 6px;
}

.board-text-block.dragging {
  cursor: default;
}

.sticky.dragging {
  cursor: default;
  box-shadow:
    0 18px 30px rgba(22, 40, 43, 0.35),
    var(--board-hotness-glow);
  transform: rotate(1.4deg);
}

.sticky.selected {
  outline: 2px solid #1d7880;
  outline-offset: 2px;
}

.card-pin {
  position: absolute;
  width: 36px;
  height: 50px;
  z-index: 3;
  cursor: pointer;
  transition: transform 0.12s ease;
  filter: drop-shadow(0 3px 4px rgba(22, 40, 43, 0.35));
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card-pin::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: currentColor;
  clip-path: path('M18 0A18 18 0 0 0 0 18c0 12 18 32 18 32s18-20 18-32A18 18 0 0 0 18 0Z');
  transform: scale(1);
  transform-origin: top center;
}

.card-pin:hover {
  transform: scale(1.12);
}

.card-pin.selected {
  filter: drop-shadow(0 0 0 #1d7880) drop-shadow(0 0 4px #1d7880) drop-shadow(0 3px 4px rgba(22, 40, 43, 0.35));
}

body.light-effects-mode .card-pin,
body.light-effects-mode .card-pin.selected {
  filter: none;
}

.card-pin.archived {
  opacity: 0.5;
}

.card-pin.low      { color: var(--sticky-low); }
.card-pin.medium   { color: var(--sticky-medium); }
.card-pin.high     { color: var(--sticky-high); }
.card-pin.critical { color: var(--sticky-critical); }

.card-pin-letter {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  font-size: 1rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  user-select: none;
  line-height: 1;
}

#toggle-pin-mode-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.sticky.drop-target {
  outline: 3px solid rgba(45, 144, 156, 0.86);
  outline-offset: 3px;
  box-shadow:
    0 0 0 4px rgba(15, 135, 144, 0.2),
    0 16px 26px rgba(22, 40, 43, 0.28),
    var(--board-hotness-glow);
}

body.light-effects-mode .sticky.drop-target {
  box-shadow: 0 0 0 3px rgba(15, 135, 144, 0.2);
}

.sticky.low {
  background: var(--sticky-low);
  color: var(--sticky-low-text, #0f172a);
}

.sticky.medium {
  background: var(--sticky-medium);
  color: var(--sticky-medium-text, #0f172a);
}

.sticky.high {
  background: var(--sticky-high);
  color: var(--sticky-high-text, #0f172a);
}

.sticky.critical {
  background: var(--sticky-critical);
  color: var(--sticky-critical-text, #0f172a);
}

.sticky.critical-urgent {
  border: 2px solid #FF0000;
}

.sticky.archived {
  background: #e2e5e8;
  border-color: #b2bcc2;
}

.sticky.filter-dimmed {
  --board-hotness-glow: 0 0 0 rgba(0, 0, 0, 0);
  background: #f8fafc !important;
  border-color: rgba(203, 213, 225, 0.72) !important;
  color: #94a3b8 !important;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.12);
  opacity: 0.48;
  filter: grayscale(1) saturate(0.12);
}

.sticky.filter-dimmed .sticky-title,
.sticky.filter-dimmed .sticky-chapo,
.sticky.filter-dimmed .sticky-dates,
.sticky.filter-dimmed .status-chip,
.sticky.filter-dimmed .card-tag,
.sticky.filter-dimmed .user-tag,
.sticky.filter-dimmed .user-alert-tag,
.sticky.filter-dimmed .hotness-badge {
  color: #94a3b8 !important;
  border-color: rgba(203, 213, 225, 0.72) !important;
  background: rgba(248, 250, 252, 0.8) !important;
}

.card-pin.filter-dimmed {
  color: #cbd5e1 !important;
  opacity: 0.42;
  filter: none;
}

.card-pin.filter-dimmed .card-pin-letter {
  color: #94a3b8;
}

.sticky-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
}

.sticky-head-right {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: auto;
}

.hotness-filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hotness-filter-row input[type="range"] {
  flex: 1 1 auto;
  min-width: 80px;
  accent-color: #ef4444;
}

.hotness-min-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  min-width: 1.6rem;
  text-align: right;
}

.hotness-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.08rem 0.3rem 0.08rem 0.18rem;
  border-radius: 999px;
  white-space: nowrap;
}

.hotness-badge .lucide-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

body.light-effects-mode .hotness-badge {
  box-shadow: none;
}

.hotness-warm  { background: #fef3c7; color: #92400e; }
.hotness-hot   { background: #ffedd5; color: #c2410c; }
.hotness-very_hot { background: #fee2e2; color: #dc2626; }
.hotness-critical { background: #dc2626; color: #ffffff; }

.hotness-detail {
  font-size: 0.78rem;
  padding: 0.12rem 0.42rem 0.12rem 0.26rem;
}

.hotness-detail .lucide-icon {
  width: 15px;
  height: 15px;
}

.sticky-alias-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.67rem;
  line-height: 1.1;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.critical-bell, .task-bell {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.critical-bell svg, .task-bell svg {
  width: 0.92rem;
  height: 0.92rem;
}

.task-bell-low {
  border: 1px solid #94a3b8;
  background: #f1f5f9;
}
.task-bell-low svg { fill: #64748b; }

.task-bell-medium {
  border: 1px solid #f59e0b;
  background: #fef3c7;
}
.task-bell-medium svg { fill: #b45309; }

.task-bell-high {
  border: 1px solid #f97316;
  background: #ffedd5;
}
.task-bell-high svg { fill: #c2410c; }

.task-bell-critical, .critical-bell {
  border: 1px solid #dc6b6b;
  background: #ffd6d6;
}
.task-bell-critical svg, .critical-bell svg { fill: #9c1d1d; }

.status-chip {
  border: 1px solid rgba(54, 64, 68, 0.3);
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.45);
}

.status-chip.status-backlog {
  border-color: #b8bdc2;
  background: #e4e7ea;
  color: #3e4b52;
}

.status-chip.status-cadrage {
  border-color: #7fa9d9;
  background: #dcecff;
  color: #1f4d86;
}

.status-chip.status-en_cours {
  border-color: #e2a153;
  background: #ffe5c2;
  color: #8a4f00;
}

.status-chip.status-fini {
  border-color: #6dbd70;
  background: #d8f2d5;
  color: #236d2e;
}

.status-chip.status-annule {
  border-color: #c9c9c9;
  background: #efefef;
  color: #8a8a8a;
}

.status-chip.status-bloque {
  border-color: #dc6b6b;
  background: #ffd6d6;
  color: #8c1f1f;
}

.sticky-title {
  margin-top: 0.45rem;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.sticky-chapo {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #37535d;
  overflow-wrap: anywhere;
}

.sticky-dates {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: #3d5962;
}

.sticky-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.card-tag {
  border-radius: 999px;
  border: 1px solid #8797a3;
  background: rgba(135, 151, 163, 0.2);
  color: #1e3137;
  padding: 0.1rem 0.42rem;
  font-size: 0.73rem;
}

.card-tag.macro {
  border-style: dashed;
  font-weight: 700;
}

.board-list {
  flex: 1 1 auto;
  min-height: 240px;
  border-radius: 14px;
  border: 1px solid rgba(57, 75, 82, 0.22);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.55rem;
  display: grid;
  align-content: start;
  /* Au moins 10 px entre cards de la vue liste (1rem = 16 px). */
  gap: 1rem;
  overflow: auto;
}

.card-row {
  /* Filet à la couleur de référence (gris des boutons) — homogène, pas écrasé par la priorité. */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 0.45rem 0.5rem;
  display: grid;
  gap: 0.36rem;
  cursor: pointer;
}

.card-row.low {
  background: var(--sticky-low);
  color: var(--sticky-low-text, #0f172a);
}

.card-row.medium {
  background: var(--sticky-medium);
  color: var(--sticky-medium-text, #0f172a);
}

.card-row.high {
  background: var(--sticky-high);
  color: var(--sticky-high-text, #0f172a);
}

.card-row.critical {
  background: var(--sticky-critical);
  color: var(--sticky-critical-text, #0f172a);
}

.card-row.archived {
  background: #eef1f3;
  border-color: #c2cad0;
}

.card-row:hover {
  border-color: #9eb3ba;
}

.card-row.selected {
  border-color: #1d7880;
  box-shadow: 0 0 0 1px rgba(29, 120, 128, 0.35);
}

.card-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.card-row-head-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
}

.impact-chip {
  border: 1px solid rgba(54, 64, 68, 0.3);
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
  font-size: 0.74rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.5);
  color: #2f434b;
}

.card-row-title {
  font-weight: 700;
  line-height: 1.3;
}

.card-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.78rem;
}

.card-row-chapo {
  color: #38545d;
  font-size: 0.85rem;
}

.card-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.card-row-tags-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #324952;
  align-self: center;
}

.user-tag {
  border-radius: 999px;
  background: rgba(15, 135, 144, 0.16);
  border: 1px solid rgba(15, 120, 128, 0.35);
  padding: 0.1rem 0.42rem;
  font-size: 0.73rem;
}

.user-alert-tag {
  border-radius: 999px;
  border: 1px solid #9b9b9b;
  padding: 0.1rem 0.42rem;
  font-size: 0.73rem;
  font-weight: 700;
  background: #f1f1f1;
  color: #424242;
}

.user-alert-tag.attention_required {
  border-color: #d69744;
  background: #ffe9c9;
  color: #7b4a00;
}

.empty {
  border: 1px dashed #95a7ad;
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.5);
  color: #3c5259;
}

.empty.empty-add-trigger {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px dashed #95a7ad;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.empty.empty-add-trigger:hover {
  border-color: #7f97a0;
  background: rgba(255, 255, 255, 0.72);
}

.empty.empty-add-trigger .lucide-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.empty.empty-add-trigger.empty-add-trigger-minimal {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  width: auto;
  gap: 0.25rem;
  color: #3c5259;
}

.empty.empty-add-trigger.empty-add-trigger-minimal:hover {
  border: none;
  background: transparent;
  color: #2f4750;
}

.empty.empty-add-trigger.empty-add-trigger-minimal .empty-add-plus {
  font-weight: 700;
  line-height: 1;
}

.details {
  display: none;
  position: relative;
  background: #ffffff;
  padding: 0.8rem;
  height: calc(100vh - 70px);
  max-height: calc(100vh - 70px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 0;
}

.details-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  z-index: 10;
  cursor: wait;
  transition: opacity 0.15s ease;
}

.details-loading-overlay.hidden {
  display: none;
}

.workspace.with-details .details {
  display: block;
  border-left: 1px solid rgba(67, 84, 89, 0.25);
}

#details-content {
  display: grid;
  gap: 0.6rem;
}

.card-main-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem;
}

.card-main-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.detail-mobile-close-btn,
.comment-editor-head-close-btn,
.floating-item-head-close-btn {
  display: none;
}

.card-main-head-actions > button,
.detail-add-toggle,
.event-item-icon-btns .icon-btn,
.compact-action-btn {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.card-main-head-actions > button:hover,
.detail-add-toggle:hover,
.event-item-icon-btns .icon-btn:hover,
.compact-action-btn:hover {
  background: #eef2f7;
  color: #334155;
  border-color: var(--line);
}

.card-main-head-actions > button .lucide-icon,
.detail-add-toggle .lucide-icon,
.event-item-icon-btns .icon-btn .lucide-icon,
.compact-action-btn .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.detail-card-main-title {
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.card-main-readonly {
  display: grid;
  gap: 0.36rem;
  margin-top: 0.15rem;
}

.card-main-readonly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
}

/* Tags du sujet : dans la rangée de chips du haut, à droite des pastilles et à la
   même taille (0.72rem, mêmes marges internes) que celles-ci. */
.card-main-readonly-chips .card-main-readonly-tags {
  gap: 0.32rem;
}

.card-main-readonly-chips .card-main-readonly-tags:empty {
  display: none;
}

.card-main-readonly-chips .card-main-readonly-tags .detail-tag-chip {
  font-size: 0.72rem;
  padding: 0.14rem 0.5rem;
  line-height: 1.2;
}

.card-main-pill {
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: #334155;
}

.card-main-pill.card-main-pill-status {
  background: #e0f2fe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.card-main-pill.card-main-pill-priority {
  background: #f1f5f9;
  border-color: var(--line);
  color: #475569;
}

.card-main-pill.card-main-pill-priority.card-main-pill-priority-low {
  background: var(--sticky-low);
  border-color: var(--sticky-low-border, var(--sticky-low));
  color: var(--sticky-low-text, #334155);
}

.card-main-pill.card-main-pill-priority.card-main-pill-priority-medium {
  background: var(--sticky-medium);
  border-color: var(--sticky-medium-border, var(--sticky-medium));
  color: var(--sticky-medium-text, #334155);
}

.card-main-pill.card-main-pill-priority.card-main-pill-priority-high {
  background: var(--sticky-high);
  border-color: var(--sticky-high-border, var(--sticky-high));
  color: var(--sticky-high-text, #9a3412);
}

.card-main-pill.card-main-pill-priority.card-main-pill-priority-critical {
  background: var(--sticky-critical);
  border-color: var(--sticky-critical-border, var(--sticky-critical));
  color: var(--sticky-critical-text, #5c0a0a);
}

.card-main-pill.card-main-pill-impact {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.card-main-pill.card-main-pill-due {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.card-main-pill.card-main-pill-focusable {
  cursor: pointer;
}

.card-main-preview-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.38rem 0.46rem;
  font-size: 0.84rem;
}

.card-main-readonly-editing .card-main-preview-block {
  display: none;
}

.card-main-panel {
  display: grid;
  gap: 0.5rem;
  border-top: 1px dashed #d7dfe4;
  padding-top: 0.48rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.detail-grid.detail-grid-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid.detail-grid-task {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 1fr) minmax(6.5rem, 0.8fr) minmax(10rem, 1.2fr);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.card-actions #archive-card-btn,
.card-actions #delete-card-btn {
  padding: 0.44rem 0.72rem;
  font-size: 0.84rem;
  border-radius: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-list label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.62rem;
  background: #fff;
  color: #5b6b78;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.user-list label:hover {
  border-color: var(--accent);
  color: #1f2937;
}

.user-list label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.user-list label:focus-within {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.user-list-extended {
  display: grid;
  gap: 0.35rem;
}

.member-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.36rem 0.45rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.member-row strong {
  min-width: 160px;
}

.member-row label {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.24rem;
  font-size: 0.82rem;
}

.member-row label input[type="checkbox"] {
  margin: 0.12rem 0 0;
}

.member-row label.alert {
  border: 1px solid #c4c7ca;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.2rem;
  background: #f3f4f5;
  white-space: nowrap;
}

.member-row label.alert.attention {
  border-color: #d69744;
  background: #ffe9c9;
  color: #7b4a00;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-list label,
.tag-list .detail-tag-chip {
  border: 1px solid #8797a3;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: rgba(135, 151, 163, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.tag-list .detail-tag-chip {
  border-width: 1px;
  line-height: 1.2;
  cursor: pointer;
}

.tag-list button.detail-tag-chip {
  font: inherit;
}

.tag-list label.detail-tag-chip,
.tag-list button.detail-tag-chip {
  cursor: pointer;
}

.tag-list label.macro,
.tag-list .detail-tag-chip.macro {
  border-style: dashed;
  font-weight: 700;
}

.tag-list .detail-member-chip {
  border-color: #acc0d6;
  background: #eff6ff;
  color: #334155;
}

.tag-list .detail-member-chip.attention {
  border-color: #fbbf24;
  background: #fef3c7;
  color: #92400e;
}

.detail-member-chip .member-chip-badge {
  border-radius: 999px;
  background: rgba(146, 64, 14, 0.14);
  padding: 0.04rem 0.32rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.tag-list-readonly {
  align-items: flex-start;
}

/* Résumé des membres concernés en haut du sujet : taille alignée sur les pills
   Statut/Priorité/Portée (sans quoi `font: inherit` ci-dessus les surdimensionne),
   et chips non interactifs. */
.tag-list-readonly button.detail-member-chip {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.14rem 0.5rem;
  cursor: default;
}

.card-main-readonly-members:empty {
  display: none;
}

.tag-editor-list {
  display: grid;
  gap: 0.35rem;
}

.tag-editor-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0.35rem 0.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px auto;
  gap: 0.35rem;
  align-items: center;
}

.tag-editor-row .tag-edit-color {
  width: 100%;
}

.tag-editor-row .tag-edit-save {
  white-space: nowrap;
}

#card-tags-dialog .card-tags-dialog-article,
#card-members-dialog .card-tags-dialog-article {
  display: grid;
  gap: 0.55rem;
}

#card-visual-dialog {
  width: min(440px, calc(100vw - 1.5rem));
}

.card-visual-dialog-article {
  display: grid;
  gap: 0.75rem;
}

.card-visual-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-visual-dialog-head h2 {
  margin: 0 0 0.14rem;
}

.card-visual-dialog-head small {
  display: block;
  color: #64748b;
  line-height: 1.3;
}

.card-visual-control,
.card-visual-layout-field {
  display: grid;
  gap: 0.45rem;
  border: 1px solid #dbe3eb;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.62rem;
}

.card-visual-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-visual-block-reset {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0.35rem;
}

.card-visual-block-reset:disabled {
  opacity: 0.35;
  cursor: default;
}

.card-visual-color-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.2rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
}

#card-visual-color {
  width: 3.2rem;
  min-height: 2.2rem;
  padding: 0.12rem;
}

.card-visual-size-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 2rem;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
}

#card-visual-size {
  width: 100%;
  accent-color: #0f8790;
}

#card-visual-size-value {
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  padding: 0.14rem 0.4rem;
  text-align: center;
}

.card-visual-layout-field select {
  width: 100%;
}

.inline-add-actions.card-visual-actions {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
}

#card-visual-cancel-btn {
  justify-self: end;
}

#card-tags-dialog .card-tags-dialog-head,
#card-members-dialog .card-tags-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

#card-tags-dialog .card-tags-dialog-head h2,
#card-members-dialog .card-tags-dialog-head h2 {
  margin: 0;
}

.card-tags-dialog-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-tags-tabs {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.12rem;
  gap: 0.12rem;
}

.card-tags-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font-size: 0.77rem;
  padding: 0.22rem 0.56rem;
  white-space: nowrap;
}

.card-tags-tab.active,
.card-tags-tab[aria-selected="true"] {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e3a8a;
}

.card-tags-choices {
  display: grid;
  gap: 0.36rem;
}

.card-tags-choice {
  border-radius: 10px;
  border: 1px solid #bfc8d1;
  padding: 0.28rem 0.42rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.card-tags-choice.macro {
  border-style: dashed;
}

.card-tags-choice input[type="checkbox"] {
  margin: 0;
}

.card-tags-choice small {
  color: #334155;
  font-size: 0.72rem;
}

.card-members-choice {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.card-members-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-members-choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  white-space: nowrap;
}

.card-members-choice-attention {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.board-tags-admin-list .card-tags-choice {
  grid-template-columns: minmax(0, 1fr) auto auto;
  cursor: context-menu;
}

.tag-visibility-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  font-size: 0.7rem;
  color: #334155;
  background: #f8fafc;
  white-space: nowrap;
}

.tag-visibility-badge.hidden {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.tag-visibility-badge.archived {
  border-color: #f6d8a8;
  color: #92400e;
  background: #fff7ed;
}

.card-tags-create-wrap {
  display: grid;
  gap: 0.4rem;
}

#card-tags-create-color,
#event-tags-create-color {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.12rem;
}

.board-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin-top: 0.32rem;
}

.board-color-palette-swatch {
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--swatch-color);
  cursor: pointer;
}

.board-color-palette-swatch:hover,
.board-color-palette-swatch:focus-visible {
  border-color: #64748b;
  outline: none;
}

.board-color-palette-swatch.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb;
}

.comments,
.checklist,
.events {
  display: grid;
  gap: 0.68rem;
}

/* .events-past-divider supprimé (séparateur « Événements passés » retiré). */

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.detail-section-head h3 {
  margin: 0;
}

.detail-add-toggle {
  margin-left: auto;
}

.detail-add-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: #e2e8f0;
  color: #0f172a;
}

.detail-inline-form {
  margin-top: 0.2rem;
  margin-bottom: 0.45rem;
  display: grid;
  gap: 0.45rem;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  margin: 0 0 4px;
  padding-top: 4px;
  min-height: calc(0.984rem + 4px);
}

.card-main-fields-actions {
  display: grid;
  justify-items: end;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.2rem;
}

.card-main-fields-primary-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}

.card-main-management-actions {
  justify-content: flex-end;
}

/* Actions secondaires (Exporter / Réaffecter / Archiver / Supprimer) : typo plus
   petite que les actions phares Enregistrer / Annuler. */
.card-main-management-actions button:not(.icon-btn) {
  font-size: 0.74rem;
  padding: 0.3rem 0.6rem;
  border-radius: 7px;
}

#redispatch-card-btn.active {
  border-color: #0b6b7c;
  background: #e6f7fa;
  color: #0f4f5b;
}

.redispatch-item-selector {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 1.25rem;
  margin: 0;
  cursor: pointer;
}

.redispatch-mode .redispatch-item-selector {
  display: inline-flex;
}

.redispatch-item-checkbox {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: #0b6b7c;
  cursor: pointer;
}

.card-redispatch-controls {
  margin: 0.65rem 0;
  padding: 0.7rem;
  border: 1px solid #cbd8e6;
  border-radius: 10px;
  background: #f8fbff;
  display: grid;
  gap: 0.4rem;
}

.card-redispatch-controls.hidden {
  display: none;
}

.card-redispatch-controls-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.55rem;
}

.card-redispatch-controls-main label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.card-redispatch-controls-main select {
  min-width: 0;
}

.detail-card-members-field {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.1rem;
}

/* Modale « Affecter à un autre tableau » : boutons tableau facon toggle. */
.reassign-board-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.3rem;
}

.reassign-board-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  padding: 0.42rem 0.72rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.reassign-board-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reassign-board-btn.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.card-main-panel > label,
.detail-inline-form > label,
.check-edit-panel > label,
.event-edit-panel > label,
.detail-item-note-composer > label {
  display: grid;
  gap: 0;
}

.card-main-panel input,
.card-main-panel textarea,
.card-main-panel select,
.detail-inline-form input,
.detail-inline-form textarea,
.detail-inline-form select,
.check-edit-panel input,
.check-edit-panel textarea,
.check-edit-panel select,
.event-edit-panel input,
.event-edit-panel textarea,
.event-edit-panel select,
.detail-item-note-composer input,
.detail-item-note-composer textarea,
.detail-item-note-composer select {
  min-width: 0;
  max-width: 100%;
  min-height: 1.92rem;
  padding: 0.32rem 0.45rem;
  border-radius: 7px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.card-main-panel textarea,
.detail-inline-form textarea,
.check-edit-panel textarea,
.event-edit-panel textarea,
.detail-item-note-composer textarea {
  line-height: 1.35;
}

.inline-add {
  margin-top: 0.2rem;
  border: 1px dashed #b4c2c8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.45rem;
}

.inline-add > summary {
  cursor: pointer;
  font-weight: 700;
  color: #30505a;
}

.inline-add[open] > summary {
  margin-bottom: 0.35rem;
}

.inline-add-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}

.inline-add-cancel-btn {
  min-width: 6.2rem;
  border: 1px solid #b8c6d8;
  background: #f8fafc;
  color: #334155;
}

.inline-add-save-btn {
  min-width: 6.2rem;
  border: 1px solid #8aa8d6;
  background: #edf4ff;
  color: #1f3a68;
}

.inline-add-save-btn:hover,
.inline-add-save-btn:focus-visible {
  border-color: #6d8fc4;
  background: #dfeeff;
}

.inline-add-cancel-btn:hover,
.inline-add-cancel-btn:focus-visible {
  border-color: #91a7c5;
  background: #eaf1ff;
}

.comment-item,
.check-item,
.event-item {
  border: 1px solid var(--detail-block-border);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
  background-clip: padding-box;
}

.comment-item.editing-hidden {
  display: none;
}

.comment-item {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
}

.comment-item-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  /* Pas de border-radius : clip via le parent (.comment-item overflow:hidden). */
  padding: 0.42rem 0.5rem;
  cursor: pointer;
  /* Aligné sur la hauteur de la ligne tâche. */
  min-height: 2.54rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.redispatch-mode .comment-item-row {
  display: flex;
}

.comment-item-open .comment-item-row {
  background: #eff6ff;
}

.comment-item-row-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.comment-item-row-author {
  font-size: 0.78rem;
  color: #1f3841;
  white-space: nowrap;
}

.comment-item-row-date {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.comment-item-row-summary {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.28;
  display: block;
  max-height: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-item-open .comment-item-row-summary,
.comment-item-open .comment-item-row-file-count,
.comment-item-open .comment-item-row-cost {
  display: none;
}

.comment-item-row-file-count,
.comment-item-row-cost {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  color: #334155;
  background: #eef2f7;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
}

.comment-item-row-cost {
  color: #0f5132;
  background: #e7f6ec;
}

.comment-voice-journal-cost {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e7f6ec;
  color: #0f5132;
  font-size: 0.75rem;
  font-weight: 700;
}

.comment-files-inline {
  margin-top: 0.05rem;
}

.comment-item-tags-inline {
  max-width: calc(100% - 1rem);
  margin: -0.12rem 0.5rem 0.05rem;
}

.comment-item-row-right {
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(58%, 38rem);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  margin-left: auto;
}

.comment-item-row-tags-inline {
  flex: 0 1 auto;
  min-width: min(8rem, 18vw);
  max-width: min(18rem, 28vw);
  margin: 0;
  justify-content: flex-end;
  overflow: hidden;
}

.comment-item-row-date,
.comment-item-row-file-count,
.comment-item-row-cost,
.comment-item-row-right .archived-ghost-indicator,
.comment-item-row-right .pinned-indicator,
.comment-item-row-right .entity-ping-btn {
  flex: 0 0 auto;
}

.comment-item-panel-tags-inline {
  margin: 0.2rem 0 0.1rem;
}

.comment-item-row-delete-btn {
  width: 1.85rem;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comment-item-row .entity-ping-btn,
.comment-item-row-copy-link-btn {
  width: 1.65rem;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comment-item-row > .entity-ping-btn .lucide-icon,
.comment-item-row-copy-link-btn .lucide-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.comment-item-row-delete-btn .lucide-icon {
  width: 0.88rem;
  height: 0.88rem;
}

.comment-view-panel {
  border-top: 1px dashed #d7dfe4;
  /* Parent sans padding : on en met ici. */
  padding: 0.36rem 0.5rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.rich-text {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.rich-text a {
  color: #0c6f79;
  text-decoration: underline;
}

.rich-text .inline-note-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.4rem 0;
  border: 1px solid #d6dde3;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #4a646c;
  margin-bottom: 0.2rem;
}

.comment-head-main {
  display: grid;
  gap: 0.05rem;
}

.comment-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.comment-actions button {
  border: 1px solid #b3c0c6;
  background: linear-gradient(180deg, #f8fafb, #ebf0f2);
  color: #39545e;
  padding: 0.12rem 0.42rem;
  font-size: 0.72rem;
  border-radius: 7px;
}

.comment-actions .comment-action-icon-btn {
  width: 1.9rem;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comment-actions .comment-action-icon-btn .lucide-icon {
  width: 0.88rem;
  height: 0.88rem;
}

.comment-actions button.danger {
  border-color: #d19090;
  color: #8b1f1f;
  background: linear-gradient(180deg, #fff6f6, #ffe6e6);
}

.comment-copy-link-btn.copied {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.comment-draft-status {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: #476169;
}

.comment-draft-status.error {
  color: #8b1f1f;
}

.textarea-format-toolbar {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  flex-wrap: wrap;
  margin: 0.12rem 0 0.22rem;
  padding: 0.24rem;
  border: 1px solid #d7e1e7;
  border-radius: 10px;
  background: #f8fafc;
}

.textarea-format-btn {
  border: 1px solid #b9c7cd;
  background: #ffffff;
  color: #2f4d57;
  border-radius: 6px;
  font-size: 0.74rem;
  line-height: 1;
  min-width: 1.9rem;
  height: 1.72rem;
  padding: 0.18rem 0.42rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.textarea-format-btn:hover,
.textarea-format-btn:focus-visible {
  border-color: #7ea6ef;
  color: #174dc7;
}

.textarea-format-btn.is-active {
  border-color: #2563eb;
  background: #eaf1ff;
  color: #174dc7;
}

.textarea-format-btn-icon {
  width: 1.9rem;
  padding-inline: 0;
}

.textarea-format-separator {
  width: 1px;
  height: 1.4rem;
  background: #d7e1e7;
  margin: 0 0.1rem;
}

.textarea-format-color-palette {
  display: flex;
  align-items: center;
  gap: 0.24rem;
  flex-wrap: wrap;
}

.textarea-format-color {
  width: 1.22rem;
  height: 1.22rem;
  min-width: 1.22rem;
  min-height: 1.22rem;
  border: 1px solid rgba(51, 65, 85, 0.28);
  border-radius: 999px;
  padding: 0;
  background: var(--connector-option-color, #334155);
  cursor: pointer;
}

.textarea-format-color:hover,
.textarea-format-color:focus-visible {
  border-color: #1d7880;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(29, 120, 128, 0.28);
}

.rich-textarea-source-hidden {
  display: none !important;
}

.rich-textarea-editor-source-hidden {
  display: none !important;
}

.rich-textarea-editor {
  border: 1px solid #b8b3aa;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  display: block;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rich-textarea-editor--floating-event-comment,
.rich-textarea-editor--floating-task-comment,
.comment-editor-body-field .rich-textarea-editor {
  min-height: 260px;
  max-height: 52vh;
  overflow-y: auto;
}

.rich-textarea-editor--floating-note-body {
  min-height: 560px;
  max-height: 70vh;
  overflow-y: auto;
}

.rich-textarea-editor:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: #7ea6ef;
}

.rich-textarea-editor.is-empty::before {
  content: attr(data-placeholder);
  color: #7b8496;
  pointer-events: none;
}

.rich-textarea-editor a {
  color: #174dc7;
  text-decoration: underline;
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-textarea-editor h1,
.rich-textarea-editor h2,
.rich-textarea-editor h3 {
  margin: 0.45rem 0 0.25rem;
  line-height: 1.18;
  color: #1e293b;
}

.rich-text h1,
.rich-textarea-editor h1 {
  font-size: 1.42rem;
}

.rich-text h2,
.rich-textarea-editor h2 {
  font-size: 1.18rem;
}

.rich-text h3,
.rich-textarea-editor h3 {
  font-size: 1rem;
}

.rich-text p,
.rich-textarea-editor p {
  margin: 0.25rem 0;
}

.rich-textarea-editor p {
  margin: 0;
}

.rich-text ul,
.rich-text ol,
.rich-textarea-editor ul,
.rich-textarea-editor ol {
  margin: 0.28rem 0 0.38rem 1.25rem;
  padding-left: 0.9rem;
}

.rich-text li,
.rich-textarea-editor li {
  margin: 0.14rem 0;
}

.rich-text blockquote,
.rich-textarea-editor blockquote {
  margin: 0.38rem 0;
  padding: 0.28rem 0.55rem;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #334155;
}

.rich-text pre,
.rich-textarea-editor pre {
  margin: 0.4rem 0;
  padding: 0.48rem 0.58rem;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.rich-text code,
.rich-textarea-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.rich-text hr,
.rich-textarea-editor hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.65rem 0;
}

.rich-textarea-editor .rich-inline-media {
  display: block;
  max-width: 100%;
  min-width: 140px;
  margin: 0.25rem 0;
  border: 1px dashed #b8c4d0;
  border-radius: 10px;
  overflow: auto;
  resize: both;
  vertical-align: top;
  cursor: move;
}

.rich-textarea-editor .rich-inline-media-caret-line {
  min-height: 1.3em;
  margin: 0.12rem 0;
}

.rich-textarea-editor .rich-inline-media-caret-line:empty::before {
  content: "\00a0";
}

.rich-textarea-editor .rich-inline-media-too-large {
  display: grid;
  gap: 0.18rem;
  margin: 0.4rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px dashed #c2410c;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
}

.rich-textarea-editor .rich-inline-media-too-large strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.rich-textarea-editor .rich-inline-media-too-large span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.rich-textarea-editor .rich-inline-media.is-dragging {
  opacity: 0.1;
}

.rich-inline-media-drag-preview {
  resize: none !important;
  overflow: hidden !important;
}

.rich-textarea-editor .rich-editor-drag-caret {
  display: inline-block;
  width: 0;
  height: 1.2em;
  margin: 0 1px;
  border-left: 2px solid #174dc7;
  vertical-align: text-bottom;
  pointer-events: none;
  animation: rich-editor-drag-caret-blink 0.9s steps(1, end) infinite;
}

@keyframes rich-editor-drag-caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.rich-textarea-editor .rich-inline-media .inline-note-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 8px;
  pointer-events: none;
}

.comment-files,
.card-files {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.35rem;
}

.card-file-item {
  border: 1px solid var(--detail-block-border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.38rem;
  display: grid;
  gap: 0.34rem;
  box-shadow: none;
  background-clip: padding-box;
}

.card-file-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  padding: 0.14rem 0.22rem;
  cursor: pointer;
}

.card-file-item-row-with-icon {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.redispatch-mode .card-file-item-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.redispatch-mode .card-file-item-row-with-icon {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.card-file-item-row .card-file-delete-btn {
  width: 1.6rem;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  opacity: 0.55;
}

.card-file-item-row .entity-ping-btn,
.card-file-copy-link-btn {
  width: 1.55rem;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-file-item-row > .entity-ping-btn .lucide-icon,
.card-file-copy-link-btn .lucide-icon {
  width: 0.78rem;
  height: 0.78rem;
}

.card-file-copy-link-btn.copied {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.card-file-item-row .card-file-delete-btn:hover {
  opacity: 1;
}

.card-file-item-open .card-file-item-row {
  background: #e8f1fd;
}

.card-file-row-name {
  min-width: 0;
  font-size: 0.8rem;
  color: #1f3f75;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-file-row-primary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.card-file-row-primary .card-file-row-name {
  flex: 0 1 auto;
}

.card-file-row-right {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.card-file-row-tags-inline {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  justify-content: flex-end;
}

.card-file-row-meta {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  /* Rétrécit et coupe par la droite (…) plutôt que de laisser le conteneur
     tronquer le début du texte quand la ligne déborde (ressource rattachée). */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-file-panel {
  border-top: 1px dashed #d7dfe4;
  padding-top: 0.36rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
}

.card-file-panel-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
}

.card-file-preview-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  /* reset button defaults when used as a button */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.card-file-preview-link:hover .card-file-preview {
  opacity: 0.85;
  border-color: #93c5fd;
}

.card-file-preview {
  width: min(100%, 360px);
  height: auto;
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #ffffff;
  transition: opacity 0.15s, border-color 0.15s;
}

.card-file-main {
  min-width: 0;
  display: grid;
  gap: 0.38rem;
}

.card-file-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.card-file-panel-title:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.card-file-panel-comment {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.card-file-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e3a8a;
  text-decoration: underline;
  overflow-wrap: anywhere;
  /* reset button defaults */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.card-file-name:hover {
  color: #1d4ed8;
}

.card-file-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: #4b5563;
  text-decoration: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-top: 0.1rem;
  width: fit-content;
}
.card-file-download-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.card-file-meta {
  font-size: 0.72rem;
  color: #64748b;
  overflow-wrap: anywhere;
}

.card-file-original-name {
  font-size: 0.7rem;
  color: #64748b;
  overflow-wrap: anywhere;
}

.card-file-metadata-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.2rem;
  align-items: baseline;
}

.card-file-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-file-title-value {
  font-size: 0.78rem;
  color: #1e293b;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card-file-metadata-row--desc .card-file-label {
  padding-top: 0.1rem;
}

.card-file-comment {
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.card-file-delete-btn {
  border: none !important;
  border-radius: 8px;
  width: 1.85rem;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  background: #fee2e2;
  color: #991b1b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  margin-left: auto;
}

.card-file-delete-btn .lucide-icon {
  width: 0.88rem;
  height: 0.88rem;
}

.check-item {
  display: grid;
  gap: 0.36rem;
}

.check-item-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  min-height: 2.54rem;
}

/* Jalon de feuille de route : liseré gris + drapeau (la priorité garde la couleur de fond). */
.check-item-milestone-flag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #64748b;
}

/* Drapeau devant le titre d'un jalon dans « Mes tâches ». */
.my-task-flag {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.12em;
  margin-right: 0.28rem;
  color: #64748b;
}

.check-item-milestone-flag .lucide-icon {
  width: 0.95rem;
  height: 0.95rem;
}

/* Sous-tâches indentées sous leur jalon/tâche parente. */
.check-subtasks {
  margin-left: 1.5rem;
  padding-left: 0.5rem;
  display: grid;
  gap: 0.3rem;
}

/* Tri « Jalons uniquement » : sous-tâches masquées par défaut, révélées dès que
   le jalon (ou l'une de ses sous-tâches) est ouvert dans le groupe. */
.milestone-group .check-subtasks.subtasks-collapsed {
  display: none;
}

.milestone-group:has(.check-item.check-item-open) .check-subtasks.subtasks-collapsed {
  display: grid;
}

/* ── Bande « Feuille de route » (vue FDR par card) ───────────────────────── */
.fdr-band {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.4rem 0.55rem 0.55rem;
  margin: 0.25rem 0 0.75rem;
  /* Élément de grille de #details-content : sans min-width:0, la min-content de la
     piste (tuiles à largeur fixe) élargirait toute la colonne hors viewport. */
  min-width: 0;
}

.fdr-band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.fdr-band-head-left {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}

.fdr-band-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.fdr-band-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.fdr-band-timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #e2e8f0;
  background: #eef1f5;
  color: #64748b;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.fdr-band-timeline-link:hover {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5e1;
}

.fdr-band-timeline-link .lucide-icon {
  color: currentColor;
}

.fdr-band-title .lucide-icon {
  color: #64748b;
}

.fdr-band-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 600;
}

.fdr-band-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, transform 0.15s;
}

.fdr-band-toggle:hover {
  background: #e2e8f0;
}

.fdr-band--collapsed .fdr-band-toggle {
  transform: rotate(-90deg);
}

.fdr-band-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  padding-bottom: 0.2rem;
  /* Glisser pour faire défiler horizontalement (barre masquée). pan-y laisse le
     défilement vertical de la page passer sur écran tactile. */
  cursor: grab;
  touch-action: pan-y;
}

.fdr-band--dragging .fdr-band-track {
  cursor: grabbing;
  user-select: none;
}

.fdr-band--dragging .fdr-node {
  cursor: grabbing;
}

.fdr-node-sep {
  flex: 0 0 auto;
  align-self: center;
  width: 1.1rem;
  height: 2px;
  background: var(--line, #cbd5e1);
}

.fdr-node {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  width: 8.5rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  color: #1e293b;
  text-align: left;
  transition: box-shadow 0.12s, transform 0.08s;
}

.fdr-node-top {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fdr-node:hover {
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.14);
}

.fdr-node:active {
  transform: translateY(1px);
}

/* Couleur = priorité (même palette que les tâches/jalons). */
.fdr-node.check-item-priority-critical { background: var(--sticky-critical); }
.fdr-node.check-item-priority-high { background: var(--sticky-high); }
.fdr-node.check-item-priority-medium { background: var(--sticky-medium); }
.fdr-node.check-item-priority-low { background: var(--sticky-low); }

.fdr-node-flag {
  display: inline-flex;
  flex: 0 0 auto;
  color: #64748b;
}

.fdr-node-date {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #475569;
}

.fdr-node-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  color: #334155;
}

/* État = remplissage du drapeau (à faire gris / fait vert / annulé rouge). */
.fdr-node--todo .fdr-node-flag { color: #64748b; }
.fdr-node--done .fdr-node-flag { color: #16a34a; }
.fdr-node--cancelled .fdr-node-flag { color: #dc2626; }

.fdr-node--done .fdr-node-label,
.fdr-node--cancelled .fdr-node-label {
  text-decoration: line-through;
  opacity: 0.65;
}

.fdr-node--overdue .fdr-node-date {
  color: #dc2626;
}

/* Champ libellé + bouton "jalon" (drapeau) à droite. */
.new-check-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.new-check-title-row > input {
  flex: 1 1 auto;
  min-width: 0;
}

/* Bouton bascule "jalon" (drapeau) — tons gris, actif = gris foncé. */
.check-type-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--line, #d2dce8);
  border-radius: 7px;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: pointer;
}

.check-type-toggle:hover,
.check-type-toggle:focus-visible {
  color: #64748b;
  border-color: var(--accent);
}

.check-type-toggle.is-active,
.check-type-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Formulaire de sous-tâche en ligne, dans le cadre du jalon parent. */
.subtask-add-form {
  margin: 0.3rem 0 0.2rem 1.5rem;
  padding: 0.5rem;
  border: 1px dashed var(--line, #d2dce8);
  border-radius: 8px;
  display: grid;
  gap: 0.4rem;
  background: #f8fafc;
}

.check-item-row > .check-done-btn {
  flex: 0 0 auto;
}
.check-item-row > .check-item-title {
  flex: 1 1 auto;
  min-width: 0;
}
.check-item-row > .check-item-tags-inline {
  flex: 0 0 auto;
  max-width: none;
  flex-wrap: nowrap;
}
.check-item-row > .check-item-assignees-inline {
  flex: 0 0 auto;
}
.check-item-row > .check-item-meta-inline {
  flex: 0 0 auto;
}

.check-item-title {
  font-size: 0.82rem;
  color: #243a44;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.check-item-title.done {
  color: #15803d;
  text-decoration: none;
  opacity: 1;
}

.check-item-title.cancelled {
  color: #b91c1c;
  text-decoration: line-through;
  opacity: 0.75;
}

.check-item.check-item-priority-critical .check-item-row {
  background: var(--sticky-critical);
}

.check-item.check-item-priority-critical .check-item-title:not(.done):not(.cancelled) {
  color: var(--sticky-critical-text, #5c0a0a);
}

.check-item.check-item-priority-high .check-item-row {
  background: var(--sticky-high);
}

.check-item.check-item-priority-high .check-item-title:not(.done):not(.cancelled) {
  color: var(--sticky-high-text, #9a3412);
}

.check-item.check-item-priority-medium .check-item-row {
  background: var(--sticky-medium);
}

.check-item.check-item-priority-medium .check-item-title:not(.done):not(.cancelled) {
  color: var(--sticky-medium-text, #334155);
}

.check-item.check-item-priority-low .check-item-row {
  background: var(--sticky-low);
}

.check-item.check-item-priority-low .check-item-title:not(.done):not(.cancelled) {
  color: var(--sticky-low-text, #334155);
}

/* Événements : code couleur de priorité selon la portée (même logique que les tâches). */
.event-item.event-item-priority-critical .event-item-row {
  background: var(--sticky-critical);
}

.event-item.event-item-priority-high .event-item-row {
  background: var(--sticky-high);
}

.event-item.event-item-priority-medium .event-item-row {
  background: var(--sticky-medium);
}

.event-item.event-item-priority-low .event-item-row {
  background: var(--sticky-low);
}

.check-item-assignees-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  max-width: min(42vw, 360px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.check-assignee-tag {
  border-radius: 999px;
  border: 1px solid #acc0d6;
  background: #eff6ff;
  color: #334155;
  padding: 0.08rem 0.42rem;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.check-assignee-tag.check-assignee-tag-empty {
  border-style: dashed;
  color: #64748b;
  background: #f8fafc;
}

.check-item-due-inline {
  font-size: 0.73rem;
  color: #475569;
  white-space: nowrap;
}

.check-item-meta-inline {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.3rem;
  min-width: 0;
}

.check-item-meta-inline > .entity-ping-btn,
.event-item-meta-inline > .entity-ping-btn {
  width: 1.55rem;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-item-meta-inline > .entity-ping-btn .lucide-icon,
.event-item-meta-inline > .entity-ping-btn .lucide-icon {
  width: 0.78rem;
  height: 0.78rem;
}

.check-item-indicators-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.check-item-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
}

.check-item-indicator .lucide-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.check-item-indicator-comment {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.check-item-indicator-reminder {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.check-item-indicator-recurrence {
  width: auto;
  min-width: 1.08rem;
  gap: 0.18rem;
  padding: 0 0.32rem;
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.66rem;
  font-weight: 800;
}

.card-main-toggle {
  font-size: 1rem;
}

.card-main-archives-toggle {
  border-color: transparent !important;
}

.card-main-archives-toggle .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.card-main-archives-toggle.has-hidden {
  background: #fecaca !important;
  color: #991b1b !important;
}

.card-main-archives-toggle.is-showing {
  background: #bbf7d0 !important;
  color: #166534 !important;
}

.card-main-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: #e2e8f0;
  color: #0f172a;
}

.check-edit-panel {
  border-top: 1px dashed #d7dfe4;
  /* Le parent n'a plus de padding : on en met ici pour que les champs déployés ne touchent pas le filet. */
  padding: 0.36rem 0.5rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.check-edit-actions {
  margin-top: 0.12rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.check-edit-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.check-created-at {
  margin-right: auto;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.2;
  align-self: center;
}

.check-item.item-archived,
.event-item.item-archived {
  border-style: dashed;
  opacity: 0.82;
}

.check-item.item-archived .check-item-title:not(.done):not(.cancelled) {
  color: #64748b;
  text-decoration: line-through;
}

.event-item-archived-indicator,
.check-item-archived-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #64748b;
}

.event-item-archived-indicator .lucide-icon,
.check-item-archived-indicator .lucide-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.check-edit-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
}

.check-item .check-edit-title-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.check-edit-title-row .check-content {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.check-edit-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.check-copy-link-btn,
.event-copy-link-btn,
.check-archive-btn,
.check-delete-btn {
  border-radius: 8px;
  width: 1.85rem;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-copy-link-btn,
.event-copy-link-btn,
.check-archive-btn,
.check-delete-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0 !important;
}

.check-copy-link-btn:hover,
.event-copy-link-btn:hover,
.check-archive-btn:hover {
  background: #eef2f7;
  color: #334155;
  border-color: var(--line) !important;
}

.check-delete-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca !important;
}

.check-archive-btn.is-active {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca !important;
}

.check-copy-link-btn.copied,
.event-copy-link-btn.copied {
  background: #dcfce7;
  color: #166534;
}

.check-copy-link-btn .lucide-icon,
.event-copy-link-btn .lucide-icon,
.check-archive-btn .lucide-icon,
.check-delete-btn .lucide-icon {
  width: 0.88rem;
  height: 0.88rem;
}

.event-bottom-delete-btn {
  width: 1.95rem;
  min-width: 1.95rem;
  height: 1.95rem;
  margin-left: 0;
}

.check-linked-comments {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.check-linked-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.check-linked-comments-title {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.check-linked-comments-add-toggle {
  margin-left: auto;
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-linked-comments-add-toggle .lucide-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.check-linked-comments-add-form {
  border: 1px dashed #b4c2c8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.45rem;
  display: grid;
  gap: 0.3rem;
}

.check-linked-comments-add-form .detail-item-note-composer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.check-linked-comments-list {
  display: grid;
  gap: 0.32rem;
}

.new-check-linked-comments .check-linked-comments-add-form:not(.hidden) + .check-linked-comments-list {
  display: none;
}

.check-linked-comment {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  padding: 0.38rem 0.42rem;
  display: grid;
  gap: 0.28rem;
}

.check-linked-comment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: flex-start;
  row-gap: 0.14rem;
  column-gap: 0.35rem;
  border-radius: 7px;
  padding: 0.08rem 0.12rem;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

.check-linked-comment-row-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  min-width: 0;
}

.check-linked-comment-row-note-icon {
  display: inline-flex;
  align-items: center;
  color: #64748b;
  line-height: 1;
}

.check-linked-comment-row-note-icon .lucide-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.check-linked-comment-open .check-linked-comment-row {
  background: #eff6ff;
}

.check-linked-comment-row-author {
  color: #1f2937;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
}

.check-linked-comment-row-date {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.check-linked-comment-row-summary {
  grid-column: 1 / 2;
  min-width: 0;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 400;
  line-height: 1.28;
  max-height: calc(1.28em * 5);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

.check-linked-comment-open .check-linked-comment-row-summary {
  display: none;
}


.check-linked-comment-row > .entity-ping-btn,
.check-linked-comment-copy-link-btn,
.check-linked-comment-edit-btn {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  align-self: flex-start;
  margin-top: 0.02rem;
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  border-radius: 4px;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-linked-comment-copy-link-btn {
  grid-column: 3 / 4;
}

.check-linked-comment-edit-btn {
  grid-column: 4 / 5;
}

.check-linked-comment-copy-link-btn.copied {
  background: #dcfce7;
  color: #166534;
}

.check-linked-comment-row > .entity-ping-btn .lucide-icon,
.check-linked-comment-copy-link-btn .lucide-icon,
.check-linked-comment-edit-btn .lucide-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.check-linked-comment-row > .entity-ping-btn:hover,
.check-linked-comment-copy-link-btn:hover,
.check-linked-comment-edit-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
}

.check-linked-comment-row-delete-btn {
  margin-left: 0;
  grid-column: 5 / 6;
  grid-row: 1 / 2;
  align-self: flex-start;
  margin-top: 0.02rem;
}

.check-linked-comment-expanded {
  padding: 0.4rem 0.5rem 0.5rem 0.8rem;
  display: grid;
  gap: 0.4rem;
}

.check-linked-comment-body-preview {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.4;
}

.check-linked-comment-editor-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.check-linked-comment-files-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.check-linked-comment-files-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex: 1 1 auto;
}

.check-linked-comment-delete-btn {
  margin-left: auto;
  width: 1.85rem;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-linked-comment-delete-btn .lucide-icon {
  width: 0.88rem;
  height: 0.88rem;
}

.check-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 1fr) minmax(6.5rem, 0.8fr) minmax(10rem, 1.2fr);
  gap: 0.35rem;
}

.detail-item-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem 0.35rem;
  min-width: 0;
  width: 100%;
  justify-self: stretch;
  align-self: start;
}

/* Boutons d'ajout d'éléments désactivés tant que l'item n'est pas enregistré. La
   spécificité (0,4,0) l'emporte sur les règles .check-item .detail-item-action-btn. */
.detail-item-action-row .detail-item-action-btn:disabled,
.check-item .detail-item-action-row .detail-item-action-btn:disabled,
.event-item .detail-item-action-row .detail-item-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  box-shadow: none;
}

.unsaved-item-add-hint {
  align-self: center;
  font-size: 0.72rem;
  font-style: italic;
  color: #94a3b8;
  line-height: 1.2;
}

.detail-item-action-row .icon-btn {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
  margin-left: 0;
}

.detail-item-action-row .detail-add-toggle {
  margin-left: 0;
}

.detail-item-action-row .icon-btn:hover {
  background: #eef2f7;
  color: #334155;
  border-color: var(--line);
}

.detail-item-action-row .icon-btn .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.check-done-meta {
  color: #166534;
  font-size: 0.74rem;
}

.event-item {
  display: grid;
  gap: 0.36rem;
}

.event-item-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  min-height: 2.54rem;
}

.event-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: #243a44;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-item-title.done {
  color: #15803d;
  text-decoration: none;
  opacity: 1;
}

.event-item-assignees-inline {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: min(42vw, 360px);
}

.event-item-tags-inline {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
  min-width: 0;
  max-width: 40%;
}

.comment-item-row-tags-inline {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: min(18rem, 28vw);
  overflow: hidden;
  white-space: nowrap;
}

.card-file-row-tags-inline {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  max-width: none;
  overflow: hidden;
  white-space: nowrap;
}

.event-item-tag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid currentColor;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-event-tags-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.1rem 0;
}

.new-event-tags-selected {
  max-width: none;
  flex: 1 1 auto;
}

.new-event-tags-empty {
  color: #64748b;
  font-size: 0.78rem;
}

.event-item-meta-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.event-item-date-inline {
  font-size: 0.73rem;
  color: #475569;
  white-space: nowrap;
}

.event-edit-fixed-grid {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 1fr) minmax(6.5rem, 0.8fr);
}

.event-scope-badge {
  font-size: 0.68rem;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  white-space: nowrap;
}

.event-item-icon-btns {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.event-item-icon-btns .icon-btn {
  opacity: 1;
}

.event-item-icon-btns .icon-btn:hover,
.event-item-icon-btns .icon-btn.active {
  opacity: 1;
  background: #e2e8f0;
  color: #0f172a;
  border-color: var(--line);
}

/* En-tête du formulaire de création d'événement : titre + icônes (tag, note) en haut à droite. */
.events-add-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.events-add-title-input {
  flex: 1 1 auto;
  min-width: 0;
}


.event-edit-panel .event-linked-notes {
  border-top: 1px dashed #e2eaf0;
  padding-top: 0.35rem;
}

.event-edit-panel {
  border-top: 1px dashed #d7dfe4;
  /* Parent sans padding : on en met ici pour que les champs déployés ne touchent pas le filet. */
  padding: 0.36rem 0.5rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.check-item .check-assignees,
.event-item .event-assignees {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin-top: 3px;
  max-height: 90px;
  overflow: auto;
}

.check-item .check-assignees label,
.event-item .event-assignees label {
  font-size: 0.74rem;
}

.event-item .event-content {
  width: 100%;
  min-width: 0;
}

.event-item .event-date {
  width: 100%;
  min-width: 0;
}

.event-item .event-time {
  width: 100%;
  min-width: 0;
}

.event-date-time-row {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.7fr);
}

.event-date-time-row.event-edit-fixed-grid {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 1fr) minmax(6.5rem, 0.8fr);
}

.check-item .check-due-date {
  width: 100%;
  min-width: 0;
}

.check-item .check-due-time {
  width: 100%;
  min-width: 0;
}

.check-item .check-reminders {
  margin-top: 0.1rem;
}

.check-reminders-heading {
  margin-bottom: 4px;
}

.detail-item-note-composer {
  grid-column: 1 / -1;
  margin-top: 0.1rem;
  padding-top: 0.32rem;
  border-top: 1px dashed #d6dee2;
  display: grid;
  gap: 0.28rem;
}

.detail-item-note-label {
  margin-bottom: 0.2rem;
}

.detail-item-note-text {
  min-height: 66px;
  resize: vertical;
}

.detail-item-note-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.detail-item-note-files-section {
  display: grid;
  gap: 0.28rem;
}

.detail-item-note-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.detail-item-note-files-empty-trigger {
  margin: 0;
}

.detail-item-note-files-toggle {
  margin-left: auto;
  width: 1.8rem;
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0;
}

.detail-item-note-files-add-form {
  margin: 0;
}

.detail-item-note-files-add-form .detail-item-note-file-input {
  flex: 1 1 auto;
  width: 100%;
}

.detail-item-resource-add-form {
  margin: 0.1rem 0 0.15rem;
}

.detail-item-resource-file-input {
  flex: 1 1 220px;
  min-width: 0;
}

.detail-item-resource-file-comment {
  min-height: 56px;
  resize: vertical;
}

.detail-item-files {
  margin-top: 0.1rem;
}

/* La ligne ne compte que 3 cellules (icône, nom, cluster d'actions). Un gabarit à
   6 colonnes laissait 3 pistes vides à droite → le cluster restait bloqué en
   colonne 3, loin du bord (icônes désalignées avec les notes). 3 colonnes : le
   cluster est poussé au bord droit par la colonne nom (1fr). */
.detail-item-files .card-file-item-row-with-icon {
  grid-template-columns: 1rem minmax(0, 1fr) auto;
}

.redispatch-mode .detail-item-files .card-file-item-row-with-icon {
  grid-template-columns: auto 1rem minmax(0, 1fr) auto;
}

.detail-item-files .card-file-row-leading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  width: 1rem;
  min-width: 1rem;
  justify-self: center;
}

.detail-item-note-file-input {
  flex: 1 1 220px;
  min-width: 0;
}

.detail-item-note-file-comment {
  min-height: 56px;
  resize: vertical;
}

.note-files-staged-preview {
  font-size: 0.75rem;
  color: #334155;
  padding: 0.15rem 0.3rem;
  background: #f0f4f8;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-linked-comment-files {
  display: grid;
  gap: 0.3rem;
}

.detail-item-note-submit {
  border: none;
  border-radius: 8px;
  padding: 0.22rem 0.6rem;
  font-size: 0.74rem;
  color: #334155;
  background: linear-gradient(180deg, #f6f7f8, #e7ebee);
}

.check-reminders {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.check-reminders label {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #5b6b78;
  padding: 0.16rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
}

.check-reminders label:hover {
  border-color: var(--accent);
  color: #1f2937;
}

/* Case masquée : le chip fonctionne comme un bouton d'affectation (bleu quand actif). */
.check-reminders label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.check-reminders label:has(input[type="checkbox"]:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Rappels SMS en ligne dans la barre d'actions : "Rappel SMS :" + chips. */
.check-reminders-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.reminder-chips-label {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

/* Dans la barre d'actions : rappels poussés à droite. */
.detail-item-action-row .check-reminders-inline {
  margin-left: auto;
}

.check-reminders-picker {
  margin-top: 0.25rem;
}

.check-reminders-hint {
  color: #64748b;
  font-size: 0.73rem;
}

.detail-assignees-picker {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin-top: 3px;
  max-height: 140px;
  overflow: auto;
}

.detail-assignees-picker label {
  font-size: 0.8rem;
}

.detail-assignees-picker.user-list label,
.check-item .check-assignees.user-list label,
.event-item .event-assignees.user-list label {
  white-space: nowrap;
  line-height: 1.1;
  flex: 0 0 auto;
}

.detail-assignees-picker.user-list label input[type="checkbox"],
.check-item .check-assignees.user-list label input[type="checkbox"],
.event-item .event-assignees.user-list label input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.check-item .check-due-date,
.check-item .check-due-time,
.event-item .event-date {
  width: 100%;
  min-width: 0;
}

.check-item .check-done-btn {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  padding: 0;
  border: 1px solid var(--line);
  background: #e5e7eb;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-item .check-done-btn .check-done-icon {
  width: 0.92rem;
  height: 0.92rem;
  stroke-width: 2.2;
}

.check-item .check-done-btn.task-done-btn-done {
  border-color: #86efac;
  background: #22c55e;
  color: #ffffff;
}

.check-item .check-done-btn.task-done-btn-cancelled {
  border-color: #fca5a5;
  background: #ef4444;
  color: #ffffff;
}

.check-item .check-content.done {
  border-color: #86efac;
  background: #f0fdf4;
  text-decoration: none;
  opacity: 1;
}

.check-item .check-content.cancelled {
  border-color: #fca5a5;
  background: #fff1f2;
  text-decoration: line-through;
  opacity: 0.75;
}

.event-item .event-content.done {
  text-decoration: none;
  opacity: 1;
  color: #15803d;
}

.check-item.task-focus,
.event-item.task-focus {
  border-color: #1d7880;
  box-shadow: 0 0 0 1px rgba(29, 120, 128, 0.28);
}

.done {
  text-decoration: line-through;
  opacity: 0.58;
}

dialog {
  border: none;
  border-radius: 12px;
  width: min(760px, 92vw);
  background: #f8f5ef;
  box-shadow: 0 24px 60px rgba(25, 44, 49, 0.35);
}

dialog::backdrop {
  background: rgba(15, 22, 26, 0.45);
}

#floating-item-dialog {
  width: min(820px, 94vw);
}

#floating-item-dialog.floating-item-dialog-task {
  border: 2px solid var(--floating-task-dialog-border, var(--line));
  background: var(--floating-task-dialog-bg, #ffffff);
  color: var(--floating-task-dialog-text, var(--ink));
}

#floating-item-dialog.floating-item-dialog-priority-low {
  --floating-task-dialog-bg: var(--sticky-low);
  --floating-task-dialog-border: var(--sticky-low-border, var(--sticky-low));
  --floating-task-dialog-text: var(--sticky-low-text, var(--ink));
}

#floating-item-dialog.floating-item-dialog-priority-medium {
  --floating-task-dialog-bg: var(--sticky-medium);
  --floating-task-dialog-border: var(--sticky-medium-border, var(--sticky-medium));
  --floating-task-dialog-text: var(--sticky-medium-text, var(--ink));
}

#floating-item-dialog.floating-item-dialog-priority-high {
  --floating-task-dialog-bg: var(--sticky-high);
  --floating-task-dialog-border: var(--sticky-high-border, var(--sticky-high));
  --floating-task-dialog-text: var(--sticky-high-text, var(--ink));
}

#floating-item-dialog.floating-item-dialog-priority-critical {
  --floating-task-dialog-bg: var(--sticky-critical);
  --floating-task-dialog-border: var(--sticky-critical-border, var(--sticky-critical));
  --floating-task-dialog-text: var(--sticky-critical-text, var(--ink));
}

#board-create-dialog {
  width: min(560px, 92vw);
}

#board-settings-dialog {
  width: min(620px, 92vw);
  background: #ffffff;
}

#board-tags-admin-dialog {
  width: min(860px, 94vw);
}

#board-switch-dialog {
  width: min(620px, 92vw);
}

#confirm-dialog {
  width: min(420px, 92vw);
}

#notice-dialog {
  width: min(440px, 92vw);
}

#item-placement-dialog {
  width: min(620px, 94vw);
}

#item-conversion-dialog {
  width: min(780px, 95vw);
}

.item-conversion-dialog-article {
  display: grid;
  gap: 0.8rem;
  width: 100%;
}

.item-conversion-controls,
.item-conversion-target-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.item-conversion-controls label,
.item-conversion-target-options label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.item-conversion-controls select,
.item-conversion-target-options select,
.item-conversion-target-options input {
  width: 100%;
}

.item-conversion-target-options .item-conversion-check {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 0.45rem;
  min-height: 2.35rem;
  font-size: 0.82rem;
}

.item-conversion-target-options .item-conversion-check input {
  width: auto;
}

.item-conversion-preview {
  min-height: 8rem;
  padding: 0.75rem;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #fff;
  font-size: 0.83rem;
}

.item-conversion-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.65rem;
}

.item-conversion-compare section {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.65rem;
  border-radius: 8px;
  background: #f8fafc;
}

.item-conversion-compare section > small {
  color: #64748b;
}

.item-conversion-compare section > p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #334155;
}

.item-conversion-arrow {
  align-self: center;
  color: #64748b;
  font-size: 1.2rem;
}

.item-conversion-payload {
  display: grid;
  gap: 0.25rem;
}

.item-conversion-payload > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.item-conversion-payload span {
  color: #64748b;
}

.item-conversion-summary {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.item-conversion-summary p {
  margin: 0.25rem 0 0;
}

.item-conversion-chip {
  display: inline-flex;
  margin: 0 0.3rem 0.25rem 0;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.75rem;
}

.item-conversion-chip.kept {
  color: #166534;
  background: #dcfce7;
}

.item-conversion-chip.lost {
  color: #9a3412;
  background: #ffedd5;
}

.item-conversion-info,
.item-conversion-required,
.item-conversion-warnings {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e3a8a;
}

.item-conversion-warnings {
  padding-left: 1.75rem;
  background: #fff7ed;
  color: #9a3412;
}

.item-conversion-required {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 600;
}

.item-conversion-dialog-actions {
  align-items: center;
  justify-content: flex-end;
}

.item-conversion-dialog-actions .comment-draft-status {
  margin-right: auto;
}

.item-placement-dialog-article {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.item-placement-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.item-placement-dialog-grid label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.item-placement-dialog-grid select {
  width: 100%;
}

.item-placement-dialog-help {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.item-placement-dialog-actions {
  align-items: center;
  justify-content: flex-end;
}

.item-placement-dialog-actions .comment-draft-status {
  margin-right: auto;
}

@media (max-width: 620px) {
  .item-placement-dialog-grid,
  .item-conversion-controls,
  .item-conversion-target-options,
  .item-conversion-compare {
    grid-template-columns: 1fr;
  }

  .item-conversion-arrow {
    display: none;
  }
}

#documentation-dialog {
  width: min(980px, 94vw);
}

#notice-dialog-message {
  margin: 0;
  color: #1f2937;
  line-height: 1.45;
}

#assistant-dialog {
  width: min(820px, 94vw);
  max-height: 94vh;
  overflow-x: hidden;
  overflow-y: auto;
}

#assistant-dialog.assistant-execution-success {
  width: min(560px, 94vw);
}

#assistant-dialog.assistant-execution-success .assistant-dialog-head small,
#assistant-dialog.assistant-execution-success .assistant-question-field,
#assistant-dialog.assistant-execution-success .assistant-model-row,
#assistant-dialog.assistant-execution-success .assistant-dialog-actions > button,
#assistant-dialog.assistant-execution-success .assistant-voice-timer,
#assistant-dialog.assistant-execution-success .assistant-answer,
#assistant-dialog.assistant-execution-success .assistant-trace,
#assistant-dialog.assistant-execution-success .assistant-sources {
  display: none !important;
}

#assistant-dialog.assistant-execution-success .assistant-dialog-actions {
  justify-content: flex-start;
}

#assistant-dialog.assistant-execution-success .assistant-dialog-actions .comment-draft-status {
  margin: 0;
}

#assistant-dialog.assistant-execution-success .assistant-action-batch {
  max-height: none;
  overflow: visible;
}

.assistant-dialog-article {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.assistant-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.assistant-dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.assistant-dialog-head small {
  color: #64748b;
  font-size: 0.78rem;
}

.assistant-question-field {
  display: grid;
}

.assistant-question-field textarea {
  width: 100%;
  min-height: 5rem;
  overflow: hidden;
  resize: none;
}

.assistant-model-row {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  min-width: 0;
}

.assistant-model-field {
  display: grid;
  grid-template-columns: auto minmax(12rem, 18rem);
  align-items: center;
  gap: 0.45rem;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.assistant-model-field select {
  width: 100%;
  min-width: 0;
}

#assistant-model-description {
  min-width: 0;
  padding-bottom: 0.5rem;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.25;
}

.assistant-dialog-actions {
  align-items: center;
  justify-content: flex-end;
}

.assistant-dialog-actions .comment-draft-status {
  margin-right: auto;
}

#assistant-status.loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#assistant-status.loading .lucide-icon {
  flex: 0 0 auto;
  animation: assistant-status-spin 0.85s linear infinite;
}

@keyframes assistant-status-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #assistant-status.loading .lucide-icon {
    animation-duration: 1.8s;
  }
}

.assistant-voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.assistant-voice-btn.recording {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.assistant-voice-timer {
  min-width: 3.2rem;
  color: #334155;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

@media (max-width: 620px) {
  .assistant-model-row {
    display: grid;
  }

  .assistant-model-field {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #assistant-model-description {
    padding-bottom: 0;
  }

  .assistant-dialog-actions {
    flex-wrap: wrap;
  }

  .assistant-dialog-actions .comment-draft-status {
    flex-basis: 100%;
  }
}

.assistant-answer {
  padding: 0.7rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.assistant-action-batch {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.assistant-action-batch-head,
.assistant-action-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.assistant-action-batch-head > div,
.assistant-action-card > header > div {
  display: grid;
  gap: 0.15rem;
}

.assistant-action-batch-head small,
.assistant-action-batch-expiry {
  color: #64748b;
  font-size: 0.72rem;
}

.assistant-action-list {
  display: grid;
  gap: 1rem;
}

.assistant-action-shared-target {
  display: grid;
  grid-template-columns: minmax(14rem, 24rem) minmax(12rem, 1fr);
  align-items: end;
  gap: 0.45rem 0.8rem;
  padding: 0.65rem;
  border: 1px solid #bfd2e6;
  border-radius: 8px;
  background: #f4f8fc;
}

.assistant-action-shared-target label {
  display: grid;
  gap: 0.22rem;
  color: #315273;
  font-size: 0.76rem;
  font-weight: 700;
}

.assistant-action-shared-target select {
  width: 100%;
  font-size: 0.84rem;
}

.assistant-action-shared-target small {
  color: #64748b;
  font-size: 0.7rem;
}

.assistant-action-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fff;
}

.assistant-action-card--event-child {
  position: relative;
  margin-left: 1rem;
  border-left-width: 3px;
}

.assistant-action-card--event-child::before {
  content: '';
  position: absolute;
  top: -1.05rem;
  bottom: calc(100% - 1.2rem);
  left: -1.05rem;
  width: 0.85rem;
  border-bottom: 2px solid #bfd2e6;
  border-left: 2px solid #bfd2e6;
  border-bottom-left-radius: 7px;
  pointer-events: none;
}

.assistant-action-card.valid {
  border-color: #86b99a;
}

.assistant-action-card.undone {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.assistant-action-type-control,
.assistant-action-title {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.assistant-action-type-control > .lucide-icon,
.assistant-action-title > .lucide-icon {
  flex: 0 0 auto;
  color: #315273;
}

.assistant-action-type-select {
  max-width: min(22rem, 70vw);
  padding: 0.08rem 1.7rem 0.08rem 0;
  border: 0;
  background-color: transparent;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.assistant-action-type-select:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.assistant-action-fields {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 0.7fr);
  gap: 0.5rem;
}

.assistant-action-fields label {
  display: grid;
  gap: 0.2rem;
  color: #475569;
  font-size: 0.72rem;
}

.assistant-action-content-field {
  grid-column: 1 / -1;
}

.assistant-action-task-schedule {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(9rem, 1fr) minmax(7rem, 0.7fr);
  gap: 0.5rem;
}

.assistant-action-tags-field {
  grid-column: 1 / -1;
}

.assistant-action-tags-field small {
  color: #64748b;
  font-size: 0.68rem;
}

.assistant-action-target-context {
  align-self: end;
  margin: 0 0 0.35rem;
  color: #64748b;
  font-size: 0.72rem;
}

.assistant-action-parent-context {
  grid-column: 1 / -1;
  align-self: auto;
  margin: 0;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  background: #eef6ff;
  color: #315273;
}

.assistant-action-fields input,
.assistant-action-fields select,
.assistant-action-fields textarea {
  width: 100%;
  font-size: 0.82rem;
}

.assistant-action-fields label.assistant-action-field-error > span {
  color: #b91c1c;
  font-weight: 700;
}

.assistant-action-fields label.assistant-action-field-error > input,
.assistant-action-fields label.assistant-action-field-error > select,
.assistant-action-fields label.assistant-action-field-error > textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.16);
}

.assistant-action-fields textarea {
  overflow: hidden;
  resize: none;
}

.assistant-action-errors,
.assistant-action-valid,
.assistant-action-undone {
  margin: 0;
  font-size: 0.76rem;
}

.assistant-action-clarifications {
  padding: 0.55rem 0.65rem;
  border: 1px solid #f0b35c;
  border-radius: 7px;
  background: #fff8ed;
  color: #92400e;
  font-size: 0.76rem;
}

.assistant-action-clarifications strong {
  display: block;
  margin-bottom: 0.2rem;
}

.assistant-action-clarifications ul {
  margin: 0;
  padding-left: 1.15rem;
}

.assistant-action-clarification-status {
  margin: 0;
  color: #92400e;
  font-size: 0.76rem;
}

.assistant-action-errors {
  padding-left: 1.25rem;
  color: #b45309;
}

.assistant-action-valid {
  color: #166534;
}

.assistant-action-undone {
  color: #64748b;
}

.assistant-action-card-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.assistant-action-card-actions .comment-draft-status {
  margin-right: auto;
}

.assistant-action-policy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fff7ed;
  color: #92400e;
  font-size: 0.76rem;
}

.assistant-action-policy.allowed {
  border-color: #86b99a;
  background: #f0fdf4;
  color: #166534;
}

.assistant-action-policy > div,
.assistant-action-policy.allowed {
  gap: 0.2rem;
}

.assistant-action-policy > div {
  display: grid;
}

.assistant-action-policy ul {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
}

@media (max-width: 620px) {
  .assistant-action-shared-target {
    grid-template-columns: 1fr;
  }

  .assistant-action-fields {
    grid-template-columns: 1fr;
  }

  .assistant-action-content-field {
    grid-column: auto;
  }

  .assistant-action-task-schedule {
    grid-template-columns: 1fr;
  }
}

.assistant-answer .rich-text,
.assistant-answer .rich-text p,
.assistant-answer .rich-text li,
.assistant-answer .rich-text a {
  text-align: left;
}

.assistant-answer .rich-text {
  font-size: 0.83rem;
}

.assistant-answer .rich-text a {
  display: inline;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.assistant-answer .rich-text ul,
.assistant-answer .rich-text ol {
  padding-left: 1.35rem;
  margin-left: 0;
  list-style-position: outside;
}

.assistant-answer .rich-text li {
  padding-left: 0.15rem;
}

.assistant-answer-cost {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e7f6ec;
  color: #0f5132;
  font-size: 0.75rem;
  font-weight: 700;
}

.assistant-inline-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #075985;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.assistant-inline-link:hover {
  color: #0f3d5a;
}

.documentation-dialog-article {
  width: 100%;
}

.documentation-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.documentation-dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.documentation-dialog-head small {
  color: #64748b;
  font-size: 0.78rem;
}

.documentation-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
}

.documentation-toolbar label {
  margin: 0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.documentation-toolbar select {
  width: min(360px, 100%);
}

.documentation-content {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 0.85rem 1rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  line-height: 1.42;
}

.documentation-content h1,
.documentation-content h2,
.documentation-content h3 {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0.82rem 0 0.38rem;
  line-height: 1.2;
  color: #0f172a;
}

.documentation-content h1:first-child,
.documentation-content h2:first-child,
.documentation-content h3:first-child {
  margin-top: 0;
}

.documentation-content h1 {
  font-size: 1.28rem;
}

.documentation-content h2 {
  padding-top: 0.28rem;
  border-top: 1px solid #e5edf6;
  font-size: 1.02rem;
}

.documentation-content h3 {
  font-size: 0.92rem;
}

.documentation-content p {
  margin: 0.34rem 0;
}

.documentation-content ul,
.documentation-content ol {
  margin: 0.34rem 0 0.46rem 1.25rem;
  padding: 0;
}

.documentation-content li {
  margin: 0.14rem 0;
}

.documentation-content blockquote {
  margin: 0.5rem 0;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid #cbd5e1;
  color: #475569;
  background: #f8fafc;
}

.documentation-content pre {
  overflow: auto;
  padding: 0.55rem;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.documentation-content .rich-textarea-blank-line {
  display: none;
}

.documentation-heading-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #315c83;
}

.documentation-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.documentation-content p code,
.documentation-content li code {
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
  background: #eef2f7;
  color: #0f172a;
}

.assistant-trace {
  display: grid;
}

.assistant-trace-details {
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.assistant-trace-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  font-weight: 700;
  color: #1f2937;
}

.assistant-trace-copy {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: #e8eef6;
  color: #122033;
  cursor: pointer;
}

.assistant-trace-copy:hover {
  background: #dbe5f0;
}

.assistant-trace-details pre {
  margin: 0;
  padding: 0.55rem;
  border-top: 1px solid #d8e2ef;
  background: #f8fafc;
  color: #111827;
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-sources {
  display: grid;
  gap: 0.45rem;
}

.assistant-sources h3 {
  margin: 0;
  font-size: 0.9rem;
}

.assistant-source-list {
  display: grid;
  gap: 0.35rem;
}

.assistant-source-group {
  display: grid;
  gap: 0.28rem;
}

.assistant-source {
  display: grid;
  gap: 0.16rem;
  width: 100%;
  padding: 0.48rem 0.55rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

.assistant-source:hover {
  border-color: #9db7d4;
  background: #f6fbff;
}

.assistant-source.passive {
  cursor: default;
}

.assistant-source.passive:hover {
  border-color: #d8e2ef;
  background: #fff;
}

.assistant-source span {
  color: #64748b;
  font-size: 0.76rem;
}

.assistant-source-elements {
  display: grid;
  gap: 0.22rem;
  padding-left: 0.7rem;
}

.assistant-source-element {
  padding: 0.35rem 0.48rem;
  background: #f8fafc;
}

.assistant-source-element strong {
  font-size: 0.82rem;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  z-index: 10000;
  max-width: min(92vw, 420px);
  transform: translate(-50%, 0.45rem);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  padding: 0.58rem 0.78rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: opacity 140ms ease, transform 140ms ease;
}

.app-toast-message {
  min-width: 0;
}

.app-toast-action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.app-toast-action:hover,
.app-toast-action:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.app-toast.success {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.18);
}

.app-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

#visual-scale-dialog {
  width: min(520px, 92vw);
}

.visual-scale-dialog-article {
  display: grid;
  gap: 0.6rem;
}

.visual-scale-meta {
  color: #64748b;
  font-size: 0.78rem;
}

.confirm-dialog-article {
  display: grid;
  gap: 0.7rem;
}

#confirm-dialog-message {
  margin: 0;
  color: #1f2937;
  line-height: 1.4;
}

.confirm-dialog-actions {
  justify-content: flex-end;
}

.confirm-dialog-actions.with-archive {
  justify-content: flex-start;
}

.confirm-dialog-actions.with-archive #confirm-dialog-cancel-btn {
  margin-left: auto;
}

#comment-editor-dialog,
#floating-event-note-editor-dialog {
  width: min(1080px, 96vw);
  background: #ffffff;
}

.comment-editor-dialog-article {
  display: grid;
  gap: 0.6rem;
  max-height: min(90vh, 980px);
  overflow: auto;
  /* Quelques pixels entre les blocs et l'ascenseur (sinon il les colle). */
  padding-right: 0.5rem;
}

/* Un seul ascenseur dans l'éditeur de note : la zone de texte grandit avec son
   contenu (plus de scroll interne) ; seule la modale scrolle. La barre d'outils
   reste accessible en restant collée en haut de la zone scrollable (sticky). */
#comment-editor-dialog .rich-textarea-editor {
  max-height: none;
  overflow-y: visible;
}
#comment-editor-dialog .textarea-format-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
}

.comment-editor-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment-editor-dialog-head h2 {
  margin: 0;
}

.comment-editor-dialog-head-main {
  display: grid;
  gap: 0.12rem;
}

.comment-editor-dialog-subtitle {
  color: #64748b;
  font-size: 0.76rem;
}

.comment-editor-body-field {
  display: block;
}

.comment-editor-dialog-article.files-only-mode .comment-editor-body-field {
  display: none;
}

.comment-editor-dialog-article.files-only-mode #comment-editor-save-btn {
  display: none;
}

.comment-editor-dialog-article.resource-edit-mode .check-linked-comment-files-label,
.comment-editor-dialog-article.resource-edit-mode .detail-item-note-files-head,
.comment-editor-dialog-article.resource-edit-mode #comment-editor-files-add-form {
  display: none;
}

.comment-editor-dialog-article.resource-edit-mode #comment-editor-files-list .card-file-item-row {
  display: none;
}

.comment-editor-dialog-article.resource-edit-mode #comment-editor-files-list .card-file-panel {
  border-top: 0;
  padding-top: 0;
}

#comment-editor-body,
#floating-event-note-editor-body {
  min-height: 260px;
  resize: vertical;
  background: #ffffff;
}

#comment-editor-dialog .rich-textarea-editor,
#floating-event-note-editor-dialog .rich-textarea-editor {
  background: #ffffff;
}

.comment-editor-files-section {
  display: grid;
  gap: 0.38rem;
}

#comment-editor-files-add-form,
#floating-event-note-editor-files-add-form {
  display: grid;
  gap: 0.34rem;
  margin: 0;
}

#comment-editor-files-add-form.hidden,
#floating-event-note-editor-files-add-form.hidden {
  display: none;
}

#comment-editor-file-comment,
#floating-event-note-editor-file-comment {
  min-height: 74px;
  resize: vertical;
}


#comment-editor-files-list .card-file-item-row,
#floating-event-note-editor-files-list .card-file-item-row {
  cursor: pointer;
}

#comment-editor-files-list .card-file-panel,
#floating-event-note-editor-files-list .card-file-panel {
  grid-template-columns: minmax(0, 1fr);
}

#comment-editor-files-list .card-file-panel-main,
#floating-event-note-editor-files-list .card-file-panel-main {
  grid-column: 1 / -1;
}

.ced-file-edit-toggle-btn {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  margin-top: 0.35rem;
  align-self: flex-start;
}

.ced-file-edit-form {
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px dashed var(--line);
  margin-top: 0.4rem;
  grid-column: 1 / -1;
}

.ced-file-edit-form input,
.ced-file-edit-form textarea {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.ced-file-edit-form textarea {
  resize: vertical;
  min-height: 52px;
}

.ced-file-edit-actions {
  display: flex;
  gap: 0.4rem;
}

.ced-file-edit-actions.card-file-actions-row {
  margin-top: 0.25rem;
}

.comment-editor-dialog-article.resource-edit-mode .ced-file-edit-form {
  border-top: 0;
}

.ced-file-edit-status {
  font-size: 0.72rem;
  color: #64748b;
}

.comment-editor-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.comment-editor-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.comment-editor-footer-left {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.comment-editor-tags-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.3rem;
}

.comment-editor-tags-list.hidden {
  display: none;
}

.comment-editor-dialog-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

/* Pied de l'éditeur de note : on ne garde que « Enregistrer ». La note
   s'enregistre en continu (auto-save ~0,7 s) et à la fermeture (clic hors-modale,
   Échap). Le bouton « Fermer » et la croix × sont retirés (homogène avec les
   autres modales). Le bouton reste dans le DOM mais masqué (handler conservé,
   inoffensif). */
#comment-editor-close-btn {
  display: none;
}

/* Bloc-notes rapide : bouton « icône Save + Enregistrer » (seul bouton du pied). */
.board-quick-note-dialog-actions > .inline-add-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.board-quick-note-dialog-actions > .inline-add-save-btn .lucide-icon {
  width: 1rem;
  height: 1rem;
}

#comment-editor-delete-btn {
  width: 1.95rem;
  min-width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#comment-editor-delete-btn .lucide-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.floating-item-dialog-article {
  display: grid;
  gap: 0.55rem;
  max-height: min(90vh, 980px);
  overflow: auto;
}

.floating-item-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.floating-item-dialog-head h2 {
  margin: 0;
}

.floating-item-form-section {
  display: grid;
  gap: 0.5rem;
}

.floating-event-tags-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
}

.floating-event-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

.floating-event-notes-section {
  border-top: 1px dashed #c7d2d6;
  padding-top: 0.5rem;
  display: grid;
  gap: 0.4rem;
}

.floating-event-notes-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.floating-event-notes-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #446069;
}

.floating-event-notes-list {
  display: grid;
  gap: 0.35rem;
}

.floating-event-note {
  background: rgba(240, 246, 248, 0.8);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  display: grid;
  gap: 0.2rem;
}

.floating-event-note-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #6a8a96;
}

.floating-event-note-meta strong {
  color: #2d4a52;
}

.floating-event-note-meta .floating-event-note-edit-btn {
  margin-left: auto;
}

.floating-event-note-meta .floating-event-note-edit-btn,
.floating-event-note-meta .floating-event-note-delete-btn {
  opacity: 0.5;
}

.floating-event-note:hover .floating-event-note-edit-btn,
.floating-event-note:hover .floating-event-note-delete-btn {
  opacity: 1;
}

.floating-event-note-body {
  font-size: 0.82rem;
  word-break: break-word;
}

.floating-event-note-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.floating-event-note-file-link {
  text-decoration: none;
}

.floating-event-note-add {
  display: grid;
  gap: 0.3rem;
}

.floating-item-created-at {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: left;
  margin-top: 0.15rem;
}

.floating-item-dialog-actions {
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
}

.floating-item-dialog-actions-left,
.floating-item-dialog-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.floating-item-dialog-actions-left:empty {
  display: none;
}

#floating-item-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

#floating-item-archive-btn,
#floating-item-delete-btn {
  width: 1.95rem;
  min-width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border: 1px solid #d8e0ec;
  background: #ffffff;
  color: #43516a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#floating-item-archive-btn.is-archived {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #dc2626;
}

#floating-item-delete-btn.floating-item-delete-icon-btn {
  width: 1.95rem;
  min-width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#floating-item-delete-btn.floating-item-delete-icon-btn .lucide-icon {
  width: 0.9rem;
  height: 0.9rem;
}

#tasks-dialog,
#pings-dialog {
  overflow: visible;
}

#tasks-dialog > article,
#pings-dialog > article {
  overflow: visible;
}

#pings-dialog > article {
  width: 100%;
  min-width: 0;
}

#tasks-dialog .tasks-dialog-head,
#pings-dialog .tasks-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  position: relative;
}

#tasks-dialog .tasks-dialog-head h2,
#pings-dialog .tasks-dialog-head h2 {
  margin: 0;
}

.pings-curation {
  display: grid;
  gap: 18px;
  max-height: min(68vh, 680px);
  overflow-y: auto;
  padding-right: 3px;
}

#pings-dialog .tasks-list {
  max-height: none;
  margin-top: 0;
  overflow: visible;
}

.pings-curation-section {
  display: grid;
  gap: 9px;
}

.pings-curation-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pings-curation-section-head h3 {
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
}

.pings-curation-count {
  min-width: 1.55rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 750;
  text-align: center;
}

.pings-curation-empty {
  padding: 28px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: var(--muted, #64748b);
  text-align: center;
}

#tasks-dialog .tasks-dialog-toolbar {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
  padding: 0.75rem;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#tasks-dialog .tasks-dialog-toolbar select {
  width: 100%;
}

.tasks-date-filter-block {
  width: 100%;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.5rem;
  margin-top: 0.15rem;
}

.tasks-date-filter-block strong {
  display: block;
  font-size: 0.72rem;
  color: #475569;
  margin-bottom: 0.3rem;
}

.tasks-date-filter-block .calendar-date-presets {
  margin-top: 0.35rem;
}

.tasks-toolbar-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.22rem 0.5rem;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  flex: 0 0 auto;
}

.tasks-toolbar-checkbox span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tasks-toolbar-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  margin-left: 0.08rem;
}

.tasks-toolbar-ghost-icon {
  flex: 0 0 auto;
  color: #64748b;
}

.tasks-filters-validate-btn {
  width: 100%;
  min-height: 2.15rem;
  border: 1px solid #1d7880;
  border-radius: 8px;
  background: #1d7880;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.tasks-filters-validate-btn:hover,
.tasks-filters-validate-btn:focus-visible {
  background: #17656b;
  border-color: #17656b;
}

#tasks-member-filter-select {
  min-height: 106px;
}

.entity-ping-btn,
.ping-item-seen-btn,
.ping-target-member-btn,
.ping-target-self-toggle {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

/* Appui long mobile : pas de menu natif iOS ni de sélection de texte parasite. */
.entity-ping-btn {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Items du canvas : pas de sélection native au double-tap (sinon le double-tap pour
   accrocher sélectionne le texte de la carte, ou affiche le rectangle gris du bloc
   englobant d'un connecteur en diagonale). */
.sticky,
.card-pin,
.board-thread,
.floating-item {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Item « accroché » via double-tap-maintenu sur mobile : retour visuel pendant le déplacement. */
.canvas-grabbed {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  z-index: 30 !important;
}

/* Raccourcis vers un autre tableau, posés sur le canvas (lien + cible de drop). */
.board-shortcut-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 140px;
  height: 140px; /* parfaitement carré, bien repérable */
  padding: 0.7rem;
  box-sizing: border-box;
  border: 2px dashed var(--shortcut-color, #6366f1);
  border-radius: 16px;
  background: #ffffff;
  color: #312e81;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(49, 46, 129, 0.18);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  z-index: 6;
}

.board-shortcut-card:hover {
  background: #eef2ff;
}

.board-shortcut-card.selected {
  outline: 2px solid #1d7880;
  outline-offset: 3px;
}

.board-shortcut-card.is-locked {
  opacity: 0.7;
}

.board-shortcut-card.drop-target {
  border-style: solid;
  background: #e0e7ff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.5);
}

.board-shortcut-icon {
  display: inline-flex;
  color: #64748b;
}

.board-shortcut-icon .lucide-icon {
  width: 28px;
  height: 28px;
}

.board-shortcut-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.board-shortcut-lock {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 0.9rem;
}

/* Pastille couleur du tableau dans le filtre par tableau (Frise / Calendrier). */
.board-filter-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Contenu déplacé depuis un autre tableau, en attente de placement. */
.needs-placement {
  outline: 2px dashed #f59e0b;
  outline-offset: 2px;
  animation: needs-placement-pulse 1.8s ease-in-out infinite;
}

@keyframes needs-placement-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.35); }
}

.entity-ping-btn.ping-unseen,
#my-pings-btn.ping-unseen,
.mobile-menu-action[data-click-target="my-pings-btn"].ping-unseen,
.ping-target-member-btn.active,
.ping-target-self-toggle.active {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

.entity-ping-btn.ping-active {
  border-color: #22c55e;
  background: #dcfce7;
  color: #15803d;
}

.entity-ping-btn.ping-active.ping-unseen {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

/* Pastille compteur de pings non visités sur l'icône globale. */
#my-pings-btn {
  position: relative;
  overflow: visible;
}

.ping-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px #fff;
}

.ping-count-badge.hidden {
  display: none;
}

/* Mot joint au ping — liste « Mes pings ». */
.ping-item-message {
  border-left: 3px solid #fca5a5;
  padding: 0.2rem 0.5rem;
  background: #fef2f2;
  border-radius: 0 6px 6px 0;
  color: #7f1d1d;
  font-size: 0.82rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Champ « Mot (optionnel) » dans la modale Ping. */
.ping-target-message-field {
  display: grid;
  gap: 0.2rem;
  margin: 0.1rem 0 0.15rem;
}

.ping-target-message-field > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.ping-target-message-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 2.4rem;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 8px;
}

.ping-item {
  display: grid;
  gap: 0.35rem;
}

.ping-item .task-item-head-actions {
  align-items: center;
}

.ping-item-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

#ping-target-dialog {
  width: min(560px, 94vw);
}

.ping-target-dialog-article {
  display: grid;
  gap: 0.75rem;
}

.ping-target-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ping-target-dialog-head h2 {
  margin: 0;
}

.ping-target-summary {
  display: grid;
  gap: 0.2rem;
  color: #334155;
}

.ping-target-share-block {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.ping-target-history-block {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.ping-target-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ping-target-member-btn,
.ping-target-self-toggle {
  min-height: 2rem;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  display: inline-grid;
  gap: 0.12rem;
  justify-items: start;
  text-align: left;
}

.ping-target-member-btn small,
.ping-target-self-toggle small {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
  color: currentColor;
  opacity: 0.8;
}

.ping-target-history {
  display: grid;
  gap: 0.35rem;
  max-height: 13rem;
  overflow: auto;
}

.ping-target-history-item {
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 0.38rem 0.5rem;
  display: grid;
  gap: 0.12rem;
  color: #334155;
  background: #ffffff;
}

.ping-target-history-item.active {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}

.ping-target-history-item small {
  color: currentColor;
  font-size: 0.7rem;
  opacity: 0.82;
}

.ping-target-history-message {
  font-style: italic;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.modal-filters-toggle {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #334155;
}

.modal-filters-toggle.active,
.modal-filters-toggle[aria-pressed="true"] {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

#search-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#board-create-dialog article,
#board-settings-dialog article,
#board-switch-dialog article,
#board-tags-admin-dialog article,
#board-trash-dialog article,
#board-activity-dialog article,
#documentation-dialog article,
#profile-dialog article,
#admin-users-dialog article,
#admin-assistant-search-dialog article,
#members-dialog article {
  display: grid;
  gap: 0.55rem;
}

#board-quick-note-dialog {
  width: min(760px, 94vw);
  background: #fffdf5;
}

.board-quick-note-dialog-article {
  display: grid;
  gap: 0.65rem;
}

.board-quick-note-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.board-quick-note-dialog-head h2 {
  margin: 0;
}

.board-quick-note-body-field {
  display: block;
}

#board-quick-note-body {
  min-height: min(58vh, 520px);
  resize: vertical;
  background:
    repeating-linear-gradient(
      to bottom,
      #fffdf5 0,
      #fffdf5 31px,
      rgba(148, 163, 184, 0.24) 32px
    );
  line-height: 32px;
  border-color: #eadfca;
}

.board-quick-note-body-field .rich-textarea-editor {
  min-height: min(58vh, 520px);
  max-height: 62vh;
  overflow-y: auto;
  background:
    repeating-linear-gradient(
      to bottom,
      #fffdf5 0,
      #fffdf5 31px,
      rgba(148, 163, 184, 0.24) 32px
    );
  border-color: #eadfca;
}

.board-quick-note-dialog-actions {
  justify-content: flex-end;
}

.voice-journal-feature-disabled #voice-journal-btn,
.voice-journal-feature-disabled [data-click-target="voice-journal-btn"] {
  opacity: 0.52;
}

#voice-journal-dialog {
  width: min(760px, 94vw);
  background: #f8fbff;
}

.voice-journal-dialog-article {
  display: grid;
  gap: 0.7rem;
}

.voice-journal-recorder {
  display: grid;
  grid-template-columns: auto auto minmax(11rem, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.voice-journal-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  border: 1px solid #b8c7d9;
  border-radius: 8px;
  background: #eef6fb;
  color: #1f3f56;
  font-weight: 700;
  cursor: pointer;
}

.voice-journal-record-btn.recording {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.voice-journal-timer {
  min-width: 3.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #334155;
}

.voice-journal-target {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.voice-journal-target-select {
  width: 100%;
  min-height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 0.82rem;
}

.voice-journal-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}

.voice-journal-fields label {
  display: grid;
  gap: 0.3rem;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

.voice-journal-fields textarea {
  resize: vertical;
  border-color: #d8e2ef;
  background: #fff;
  line-height: 1.45;
}

.voice-journal-actions {
  align-items: center;
}

.voice-journal-history {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.2rem;
  border-top: 1px solid #d8e2ef;
}

.voice-journal-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.voice-journal-history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f3f56;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.voice-journal-history-list {
  display: grid;
  gap: 0.35rem;
  max-height: min(52vh, 440px);
  overflow-y: auto;
}

.voice-journal-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.4rem 0.55rem;
  width: 100%;
  padding: 0.48rem 0.55rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
}

.voice-journal-history-item-main {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.voice-journal-history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.voice-journal-history-menu {
  position: relative;
  flex: 0 0 auto;
}

.voice-journal-history-menu-toggle {
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #64748b;
}

.voice-journal-history-menu-toggle:hover,
.voice-journal-history-menu-toggle:focus-visible,
.voice-journal-history-menu-toggle[aria-expanded="true"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #1f3f56;
}

.voice-journal-history-menu-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.2rem);
  right: 0;
  display: grid;
  gap: 0.32rem;
  width: min(19rem, calc(100vw - 3rem));
  padding: 0.42rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.16);
}

.voice-journal-history-card-assign {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.voice-journal-card-select {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 0.78rem;
}

.voice-journal-history-assign,
.voice-journal-history-process,
.voice-journal-history-edit,
.voice-journal-history-delete {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  min-height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #eef6fb;
  color: #1f3f56;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.voice-journal-history-menu-panel > button {
  width: 100%;
}

.voice-journal-history-process {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.voice-journal-history-process:hover,
.voice-journal-history-process:focus-visible {
  background: #bbf7d0;
}

.voice-journal-history-delete {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
}

.voice-journal-history-menu-cost {
  padding: 0.36rem 0.5rem 0.08rem;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.voice-journal-history-assign:disabled,
.voice-journal-card-select:disabled,
.voice-journal-target-select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.voice-journal-history-item-meta {
  min-width: 0;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.voice-journal-history-more {
  display: flex;
  justify-content: center;
  padding: 0.2rem 0 0.05rem;
}

.voice-journal-history-more button {
  min-height: 2rem;
  font-size: 0.78rem;
}

.voice-journal-history-item-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.35;
}

.voice-journal-history-item-preview span {
  display: block;
}

.voice-journal-history-editor {
  display: grid;
  gap: 0.4rem;
}

.voice-journal-history-editor textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  line-height: 1.4;
}

.voice-journal-history-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.voice-journal-history-empty {
  padding: 0.55rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #fff;
}

@media (max-width: 720px) {
  .voice-journal-recorder {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .voice-journal-record-btn {
    justify-content: center;
  }

  .voice-journal-target,
  #voice-journal-status {
    grid-column: 1 / -1;
  }
}

.comment-draft-status.error {
  color: #b91c1c;
}

.board-settings-pastel-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0;
  padding: 0.5rem 0.55rem 0.6rem;
}

.board-settings-pastel-fieldset legend {
  padding: 0 0.18rem;
  color: #334155;
  font-size: 0.84rem;
}

.board-settings-pastel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.board-settings-background-section {
  display: grid;
  gap: 0.42rem;
}

.board-settings-taxonomy-section,
.board-settings-priority-colors-section,
.board-settings-metrics-section,
.board-settings-other-section,
.board-settings-assistant-section,
.board-settings-export-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.55rem 0.6rem;
  display: grid;
  gap: 0.45rem;
  background: #f8fafc;
}

.board-settings-taxonomy-head,
.board-settings-priority-colors-head,
.board-settings-metrics-head,
.board-settings-other-head,
.board-settings-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.board-settings-metrics-section {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.board-settings-metrics-head small {
  color: #64748b;
  font-size: 0.75rem;
}

.board-settings-metrics-head small.error {
  color: #b91c1c;
}

.board-settings-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.board-settings-metric {
  min-width: 0;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  padding: 0.42rem 0.48rem;
  background: #ffffff;
  display: grid;
  align-content: start;
  gap: 0.08rem;
}

.board-settings-metric > span {
  color: #64748b;
  font-size: 0.69rem;
  line-height: 1.2;
}

.board-settings-metric > strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

.board-settings-metric > small,
.board-settings-metrics-upload-detail {
  color: #64748b;
  font-size: 0.66rem;
  line-height: 1.25;
}

.board-settings-metrics-upload-detail {
  display: block;
}

.board-settings-assistant-section {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.board-settings-assistant-actions {
  margin: 0;
  padding: 0.5rem 0.6rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.board-settings-assistant-actions legend {
  padding: 0 0.2rem;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

.board-settings-assistant-actions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.8rem;
}

.board-settings-assistant-limits {
  align-items: end;
}

.board-settings-assistant-save-row {
  align-items: center;
  justify-content: flex-end;
}

.board-settings-assistant-save-row .comment-draft-status {
  margin-right: auto;
}

#board-settings-assistant-global-status.error {
  color: #9a3412;
  font-style: normal;
}

@media (max-width: 620px) {
  .board-settings-assistant-actions-list {
    grid-template-columns: 1fr;
  }
}

.board-settings-taxonomy-head strong,
.board-settings-priority-colors-head strong,
.board-settings-metrics-head strong,
.board-settings-other-head h2,
.board-settings-export-head strong {
  margin: 0;
  font-size: 0.84rem;
  color: #334155;
}

@media (max-width: 560px) {
  .board-settings-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.board-settings-taxonomy-hint {
  font-size: 0.76rem;
  color: #475569;
  font-style: italic;
  margin: 0;
  line-height: 1.35;
}

.board-settings-priority-colors-section input[type="color"] {
  min-height: 2.1rem;
  padding: 0.2rem;
  border-radius: 8px;
}

.board-settings-background-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.board-settings-background-preview {
  width: 100%;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-settings-background-preview.empty {
  color: #64748b;
  font-size: 0.84rem;
  text-align: center;
  padding: 0.6rem;
}

.board-settings-background-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.board-settings-background-actions {
  justify-content: flex-start;
}

.board-settings-export-actions {
  justify-content: flex-start;
}

.board-settings-color-swatch {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--swatch-color, #f8fafc);
  padding: 0;
  cursor: pointer;
}

.board-settings-color-swatch:hover,
.board-settings-color-swatch:focus-visible {
  border-color: #64748b;
}

.board-settings-color-swatch.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18);
}

#board-settings-dialog .card-actions button {
  border: none;
  background: #cbd5e1;
  color: #0f172a;
}

#board-settings-dialog .card-actions button.ghost {
  background: #d5dbe4;
}

#board-settings-dialog .card-actions button:hover,
#board-settings-dialog .card-actions button:focus-visible {
  background: #b9c4d3;
}

.board-switch-list-wrap {
  position: relative;
}

/* Dégradés en haut/bas quand il reste des tableaux hors de la zone visible. */
.board-switch-list-wrap::before,
.board-switch-list-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1.7rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.board-switch-list-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, #f8f5ef, rgba(248, 245, 239, 0));
}

.board-switch-list-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, #f8f5ef, rgba(248, 245, 239, 0));
}

.board-switch-list-wrap.has-more-top::before,
.board-switch-list-wrap.has-more-bottom::after {
  opacity: 1;
}

.board-switch-list {
  display: grid;
  gap: 0.42rem;
  max-height: min(60vh, 420px);
  overflow: auto;
}

.board-switch-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  padding: 0.52rem 0.66rem;
  text-align: left;
}

.board-switch-item:hover,
.board-switch-item:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
}

.board-switch-item.active {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e3a8a;
}

.board-switch-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-switch-item-badge {
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 0.08rem 0.42rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

/* Arborescence des tableaux : parent + sous-tableaux repliables. */
.board-switch-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.board-switch-row .board-switch-item {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.board-switch-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transform: rotate(-90deg);
  transition: transform 0.15s, background 0.12s;
}

.board-switch-toggle:hover {
  background: #e2e8f0;
}

.board-switch-toggle.is-expanded {
  transform: rotate(0deg);
}

.board-switch-toggle-spacer {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
}

.board-switch-children {
  display: grid;
  gap: 0.42rem;
  margin-left: 1.4rem;
}

.board-switch-relations {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.4rem;
}

.board-switch-relations-title {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
}

.board-switch-relations-list {
  display: grid;
  gap: 0.45rem;
}

.board-switch-relation-group {
  display: grid;
  gap: 0.2rem;
}

.board-switch-relation-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}

.board-switch-relation-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.board-switch-relation-nav {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.34rem 0.55rem;
  cursor: pointer;
}

.board-switch-relation-nav:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.board-switch-relation-nav.is-locked,
.board-switch-relation-nav:disabled {
  cursor: default;
  color: #94a3b8;
  background: #f8fafc;
}

.board-switch-relation-lock {
  font-size: 0.7rem;
  white-space: nowrap;
}

.board-switch-relations-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.board-switch-relations-manage select {
  flex: 1 1 auto;
  min-width: 0;
}

.board-switch-dialog-actions {
  justify-content: flex-end;
}

.board-trash-dialog-article {
  width: min(760px, 94vw);
}

#board-activity-dialog {
  width: min(560px, 94vw);
}

.board-activity-dialog-article {
  width: 100%;
}

.board-activity-dialog-article #board-activity-status:empty {
  display: none;
}

.board-trash-list {
  display: grid;
  gap: 0.5rem;
  max-height: 64vh;
  overflow: auto;
}

.board-activity-list {
  display: grid;
  gap: 0.45rem;
  max-height: 64vh;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.board-trash-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.5rem 0.58rem;
  display: grid;
  gap: 0.3rem;
}

.board-activity-item {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.5rem 0.58rem;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.board-activity-item:hover,
.board-activity-item:focus-visible {
  border-color: #91a7ad;
  background: #f8fbfb;
}

.board-activity-item:disabled {
  cursor: default;
}

.board-activity-item-disabled {
  opacity: 0.72;
}

.board-activity-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  color: #1b2d35;
  background: #eef4f5;
}

.board-activity-item-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.board-activity-item-main strong {
  color: #0f172a;
  font-size: 0.9rem;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.board-activity-item-main span,
.board-activity-item-meta {
  color: #64748b;
  font-size: 0.78rem;
}

.board-activity-item-meta {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  white-space: normal;
}

.board-activity-item-unavailable {
  color: #9f1239;
  font-weight: 600;
}

.board-trash-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.board-trash-item-type {
  font-size: 0.78rem;
  color: #475569;
}

.board-trash-item-title {
  font-weight: 600;
  color: #0f172a;
}

.board-trash-item-subtitle {
  font-size: 0.8rem;
  color: #64748b;
}

.board-trash-item-meta {
  font-size: 0.76rem;
  color: #64748b;
}

.board-trash-item-actions {
  justify-content: flex-end;
}

.board-trash-item-restore-blocked {
  color: #b45309;
  font-size: 0.76rem;
}

.item-audit-meta {
  display: block;
  justify-self: start;
  align-self: end;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.inline-add-actions > .item-audit-meta {
  margin-right: auto;
  align-self: center;
}

.members-dialog-article {
  width: min(680px, 92vw);
}

.members-invite-row {
  margin-top: 0.28rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.members-invite-field {
  position: relative;
  min-width: 0;
}

.members-invite-field input {
  width: 100%;
}

.members-invite-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.2rem;
  max-height: 13rem;
  overflow: auto;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.members-invite-suggestion {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.members-invite-suggestion:hover,
.members-invite-suggestion:focus {
  background: #eef4fb;
  outline: none;
}

.members-invite-suggestion strong,
.members-invite-suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.members-invite-suggestion span {
  color: #64748b;
  font-size: 0.78rem;
}

.members-dialog-list {
  display: grid;
  gap: 0.45rem;
  max-height: 56vh;
  overflow: auto;
}

.members-member-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.45rem;
  display: grid;
  gap: 0.36rem;
}

.members-member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.members-member-head strong {
  min-width: 0;
}

.members-member-email {
  color: #64748b;
  font-size: 0.78rem;
}

.members-member-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.members-member-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.members-member-actions button {
  padding: 0.26rem 0.62rem;
  font-size: 0.8rem;
}

.admin-users-list {
  display: grid;
  gap: 0.45rem;
  max-height: 62vh;
  overflow: auto;
}

.admin-user-create-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
  background: #f8fafc;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.admin-assistant-search-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem;
  background: #ffffff;
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.admin-assistant-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.45rem;
}

.admin-assistant-search-grid textarea {
  min-height: 190px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
}

.admin-assistant-search-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-user-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.42rem;
  background: #ffffff;
  display: grid;
  gap: 0.35rem;
}

.admin-user-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-user-head strong {
  min-width: 160px;
}

.admin-user-head small {
  color: #64748b;
  font-size: 0.76rem;
}

.admin-user-badge {
  border: 1px solid #b8c4d2;
  background: #eef2f7;
  color: #334155;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.1rem 0.42rem;
}

.admin-user-badge.admin {
  border-color: #d6a95f;
  background: #ffefcf;
  color: #7b4a00;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-user-actions .admin-user-save-btn {
  white-space: nowrap;
}

#text-block-create-dialog,
#text-block-create-dialog article {
  max-width: 100%;
  overflow-x: hidden;
}

#text-block-create-dialog {
  width: min(640px, 92vw);
  box-sizing: border-box;
}

#text-block-create-dialog article {
  box-sizing: border-box;
  display: grid;
  gap: 0.65rem;
}

.text-block-create-grid {
  grid-template-columns: minmax(96px, 120px) minmax(120px, 1fr) minmax(120px, 1fr);
  align-items: start;
  min-width: 0;
}

.text-block-create-grid label {
  min-width: 0;
}

.text-block-box-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  font-weight: 650;
  color: #1f2937;
}

.text-block-box-toggle input {
  width: auto;
}

.text-block-box-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem;
  margin: 0;
  min-width: 0;
}

.text-block-box-options legend {
  padding: 0 0.25rem;
  color: #475569;
  font-size: 0.8rem;
}

.text-block-box-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.text-block-box-presets label {
  display: block;
  cursor: pointer;
}

.text-block-box-presets input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.text-block-box-presets span {
  display: flex;
  min-height: 2.1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
}

.text-block-box-presets input:checked + span {
  border-color: #1d7880;
  background: #e6f4f5;
  color: #145c63;
}

#text-block-create-dialog textarea {
  min-height: 130px;
  resize: vertical;
}

#text-block-create-font-size {
  max-width: 7rem;
}

#text-block-create-color,
#text-block-create-background-color {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.12rem;
}

.search-input-wrap {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.55rem;
}

.search-option-toggle {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.82rem;
  color: #475569;
}

.search-option-toggle input[type="checkbox"] {
  margin: 0;
  width: 1rem;
  height: 1rem;
}

.search-results {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.45rem;
  max-height: 56vh;
  overflow: auto;
}

.search-results > small {
  color: #475569;
}

.search-result-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem;
  background: #ffffff;
  display: grid;
  gap: 0.22rem;
}

.search-result-item.critical {
  border-color: #df7b7b;
  background: #fff5f5;
}

.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.search-result-open {
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
  font-weight: 700;
  color: #1d5863;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.search-result-meta {
  color: #475569;
}

.search-result-snippet {
  font-size: 0.82rem;
  color: #334155;
}

.search-result-task-open {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result-task-open:hover,
.search-result-task-open:focus-visible {
  color: #1d5863;
  text-decoration: underline;
}

.search-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0.6rem 0 0.25rem;
}

.search-result-item.search-result-floating {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.search-result-open-floating {
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
  font-weight: 700;
  color: #0369a1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.search-result-journal-preview {
  display: grid;
  gap: 0.08rem;
  padding-top: 0.08rem;
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.search-result-journal-preview span {
  display: block;
}

/* ===== Frise temporelle ===== */
.timeline-screen {
  width: 96vw;
  max-width: 96vw;
}

.timeline-screen-panel {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  height: min(88vh, 1000px);
  max-height: 88vh;
  overflow: hidden;
}

.timeline-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.timeline-screen-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.timeline-filters-wrap {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(240px, 1fr);
  gap: 0.55rem;
  align-items: stretch;
}

.timeline-elements-filter {
  display: grid;
  gap: 0.45rem;
}

.timeline-elements-filter-checks {
  gap: 0.35rem;
  margin: 0;
}

.timeline-elements-filter-stack {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: #475569;
}

.timeline-elements-filter-stack select {
  width: 100%;
}

.timeline-tag-filter {
  max-height: 8.5rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.timeline-tag-filter label {
  border-width: 1px;
  border-style: solid;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.timeline-tag-filter label.macro {
  border-style: dashed;
}

.filter-empty {
  color: #64748b;
  font-size: 0.82rem;
}

.timeline-screen-body {
  min-height: 0;
  min-width: 0;
}

.timeline-scroll {
  overflow: auto;
  height: 100%;
  max-width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  position: relative;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: none;
}

.timeline-scroll::-webkit-scrollbar {
  display: none;
}

.timeline-scroll.is-panning {
  cursor: grabbing;
}

.timeline-canvas {
  position: relative;
  min-height: 100%;
  min-width: 100%;
}

.timeline-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem;
}

.timeline-band-label {
  position: absolute;
  left: 8px;
  z-index: 4;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  pointer-events: none;
}

.timeline-frieze {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(241, 245, 249, 0.6);
  pointer-events: none;
  z-index: 0;
}

/* Repères par jour */
.timeline-daycol {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(100, 116, 139, 0.1);
  pointer-events: none;
  z-index: 0;
}

.timeline-daycol.holiday {
  background: rgba(239, 68, 68, 0.12);
}

.timeline-daytick {
  position: absolute;
  width: 1px;
  height: 7px;
  background: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.timeline-weektick {
  position: absolute;
  width: 1px;
  background: rgba(100, 116, 139, 0.5);
  pointer-events: none;
  z-index: 2;
}

/* Trait reliant chaque card à la bande centrale */
.timeline-connector {
  position: absolute;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(71, 85, 105, 0.45);
  pointer-events: none;
  z-index: 2;
}

.timeline-connector.dimmed {
  opacity: 0.12;
}

/* Bande réservée à un jalon et à ses tâches dans la vue groupée. */
.timeline-milestone-group-band {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(100, 116, 139, 0.26);
  border-left: 3px solid var(--group-color, #94a3b8);
  border-radius: 14px;
  background-color: rgba(241, 245, 249, 0.42);
  pointer-events: none;
  transition: opacity 120ms ease, filter 120ms ease;
}

.timeline-milestone-group-band--0 {
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 8px,
    rgba(100, 116, 139, 0.08) 8px,
    rgba(100, 116, 139, 0.08) 10px
  );
}

.timeline-milestone-group-band--1 {
  background-color: rgba(239, 246, 255, 0.44);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 9px,
    rgba(71, 85, 105, 0.075) 9px,
    rgba(71, 85, 105, 0.075) 11px
  );
}

.timeline-milestone-group-band--2 {
  background-color: rgba(248, 250, 252, 0.48);
  background-image: repeating-linear-gradient(
    120deg,
    transparent 0,
    transparent 11px,
    rgba(100, 116, 139, 0.09) 11px,
    rgba(100, 116, 139, 0.09) 12px
  );
}

.timeline-milestone-group-band.dimmed {
  opacity: 0.14;
  filter: grayscale(0.7);
}

.timeline-daynum {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: #94a3b8;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

/* Mois en gros, posés sur la frise */
.timeline-month-sep {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.28);
  pointer-events: none;
  z-index: 2;
}

.timeline-month {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: rgba(30, 41, 59, 0.2);
  text-transform: capitalize;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.timeline-today {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #ef4444;
  pointer-events: none;
  z-index: 2;
}

.timeline-today-label {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 600;
  color: #ef4444;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 0.25rem;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.timeline-dot {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  text-align: left;
  width: 224px;
  min-height: 48px;
  padding: 0.4rem 0.6rem 0.4rem 0.7rem;
  border-radius: 11px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-left: 6px solid var(--level-color, var(--line));
  background: var(--level-color, #ffffff);
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.13);
  transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  overflow: hidden;
  z-index: 3;
}

.timeline-dot-subject {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(15, 23, 42, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.timeline-dot-date {
  text-transform: none;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.85);
}

.timeline-dot-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1f2937;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Les intitulés courants restent en bas-de-casse ; le jalon garde sa casse
   d'origine et un poids plus fort pour servir de repère dans la frise. */
.timeline-dot:not(.timeline-dot--milestone) .timeline-dot-title {
  text-transform: lowercase;
}

.timeline-dot.task:not(.timeline-dot--milestone) {
  padding: 0.28rem 0.48rem 0.3rem 0.58rem;
}

.timeline-dot.task:not(.timeline-dot--milestone) .timeline-dot-subject {
  font-size: 0.54rem;
}

.timeline-dot.task:not(.timeline-dot--milestone) .timeline-dot-title {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.12;
}

.timeline-dot.task:not(.timeline-dot--milestone) .timeline-dot-parent {
  font-size: 0.58rem;
  line-height: 1.15;
}

.timeline-dot.task:not(.timeline-dot--milestone) .timeline-dot-tag,
.timeline-dot.task:not(.timeline-dot--milestone) .timeline-dot-assignees {
  font-size: 0.53rem;
}

.timeline-dot.timeline-dot--milestone .timeline-dot-title {
  text-transform: none;
  font-weight: 850;
}

/* Sous-tâche dans la frise : rappel du jalon parent, en petit. */
.timeline-dot-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: #64748b;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.timeline-dot-parent .lucide-icon {
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
}

.timeline-dot-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  overflow: hidden;
}

.timeline-dot-tag {
  flex: 0 1 auto;
  max-width: 6.8rem;
  min-width: 0;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  padding: 0.03rem 0.3rem;
  font-size: 0.61rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-dot-tag.macro {
  border-style: dashed;
}

.timeline-dot-assignees {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.66rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.68);
}

.timeline-dot.floating {
  border-left-style: dashed;
}

.timeline-dot.task {
  border-left-color: var(--level-color, #475569);
  background: var(--level-color, #f8fafc);
}

.timeline-dot.task .timeline-dot-subject {
  color: rgba(51, 65, 85, 0.72);
}

.timeline-dot.task .timeline-dot-title {
  color: #0f172a;
}

.timeline-dot.task.task-done {
  border-left-color: #16a34a;
  background: #dcfce7;
}

.timeline-dot.task.task-done .timeline-dot-title {
  color: #14532d;
  text-decoration: none;
}

.timeline-dot.task.task-cancelled {
  border-left-color: #dc2626;
  background: #fee2e2;
}

.timeline-dot.task.task-cancelled .timeline-dot-title {
  color: #7f1d1d;
  text-decoration: none;
}

.timeline-dot:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
  z-index: 4;
}

.timeline-dot.selected {
  border-color: #0f172a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.32);
  z-index: 6;
}

.timeline-dot.dimmed {
  opacity: 0.2;
  filter: grayscale(0.7);
}

.timeline-dot.done .timeline-dot-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.timeline-event-dialog {
  width: min(440px, 94vw);
}

.timeline-event-dialog-article {
  position: relative;
  display: grid;
  gap: 0.1rem;
}

.timeline-event-close-btn {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
}

.timeline-detail h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.3;
  padding-right: 1.6rem;
}

.timeline-detail-subject {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.6rem;
}

.timeline-detail-subject .timeline-subject-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--level-color, #cbd5e1);
  border: 1px solid rgba(15, 23, 42, 0.15);
  flex: 0 0 auto;
}

.timeline-detail-row {
  font-size: 0.82rem;
  color: #475569;
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.4rem;
}

.timeline-detail-row .timeline-detail-label {
  color: #94a3b8;
  min-width: 5.5rem;
  flex: 0 0 auto;
}

.timeline-detail-comment {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eef2f7;
  font-size: 0.82rem;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-detail-actions {
  margin-top: 0.8rem;
}

.timeline-detail-isolate {
  margin-top: 0.55rem;
  text-align: right;
}

.timeline-isolate-link {
  background: none;
  border: none;
  padding: 0;
  color: #2563eb;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.timeline-isolate-link:hover {
  background: none;
  color: #1d4ed8;
}

.calendar-screen {
  width: min(1280px, 96vw);
  max-width: 96vw;
}

.calendar-screen-panel {
  width: 100%;
  margin: 0;
  display: grid;
  gap: 0.6rem;
  max-height: min(88vh, 980px);
  overflow: auto;
}

.calendar-screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.calendar-filters-wrap {
  width: 100%;
}

.calendar-filters-wrap .filter-block {
  min-width: 0;
  padding: 0.2rem 0.35rem;
}

.calendar-filters-wrap .filter-block strong {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.calendar-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
}

.calendar-date-range label {
  display: grid;
  gap: 0.12rem;
  font-size: 0.73rem;
  color: #475569;
}

.calendar-date-range input[type="date"] {
  font-size: 0.78rem;
  padding: 0.1rem 0.3rem;
}

.calendar-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.3rem;
}

.calendar-date-preset-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.calendar-date-preset-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e3a5f;
}

.date-filter-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.date-filter-preset-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.date-filter-preset-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e3a5f;
}

.calendar-list {
  display: grid;
  gap: 0.5rem;
  max-height: calc(min(88vh, 980px) - 170px);
  overflow: auto;
}

.calendar-open-link {
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
  font-weight: 700;
  color: #1d5863;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.calendar-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Icône de nature (événement / tâche) à gauche de la date. */
.calendar-item-date-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.calendar-type-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #64748b;
}

.calendar-type-icon.type-event {
  color: #2563eb;
}

.calendar-type-icon.type-task {
  color: #16a34a;
}

.calendar-type-icon.type-milestone {
  color: #7c3aed;
}

.calendar-overdue-summary {
  border: 1px solid #fca5a5;
  border-radius: 9px;
  padding: 0.42rem 0.56rem;
  background: #fee2e2;
  color: #7f1d1d;
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-overdue-see-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
}

.calendar-type-chip {
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  font-size: 0.72rem;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.calendar-type-chip.type-event {
  background: #dbeafe;
  color: #1e3a8a;
}

.calendar-type-chip.type-card_due {
  background: #e2e8f0;
  color: #334155;
}

.calendar-type-chip.type-task_due {
  background: #d1fae5;
  color: #065f46;
}

.calendar-scope-chip {
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  font-size: 0.72rem;
  background: #fef3c7;
  color: #92400e;
  display: inline-flex;
  align-items: center;
}

.calendar-date-pill {
  border-radius: 999px;
  padding: 0.14rem 0.46rem;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.72rem;
  white-space: nowrap;
}

.calendar-state {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
}

.calendar-state.open {
  background: #e2e8f0;
  color: #334155;
}

.calendar-state.done {
  background: #dcfce7;
  color: #166534;
}

.tasks-list {
  margin-top: 0.6rem;
  display: grid;
  /* Plus d'air entre les sections (Tâches / Événements / etc.). */
  gap: 1rem;
  max-height: 58vh;
  overflow: auto;
}

.tasks-section {
  display: grid;
  /* Au moins 10 px entre items de la liste « Mes tâches » (1rem = 16 px). */
  gap: 1rem;
}

.tasks-section-title {
  margin: 0;
  color: #31515a;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem;
  background: white;
  display: grid;
  gap: 0.3rem;
}

.task-item-head {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  justify-content: flex-start;
}

.task-item-head-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.task-open-title,
.task-event-open-title,
.task-floating-open-title {
  padding: 0;
  border: none;
  background: transparent;
  color: #1d5863;
  text-align: left;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.task-date-plain {
  font-size: 1.24rem;
  line-height: 1.2;
  font-weight: 900;
  text-transform: capitalize;
  color: #0b172a;
}

.task-date-plain-main {
  display: inline;
}

.task-date-plain-right-sep {
  color: #94a3b8;
}

.task-date-plain-right {
  color: #475569;
}

.task-date-plain.compact {
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 700;
  color: #334155;
}

.task-item small {
  color: #334155;
}

.task-item-meta {
  display: block;
  font-size: 0.76rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item-context {
  display: grid;
  gap: 0.12rem;
}

.task-item-context-line {
  display: block;
  font-size: 0.76rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item-context-line strong {
  color: #1f3841;
}

.task-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.15rem;
}

.task-board-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.task-assignee-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.task-done-btn {
  border: none;
  background: linear-gradient(180deg, #f6f7f8, #e7ebee);
  color: #4e5a60;
  padding: 0.18rem 0.52rem;
  font-size: 0.74rem;
  border-radius: 8px;
}

.task-item-head .task-done-btn {
  margin-left: auto;
  align-self: flex-start;
}

.task-item-head-actions .task-done-btn {
  margin-left: 0;
}

.task-item .check-done-btn {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  padding: 0;
  border: 1px solid var(--line);
  background: #e5e7eb;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-item .check-done-btn .check-done-icon {
  width: 0.92rem;
  height: 0.92rem;
  stroke-width: 2.2;
}

.task-item .check-done-btn.task-done-btn-done {
  border-color: #86efac;
  background: #22c55e;
  color: #ffffff;
}

.task-item .check-done-btn.task-done-btn-cancelled {
  border-color: #fca5a5;
  background: #ef4444;
  color: #ffffff;
}

.task-postpone-btn {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  padding: 0;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-postpone-btn:hover,
.task-postpone-btn:focus-visible {
  background: #dbeafe;
  color: #1e40af;
}

.task-postpone-menu {
  position: fixed;
  z-index: 10000;
  width: min(220px, calc(100vw - 16px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  padding: 0.38rem;
  display: grid;
  gap: 0.32rem;
}

.task-postpone-menu-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  padding: 0.1rem 0.25rem;
}

.task-postpone-menu-options {
  display: grid;
  gap: 0.18rem;
}

.task-postpone-option {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  padding: 0.36rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}

.task-postpone-option:hover,
.task-postpone-option:focus-visible {
  background: #eff6ff;
}

.task-postpone-option span {
  font-size: 0.8rem;
  font-weight: 800;
}

.task-postpone-option small {
  color: #64748b;
  font-size: 0.7rem;
  white-space: nowrap;
}

.task-item-archived-indicator,
.task-item-pinned-indicator,
.calendar-archived-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08rem;
  min-width: 1.08rem;
  height: 1.08rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #64748b;
}

/* Indicateur « épinglé » : même boîte que le fantôme, mais teinté bleu. */
.task-item-pinned-indicator {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.task-item-recurrence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  min-height: 1.45rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.task-item-archived-indicator .lucide-icon,
.task-item-pinned-indicator .lucide-icon,
.calendar-archived-indicator .lucide-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.task-done-btn-done {
  border-color: #5ea36d;
  background: linear-gradient(180deg, #e5f7e8, #cbefcf);
  color: #1f6e31;
  font-weight: 700;
}

.task-open-title.cancelled {
  color: #9f1239;
  text-decoration: line-through;
  opacity: 0.82;
}

/* Bordure des tâches : on garde TOUJOURS var(--line) (gris des boutons) — la couleur de priorité
   ne porte plus sur le filet (sinon rose sur rose = filet « bicolore / qui disparaît »).
   Seul le fond change selon la priorité. */
.task-item.priority-low {
  background: var(--sticky-low);
  color: var(--sticky-low-text, #0f172a);
}

.task-item.priority-medium {
  background: var(--sticky-medium);
  color: var(--sticky-medium-text, #0f172a);
}

.task-item.priority-high {
  background: var(--sticky-high);
  color: var(--sticky-high-text, #0f172a);
}

.task-item.priority-critical {
  background: var(--sticky-critical);
  color: var(--sticky-critical-text, #0f172a);
}

.task-item.critical {
  background: #fff5f5;
}

.task-item.priority-critical.critical {
  background: var(--sticky-critical);
  color: var(--sticky-critical-text, #0f172a);
}

.task-card-item.attention_required {
  border-color: #e2c18e;
}

.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.task-alert-tags {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Cold Gray Refresh */
.auth-card,
.topbar,
.filter-block,
.list-sort-wrap,
.board-list,
.inline-add,
.member-row,
.admin-user-row,
.tag-editor-row,
.comment-item,
.check-item,
.task-item,
dialog {
  background: #f8fafc;
}

.auth-card {
  border: 1px solid #d8e2ec;
}

.topbar {
  border-bottom-color: #d8e2ec;
  backdrop-filter: none;
  background: var(--board-banner-bg, #f8fafc);
}

.view-switch,
.filter-block,
.list-sort-wrap,
#canvas-scroll,
.board-list,
.details,
.inline-add,
.member-row,
.admin-user-row,
.tag-editor-row,
.comment-item,
.check-item,
.event-item,
.card-file-item,
.task-item {
  border-color: var(--detail-block-border);
}

#canvas-scroll {
  background-color: #ffffff;
  background-image:
    var(--board-background-image, none),
    linear-gradient(90deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(100, 116, 139, 0.07) 1px, transparent 1px);
  background-size:
    cover,
    var(--board-grid-size, 28px) var(--board-grid-size, 28px),
    var(--board-grid-size, 28px) var(--board-grid-size, 28px);
  background-repeat:
    no-repeat,
    repeat,
    repeat;
  background-position:
    center center,
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px),
    var(--board-grid-offset-x, 0px) var(--board-grid-offset-y, 0px);
}

input,
textarea,
select {
  background: #ffffff;
  border-color: var(--line);
  color: #0f172a;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: 0;
  border-color: #93c5fd;
}

.subtitle,
.filter-block strong,
.list-sort-wrap label,
.tasks-section-title,
.card-row-tags-label,
.comment-head,
.comment-draft-status {
  color: #475569;
}

.view-switch {
  background: #e2e8f0;
}

.view-switch button.active {
  background: #cbd5e1;
  color: #1e293b;
}

.tab {
  border: none;
  background: #e2e8f0;
}

.tab.active {
  border-color: transparent;
  background: #dbeafe;
  color: #1e3a8a;
}

.create-card-tooltip,
.card-context-tooltip,
.text-context-tooltip,
.tag-edit-tooltip,
.detail-item-context-tooltip,
.rich-editor-link-context-tooltip {
  background: #f8fafc;
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.create-card-tooltip-yes,
.comment-actions button {
  border: none !important;
  background: #e2e8f0;
  color: #0f172a;
}

.task-done-btn {
  border: none !important;
  background: #e2e8f0;
  color: #334155;
}

.task-done-btn-done {
  border: none !important;
  background: #dcfce7;
  color: #166534;
}

.comment-actions button.danger,
.card-context-archive,
.card-context-delete,
.card-context-appearance,
.card-context-create-alias,
.card-context-delete-instance,
.card-context-delete-all,
.text-context-open-btn,
.text-context-connector-btn,
.text-context-archive-btn,
.text-context-delete-btn {
  border: none !important;
  background: #e2e8f0;
  color: #0f172a;
}

/* Uniformiser les boutons d'action : gris, sans contour (comme mini-modale burger). */
.topbar-menu-panel button,
.topbar-quick-add-panel button,
.card-actions button,
.inline-add-actions button,
.check-linked-comment-editor-actions button,
.detail-item-note-actions button,
.members-member-actions button,
.admin-user-actions button,
.tag-edit-actions button,
.detail-item-context-archive,
.detail-item-context-delete,
.rich-editor-link-context-tooltip button,
.create-card-tooltip-yes,
.comment-actions button,
.card-context-archive,
.card-context-delete,
.card-context-appearance,
.card-context-create-alias,
.card-context-delete-instance,
.card-context-delete-all,
.text-context-open-btn,
.text-context-connector-btn,
.text-context-archive-btn,
.text-context-delete-btn,
.board-switch-item,
.inline-add-save-btn,
.inline-add-cancel-btn,
button.danger,
button.ghost {
  border: none !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.topbar-menu-panel button:hover,
.topbar-menu-panel button:focus-visible,
.topbar-quick-add-panel button:hover,
.topbar-quick-add-panel button:focus-visible,
.card-actions button:hover,
.card-actions button:focus-visible,
.inline-add-actions button:hover,
.inline-add-actions button:focus-visible,
.check-linked-comment-editor-actions button:hover,
.check-linked-comment-editor-actions button:focus-visible,
.detail-item-note-actions button:hover,
.detail-item-note-actions button:focus-visible,
.members-member-actions button:hover,
.members-member-actions button:focus-visible,
.admin-user-actions button:hover,
.admin-user-actions button:focus-visible,
.tag-edit-actions button:hover,
.tag-edit-actions button:focus-visible,
.detail-item-context-archive:hover,
.detail-item-context-archive:focus-visible,
.detail-item-context-delete:hover,
.detail-item-context-delete:focus-visible,
.rich-editor-link-context-tooltip button:hover,
.rich-editor-link-context-tooltip button:focus-visible,
.create-card-tooltip-yes:hover,
.create-card-tooltip-yes:focus-visible,
.comment-actions button:hover,
.comment-actions button:focus-visible,
.card-context-archive:hover,
.card-context-archive:focus-visible,
.card-context-delete:hover,
.card-context-delete:focus-visible,
.card-context-appearance:hover,
.card-context-appearance:focus-visible,
.card-context-create-alias:hover,
.card-context-create-alias:focus-visible,
.card-context-delete-instance:hover,
.card-context-delete-instance:focus-visible,
.card-context-delete-all:hover,
.card-context-delete-all:focus-visible,
.text-context-open-btn:hover,
.text-context-open-btn:focus-visible,
.text-context-connector-btn:hover,
.text-context-connector-btn:focus-visible,
.text-context-archive-btn:hover,
.text-context-archive-btn:focus-visible,
.text-context-delete-btn:hover,
.text-context-delete-btn:focus-visible,
.board-switch-item:hover,
.board-switch-item:focus-visible,
.inline-add-save-btn:hover,
.inline-add-save-btn:focus-visible,
.inline-add-cancel-btn:hover,
.inline-add-cancel-btn:focus-visible,
button.danger:hover,
button.danger:focus-visible,
button.ghost:hover,
button.ghost:focus-visible {
  border: none !important;
  background: #d8e1ec !important;
  color: #0f172a !important;
}

.inline-add-actions .check-copy-link-btn,
.inline-add-actions .check-archive-btn,
.inline-add-actions .check-delete-btn {
  border: 1px solid #d8e1ec !important;
  background: #ffffff !important;
  color: #475569 !important;
}

.inline-add-actions .check-copy-link-btn:hover,
.inline-add-actions .check-copy-link-btn:focus-visible,
.inline-add-actions .check-archive-btn:hover,
.inline-add-actions .check-archive-btn:focus-visible {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

.inline-add-actions .check-delete-btn:hover,
.inline-add-actions .check-delete-btn:focus-visible,
.inline-add-actions .check-archive-btn.is-active {
  border-color: #fecaca !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.board-switch-item.active {
  border: none !important;
  background: #cbd5e1 !important;
  color: #0f172a !important;
}

.pill,
.filter-list label,
.tag-list label,
.card-tag,
.status-chip,
.impact-chip {
  border-color: transparent;
  background: #e2e8f0;
  color: #334155;
}

.user-tag {
  border: 1px solid #94a3b8;
  background: #f1f5f9;
  color: #334155;
}

/* Filters Alignment Fix */
.filters-wrap {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
}

.filter-block,
#clear-tag-filters-btn,
#list-sort-wrap {
  min-width: 0;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem;
}

.filter-list label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 0;
  padding: 0.18rem 0.5rem;
  line-height: 1.2;
}

.filter-list label input[type="checkbox"] {
  margin: 0;
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.filter-list .critical-filter-toggle {
  min-height: 0;
}

.filter-control-stack select,
.filter-control-row select,
.filter-control-stack input,
.filter-control-row input {
  min-height: 0;
}

dialog {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

@media (max-width: 1450px) {
  .check-item {
    grid-template-columns: 1fr;
  }

  .check-item-assignees-inline,
  .event-item-assignees-inline {
    max-width: min(46vw, 320px);
  }

  .check-item .check-assignees,
  .event-item .event-assignees {
    max-height: 80px;
  }
}

@media (max-width: 1080px) {
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .topbar-main {
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    row-gap: 0;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-views-separator {
    display: none;
  }

  .topbar-board-name {
    flex: 0 1 auto;
    max-width: 52vw;
  }

  /* Sur mobile : on remplace le logo Mindee complet par la marque « ee ». */
  .brand-logo-full {
    display: none;
  }

  .brand-logo-mark {
    display: block;
    width: 1.7rem;
    height: auto;
  }

  .topbar-favorites-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .topbar-menu-toggle {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .topbar-popover-panel {
    max-width: calc(100vw - 1.1rem);
  }

  .topbar-menu-panel {
    width: calc(100vw - 1.1rem);
  }

  .topbar-bookmarks-bar,
  .topbar-main > .topbar-board-action,
  .topbar > .topbar-board-action {
    display: none !important;
  }

  .topbar-mobile-menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.1rem;
  }

  .topbar-mobile-menu-actions .mobile-menu-action {
    width: 2.2rem;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    justify-content: center;
  }

  .topbar-quick-add-panel {
    position: fixed;
    left: 0.55rem !important;
    right: 0.55rem !important;
    top: 4.25rem !important;
    width: auto;
    max-width: none;
    justify-content: center;
    z-index: 90;
  }

  .topbar-quick-add-panel button {
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0;
  }

  .topbar-quick-add-panel button span {
    display: none;
  }

  .board-tools {
    align-items: stretch;
  }

  .filters-wrap {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .filter-block {
    min-width: 0;
    width: 100%;
  }

  .list-sort-wrap {
    min-width: 0;
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.with-details {
    grid-template-columns: 1fr;
  }

  .details {
    display: none;
    border-left: none;
    border-top: 1px solid rgba(67, 84, 89, 0.25);
    min-height: 340px;
  }

  .workspace.with-details .details {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    width: auto;
    max-width: 100vw;
    padding: 0.75rem;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    border: none;
    box-sizing: border-box;
    background: #ffffff;
  }

  #details-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 100%;
    overflow-x: hidden;
    align-content: start;
  }

  #details-content,
  #details-content * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .card-main-head-row {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -0.75rem 0 0;
    padding: 0.75rem 0 0.65rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    touch-action: none;
  }

  /* Les pills (Statut/Priorité/Portée…) doivent dégager la bande sticky du titre. */
  .card-main-readonly {
    margin-top: 0.5rem;
  }

  .card-main-head-actions {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .detail-mobile-close-btn {
    display: inline-flex;
    width: 2.15rem;
    min-width: 2.15rem;
    height: 2.15rem;
    align-items: center;
    justify-content: center;
  }

  #comment-editor-dialog,
  #floating-event-note-editor-dialog,
  #floating-item-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
  }

  #comment-editor-dialog .comment-editor-dialog-article,
  #floating-event-note-editor-dialog .comment-editor-dialog-article,
  #floating-item-dialog .floating-item-dialog-article {
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 0.75rem;
    overflow: auto;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
    align-content: start;
  }

  .comment-editor-dialog-head,
  .floating-item-dialog-head {
    position: sticky;
    top: -0.75rem;
    z-index: 2;
    margin: -0.75rem -0.75rem 0;
    padding: 0.75rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    touch-action: none;
  }

  .floating-item-dialog-head {
    align-items: flex-start;
    min-height: 0;
  }

  .floating-item-dialog-head h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.12;
  }

  .comment-editor-head-close-btn,
  .floating-item-head-close-btn {
    display: inline-flex;
    width: 2.15rem;
    min-width: 2.15rem;
    height: 2.15rem;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
  }

  #comment-editor-body,
  #floating-event-note-editor-body {
    min-height: 48vh;
  }

  #comment-editor-dialog .rich-textarea-editor,
  #floating-event-note-editor-dialog .rich-textarea-editor {
    min-height: 48vh;
  }

  /* Mobile : le header est déjà sticky -> la barre d'outils défile normalement
     (pas de sticky, sinon elle chevaucherait le header collé en haut). */
  #comment-editor-dialog .textarea-format-toolbar {
    position: static;
  }

  #floating-item-event-fields {
    gap: 0.42rem;
  }

  #floating-item-event-fields > label,
  #floating-item-event-fields .event-date-time-row > label {
    display: grid;
    gap: 0.12rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.15;
  }

  .floating-event-title-row {
    align-items: center;
    gap: 0.35rem;
  }

  .floating-event-title-row .event-item-icon-btns {
    margin-left: 0;
  }

  .tag-editor-row {
    grid-template-columns: 1fr;
  }

  .card-tags-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .card-tags-choice small {
    grid-column: 2;
  }

  .text-block-create-grid {
    grid-template-columns: 1fr;
  }

  #comment-editor-files-add-form {
    grid-template-columns: 1fr;
  }

  .detail-grid.detail-grid-triple {
    grid-template-columns: 1fr;
  }

  .detail-grid.detail-grid-task {
    grid-template-columns: 1fr;
  }

  .check-item-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.28rem 0.4rem;
    padding: 0.5rem 0.55rem;
  }

  .check-item-row > .check-done-btn {
    order: 1;
  }

  .check-item-row > .check-item-title {
    order: 2;
    flex: 1 1 calc(100% - 2.4rem);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  .check-item-row > .check-item-tags-inline {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    overflow-x: auto;
  }

  .check-item-row > .check-item-assignees-inline,
  .check-item-row > .check-item-meta-inline {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    justify-self: start;
    overflow-x: auto;
  }

  .check-item-row > .check-item-assignees-inline {
    order: 4;
  }

  .check-item-row > .check-item-meta-inline {
    order: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .event-item-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.28rem;
    padding: 0.5rem 0.55rem;
  }

  .event-item-title {
    flex: 0 0 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  .event-item-tags-inline {
    flex: 0 0 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .event-item-assignees-inline,
  .event-item-meta-inline {
    flex: 0 0 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .event-item-icon-btns {
    margin-left: auto;
  }

  .comment-item-row-main {
    row-gap: 0.15rem;
  }

  .comment-item-row-summary {
    width: auto;
  }

  .check-edit-grid {
    grid-template-columns: minmax(0, 1fr) minmax(5.7rem, 0.58fr);
  }

  .event-edit-fixed-grid {
    grid-template-columns: minmax(0, 1fr) minmax(5.7rem, 0.58fr);
  }

  #checklist-add-form .detail-grid-triple,
  #floating-item-task-fields .check-edit-grid,
  .event-date-time-row:not(.event-edit-fixed-grid) {
    grid-template-columns: minmax(0, 1fr) minmax(5.7rem, 0.58fr);
  }

  .check-edit-grid,
  .event-edit-fixed-grid,
  .event-date-time-row,
  #floating-item-dialog .detail-grid,
  .detail-inline-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .check-edit-panel,
  .event-edit-panel {
    padding: 0.45rem 0.55rem 0.55rem;
  }

  .check-edit-title-row,
  .event-edit-title-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .check-edit-title-actions {
    justify-self: start;
  }

  .check-edit-grid > *,
  .event-edit-fixed-grid > *,
  .event-date-time-row > *,
  #floating-item-dialog .detail-grid > *,
  .detail-inline-form > input,
  .detail-inline-form > select,
  .detail-inline-form > textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .check-edit-grid > select,
  .event-edit-fixed-grid > select,
  #checklist-add-form .detail-grid-triple > select,
  #floating-item-task-fields .check-edit-grid > select {
    grid-column: 1 / -1;
  }

  .card-main-panel input,
  .card-main-panel textarea,
  .card-main-panel select,
  .detail-inline-form input,
  .detail-inline-form textarea,
  .detail-inline-form select,
  .check-edit-panel input,
  .check-edit-panel textarea,
  .check-edit-panel select,
  .event-edit-panel input,
  .event-edit-panel textarea,
  .event-edit-panel select,
  .detail-item-note-composer input,
  .detail-item-note-composer textarea,
  .detail-item-note-composer select,
  #floating-item-dialog input,
  #floating-item-dialog textarea,
  #floating-item-dialog select {
    min-height: 2.1rem;
    padding: 0.28rem 0.42rem;
    font-size: 16px;
  }

  .card-main-panel input[type="date"],
  .detail-inline-form input[type="date"],
  .check-edit-panel input[type="date"],
  .event-edit-panel input[type="date"],
  #floating-item-dialog input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-left: 1.9rem;
    padding-right: 0.35rem;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='18'%20height='18'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%2364758b'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%202v4'/%3E%3Cpath%20d='M16%202v4'/%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='18'%20rx='2'/%3E%3Cpath%20d='M3%2010h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.55rem center;
    background-size: 1rem 1rem;
    justify-self: start;
  }

  .detail-inline-form input[type="time"],
  .check-edit-panel input[type="time"],
  .event-edit-panel input[type="time"],
  #floating-item-dialog input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-left: 1.9rem;
    padding-right: 0.35rem;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='18'%20height='18'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%2364758b'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Cpath%20d='M12%206v6l4%202'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.55rem center;
    background-size: 1rem 1rem;
    justify-self: start;
  }

  .detail-item-action-row {
    width: 100%;
    justify-content: flex-start;
  }

  .floating-item-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .floating-item-dialog-actions-left,
  .floating-item-dialog-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
  }

  .floating-item-dialog-actions-left:empty {
    display: none;
  }

  .floating-item-dialog-actions-right {
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .floating-item-dialog-actions-right .inline-add-save-btn,
  .floating-item-dialog-actions-right .ghost {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
    white-space: nowrap;
  }

  .floating-item-dialog-actions-right #floating-item-archive-btn,
  .floating-item-dialog-actions-right #floating-item-delete-btn.floating-item-delete-icon-btn {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
  }

  .check-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .check-edit-actions > .item-audit-meta {
    flex: 0 0 100%;
    order: -1;
    width: 100%;
    margin-right: 0;
  }

  .check-edit-actions .inline-add-save-btn,
  .check-edit-actions .inline-add-cancel-btn,
  .check-edit-actions .event-edit-save-btn,
  .check-edit-actions .event-edit-cancel-btn {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
  }

  .check-edit-actions .check-copy-link-btn,
  .check-edit-actions .check-archive-btn,
  .check-edit-actions .check-delete-btn,
  .check-edit-actions .event-bottom-delete-btn {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
  }

  .timeline-filters-wrap {
    grid-template-columns: 1fr;
  }

  .check-item .check-assignees,
  .event-item .event-assignees,
  .detail-assignees-picker {
    max-height: none;
  }

  .card-file-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .card-file-panel-main {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .admin-user-grid,
  .admin-assistant-search-grid {
    grid-template-columns: 1fr;
  }

  .card-file-preview {
    width: min(100%, 260px);
    height: auto;
    max-height: 220px;
  }

  .calendar-date-range {
    grid-template-columns: 1fr;
  }

  .calendar-list {
    max-height: calc(min(88vh, 980px) - 220px);
  }

  #tasks-member-filter-select {
    min-height: 92px;
  }

  .detail-item-note-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-item-note-file-input {
    flex: 1 1 auto;
  }

  .detail-item-note-submit {
    width: 100%;
  }

  .textarea-format-hint {
    width: 100%;
    margin-left: 0;
  }
}

/* ── File preview dialog ──────────────────────────────────────────────────── */

#file-preview-dialog {
  width: min(960px, 96vw);
  max-height: min(92vh, 960px);
  padding: 0;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

#file-preview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.file-preview-dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 240px;
}

.file-preview-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.file-preview-dialog-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e6edf3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.file-preview-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.file-preview-action-btn:hover {
  background: #30363d;
  color: #e6edf3;
}
.file-preview-action-btn.danger:hover {
  background: #7c1e1e;
  border-color: #da3633;
  color: #ff7b72;
}
.file-preview-action-btn.hidden {
  display: none;
}

.file-preview-close-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.file-preview-close-btn:hover {
  color: #e6edf3;
  background: #30363d;
}

.file-preview-dialog-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1117;
  min-height: 160px;
}

.file-preview-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.file-preview-iframe {
  width: 100%;
  height: 72vh;
  border: none;
  display: block;
}

.file-preview-video {
  max-width: 100%;
  max-height: 72vh;
  display: block;
}

.file-preview-audio {
  padding: 2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.file-preview-text {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.78rem;
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  color: #e6edf3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  text-align: left;
  box-sizing: border-box;
  line-height: 1.55;
}

.file-preview-unavailable {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #6e7681;
}
.file-preview-unavailable p {
  margin: 0.3rem 0;
}
.file-preview-mime {
  font-size: 0.75rem;
  font-family: monospace;
  color: #484f58;
}

.file-preview-dialog-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  justify-content: flex-end;
  flex-shrink: 0;
}

.file-preview-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #238636;
  color: #ffffff;
  padding: 0.38rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  transition: background 0.15s;
}
.file-preview-download-link:hover {
  background: #2ea043;
  color: #ffffff;
}
.file-preview-download-link.hidden {
  display: none;
}

.file-preview-footer-close {
  color: #8b949e;
  font-size: 0.83rem;
}
.file-preview-footer-close:hover {
  color: #e6edf3;
}

/* ── Compact panel mode ─────────────────────────────────────── */

.board-settings-option-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.36rem;
}

.board-settings-option-label {
  display: inline-grid;
  grid-template-columns: auto minmax(0, max-content);
  align-items: center;
  justify-content: start;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
  line-height: 1.25;
  padding: 0.12rem 0;
}

.board-settings-option-label input[type="checkbox"] {
  justify-self: start;
  margin: 0;
}

.compact-action-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.5rem;
}

.compact-sort-select {
  flex: 0 0 auto;
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  height: 2rem;
  cursor: pointer;
  width: auto;
}

.compact-action-icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.compact-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.compact-action-btn:hover {
  background: #eef2f7;
  color: #334155;
  border-color: var(--line);
}

.compact-action-btn[aria-expanded="true"] {
  background: #e2e8f0;
  color: #0f172a;
  border-color: var(--line);
}

.compact-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  min-height: 0;
}

.compact-item-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}

/* Filet gris clair après les items épinglés : la première ligne non épinglée
   qui suit un item épinglé porte une bordure haute, pour séparer du reste. */
.compact-item-wrap-pinned + .compact-item-wrap:not(.compact-item-wrap-pinned) {
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

/* Liserés « Événements passés » retirés (jugés inutiles) : les événements passés
   ne sont plus séparés par une bordure ni un label ; ils restent grisés. */

.compact-item-wrap-event-past .event-item-title,
.compact-item-wrap-event-past .event-item-date-inline,
.event-item.event-item-past .event-item-title,
.event-item.event-item-past .event-item-date-inline {
  color: #94a3b8;
}

.event-item.event-item-past {
  opacity: 0.85;
}

/* Événement passé : la typo passe en gris → on pastelise le fond de priorité
   (surcouche blanche translucide sur la couleur, le texte reste lisible).
   Le background-color (var --sticky-*) de la règle de base est conservé. */
.event-item.event-item-past.event-item-priority-low .event-item-row,
.event-item.event-item-past.event-item-priority-medium .event-item-row,
.event-item.event-item-past.event-item-priority-high .event-item-row,
.event-item.event-item-past.event-item-priority-critical .event-item-row {
  background-image: linear-gradient(rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.66));
}

.compact-item-type-icon {
  flex: 0 0 auto;
  padding-top: 0.45rem;
  color: #94a3b8;
  line-height: 1;
}

.compact-item-body {
  flex: 1;
  min-width: 0;
}

.compact-item-wrap .check-item,
.compact-item-wrap .event-item,
.compact-item-wrap .comment-item,
.compact-item-wrap .card-file-item {
  border: 1px solid var(--detail-block-border);
  box-shadow: none;
  width: 100%;
}

.compact-empty {
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 0.5rem 0;
  margin: 0;
}

.check-item-title,
.check-item-title.done,
.check-item-title.cancelled,
.check-item.check-item-priority-critical .check-item-title:not(.done):not(.cancelled),
.check-item.check-item-priority-high .check-item-title:not(.done):not(.cancelled),
.check-item.check-item-priority-medium .check-item-title:not(.done):not(.cancelled),
.check-item.check-item-priority-low .check-item-title:not(.done):not(.cancelled),
.check-item.item-archived .check-item-title:not(.done):not(.cancelled),
.event-item-title,
.event-item-title.done,
.comment-item-row-summary,
.card-file-row-name {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 600;
}

.compact-item-wrap-event-past .event-item-title,
.event-item.event-item-past .event-item-title {
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
}

.check-linked-comment-row-summary {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 400;
}

.compact-panel-members {
  padding-top: 0.6rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.5rem;
}

/* File panel actions in compact mode (edit + delete buttons) */
.compact-items-list .card-file-panel-main {
  grid-template-columns: minmax(0, 1fr);
}

.compact-file-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-self: flex-start;
  padding-top: 0.2rem;
}

/* Note rows in compact mode: single-line summary + date pushed right, no author */
.compact-items-list .comment-item-row-main {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.compact-items-list .comment-item-row-summary {
  flex: 1;
  min-width: 0;
  max-height: calc(1.28em * 2);
  grid-column: unset;
}

.compact-items-list .comment-item-row-date {
  flex: 0 0 auto;
  margin-left: auto;
}

/* ---- Crop dialog ---- */

#crop-dialog {
  width: min(92vw, 960px);
  max-height: 92vh;
  padding: 0;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

#crop-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(3px);
}

.crop-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.crop-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.crop-dialog-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e6edf3;
}

.crop-dialog-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
}
.crop-dialog-close-btn:hover {
  background: #30363d;
  color: #e6edf3;
}

.crop-dialog-canvas-wrap {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d13;
  padding: 1rem;
  flex: 1 1 auto;
  min-height: 0;
}

#crop-canvas {
  display: block;
  max-width: 100%;
  cursor: crosshair;
  border-radius: 2px;
}

.crop-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.crop-dialog-hint {
  font-size: 0.76rem;
  color: #6e7681;
  flex: 1 1 auto;
}

.crop-dialog-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

#crop-dialog-confirm-btn {
  background: #238636;
  color: #ffffff;
  border: 1px solid #2ea043;
  border-radius: 6px;
  padding: 0.38rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
}
#crop-dialog-confirm-btn:hover {
  background: #2ea043;
}
#crop-dialog-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Harmonisation des boutons d'action des items (tâches, événements, …).
   Même style que les boutons d'ajout du panneau (.compact-action-btn) :
   carré 2rem, filet gris léger, fond gris très clair, couleur grise.
   Libellés (Enregistrer) à la taille de typo des titres (0.82rem).
   Suppression en gris (plus de rouge) ; seule l'archive (fantôme) garde
   une couleur en état actif.
   ============================================================ */
.check-item .check-edit-actions > button,
.event-item .check-edit-actions > button,
.check-item .detail-item-action-row .detail-item-action-btn,
.event-item .detail-item-action-row .detail-item-action-btn {
  height: 2rem;
  min-height: 2rem;
  min-width: 2rem;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px;
  background: #f8fafc !important;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
}

/* Icône seule : carré parfait (tout sauf le bouton Enregistrer qui porte un libellé). */
.check-item .check-edit-actions > button:not(.inline-add-save-btn),
.event-item .check-edit-actions > button:not(.inline-add-save-btn),
.check-item .detail-item-action-row .detail-item-action-btn,
.event-item .detail-item-action-row .detail-item-action-btn {
  width: 2rem;
  padding: 0;
}

/* Bouton avec libellé (Enregistrer) : largeur au contenu, texte à la taille des titres. */
.check-item .check-edit-actions > .inline-add-save-btn,
.event-item .check-edit-actions > .inline-add-save-btn {
  width: auto;
  padding: 0 0.6rem;
}

/* Icônes harmonisées (1rem comme les boutons d'ajout). */
.check-item .check-edit-actions > button .lucide-icon,
.event-item .check-edit-actions > button .lucide-icon,
.check-item .detail-item-action-row .detail-item-action-btn .lucide-icon,
.event-item .detail-item-action-row .detail-item-action-btn .lucide-icon {
  width: 1rem;
  height: 1rem;
}

/* Survol uniforme (gris) — y compris suppression : plus de rouge. */
.check-item .check-edit-actions > button:hover,
.check-item .check-edit-actions > button:focus-visible,
.event-item .check-edit-actions > button:hover,
.event-item .check-edit-actions > button:focus-visible,
.check-item .detail-item-action-row .detail-item-action-btn:hover,
.check-item .detail-item-action-row .detail-item-action-btn:focus-visible,
.event-item .detail-item-action-row .detail-item-action-btn:hover,
.event-item .detail-item-action-row .detail-item-action-btn:focus-visible {
  background: #eef2f7 !important;
  color: #334155 !important;
  border-color: var(--line) !important;
}

/* Exception « fantôme » : item archivé → l'archive garde une couleur active. */
.check-item .check-edit-actions .check-archive-btn.is-active,
.event-item .check-edit-actions .event-archive-btn.is-active {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

/* ============================================================
   Harmonisation des boutons de la modale d'édition de note.
   Enregistrer = icône + libellé ; Lien / Supprimer = icône seule, carré 2rem.
   Style aligné sur les boutons d'ajout (gris). Fermer reste en ghost.
   ============================================================ */
.comment-editor-dialog-actions > .inline-add-save-btn,
.comment-editor-dialog-actions > .comment-editor-assistant-btn,
.comment-editor-dialog-actions > .comment-editor-placement-btn,
.comment-editor-dialog-actions > .comment-editor-conversion-btn,
.comment-editor-dialog-actions > .comment-editor-tags-btn,
.comment-editor-dialog-actions > .comment-editor-copy-link-btn,
.comment-editor-dialog-actions > .comment-editor-archive-btn,
.comment-editor-dialog-actions > .comment-editor-pin-btn,
.comment-editor-dialog-actions > #comment-editor-delete-btn {
  height: 2rem;
  min-height: 2rem;
  min-width: 2rem;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px;
  background: #f8fafc !important;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
}
.comment-editor-dialog-actions > .comment-editor-tags-btn,
.comment-editor-dialog-actions > .comment-editor-assistant-btn,
.comment-editor-dialog-actions > .comment-editor-placement-btn,
.comment-editor-dialog-actions > .comment-editor-conversion-btn,
.comment-editor-dialog-actions > .comment-editor-copy-link-btn,
.comment-editor-dialog-actions > .comment-editor-archive-btn,
.comment-editor-dialog-actions > .comment-editor-pin-btn,
.comment-editor-dialog-actions > #comment-editor-delete-btn {
  width: 2rem;
  padding: 0;
}
.comment-editor-dialog-actions > .inline-add-save-btn {
  width: auto;
  padding: 0 0.6rem;
  min-width: auto;
}
.comment-editor-dialog-actions > .inline-add-save-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-assistant-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-placement-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-conversion-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-tags-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-copy-link-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-archive-btn .lucide-icon,
.comment-editor-dialog-actions > .comment-editor-pin-btn .lucide-icon,
.comment-editor-dialog-actions > #comment-editor-delete-btn .lucide-icon {
  width: 1rem;
  height: 1rem;
}
.comment-editor-dialog-actions > .inline-add-save-btn:hover,
.comment-editor-dialog-actions > .inline-add-save-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-assistant-btn:hover,
.comment-editor-dialog-actions > .comment-editor-assistant-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-placement-btn:hover,
.comment-editor-dialog-actions > .comment-editor-placement-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-conversion-btn:hover,
.comment-editor-dialog-actions > .comment-editor-conversion-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-tags-btn:hover,
.comment-editor-dialog-actions > .comment-editor-tags-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-copy-link-btn:hover,
.comment-editor-dialog-actions > .comment-editor-copy-link-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-archive-btn:hover,
.comment-editor-dialog-actions > .comment-editor-archive-btn:focus-visible,
.comment-editor-dialog-actions > .comment-editor-pin-btn:hover,
.comment-editor-dialog-actions > .comment-editor-pin-btn:focus-visible,
.comment-editor-dialog-actions > #comment-editor-delete-btn:hover,
.comment-editor-dialog-actions > #comment-editor-delete-btn:focus-visible {
  background: #eef2f7 !important;
  color: #334155 !important;
  border-color: var(--line) !important;
}
/* Exception « fantôme » : note archivée → l'archive garde une couleur active. */
.comment-editor-dialog-actions > .comment-editor-archive-btn.is-active {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

/* Bouton « épingler » (item-pin-btn) : harmonisé gris via les blocs d'actions
   existants ; à l'état actif (item épinglé) il prend une couleur bleue. La
   spécificité (4 sélecteurs) passe au-dessus de l'harmonisation grise. */
.check-item .check-edit-actions > .item-pin-btn.is-active,
.event-item .check-edit-actions > .item-pin-btn.is-active,
.card-file-actions-row > .item-pin-btn.is-active,
.comment-editor-dialog-actions > .item-pin-btn.is-active {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

/* ============================================================
   Harmonisation des boutons du panneau Ressource (liste compacte).
   Modifier = icône + libellé ; Lien / Archive / Supprimer = icône seule, carré 2rem.
   Même style gris que les boutons d'ajout. Archive « fantôme » garde sa couleur.
   ============================================================ */
.card-file-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  width: 100%;
  margin-left: auto;
}
.card-file-actions-row > button,
.card-file-actions-row > .card-file-copy-link-btn,
.card-file-actions-row > .card-file-tags-btn,
.card-file-actions-row > .card-file-archive-btn,
.card-file-actions-row > .card-file-delete-btn {
  height: 2rem;
  min-height: 2rem;
  min-width: 2rem;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px;
  background: #f8fafc !important;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  opacity: 1;
}
.card-file-actions-row > button:not(.inline-add-save-btn),
.card-file-actions-row > .card-file-copy-link-btn,
.card-file-actions-row > .card-file-tags-btn,
.card-file-actions-row > .card-file-archive-btn,
.card-file-actions-row > .card-file-delete-btn {
  width: 2rem;
  padding: 0;
  margin-left: 0 !important;
  flex: 0 0 2rem;
}
.card-file-actions-row > .inline-add-save-btn {
  width: auto;
  padding: 0 0.6rem;
  min-width: auto;
  flex: 0 0 auto;
}
.card-file-actions-row > button .lucide-icon {
  width: 1rem;
  height: 1rem;
}
.card-file-actions-row > button:hover,
.card-file-actions-row > button:focus-visible {
  background: #eef2f7 !important;
  color: #334155 !important;
  border-color: var(--line) !important;
}
/* Exception « fantôme » : ressource archivée → l'archive garde une couleur active. */
.card-file-actions-row > .card-file-archive-btn.is-active {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

/* ============================================================
   Vue compacte unifiée : lignes Note / Ressource en flex (comme les
   tâches/événements). En grid, l'indicateur « archivé » (fantôme) ajoutait un
   élément qui débordait sur une 2e rangée -> la sirène passait à la ligne. En
   flex (nowrap), tout tient sur une seule ligne : le nom occupe l'espace
   restant, puis métadonnée, fantôme et sirène. Le fantôme est juste à gauche de
   la sirène (cf. ordre du markup).
   ============================================================ */
.compact-item-body > .comment-item > .comment-item-row {
  display: flex;
  align-items: center;
}
.compact-item-body > .comment-item > .comment-item-row > .comment-item-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.compact-item-body > .card-file-item > .card-file-item-row {
  display: flex;
  align-items: center;
  /* L'article .card-file-item a padding 0.38rem (les autres types : 0). On cale
     donc le padding droit de la ligne à 0.12rem pour que l'inset total
     (0.38 + 0.12 = 0.5rem) corresponde aux notes/tâches/événements -> sirènes
     alignées à droite. */
  padding-right: 0.12rem;
}
.compact-item-body > .card-file-item > .card-file-item-row > .card-file-row-name {
  flex: 1 1 auto;
  min-width: 0;
}
.compact-item-body > .card-file-item > .card-file-item-row > .card-file-row-primary {
  flex: 1 1 auto;
  min-width: 0;
}

/* Ressource imbriquée sous une note : pas de ping ni de lien (cf. hideRowActions).
   La ligne ne contient plus que le nom + la métadonnée (taille/date) -> on cale la
   grille pour que la métadonnée se pose à droite, sans colonne vide résiduelle. */
.comment-files-inline .card-file-item-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* ============================================================
   Volet de filtres compact : usages fréquents visibles, critères rares
   rangés dans « Voir plus », sélections multiples en menus déroulants.
   ============================================================ */
#filters-wrap.filters-wrap {
  position: relative;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.45rem;
}

.filters-primary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(180px, 1.35fr) minmax(130px, 0.7fr) minmax(170px, 1fr);
  gap: 0.4rem;
  align-items: end;
  min-width: 0;
}

#filters-wrap .filter-block {
  min-width: 0;
}

#filters-wrap .filter-block-compact {
  padding: 0.28rem 0.38rem 0.36rem;
}

#filters-wrap .filter-block-compact > strong {
  margin-bottom: 0.22rem;
}

.filter-multiselect {
  position: relative;
  min-width: 0;
}

.filter-multiselect > summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  width: 100%;
  min-width: 0;
  height: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
}

.filter-multiselect > summary::-webkit-details-marker,
.filters-more > summary::-webkit-details-marker {
  display: none;
}

.filter-multiselect > summary::after {
  content: "⌄";
  flex: 0 0 auto;
  margin-left: auto;
  color: #64748b;
  font-size: 0.9rem;
  transform-origin: center;
  transition: transform 120ms ease;
}

.filter-multiselect[open] > summary::after {
  transform: rotate(180deg);
}

.filter-multiselect.has-selection > summary {
  border-color: #7aa6b0;
  background: #f0f9fa;
  color: #174f58;
  font-weight: 600;
}

.filter-multiselect-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#filters-wrap .filter-multiselect-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.18rem;
  width: max(100%, 220px);
  max-width: min(320px, 82vw);
  max-height: min(300px, 55vh);
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

#filters-wrap .filter-multiselect-menu label {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  padding: 0.34rem 0.45rem;
  cursor: pointer;
}

#filters-wrap .filter-multiselect-menu label:hover {
  filter: brightness(0.97);
}

#filters-wrap .filter-multiselect-menu .empty {
  border: 0;
  background: transparent;
  color: #64748b;
}

.filters-secondary-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.filters-more {
  flex: 1 1 auto;
  min-width: 0;
}

.filters-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.9rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.filters-more > summary::before {
  content: "+";
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1;
}

.filters-more[open] > summary::before {
  content: "−";
}

.filters-more.has-active-filters > summary {
  border-color: #7aa6b0;
  background: #f0f9fa;
  color: #174f58;
}

.filters-more-count {
  color: #1d7880;
}

.filters-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.4rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e2e8f0;
}

#filters-wrap .filter-list-stacked {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.filters-clear-btn {
  flex: 0 0 auto;
  min-height: 1.9rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}

#filters-wrap .hotness-filter-row {
  grid-template-columns: minmax(80px, 1fr) 34px;
  align-items: center;
  min-height: 2rem;
}

#filters-wrap #archive-filter-select {
  width: 100%;
  height: 2rem;
}

@media (max-width: 980px) {
  .filters-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .filters-primary-grid,
  .filters-more-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters-secondary-row {
    align-items: stretch;
  }

  .filters-more > summary,
  .filters-clear-btn {
    min-height: 2.1rem;
  }

  #filters-wrap .filter-multiselect-menu {
    position: fixed;
    top: auto;
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    width: auto;
    max-width: none;
    max-height: 50vh;
    z-index: 120;
  }
}

/* Sous-éléments qui expliquent le match d'un filtre de tags en vue liste. */
.card-row-matches {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.28rem;
  margin: 0.15rem 0 0.05rem 1.35rem;
  padding-left: 0.7rem;
  border-left: 2px solid rgba(71, 85, 105, 0.24);
}

.card-row-matches-title {
  color: #526873;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.card-row-match {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  padding: 0.38rem 0.48rem;
  border: 1px solid rgba(148, 163, 184, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.card-row-match:hover,
.card-row-match:focus-visible {
  border-color: #7aa6b0;
  background: rgba(240, 249, 250, 0.94);
}

.card-row-match-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 6px;
  background: rgba(226, 232, 240, 0.82);
  color: #526873;
}

.card-row-match-body {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.card-row-match-label {
  overflow: hidden;
  color: #263c46;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-row-match-meta {
  overflow: hidden;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-row-match-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem;
  max-width: min(34vw, 320px);
}

.card-row-match-tags .card-tag {
  padding: 0.06rem 0.32rem;
  font-size: 0.65rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .card-row-matches {
    margin-left: 0.55rem;
    padding-left: 0.5rem;
  }

  .card-row-match {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .card-row-match-tags {
    grid-column: 2;
    justify-content: flex-start;
    max-width: 100%;
  }
}
.mobile-capture-dialog-article { width: min(680px, calc(100vw - 32px)); }
.mobile-capture-pairing, .mobile-capture-devices-section { padding: 4px 0 18px; }
.mobile-capture-pairing h3, .mobile-capture-devices-section h3 { margin-bottom: 6px; }
.mobile-capture-pairing p { color: var(--muted, #64748b); line-height: 1.5; }
.mobile-capture-pair-result { margin-top: 14px; padding: 14px; border: 1px solid #cde2d4; border-radius: 12px; background: #f2faf5; }
.mobile-capture-pair-result input { width: 100%; margin-bottom: 10px; }
.mobile-capture-qr-wrap { display: grid; justify-items: center; gap: 9px; margin: 2px 0 18px; text-align: center; }
.mobile-capture-qr { width: min(260px, 72vw); aspect-ratio: 1; padding: 10px; border: 1px solid #d5e4da; border-radius: 13px; background: #fff; }
.mobile-capture-qr svg { display: block; width: 100%; height: 100%; }
.mobile-capture-pair-code { padding: 8px 14px; border-radius: 9px; background: #10261a; color: #fff; font: 750 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.mobile-capture-pair-result .button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 13px; border-radius: 8px; background: #e2e8f0; color: inherit; text-decoration: none; }
.mobile-capture-devices { display: grid; gap: 8px; }
.mobile-capture-device { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid #dce5df; border-radius: 11px; }
.mobile-capture-device-info { display: grid; gap: 3px; }
.mobile-capture-device-info small { color: var(--muted, #64748b); }

.pings-meetings-list {
  display: grid;
  gap: 10px;
  padding: 4px 2px;
}

.mindee-ears-session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 13px 14px;
  border: 1px solid #dbe5ee;
  border-radius: 12px;
  background: #fff;
}

.mindee-ears-session-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mindee-ears-session-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mindee-ears-session-title-row strong,
.mindee-ears-session-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindee-ears-session-copy > span,
.mindee-ears-session-copy > small {
  color: var(--muted, #64748b);
}

.mindee-ears-session-status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 700;
}

.mindee-ears-session-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.mindee-ears-session-actions > button {
  flex: 0 1 auto;
  white-space: normal;
}

.mindee-ears-session-actions > button.mindee-ears-session-cancel-btn {
  background: #fef2f2 !important;
  color: #b42318 !important;
}

@media (max-width: 760px) {
  .mindee-ears-session-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .mindee-ears-session-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .mindee-ears-session-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .mindee-ears-session-actions > button {
    width: 100%;
  }
}
