:root {
  --bg: #121212;
  --surface: #1b1b1c;
  --surface-2: #252527;
  --surface-3: #2f2f32;
  --line: #2c2c2f;
  --text: #f6f3ee;
  --text-2: #bdb8b0;
  --text-3: #8f8a82;
  --accent: #b3121b;
  --accent-press: #95101a;
  --accent-ink: #ff6066;
  --D: #3987e5;
  --G: #9085e9;
  --U: #f6f3ee;
  --int: #e8772e;
  --neu: #9a958d;
  --ext: #23a974;
  --up: #3dd68c;
  --down: #ef7f7a;
  --r-card: 18px;
  --r-ctl: 11px;
  --pad: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ok: #3dd68c;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 400 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
::selection { background: rgba(179, 18, 27, .55); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 0 calc(var(--nav-h) + var(--safe-b) + 24px); }
.view { padding: 0 var(--pad); }

/* ---------- top bars ---------- */
.top { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 8px; }
.top h1 { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin: 0; flex: 1; }
.top .sub { color: var(--text-3); font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: var(--surface); flex: none; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.ghost { background: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.net::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.net.ok::before { background: var(--up); }
.net.envoi::before { background: #c98500; }
.net.hors::before, .net.err::before { background: var(--down); }

/* ---------- cards & text ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 16px; margin-bottom: 12px; }
.card.hero { padding: 20px; background: linear-gradient(180deg, #23191a 0%, var(--surface) 70%); }
.label { font-size: 13px; font-weight: 600; color: var(--text-3); margin: 0 0 6px; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.h3 { font-size: 17px; font-weight: 650; margin: 0; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.small { font-size: 13px; }
.big { font-size: 34px; font-weight: 760; letter-spacing: -.02em; line-height: 1.05; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-t { font-size: 15px; font-weight: 650; color: var(--text-2); margin: 22px 4px 10px; }
.empty { text-align: center; color: var(--text-3); padding: 36px 16px; }
.empty .h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- buttons ---------- */
a.btn, a.card, a.list, a.li { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; font-weight: 650; font-size: 16px; background: var(--surface-2); color: var(--text); }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-press); }
.btn.block { width: 100%; }
.btn.quiet { background: none; color: var(--text-2); min-height: 44px; padding: 0 12px; }
.btn.danger { color: var(--accent-ink); }
.btn.sm { min-height: 40px; font-size: 15px; padding: 0 14px; border-radius: 12px; }

/* ---------- pills ---------- */
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding: 2px 0; }
.pills::-webkit-scrollbar { display: none; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; min-height: 36px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

/* ---------- lists ---------- */
.list { background: var(--surface); border-radius: var(--r-card); overflow: hidden; margin-bottom: 12px; }
.li { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 16px; text-align: left; }
.li + .li { border-top: 1px solid var(--line); }
.li:active { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 13px; color: var(--text-3); display: block; }
.chev { color: var(--text-3); width: 18px; height: 18px; }
.date-chip { width: 46px; flex: none; text-align: center; border-radius: 12px; background: var(--surface-2); padding: 6px 0; line-height: 1.1; }
.date-chip b { display: block; font-size: 19px; }
.date-chip span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.date-chip.today { background: var(--accent); }
.date-chip.today span { color: #ffd9db; }
.tag { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.done { color: var(--up); }
.tag.plan { color: var(--text-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.int { background: var(--int); } .dot.ext { background: var(--ext); } .dot.neu { background: var(--neu); }
.dot.D { background: var(--D); } .dot.G { background: var(--G); }

/* ---------- session ---------- */
.s-head { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 0 calc(-1 * var(--pad)); padding: calc(var(--safe-t) + 6px) var(--pad) 8px; }
.s-head .top { margin: 0; }
.s-title { flex: 1; min-width: 0; }
.s-title input { width: 100%; background: none; border: 0; font-size: 22px; font-weight: 750; letter-spacing: -.01em; padding: 2px 0; }
.s-title input:focus { outline: none; box-shadow: 0 2px 0 var(--accent); }
.s-title button { font-size: 14px; color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; min-height: 28px; }
.s-sum { display: flex; gap: 18px; font-size: 13px; color: var(--text-3); padding: 2px 0 0 56px; }
.s-sum b { color: var(--text); font-weight: 650; }

.exo { background: var(--surface); border-radius: var(--r-card); padding: 14px 12px 8px; margin-bottom: 12px; }
.exo-h { display: flex; gap: 8px; align-items: flex-start; padding: 0 4px; }
.exo-h .grow { flex: 1; min-width: 0; }
.exo-h .h3 { line-height: 1.25; }
.exo-meta { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.exo-rec { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); margin: 10px 4px 4px; }
.exo-rec b { font-weight: 650; color: var(--text); }
.exo-obj { font-size: 13px; color: var(--text-2); margin: 8px 4px 0; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.more { width: 40px; height: 40px; margin: -8px -4px 0 0; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.more:active { background: var(--surface-2); }

.sets { margin-top: 10px; }
.sets-h, .set { display: grid; grid-template-columns: var(--cols, 26px 1fr 1fr); gap: 8px; align-items: center; }
.sets-h { font-size: 12px; font-weight: 650; color: var(--text-3); padding: 0 2px 6px; }
.sets-h span:not(:first-child) { display: flex; align-items: center; gap: 6px; }
.set { padding: 3px 2px; }
.set .n { font-size: 14px; font-weight: 650; color: var(--text-3); text-align: center; height: 40px; min-width: 30px; border-radius: 9px; background: none; border: 0; padding: 0; }
.set .n:active { background: var(--surface-2); }
.set .n.t-w { color: var(--int); }
.set .n.t-f { color: var(--accent-ink); }
.set.warm .cell { opacity: .62; }
.cell { display: flex; align-items: center; gap: 3px; background: var(--surface-2); border-radius: var(--r-ctl); padding: 0 4px; height: 46px; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.cell input { width: 100%; min-width: 0; height: 44px; background: none; border: 0; text-align: center; font-size: 17px; font-weight: 600; padding: 0; caret-color: var(--accent-ink); }
.cell input::placeholder { color: #67635d; font-weight: 500; }
.cell input:focus { outline: none; }
.cell:focus-within { box-shadow: inset 0 0 0 2px var(--text-3); }
.cell .x { color: var(--text-3); font-size: 13px; flex: none; }
.cell.up { box-shadow: inset 0 -2px 0 var(--up); }
.cell.down { box-shadow: inset 0 -2px 0 var(--down); }
.cell.pr { background: #15301f; box-shadow: inset 0 0 0 1.5px var(--up); }
.cell.filled input { color: var(--text); }
.sets-f { display: flex; justify-content: space-between; padding: 6px 0 2px; }

.over { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.arm { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.arm .lab { font-size: 12px; font-weight: 650; color: var(--text-3); display: flex; justify-content: space-between; }
.stepper { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; }
.stepper button:active { background: #3a3a3e; }
.stepper output { font-size: 26px; font-weight: 750; min-width: 2ch; text-align: center; }
.stepper output small { font-size: 14px; color: var(--text-3); font-weight: 600; }

.note { width: 100%; min-height: 84px; background: var(--surface); border: 0; border-radius: var(--r-card); padding: 14px 16px; resize: vertical; color: var(--text); }
.note::placeholder { color: var(--text-3); }
.note:focus { outline: none; box-shadow: inset 0 0 0 2px var(--surface-3); }
.add-exo { width: 100%; min-height: 56px; border-radius: var(--r-card); border: 1.5px dashed #3a3a3d; color: var(--text-2); font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 16px; }
.add-exo:active { background: var(--surface); }

/* ---------- balance (signature: the two arms face to face) ---------- */
.bal { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 12px; margin: 8px 0 4px; }
.bal > div { position: relative; background: var(--surface-2); overflow: hidden; }
.bal > div:first-child { border-radius: 6px 0 0 6px; }
.bal > div:last-child { border-radius: 0 6px 6px 0; }
.bal i { position: absolute; top: 0; bottom: 0; }
.bal > div:first-child i { right: 0; background: var(--G); border-radius: 6px 0 0 6px; }
.bal > div:last-child i { left: 0; background: var(--D); border-radius: 0 6px 6px 0; }
.bal.lg { height: 22px; }
.bal-lab { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.bal-lab b { color: var(--text); font-weight: 650; }
.bal-row { padding: 12px 16px; }
.bal-row + .bal-row { border-top: 1px solid var(--line); }
.bal-row .row-between .t { font-weight: 600; }
.verdict { font-size: 14px; font-weight: 650; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: #2a2a2d; stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 11px; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .mk { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .end { font-size: 12px; font-weight: 700; }
.tip { position: absolute; top: 0; pointer-events: none; background: #f6f3ee; color: #121212; border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.35; min-width: 120px; box-shadow: 0 6px 18px rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; z-index: 3; }
.tip.on { opacity: 1; }
.tip b { font-weight: 700; }
.tip .dot { margin-right: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.legend b { color: var(--text); font-weight: 650; }

.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--r-card); padding: 14px; }
.stat .big { font-size: 26px; }
.stat .arms { display: grid; gap: 4px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.stat .arms b { color: var(--text); font-weight: 650; white-space: nowrap; }
.stat .arms div { display: flex; justify-content: space-between; }

.hbar { padding: 10px 16px; }
.hbar + .hbar { border-top: 1px solid var(--line); }
.hbar .track { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; margin-top: 8px; }
.hbar .track i { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.hbar .track .zero { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: var(--text-3); left: 50%; }
.stack { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin: 10px 0 8px; }
.stack i { display: block; height: 100%; }

/* ---------- select & fields ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-3); margin: 0 0 6px 2px; }
.input, .select { width: 100%; min-height: 50px; background: var(--surface-2); border: 0; border-radius: 13px; padding: 0 14px; font-size: 17px; color: var(--text); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8a82' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--text-3); }
.input[type="date"] { -webkit-appearance: none; display: flex; align-items: center; }

/* ---------- bottom sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; opacity: 0; transition: opacity .25s var(--ease); }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: #1d1d1f; border-radius: 22px 22px 0 0; padding: 8px var(--pad) calc(var(--safe-b) + 18px); transform: translateY(100%); transition: transform .3s var(--ease-drawer); }
.sheet.on { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #444; margin: 2px auto 12px; }
.sheet h2 { font-size: 20px; margin: 0 0 14px; }
.sheet .list { background: var(--surface-2); }
.sheet .li + .li { border-color: #36363a; }
.search { position: sticky; top: -8px; background: #1d1d1f; padding: 0 0 10px; z-index: 2; }
.group-t { font-size: 13px; font-weight: 650; color: var(--text-3); margin: 14px 4px 6px; }
.menu .li { min-height: 54px; }
.sheet .btns { display: flex; gap: 10px; margin-top: 8px; }
.sheet .btns .btn { flex: 1; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(18,18,18,.92); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid #222224; padding-bottom: var(--safe-b); }
.nav-in { max-width: 560px; margin: 0 auto; display: grid; height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] svg { stroke: var(--accent-ink); }
body.in-session .nav { display: none; }
body.in-session #app { padding-bottom: calc(var(--safe-b) + 24px); }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; opacity: 0; transition: all .3s var(--ease); z-index: 60; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.banner { background: #2a2312; color: #f0d79a; border-radius: 14px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }



/* ---------- v4 ---------- */
a.card, a.list, a.li { display: block; }
a.li { display: flex; }
.hi { color: var(--text); }
.btn, .icon-btn, .pill, .li, .seg button, .stepper button, .add-exo, .demo-btn, .thumb { transition: transform .14s var(--ease), background-color .15s ease; }
.btn:active, .icon-btn:active, .pill:active, .demo-btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.welcome { padding-top: 18vh; text-align: center; }
.welcome img { border-radius: 18px; }
.welcome h1 { margin: 18px 0 8px; }
.welcome p { max-width: 300px; margin: 0 auto 26px; }
.hero-t { font-size: 26px; margin: 2px 0 6px; }
.hero-s { margin: 0 0 16px; }
.h1-sm { font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin: 0; flex: 1; line-height: 1.2; }
.clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal !important; }
.pre { white-space: pre-wrap; margin: 0; }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; color: var(--text); }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av svg.i { width: 16px; height: 16px; }
.av.hot { background: #3a1d1e; color: var(--accent-ink); }
.carnet-band { display: flex; align-items: center; gap: 10px; background: #26201a; color: #f0d79a; border-radius: 14px; padding: 6px 6px 6px 10px; margin: 0 0 12px; font-size: 14px; }
.carnet-band .btn { color: #f0d79a; }
.carnet-band .grow { flex: 1; min-width: 0; }

.prog { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.prog i { display: block; height: 100%; background: var(--ok); transform-origin: left; border-radius: 4px; transition: transform .5s var(--ease); }
.li .prog { margin-top: 6px; height: 5px; }
.dot.ok { background: var(--ok); } .dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--surface-3); }
.tag.warn { color: #f0b35a; background: #2e2514; }

.checkin { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1.5px solid #3b2a1b; background: #1f1a15; }
.checkin .grow { display: grid; gap: 2px; flex: 1; }
.exo-h .exo-n { color: inherit; text-decoration: none; display: block; }
.demo-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; margin: -2px 6px 0 -2px; }
.demo-btn svg.i { fill: #fff; stroke: none; width: 18px; height: 18px; }
.exo-obj b { color: var(--text); font-weight: 650; margin-right: 4px; }
input.eff { width: 100%; height: 46px; min-width: 0; background: var(--surface-2); border: 0; border-radius: var(--r-ctl); text-align: center; font-size: 16px; font-weight: 600; color: var(--text); padding: 0; }
input.eff::placeholder { color: #67635d; }
input.eff:focus { outline: none; box-shadow: inset 0 0 0 2px var(--text-3); }
.eff-h { text-align: center; }
.sets-f { align-items: center; gap: 2px; }
.sets-f .grow { flex: 1; }
.sets-f .btn svg.i { width: 19px; height: 19px; }
.pain-on { color: var(--accent-ink); }
.clips { display: grid; gap: 6px; margin: 6px 0 4px; }
.clip { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; color: var(--text-2); text-decoration: none; font-size: 13px; }
.clip svg.i { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.fin-btn { margin-top: 12px; }

.seg.five button { font-size: 16px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 auto; padding: 0 10px; }
.seg.days button { padding: 0; font-size: 13px; }
.scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin: -8px 4px 0; }
.grid11 { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.grid11 button { min-height: 40px; border-radius: 9px; background: var(--surface-2); font-weight: 650; font-size: 14px; color: var(--text-2); }
.grid11 button.hot { color: #f3a19d; }
.grid11 button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.grid11 button.hot[aria-pressed="true"] { background: var(--accent); color: #fff; }
.res-box { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.res-box.hot { background: #2c1718; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); text-decoration: none; }
.chip.strong { color: var(--text); background: var(--surface-3); }
.chip button { width: 22px; height: 22px; display: grid; place-items: center; margin-right: -6px; color: var(--text-3); }
.chip button svg.i { width: 14px; height: 14px; }
.done-box { text-align: center; padding: 8px 0 4px; }
.done-ic { width: 56px; height: 56px; border-radius: 50%; background: #15301f; color: var(--ok); display: grid; place-items: center; margin: 4px auto 12px; animation: pop .42s var(--ease) both; }
.done-ic svg.i { width: 28px; height: 28px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stats3 div { background: var(--surface-2); border-radius: 14px; padding: 12px 6px; }
.stats3 b { display: block; font-size: 24px; font-weight: 750; }
.stats3 span { font-size: 12px; color: var(--text-3); }

.pills.tabs { margin-bottom: 10px; }
.card.flush { padding: 6px 0; }
.label.pad { padding: 10px 16px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.lvl { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.lvl:first-of-type { margin-top: 8px; }
.lvl.tot b { font-size: 17px; }

.search { position: relative; }
.view > .search { margin-bottom: 12px; }
.search-i { position: absolute; left: 14px; top: 14px; color: var(--text-3); pointer-events: none; }
.search-i svg.i { width: 20px; height: 20px; }
.view > .search .input { padding-left: 44px; }
.thumb { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.thumb svg.i { width: 16px; height: 16px; fill: #fff; stroke: none; }
.thumb.off { background: var(--surface-2); color: var(--text-3); }
.thumb.off svg.i { fill: none; stroke: currentColor; width: 20px; height: 20px; }
.li .t .dot { margin-right: 6px; }
.lib-empty { padding-top: 48px; }

.player { position: relative; border-radius: var(--r-card); overflow: hidden; background: #000; margin-bottom: 12px; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.load, .player.empty { background: var(--surface); color: var(--text-3); font-size: 14px; padding: 16px; text-align: center; }
.player.add { width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; border: 1.5px dashed #3a3a3d; color: var(--text-2); font-weight: 600; }
.sheet .player { margin-bottom: 4px; }
.kv { display: grid; gap: 0; padding: 4px 16px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 15px; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv span { color: var(--text-3); flex: none; }
.kv b { font-weight: 600; text-align: right; }
.mv-card { text-decoration: none; color: inherit; }
.vid-pick { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.vid-pick .btn { min-height: 50px; white-space: nowrap; }
.input.area { min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.cat-ed { background: var(--surface-2); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.cat-ed > .input { background: var(--surface-3); font-weight: 650; margin-bottom: 8px; }
.cat-ed .chip { background: var(--surface-3); }
.add-f { display: flex; gap: 6px; margin-top: 8px; }
.add-f .input { background: var(--surface-3); min-height: 42px; font-size: 15px; }
.add-f .select { width: 92px; flex: none; background-color: var(--surface-3); min-height: 42px; font-size: 14px; }

.quick { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; scrollbar-width: none; }
.quick .btn { flex: none; }
.count { display: inline-flex; align-items: center; gap: 3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; justify-content: center; }
.count.hot { background: var(--accent); color: #fff; }
.count svg.i { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.badges { display: flex; gap: 4px; }
.li.client { align-items: center; }
.inline-in { width: 100%; background: none; border: 0; font-size: 17px; font-weight: 650; padding: 4px 0; color: var(--text); }
.inline-in:focus { outline: none; box-shadow: 0 2px 0 var(--accent); }
.list.inner { background: var(--surface-2); margin: 10px 0 4px; }
.list.inner .li + .li { border-color: #36363a; }
.small-note { min-height: 60px; margin-bottom: 12px; font-size: 15px; }
.tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--surface-3); color: transparent; }
.tick svg.i { width: 16px; height: 16px; stroke-width: 2.4; }
.li.on .tick { background: var(--ok); box-shadow: none; color: #0d2116; }
.rank .rk { width: 28px; font-weight: 750; color: var(--text-3); text-align: center; flex: none; }
.rank .li:nth-child(1) .rk { color: #e8b64a; }
.rank .me { background: #1f2a22; }
.big-in { font-size: 26px; font-weight: 700; text-align: center; min-height: 60px; }
.li.danger { color: var(--accent-ink); }
.menu .li { justify-content: flex-start; }

/* rest timer: floating above the thumb zone */
.timer { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 30; max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 6px;
  background: #f6f3ee; color: #121212; border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5); overflow: hidden; animation: up .3s var(--ease) both; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.timer-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; transition: transform .25s linear; }
.timer-l { font-size: 13px; font-weight: 650; color: #5d5852; }
.timer-t { flex: 1; font-size: 24px; font-weight: 760; letter-spacing: -.01em; }
.timer button { min-width: 44px; height: 44px; border-radius: 12px; background: #e6e1d9; font-weight: 700; font-size: 14px; color: #121212; display: grid; place-items: center; }
.timer button svg.i { width: 18px; height: 18px; }
body:not(.in-session) .timer { bottom: calc(var(--nav-h) + var(--safe-b) + 10px); }
body.has-timer.in-session #app { padding-bottom: calc(var(--safe-b) + 96px); }
body.has-timer .toast { bottom: calc(var(--nav-h) + var(--safe-b) + 84px); }

@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .pill, .li, .seg button, .prog i, .timer-bar { transition: none; }
  .done-ic, .timer { animation: none; }
  .sheet { transition: opacity .2s ease; }
}
.view > .search { position: relative; top: auto; background: none; padding: 0; }

.steps { margin: 8px 0 18px; padding-left: 22px; color: var(--text-2); line-height: 1.55; }
.steps li { margin: 4px 0; padding-left: 4px; }
.seg.eleven { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.seg.eleven button { padding: 0; min-width: 0; height: 40px; font-size: 14px; }
.scale span[data-rpel] { color: var(--text); font-weight: 600; }
.rm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rm { background: var(--surface-2); border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; }
.rm .n { font-size: 12px; color: var(--text-3); font-weight: 650; letter-spacing: .02em; }
.rm b { font-size: 19px; font-variant-numeric: tabular-nums; }
.rm.faible { opacity: .6; }
.info { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); border: 0; font-weight: 700; font-size: 13px; flex: none; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; align-items: end; margin-bottom: 8px; }
.calc-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.calc-row label.wide { grid-column: span 2; }
.calc-row output { min-height: 44px; display: flex; flex-direction: column; justify-content: center; background: var(--surface-2); border-radius: var(--r-ctl); padding: 4px 10px; font-variant-numeric: tabular-nums; }
.calc-row output b { font-size: 17px; }

/* ---------- v4.1 · progress ---------- */
:root { --c1: #5aa9ff; --c2: #f2a65a; --c3: #3dd68c; --c4: #e86f9a; --c5: #b48cff; --c6: #4fd1c5; --c7: #f4d35e; --c8: #ff7a59; }
.top .grow { flex: 1; min-width: 0; }
.top .grow h1 { margin: 0; }
.pills.mini { margin: 8px 0 10px; }
.pills.mini .pill { min-height: 30px; padding: 0 11px; font-size: 13px; }
.insights { margin-bottom: 14px; }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 12px 16px; position: relative; }
.insight + .insight { border-top: 1px solid var(--line); }
.insight::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--neu); }
.insight.rouge::before { background: var(--accent-ink); }
.insight.orange::before { background: var(--int); }
.insight .grow { flex: 1; min-width: 0; }
.insight .t { font-weight: 650; display: block; }
.insight .s { white-space: pre-line; font-size: 13px; color: var(--text-2); display: block; margin-top: 2px; line-height: 1.4; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--r-card); padding: 12px 13px 10px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi:active { background: var(--surface-2); }
.kpi .kn, .kpi .kv, .kpi .kd { display: block; padding: 0; margin: 0; background: none; }
.kpi .kn { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .kv { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .kv small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.kpi .kd { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kpi .kd.up { color: var(--up); } .kpi .kd.down { color: var(--down); }
.spark { display: block; height: 26px; margin-top: 4px; }
.spark svg { width: 100%; display: block; }
.spark path { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linejoin: round; }
.spark circle { fill: var(--text); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.trio .stat { padding: 12px 11px; }
.trio .big { font-size: 22px; }
.stat .label { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.stat .label .info { width: 22px; height: 22px; font-size: 12px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tg { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; border: 0; }
.tg .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tg[aria-pressed="false"] { opacity: .45; }
.tg[aria-pressed="false"] .sw { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.tg.add { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.tg.add svg { width: 16px; height: 16px; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chart .mk.raw { opacity: .45; stroke-width: 0; }
.chart .base { stroke: var(--text-3); stroke-dasharray: 2 4; }
.chart .avg { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .7; }
.stackbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin-top: 10px; }
.stackbar i { display: block; }
.ratio .big small { font-size: 15px; color: var(--text-3); }
.rec-reps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.rec-reps > div { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.rec-reps span:first-child { font-size: 12px; color: var(--text-3); font-weight: 650; }
.rec-reps b { font-size: 18px; font-variant-numeric: tabular-nums; }
.li .s.prevu { color: var(--text-3); font-style: normal; opacity: .85; }
.chips.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-t { min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; border: 0; }
.chip-t[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chip-t.half[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.chip-t.sub { font-size: 12px; min-height: 30px; }
.chip-t:disabled { opacity: .55; }
details.classe { background: var(--surface-2); border-radius: var(--r-ctl); padding: 4px 12px; margin: 4px 0 14px; }
details.classe summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none; }
details.classe summary::-webkit-details-marker { display: none; }
details.classe[open] summary { margin-bottom: 6px; }
/* profile and person page */
.av.me { text-decoration: none; }
.av.xl { width: 60px; height: 60px; font-size: 20px; }
.card.ident { display: flex; align-items: center; gap: 14px; }
.card.ident .grow { min-width: 0; flex: 1; }
.card.ident .h2 { overflow-wrap: anywhere; }
.pf-cta { border: 1px solid var(--line); }
.pf { margin-top: 16px; }
.pf .seg.wrap { flex-wrap: wrap; }
.pf-nav { display: flex; gap: 10px; margin: 6px 0 16px; }
.pf-nav .btn { flex: 1; }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--r-card); padding: 14px; margin: 4px 0 12px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.kv b.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.li[hidden] { display: none; }
.wk-nav { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.wk-nav .btn svg.i { width: 16px; height: 16px; }
.card.hot-card { background: #2a1718; box-shadow: inset 0 0 0 1px #5a2427; }
.li a.grow { display: block; text-decoration: none; color: inherit; min-width: 0; }
.li[disabled] { opacity: .7; }
