/* The Shift Training · styles communs */

@font-face { font-family: 'Bespoke Sans'; src: url('/fonts/BespokeSans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bespoke Sans'; src: url('/fonts/BespokeSans-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bespoke Sans'; src: url('/fonts/BespokeSans-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bespoke Sans'; src: url('/fonts/BespokeSans-Extrabold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --ink: #0E1B2A;
  --muted: #56657A;
  --line: #DDE3E9;
  --field: #C3CDD8;
  --danger: #B3261E;
  --danger-bg: #FBE9E7;
  --ok: #14532D;
  --ok-bg: #E3F1E6;
  --radius: 14px;
  /* Santé (par défaut) */
  --brand: #0067BE;
  --brand-deep: #08233F;
  --brand-soft: #E5EFF8;
  --brand-ink: #00437C;
}
body[data-theme="perf"] {
  --brand: #53565A;
  --brand-deep: #2B2D30;
  --brand-soft: #ECEDEE;
  --brand-ink: #2E3033;
}
body[data-theme="coach"] {
  --brand: #0067BE;
  --brand-deep: #08233F;
  --brand-soft: #E5EFF8;
  --brand-ink: #00437C;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Bespoke Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.noscript { padding: 24px; }
.center-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }

/* Mise en page téléphone */
.phone {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand-head { display: flex; align-items: center; gap: 12px; }
.brand-head img { width: 48px; height: 48px; flex-shrink: 0; }
.eyebrow { font-size: 14px; color: var(--muted); }
.title-xl { font-size: 30px; font-weight: 700; }
.title-l { font-size: 24px; font-weight: 700; }
.lead { font-size: 16px; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.soft { background: var(--brand-soft); }
.card h2 { font-size: 18px; font-weight: 700; }

/* Écran de connexion */
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 36px 4px 18px; }
.login-logo { width: 64px; height: 64px; }
.login-phrase { width: 100%; max-width: 380px; height: auto; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; }
.field .hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.input {
  min-height: 48px; width: 100%; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 10px; background: #fff;
  font-size: 16px; font-weight: 400;
}
.input:focus { border-color: var(--brand); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--brand); }

.btn {
  min-height: 50px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:disabled { background: #8A94A3; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-link { min-height: 44px; padding: 0; background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-align: left; }
.btn-block { width: 100%; }

.msg { border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.msg-error { background: var(--danger-bg); color: var(--danger); }
.msg-ok { background: var(--ok-bg); color: var(--ok); }
.msg:empty { display: none; }

.list-clean { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.small { font-size: 13px; color: var(--muted); }
.spacer { flex: 1; }

/* Espace coach (ordinateur) */
.coach-layout { min-height: 100dvh; display: flex; flex-wrap: wrap; }
.coach-nav {
  flex: 1 1 220px; background: var(--brand-deep); color: #fff; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.coach-nav .brand-head { margin-bottom: 18px; }
.coach-nav .brand-head img { width: 44px; height: 44px; }
.coach-nav .brand-head span { font-size: 22px; font-weight: 700; }
.coach-nav a, .coach-nav button {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: #fff; text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 16px; text-align: left;
}
.coach-nav [aria-current="page"] { background: var(--brand); font-weight: 600; }
.coach-nav .soon { opacity: .55; cursor: default; }
.coach-main { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; font-size: 14px; }
td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
td .input { min-height: 44px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); }
.badge-wait { background: #FCE8D2; color: #6E2C00; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .coach-main { padding: 20px 16px; }
}

/* ---------- Espace adhérent (étape 2) ---------- */
.screen { max-width: 480px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; }
.screen-head { display: flex; align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 12px 4px; }
.screen-head h1:only-child { padding-left: 4px; }
.screen-body { flex: 1; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.screen-body.home { padding-top: max(20px, env(safe-area-inset-top)); }
.screen-foot { position: sticky; bottom: 0; padding: 10px 16px max(16px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 12px; }
.brand-txt { color: var(--brand); font-weight: 600; }
.phrase { font-size: 22px; font-weight: 600; line-height: 1.2; }
.big-count { font-size: 20px; font-weight: 700; line-height: 1.15; }
.center { text-align: center; justify-content: center; }
.score { font-size: 38px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.score span { font-size: 18px; color: var(--muted); font-weight: 500; }

.tabbar { position: sticky; bottom: 0; display: grid; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px max(12px, env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--brand); font-weight: 600; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.row:first-child { border-top: 0; }
.row svg { color: var(--muted); flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { display: block; font-size: 16px; font-weight: 600; }
.row-sub { display: block; font-size: 14px; color: var(--muted); }
.dot { width: 10px; height: 34px; border-radius: 4px; flex-shrink: 0; }
.link-card { flex-direction: row; align-items: center; justify-content: space-between; text-decoration: none; color: var(--ink); }
.round-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--brand); font-size: 24px; font-weight: 700; cursor: pointer; }
.round-btn.ghost { background: #fff; color: var(--brand); }
.done-tag { display: inline-flex; align-items: center; gap: 6px; }

fieldset.card { border: 0; margin: 0; min-width: 0; }
.q-legend { float: left; width: 100%; padding: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 700; }
.q-legend + * { clear: both; }
.q-answer { font-size: 14px; font-weight: 500; color: var(--muted); text-align: right; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.num { min-height: 48px; border-radius: 12px; border: 1px solid var(--field); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.num[aria-pressed="true"], .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip[data-warn][aria-pressed="true"] { background: #B84A00; border-color: #B84A00; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.scale-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; font-size: 15px; }
.scale-row + .scale-row { margin-top: 6px; }
.scale-n { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.scale-h { display: block; font-size: 13px; color: var(--muted); }
.scale-row[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale-row[aria-pressed="true"] .scale-n { background: #fff; color: var(--brand); }
.scale-row[aria-pressed="true"] .scale-h { color: #fff; opacity: .9; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; }
.stepper output { min-width: 120px; text-align: center; }
.textarea { min-height: 88px; padding: 10px 14px; resize: none; line-height: 1.4; }
.bar { height: 12px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); border-radius: 999px; }
.week-chart { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.btn-danger { background: var(--danger); color: #fff; }
a.btn { text-decoration: none; }

/* ---------- Messages, conseils ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.msg-btn { margin-left: auto; position: relative; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #B84A00; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
.msg-btn .nav-badge { position: absolute; top: -2px; right: -2px; margin: 0; }
.coach-nav a .nav-badge { margin-left: 8px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--line); border-radius: 12px; }
.segmented a { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.segmented a[aria-selected="true"] { background: #fff; }
.chat-top { flex: 0; padding-bottom: 0; }
.chat-screen .thread { flex: 1; }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; overflow-y: auto; }
.thread-card .thread { max-height: 60vh; min-height: 200px; padding: 4px 0 12px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 16px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: #fff; color: var(--ink); border-bottom-left-radius: 4px; }
.bubble-time { display: block; font-size: 11px; opacity: .75; margin-top: 4px; text-align: right; }
.composer { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; }
.composer .textarea { min-height: 44px; flex: 1; }
.chat-screen .composer { position: sticky; bottom: 0; }
.repere-title { font-size: 24px; font-weight: 700; }
.repere-action { font-size: 18px; line-height: 1.4; }
.form-grid { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.chip-radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.chip-radio input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.chip-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.thread-card .bubble.them { background: var(--bg); }
/* Pastille rouge des nouveaux messages */
.nav-badge { background: #D92D20; box-shadow: 0 0 0 2px #fff; }
.coach-nav a .nav-badge { box-shadow: none; }
.tab-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #D92D20; color: #fff; font-size: 11px; font-weight: 700; }
@keyframes badge-pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.nav-badge.pop { animation: badge-pop .45s ease-out; }
@media (prefers-reduced-motion: reduce) { .nav-badge.pop { animation: none; } }

/* ---------- Espace coach : aujourd'hui, fiche ---------- */
.st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.st-alert { background: #B84A00; color: #fff; }
.st-watch { background: #FCE8D2; color: #6E2C00; }
.st-ok { background: var(--brand-soft); color: var(--brand-ink); }
.st-empty { background: #E7ECF1; color: #3D4A5C; }
th a { color: var(--ink); font-weight: 700; }
th[scope="row"] { text-align: left; padding: 8px; border-top: 1px solid var(--line); font-weight: 600; }
.alert-card { border-left: 6px solid #B84A00; }
.alert-card a { color: var(--ink); font-weight: 600; }
a.stat { color: var(--ink); text-decoration: none; }
.seg-coach { display: flex; gap: 8px; flex-wrap: wrap; }
.fiche-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.chart { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.chart figcaption { display: flex; flex-direction: column; gap: 2px; }
.chart-title { font-weight: 600; }
.chart svg, .load-chart { width: 100%; height: auto; display: block; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field { flex: 1 1 140px; }
.note-bar { display: flex; align-items: center; gap: 12px; }
td .row-sub { display: block; }

/* ---------- Planning, présences, séance à distance ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; }
.day { background: #fff; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.day h2 { font-size: 14px; font-weight: 700; padding: 6px 8px; border-radius: 8px; background: var(--bg); text-transform: capitalize; }
.day.today h2 { background: var(--brand); color: #fff; }
.slot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; border-left-width: 4px; text-align: left; cursor: pointer; font-size: 13px; }
.slot.sel { outline: 3px solid var(--ink); outline-offset: 1px; }
.slot-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot-who { font-weight: 500; }
.k-indiv { background: #E5EFF8; color: #0E1B2A; border-color: #0067BE; }
.k-groupe { background: #53565A; color: #fff; border-color: #2B2D30; }
.k-distance { background: #FFF3C4; color: #5C4A00; border-color: #5C4A00; }
.k-bloque { background: #DDE3E9; color: #0E1B2A; border-color: #C3CDD8; }
.legend i.k-indiv, .legend i.k-groupe, .legend i.k-distance, .legend i.k-bloque { border-width: 0; }
.slot-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.slot-form [hidden] { display: none !important; }
.edit-card { border-left: 6px solid var(--brand); }
.group { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 600; }
.tag-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); }
.pres-row { gap: 10px; flex-wrap: wrap; }
.pres-row .slot-time { width: 64px; }
.chip-no[aria-pressed="true"] { background: #6E2C00; border-color: #6E2C00; color: #fff; }
.live-card { background: #FFF3C4; }
.live-card .eyebrow { display: flex; align-items: center; gap: 6px; color: #5C4A00; font-weight: 600; }
.plan-row { align-items: flex-start; }
.plan-row .slot-time { width: 64px; padding-top: 2px; }
.plan-row .btn { margin-top: 8px; }
.row .btn svg { color: inherit; }
.legend i.k-indiv { box-shadow: inset 0 0 0 2px #0067BE; }
.k-indivperf { background: #ECEDEE; color: #2E3033; border-color: #53565A; }
.legend i.k-indivperf { box-shadow: inset 0 0 0 2px #53565A; }
.k-groupesante { background: #00437C; color: #fff; border-color: #08233F; }

/* ---------- Bilans ---------- */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.opts .field > span { font-size: 15px; font-weight: 600; }
.bilan-table th[scope=row] { color: var(--ink); font-weight: 600; min-width: 160px; }
.bilan-table td { white-space: nowrap; }
.input.cell { width: 86px; min-height: 40px; padding: 6px 8px; font-size: 15px; text-align: right; }
.calc { font-weight: 600; }
.up-good { color: #1E7B3A; font-weight: 700; }
.up-bad { color: #B84A00; font-weight: 700; }
.lv { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lv-base, .hl-2 { background: #FDEBD9; color: #8A3A00; }
.lv-solide, .hl-3 { background: #E3EEF9; color: #0B4F8A; }
.lv-avance, .hl-4 { background: #DFF1E4; color: #1E6B35; }
.hl-1 { background: #FBE1DF; color: #A1251B; }
.hl-5 { background: #C9EBD3; color: #135227; }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg, #F4F6F8) 30%); }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.results li:first-child { border-top: 0; }
.res-label { font-weight: 600; }
.res-val { text-align: right; }
.res-gain { grid-column: 2; text-align: right; font-size: 14px; }
.results.evo li { grid-template-columns: 1fr; }
.results.evo .res-val { text-align: left; }
.results details summary { cursor: pointer; color: var(--brand); font-size: 14px; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.compo { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
a.chip { text-decoration: none; }
.t-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.hc-table .input.cell { width: 64px; padding: 6px; }
.hc-table th[scope=row] { min-width: 150px; white-space: normal; }
.hc-table td, .hc-table th { padding: 6px; }

/* ---------- Bibliothèque d'exercices ---------- */
.ex-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ex-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 8px; }
.ex-list li:first-child .ex-row { border-top: 0; }
.ex-row:hover { background: var(--bg); }
.ex-thumb { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; background: #08233F; }
.ex-thumb-empty { display: flex; align-items: center; justify-content: center; background: #F3F5F7; color: var(--muted); font-size: 12px; text-align: center; }
.ex-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-name { font-weight: 600; }
.video-wrap { position: relative; width: 100%; max-width: 560px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin: 4px 0 12px; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.field legend { font-weight: 600; margin-bottom: 6px; }
@media (max-width: 560px) { .ex-row { grid-template-columns: 72px 1fr; } .ex-thumb { width: 72px; height: 40px; } .ex-row .badge { grid-column: 2; justify-self: start; } }
.ex-note { font-style: italic; color: #8A3A00; }

/* ---------- Routines maison ---------- */
.segmented button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.routine-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 8px; }
.ex-list li:first-child .routine-row { border-top: 0; }
.routine-row:hover { background: var(--bg); }
.rt-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rt-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.rt-head { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; }
.rt-move { display: flex; gap: 2px; }
.rt-move .icon-btn { border: 1px solid var(--line); background: #fff; font-size: 16px; }
.rt-move .icon-btn:disabled { opacity: .35; }
.rt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.pick:hover { border-color: var(--brand); }
.pick .small { grid-column: 1; }
.pick-plus { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--brand); font-weight: 700; }
.rx-details summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.rx-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 16px; }
.rx-head { display: flex; gap: 12px; align-items: flex-start; }
.rx-head > span:last-child { display: flex; flex-direction: column; }
.rx-n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--brand-soft, #E3EEF9); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.video-load { position: relative; display: block; width: 100%; max-width: 560px; aspect-ratio: 16 / 9; margin: 8px 0; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #08233F; cursor: pointer; }
.video-load img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-load .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 560px) { .rt-head { grid-template-columns: 72px 1fr; } .rt-move { grid-column: 1 / -1; justify-content: flex-end; } .rt-fields { grid-template-columns: 1fr; } }
