/* ============================================================
   Protocole — feuille de style unique
   ============================================================ */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #eef1f8;
  --border:    #dfe4ef;
  --text:      #16192b;
  --text-soft: #5d6480;
  --accent:    #3d5afe;
  --accent-ink:#ffffff;
  --free:      #12a150;
  --busy:      #e5484d;
  --soon:      #f5a524;
  --shadow:    0 1px 2px rgba(16,20,45,.06), 0 8px 24px rgba(16,20,45,.07);
  --radius:    14px;
  --slot-h:    56px;   /* hauteur d'une heure dans le planning */
}

:root[data-theme="dark"] {
  --bg:        #0e1017;
  --surface:   #171a24;
  --surface-2: #1f2331;
  --border:    #2a2f40;
  --text:      #eceefb;
  --text-soft: #9aa2bd;
  --accent:    #7b8cff;
  --accent-ink:#0e1017;
  --free:      #30c46b;
  --busy:      #ff6369;
  --soon:      #ffc453;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }

/* ---------------------------- Barre haute --------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 19px;
}

.brand h1 { font-size: 17px; letter-spacing: -.01em; }
.brand-sub { margin: 1px 0 0; font-size: 12px; color: var(--text-soft); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 11px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,20,45,.1);
}

.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

/* ------------------------------ Boutons ----------------------------- */
.btn {
  font: inherit;
  font-size: 14px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 8px 12px; font-size: 17px; line-height: 1; }
.btn-danger { background: transparent; color: var(--busy); border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--busy) 12%, transparent); }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* ---------------------------- Barre de date ------------------------- */
.datebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.datebar input[type="date"] {
  font: inherit;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  color-scheme: light dark;
}

.datebar-label {
  display: inline-block;
  color: var(--text-soft);
  font-size: 14px;
}
.datebar-label::first-letter { text-transform: uppercase; }

/* ------------------------------- Vues ------------------------------- */
main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 18px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.hint { color: var(--text-soft); font-size: 13px; margin: 12px 2px 0; }

/* ----------------------------- Statistiques ------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.stat.free  .stat-value { color: var(--free); }
.stat.busy  .stat-value { color: var(--busy); }

/* ---------------------------- Grille salles ------------------------- */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.room-card {
  /* Un <button> centre son contenu verticalement quel que soit son display :
     on impose une colonne flex pour aligner toutes les cartes en haut. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(16,20,45,.08), 0 14px 32px rgba(16,20,45,.1); }
.room-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--room-color, var(--accent));
}

.room-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.room-card h3 { font-size: 16.5px; }

/* Identité d'une salle : pictogramme + nom, alignés en haut pour que le
   dessin ne flotte pas quand le lieu passe sur deux lignes. */
.room-ident { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.room-icon {
  flex: none;
  width: 34px; height: 34px;
  color: var(--room-color, var(--accent));
}
.detail-head .room-icon { width: 42px; height: 42px; }
.room-meta { font-size: 13px; color: var(--text-soft); margin-top: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.free { color: var(--free); background: color-mix(in srgb, var(--free) 14%, transparent); }
.badge.busy { color: var(--busy); background: color-mix(in srgb, var(--busy) 14%, transparent); }
.badge.soon { color: var(--soon); background: color-mix(in srgb, var(--soon) 18%, transparent); }

.room-status { margin-top: 12px; font-size: 13.5px; }
.room-status strong { font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
}

/* mini-barre d'occupation de la journée */
.occupancy {
  position: relative;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.occupancy span {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--room-color, var(--accent));
  opacity: .85;
}
.occupancy .now {
  background: var(--text);
  width: 2px;
  opacity: .55;
}

/* ------------------------------ Planning ---------------------------- */
.planning-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

.timeline {
  display: grid;
  grid-template-columns: 64px repeat(var(--cols, 1), minmax(170px, 1fr));
  min-width: fit-content;
}

.tl-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-left: 1px solid var(--border);
}
.tl-head.corner { border-left: 0; }
.tl-head small { display: block; font-weight: 400; color: var(--text-soft); font-size: 12px; }
.tl-head .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--room-color, var(--accent));
}

.tl-hours, .tl-col { margin: 12px 0; }   /* évite de rogner le premier et le dernier libellé */

.tl-hours { position: relative; }
.tl-hour-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11.5px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.tl-col {
  position: relative;
  border-left: 1px solid var(--border);
  cursor: crosshair;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0, var(--border) 1px,
    transparent 1px, transparent var(--slot-h)
  );
}

.tl-booking {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  color: #fff;
  background: var(--room-color, var(--accent));
  overflow: hidden;
  cursor: pointer;
  border: 0;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tl-booking:hover { filter: brightness(1.07); }
.tl-booking b { display: block; font-weight: 600; font-size: 12.5px; }
.tl-booking span { opacity: .85; font-variant-numeric: tabular-nums; }

.tl-now {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--busy);
  z-index: 4;
  pointer-events: none;
}
.tl-now::before {
  content: "";
  position: absolute;
  left: -4px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--busy);
}

/* ------------------------- Semaine, mois, année ---------------------- */

/* Colonne du jour courant, dans la semaine comme dans le mois. */
.tl-head.is-today { color: var(--accent); }
.tl-col.is-week { cursor: pointer; }
/* Les blocs de la semaine posent eux-mêmes leur largeur : la marge droite
   héritée du planning du jour les décalerait. */
.tl-col.is-week .tl-booking { right: auto; margin-left: 3px; }
/* Une colonne partagée devient étroite : mieux vaut couper net en fin de
   ligne que laisser le texte se faire trancher au milieu d'un mot. Le
   libellé complet reste dans l'infobulle. */
