/* Coach — une interface mobile calme, lisible et tactile. */
:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --num: var(--font);
  --bg: #f5f5f7; --card: #fff; --ink: #1d1d1f; --muted: #6e6e73; --soft: #515154;
  --line: #e8e8ed; --chip: #ededf0; --accent: #0071e3; --accent-soft: #edf5ff;
  --green: #24834b; --green-ink: #227044; --green-soft: #edf7ef;
  --orange: #a85b08; --orange-ink: #945207; --orange-soft: #fff2dd; --orange-bg: #fffbf4; --orange-line: #f0dfc3;
  --red: #c53532; --red-ink: #b0302d; --red-soft: #ffedeb; --red-bg: #fff7f6; --red-line: #f3d9d6;
  --dark: #f5f5f7; --dark-line: #e3e3e8; --dark-muted: #6e6e73; --work: #0071e3;
  --glass: rgba(255,255,255,.88); --input: #f5f5f7; --shadow: 0 2px 8px #1d1d1f03, 0 16px 40px #1d1d1f04;
  --radius: 24px; --dock-bottom: max(10px, env(safe-area-inset-bottom)); --dock-height: 66px;
  --keyboard-inset: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-padding-bottom: 210px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
button, a, input, textarea, select { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
a { color: var(--accent); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, a, summary { -webkit-user-select: none; user-select: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { max-width: 600px; margin: 0 auto; min-height: 100dvh; padding: max(32px, env(safe-area-inset-top)) 20px calc(100px + env(safe-area-inset-bottom)); }
body.in-coach .app { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
#view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
#view > * { min-width: 0; }
.loading, .error { color: var(--muted); padding: 48px 4px; }
.error { color: var(--red-ink); }
.hint { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); letter-spacing: 0; }
.hint.center { text-align: center; padding: 16px 12px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 5px 3px 10px; }
.head small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 3px; }
.head small::first-letter { text-transform: uppercase; }
.head h1 { margin: 0; font-size: 34px; line-height: 1.16; font-weight: 700; letter-spacing: -.055em; }
.head .side { max-width: 100px; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: right; }
.header-action { display: grid; place-items: center; width: 46px; height: 46px; background: var(--card); color: var(--ink); border-radius: 50%; box-shadow: var(--shadow); }
.header-action svg { width: 23px; height: 23px; }
.back { text-decoration: none; align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; font-size: 15px; background: none; border: 0; padding: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
.card p { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12px; padding: 6px 11px; border-radius: 9px; background: var(--chip); color: var(--soft); }
.warning { display: flex; gap: 10px; background: var(--red-bg); padding: 16px; border-radius: 16px; color: var(--red-ink); font-size: 14px; }
.warning.card { flex-direction: row; box-shadow: none; }
.badge { flex: none; font-size: 10px; font-weight: 600; padding: 4px 7px; border-radius: 6px; letter-spacing: 0; }
.badge.ok { background: var(--green-soft); color: var(--green-ink); }
.badge.warn { background: var(--orange-soft); color: var(--orange-ink); }
.badge.bad { background: var(--red-soft); color: var(--red-ink); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* La séance est le point d'entrée, le détail reste à un geste. */
.today { background: var(--card); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.today-head { display: flex; flex-direction: column; width: 100%; padding: 20px 22px 12px; gap: 18px; border: 0; background: none; text-align: left; }
.today-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.eyebrow { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .025em; }
.readiness { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green-ink); font-weight: 500; white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--green); }
.level-orange .readiness { color: var(--orange-ink); }
.level-orange .dot { background: var(--orange); }
.level-rouge .readiness { color: var(--red-ink); }
.level-rouge .dot { background: var(--red); }
.today-main { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.today-main > b { font-size: 18px; font-weight: 600; letter-spacing: -.03em; }
.today-prescription { font-size: clamp(30px, 9.5vw, 46px); font-weight: 650; line-height: 1.12; letter-spacing: -.055em; overflow-wrap: anywhere; }
.today-main .target { color: var(--muted); font-size: 15px; }
.today-disclosure { min-height: 44px; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--accent); }
.today-disclosure svg { width: 15px; height: 15px; }
.chev { transition: transform .2s; }
.chev.up { transform: rotate(90deg); }
.today-body { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 22px; }
.warn-line { margin: 0; display: flex; gap: 8px; font-size: 14px; color: var(--red-ink); }
.planned { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; }
.planned span { font-size: 11px; color: var(--muted); }
.planned s { color: var(--muted); }
.also { margin: 0; font-size: 13px; color: var(--soft); }
.reasons-list { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.today-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ghost-btn { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 13px; border: 0; background: var(--input); font-weight: 500; font-size: 13px; color: var(--ink); text-decoration: none; }
.ghost-btn svg { width: 17px; height: 17px; }
.as-link { align-self: flex-start; }
.session { background: var(--dark); color: var(--ink); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.session .top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--dark-muted); gap: 8px; }
.session .top span { display: inline-flex; align-items: center; gap: 6px; }
.session .top svg { width: 16px; height: 16px; }
.session .big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.session .headline { font-size: 34px; font-weight: 650; line-height: 1.12; letter-spacing: -.05em; overflow-wrap: anywhere; }
.session .target { font-size: 17px; color: var(--accent); }
.bar { display: flex; gap: 3px; height: 40px; align-items: flex-end; }
.bar span { display: block; border-radius: 4px 4px 2px 2px; min-width: 2px; }
.bar .k-warm { height: 40%; background: #bacfe3; }
.bar .k-easy { height: 45%; background: var(--work); opacity: .6; }
.bar .k-work { height: 100%; background: var(--work); }
.bar .k-recovery { height: 30%; background: #c8d5e1; }
.captions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; font-size: 10px; color: var(--dark-muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding-top: 14px; border-top: 1px solid var(--dark-line); }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 19px; font-weight: 600; letter-spacing: -.04em; }
.stats span { font-size: 10px; color: var(--dark-muted); }
.session .notes { margin: 0; font-size: 12px; color: var(--dark-muted); }

/* Conversation et saisie : commandes à portée du pouce. */
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 4px 0; }
.section-heading h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.035em; }
.section-heading > span { font-size: 11px; color: var(--muted); text-align: right; }
.chat { display: flex; flex-direction: column; gap: 22px; }
.chat-empty { text-align: center; padding: 30px 12px; color: var(--muted); }
.coach-emblem { display: grid; place-items: center; margin: 0 auto 14px; width: 44px; height: 44px; border-radius: 15px; color: var(--soft); background: var(--card); }
.chat-empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 19px; font-weight: 600; }
.chat-empty p { font-size: 14px; margin: 0; line-height: 1.65; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 94%; min-width: 0; }
.msg.user { align-self: flex-end; align-items: flex-end; max-width: 86%; }
.msg.coach { align-self: flex-start; }
.bubble { padding: 15px 18px; border-radius: 22px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.msg.coach .bubble { background: var(--card); border-bottom-left-radius: 7px; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 7px; }
.msg time { font-size: 10px; color: var(--muted); padding: 0 7px; }
.msg-kind { font-size: 11px; font-weight: 500; color: var(--muted); padding: 0 7px; }
.typing { flex-direction: row; gap: 5px; padding: 18px; background: var(--card); border-radius: 20px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
.mcard { background: var(--card); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; font-size: 14px; }
.mcard p { margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.mcard .session { margin: 0; padding: 16px; }
.mcard .rest { color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stats-line { color: var(--soft); font-size: 14px; }
.week ul { margin: 0; padding: 0; list-style: none; }
.week li { display: grid; grid-template-columns: 62px 1fr auto; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.week li span:first-child { color: var(--muted); }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--dock-height) + var(--dock-bottom) + 6px); z-index: 4; background: linear-gradient(to top, var(--bg) 78%, transparent); padding: 18px 20px 10px; }
.composer > * { max-width: 560px; margin: 0 auto; }
.composer .row { display: flex; align-items: flex-end; gap: 6px; background: var(--card); padding: 5px; border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 4px 20px #00000004; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; border: 0; border-radius: 0; padding: 10px 0; font-size: 16px; line-height: 24px; background: transparent; color: var(--ink); }
.composer textarea:focus { outline: none; }
.composer .row:focus-within { border-color: var(--accent); }
.composer textarea::placeholder { color: var(--muted); }
.suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; min-height: 38px; padding: 0 13px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); font-size: 12px; color: var(--soft); }
.icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--chip); color: var(--soft); display: inline-flex; align-items: center; justify-content: center; }
.composer .icon-btn { background: transparent; }
.icon-btn.primary-icon { background: var(--ink); color: var(--card); }
.keyboard-open .tabs { visibility: hidden; pointer-events: none; }
.keyboard-open .composer { bottom: var(--keyboard-inset); padding-bottom: 10px; }

