:root {
  --sand: #F5F0E7;
  --sand-deep: #ECE4D6;
  --paper: #FFFDF9;
  --ink: #16211F;
  --ink-soft: #46514E;
  --muted: #6E7672;
  --ocean: #0E4F6B;
  --ocean-dark: #0A3A4F;
  --sea: #2F7D74;
  --sea-soft: #E3EFEC;
  --line: #DED5C5;
  --danger: #A1402F;
  --radius: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --tabs-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--sand); color: var(--ink);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--ocean); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; border-radius: 6px; }

/* Barre du haut */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(245, 240, 231, 0.94); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar__brand { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bar__tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sea); white-space: nowrap; }
.bar__out { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 0; }

.view { width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 16px calc(var(--tabs-h) + 40px + env(safe-area-inset-bottom)); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* Onglets du bas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabs-h); text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--ocean); }

/* Typo */
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sea); margin-bottom: 8px; }
.h1 { font-size: clamp(28px, 7vw, 38px); margin-bottom: 8px; }
.sub { color: var(--ink-soft); }
.muted { color: var(--muted); font-size: 14px; }
.stack > * + * { margin-top: 14px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ocean); color: #fff; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; padding: 14px 22px; text-decoration: none; transition: background .2s;
}
.btn:hover { background: var(--ocean-dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--block { width: 100%; }
.btn--big { padding: 18px 22px; font-size: 17px; }
.btn--ghost { background: transparent; color: var(--ocean); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--paper); }
.btn--small { padding: 9px 14px; font-size: 14px; }
.btn--danger { background: transparent; color: var(--danger); border: 1px solid #E5C9C2; }
.btn svg { width: 22px; height: 22px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ocean); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Formulaires */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-soft); }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; }

.switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--sand-deep); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.switch button { border: 0; background: none; border-radius: 999px; padding: 10px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.auth { max-width: 440px; margin: 8px auto 0; }
.auth__intro { margin-bottom: 22px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ocean); color: #fff; border-color: var(--ocean); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--ocean); color: #fff; font-size: 13px; font-weight: 600; }
.badge--soft { background: var(--sea-soft); color: var(--sea); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #F3E3C9; color: #7A5418; }

/* Journal */
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 16px; }
.daynav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 18px; }
.daynav button:disabled { opacity: .35; cursor: default; }
.daynav__label { text-align: center; }
.daynav__label strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.daynav__label span { font-size: 13px; color: var(--muted); }