.tl-col.is-week .tl-booking b,
.tl-col.is-week .tl-booking span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grille mensuelle : sept colonnes, une ligne par semaine. */
.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.cal-dow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 2px 4px 6px;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  min-height: 104px;
  padding: 7px 7px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.is-weekend { background: var(--surface-2); }
.cal-cell.is-out { border-style: dashed; opacity: .35; cursor: default; min-height: 0; }
.cal-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.cal-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cal-cell.is-today .cal-num { color: var(--accent); }

.cal-chip {
  display: block;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11.5px;
  color: #fff;
  background: var(--room-color, var(--accent));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.cal-more { font-size: 11px; color: var(--text-soft); }

/* Grille annuelle : douze mini-mois, une case par jour. */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.ymonth {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px 14px;
}
.ymonth h3 {
  margin: 0 0 10px;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ymonth h3::first-letter { text-transform: uppercase; }
.ymonth h3 small { font-weight: 400; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.ycells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.ydow {
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-soft);
}

.ycell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0;
  background: var(--surface-2);
  cursor: pointer;
}
.ycell.is-out { border: 0; background: none; cursor: default; }
.ycell:hover:not(.is-out) { outline: 2px solid var(--accent); outline-offset: 1px; }
.ycell.is-today { border-color: var(--accent); }

/* Quatre paliers d'occupation, du plus calme au plus chargé. */
.ycell.n1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.ycell.n2 { background: color-mix(in srgb, var(--accent) 52%, var(--surface-2)); }
.ycell.n3 { background: color-mix(in srgb, var(--accent) 76%, var(--surface-2)); }
.ycell.n4 { background: var(--accent); }

/* ------------------------ Demandes et formulaire --------------------- */

/* Compteur de demandes en attente, porté par l'onglet. */
.tab-count {
  display: inline-block;
  margin-left: 7px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--soon);
  color: #1c1400;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
/* `display` explicite ci-dessus : sans cette règle, [hidden] ne masquerait
   plus le compteur quand aucune demande n'attend. */
.tab-count[hidden] { display: none; }

/* Une demande en attente n'occupe pas encore la salle : on la montre en
   creux, pour qu'on ne la confonde pas avec un créneau accordé. */
.tl-booking.is-demandee,
.cal-chip.is-demandee {
  background: repeating-linear-gradient(
    135deg,
    var(--room-color, var(--accent)) 0 6px,
    color-mix(in srgb, var(--room-color, var(--accent)) 55%, #000) 6px 12px
  );
  opacity: .82;
}

.badge.statut-demandee { background: var(--soon); color: #1c1400; }
.badge.statut-validee  { background: var(--free); color: #fff; }
.badge.statut-refusee  { background: var(--busy); color: #fff; }

.demande {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--room-color, var(--accent));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.demande-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.demande-head h3 { margin: 0 0 4px; font-size: 16px; }
.demande-meta { margin: 0; color: var(--text-soft); font-size: 13px; }

.demande-etat { display: flex; align-items: center; gap: 10px; flex: none; }
.numero {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-soft);
}

.demande-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  margin: 14px 0 12px;
}
.demande-detail dt {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.demande-detail dd { margin: 2px 0 0; font-size: 13.5px; }

.demande-vide { margin: 0; font-size: 13px; color: var(--text-soft); }
.demande-avis {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 13.5px;
}
.demande .row-actions { margin-top: 14px; }

#demandes-filtres .btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Le formulaire long : des blocs titrés, comme sur le papier. */
.modal-lg { max-width: 780px; }

.modal-numero {
  margin: -6px 0 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-soft);
}

.form-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0 0 14px;
}
.form-block legend {
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.field i { font-style: normal; color: var(--text-soft); font-weight: 400; }
.field-wide { flex: 2 1 240px; }

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px 14px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.form-note { margin: 12px 0 0; font-size: 12.5px; color: var(--text-soft); }
.form-note span { display: block; }
.form-note span + span { margin-top: 3px; }

.form-warn {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--soon) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--soon) 45%, var(--surface));
  font-size: 13px;
}

/* ------------------------------- Tableau ---------------------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 9px;
  background: var(--room-color, var(--accent));
}

/* ---------------------------- Détail salle -------------------------- */
.back { margin-bottom: 16px; }

.detail-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.detail-head h2 { font-size: 21px; }

.agenda-day { margin-bottom: 18px; }
.agenda-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.agenda-date::first-letter { text-transform: uppercase; }
.agenda-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  margin-bottom: 7px;
}
.agenda-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13.5px;
  min-width: 108px;
}
.agenda-body { flex: 1; min-width: 0; }
.agenda-body b { display: block; font-size: 14px; }
.agenda-body small { color: var(--text-soft); }

/* ------------------------------ Modales ----------------------------- */
.modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.modal::backdrop { background: rgba(10,12,22,.5); backdrop-filter: blur(2px); }
.modal form { padding: 22px; }
.modal h2 { font-size: 18px; margin-bottom: 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field > span small { font-weight: 400; color: var(--text-soft); }
.field input, .field select {
  width: 100%;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  color-scheme: light dark;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { border-color: var(--text); transform: scale(1.12); }

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--busy);
  background: color-mix(in srgb, var(--busy) 12%, transparent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
}

/* ----------------------------- Responsive --------------------------- */
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; gap: 12px; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; }
  .datebar { padding: 10px 16px; }
  main { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .agenda-item { flex-wrap: wrap; }
}

/* ------------------------- Indicateur de mode ----------------------- */
.mode-badge {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: help;
}
.mode-badge.local  { color: var(--text-soft); background: var(--surface-2); }
.mode-badge.remote { color: var(--free); background: color-mix(in srgb, var(--free) 14%, transparent); }
.mode-badge.error  { color: var(--busy); background: color-mix(in srgb, var(--busy) 14%, transparent); }
