/* BIO-DIGITAL coach - refonte "premium sport" (proposition design).
   Couleurs officielles bio-digital.eu conservées. Inter 500-700, chiffres tabulaires alignés. */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #0a1726;        /* titres, logo, boutons pilule */
  --ink-2: #16293f;      /* survol */
  --accent: #1aa1f4;     /* bleu signature */
  --brand: #1483c4;      /* accent foncé */
  --ice: #e8f2fa;        /* panneau pâle */
  --panel: #dfeefa;      /* panneau pâle 2 */
  --page: #f4f8fc;       /* fond */
  --line: #d5e3ee;
  --hair: #e6eef5;
  --soft: #b9cfe0;
  --muted: #4b5c6e;
  --faint: #7d8ea0;
  --ok: #16a34a;
  --warn: #c2410c;
  --card: #ffffff;
  --r-xl: 28px; --r-lg: 24px; --r-md: 18px; --r-sm: 14px;
  --shadow: 0 1px 1px rgba(10, 23, 38, .03), 0 10px 30px -12px rgba(10, 23, 38, .10);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a1726' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--page); color: var(--muted); font: 500 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body { min-height: 100vh; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
b, strong { color: var(--ink); font-weight: 600; }
p { margin: .4em 0; }
.num, .tnum { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum", "cv11", "ss01"; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.blue { color: var(--accent); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: .02em; }
.screen-title { color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.screen-title span { color: var(--accent); }
.sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head { padding: 2px 4px 2px; }
.page-head .eyebrow { margin-bottom: 4px; }

/* En-tête: logo personnalisé petit, avatar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 248, 252, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.topbar .logo { height: 32px; width: auto; display: block; }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; }

main { padding: 8px 16px calc(112px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin-bottom: 10px; }
.card .head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 8px; }
.card .head h2 { margin: 0; }
.card .head .eyebrow { margin-bottom: 2px; }

/* Héros séance du jour (marine, comme le header sombre du site) */
.hero-session {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px 22px 20px; color: #fff;
  /* v1.4: marine adouci #12304F -> #0E2740, texte blanc, accent #1AA1F4 */
  background: radial-gradient(120% 90% at 100% 0%, rgba(26, 161, 244, .22) 0%, rgba(26, 161, 244, 0) 55%), linear-gradient(165deg, #12304F 0%, #0E2740 100%);
  box-shadow: 0 18px 40px -20px rgba(14, 39, 64, .45);
}
.hero-session .hs-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-session .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .14); padding: 5px 11px; border-radius: 160px; }
.hero-session .tag svg { width: 14px; height: 14px; color: var(--accent); }
.hero-session .hs-race { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .62); }
.hero-session .hs-race b { color: #fff; }
.hero-session .hs-main { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; gap: 12px; }
.hero-session .hs-big { font-size: 84px; font-weight: 700; letter-spacing: -.055em; line-height: .86; color: #fff; }
.hero-session .hs-big small { font-size: 22px; font-weight: 600; color: var(--accent); margin-left: 6px; letter-spacing: -.01em; }
.hero-session .hs-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 14px; color: #fff; }
.hero-session .hs-detail { color: rgba(255, 255, 255, .70); font-size: 14px; margin: 4px 0 0; }
.hero-session .hs-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; }
.hero-session .hs-metrics > div + div { border-left: 1px solid rgba(255, 255, 255, .12); padding-left: 14px; }
.hero-session .m-l { font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .55); }
.hero-session .m-v { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; white-space: nowrap; }
.hero-session .m-v small { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .6); margin-left: 3px; letter-spacing: 0; }
.hero-session .hs-foot { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hero-session .done { display: flex; align-items: center; gap: 10px; width: 100%; background: rgba(22, 163, 74, .16); border: 1px solid rgba(74, 222, 128, .28); border-radius: var(--r-md); padding: 10px 14px; color: #fff; }
.hero-session .done .ck { width: 26px; height: 26px; border-radius: 50%; background: #22c55e; display: grid; place-items: center; flex: none; }
.hero-session .done .ck svg { width: 14px; height: 14px; color: #fff; }
.hero-session .done .dl { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.hero-session .done .dv { font-size: 15px; font-weight: 700; color: #fff; }
.hero-session .done .dv span { color: rgba(255, 255, 255, .55); font-weight: 600; margin: 0 4px; }
.hero-session .chips { margin-top: 12px; }
.hero-session .chip { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .14); }

/* Segments de séance (seuil) */
.segs { margin-top: 18px; }
.segs .bar { display: flex; gap: 4px; height: 10px; }
.segs .bar i { border-radius: 6px; background: rgba(255, 255, 255, .22); display: block; }
.segs .bar i.hot { background: var(--accent); }
.segs .lbl { display: flex; gap: 4px; margin-top: 8px; }
.segs .lbl span { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .6); white-space: nowrap; min-width: 0; }
.segs .lbl span b { display: block; color: #fff; font-size: 15px; font-weight: 700; }
.segs .lbl span.hot b { color: var(--accent); }

/* Panneau pâle (héros secondaire, comme le hero du site) */
.panel-hero { background: linear-gradient(165deg, var(--ice) 0%, var(--panel) 100%); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; position: relative; overflow: hidden; }
.panel-hero .big { font-size: 64px; font-weight: 700; letter-spacing: -.05em; line-height: .9; color: var(--ink); margin-top: 10px; }
.panel-hero .big small { font-size: 20px; font-weight: 600; color: var(--accent); margin-left: 6px; letter-spacing: -.01em; }

/* Semaine en cours (anneaux) */
.activity { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: center; }
.activity .ring-wrap { position: relative; width: 116px; height: 116px; }
.activity .ring-wrap svg { width: 116px; height: 116px; transform: rotate(-90deg); }
.activity .ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.activity .ring-c b { font-size: 17px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.activity .ring-c span { font-size: 9.5px; font-weight: 600; color: var(--faint); margin-top: 3px; }
.kv + .kv { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.kv .k { font-size: 12px; font-weight: 600; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.kv .k i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.kv .v { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.kv .v small { font-size: 13px; font-weight: 600; color: var(--faint); margin-left: 2px; letter-spacing: 0; }

/* Chips / pills */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 160px; font-size: 12.5px; font-weight: 600; background: #fff; color: var(--ink); border: 1px solid var(--line); margin: 0 6px 6px 0; }
.chip.volt { background: var(--ink); color: #fff; border-color: var(--ink); }
a.pill { text-decoration: none; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 160px; font-size: 12px; font-weight: 600; background: var(--ice); color: var(--brand); border: 1px solid transparent; white-space: nowrap; }
.pill.volt { background: var(--accent); color: #fff; }
.pill.navy { background: var(--ink); color: #fff; }
.pill.hot { background: #fff4ed; color: var(--warn); }
.pill.ok { background: #eafaf0; color: #15803d; }
.done-badge { display: inline-flex; gap: 6px; align-items: center; background: #eafaf0; color: #15803d; font-weight: 600; padding: 6px 12px; border-radius: 160px; font-size: 13px; }

/* Listes sans puces */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 14px 0; border-top: 1px solid var(--hair); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }

/* Plan de la semaine */
.wbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 118px; margin-top: 18px; }
.wbars .c { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.wbars .v { font-size: 11px; font-weight: 600; color: var(--muted); }
.wbars .b { width: 100%; max-width: 30px; border-radius: 8px; background: rgba(26, 161, 244, .28); position: relative; overflow: hidden; min-height: 4px; }
.wbars .b.rest { background: var(--soft); opacity: .45; }
.wbars .b.seuil { background: var(--accent); }
.wbars .b.longue { background: var(--ink); }
.wbars .b i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink); }
.wbars .d { font-size: 11px; font-weight: 600; color: var(--faint); }
.wbars .c.today .d { color: var(--ink); }
.dayrow { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; }
.dayrow .d { width: 46px; height: 52px; border-radius: 14px; background: var(--page); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; line-height: 1.1; }
.dayrow .d b { display: block; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.dayrow.today .d { background: var(--ink); color: rgba(255, 255, 255, .7); }
.dayrow.today .d b { color: #fff; }
.dayrow .t { font-size: 15px; font-weight: 600; color: var(--ink); }
.dayrow.seuil .t { color: var(--brand); }
.dayrow.repos .t { color: var(--muted); }
.dayrow .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.dayrow .s .pill { margin-top: 5px; font-size: 11px; padding: 2px 8px; }
.dayrow .km { text-align: right; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; line-height: 1; }
.dayrow .km small { display: block; font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: 0; margin-top: 3px; }
.dayrow.seuil .km { color: var(--brand); }

.progress { height: 8px; background: rgba(255, 255, 255, .8); border-radius: 160px; overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 160px; }

.stat { background: var(--page); border-radius: var(--r-sm); padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.stat span { font-size: 11.5px; font-weight: 600; color: var(--faint); }
.tile { background: #fff; border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px 14px 12px; }
.tile .k { font-size: 11.5px; font-weight: 600; color: var(--faint); }
.tile .v { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; white-space: nowrap; }
.tile .v small { font-size: 12px; font-weight: 600; color: var(--faint); margin-left: 2px; letter-spacing: 0; }
.tile.hl { background: var(--ink); border-color: var(--ink); }
.tile.hl .k { color: rgba(255, 255, 255, .6); }
.tile.hl .v { color: #fff; }
.tile.hl .v small { color: var(--accent); }

/* Exercices */
.ex { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: start; }
.ex .n { font-weight: 600; color: var(--ink); font-size: 15px; }
.ex .load { text-align: right; white-space: nowrap; }
.ex .load .reps { display: block; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.ex .load .kg { display: block; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.ex .note { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.ex .sug { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ice); border-radius: var(--r-sm); padding: 9px 9px 9px 12px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--brand); }
.ex .sug .up { display: inline-flex; align-items: center; gap: 6px; }
.ex .sug .up svg { width: 16px; height: 16px; flex: none; }

/* Nutrition */
.kcal { display: flex; align-items: baseline; gap: 6px; }
.kcal b { font-size: 40px; font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.kcal span { font-size: 14px; font-weight: 600; color: var(--faint); }
.mbar { display: flex; height: 10px; gap: 3px; margin: 14px 0 12px; }
.mbar i { display: block; border-radius: 6px; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.macros > div { padding-left: 10px; border-left: 3px solid var(--line); }
.macros b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.macros b small { font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 1px; }
.macros span { font-size: 11.5px; font-weight: 600; color: var(--faint); }
.meal { display: grid; grid-template-columns: 96px 1fr; gap: 10px; color: var(--ink); font-size: 14.5px; }
.meal .s { font-size: 12px; font-weight: 600; color: var(--faint); padding-top: 2px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hair); }

/* Formulaires */
fieldset { margin: 0; min-width: 0; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); background: var(--page);
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 12px 14px; outline: none; appearance: none; font-variant-numeric: tabular-nums;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(26, 161, 244, .16); }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 15px; color: var(--ink); font-weight: 500; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.seg { display: flex; background: #fff; border: 1px solid var(--hair); border-radius: 160px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; padding: 10px; border-radius: 160px; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.feel { display: flex; gap: 6px; }
.feel button { flex: 1; border: 1px solid var(--hair); background: var(--page); border-radius: 160px; padding: 9px 0; font: inherit; font-weight: 700; color: var(--muted); }
.feel button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.dayedit { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--hair); }
.dayedit b { color: var(--ink); }
.dayedit .full { grid-column: 2; }
.setrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; }
.setrow input { text-align: center; padding: 10px 4px; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }
.disclaimer p { font-size: 13.5px; }

/* Boutons pilule: principal marine + flèche ronde, secondaire blanc */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ink); font: inherit; font-weight: 600; font-size: 15px; padding: 14px 22px; border-radius: 160px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--ink-2); }
.btn.volt::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: #fff var(--arrow) center / 13px no-repeat; flex: none; margin-right: -10px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light.volt::after { background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E"); }
.btn.danger { background: #fff; color: var(--warn); border: 1px solid #fed7c3; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.sm.volt::after { width: 22px; height: 22px; background-size: 11px; margin-right: -7px; }
.btn.icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn.icon svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.linkbtn { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Barre d'onglets: icônes fines */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--hair);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(10px + var(--safe-b));
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--faint); font-size: 10.5px; font-weight: 600; padding: 4px 0; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on::before { content: ""; position: absolute; top: -9px; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabbar a.plus { justify-content: center; }
.tabbar a.plus span.ic { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(10, 23, 38, .45); }
.tabbar a.plus span.ic svg { width: 22px; height: 22px; }
.tabbar a.plus span:not(.ic) { display: none; }
.tabbar a.plus::before { display: none; }

/* Accueil (sans profil) */

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 160px; font-weight: 600; font-size: 14px; opacity: 0; transition: .25s; z-index: 50; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .ax { font-size: 10px; fill: var(--faint); font-weight: 500; }
.chart .val { font-size: 11px; fill: var(--ink); font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 600; color: var(--faint); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; gap: 10px; }
.chart-head .big { font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -.04em; line-height: 1; }
.chart-head .big small { font-size: 13px; font-weight: 600; color: var(--faint); margin-left: 3px; letter-spacing: 0; }
.warn { background: #fff4ed; color: #9a3412; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; }
.info { background: var(--ice); color: var(--ink-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip + .tip { margin-top: 12px; }
.tip .ic { width: 32px; height: 32px; border-radius: 10px; background: #fff4ed; color: var(--warn); display: grid; place-items: center; flex: none; }
.tip .ic svg { width: 17px; height: 17px; }
.tip p { margin: 0; font-size: 13.5px; color: var(--ink); }
.tomorrow { display: flex; align-items: center; gap: 14px; }
.tomorrow .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--ice); color: var(--brand); display: grid; place-items: center; flex: none; }
.tomorrow .ico svg { width: 22px; height: 22px; }
.tomorrow .tx { flex: 1; min-width: 0; }
.tomorrow .tx b { display: block; font-size: 15px; }
.tomorrow .tx span { font-size: 12.5px; color: var(--muted); }
.tomorrow .km { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; }
.tomorrow .km small { font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 2px; }

/* ---------------- v1.4: écrans v1.3 dans le langage Design ---------------- */

/* Accueil plein écran bord à bord: logo, visuel anneaux, feuille d'actions en bas */
html.welcome-on, html.welcome-on body { background: var(--panel); overflow: hidden; }
.welcome {
  position: fixed; inset: 0; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 55% at 85% 8%, rgba(26, 161, 244, .20) 0%, rgba(26, 161, 244, 0) 70%),
    linear-gradient(180deg, var(--page) 0%, var(--ice) 50%, var(--panel) 100%);
  padding-top: env(safe-area-inset-top, 0px);
}
.welcome .top { display: flex; align-items: center; justify-content: center; padding: 22px 20px 0; }
.welcome .top img { height: 32px; width: auto; }
.welcome .visual { position: relative; flex: 1; min-height: 220px; display: grid; place-items: center; }
.welcome .visual svg.rings { position: absolute; width: 280px; height: 280px; transform: rotate(-90deg); }
.welcome .visual img { width: 84px; height: 84px; position: relative; }
.welcome .sheet {
  position: relative; background: #fff; border-top: 1px solid var(--hair);
  border-radius: 32px 32px 0 0; box-shadow: 0 -12px 34px -10px rgba(10, 23, 38, .10);
  padding: 26px 20px calc(20px + var(--safe-b));
}
.welcome .sheet > * { max-width: 480px; margin-left: auto; margin-right: auto; }
.welcome .tagline { font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.08; color: var(--ink); }
.welcome .tagline span { color: var(--accent); }
.welcome .actions { display: grid; gap: 10px; margin-top: 20px; }
.welcome .sig { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 12px; font-weight: 600; margin-top: 16px; }
.welcome .sig svg { width: 14px; height: 14px; }
.welcome .demo { text-align: center; margin-top: 8px; font-size: 13px; }
.welcome .demo .linkbtn { color: var(--muted); font-weight: 600; }

/* Anneau hebdo: dépassement */
.activity .ring-c#ring-center span { color: var(--faint); }
.ring-over { filter: drop-shadow(0 0 1.5px rgba(124, 203, 248, .6)); }

/* Notes d'en-tête sobres (remplacent les pastilles) */
.head-link { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; padding-top: 2px; white-space: nowrap; }
.head-note { font-size: 12.5px; font-weight: 600; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.ok-txt { color: #15803d; font-weight: 700; }
.str-line { font-size: 12.5px; font-weight: 600; color: var(--brand); }
.next-km { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.meta-line { color: var(--muted); font-size: 13px; margin-top: 12px; }
.hero-session .hs-meta { color: rgba(255, 255, 255, .62); font-size: 12.5px; font-weight: 500; margin: 14px 0 0; }

/* Habitudes: lignes fines, case ronde, conseil en dessous */
.habit { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; border-top: 1px solid var(--hair); padding: 14px 0; margin: 0; cursor: pointer; }
.card > p + .habit, .habit:first-of-type { border-top: 0; }
.habit input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 50%; border: 1.6px solid var(--soft); background: #fff; display: grid; place-items: center; transition: .15s; }
.habit input:checked { background: var(--ink); border-color: var(--ink); }
.habit input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.habit-label { display: block; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.habit-tip { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; font-weight: 500; }
.warm { color: var(--warn); font-weight: 700; }

/* Compléments et aliments du moment: même rangées fines */
#supplements .check, #pantry .check { border-top: 1px solid var(--hair); padding: 12px 0; }
#supplements > p + .check { border-top: 0; }
#supplements .field { margin: 12px 0; }
#pantry .checks { gap: 0 16px; margin-top: 6px; }
#pantry .checks .check:nth-child(-n+2) { border-top: 0; }
#pantry .check { font-size: 14.5px; }
#pantry .field { margin-top: 14px; }

/* Carte nutrition: idée avec aliments du moment, astuce du jour, lien */
.from-pantry { display: block; font-size: 12px; font-weight: 600; color: var(--brand); margin-top: 3px; }
.habit-day { margin-top: 16px; background: linear-gradient(165deg, var(--ice) 0%, var(--panel) 100%); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.habit-day .eyebrow { color: var(--brand); }
.habit-day p { margin: 4px 0 0; color: var(--ink); font-size: 14px; line-height: 1.45; }
.row-link { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.row-link b { color: var(--accent); margin-left: 4px; }
.row-link svg { width: 18px; height: 18px; color: var(--faint); }

/* Import de fichiers */
.dropzone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; border: 1.5px dashed var(--soft); border-radius: var(--r-md); background: linear-gradient(165deg, var(--page) 0%, var(--ice) 100%); cursor: pointer; transition: .15s; margin: 0; }
.dropzone.over { border-color: var(--accent); background: var(--ice); }
.dropzone b { color: var(--ink); font-size: 15px; }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.dropzone .dz-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 4px; }
.dropzone .dz-ic svg { width: 18px; height: 18px; }
.imp { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hair); }
.imp-head { margin-bottom: 8px; }
.imp-err { margin: 8px 0; }
.imp-row { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.imp-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.imp-body b { font-size: 17px; }
.imp-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.imp-meta select { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; min-height: 0; }
.imp-dup { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--warn); }
.imp-row.is-dup .imp-body > .spread b { color: var(--faint); }
#imp-add { margin-top: 14px; }
#imp-add:disabled { opacity: .45; }
.hero-session .hs-import { color: rgba(255, 255, 255, .78); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* Profils */
.other-profiles { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--hair); }
.other-profiles .row-link { width: 100%; background: none; border: 0; border-top: 1px solid var(--hair); font: inherit; font-weight: 600; cursor: pointer; padding: 12px 0; margin-top: 0; }
.other-profiles .eyebrow + .row-link { border-top: 0; }

/* ================= v1.5 ================= */
/* Tuiles cochables pleine largeur, 2 colonnes: bordure fine qui passe en bleu + petite coche */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { position: relative; display: flex; align-items: center; min-height: 52px; margin: 0; padding: 12px 34px 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.25; cursor: pointer; transition: border-color .15s, background .15s; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-l small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.opt-tick { position: absolute; right: 10px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 1.5px solid var(--soft); background: #fff; transition: .15s; }
.opt:has(input:checked) { border-color: var(--accent); background: #f5fbff; }
.opt:has(input:checked) .opt-tick { background: var(--accent); border-color: var(--accent); }
.opt:has(input:checked) .opt-tick::after { content: ""; position: absolute; left: 4.5px; top: 4.5px; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); }
.opt:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(26, 161, 244, .2); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }

/* Blocs repliables */
details.block { border-top: 1px solid var(--hair); margin-top: 14px; padding-top: 4px; }
details.block > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 0; color: var(--ink); font-weight: 600; font-size: 15px; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
details.block[open] > summary::after { transform: rotate(-135deg); }

/* Onboarding: barre fine, "Passer" discret en haut à droite, "Continuer" en bas (zone du pouce) */
.ob { padding-bottom: calc(96px + var(--safe-b)); }
.ob-top { position: sticky; top: 56px; z-index: 5; background: var(--page); padding: 4px 0 10px; }
.ob-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ob-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .35s ease; }
.ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
.ob-back { text-decoration: none; color: var(--muted); font-size: 14px; }
.ob-count { color: var(--faint); font-weight: 600; }
.ob-skip { border: 0; background: none; color: var(--faint); font: inherit; font-weight: 600; font-size: 14px; padding: 4px 0; cursor: pointer; }
.ob-skip-ph { width: 44px; }
.ob-title { font-size: 28px; letter-spacing: -.03em; margin: 12px 0 2px; }
.ob form { margin-top: 18px; }
.ob .sec > .field:first-child { margin-top: 0; }
.ob-foot, .sec-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(14px + var(--safe-b)); background: linear-gradient(180deg, rgba(244, 248, 252, 0) 0%, var(--page) 30%); }
.ob-foot .btn, .sec-foot .btn { max-width: 528px; margin: 0 auto; display: flex; min-height: 54px; }
.ob-block { background: #fff; border: 1px solid var(--hair); border-radius: var(--r-md); padding: 4px 16px 14px; margin-top: 10px; box-shadow: var(--shadow); }
.ob-block + .ob-block { margin-top: 10px; }
.consent { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.consent svg, .sec .tiny svg { width: 15px; height: 15px; flex: none; vertical-align: -2px; margin-right: 4px; }
.ready { text-align: center; padding-top: 24px; }
.ready-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 6px; }
.ready-mark svg { width: 30px; height: 30px; }
.ready-big { margin: 18px 0 2px; color: var(--ink); }
.ready-big b { font-size: 84px; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.ready-big small { font-size: 22px; font-weight: 600; color: var(--accent); margin-left: 6px; }
.ready-t { color: var(--ink); font-weight: 600; margin-bottom: 22px; }
html.ob-on .topbar .avatar { display: none; }

/* Planning boulot */
.seg.sm button { padding: 8px 6px; font-size: 13px; }
.work-grid { margin-top: 6px; }
.wday { display: grid; grid-template-columns: 40px 1fr; gap: 8px 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hair); }
.wday:first-child { border-top: 0; }
.wday > b { color: var(--ink); font-size: 14px; }
.wslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wslot { margin: 0; position: relative; }
.wslot input { position: absolute; opacity: 0; pointer-events: none; }
.wslot span { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.wslot input:checked + span { border-color: var(--accent); background: #f5fbff; color: var(--brand); }
.wslot.off input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.wslot input:focus-visible + span { box-shadow: 0 0 0 3px rgba(26, 161, 244, .2); }
.whours { grid-column: 2; padding: 9px 12px !important; font-size: 14px !important; }

/* Aliments du moment */
.food-search { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--page); border: 1px solid var(--hair); border-radius: 160px; padding: 12px 18px; outline: none; margin-bottom: 6px; }
.food-search:focus { border-color: var(--accent); background: #fff; }
.fam { margin-top: 14px; }
.fam-t { margin-bottom: 8px; }

/* Profil: rangées pleine largeur titre + résumé gris + chevron */
.card.rows { padding: 4px 18px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--hair); text-decoration: none; color: var(--ink); }
.prow:first-child { border-top: 0; }
.prow-b { min-width: 0; }
.prow-t { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.prow-s { display: block; font-size: 13px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-s.todo { color: var(--brand); }
.prow svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.sub-block { border-top: 1px solid var(--hair); margin-top: 16px; padding-top: 14px; }
.sub-block h3 { margin-bottom: 4px; }
.danger-zone h2 { color: var(--warn); }
.change-line { font-size: 13.5px; color: var(--ink); background: var(--ice); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 0; }
#sec-form + .change-line { margin-top: 12px; }
main:has(#sec-form) { padding-bottom: calc(150px + var(--safe-b)); }

/* Repas composés */
.meals .meal { grid-template-columns: 92px 1fr; }
.meal .mt { font-weight: 600; color: var(--ink); line-height: 1.35; }
.meal .mp { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 3px; }
.meal .mh { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.meal .missing { display: block; font-size: 12.5px; color: var(--warn); margin-top: 5px; text-decoration: none; font-weight: 500; }
.meal .meal-more { font-size: 12.5px; margin-top: 6px; color: var(--brand); text-decoration: none; border: 1px solid var(--line); border-radius: 160px; padding: 5px 12px; background: #fff; }
.meal-empty { background: var(--ice); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.meal-empty b { display: block; font-size: 15px; margin-bottom: 4px; }
.meal-empty .btn { margin-top: 8px; }

/* Étirements */
.stretch li { display: flex; justify-content: space-between; gap: 12px; }
.stretch .n { color: var(--ink); font-weight: 500; font-size: 14px; }
.stretch .d { color: var(--faint); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* Planning sur la carte du jour et la semaine */
.hero-session .hs-work { color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 500; margin: 8px 0 0; }
.dayrow .shift { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.dayrow[data-day] { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dayrow.unavail .t { color: var(--faint); }
a.tomorrow { text-decoration: none; color: inherit; }

/* Carte "à compléter" sobre et fermable */
.todo-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 18px; }
.todo-card a { color: var(--ink); font-weight: 600; text-decoration: none; font-size: 14.5px; }
.todo-x { border: 0; background: none; color: var(--faint); width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.todo-x svg { width: 16px; height: 16px; }

/* Menu appui long */
.sheet-menu { position: fixed; inset: 0; z-index: 60; background: rgba(10, 23, 38, .28); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s ease; }
.sm-card { width: 100%; max-width: 560px; background: #fff; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); display: grid; gap: 10px; text-align: center; }
.sm-card .eyebrow { margin-bottom: 4px; }

/* Toast avec Annuler */
.toast { display: flex; align-items: center; gap: 14px; }
.toast.has-undo { pointer-events: auto; }
.toast-undo { border: 0; background: none; color: #7ccbf8; font: inherit; font-weight: 700; padding: 0; cursor: pointer; }

/* Transition douce de la carte modifiée */
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(26, 161, 244, .0); background-color: #fff; } 30% { box-shadow: 0 0 0 4px rgba(26, 161, 244, .18); } 100% { box-shadow: var(--shadow); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.card.flash, .meal.flash { animation: flash 1.1s ease; }
.hero-session.flash { animation: fadein .5s ease; }
@media (prefers-reduced-motion: reduce) { .card.flash, .meal.flash, .hero-session.flash, .sheet-menu { animation: none; } .ob-bar i { transition: none; } }
/* Écran de réglage: focus, la barre d'onglets laisse la place au bouton Enregistrer */
body:has(#sec-form) .tabbar { display: none; }
main:has(#sec-form) { padding-bottom: calc(96px + var(--safe-b)); }

/* v1.6 Compte et synchro */
.sync-line { font-size: 12.5px; color: var(--faint); text-align: center; margin: 4px 0 0; }
#acc-home .sync-line { text-align: left; margin: 2px 0 14px; }
.acc-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); margin: 6px 0 14px; cursor: pointer; }
.acc-consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.form-err { min-height: 0; margin: 0 0 12px; font-size: 13px; color: var(--warn); }
.form-err:empty { display: none; }
.acc-ask { text-align: center; margin: 6px 0 0; }
.tiles.one { grid-template-columns: 1fr; margin: 12px 0 16px; }
.center { text-align: center; }
.welcome .demo .sep { display: inline-block; width: 1px; height: 12px; background: var(--line); margin: 0 12px; vertical-align: -1px; }
#acc-intro h2, #acc-choice h2 { margin-bottom: 6px; }
#acc-intro .btn.volt { margin-top: 16px; }
#a-code { text-transform: uppercase; letter-spacing: .04em; }
#a-code::placeholder { letter-spacing: 0; }