.meals { display: grid; gap: 16px; margin-top: 20px; }
.meal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meal__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sand-deep); cursor: zoom-in; }
.meal__body { padding: 14px 16px 16px; }
.meal__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.meal__type { font-family: var(--serif); font-size: 19px; }
.meal__time { font-size: 14px; color: var(--muted); }
.meal__note { margin-top: 6px; color: var(--ink-soft); white-space: pre-wrap; }
.meal__actions { margin-top: 10px; display: flex; gap: 14px; }
.coachnote { margin-top: 12px; padding: 12px 14px; background: var(--sea-soft); border-radius: 12px; }
.coachnote__who { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sea); margin-bottom: 4px; }
.coachnote p { white-space: pre-wrap; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Feuille d'ajout */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(22, 33, 31, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--sand);
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.sheet__preview { width: 100%; max-height: 42vh; object-fit: cover; border-radius: 14px; margin-bottom: 16px; }

/* Coach */
.clients { display: grid; gap: 12px; margin-top: 18px; }
.client { display: block; text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.client:hover { border-color: var(--sea); }
.client__top { display: flex; align-items: center; gap: 12px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--ocean); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 19px; }
.client__name { font-weight: 600; font-size: 17px; }
.client__meta { font-size: 13px; color: var(--muted); }
.client__right { margin-left: auto; text-align: right; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.week__d { text-align: center; font-size: 11px; color: var(--muted); }
.week__dot { margin: 4px auto 0; width: 28px; height: 28px; border-radius: 50%; background: var(--sand-deep); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.week__dot.is-on { background: var(--sea); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat strong { display: block; font-family: var(--serif); font-size: 26px; font-weight: 500; }
.stat span { font-size: 12px; color: var(--muted); }

.back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-soft); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.dayblock + .dayblock { margin-top: 26px; }
.dayblock__title { font-family: var(--serif); font-size: 20px; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.dayblock__title span { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.commentbox { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.commentbox textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; resize: vertical; }

/* Ressources */
.res-cat { margin-top: 26px; }
.res-cat__title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sea); margin-bottom: 10px; }
.res { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.res + .res { margin-top: 10px; }
.res summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--serif); font-size: 19px; }
.res summary::-webkit-details-marker { display: none; }
.res summary::after { content: "+"; font-family: var(--sans); font-size: 22px; color: var(--sea); }
.res[open] summary::after { content: "–"; }
.res__body { padding: 0 18px 18px; color: var(--ink-soft); }
.res__body p + p, .res__body p + ul, .res__body ul + p { margin-top: 10px; }
.res__body ul { margin: 8px 0 0; padding-left: 20px; }
.res__body li + li { margin-top: 6px; }
.res__body strong { color: var(--ink); }
.res__edit { margin-top: 14px; display: flex; gap: 10px; }
.disclaimer { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }

/* Toast + lightbox */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ===== Console : menu latéral (ordinateur) ===== */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; display: none; flex-direction: column;
  background: var(--ink); color: #E8EEEC; padding: 24px 16px 18px;
}
.side__brand { font-family: var(--serif); font-size: 22px; font-weight: 600; color: #fff; text-decoration: none; padding: 0 10px; }
.side__tag { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8CC7BE; padding: 4px 10px 0; }
.side__nav { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
.side__nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: #C9D3D0; text-decoration: none; font-weight: 500; font-size: 15px;
}
.side__nav a svg { width: 20px; height: 20px; flex: none; }
.side__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side__nav a[aria-current="page"] { background: rgba(140,199,190,.16); color: #fff; }
.side__count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #E9A75B; color: var(--ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 16px 10px 0; }
.side__me { font-size: 14px; color: #fff; font-weight: 600; }
.side__me span { display: block; font-weight: 400; color: #9AA7A3; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.side__out { margin-top: 10px; background: none; border: 0; padding: 0; color: #9AA7A3; cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 900px) {
  body.is-auth { padding-left: 248px; }
  body.is-auth .side { display: flex; }
  body.is-auth .bar, body.is-auth .tabs { display: none !important; }
  body.is-auth .view { padding: 40px 40px 60px; }
  .toast { bottom: 28px; }
}
.view--wide { max-width: 1160px; }

/* ===== En-tête de page ===== */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 24px; }
.pagehead .h1 { margin-bottom: 4px; }
.pagehead__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--sea); }
.kpi__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi__value { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin-top: 6px; }
.kpi__hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi--accent { background: var(--ocean); border-color: var(--ocean); color: #fff; }
.kpi--accent .kpi__label, .kpi--accent .kpi__hint { color: #BFD6DF; }
.kpi--warn .kpi__value { color: #A9611B; }

/* ===== Panneaux ===== */
.panels { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 1000px) { .panels { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel__head h2 { font-size: 20px; }
.panel__head a { font-size: 14px; white-space: nowrap; }
.panel__empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.col { display: grid; gap: 16px; }

.feed { display: grid; gap: 4px; }
.feed__item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.feed__item:hover { background: var(--sand); }
.feed__thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--sand-deep); flex: none; }
.feed__main { min-width: 0; flex: 1; }
.feed__title { font-weight: 600; font-size: 15px; }
.feed__meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__side { font-size: 13px; color: var(--muted); text-align: right; flex: none; }

.rowlist { display: grid; }
.rowlist__item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rowlist__item:last-child { border-bottom: 0; }
.rowlist__item a { color: inherit; text-decoration: none; font-weight: 600; }
.rowlist__item .muted { margin-left: auto; }

/* ===== Tableaux ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { flex: 1; min-width: 200px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover { background: var(--sand); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 34px; height: 34px; font-size: 15px; }
.who__name { font-weight: 600; }
.who__sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mini-week { display: flex; gap: 3px; }
.mini-week span { width: 10px; height: 10px; border-radius: 3px; background: var(--sand-deep); }
.mini-week span.is-on { background: var(--sea); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--active { background: #E1F0EC; color: #23695F; }
.status--paused { background: #F6EBD8; color: #91601B; }
.status--done { background: #ECECEA; color: #6E7672; }
.status--invited { background: #E3ECF3; color: #2D5F80; }
.status--paid { background: #E1F0EC; color: #23695F; }
.status--pending { background: #FBE7D6; color: #A1531B; }
button.status { border: 0; cursor: pointer; }

/* Liste en cartes sur mobile */
@media (max-width: 760px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table--cards td { border: 0; padding: 3px 0; }
  .table--cards td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: 13px; }
  .table--cards .num { text-align: left; }
  .hide-mobile { display: none !important; }
}

/* ===== Fiche coaché ===== */
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; overflow-x: auto; }
.subtabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ocean); }
.ficheinfo { display: grid; gap: 10px 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 16px; }
.ficheinfo div { font-size: 14px; }
.ficheinfo strong { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.invite { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #E3ECF3; color: #1F4A66; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.invite code { background: #fff; padding: 4px 8px; border-radius: 8px; font-size: 13px; word-break: break-all; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.modal-title { margin-bottom: 4px; }

/* ===== Bannière d'installation ===== */
.install { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.install img { border-radius: 10px; flex: none; }
.install__text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.install__text strong { display: block; }
.install__text span { color: var(--muted); }
.install__close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }

/* ===== Frise de la journée ===== */
.frise { margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; }
.frise__track { position: relative; height: 64px; }
.frise__slot { position: absolute; top: 0; bottom: 0; background: var(--sea-soft); border-radius: 10px; }
.frise__slot span { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 600; color: var(--sea); white-space: nowrap; }
.frise__line { position: absolute; left: 0; right: 0; top: 44px; height: 2px; background: var(--line); }
.frise__dot { position: absolute; top: 28px; width: 34px; height: 34px; margin-left: -17px; padding: 0; border-radius: 50%; border: 3px solid var(--sea); background: var(--sand-deep); overflow: hidden; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.frise__dot.is-off { border-color: #D9822B; }
.frise__dot.is-up { top: 20px; z-index: 1; }
.frise__dot img { width: 100%; height: 100%; object-fit: cover; }
.frise__ticks { position: relative; height: 18px; margin-top: 6px; }
.frise__ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.frise__sum { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.frise__sum .is-off { color: #B8641C; }
.frise__hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.dayblock .frise { margin: 0 0 14px; }
.meal.is-flash { box-shadow: 0 0 0 3px var(--sea); transition: box-shadow .3s; }

/* ===== Assistant ===== */
.chat { max-width: 760px; }
.chat__list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.bubble { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: 16px; line-height: 1.5; }
.bubble--me { align-self: flex-end; background: var(--ocean); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bubble--bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); }
.bubble--bot p + p, .bubble--bot p + ul, .bubble--bot ul + p { margin-top: 8px; }
.bubble--bot ul { margin: 6px 0 0; padding-left: 18px; }
.bubble--bot li + li { margin-top: 4px; }
.bubble__who { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sea); margin-bottom: 4px; }
.bubble--error { align-self: center; background: #F8E4DF; color: var(--danger); font-size: 14px; }
.bubble--typing { display: flex; gap: 5px; padding: 16px 18px; }
.bubble--typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: jd-dot 1.2s infinite ease-in-out; }
.bubble--typing span:nth-child(2) { animation-delay: .15s; }
.bubble--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes jd-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble--typing span { animation: none; opacity: .6; } }
.chat__suggest { margin: 6px 0 4px; }
.chat__suggest .chip { text-align: left; }
.chat__form {
  position: sticky; bottom: calc(var(--tabs-h) + 10px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; padding: 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 4px 18px rgba(22,33,31,.08);
}
.chat__form textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 10px 8px; font-size: 16px; max-height: 160px; outline: none; }
.chat__form .btn { width: 46px; height: 46px; padding: 0; flex: none; }
@media (min-width: 900px) { .chat__form { bottom: 20px; } }
.frise__slot .sm { display: none; }
@media (max-width: 520px) { .frise__slot .lg { display: none; } .frise__slot .sm { display: inline; } }

/* ===== Dictée ===== */
.commentbox__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.micbtn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ocean);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
}
.micbtn svg { width: 18px; height: 18px; }
.micbtn.is-rec { background: #FBE9E5; border-color: #E8B8AD; color: var(--danger); }
.micbtn.is-busy { color: var(--muted); cursor: progress; }
.micbtn__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: jd-pulse 1s infinite ease-in-out; }
.micbtn__spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ocean); animation: jd-spin .8s linear infinite; }
@keyframes jd-pulse { 50% { opacity: .35; } }
@keyframes jd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .micbtn__dot, .micbtn__spin { animation: none; } }

