/* Espaces de travail : espace guide et espace propriétaire (suivi des commandes).
   Une structure d'outil de travail : menu latéral avec icônes (barre d'onglets en haut sur téléphone), en-tête de section, tuiles de chiffres,
   cartes hiérarchisées, badges d'état. Chargé après theme.css, uniquement par ces pages. */

.ws-on .page-head { display: none; }

.ws {
  --ws-line: var(--line); --ws-line-2: var(--line-2); --ws-ink: var(--ink); --ws-muted: var(--ink-2); --ws-faint: var(--placeholder);
  --st-info: #1b5a86; --st-info-bg: #e6f0f7;
  --st-warn: #7a4f00; --st-warn-bg: #fcf0d3;
  --st-ok: #14633b; --st-ok-bg: var(--ok-wash);
  --st-bad: #9c1f18; --st-bad-bg: #fae6e4;
  --st-mute: #574b40; --st-mute-bg: #efe9e1;
  display: grid; gap: 14px; max-width: 1180px; margin-inline: auto; padding: 14px var(--gutter) 28px; color: var(--ws-ink);
}
.ws[hidden] { display: none; }
.ws h1, .ws h2, .ws h3 { font-family: var(--font-body); letter-spacing: -.01em; color: var(--ws-ink); }
@media (min-width: 960px) {
  .ws { grid-template-columns: 264px minmax(0, 1fr); gap: 32px; padding-top: 32px; }
}

