/*
 * Charte du backoffice ChevalTV (tmp/design_handoff_backoffice_charte).
 * Écrite à la main, sans npm ni Tailwind compilé ; déclarée par UNFOLD["STYLES"].
 * Hors couche (@layer) : elle l'emporte sur les couches Tailwind d'Unfold 0.107.
 * Polices auto-hébergées (SIL Open Font License 1.1, voir fonts/OFL-*.txt) :
 * aucune requête vers un tiers.
 */

/* ---- Polices -------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/archivo-latin.92895abae7c5.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.288d2a1c9f04.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin.c008db4e8a97.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-ext.18e8ea957b6c.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.570751c5f8b4.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.e6155c5cfacf.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Jetons --------------------------------------------------------------- */

:root {
  --bo-paper: #F4F1EA;
  --bo-surface: #FFFDF8;
  --bo-thead: #F7F4EC;
  --bo-line: #E0DCD0;
  --bo-line-strong: #CFC9B9;
  --bo-line-hover: #A9A391;
  --bo-row: #ECE8DE;
  --bo-tag-line: #D6D1C3;
  --bo-ink: #14170F;
  --bo-text-2: #3A3F31;
  --bo-gray: #6B6F62;
  --bo-disabled-text: #8C8F84;
  --bo-disabled-bg: #E6E2D6;
  --bo-green: #1F3D2B;
  --bo-green-hover: #2A5039;
  --bo-green-active: #E6EBE3;
  --bo-green-select: #EEF2EC;
  --bo-green-soft: #9DB3A2;
  --bo-terracotta: #B8552F;
  --bo-success: #2F6B45;
  --bo-warning: #C08A2B;
  --bo-danger: #A3302A;
  --bo-danger-line: #E3B8B0;
  --bo-danger-hover: #F7E4E0;
  --bo-font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bo-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --bo-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Variables de thème d'Unfold (Tailwind 4) : toute l'interface passe en Archivo. */
  --font-sans: var(--bo-font);
  --font-mono: var(--bo-mono);
}

/* ---- Cadre Unfold ---------------------------------------------------------- */

body { font-family: var(--bo-font); -webkit-font-smoothing: antialiased; }
#main { background: var(--bo-paper); }
#main > div:first-child:has(#header-inner) { background: var(--bo-paper); border-color: var(--bo-line); }

/* Menu latéral : surface, 240 px, libellés de groupe en capitales mono. */
#nav-sidebar { background: var(--bo-surface); border-right: 1px solid var(--bo-line); }
#nav-sidebar-inner { background: var(--bo-surface); }
#nav-sidebar-inner a:has(> img) { display: inline-flex; align-items: center; gap: 10px; }
#nav-sidebar-inner a:has(> img) img { height: 34px; width: auto; margin-right: 0; }
#nav-sidebar-inner a:has(> img)::after {
  content: "backoffice";
  font-family: var(--bo-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bo-gray); border: 1px solid var(--bo-tag-line); border-radius: 3px; padding: 2px 5px;
}
#nav-sidebar-apps h2 {
  font-family: var(--bo-mono); font-size: 10px; font-weight: 400; letter-spacing: .14em;
  text-transform: uppercase; color: var(--bo-gray); margin-top: 14px;
}
#nav-sidebar-apps h2:hover { color: var(--bo-green); }
#nav-sidebar-apps ol { padding-left: 14px; padding-right: 14px; gap: 2px; }
#nav-sidebar-apps ol a {
  height: auto; min-height: 36px; margin: 0; padding: 8px 10px; border-radius: 6px;
  font-size: 14px; color: var(--bo-text-2); text-decoration: none;
}
#nav-sidebar-apps ol a:hover { color: var(--bo-green); background: var(--bo-paper); }
#nav-sidebar-apps ol a.active { background: var(--bo-green-active); color: var(--bo-green); font-weight: 600; }
#nav-sidebar-apps ol a > .material-symbols-outlined { display: none; }
#nav-sidebar-apps ol a:focus-visible { outline: 2px solid var(--bo-green); outline-offset: 1px; }