/* ===== Montre Garmin (profil) ===== */
.garmin__title { font-size: 22px; margin-bottom: 4px; }
.garmin__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.garmin__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.garmin__actions .btn svg { width: 18px; height: 18px; }

/* ===== Sport : reprise du suivi d'entraînement, aux couleurs de l'espace ===== */
.sport {
  --s-base: #A9CCD6; --s-active: #0E4F6B; --s-line: #0E4F6B; --s-grid: #EEE7DB;
  --z1: #C7E0E6; --z2: #8EC0CD; --z3: #4F97AD; --z4: #1F6C88; --z5: #0A3A4F;
}
.sport-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); font-size: 14px; padding: 7px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--sand); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.sport-sync { font-size: 13px; color: var(--muted); }
.sport-sync .linkbtn { font-size: 13px; }
.sport-warn { margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: #FBE7D6; color: #8A4515; font-size: 14px; }
.sport-kpis .kpi__value small { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 4px; }
.sport-card { margin-top: 16px; }
.sport-card .panel__head { flex-wrap: wrap; align-items: baseline; }
.sport-card .panel__head h2 { font-size: 19px; }
.sport-card .panel__head .muted { font-size: 13px; }
.sport-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.sport-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sport-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sport-chart { position: relative; width: 100%; }
.sport svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.sport .axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--sans); }
.sport-tip {
  position: fixed; pointer-events: none; z-index: 80; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; max-width: 240px; opacity: 0; transition: opacity .08s; font-variant-numeric: tabular-nums;
}
.sport-tip b { font-weight: 600; }
.sport-scroll { overflow-x: auto; margin: 0 -4px; }
.stable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.stable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stable td { padding: 9px 8px; border-bottom: 1px solid var(--s-grid); white-space: nowrap; }
.stable .num { text-align: right; }
.stable tr:last-child td { border-bottom: 0; }
.stable tr[data-act] { cursor: pointer; }
.stable tr[data-act]:hover td { background: var(--sand); }
.stable .chev { color: var(--muted); width: 16px; text-align: right; }
.zones { display: flex; gap: 2px; width: 140px; height: 10px; }
.zones i { display: block; height: 100%; border-radius: 2px; min-width: 0; }
.logt { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--muted); }
.snote { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); vertical-align: 1px; }
.sport-more { margin-top: 12px; }
.sport-foot { margin-top: 14px; font-size: 13px; color: var(--muted); }
.sport-connect h2 { font-size: 24px; }