/* L'accueil garde le détail et les raccourcis à la demande. */
.profile-link { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; border-radius: 24px; padding: 0 12px; background: var(--card); color: var(--soft); text-decoration: none; font-size: 12px; }
.profile-link svg { width: 18px; height: 18px; }
.today-footer { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); }
.feeling-button { min-height: 44px; padding: 8px 11px; border: 0; border-radius: 12px; background: var(--input); font-size: 12px; color: var(--soft); }
.today-feeling { padding: 0 20px 20px; }
.today-main .target { font-size: 14px; }
.composer-options { position: absolute; bottom: calc(100% - 10px); left: 20px; right: 20px; max-width: 560px; margin: 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 8px 35px #00000018; max-height: min(380px, 50dvh); overflow-y: auto; }
.composer-option { min-height: 44px; display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; background: none; border: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.menu-label { display: block; color: var(--muted); font-size: 11px; padding: 12px 12px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
.profile-identity { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 16px 0 24px; gap: 10px; }
.profile-avatar { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--chip); color: var(--soft); font-size: 26px; font-weight: 500; }
.profile-avatar svg { width: 30px; height: 30px; }
.profile-identity h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.profile-identity p { margin: 0; font-size: 13px; color: var(--muted); }
.profile-menu { border-radius: 22px; overflow: hidden; background: var(--card); }
.profile-row { min-height: 88px; padding: 18px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.profile-row + .profile-row { border-top: 1px solid var(--line); }
.profile-row > span:not(.profile-row-icon) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.profile-row b { font-size: 15px; font-weight: 500; }
.profile-row small { font-size: 12px; color: var(--muted); }
.profile-row > svg { width: 16px; height: 16px; color: var(--muted); }
.profile-row-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--input); color: var(--soft); }
.quiet-details { color: var(--muted); font-size: 13px; padding: 0 4px; }
.quiet-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.quiet-details summary::after { content: "+"; margin-left: auto; font-size: 18px; }
.quiet-details[open] summary::after { content: "−"; }
.quiet-details summary::-webkit-details-marker { display: none; }
.quiet-details p { margin: 0 0 12px; }
.filters.compact-filters { flex-direction: row; }
.compact-filters select { background: var(--card); font-size: 14px; }
.compact-filters select:first-child { flex: 0 0 105px; }
.plan-overview { justify-content: space-between; background: var(--card); }
.form-section { border-top: 1px solid var(--line); }
.form-section > summary { display: flex; align-items: center; gap: 12px; min-height: 76px; cursor: pointer; list-style: none; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.form-section summary b { font-size: 14px; font-weight: 500; }
.form-section summary small { font-size: 11px; color: var(--muted); }
.form-section summary svg { width: 15px; height: 15px; color: var(--muted); transition: transform .2s; }
.form-section[open] > summary svg { transform: rotate(90deg); }
.disclosure-body { display: flex; flex-direction: column; gap: 22px; padding: 4px 0 18px; }

/* Formulaires groupés et contrôles natifs. */
.stack { display: flex; flex-direction: column; gap: 22px; }
#goal { background: var(--card); border-radius: var(--radius); padding: 22px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { font-size: 13px; font-weight: 500; color: var(--soft); padding: 0 0 10px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; color: var(--soft); }
input:not([type=checkbox]):not([type=range]):not([type=file]), select { min-height: 48px; border: 1px solid transparent; border-radius: 12px; background: var(--input); padding: 10px 12px; font-size: 16px; color: var(--ink); width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input::placeholder { color: var(--muted); }
.opt { min-height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); font-weight: 500; font-size: 13px; padding: 0 11px; }
.opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.opt.pill { border-radius: 11px; padding: 0 13px; }
.opt.small { min-height: 44px; padding: 0 11px; font-size: 12px; }
.opt.small b { font-size: 15px; }
.seg { display: flex; gap: 3px; background: var(--chip); border-radius: 13px; padding: 4px; min-width: 0; }
.seg .opt { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 5px; background: transparent; border: 0; color: var(--soft); border-radius: 9px; font-size: 12px; }
.seg .opt[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px #00000014; }
.days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.days .opt { font-weight: 500; padding: 0; border: 0; background: var(--input); }
.days .opt[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.grid2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.perf { display: grid; grid-template-columns: 1fr 1fr 44px; grid-template-areas: "distance time remove" "date date remove"; gap: 7px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.perf select { grid-area: distance; }
.perf input:not([type=date]) { grid-area: time; }
.perf input[type=date] { grid-area: date; }
.perf button { grid-area: remove; align-self: center; }
.check { min-height: 48px; display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 8px 14px; font-size: 14px; }
.card .check, fieldset .check { padding-left: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.primary { min-height: 50px; border: 0; border-radius: 15px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; padding: 12px 18px; }
.primary.small { min-height: 48px; font-size: 14px; padding: 10px 14px; }
.primary.as-link { display: flex; align-items: center; justify-content: center; text-decoration: none; align-self: stretch; }
.ghost { min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 14px; }
.ghost.left { align-self: flex-start; padding: 0; color: var(--accent); }
.inline-form { display: flex; gap: 8px; align-items: stretch; }
.inline-form input { flex: 1; }
.status { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.status.ok { color: var(--green-ink); } .status.bad { color: var(--red-ink); }
.status svg { width: 17px; height: 17px; }
.with-icon { display: flex; align-items: center; gap: 10px; }
.with-icon svg { width: 18px; height: 18px; color: var(--muted); }
#sync-state { display: flex; flex-direction: column; gap: 7px; }
.howto { background: var(--input); border-radius: 15px; padding: 8px 14px; font-size: 13px; }
.howto summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.howto p { margin: 12px 0 6px; }
.howto ol, .steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--soft); }
label.primary.disabled { opacity: .5; pointer-events: none; }
.progress { height: 5px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress span { display: block; width: 35%; height: 100%; background: var(--accent); border-radius: 999px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.notes-edit { margin: 0; padding: 0; list-style: none; }
.notes-edit li { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.notes-edit li:last-child { border: 0; }
.notes-edit li span { flex: 1; }
.summary .verdict { font-size: 27px; font-weight: 650; line-height: 1.2; letter-spacing: -.04em; }
.summary.tone-ok .verdict { color: var(--green-ink); }
.summary.tone-warn .verdict { color: var(--orange-ink); }
.summary.tone-bad .verdict { color: var(--red-ink); }
.summary small { display: block; font-size: 11px; color: var(--muted); }
.summary b { font-size: 21px; font-weight: 600; letter-spacing: -.04em; }
.notes-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--soft); display: flex; flex-direction: column; gap: 7px; }
.efforts { margin: 0; padding: 0; list-style: none; background: var(--input); border-radius: 14px; }
.efforts li { display: flex; align-items: center; gap: 10px; padding: 14px; }
.efforts li + li { border-top: 1px solid var(--line); }
.efforts .main { display: flex; flex-direction: column; min-width: 0; }
.efforts b { font-size: 18px; font-weight: 600; }
.efforts small { font-size: 11px; color: var(--muted); }
.efforts .badge { margin-left: auto; }

/* Programme et historique. */
.week-nav { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.week-nav > div { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.week-nav b { font-size: 17px; font-weight: 600; }
.week-nav small { font-size: 11px; color: var(--muted); }
.week-nav .icon-btn { background: var(--card); }
.days-list, .acts { margin: 0; padding: 0; list-style: none; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.days-list li { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.days-list li + li, .acts li + li { border-top: 1px solid var(--line); }
.days-list li.is-today { background: var(--accent-soft); }
.days-list li.is-past .pmain b, .days-list li.is-past .rest-day { color: var(--muted); }
.dayname { width: 32px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 22px; font-weight: 500; line-height: 1.1; padding-top: 2px; font-variant-numeric: tabular-nums; }
.dayname b { font-size: 10px; font-weight: 500; text-transform: uppercase; color: var(--muted); }
.is-today .dayname { color: var(--accent); } .is-today .dayname b { color: var(--accent); }
.day-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rest-day { font-size: 14px; color: var(--muted); padding-top: 12px; }
.pitem summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; min-height: 44px; }
.pitem summary::-webkit-details-marker { display: none; }
.pitem[open] summary { margin-bottom: 14px; }
.pmain { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pmain b { font-size: 14px; font-weight: 600; }
.pmain small { font-size: 11px; color: var(--muted); }
.sport-dot.small { width: 28px; height: 28px; }
.sport-dot.small svg { width: 15px; height: 15px; }
.timeline { position: relative; display: flex; gap: 4px; padding-bottom: 18px; margin-top: 4px; }
.timeline span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.timeline i { display: block; height: 6px; border-radius: 4px; background: var(--accent); opacity: .35; }
.timeline span:nth-child(2) i { opacity: .55; } .timeline span:nth-child(n+3) i { opacity: .85; }
.timeline small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .now { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 2px; background: var(--ink); }
.month-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.mweek { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head nums" "bar bar" "dots dots"; gap: 12px; text-align: left; background: var(--card); border: 1px solid transparent; border-radius: 20px; padding: 18px; }
.mweek.is-current { border-color: var(--accent); }
.mhead { grid-area: head; display: flex; flex-direction: column; min-width: 0; }
.mhead b { font-size: 15px; font-weight: 600; }
.mhead small, .mnums small { font-size: 11px; color: var(--muted); }
.mnums { grid-area: nums; display: flex; flex-direction: column; align-items: flex-end; }
.mnums b { font-size: 18px; font-weight: 600; }
.mbar { grid-area: bar; height: 4px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.mdots { grid-area: dots; display: flex; gap: 6px; }
.mdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); opacity: .4; }
.mdots i.q { opacity: 1; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.tiles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: 20px; padding: 18px 14px; display: flex; flex-direction: column; }
.tile b { font-size: 27px; font-weight: 600; line-height: 1.2; letter-spacing: -.05em; }
.tile b small { font-size: 13px; font-weight: 400; }
.tile span { font-size: 11px; color: var(--muted); margin-top: 5px; }
.chart-card { gap: 16px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; fill: currentColor; stroke: none; stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.chart .hit { cursor: crosshair; }
.chart .cross { stroke: var(--soft); stroke-width: 1; stroke-dasharray: 3 3; }
.tooltip { position: absolute; top: -6px; transform: translateY(-100%); background: var(--ink); color: var(--card); border-radius: 12px; padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; white-space: nowrap; z-index: 2; }
.tooltip b { font-size: 13px; }
.line-chart { display: flex; flex-direction: column; gap: 8px; }
.line-chart + .line-chart { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.line-chart h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--soft); }
.week-group { display: flex; flex-direction: column; gap: 10px; }
.week-group h3 { margin: 8px 4px 0; font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.week-group h3 span { font-size: 11px; font-weight: 400; color: var(--muted); }
.act { display: flex; align-items: center; gap: 10px; padding: 17px 15px; text-decoration: none; color: var(--ink); min-height: 76px; }
.sport-dot { width: 36px; height: 36px; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.sport-dot svg { width: 18px; height: 18px; }
.sport-dot.big { width: 48px; height: 48px; border-radius: 16px; }
.sport-dot.big svg { width: 24px; height: 24px; }
.act-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; }
.act-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-main small, .act-nums small { font-size: 11px; color: var(--muted); }
.act-main small::first-letter { text-transform: uppercase; }
.act-nums { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.act-nums b { font-size: 15px; font-weight: 500; }
.act-head { display: flex; align-items: center; gap: 12px; }
.act-head small { display: block; font-size: 12px; color: var(--muted); }
.act-head small::first-letter { text-transform: uppercase; }
.act-head h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; line-height: 1.2; }
.stat-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.stat-grid div { background: var(--card); border-radius: 18px; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.stat-grid span { font-size: 11px; color: var(--muted); }
.stat-grid b { font-size: 21px; font-weight: 600; letter-spacing: -.045em; }
.rpe { font-size: 20px; }
.int-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.int-table th { text-align: left; font-size: 10px; font-weight: 500; color: var(--muted); padding: 8px 3px; }
.int-table td { padding: 10px 3px; border-top: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Fond fixe sous la barre flottante : le contenu qui défile ne reste pas visible autour et sous la barre.
   Il passe sous la zone de saisie (z-index 4) et sous la barre (z-index 5). */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none;
  height: calc(var(--dock-height) + var(--dock-bottom) + 22px);
  background: linear-gradient(to top, var(--bg) calc(100% - 22px), transparent); }
.in-login::after, .keyboard-open::after { display: none; }

/* Barre de navigation en verre dépoli. */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: var(--dock-bottom); width: calc(100% - 24px); max-width: 440px; height: var(--dock-height); padding: 5px; background: var(--glass); border: 1px solid rgba(150,150,160,.13); border-radius: 28px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; z-index: 5; backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); box-shadow: 0 6px 30px #0000000c, inset 0 1px 0 #ffffff50; }
.tab { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 22px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; transition: background .2s, color .2s; }
.tab svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tab.is-active { background: var(--chip); color: var(--ink); font-weight: 600; }
.toast { position: fixed; left: 50%; top: max(16px,env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--card); padding: 14px 18px; border-radius: 18px; font-size: 13px; z-index: 10; box-shadow: 0 8px 30px #00000020; }
.toast.bad { background: var(--red-ink); color: #fff; }
@media (hover:hover) { button:not(:disabled):hover, .ghost-btn:hover { filter: brightness(.97); } .act:hover { background: var(--input); } }
@media (max-width: 480px) { #goal > .grid2 { grid-template-columns: 1fr; } .tiles { grid-template-columns: repeat(2,minmax(0,1fr)); } .tile { padding: 18px; } }
@media (max-width: 360px) {
  .app { padding-left: 14px; padding-right: 14px; }
  .today-head { padding: 20px; }
  .card, #goal { padding: 18px; }
  .readiness { font-size: 10px; }
  .eyebrow { font-size: 10px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .act .badge { font-size: 9px; padding: 4px 5px; }
  .composer { padding-left: 14px; padding-right: 14px; }
  .today-actions .ghost-btn { flex: 1; }
}
@media (min-width: 768px) { .app { padding-top: 48px; } .head h1 { font-size: 38px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) {
    color-scheme: dark;
    --bg: #101012; --card: #1c1c1e; --ink: #f5f5f7; --muted: #a1a1a8; --soft: #bfbfc5;
    --line: #333336; --chip: #2c2c2f; --input: #27272a; --accent: #6aafff; --accent-soft: #1b2a3e;
    --green: #65bf88; --green-ink: #83cda0; --green-soft: #203428;
    --orange: #e4ad62; --orange-ink: #e9bc80; --orange-soft: #392c1c; --orange-bg: #29231d; --orange-line: #504130;
    --red: #f07e79; --red-ink: #ffa49e; --red-soft: #3c2626; --red-bg: #2b2020; --red-line: #51302e;
    --dark: #252528; --dark-line: #3b3b3e; --dark-muted: #adadb5; --work: #6aafff;
    --glass: rgba(35,35,38,.9); --shadow: none;
  }
  :root:not([data-appearance="light"]) .primary, :root:not([data-appearance="light"]) .msg.user .bubble { background: #176dd2; color: #fff; }
  :root:not([data-appearance="light"]) .bar .k-warm, :root:not([data-appearance="light"]) .bar .k-recovery { background: #4b6078; }
}
:root[data-appearance="dark"] {
    color-scheme: dark;
    --bg: #101012; --card: #1c1c1e; --ink: #f5f5f7; --muted: #a1a1a8; --soft: #bfbfc5;
    --line: #333336; --chip: #2c2c2f; --input: #27272a; --accent: #6aafff; --accent-soft: #1b2a3e;
    --green: #65bf88; --green-ink: #83cda0; --green-soft: #203428;
    --orange: #e4ad62; --orange-ink: #e9bc80; --orange-soft: #392c1c; --orange-bg: #29231d; --orange-line: #504130;
    --red: #f07e79; --red-ink: #ffa49e; --red-soft: #3c2626; --red-bg: #2b2020; --red-line: #51302e;
    --dark: #252528; --dark-line: #3b3b3e; --dark-muted: #adadb5; --work: #6aafff;
    --glass: rgba(35,35,38,.9); --shadow: none;
  }
:root[data-appearance="dark"] .primary, :root[data-appearance="dark"] .msg.user .bubble { background: #176dd2; color: #fff; }
:root[data-appearance="dark"] .bar .k-warm, :root[data-appearance="dark"] .bar .k-recovery { background: #4b6078; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .progress span { width: 100%; opacity: .5; }
}
@media (prefers-reduced-transparency: reduce) { .tabs { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; } }

.in-login .tabs { display: none; }
.in-login .app { padding-bottom: 32px; }
.login-card .ghost-btn { width: 100%; }

/* Connexion : film sportif discret, typographie ample et panneau de verre clair. */
body.in-login { background: #17221f; }
.in-login .app:has(.login-layout) { max-width: 1220px; padding: max(30px,env(safe-area-inset-top)) 48px max(24px,env(safe-area-inset-bottom)); }
.in-login #view:has(.login-layout) { min-height: calc(100dvh - 54px); gap: 0; isolation: isolate; }
.login-backdrop { position: fixed; inset: 0; z-index: -2; background: #263a30 url('media/login-running.jpg') center / cover no-repeat; overflow: hidden; }
.login-film { width: 100%; height: 100%; object-fit: cover; object-position: 52% center; filter: blur(3px) saturate(.7); transform: scale(1.035); }
.login-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(7,20,16,.66),rgba(11,20,17,.22)),linear-gradient(0deg,rgba(8,18,15,.75),transparent 65%,rgba(6,15,11,.22)); }
.login-brand { display: flex; align-items: center; gap: 11px; color: #fff; font-size: 24px; letter-spacing: -.06em; font-weight: 650; }
.login-emblem { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #ffffff45; border-radius: 12px; background: #ffffff12; backdrop-filter: blur(16px); }
.login-emblem svg { width: 25px; height: 25px; stroke-width: 2; }
.login-brand-detail { margin-left: auto; font-size: 12px; font-weight: 400; letter-spacing: .02em; color: #ffffffb8; }
.login-layout { flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 370px; align-items: center; gap: 60px; padding: 75px 0; }
.login-story { color: #fff; }
.login-eyebrow { margin: 0 0 23px; font-size: 11px; letter-spacing: .19em; text-transform: uppercase; font-weight: 600; color: #e1eaded9; }
.login-story h1 { margin: 0; font-size: clamp(44px,5.8vw,76px); font-weight: 550; letter-spacing: -.065em; line-height: 1.04; text-wrap: balance; }
.login-intro { margin: 26px 0 0; font-size: 17px; font-weight: 400; line-height: 1.65; letter-spacing: -.02em; color: #ffffffcc; }
.login-sports { margin-top: 33px; display: flex; align-items: center; gap: 13px; font-size: 11px; letter-spacing: .07em; color: #ffffffb8; }
.login-sports i { width: 3px; height: 3px; background: #ffffff66; border-radius: 50%; }
.login-panel { padding: 32px 28px 25px; border-radius: 30px; border: 1px solid #ffffffbd; background: rgba(250,251,248,.94); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: 0 24px 80px #06150d35,inset 0 1px 0 #fff; color: #202722; color-scheme: light; }
.login-panel-kicker { display: block; font-size: 9px; font-weight: 650; letter-spacing: .17em; color: #747e74; margin-bottom: 12px; }
.login-panel h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.055em; line-height: 1.2; }
.login-panel > p { color: #737970; font-size: 12px; margin: 10px 0 25px; }
.login-options { display: flex; flex-direction: column; gap: 10px; }
.login-provider { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 53px; padding: 12px 16px; border: 1px solid #dfe4dc; border-radius: 15px; background: #fff; color: #242c25; font-size: 13px; font-weight: 550; box-shadow: 0 2px 4px #15271003; transition: transform .2s,box-shadow .2s; }
.login-provider svg { width: 19px; height: 19px; }
.login-provider .google-mark { stroke: none; }
.login-provider-email { background: transparent; border-color: #d6ddd3; }
.login-provider:hover { box-shadow: 0 5px 15px #1527100a; transform: translateY(-1px); }
.login-provider:active { transform: scale(.985); }
.login-signup { padding: 24px 0 21px; font-size: 11px; text-align: center; color: #71796f; border-bottom: 1px solid #dfe4da; }
.login-signup button { display: inline; padding: 10px 2px; margin: -10px 0; min-height: 40px; border: 0; background: none; color: #263f2c; font-size: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.login-panel > .login-reassurance { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 10px; margin: 18px 0 0; color: #7c8478; }
.login-reassurance svg { width: 12px; height: 12px; }
.login-footer { display: flex; justify-content: space-between; align-items: center; min-height: 40px; color: #ffffff8f; font-size: 10px; letter-spacing: .035em; }
.login-motion { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #ffffff40; border-radius: 50%; color: #fff; background: #ffffff0d; }
.login-motion svg { width: 16px; height: 16px; }
.in-login .login-panel button:focus-visible { outline-color: #426e46; }
@media (max-width: 760px) {
  .in-login .app:has(.login-layout) { padding: max(22px,env(safe-area-inset-top)) 24px max(14px,env(safe-area-inset-bottom)); }
  .in-login #view:has(.login-layout) { min-height: calc(100dvh - 36px); }
  .login-brand { font-size: 22px; }
  .login-brand-detail { font-size: 11px; }
  .login-layout { grid-template-columns: 1fr; align-content: center; gap: 31px; padding: 44px 0 24px; width: 100%; max-width: 440px; margin: 0 auto; }
  .login-eyebrow { margin-bottom: 16px; font-size: 9px; }
  .login-story h1 { font-size: clamp(39px,10.8vw,58px); }
  .login-intro { font-size: 13px; margin-top: 18px; }
  .login-sports { margin-top: 19px; font-size: 10px; }
  .login-panel { padding: 25px 23px 21px; border-radius: 26px; }
  .login-panel h2 { font-size: 25px; }
  .login-panel-kicker { font-size: 8px; margin-bottom: 9px; }
  .login-panel > p { margin-bottom: 21px; }
  .login-signup { padding: 19px 0 17px; }
  .login-panel > .login-reassurance { margin: 14px 0 0; }
  .login-footer { font-size: 9px; }
  .login-backdrop::after { background: linear-gradient(0deg,rgba(8,18,15,.7),rgba(10,25,16,.35) 60%,rgba(9,20,14,.5)); }
}
@media (max-width: 760px) and (max-height: 750px) {
  .login-layout { padding-top: 25px; gap: 24px; }
  .login-intro { margin-top: 13px; }
  .login-sports { display: none; }
}
@media (prefers-reduced-transparency: reduce) { .login-panel { background: #fafbf8; backdrop-filter: none; -webkit-backdrop-filter: none; } }
