/* Charte des chauffeurs à deux niveaux (chartes.js, owner 2026-11-28, maquette design-lab/charte-deux-niveaux-maquette.html) */

/* Pastilles (version, état, règle changée) */
.chx-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; background: var(--panel-2); color: var(--muted); vertical-align: 2px; }
.chx-chip.live { background: var(--green-soft); color: var(--green); }
.chx-chip.late { background: var(--red-soft); color: var(--red); }
.chx-chip.gold { background: var(--gold-soft); color: var(--text); }
.chx-ch { margin-left: 6px; }
.chx-was { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.chx-was s { text-decoration-color: var(--red); }
.chr-end .chx-was, .chr-end .chx-was s { color: rgba(255, 255, 255, .85); }
.chr-end .chx-chip.gold { background: #fff; color: var(--text); }

/* Retour à « Mes chartes » */
.chx-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 2px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .3s; }
.chx-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .chx-back:hover { color: var(--text); } }
.chr-hico.app { background: var(--text); color: var(--gold); }
.chr-hico.app svg { stroke: var(--gold); }

/* Mes chartes : une ligne par charte */
/* Mes chartes : titre de la page puis 10 px, puis la carte ChauffApp, sans titre « ChauffApp » (owner, 2026-12-03) */
.chx-h1:has(+ .chx-doc) { margin-bottom: 0; }
.chx-h1 + .chx-doc { margin-top: 2px; }   /* + 8 px de gap de .chr = 10 px */
html.dt .chr > .chx-h1 + .chx-doc { margin-top: -2px; }   /* + 12 px de gap (sitelook.css) = 10 px */
.chx-gt { margin: 18px 0 2px; font-size: 15px; font-weight: 700; color: var(--text); }
.chx-doc { display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: border-color .3s, background .3s; }
.chx-doc.todo { border-color: var(--red); background: var(--red-soft); }
@media (hover: hover) { .chx-doc:hover { border-color: var(--text); } }
.chx-av { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); font-size: 17px; font-weight: 800; color: var(--text); }
.chx-av.app { background: var(--text); }
.chx-av svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chx-tx { flex: 1; min-width: 0; }
.chx-tx b { display: block; font-size: 15px; font-weight: 700; }
.chx-tx span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.chx-st { flex: none; display: flex; align-items: center; gap: 10px; }
.chx-go { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; }
.chx-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) {
  .chx-doc { flex-wrap: wrap; }
  .chx-st { width: 100%; justify-content: space-between; padding-left: 58px; box-sizing: border-box; }
}