/* Menu toujours visible dès 900 px (maquette), rabattable en dessous comme dans Unfold. */
@media (min-width: 900px) {
  #page > .z-60 > div:first-child {
    display: block !important; position: relative !important; width: 240px !important; flex: none;
  }
  #nav-sidebar { width: 240px !important; }
  #nav-sidebar .cursor-col-resize { display: none; }
  #header-inner span.cursor-pointer:has([x-on\:click="sidebarToggle()"]),
  #header-inner span.cursor-pointer:has([x-on\:click="sidebarToggle()"]) + span.bg-base-200,
  #nav-sidebar-inner [x-on\:click="sidebarToggle()"] { display: none !important; }
  /* Pages opérateur : fil d'Ariane et titre sont dans la page, l'en-tête d'Unfold est superflu. */
  body.bo-operator .bo-unfold-header { display: none; }
  #main > .\@container { padding-left: 36px; padding-right: 36px; }
  #main > div:first-child:has(#header-inner) { padding-left: 36px; padding-right: 36px; }
}

/* Messages de Django : pages opérateur (.bo-messages) et pages d'Unfold (ses classes de message). */
.bo-messages { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.bg-green-100.text-green-700 { background: #EEF4EE; color: #1D4630; border: 1px solid #BFD3C2; border-radius: 8px; }
.bg-orange-100.text-orange-700 { background: #FBF3E2; color: #5E3F0B; border: 1px solid #E6CF9F; border-radius: 8px; }
.errornote.bg-red-100, .bg-red-100.text-red-700 {
  background: #FBEDEA; color: #7A241F; border: 1px solid var(--bo-danger-line); border-radius: 8px;
}
.bg-blue-100.text-blue-700 { background: var(--bo-surface); color: var(--bo-ink); border: 1px solid var(--bo-line); border-radius: 8px; }
.errors input, .errors select, .errors textarea { border-color: var(--bo-danger); box-shadow: 0 0 0 3px var(--bo-danger-hover); }
ul.errorlist, ul.errorlist li { color: #8A2A24; font-size: 12px; }

/* ---- Page, titres, fil d'Ariane ---------------------------------------------- */

.bo-page {
  display: flex; flex-direction: column; gap: 20px; padding: 28px 0 64px;
  color: var(--bo-ink); font-size: 14px; line-height: 1.55;
}
.bo-page--narrow { max-width: 820px; }
.bo-page--confirm { max-width: 760px; }
.bo-page--wide { max-width: 1180px; }
.bo-page p { margin: 0; }
.bo-page [hidden] { display: none !important; }
.bo-page a:not(.bo-btn), .bo-link, #content-main .readonly a:not(.bo-btn) {
  color: var(--bo-green); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--bo-green-soft);
}
.bo-page a:not(.bo-btn):hover, .bo-link:hover, #content-main .readonly a:not(.bo-btn):hover {
  color: var(--bo-terracotta); text-decoration-color: var(--bo-terracotta);
}
.bo-page a:not(.bo-btn):focus-visible, .bo-link:focus-visible {
  outline: 2px solid var(--bo-green); outline-offset: 2px; border-radius: 2px;
}

.bo-breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--bo-gray);
}
.bo-breadcrumb > span[aria-hidden] { color: var(--bo-gray); }
.bo-breadcrumb [aria-current] { color: var(--bo-ink); }