/* Séances en cartes sur téléphone */
.acts-cards { display: none; }
.actcard {
  display: grid; gap: 6px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--s-grid);
  padding: 12px 2px; cursor: pointer; color: inherit;
}
.actcard:last-child { border-bottom: 0; }
.actcard__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.actcard__top strong { font-size: 16px; }
.actcard__top .muted { margin-left: auto; font-size: 13px; }
.actcard__log { font-size: 14px; color: var(--ink-soft); }
.actcard__nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.actcard .zones { width: 100%; height: 8px; }
@media (max-width: 760px) {
  .acts-table { display: none; }
  .acts-cards { display: block; }
  .sport-top { align-items: stretch; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 8px 4px; }
  .sport .panel { padding: 16px 14px; }
}

/* Détail d'une séance */
.sdrawer-backdrop { position: fixed; inset: 0; background: rgba(22, 33, 31, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.sdrawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--sand); z-index: 51;
  overflow-y: auto; overscroll-behavior: contain; transform: translateX(100%); transition: transform .25s ease; box-shadow: -8px 0 32px rgba(0,0,0,.15);
}
body.sdrawer-open { overflow: hidden; }
body.sdrawer-open .sdrawer-backdrop { opacity: 1; pointer-events: auto; }
body.sdrawer-open .sdrawer { transform: none; }
.sdrawer__inner { padding: max(20px, env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.sdrawer__head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.sdrawer__head h2 { font-size: 26px; }
.sdrawer__head h2 .muted { font-family: var(--sans); font-size: 16px; }
.sdrawer__head p { margin-top: 4px; color: var(--ink-soft); }
.sclose { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 22px; line-height: 1; cursor: pointer; }
.sport-coachnote { margin: 0 0 16px; }
.sdrawer .commentbox { margin-top: 0; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, calc(50% - 5px)), 1fr)); gap: 10px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tile__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile__value { font-family: var(--serif); font-size: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile__value small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 3px; }
.tile__hint { font-size: 12px; color: var(--muted); margin-top: 1px; }
.mrow + .mrow { margin-top: 6px; }
.mlabel { font-size: 12px; color: var(--ink-soft); margin: 0 0 2px 40px; }
.zrow { display: grid; grid-template-columns: 92px 1fr 104px; gap: 12px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; padding: 5px 0; }
.zrow__l { line-height: 1.25; }
.zrow__l small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.zrow .bar { height: 10px; background: var(--s-grid); border-radius: 3px; overflow: hidden; }
.zrow .bar i { display: block; height: 100%; border-radius: 3px; }
.zrow .t { text-align: right; color: var(--ink-soft); white-space: nowrap; }
.tile__value.is-text { font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.snote-txt { font-size: 12px; color: var(--muted); margin-top: 10px; }
.steps { margin: 0; padding-left: 18px; }
.steps li { margin: 4px 0; }
.prog { font-size: 15px; line-height: 1.55; }
.prog p { margin: 10px 0 4px; }
.prog p:first-child { margin-top: 0; }
.prog ul { margin: 2px 0 6px; padding-left: 20px; }
.prog ul ul { margin: 0; }
.prog strong { font-weight: 600; }
.prog-title { font-size: 14px; color: var(--ink-soft); margin: -4px 0 10px; }
@media (max-width: 760px) {
  .sdrawer__inner { padding-left: 14px; padding-right: 14px; }
  .zrow { grid-template-columns: 82px 1fr 92px; gap: 8px; }
}