/* ---------- Icônes ---------- */
.ws-ico { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.ws-svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Menu latéral ---------- */
.ws-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 960px) { .ws-side { position: sticky; top: 16px; align-self: start; } }
.ws-who { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--ws-line); border-radius: 16px; min-width: 0; }
.ws-avatar { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--forest); color: var(--gold-soft); font-weight: 700; letter-spacing: .02em; }
.ws-who > div { min-width: 0; }
.ws-who b { display: block; font-size: .96875rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-who small { display: block; margin-top: 2px; color: var(--ws-muted); font-size: .8125rem; }
.ws-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--ws-line); border-radius: 16px; }
.ws-nav-title { margin: 0; padding: 10px 12px 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ws-faint); }
.ws-nav-title:first-child { padding-top: 4px; }
.ws-nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ws-ink); font: 600 .9375rem/1.2 var(--font-body); text-align: start; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ws-nav-item .ws-svg { width: 20px; height: 20px; color: var(--ws-muted); }
.ws-nav-item:hover { background: var(--wash); color: var(--ws-ink); }
.ws-nav-item[aria-current="page"] { background: var(--forest); color: #fff; }
.ws-nav-item[aria-current="page"] .ws-svg { color: var(--gold-soft); }
.ws-nav-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ws-count {
  margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px;
  background: var(--wash-2); color: var(--ws-ink); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ws-count[hidden] { display: none; }
.ws-count[data-tone="alert"] { background: var(--gold); color: var(--night); }
.ws-nav-item[aria-current="page"] .ws-count { background: rgba(255, 255, 255, .2); color: #fff; }
.ws-nav-item[aria-current="page"] .ws-count[data-tone="alert"] { background: var(--gold); color: var(--night); }
.ws-side-foot { display: grid; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--ws-line); border-radius: 16px; }

/* Téléphone : le menu devient une barre d'onglets en haut, qui reste visible */
@media (max-width: 959px) {
  .ws-side {
    position: sticky; top: 0; z-index: 25; margin-inline: calc(var(--gutter) * -1); padding: 8px var(--gutter);
    background: rgb(var(--paper-rgb) / .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ws-line);
  }
  .ws-who, .ws-side-foot, .ws-nav-title { display: none; }
  .ws-nav { flex-direction: row; gap: 6px; padding: 0; border: 0; background: transparent; overflow-x: auto; scrollbar-width: none; }
  .ws-nav::-webkit-scrollbar { display: none; }
  .ws-nav-item { flex: none; width: auto; min-width: 74px; min-height: 56px; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 10px; font-size: .75rem; text-align: center; background: #fff; border: 1px solid var(--ws-line); }
  .ws-nav-item .ws-count { position: absolute; top: 3px; inset-inline-end: 3px; margin: 0; min-width: 20px; height: 20px; }
}

/* ---------- En-tête de section ---------- */
.ws-main { display: grid; gap: 18px; min-width: 0; align-content: start; }
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.ws-over { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gold-deep); }
.ws-title { margin: 2px 0 0; font-size: clamp(1.4rem, 3.2vw, 1.8rem); font-weight: 700; line-height: 1.2; }
.ws-sub { margin: 4px 0 0; max-width: 62ch; color: var(--ws-muted); font-size: .9375rem; line-height: 1.5; }
.ws-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ws-updated { color: var(--ws-faint); font-size: .8125rem; }
.ws-stack { display: grid; gap: 20px; }

/* ---------- Boutons dans les espaces de travail : plus nets que ceux du site ---------- */
.ws .btn { min-height: 42px; padding: 0 16px; border-radius: 10px; font-size: .9375rem; gap: 8px; }
.ws .btn .ws-svg { width: 18px; height: 18px; }
.ws .btn-sm { min-height: 38px; padding: 0 13px; font-size: .875rem; }
.ws .btn-outline { background: #fff; }
.ws .btn-danger { background: #fff; color: var(--st-bad); border-color: #e3b9b5; }
.ws .btn-danger:hover { background: var(--st-bad-bg); border-color: var(--st-bad); }
.ws .link-btn { min-height: 38px; }

/* ---------- Tuiles de chiffres ---------- */
.ws-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ws-stat { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; min-width: 0; text-align: start; font: inherit; color: inherit; }
button.ws-stat { cursor: pointer; }
button.ws-stat:hover { border-color: var(--forest); }
.ws-stat-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--st-mute-bg); color: var(--st-mute); font-size: 1.1rem; }
.ws-stat[data-tone="warn"] .ws-stat-ico { background: var(--st-warn-bg); color: var(--st-warn); }
.ws-stat[data-tone="info"] .ws-stat-ico { background: var(--st-info-bg); color: var(--st-info); }
.ws-stat[data-tone="ok"] .ws-stat-ico { background: var(--st-ok-bg); color: var(--st-ok); }
.ws-stat[data-tone="bad"] .ws-stat-ico { background: var(--st-bad-bg); color: var(--st-bad); }
.ws-stat b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ws-stat .l { display: block; margin-top: 2px; color: var(--ws-muted); font-size: .8125rem; line-height: 1.3; }

/* ---------- Sections et cartes ---------- */
.ws-section { display: grid; gap: 12px; }
.ws-section-head { display: flex; align-items: center; gap: 10px; }
.ws-section-head .ws-ico { color: var(--forest-2); font-size: 1.15rem; }
.ws-section-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.ws-chip { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--wash-2); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-chip[data-tone="alert"] { background: var(--gold); color: var(--night); }
.ws-card { padding: 20px; background: #fff; border: 1px solid var(--ws-line); border-radius: 16px; min-width: 0; }
.ws-card + .ws-card, .ws-stack > .ws-card + .ws-card { margin-top: 0; }
.ws-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ws-card-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--st-mute-bg); color: var(--forest-2); font-size: 1.1rem; }
.ws-card-title { margin: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.ws-card-sub { margin: 3px 0 0; color: var(--ws-muted); font-size: .875rem; line-height: 1.5; }
.ws-note { margin: 0; color: var(--ws-muted); font-size: .875rem; line-height: 1.5; }

/* ---------- Éléments de liste (demandes, commandes) ---------- */
.ws-list { display: grid; gap: 12px; }
.ws-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed var(--ws-line-2); border-radius: 14px; color: var(--ws-muted); font-size: .9375rem; background: rgba(255, 255, 255, .6); }
.ws-empty .ws-ico { color: var(--ws-faint); font-size: 1.3rem; }
.ws-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--ws-line); border-inline-start: 4px solid var(--ws-line-2); border-radius: 16px; min-width: 0; }
.ws-item[data-tone="warn"] { border-inline-start-color: var(--gold); }
.ws-item[data-tone="info"] { border-inline-start-color: var(--st-info); }
.ws-item[data-tone="ok"] { border-inline-start-color: var(--st-ok); }
.ws-item[data-tone="bad"] { border-inline-start-color: var(--st-bad); }
.ws-item-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--st-mute-bg); color: var(--forest-2); font-size: 1.15rem; }
.ws-item-body { min-width: 0; display: grid; gap: 10px; }
.ws-item-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.ws-item-title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ws-dim { color: var(--ws-muted); font-weight: 500; }
.ws-ref { margin: -4px 0 0; color: var(--ws-faint); font: 600 .75rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.ws-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.ws-facts li { display: inline-flex; align-items: center; gap: 7px; color: var(--ws-muted); font-size: .875rem; min-width: 0; }
.ws-facts .ws-svg { width: 16px; height: 16px; color: var(--ws-faint); }
.ws-facts strong { color: var(--ws-ink); font-weight: 600; }
.ws-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--st-mute-bg); color: var(--st-mute); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.ws-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ws-badge[data-tone="info"] { background: var(--st-info-bg); color: var(--st-info); }
.ws-badge[data-tone="warn"] { background: var(--st-warn-bg); color: var(--st-warn); }
.ws-badge[data-tone="ok"] { background: var(--st-ok-bg); color: var(--st-ok); }
.ws-badge[data-tone="bad"] { background: var(--st-bad-bg); color: var(--st-bad); }
.ws-timer { display: inline-flex; align-items: center; gap: 7px; align-self: start; padding: 5px 11px; border-radius: 999px; background: var(--st-warn-bg); color: var(--st-warn); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-timer[data-urgent="1"] { background: var(--st-bad-bg); color: var(--st-bad); }
.ws-actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--wash-5); border: 1px solid var(--ws-line); border-radius: 12px; min-width: 0; }
.ws-person .ws-avatar { width: 38px; height: 38px; border-radius: 10px; font-size: .875rem; }
.ws-person b { display: block; font-size: .9375rem; overflow-wrap: anywhere; }
.ws-person small { display: block; color: var(--ws-muted); font-size: .8125rem; overflow-wrap: anywhere; }
.ws-quote { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--wash-5); border: 1px solid var(--ws-line); border-inline-start: 3px solid var(--forest-2); color: var(--ws-ink); font: 400 .9375rem/1.55 var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-mono { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--wash-6); border: 1px solid var(--ws-line); font: 500 .8125rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-panel { display: grid; gap: 0 14px; padding: 14px 14px 0; border: 1px solid var(--ws-line); border-radius: 12px; background: var(--wash-3); }
.ws-panel-title { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin: 0 0 12px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ws-muted); }
.ws-panel-title .ws-svg { width: 16px; height: 16px; }
@media (min-width: 640px) { .ws-panel.cols-3 { grid-template-columns: repeat(3, 1fr); } .ws-panel.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.ws-panel .ws-actions-row { grid-column: 1 / -1; margin-bottom: 14px; }
.ws-panel .field { margin-bottom: 14px; }

/* ---------- Liste de démarrage ---------- */
.ws-progress { height: 6px; margin: 0 0 14px; border-radius: 3px; background: var(--wash-2); overflow: hidden; }
.ws-progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--st-ok); border-radius: 3px; transition: width .35s ease; }
.ws-steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ws-steps li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 4px; border-top: 1px solid var(--ws-line); }
.ws-steps li:first-child { border-top: 0; }
.ws-step-mark { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ws-line-2); color: transparent; font-size: .9rem; }
.ws-steps li[data-done="1"] .ws-step-mark { background: var(--st-ok); border-color: var(--st-ok); color: #fff; }
.ws-step-text { flex: 1 1 220px; min-width: 0; }
.ws-step-text strong { display: block; font-size: .9375rem; }
.ws-step-text small { display: block; margin-top: 2px; color: var(--ws-muted); font-size: .8125rem; line-height: 1.45; }
.ws-steps li[data-done="1"] .ws-step-text strong { color: var(--ws-muted); font-weight: 600; }

/* ---------- Formulaires ---------- */
.ws .field { margin-bottom: 16px; }
.ws .field > span, .ws .field legend { font-size: .875rem; font-weight: 600; color: var(--ws-ink); margin-bottom: 6px; }
.ws .field > small { font-size: .8125rem; color: var(--ws-muted); }
.ws input, .ws select, .ws textarea { min-height: 44px; padding: 10px 14px; border-radius: 10px; border-color: var(--ws-line-2); font-size: .96875rem; }
.ws textarea { min-height: 96px; }
.ws input[type="checkbox"], .ws input[type="radio"] { min-height: 0; padding: 0; width: 20px; height: 20px; }
.ws .check { margin-bottom: 12px; font-size: .9375rem; color: var(--ws-ink); }
.ws-form-grid { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .ws-form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.ws-savebar { position: sticky; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; background: rgba(255, 255, 255, .96); border: 1px solid var(--ws-line); border-radius: 14px; box-shadow: 0 8px 24px rgb(var(--night-rgb) / .08); }
@media (min-width: 880px) { .ws-savebar { bottom: 16px; } }
.ws-savebar .status { margin: 0; min-height: 0; font-size: .875rem; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ws .filter { min-height: 38px; padding: 0 14px; font-size: .875rem; border-radius: 999px; }
.ws .status { font-size: .9375rem; }

/* ---------- Disponibilités : une ligne par jour ---------- */
.ws-days { display: grid; gap: 0; border: 1px solid var(--ws-line); border-radius: 12px; overflow: hidden; }
.ws-day { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--ws-line); }
.ws-day:first-child { border-top: 0; }
.ws-day-name { flex: 0 0 96px; font-weight: 600; font-size: .9375rem; }
.ws-range { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid var(--ws-line-2); border-radius: 10px; background: var(--wash-5); }
.ws-range input { width: 112px; min-height: 36px; padding: 4px 8px; }
.ws-range .link-btn { min-height: 32px; }
.ws-day[data-empty="1"] .ws-day-name { color: var(--ws-faint); font-weight: 500; }

/* ---------- Chiffres, listes et tableaux ---------- */
.ws .figures { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 0; }
.ws .figure { padding: 14px; background: var(--wash-5); border: 1px solid var(--ws-line); border-radius: 12px; }
.ws .figure b { font-family: var(--font-body); font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ws .figure span { font-size: .8125rem; }
.ws .rows { margin: 0; gap: 0; }
.ws .rows li { padding: 12px 0; border-top: 1px solid var(--ws-line); }
.ws .rows li:first-child { border-top: 0; }
.ws .tbl th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ws-muted); }
.ws .tbl td { font-variant-numeric: tabular-nums; }
.ws-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.ws-row .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.charter-text { font-size: .9375rem; }

/* ---------- Suivi d'une commande : étapes ---------- */
.ws-track { display: flex; margin: 2px 0 0; padding: 0; list-style: none; }
.ws-track li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; color: var(--ws-faint); font-size: .75rem; font-weight: 600; text-align: center; }
.ws-track li::before { content: ""; position: absolute; top: 13px; inset-inline: -50% 50%; height: 2px; background: var(--ws-line-2); }
.ws-track li:first-child::before { display: none; }
.ws-track i { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ws-line-2); background: #fff; font-style: normal; }
.ws-track .ws-svg { width: 14px; height: 14px; }
.ws-track li[data-state="done"] { color: var(--st-ok); }
.ws-track li[data-state="done"]::before { background: var(--st-ok); }
.ws-track li[data-state="done"] i { background: var(--st-ok); border-color: var(--st-ok); color: #fff; }
.ws-track li[data-state="current"] { color: var(--ws-ink); }
.ws-track li[data-state="current"]::before { background: var(--st-ok); }
.ws-track li[data-state="current"] i { border-color: var(--gold); background: var(--st-warn-bg); color: var(--st-warn); }
.ws-track[data-tone="bad"] li[data-state="current"] i { border-color: var(--st-bad); background: var(--st-bad-bg); color: var(--st-bad); }

/* ---------- Commandes : barre d'outils, lignes de produits, connexion ---------- */
.ws-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ws-search { position: relative; flex: 1 1 240px; max-width: 420px; }
.ws-search .ws-ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ws-faint); pointer-events: none; }
.ws-search input { padding-inline-start: 40px; }
.ws-select { flex: 0 1 280px; min-width: 0; }
.ws-select select { width: 100%; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--ws-line-2, var(--line-2)); border-radius: 12px; background: #fff; font: inherit; color: var(--ws-ink, inherit); }
.ws-lines { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ws-line); border-radius: 12px; overflow: hidden; }
.ws-lines li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--ws-line); font-size: .9375rem; }
.ws-lines li:first-child { border-top: 0; }
.ws-lines .qty { flex: none; min-width: 34px; padding: 2px 8px; border-radius: 8px; background: var(--st-mute-bg); font-weight: 700; font-size: .8125rem; text-align: center; font-variant-numeric: tabular-nums; }
.ws-lines .name { flex: 1 1 160px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ws-lines .sub { color: var(--ws-muted); font-size: .8125rem; }
.ws-lines a { font-size: .8125rem; }
.ws-money { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.ws-money strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.ws-money span { color: var(--ws-muted); font-size: .8125rem; }
.ws-lock { max-width: 480px; margin: 18px auto; }
.ws-next { display: grid; gap: 0; }
details.ws-more { border: 1px solid var(--ws-line); border-radius: 12px; background: #fff; }
details.ws-more > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: .9375rem; list-style: none; }
details.ws-more > summary::-webkit-details-marker { display: none; }
details.ws-more > summary > .ws-ico:last-child { margin-inline-start: auto; }
details.ws-more > summary > .ws-ico:last-child .ws-svg { transition: transform .15s ease; }
details.ws-more[open] > summary > .ws-ico:last-child .ws-svg { transform: rotate(180deg); }
details.ws-more > div { display: grid; gap: 12px; padding: 0 14px 14px; }

@media (prefers-reduced-motion: reduce) { .ws-progress i { transition: none; } }
@media print { .ws-side, .ws-savebar { display: none; } .ws { display: block; } }

.ws-on .section { padding-block: 0 8px; }

/* Un élément masqué reste masqué même quand sa classe lui donne un affichage (grille, flex) */
.ws [hidden], .ws-on [hidden] { display: none !important; }
.ws-main > .status { margin: 0; min-height: 0; }
.ws-main > .status:empty { display: none; }
.ws-timer { justify-self: start; }

/* Pastilles à cocher (langues, accompagnements) : case et texte alignés, état coché visible */
.ws-chips label.filter { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ws-chips label.filter input[type="checkbox"] { width: 18px; height: 18px; margin: 0 !important; flex: none; }
.ws-chips label.filter:has(input:checked) { background: var(--wash); border-color: var(--forest); }
.ws-chips .link-btn { color: var(--st-bad); }
/* Zones de message : pas de grand vide quand elles sont vides */
.ws .status { min-height: 0; margin-top: 10px; }
.ws .ws-actions-row:not(:has(> :not([hidden]))) { display: none; }

/* Téléphone : le nom du jour passe seul sur sa ligne, les plages se replient au lieu de déborder */
@media (max-width: 560px) {
  .ws-day-name { flex: 0 0 100%; }
  .ws-range { flex-wrap: wrap; max-width: 100%; }
  .ws-range input { flex: 1 1 88px; width: auto; min-width: 88px; }
}

.ws.ws-solo { display: block; padding-top: 32px; }

.ws-stats.is-money { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ws-stats.is-money .ws-stat b { white-space: nowrap; }
.ws-stats:empty { display: none; }

/* Colonnes uniques qui peuvent se réduire : un champ date ou une longue ligne ne doit jamais élargir la page au-delà de l'écran */
.ws, .ws-main, .ws-stack, .ws-list, .ws-section, .ws-item-body { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .ws { grid-template-columns: 264px minmax(0, 1fr); } }
.ws input, .ws select, .ws textarea { min-width: 0; max-width: 100%; }
.ws-panel, .ws-form-grid, .ws-days { grid-template-columns: minmax(0, 1fr); }

/* Petit téléphone : l'état d'une carte se lit sur son badge et sa bordure ; l'icône cède sa colonne au contenu, et un badge long passe à la ligne */
.ws-badge { max-width: 100%; white-space: normal; line-height: 1.3; }
@media (max-width: 420px) {
  .ws-item { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .ws-item-ico { display: none; }
}

/* Essai de séance (visio-essai.html) */
.ws.ws-solo.ws-narrow { max-width: 940px; display: grid; gap: 18px; }
.vs-frame { margin-top: 14px; height: min(70vh, 560px); min-height: 360px; border-radius: 14px; overflow: hidden; background: var(--night); border: 1px solid var(--ws-line); }
.vs-frame iframe { width: 100%; height: 100%; border: 0; }
.vs-notes { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--ws-muted); font-size: .9375rem; line-height: 1.5; }
.vs-log { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; font-size: .875rem; color: var(--ws-muted); font-variant-numeric: tabular-nums; }
.vs-log li { padding: 6px 10px; border-radius: 8px; background: var(--wash-5); border: 1px solid var(--ws-line); }
#vsResult h3 { margin: 0 0 12px; }
#vsResult .ws-lines .sub { flex: 1 1 100%; color: var(--ws-ink); font-size: .9375rem; }
#vsResult .ws-lines .name { flex: 0 0 auto; }
.btn[aria-pressed="true"] { border-color: var(--forest); background: var(--wash); }
.ws.ws-solo.ws-narrow { grid-template-columns: minmax(0, 1fr); }