.bo-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.bo-head__title { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bo-h1, .bo-page h1 {
  font-family: var(--bo-serif); font-weight: 400; font-size: 38px; line-height: 1.05;
  color: var(--bo-ink); margin: 0; letter-spacing: 0; overflow-wrap: anywhere;
}
.bo-h1__muted { color: var(--bo-gray); }
.bo-h2, .bo-page h2 { font-family: var(--bo-font); font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0; }
.bo-h2 small, .bo-muted { font-size: 13px; font-weight: 400; color: var(--bo-gray); }
.bo-note { font-size: 12px; line-height: 1.5; color: var(--bo-gray); }
.bo-text-2 { color: var(--bo-text-2); }
.bo-mono { font-family: var(--bo-mono); font-size: 12px; overflow-wrap: anywhere; }
.bo-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.bo-live { font-size: 13px; color: var(--bo-gray); }
.bo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bo-row--end { justify-content: flex-end; }
.bo-row--spread { justify-content: space-between; align-items: baseline; gap: 12px; }
.bo-stack { display: flex; flex-direction: column; gap: 10px; }
.bo-stack--page { gap: 20px; }
.bo-grid-2 {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start;
}
.bo-grid-2--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bo-grid-2 > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1100px) { .bo-grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .bo-grid-2--even { grid-template-columns: minmax(0, 1fr); } }

/* ---- Cartes ------------------------------------------------------------------ */

