/* Un thème par sport : le fond, l'accent et l'illustration d'en-tête changent avec l'espace.
   hub = semaine, progrès, réglages. esc = escalade (calcaire et orange), sal = salle (fitness park : bitume et jaune),
   run = course (sentier et vert), soup = souplesse (beige, brun et blanc cassé). */
:root {
  --bg: #ECEFF2; --surface: #FFFFFF; --ink: #12171D; --mute: #59636F; --line: #DADFE5; --soft: #E4E8EC;
  --ac: #1E2733; --acink: #FFFFFF; --h1: #1B2431; --h2: #2F3D52; --h3: #8FA3BF;
  --esc: #D9482B; --sal: #2B3036; --run: #1F8A55; --soup: #8A6A47;
  --warn: #8A5B00; --warnbg: #FBF0D2; --bad: #B3261E;
  --f-disp: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
:root[data-sport="esc"]  { --bg: #EDEAE6; --surface: #FBFAF8; --ink: #1D1814; --mute: #6B625A; --line: #DDD6CE; --soft: #E5DFD8; --ac: #D9482B; --acink: #FFFFFF; --h1: #A9341B; --h2: #DE5B38; --h3: #F6B08E; }
:root[data-sport="sal"] { --bg: #E6E7E2; --surface: #FBFBF8; --ink: #16181B; --mute: #5E6258; --line: #D5D6CF; --soft: #DEDFD8; --ac: #2B3036; --acink: #FFD21F; --h1: #1F2328; --h2: #3A4048; --h3: #FFD21F; }
:root[data-sport="run"]  { --bg: #E7EFE9; --surface: #FFFFFF; --ink: #10231A; --mute: #51675A; --line: #CFDCD3; --soft: #DDE8E0; --ac: #1F7A4D; --acink: #FFFFFF; --h1: #0E4A2F; --h2: #2A8656; --h3: #B5E27A; }
:root[data-sport="soup"] { --bg: #F1EAE0; --surface: #FBF8F3; --ink: #2D241B; --mute: #7A6B5A; --line: #E2D6C6; --soft: #EAE0D2; --ac: #7A5A3C; --acink: #FFFFFF; --h1: #6B4F36; --h2: #A58463; --h3: #EBD9BE; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1216; --surface: #161C22; --ink: #E9EEF3; --mute: #93A0AD; --line: #26303A; --soft: #1D252D;
    --ac: #E9EEF3; --acink: #0E1216; --h1: #18212B; --h2: #2B3A4C; --h3: #7F95B0;
    --esc: #F06A47; --sal: #FFD21F; --run: #4FC088; --soup: #C8A67E;
    --warn: #E6B84D; --warnbg: #2B2412; --bad: #FF8A80; color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-sport="esc"]  { --bg: #16110E; --surface: #211A16; --ink: #F2ECE6; --mute: #A99E94; --line: #352C26; --soft: #2A221D; --ac: #F06A47; --acink: #16110E; --h1: #6E2515; --h2: #B8452A; --h3: #F4A07A; }
  :root:not([data-theme="light"])[data-sport="sal"] { --bg: #101214; --surface: #1A1D20; --ink: #EEF0EA; --mute: #9BA096; --line: #2B3035; --soft: #22262A; --ac: #FFD21F; --acink: #16181B; --h1: #1A1D20; --h2: #2E343A; --h3: #FFD21F; }
  :root:not([data-theme="light"])[data-sport="run"]  { --bg: #0C1712; --surface: #14231B; --ink: #E6F2EA; --mute: #90AA9A; --line: #223A2D; --soft: #1A2E23; --ac: #4FC088; --acink: #0C1712; --h1: #0C4128; --h2: #1F7A4D; --h3: #B7E37A; }
  :root:not([data-theme="light"])[data-sport="soup"] { --bg: #17120D; --surface: #211A13; --ink: #F1E8DB; --mute: #B5A590; --line: #3A2F23; --soft: #2A2118; --ac: #D2B48C; --acink: #1A140D; --h1: #3B2C1E; --h2: #6F5237; --h3: #E0C9A6; }
}
:root[data-theme="dark"] {
  --bg: #0E1216; --surface: #161C22; --ink: #E9EEF3; --mute: #93A0AD; --line: #26303A; --soft: #1D252D;
  --ac: #E9EEF3; --acink: #0E1216; --h1: #18212B; --h2: #2B3A4C; --h3: #7F95B0;
  --esc: #F06A47; --sal: #FFD21F; --run: #4FC088; --soup: #C8A67E;
  --warn: #E6B84D; --warnbg: #2B2412; --bad: #FF8A80; color-scheme: dark;
}
:root[data-theme="dark"][data-sport="esc"]  { --bg: #16110E; --surface: #211A16; --ink: #F2ECE6; --mute: #A99E94; --line: #352C26; --soft: #2A221D; --ac: #F06A47; --acink: #16110E; --h1: #6E2515; --h2: #B8452A; --h3: #F4A07A; }
:root[data-theme="dark"][data-sport="sal"] { --bg: #101214; --surface: #1A1D20; --ink: #EEF0EA; --mute: #9BA096; --line: #2B3035; --soft: #22262A; --ac: #FFD21F; --acink: #16181B; --h1: #1A1D20; --h2: #2E343A; --h3: #FFD21F; }
:root[data-theme="dark"][data-sport="run"]  { --bg: #0C1712; --surface: #14231B; --ink: #E6F2EA; --mute: #90AA9A; --line: #223A2D; --soft: #1A2E23; --ac: #4FC088; --acink: #0C1712; --h1: #0C4128; --h2: #1F7A4D; --h3: #B7E37A; }
:root[data-theme="dark"][data-sport="soup"] { --bg: #17120D; --surface: #211A13; --ink: #F1E8DB; --mute: #B5A590; --line: #3A2F23; --soft: #2A2118; --ac: #D2B48C; --acink: #1A140D; --h1: #3B2C1E; --h2: #6F5237; --h3: #E0C9A6; }
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  padding-block: 0 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  transition: background-color .3s;
}
body.noscroll { overflow: hidden; }
#app { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 700; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: 40px; line-height: 1; text-transform: uppercase; }
h2 { font-size: 26px; line-height: 1.05; }
h2 small { font-family: var(--f-mono); font-size: 12px; color: var(--mute); font-weight: 400; margin-left: 6px; }
h3 { font-size: 21px; line-height: 1.12; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.muted { color: var(--mute); }
.pad { padding: 0 4px; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.hint { font-size: 13px; color: var(--mute); }
.empty { color: var(--mute); padding: 6px 0; }
.big { font-family: var(--f-disp); font-size: 44px; line-height: 1; font-weight: 700; }
.big small { font-family: var(--f-body); font-size: 13px; font-weight: 400; color: var(--mute); }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.t-esc { --c: var(--esc); } .t-sal { --c: var(--sal); } .t-run { --c: var(--run); } .t-soup { --c: var(--soup); }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- En-tête illustré ---- */
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 26px; color: #fff; min-height: 210px; padding: 18px 20px 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  background: linear-gradient(150deg, var(--h1) 0%, var(--h2) 100%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.12) 55%, rgba(0,0,0,0) 80%); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero h1 { font-size: 52px; line-height: .92; color: #fff; }
.hero .eyebrow { color: rgba(255,255,255,.82); }
.hero p { color: rgba(255,255,255,.9); max-width: 36ch; }
.hero .objs { margin-top: 2px; }
.hero .obj { border-color: rgba(255,255,255,.45); color: #fff; }
.hero-btn { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; top: 12px; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; font-size: 24px; line-height: 1; }
.hero-btn:hover { background: rgba(255,255,255,.28); }
.hero-btn:focus-visible { outline: 2px solid #fff; }
.hero-btn.r { right: 12px; } .hero-btn.l { left: 12px; }
.hero.has-l { padding-top: 64px; }
.hero .pips i { background: rgba(255,255,255,.35); } .hero .pips i.on { background: #fff; }
.prog { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--ac); width: 0; border-radius: 999px; transition: width .3s; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: 0 10px 28px -22px rgba(0,0,0,.45); }
.card.current { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac); }
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.link { all: unset; cursor: pointer; color: var(--ac); font-weight: 600; font-size: 14px; align-self: flex-start; }
.link:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.deloadnote { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.objs { display: flex; flex-wrap: wrap; gap: 6px; }
.obj { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.alert { background: var(--warnbg); color: var(--warn); border-radius: 14px; padding: 11px 14px; font-weight: 500; }
.alert.sm { font-size: 13px; padding: 8px 11px; border-radius: 10px; }

/* ---- Semaine ---- */
.weeknav { display: flex; align-items: center; justify-content: space-between; }
.iconbtn { all: unset; box-sizing: border-box; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--ink); font-size: 24px; background: var(--surface); border: 1px solid var(--line); }
.iconbtn:focus-visible { outline: 2px solid var(--ac); }
.wk-t { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.wk-t b { font-family: var(--f-disp); font-size: 22px; }
.wk-t span { font-family: var(--f-mono); font-size: 12px; color: var(--mute); }
.weeksum { text-align: center; color: var(--mute); font-size: 14px; margin-top: -6px; }
.days { display: flex; flex-direction: column; gap: 10px; }
.days.one { gap: 8px; }
.day { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px; min-width: 0; }
.day.today { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac); }
.dcol { display: flex; flex-direction: column; align-items: center; padding: 9px 0; border-radius: 14px; background: var(--soft); align-self: start; }
.dcol b { font-family: var(--f-disp); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.dcol span { font-family: var(--f-disp); font-size: 30px; line-height: 1; font-weight: 700; }
.dcol i { font-style: normal; font-family: var(--f-mono); font-size: 9px; text-transform: uppercase; color: var(--mute); }
.day.today .dcol { background: var(--ac); color: var(--acink); }
.day.today .dcol b, .day.today .dcol i { color: inherit; opacity: .8; }
.dmain { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rest { color: var(--mute); padding: 10px 2px; }
.srow { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); }
.srow:hover { border-color: var(--c); }
.srow:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.srow.done { opacity: .6; }
.srow.done .sr-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.sr-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; }
.sr-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sr-title { font-family: var(--f-disp); font-size: 21px; line-height: 1.1; font-weight: 700; }
.sr-meta { font-size: 13px; color: var(--mute); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sr-st { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lightbadge, .donebadge { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--mute); background: var(--surface); }
.donebadge { color: var(--run); border-color: var(--run); }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 5px; height: 12px; border-radius: 2px; background: var(--line); display: block; }
.pips i.on { background: var(--ink); }
.dayacts { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { all: unset; box-sizing: border-box; cursor: pointer; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 11px; min-height: 34px; display: inline-flex; align-items: center; }
.mini:hover { border-color: var(--mute); }
.mini.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mini:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.mood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mood > span { font-size: 13px; color: var(--mute); margin-right: 4px; }
.soupline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: color-mix(in srgb, var(--soup) 8%, var(--surface)); }
.sl-t { flex: 1 1 150px; font-size: 14px; }

/* ---- Contrôles ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { all: unset; box-sizing: border-box; cursor: pointer; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; min-height: 36px; display: inline-flex; align-items: center; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.fl { font-family: var(--f-mono); font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.btn { all: unset; box-sizing: border-box; cursor: pointer; font-weight: 600; font-size: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 11px 16px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn:hover { border-color: var(--mute); }
.btn.pri { background: var(--ac); color: var(--acink); border-color: var(--ac); }
.btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.subtabs { display: flex; gap: 4px; overflow-x: auto; background: var(--soft); border-radius: 16px; padding: 4px; }
.st { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 9px 12px; font-weight: 600; color: var(--mute); border-radius: 12px; white-space: nowrap; }
.st.on { color: var(--ink); background: var(--surface); box-shadow: 0 1px 6px -2px rgba(0,0,0,.3); }
.st:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.search, input[type="text"], input[type="number"], input[type="date"], input[type="search"], input[type="email"], input[type="password"], select, textarea {
  font: inherit; font-size: 16px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); min-width: 0;
}
textarea { resize: vertical; }

/* ---- Banque et cartes ---- */
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bc-top { display: flex; justify-content: space-between; align-items: center; }
.bc-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--c); color: #fff; display: grid; place-items: center; }
.bc-ic .ic { width: 19px; height: 19px; }
.bc-meta { font-size: 13px; color: var(--mute); display: inline-flex; gap: 8px; align-items: center; }
.bc-tags { font-size: 13px; color: var(--mute); }
.bc-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.steps { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 3px; }
.steps em { color: var(--mute); font-style: normal; font-family: var(--f-mono); font-size: 12px; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }

/* ---- Séance ---- */
.ctxnote { font-family: var(--f-mono); font-size: 12px; color: var(--mute); }
.intro { color: var(--ink); }
.warm { background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.it-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.it-head h3 { flex: 1 1 160px; }
.scheme { font-family: var(--f-mono); font-size: 14px; font-weight: 500; background: var(--soft); border-radius: 8px; padding: 2px 8px; }
.load { font-weight: 600; }
.restl, .note { font-size: 13px; color: var(--mute); }
.setrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.setchip { all: unset; box-sizing: border-box; cursor: pointer; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--f-mono); font-weight: 500; background: var(--bg); }
.setchip.on { background: var(--ac); border-color: var(--ac); color: var(--acink); }
.setchip:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.fields { display: flex; flex-wrap: wrap; gap: 8px; }
.fields label { flex: 1 1 100px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); }
.linkchip { all: unset; cursor: pointer; color: var(--ac); font-weight: 600; text-decoration: underline; }
.foot { display: flex; gap: 8px; position: sticky; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); padding: 8px 0; }
.foot .btn { flex: 1; box-shadow: 0 8px 24px -10px rgba(0,0,0,.5); }
.foot .btn.pri { flex: 2; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; align-items: end; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); }
.form .w2 { grid-column: 1 / -1; }
.form.inline { grid-template-columns: 1fr auto; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--f-disp); font-size: 40px; line-height: 1; }
.stats span { font-size: 12px; color: var(--mute); }
.logl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.logl li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.logl li:first-child { border-top: 0; }
.logl em { display: block; font-style: normal; color: var(--mute); font-size: 13px; }
.wkpat { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.wkpat dt { font-family: var(--f-mono); font-size: 12px; color: var(--mute); text-transform: uppercase; }
.wkpat dd { margin: 0; }
.chrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.chrow em { display: block; font-style: normal; font-size: 12px; color: var(--mute); }
.chrow label { display: flex; align-items: center; gap: 6px; width: 124px; flex: none; }
.ladder { display: flex; flex-wrap: wrap; gap: 4px; }
.lad { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--mute); }
.lad.ok { background: var(--ac); border-color: var(--ac); color: var(--acink); }
.lad.goal { border: 2px solid var(--ac); color: var(--ink); font-weight: 600; }
.lad.goal.ok { color: var(--acink); }
.dots { display: flex; gap: 8px; }
.dot { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.dot i { font-style: normal; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; color: var(--mute); }
.dot.on { background: var(--ac); border-color: var(--ac); }
.dot.on i { color: var(--acink); }
.rng { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.chart { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-t { fill: var(--mute); font-family: var(--f-mono); font-size: 10px; }
.ch-line { fill: none; stroke: var(--ac); stroke-width: 2.4; stroke-linejoin: round; }
.ch-dot { fill: var(--surface); stroke: var(--ac); stroke-width: 2; }
.ch-dot.last { fill: var(--ac); }
.ch-bar { fill: var(--ac); }
.ch-plan { stroke: var(--ink); stroke-width: 2; }

/* ---- Onglets, minuteur, feuilles ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; pointer-events: none;
  padding: 0 max(10px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
.tabs-in { pointer-events: auto; display: flex; gap: 2px; width: 100%; max-width: 520px; padding: 6px; border-radius: 24px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 14px 34px -14px rgba(0,0,0,.5); }
.tab { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; color: var(--mute); font-size: 11px; font-weight: 600; border-radius: 18px; }
.tab span { white-space: nowrap; }
.tab.on { color: var(--c, var(--ink)); background: color-mix(in srgb, var(--c, var(--ink)) 15%, transparent); }
.tab:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.tbar { position: fixed; left: 0; right: 0; z-index: 19; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 440px; display: flex; background: var(--ink); color: var(--bg); border-radius: 16px; overflow: hidden; width: calc(100% - 32px); box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.tb-main { all: unset; cursor: pointer; flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; gap: 10px; min-width: 0; }
.tb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tb-t { font-family: var(--f-mono); font-size: 20px; }
.tb-x { all: unset; cursor: pointer; padding: 0 18px; font-size: 22px; border-left: 1px solid rgba(128,128,128,.35); display: grid; place-items: center; }
.timer-on { padding-bottom: 180px; }
.timer-on .foot { bottom: calc(148px + env(safe-area-inset-bottom, 0px)); }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sh-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sh-panel { position: relative; background: var(--bg); width: 100%; max-width: 640px; max-height: 88%; border-radius: 26px 26px 0 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sh-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.sh-head h2 { font-size: 23px; }
.sh-body { overflow-y: auto; padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.t-grp { display: flex; flex-direction: column; gap: 8px; }
.t-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; align-items: end; }
.t-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); }
.t-live { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 10px 0; }
.t-title { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.t-label { font-family: var(--f-disp); font-size: 28px; font-weight: 700; line-height: 1.1; }
.t-big { font-family: var(--f-mono); font-size: 68px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ac); }
.t-next { color: var(--mute); font-size: 14px; }
.t-ctl { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.exta { font-family: var(--f-mono); font-size: 12px; }
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
@media (max-width: 420px) { .hero h1 { font-size: 44px; } .tab { font-size: 10px; } .t-big { font-size: 56px; } .day { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
.hero.sm { min-height: 150px; } .hero.sm h1 { font-size: 36px; line-height: 1; }
.hero .pips i { background: rgba(255,255,255,.4); }
.hero .ic { width: 22px; height: 22px; }
.hero h1 { max-width: 72%; } .hero.sm h1 { max-width: 80%; } .hero.k-hub h1 { font-size: 40px; }
.how { margin: 2px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 15px; }
.how li::marker { color: var(--ac); font-weight: 700; }
.warm b { display: block; margin-bottom: 4px; }
.warm .how { font-size: 14px; }
.alt { background: var(--soft); border-radius: 12px; padding: 4px 12px; }
.alt ul { margin: 4px 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.gymsw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hero.k-hub { background: linear-gradient(180deg, #1F4458 0%, #3F8A91 52%, #F2B66D 100%); min-height: 240px; }
.hero.k-hub .hero-art { z-index: -1; }
.hero.k-hub::after { background: linear-gradient(90deg, rgba(6,18,24,.55) 0%, rgba(6,18,24,.15) 60%, rgba(6,18,24,0) 85%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero.k-hub { background: linear-gradient(180deg, #0B1A24 0%, #1F4452 55%, #B07A3E 100%); } }
:root[data-theme="dark"] .hero.k-hub { background: linear-gradient(180deg, #0B1A24 0%, #1F4452 55%, #B07A3E 100%); }
.exo-ic { flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--soft); color: var(--ac); display: grid; place-items: center; }
.exo-ic svg { width: 40px; height: 40px; }
.exo-ic .eq { stroke: var(--mute); }
.it-head { align-items: center; }
.wkprog { gap: 8px; }
.wp { display: grid; grid-template-columns: 84px 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.wp-n { font-weight: 600; } .wp b { font-family: var(--f-mono); font-size: 12px; text-align: right; font-weight: 500; }
.wp .prog { height: 8px; } .wp .prog i { background: var(--c); }
.exo-ic { width: 58px; height: 58px; } .exo-ic svg { width: 48px; height: 48px; }

.t-sal .sr-ic, .t-sal .bc-ic { color: #FFD21F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-sal .sr-ic, :root:not([data-theme="light"]) .t-sal .bc-ic { color: #16181B; } }
:root[data-theme="dark"] .t-sal .sr-ic, :root[data-theme="dark"] .t-sal .bc-ic { color: #16181B; }
.t-libre { --c: #6B7A8F; }
:root[data-theme="dark"] .t-libre { --c: #8FA3BF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-libre { --c: #8FA3BF; } }
div.srow { cursor: default; }

/* ---- Compte / connexion ---- */
.auth { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: linear-gradient(180deg, #1c5560 0%, #3d7a7a 45%, #e9a95b 100%); }
.auth[hidden] { display: none; }
.auth-card { width: min(100%, 400px); background: var(--surface); color: var(--ink); border-radius: 24px; padding: 24px 22px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); display: grid; gap: 12px; }
.auth-card h1 { font-family: "Barlow Condensed", sans-serif; font-size: 32px; line-height: 1.05; margin: 0; }
.auth-brand { font-family: "Barlow Condensed", sans-serif; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.auth-dot { width: 10px; height: 10px; border-radius: 50%; background: #e9a95b; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mute); }
.auth-load { text-align: center; margin: 12px 0; }
.sm { font-size: 13px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: var(--bg); vertical-align: middle; }
.urow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.uinfo { min-width: 0; overflow-wrap: anywhere; }
.uact { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.sm { min-height: 36px; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.uh { margin: 18px 0 8px; font-size: 16px; }
.cl-offline, .cl-error, .cl-conflict { color: var(--warn); }

/* ---- Assistant de démarrage ---- */
.ob { display: flex; z-index: 85; }
.ob .auth-card { margin: auto; }
.auth-card.wide { width: min(100%, 560px); gap: 14px; }
.ob-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ob-bar { height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.ob-bar i { display: block; height: 100%; background: #e9a95b; border-radius: 4px; transition: width .25s; }
.ob-sports, .ob-focus { display: grid; gap: 8px; }
.ob-sp { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); }
.ob-sp b { font-size: 16px; }
.ob-sp span { font-size: 13px; color: var(--mute); }
.ob-sp.on { border-color: var(--ink); background: var(--soft); }
.ob-sp:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.ob-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.ob-card h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ob-card p { margin: 0; }
.ob-nav { display: flex; justify-content: space-between; gap: 10px; }
.ob-nav .btn.pri { flex: 1; }
.chip.dis { opacity: .35; }
.badge.lv1 { background: #6b8e5a; color: #fff; } .badge.lv2 { background: #c9902f; color: #fff; } .badge.lv3 { background: #c4592f; color: #fff; } .badge.lv4 { background: #2b3036; color: #fff; }
.v-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.v-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.v-tag.v-ok { background: #dcefd9; color: #1f5a22; } .v-tag.v-tight { background: #fbe9c4; color: #7a4d00; } .v-tag.v-no { background: #f8d9d4; color: #8f1d14; }
.ob-card.v-no { border-color: #d9877c; } .ob-card.v-tight { border-color: #e0b560; }
:root[data-theme="dark"] .v-tag.v-ok { background: #1f3b22; color: #a9dca8; } :root[data-theme="dark"] .v-tag.v-tight { background: #44350f; color: #f1cd7a; } :root[data-theme="dark"] .v-tag.v-no { background: #4a1e19; color: #f2aaa2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .v-tag.v-ok { background: #1f3b22; color: #a9dca8; } :root:not([data-theme="light"]) .v-tag.v-tight { background: #44350f; color: #f1cd7a; } :root:not([data-theme="light"]) .v-tag.v-no { background: #4a1e19; color: #f2aaa2; }
}
.ob-rec { font-weight: 600; font-size: 11px; color: #1f6a4a; background: #dcefd9; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
:root[data-theme="dark"] .ob-rec { background: #1f3b22; color: #a9dca8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ob-rec { background: #1f3b22; color: #a9dca8; } }