/* Conditions ChauffApp : règles signées sur fond vert clair, comme la charte signée */
.chx-terms { display: flex; flex-direction: column; gap: 8px; }
.chx-terms .chr-r { cursor: default; }
.chx-terms .chr-ic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Réglages › Charte des chauffeurs */
.chx-ed { display: flex; flex-direction: column; gap: 14px; }
.chx-ed-d { margin: 0; }
.chx-ed-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chx-ed-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.chx-ed .chx-meta { margin-top: -4px; }
.chx-seg button { cursor: pointer; white-space: nowrap; }
.chx-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .chx-cols { grid-template-columns: 1fr; } }
.chx-sec { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; box-sizing: border-box; }
.chx-sec b { flex: 1; font-size: 15px; font-weight: 700; }
.chx-sec-body { padding: 4px 0 18px; }
.chx-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.chx-row.off .chx-rt b, .chx-row.off .chx-rt > span { opacity: .5; }
.chx-rt { flex: 1; min-width: 0; }
.chx-rt b { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.chx-rt > span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.chx-end-t { display: block; font-size: 14px; line-height: 1.5; }
.chx-fix { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.chx-fix svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chx-ia { flex: none; display: flex; align-items: center; gap: 2px; }
.chx-sw { display: inline-flex; align-items: center; margin-right: 6px; cursor: pointer; }
.chx-ib { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: background .3s, color .3s; }
.chx-ib svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .chx-ib:hover { background: var(--text); color: var(--bg); } .chx-ib.del:hover { background: var(--red); color: #fff; } }
.chx-row.editing { display: block; padding: 16px 0; }
.chx-row.editing .f + .f { margin-top: 14px; }
.chx-row-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.chx-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.chx-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chx-add span { border-bottom: 1.5px solid var(--gold); transition: border-color .3s; }
@media (hover: hover) { .chx-add:hover span { border-color: var(--text); } }
.chx-side { display: flex; flex-direction: column; gap: 18px; padding-top: 10px; }
.chx-box { position: relative; padding: 18px 16px 16px; border: 1.5px solid var(--line); border-radius: 14px; }
.chx-bt { position: absolute; top: -10px; left: 12px; padding: 0 6px; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.chx-box p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.chx-box .btn { margin-top: 12px; width: 100%; }
.chx-big { font-size: 26px; font-weight: 800; line-height: 1; }
.chx-big small { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chx-meter { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 10px 0; }
.chx-meter i { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* Qui a signé */
.chx-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chx-f { padding: 7px 13px; border: 0; border-radius: 11px; background: var(--panel-2); color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .3s, color .3s; }
.chx-f.on { background: var(--text); color: var(--bg); }
@media (hover: hover) { .chx-f:not(.on):hover { background: var(--text); color: var(--bg); } }
.chx-tbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.chx-tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 10px 10px; border-bottom: 1.5px solid var(--line); }
.chx-tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.chx-tbl th:first-child, .chx-tbl td:first-child { padding-left: 0; }
.chx-tbl th:last-child, .chx-tbl td:last-child { padding-right: 0; text-align: right; }
.chx-tbl .nm { font-weight: 700; }
.chx-tbl .nm small { font-weight: 500; color: var(--muted); }
@media (max-width: 600px) {
  .chx-tbl thead { display: none; }
  .chx-tbl tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .chx-tbl td { padding: 0; border: 0; }
  .chx-tbl td.v, .chx-tbl td.d { grid-column: 1; font-size: 13px; color: var(--muted); }
  .chx-tbl td.s { grid-column: 2; grid-row: 1; }
  .chx-tbl td.a { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
  .chx-tbl td.v:empty, .chx-tbl td.d:empty { display: none; }
}

/* Conditions ChauffApp lues par l'administrateur */
.chx-dialog { max-width: 560px; }
.chx-dialog h2 { margin: 0 0 4px; }
.chx-dialog .chx-terms { margin: 14px 0; max-height: 55vh; overflow: auto; }
.chx-band { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); font-size: 13.5px; font-weight: 600; }

/* Favicons dans les carrés : ChauffApp et chaque société (owner, 2026-11-28) */
.chx-av.fav { background: none; overflow: hidden; }
.chx-av.fav img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; }
.chr-hico.chx-favh { background: none; padding: 0; overflow: hidden; }
.chr-hico.chx-favh img { width: 40px; height: 40px; border-radius: 11px; display: block; }
/* Page « Charte » de l'admin (menu de gauche) */
.chx-apage { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 40px; }
.chx-apage .chr-head h1 { margin: 0; }

/* Règles du gérant (fcDraw, owner 2026-11-28) */
.fc-signs { margin-top: 18px; }
.fc-sg { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 0; }
.fc-sg + .fc-sg { border-top: 1px solid var(--line); }
.fc-sg b { font-size: 14px; color: var(--text); }
/* Conditions ChauffApp : « J'ai compris » appuyé, chaque carte « Non négociable » faite (compris, essai fait) passe en vert clair (owner, 2026-11-29) */
html .chr .chr-r.chr-und-ok { background: var(--green-soft); border-color: var(--green); transition: background .3s, border-color .3s; }
html .chr .chr-r.chr-und-ok .chr-prac-btn.done { background: var(--bg); }
@media (hover: hover) { html .chr .chr-r.chr-und-ok .chr-prac-btn.done:hover { background: var(--text); color: var(--bg); border-color: var(--text); } }

/* Règles en étiquettes, design 5 (chxRulesDraw, owner 2026-11-30) : une étiquette par règle (toucher = modifier ou masquer),
   « + Ajouter » au bout de chaque groupe sur ordinateur et téléphone, liens en bas. */
.chx-v5 { max-width: 980px; }
.chx-v5-top { margin: 6px 0 4px; }
.chx-signs { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.chx-grp { margin-top: 22px; }
.chx-grp h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.chx-grp h3 small { color: var(--muted); font-size: 12px; font-weight: 700; }
.chx-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.chx-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; text-align: start; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
.chx-pill.must { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: color-mix(in srgb, var(--red) 7%, var(--bg)); }
.chx-pill.off { opacity: .5; text-decoration: line-through; }
.chx-pill.add { border-style: dashed; color: var(--muted); }
.chx-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) { .chx-pill:hover, .chx-lnk:not(.ro):hover { background: var(--text); color: var(--bg); border-color: var(--text); text-decoration: none; } }
.chx-lnks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.chx-lnk { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
.chx-lnk.ro { cursor: default; color: var(--muted); }
.chx-epop .f { margin-top: 14px; }
.chx-ep-sw { margin-top: 14px; }
.chx-epop .btns .danger { margin-inline-end: auto; }
@media (max-width: 999px) { .chx-pill { font-size: 13px; } }
@media (max-width: 999px) { .chx-apage { padding-inline: 16px; } }   /* téléphone : 16 px des bords comme les autres pages (owner, 2026-11-30) */

/* Design 3 « Aperçu sombre toujours visible » (chxRulesDraw, design-lab/charte-regles-apercu-3-designs.html, owner 2026-12-01) :
   éditeur à gauche, aperçu chauffeur sombre à droite (ordinateur) ; bouton « Aperçu » qui ouvre un tiroir (téléphone). */
.chx-whob svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chx-whon { margin-inline-start: 2px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2, var(--line)); color: var(--text); font-size: 11px; font-weight: 800; transition: background .3s, color .3s; }
@media (hover: hover) { .chx-whob:hover .chx-whon { background: var(--bg); color: var(--text); } }
.chx-v6 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1.1fr); gap: 28px; align-items: start; }   /* aperçu à peu près la moitié de la page (owner, 2026-12-01 : « expand preview, too narrow ») */
.chx-v6-ed { min-width: 0; }
.chx-lbl { margin: 8px 0 -6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chx-lbl-end { margin: 30px 0 14px; }
.chx-endf { position: relative; display: block; margin: 0; padding: 16px 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .3s, box-shadow .3s; }
.chx-endf > span:first-child { position: absolute; top: -9px; inset-inline-start: 12px; padding: 0 6px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 800; transition: color .3s; }
.chx-endf:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.chx-endf:focus-within > span:first-child { color: var(--gold); }
.chx-endf textarea { display: block; width: 100%; min-height: 72px; margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; resize: vertical; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; }
.chx-endft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.chx-tag { padding: 2px 8px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
@media (hover: hover) { .chx-tag:hover { background: var(--text); color: var(--bg); border-color: var(--text); border-style: solid; } }
.chx-cnt { margin-inline-start: auto; }
.chx-resetw { display: flex; justify-content: flex-end; margin-top: 18px; }
.chx-resetw svg, .chx-pvbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chx-pvbtn { display: none; }
/* panneau d'aperçu : fond sombre comme le menu de gauche, téléphone clair dedans */
.chx-pvside { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); padding: 18px; border-radius: 20px; background: #0f1f3d; color: #fff; }
.chx-pvh { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.chx-pvh b { display: flex; align-items: center; gap: 8px; margin-inline-end: auto; font-size: 14px; font-weight: 800; white-space: nowrap; }
.chx-pvh b svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chx-pvh .sel-btn, .chx-pvh select { width: auto; max-width: 118px; min-height: 32px; padding-block: 4px; font-size: 12px; }
.chx-pvph { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: none; padding: 22px 14px 14px; border: 8px solid #2b3b5e; border-radius: 30px; background: #fff; color: #0f1f3d; }
.chx-pvph::-webkit-scrollbar { display: none; }
.chx-pvph::before { content: ""; position: absolute; top: 7px; left: 50%; width: 56px; height: 5px; border-radius: 9px; background: #2b3b5e; transform: translateX(-50%); }
.chx-pv { font-size: 12.5px; line-height: 1.4; }
.chx-pvt { margin-bottom: 3px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.chx-pvs { margin: 0 0 8px; color: #5a6480; font-size: 12px; }
.chx-pvk { margin: 14px 0 6px; color: #5a6480; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.chx-pvk.must { color: var(--red); }
.chx-pv ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chx-pv li { position: relative; padding-inline-start: 14px; }
.chx-pv li::before { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.chx-pvk.must + ul li::before { background: var(--red); }
.chx-pv li b { display: block; font-weight: 700; }
.chx-pv li small { display: block; color: #5a6480; font-size: 11.5px; }
.chx-pv li.nw, .chx-pvmsg.nw { background: color-mix(in srgb, var(--gold) 16%, #fff); border-radius: 8px; }
.chx-pv li.nw { margin-inline: -6px; padding: 4px 6px 4px 20px; }
.chx-pv li.nw::before { inset-inline-start: 6px; top: 10px; }
.chx-pvmsg { margin: 16px 0 0; padding: 9px 11px; border-inline-start: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #f4f5f8; color: #4a5672; font-style: italic; white-space: pre-line; }
.chx-pvc { margin: 12px 0 8px; font-weight: 700; }
.chx-pvn { display: block; margin-bottom: 10px; padding: 10px 12px; border: 1px solid #cfd4df; border-radius: 12px; color: #8a93a8; font-size: 12px; }
.chx-pvb { display: grid; place-items: center; height: 42px; border-radius: 14px; background: var(--gold); color: #fff; font-weight: 800; }
.chx-pvnote { display: flex; gap: 7px; margin: 12px 0 0; color: #aab3c6; font-size: 11.5px; line-height: 1.4; }
.chx-pvnote svg { flex: none; width: 14px; height: 14px; margin-top: 1px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; }
/* téléphone (et écran étroit) : une colonne, aperçu en tiroir */
.chx-pvdlg { background: #0f1f3d; color: #fff; }
.chx-pvdlg .chx-pvph { max-height: 62vh; }
.chx-pvdlg .btns { margin-top: 14px; }
@media (max-width: 999px) {   /* téléphone : les boutons du haut passent à la ligne au lieu de sortir de l'écran */
  #chxActs { flex-wrap: wrap; max-width: 100%; }  #chxActs .chx-whob { display: none; }   /* « Qui a signé » est dans le menu du titre (Règles ▾) sur téléphone */
}
@media (max-width: 1199px) {
  .chx-v6 { grid-template-columns: minmax(0, 1fr); }
  .chx-pvside { display: none; }
  .chx-pvbtn { display: inline-flex; margin: 4px 0 6px; }
}
/* Téléphone : « Mes chartes » commence 50 px sous le logo comme les autres pages (owner, 2026-12-02 : « we said 50 pixel under
   the logo ») : les 50 px viennent de l'en-tête (app.css), donc ni marge du titre ni haut de page en plus ici. */
@media (max-width: 999px) {
  .chr.chx-list { padding-top: 0; }
  .chr.chx-list > .chx-h1:first-child { margin-top: 0; }
}