.bo-card {
  background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 8px;
  padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0;
}
fieldset.bo-card { min-inline-size: 0; }
.bo-card > legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; }
.bo-card > legend + * { clear: both; }
.bo-card__foot { border-top: 1px solid var(--bo-row); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.bo-card__foot--row { flex-direction: row; flex-wrap: wrap; align-items: center; margin: 0; }
.bo-card--flush { padding: 0; gap: 0; overflow: hidden; }
.bo-card--flush > .bo-card__head { padding: 16px 20px 12px; }

/* ---- Boutons ----------------------------------------------------------------- */

.bo-btn {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--bo-line-strong);
  background: var(--bo-surface); color: var(--bo-ink);
  font-family: var(--bo-font); font-size: 14px; font-weight: 500; line-height: 1.2;
  text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.bo-btn:hover { background: var(--bo-paper); border-color: var(--bo-line-hover); color: var(--bo-ink); text-decoration: none; }
.bo-btn:focus-visible {
  outline: 2px solid var(--bo-green); outline-offset: 3px; box-shadow: 0 0 0 3px var(--bo-green-active);
}
.bo-btn--primary { background: var(--bo-green); border-color: var(--bo-green); color: var(--bo-paper); }
.bo-btn--primary:hover { background: var(--bo-green-hover); border-color: var(--bo-green-hover); color: var(--bo-paper); }
.bo-btn--danger { color: var(--bo-danger); border-color: var(--bo-danger-line); }
.bo-btn--danger:hover { background: var(--bo-danger-hover); border-color: var(--bo-danger-line); color: var(--bo-danger); }
.bo-btn--danger-solid { background: var(--bo-danger); border-color: var(--bo-danger); color: #FFFFFF; font-weight: 600; }
.bo-btn--danger-solid:hover { background: #8A2A24; border-color: #8A2A24; color: #FFFFFF; }
.bo-btn--danger:focus-visible, .bo-btn--danger-solid:focus-visible {
  outline-color: var(--bo-danger); box-shadow: 0 0 0 3px var(--bo-danger-hover);
}
.bo-btn--sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.bo-btn--lg { min-height: 40px; padding: 0 18px; font-weight: 600; }
.bo-btn--lg.bo-btn--secondary { padding: 0 14px; font-weight: 500; }
.bo-btn:disabled, .bo-btn[aria-disabled="true"] {
  background: var(--bo-disabled-bg); border-color: var(--bo-line); color: var(--bo-disabled-text);
  cursor: not-allowed;
}
.bo-table .bo-btn--sm { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.bo-actions-stack { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.bo-actions-stack .bo-btn { white-space: nowrap; }
.bo-inline-form { display: inline; margin: 0; }

/* ---- États, étiquettes ------------------------------------------------------- */

.bo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.35; background: #EFECE4; color: #4E5245;
  white-space: normal; overflow-wrap: normal; hyphens: manual; max-width: 100%;
}
.bo-badge::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bo-badge--online { background: #E3EDE3; color: #24553A; }
.bo-badge--online::before { background: var(--bo-success); }
.bo-badge--offline { background: #EFECE4; color: #4E5245; }
.bo-badge--offline::before { background: transparent; border: 1.5px solid var(--bo-disabled-text); box-sizing: border-box; }
.bo-badge--capture { background: #F6E6DC; color: #8E3F1F; }
.bo-badge--capture::before { background: var(--bo-terracotta); }
.bo-badge--pending { background: #F6ECD7; color: #77500F; }
.bo-badge--pending::before { background: var(--bo-warning); }
.bo-badge--failed { background: var(--bo-danger-hover); color: #8A2A24; }
.bo-badge--failed::before { background: var(--bo-danger); }

.bo-tag {
  display: inline-flex; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--bo-tag-line);
  font-family: var(--bo-mono); font-size: 11px; color: var(--bo-text-2); overflow-wrap: normal; hyphens: none;
  max-width: 100%;
}

/* ---- Messages ------------------------------------------------------------- */

.bo-alert {
  border: 1px solid var(--bo-line); border-radius: 8px; padding: 12px 16px; font-size: 14px; line-height: 1.55;
  background: var(--bo-surface); color: var(--bo-ink); display: flex; flex-direction: column; gap: 8px; margin: 0;
}
.bo-alert--success { border-color: #BFD3C2; background: #EEF4EE; color: #1D4630; }
.bo-alert--warning { border-color: #E6CF9F; background: #FBF3E2; color: #5E3F0B; }
.bo-alert--error { border-color: var(--bo-danger-line); background: #FBEDEA; color: #7A241F; }
.bo-alert--error.bo-alert--strong { color: #5C1D19; }
.bo-alert__title { font-weight: 600; font-size: 14px; }
.bo-alert ul { margin: 0; padding-left: 1.2em; }
.bo-alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bo-alert-list > li {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: var(--bo-text-2);
}
.bo-alert-list .bo-note { color: var(--bo-gray); }

/* ---- Tableaux ---------------------------------------------------------------- */

.bo-table-wrap {
  background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 8px; overflow-x: auto;
  container-type: inline-size;
}
.bo-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; color: var(--bo-ink); }
.bo-table th {
  text-align: left; padding: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--bo-gray); background: var(--bo-thead); border-bottom: 1px solid var(--bo-line);
  overflow-wrap: normal; hyphens: auto; vertical-align: bottom;
}
.bo-table td {
  padding: 10px; vertical-align: middle; border-bottom: 1px solid var(--bo-row);
  overflow-wrap: break-word; hyphens: auto;
}
.bo-table tbody tr:last-child td { border-bottom: 0; }
.bo-table--workers { table-layout: fixed; }
/* Largeurs : 86 % répartis + 112 px d'actions, jamais plus large que le tableau. */
.bo-table--workers th:nth-child(1) { width: 14%; }
.bo-table--workers th:nth-child(2) { width: 12%; }
.bo-table--workers th:nth-child(3) { width: 10%; }
.bo-table--workers th:nth-child(4) { width: 9%; }
.bo-table--workers th:nth-child(5), .bo-table--workers th:nth-child(6) { width: 9%; }
.bo-table--workers th:nth-child(7) { width: 10%; }
.bo-table--workers th:nth-child(8) { width: 13%; }
.bo-table--workers th:nth-child(9) { width: 112px; }
.bo-table--workers td:nth-child(3), .bo-table--workers td:nth-child(4), .bo-table--workers td:nth-child(7) { color: var(--bo-text-2); }
.bo-table--workers td:nth-child(8) { font-family: var(--bo-mono); font-size: 11px; color: var(--bo-text-2); overflow-wrap: anywhere; hyphens: none; }
/* Découpage (15.0) : l’étiquette « Horses n Competitions » se coupe avec césure dans la colonne étroite ;
 * canal, décalage et bascule sont sur les lignes dessous (bo-cell-sub). */
.bo-table--workers td:nth-child(6) .bo-tag { overflow-wrap: anywhere; hyphens: auto; }
@container (max-width: 1000px) {
  .bo-table--workers th, .bo-table--workers td { padding: 8px 6px; }
}
/* Tableau trop étroit pour 9 colonnes lisibles (menu latéral + 900 px) : une carte par worker,
 * les 9 cellules restant séparées, chacune avec son intitulé ; jamais de défilement horizontal. */
@container (max-width: 860px) {
  .bo-table--workers, .bo-table--workers tbody, .bo-table--workers tr { display: block; width: auto; }
  .bo-table--workers thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .bo-table--workers tr { padding: 12px 14px; border-bottom: 1px solid var(--bo-row); }
  .bo-table--workers tbody tr:last-child { border-bottom: 0; }
  .bo-table--workers td {
    display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 2px 12px; align-items: baseline;
    padding: 4px 0; border: 0; overflow-wrap: anywhere;
  }
  .bo-table--workers td::before { font-size: 11px; font-weight: 600; color: var(--bo-gray); }
  .bo-table--workers td:nth-child(1) { display: block; padding-bottom: 6px; }
  .bo-table--workers td:nth-child(2)::before { content: "État"; }
  .bo-table--workers td:nth-child(3)::before { content: "Capture"; }
  .bo-table--workers td:nth-child(4)::before { content: "Pilote"; }
  .bo-table--workers td:nth-child(5)::before { content: "Entrée"; }
  .bo-table--workers td:nth-child(6)::before { content: "Découpage"; }
  .bo-table--workers td:nth-child(7)::before { content: "Hébergement"; }
  .bo-table--workers td:nth-child(8)::before { content: "Lien d’envoi"; font-family: var(--bo-font); }
  .bo-table--workers td:nth-child(9) { display: block; padding-top: 8px; }
  .bo-table--workers td:nth-child(9) .bo-actions-stack { flex-direction: row; flex-wrap: wrap; }
  .bo-table--workers td.bo-empty { display: block; }
  .bo-table--workers td:not(:nth-child(1)):not(:nth-child(9)) > * { grid-column: 2; justify-self: start; }
}
.bo-cell-title { font-weight: 600; }
.bo-cell-sub { font-size: 12px; color: var(--bo-gray); margin-top: 2px; }
.bo-empty { padding: 14px 10px; color: var(--bo-text-2); }

/* Liste de définitions, journal, étapes ---------------------------------------- */

.bo-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.bo-dl dt { color: var(--bo-gray); }
.bo-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bo-dl dd.bo-mono { font-size: 12px; }
@media (max-width: 480px) { .bo-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .bo-dl dd { margin-bottom: 8px; } }

.bo-log {
  margin: 0; max-height: 220px; overflow: auto; background: var(--bo-ink); color: #DCE4DA; border-radius: 6px;
  padding: 12px 14px; font-family: var(--bo-mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bo-log:focus-visible { outline: 2px solid var(--bo-green); outline-offset: 2px; }
/* 17.0 (BUG-071) : heure du concours en tête de ligne, instant UTC au survol. */
.bo-log__at { color: var(--bo-green-soft); cursor: help; }

.bo-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bo-events > li {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 8px 0;
  border-top: 1px solid var(--bo-row); font-size: 14px;
}
.bo-events time, .bo-events .bo-events__at { font-family: var(--bo-mono); font-size: 12px; color: var(--bo-gray); }
.bo-events .bo-events__stage { font-family: var(--bo-mono); font-size: 11px; color: var(--bo-gray); }
.bo-events .bo-log { grid-column: 1 / -1; }
@media (max-width: 480px) { .bo-events > li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.bo-timeline {
  list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr); gap: 6px;
}
.bo-timeline li { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.3; color: var(--bo-gray); overflow-wrap: anywhere; hyphens: auto; }
.bo-timeline li::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--bo-line); }
.bo-timeline li.done { color: var(--bo-text-2); }
.bo-timeline li.done::before { background: var(--bo-green-soft); }
.bo-timeline li.current { color: var(--bo-ink); font-weight: 600; }
.bo-timeline li.current::before { background: var(--bo-green); }
.bo-timeline li.failed { color: #8A2A24; font-weight: 600; }
.bo-timeline li.failed::before { background: var(--bo-danger); }
@media (max-width: 1100px) { .bo-timeline { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 12px; } }
@media (max-width: 640px) { .bo-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.bo-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bo-check { display: flex; gap: 8px; align-items: baseline; }
.bo-check::before { flex: none; font-weight: 700; width: 1em; }
.bo-check--ok::before { content: "✓"; color: var(--bo-success); }
.bo-check--ko::before { content: "✗"; color: var(--bo-danger); }
.bo-check__reason { color: var(--bo-gray); }

.bo-state-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.bo-state-grid > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bo-state-grid dt, .bo-label-sm { font-size: 12px; color: var(--bo-gray); }
.bo-state-grid dd { margin: 0; }

.bo-free-track {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--bo-row);
}
.bo-free-track .bo-cell-title { font-size: 14px; }

.bo-code {
  display: inline-block; font-family: var(--bo-mono); font-size: 28px; font-weight: 500; letter-spacing: .12em;
  background: var(--bo-thead); border: 1px solid var(--bo-line); border-radius: 6px; padding: 10px 16px;
  color: var(--bo-ink); user-select: all;
}
.bo-masked {
  font-family: var(--bo-mono); font-size: 13px; background: var(--bo-thead); border: 1px solid var(--bo-line);
  border-radius: 6px; padding: 9px 12px; overflow-wrap: anywhere;
}
.bo-commands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bo-commands li { padding: 6px 0; border-top: 1px solid var(--bo-row); font-size: 13px; }

/* ---- Champs ----------------------------------------------------------------- */

.bo-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.bo-input {
  box-sizing: border-box; height: 36px; border: 1px solid var(--bo-line-strong); border-radius: 6px;
  background: #FFFFFF; padding: 0 10px; font-family: var(--bo-font); font-size: 14px; font-weight: 400;
  color: var(--bo-ink); width: 100%; max-width: 100%;
}
.bo-input--mono { font-family: var(--bo-mono); font-size: 13px; height: 38px; max-width: 360px; }
.bo-input[readonly] { background: var(--bo-thead); }
.bo-input:focus, .bo-input:focus-visible, .bo-select:focus-visible {
  outline: 2px solid var(--bo-green); outline-offset: 1px; border-color: var(--bo-green);
  box-shadow: 0 0 0 3px var(--bo-green-active);
}
.bo-input[aria-invalid="true"] { border-color: var(--bo-danger); box-shadow: 0 0 0 3px var(--bo-danger-hover); }
.bo-field__error { font-size: 12px; font-weight: 400; color: #8A2A24; }
.bo-select {
  box-sizing: border-box; height: 36px; border: 1px solid var(--bo-line-strong); border-radius: 6px;
  background-color: #FFFFFF; padding: 0 8px; font-family: var(--bo-font); font-size: 14px; color: var(--bo-ink);
  min-width: 220px; max-width: 100%;
}
.bo-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.bo-filter label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--bo-text-2); }
.bo-copy { display: flex; gap: 8px; }
.bo-copy .bo-input { flex: 1; min-width: 0; font-family: var(--bo-mono); font-size: 12px; }

/* Radios en carte (taille du Droplet) et radios simples (entrée, découpage). */
.bo-radio-card {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--bo-line); background: #FFFFFF;
}
.bo-radio-card:has(input:checked) { border-color: var(--bo-green); background: var(--bo-green-select); }
.bo-radio-card__body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.bo-radio-card__line { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--bo-text-2); }
.bo-radio-card__line strong { font-family: var(--bo-mono); font-size: 13px; color: var(--bo-ink); }
.bo-radio-card__price { text-align: right; font-size: 13px; white-space: nowrap; display: flex; flex-direction: column; }
.bo-radio-card__price span { color: var(--bo-gray); font-size: 12px; }
.bo-radio, .bo-radio-card input[type="radio"], .bo-choice input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--bo-line-hover); background: #FFFFFF; cursor: pointer;
}
.bo-radio-card input[type="radio"]:checked, .bo-choice input[type="radio"]:checked { border: 5px solid var(--bo-green); }
.bo-radio-card input[type="radio"]:focus-visible, .bo-choice input[type="radio"]:focus-visible {
  outline: 2px solid var(--bo-green); outline-offset: 2px;
}
.bo-choice input[type="radio"]:disabled { border-color: var(--bo-line); background: var(--bo-disabled-bg); cursor: not-allowed; }
.bo-choice { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.bo-choice--disabled { color: var(--bo-disabled-text); }

/* ---- Charte vivante (/operator/charte/, DEC-141) ------------------------------ */

.bo-swatches {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.bo-swatch { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; }
.bo-swatch__chip { display: block; height: 44px; border-radius: 6px; border: 1px solid var(--bo-line); margin-bottom: 4px; }
.bo-example { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; padding-top: 12px; border-top: 1px solid var(--bo-row); }
.bo-example__label { padding-top: 4px; }
.bo-example__render { min-width: 0; }
.bo-example__code {
  grid-column: 2; margin: 0; padding: 10px 12px; background: var(--bo-thead); border: 1px solid var(--bo-line);
  border-radius: 6px; font-family: var(--bo-mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: anywhere; color: var(--bo-text-2);
}
.bo-card > .bo-example__code { grid-column: auto; }
@media (max-width: 640px) { .bo-example { grid-template-columns: minmax(0, 1fr); } .bo-example__code { grid-column: 1; } }

/* ---- Formulaires d'administration (fiche concours et autres) ------------------ */

#content-main fieldset.module {
  background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 8px; padding: 16px 20px 6px;
}
#content-main fieldset.module > h2, #content-main fieldset.module > div > h2,
#content-main fieldset.module h2.bg-base-100 {
  background: transparent; font-family: var(--bo-font); font-size: 17px; font-weight: 600; color: var(--bo-ink);
  padding: 0; margin: 0 0 12px; height: auto; border: 0;
}
#content-main fieldset.module > div > .border { border-color: transparent; box-shadow: none; background: transparent; }
#submit-row .absolute.inset-0 { background: rgba(244, 241, 234, .95); }
#submit-row > div { border-color: var(--bo-line); }
#submit-row button, #submit-row a {
  min-height: 36px; border-radius: 6px; font-family: var(--bo-font); font-size: 14px; font-weight: 500;
  background: var(--bo-surface); border: 1px solid var(--bo-line-strong); color: var(--bo-ink); box-shadow: none;
}
#submit-row button:hover, #submit-row a:hover { background: var(--bo-paper); border-color: var(--bo-line-hover); }
#submit-row button[name="_save"] { background: var(--bo-green); border-color: var(--bo-green); color: var(--bo-paper); font-weight: 600; }
#submit-row button[name="_save"]:hover { background: var(--bo-green-hover); }
#submit-row button:focus-visible, #submit-row a:focus-visible {
  outline: 2px solid var(--bo-green); outline-offset: 3px; box-shadow: 0 0 0 3px var(--bo-green-active);
}

/* Fiche concours : titre en Instrument Serif, libellés au-dessus des champs, grille de la maquette. */
.bo-admin-title { margin: 4px 0 20px; }
body.model-competition.change-form #content-main fieldset.module .form-rows {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; border: 0;
}
body.model-competition.change-form #content-main fieldset.module .form-rows > div { border: 0; padding: 0; }
body.model-competition.change-form #content-main fieldset.module .form-rows > div > div {
  flex-direction: column; align-items: stretch; gap: 6px; padding: 0; border: 0; min-height: 0;
}
body.model-competition.change-form #content-main fieldset.module .form-rows > div > div > div:first-child {
  width: auto; min-width: 0; height: auto; line-height: 1.4;
}
body.model-competition.change-form #content-main fieldset.module .form-rows label.block {
  width: auto; font-size: 13px; font-weight: 500; color: var(--bo-ink); padding: 0; margin: 0;
}
body.model-competition.change-form #content-main .form-rows > div:has(.image-crop) { grid-column: 1 / -1; }
body.model-competition.change-form #content-main .form-rows > div:has(.bo-datetime) { grid-column: span 1; }

/* Publication : deux radios en pastille. */
body #id_publication { flex-direction: row; flex-wrap: wrap; gap: 8px; }
body #id_publication > div { flex: none; }
body #id_publication label {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--bo-line-strong); background: #FFFFFF; font-size: 14px; font-weight: 400; cursor: pointer;
}
body #id_publication label .truncate { overflow: visible; }
body #id_publication label:has(input:checked) { border-color: var(--bo-green); background: var(--bo-green-select); }
body #id_publication input[type="radio"] {
  -webkit-appearance: none; appearance: none; width: 16px; min-width: 16px; height: 16px; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--bo-line-hover); background: #FFFFFF;
}
body #id_publication input[type="radio"]::after { display: none; }
body #id_publication input[type="radio"]:checked { border: 5px solid var(--bo-green); }
body #id_publication input[type="radio"]:focus-visible { outline: 2px solid var(--bo-green); outline-offset: 2px; }

/* Début et fin : date puis heure, raccourcis « Aujourd’hui » / « Maintenant » en liens sous les champs. */
.bo-datetime { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; align-items: start; }
.bo-datetime .min-w-56, .bo-datetime .min-w-52 { min-width: 0; }
.bo-datetime input { width: 100%; }
.bo-datetime .datetimeshortcuts {
  position: static; display: flex; flex-direction: row; align-items: center; gap: 10px; margin-top: 6px; font-size: 0;
}
.bo-datetime .datetimeshortcuts a {
  display: inline-flex; height: auto; font-size: 12px; font-weight: 400; color: var(--bo-green);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bo-green-soft);
}
.bo-datetime .datetimeshortcuts a:first-child { display: inline-flex; }
.bo-datetime .datetimeshortcuts a:first-child::after { content: none; display: none; }
.bo-datetime .datetimeshortcuts a:hover { color: var(--bo-terracotta); }
.bo-datetime .datetimeshortcuts a:focus-visible { outline: 2px solid var(--bo-green); outline-offset: 2px; }
/* Icône calendrier / horloge (fenêtre de choix de l'admin) : dans le champ, comme dans Unfold. */
.bo-datetime .datetimeshortcuts a:not(:first-child) {
  position: absolute; top: 1px; right: 1px; height: 34px; padding: 0 8px; align-items: center;
  text-decoration: none; color: var(--bo-gray);
}
.bo-datetime input { padding-right: 34px; }

/* Pistes (inline tabulaire) : en-tête en capitales, pas de titre répété au-dessus de chaque ligne. */
#tracks-group th {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--bo-gray);
  background: var(--bo-thead);
}
#tracks-group .formset-wrapper { border-color: var(--bo-line); box-shadow: none; }
#tracks-group tbody.original > tr:first-child p { display: none; }
#tracks-group td.field-association { vertical-align: middle; }
.bo-track-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Section Workers de la fiche concours (après les pistes). */
.bo-competition-workers { margin-top: 24px; font-size: 14px; }
/* Clip page (19.0): publication, download, archive above the form. */
.bo-clip-publication { margin-bottom: 24px; font-size: 14px; }
.bo-inline-form { display: contents; }
#result_list .bo-badge { white-space: nowrap; }

/* ---- Écrans étroits ------------------------------------------------------------ */

@media (max-width: 640px) {
  .bo-page { padding: 12px 0 32px; }
  .bo-h1, .bo-page h1 { font-size: 32px; }
  .bo-card { padding: 14px 16px; }
  .bo-radio-card { flex-wrap: wrap; }
  .bo-radio-card__price { text-align: left; }
}
