/* Boussole : feuille de style unique.
   Sobre et dense : papier chaud, encre, un seul accent bleu pétrole.
   Vert et rouge réservés aux gains et aux pertes. */

:root {
  --bg: #F5F4F0; --surface: #FFFFFF; --surface-2: #FAF9F6; --hover: #F1EFEA;
  --line: #E6E3DC; --line-2: #D6D2C8;
  --ink: #17191C; --ink-2: #474C54; --muted: #7A7F87;
  --accent: #0E6A7A; --accent-ink: #FFFFFF; --accent-soft: #E2EFF0; --accent-line: #A9CFD5;
  --pos: #1D8A55; --neg: #C43E2B;
  --c-blue: #3567C9; --c-green: #2C8C5A; --c-orange: #D27A1E; --c-red: #C9473D;
  --c-violet: #7A58BF; --c-teal: #13879A; --c-pink: #C2497F; --c-slate: #5E6773;
  --r: 8px; --r-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 2px 8px rgba(20, 22, 26, .04);
  --shadow-lg: 0 12px 40px rgba(20, 22, 26, .18);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --side: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1113; --surface: #16191C; --surface-2: #1A1E22; --hover: #1F2328;
    --line: #262A30; --line-2: #333940;
    --ink: #ECEDEE; --ink-2: #C3C7CC; --muted: #8B9199;
    --accent: #4DB4C6; --accent-ink: #061416; --accent-soft: #15292D; --accent-line: #24535B;
    --pos: #46C283; --neg: #F0715E;
    --c-blue: #6E98EE; --c-green: #4FBF83; --c-orange: #E9A24F; --c-red: #EE7468;
    --c-violet: #A88AE8; --c-teal: #45B9CB; --c-pink: #E77AAE; --c-slate: #98A2AE;
    --shadow: none; --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1113; --surface: #16191C; --surface-2: #1A1E22; --hover: #1F2328;
  --line: #262A30; --line-2: #333940;
  --ink: #ECEDEE; --ink-2: #C3C7CC; --muted: #8B9199;
  --accent: #4DB4C6; --accent-ink: #061416; --accent-soft: #15292D; --accent-line: #24535B;
  --pos: #46C283; --neg: #F0715E;
  --c-blue: #6E98EE; --c-green: #4FBF83; --c-orange: #E9A24F; --c-red: #EE7468;
  --c-violet: #A88AE8; --c-teal: #45B9CB; --c-pink: #E77AAE; --c-slate: #98A2AE;
  --shadow: none; --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.cap::first-letter { text-transform: uppercase; }
.sp { flex: 1; }
.ico { flex: none; display: block; }
.ok { color: var(--pos); }
.pad { padding: 14px 18px; }
.pad-x { padding: 0 18px 14px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- coquille ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--surface-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 17px; letter-spacing: -.02em; }
.brand.big { font-size: 26px; padding: 0 0 6px; }
.mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); position: relative; flex: none; }
.mark::after { content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; background: linear-gradient(var(--accent) 50%, var(--ink) 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: rotate(35deg); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; transition: background .12s, color .12s; }
.sidebar nav a:hover { background: var(--hover); color: var(--ink); }
.sidebar nav a.on { background: var(--ink); color: var(--bg); }
.sidebar nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-btn { margin-top: 10px; justify-content: center; }
.offline { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; padding: 10px; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; }
.page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .mark { width: 34px; height: 34px; animation: spin 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- titres de page ---------- */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.page-h h1 { font-size: 26px; letter-spacing: -.02em; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.cal-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-btns { display: flex; align-items: center; gap: 2px; }
.eyebrow { color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.02; letter-spacing: -.01em; }
.display em { font-style: italic; color: var(--ink-2); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, transform .08s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--neg); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.active { color: var(--accent); }
.link { color: var(--accent); font-weight: 550; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; min-height: 48px; }
.card-h h2 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.card-h h2 .ico { color: var(--muted); }
.sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 18px 6px; }
.sub.nopad { padding: 0 0 4px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 15.5px; }
.empty p { max-width: 360px; }
.empty .btn { margin-top: 6px; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px; border-style: dashed; color: var(--muted); font-weight: 550; box-shadow: none; background: transparent; }
.add-card:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- aujourd'hui ---------- */
.today-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 4px 0 8px; }
.day-score { display: flex; align-items: center; gap: 12px; }
.day-score b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.day-score span { color: var(--muted); font-size: 13px; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset .5s cubic-bezier(.3, .7, .2, 1); }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash .span2 { grid-column: span 2; }
.inline-add { display: flex; align-items: center; gap: 10px; margin: 0 18px 6px; padding: 0 12px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); color: var(--muted); }
.inline-add:focus-within { border-style: solid; border-color: var(--accent); color: var(--accent); }
.inline-add input { flex: 1; border: 0; background: none; outline: none; height: 40px; color: var(--ink); min-width: 0; }
.tasks { padding: 4px 8px 10px; }
.task { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.task:hover { background: var(--hover); }
.task-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-t > span { overflow-wrap: anywhere; }
.task-t small { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.task-t small:empty { display: none; }
.task-t small span { display: inline-flex; gap: 4px; align-items: center; }
.task.done .task-t > span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.late { color: var(--neg); font-style: normal; }
.prio { width: 8px; height: 8px; border-radius: 50%; background: var(--c-orange); flex: none; }
.task.p2 .prio { background: var(--neg); }
.task.done .prio { opacity: .3; }
.chk { display: inline-grid; place-items: center; flex: none; --c: var(--accent); }
.chk rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.6; transition: fill .15s, stroke .15s; }
.chk path { fill: none; stroke: transparent; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .22s ease .03s; }
.chk:hover rect { stroke: var(--c); }
.chk.on rect { fill: var(--c); stroke: var(--c); }
.chk.on path { stroke: var(--surface); stroke-dashoffset: 0; }
.chk.on { animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(1.12); } }

.wq { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.wq + .wq { border-top: 1px solid var(--line); padding-top: 14px; }
.wq-h { display: flex; justify-content: space-between; align-items: baseline; }
.wq-h small { color: var(--muted); }
.ex-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ex-list li:last-child { border-bottom: 0; }
.ex-list li span { flex: 1; }
.ex-list li small { color: var(--muted); font-variant-numeric: tabular-nums; }
.ex-list li.done span { color: var(--muted); text-decoration: line-through; }
.wq.completed .wq-h b::after { content: ' · faite'; color: var(--pos); font-weight: 500; }

.habits-q { padding: 2px 8px 12px; }
.habits-q li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.habits-q li:hover { background: var(--hover); }
.habits-q li span { flex: 1; }
.habits-q li.done span { color: var(--muted); }
.streak { display: inline-flex; align-items: center; gap: 3px; color: var(--c-orange); font-weight: 600; font-variant-numeric: tabular-nums; }

.agenda-mini { padding: 0 8px 12px; }
.agenda-mini li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.agenda-mini li:hover { background: var(--hover); }
.agenda-mini .when { display: flex; flex-direction: column; line-height: 1.2; }
.agenda-mini .when b { font-weight: 600; font-size: 13.5px; }
.agenda-mini .when small { color: var(--muted); }
.agenda-mini .what { display: flex; gap: 7px; align-items: center; min-width: 0; }
.agenda-mini .what i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.agenda-mini .what .ico { color: var(--c); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.kpis div:last-child { grid-column: span 2; }
.kpis small, .kpi small, .stats small { display: block; color: var(--muted); font-size: 12.5px; }
.kpis b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.meter i.over { background: var(--neg); }
textarea.inbox { display: block; width: calc(100% - 36px); margin: 0 18px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 10px 12px; resize: vertical; min-height: 96px; outline: none; }
textarea.inbox:focus { border-color: var(--accent); }
.mini-list { padding: 0 18px 12px; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > span { flex: 1; min-width: 0; }
.mini-list li small { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.mini-list li small.pos { color: var(--pos); }
.mini-list li small.neg { color: var(--neg); }
.mini-list.hist .hd { flex: 0 0 120px; color: var(--muted); font-size: 13px; }

/* ---------- formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.compact { gap: 10px; margin-top: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 2 1 180px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 0 11px; height: 40px; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { padding: 9px 11px; height: auto; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type=date], input[type=time] { min-width: 0; }
.big-num { font-size: 22px !important; font-weight: 600; height: 48px !important; font-variant-numeric: tabular-nums; }
.select-sm { height: 32px; width: auto; max-width: 180px; font-size: 13.5px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch.mini input { width: 32px; height: 18px; }
.switch.mini input::after { width: 12px; height: 12px; }
.switch.mini input:checked::after { transform: translateX(14px); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: var(--r-sm); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 13px; border-radius: 5px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.small button { height: 28px; padding: 0 11px; font-size: 13.5px; }
.cat-pick, .sugg, .filters, .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13.5px; font-weight: 500; background: var(--surface); }
.cat-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); opacity: .35; }
.cat-chip.on { border-color: var(--c, var(--accent)); color: var(--ink); background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--surface)); }
.cat-chip.on i { opacity: 1; }
.cat-chip.plain.on { --c: var(--accent); }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.colors button { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.colors button.on { box-shadow: 0 0 0 2px var(--ink); }
.day-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick button { height: 36px; min-width: 46px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font-weight: 550; color: var(--ink-2); }
.day-pick button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stars { display: flex; gap: 2px; }
.stars button { font-size: 22px; line-height: 1; color: var(--line-2); padding: 4px 2px; }
.stars button.on { color: var(--c-orange); }

/* ---------- fenêtres ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(12, 14, 16, .42); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(540px, 100%); max-height: min(88dvh, 820px); display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { width: min(760px, 100%); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 22px; }
.modal-h h2 { font-size: 18px; }
.modal-b { padding: 8px 22px 18px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-i { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.quick-i:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.quick-i .ico { color: var(--accent); }
.quick-i b { display: block; }
.quick-i small { color: var(--muted); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 5px; animation: fade .1s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 5px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--neg); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; gap: 16px; align-items: center; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); animation: rise .2s; font-weight: 500; }
.toast button { color: var(--accent-line); font-weight: 650; }

/* ---------- calendrier ---------- */
.filters { margin-top: -4px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dow { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.day { min-height: 112px; padding: 6px; text-align: left; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .1s; }
.day:nth-child(7n) { border-right: 0; }
.day:nth-last-child(-n+7) { border-bottom: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: var(--surface-2); }
.day.out .num { color: var(--muted); opacity: .6; }
.day .num { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; width: 26px; height: 26px; justify-content: center; border-radius: 50%; font-variant-numeric: tabular-nums; position: relative; }
.day.now .num { background: var(--accent); color: var(--accent-ink); }
.day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.sport-dot { position: absolute; right: -3px; top: -1px; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); border: 1.5px solid var(--surface); }
.chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip { display: block; font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 0; }
.chip small { color: var(--c); font-weight: 600; margin-right: 4px; }
.more, .tcount { font-size: 11.5px; color: var(--muted); padding-left: 6px; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.dots i.t { background: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; min-height: 300px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-width: 0; }
.wday.now { border-color: var(--accent-line); }
.wday.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.wday header { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 6px; position: relative; }
.wday header span { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; }
.wday header b { font-size: 20px; }
.wday.now header b { color: var(--accent); }
.wday header .sport-dot { position: static; }
.wev { padding: 5px 7px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); font-size: 12.5px; display: flex; flex-direction: column; min-width: 0; }
.wev small { color: var(--c); font-weight: 600; }
.wev span { overflow-wrap: anywhere; }
.wtask { display: flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--ink-2); padding: 2px 4px; }
.wtask.done { color: var(--muted); text-decoration: line-through; }
.wadd { margin-top: auto; align-self: center; color: var(--muted); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; opacity: 0; transition: opacity .1s; }
.wday:hover .wadd, .wadd:focus-visible { opacity: 1; }
.wadd:hover { background: var(--hover); color: var(--accent); }
.agenda { display: flex; flex-direction: column; gap: 10px; }
.ag-day { display: grid; grid-template-columns: 140px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.ag-day h3 { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.ag-day h3 b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ag-day h3 span { display: flex; flex-direction: column; line-height: 1.2; }
.ag-day h3 small { color: var(--muted); font-size: 12.5px; }
.ag-day li { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.ag-day li i { width: 4px; align-self: stretch; border-radius: 2px; background: var(--c); }
.ag-day li .t { width: 90px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.ag-day li small { color: var(--muted); }
.day-panel { position: sticky; top: 20px; }
.ev-list { padding: 0 12px 6px; }
.ev-list li { display: flex; gap: 10px; padding: 8px 6px; border-radius: var(--r-sm); cursor: pointer; }
.ev-list li:hover { background: var(--hover); }
.ev-list li > i { width: 4px; border-radius: 2px; background: var(--c); flex: none; }
.ev-list b { display: block; font-weight: 600; }
.ev-list small { color: var(--muted); }
.ev-list p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; white-space: pre-wrap; }

/* ---------- tâches ---------- */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-filters { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.side-filters h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 6px; }
.side-filters button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; text-align: left; }
.side-filters button:hover { background: var(--hover); }
.side-filters button.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.side-filters button small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-filters .hash { width: 20px; text-align: center; color: var(--muted); font-weight: 600; }
.side-filters .add-list { color: var(--muted); }
.task-main { padding-top: 14px; }
.tgroup + .tgroup { border-top: 1px solid var(--line); }
.tasks-page.solo .split { grid-template-columns: 1fr; }

/* ---------- sport ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.stats b { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats b span { font-size: 15px; color: var(--muted); font-weight: 500; }
.stats.in-card { padding: 0 18px 12px; }
.stats.in-card > div { background: var(--surface-2); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px; gap: 4px; }
.ws { position: relative; padding: 10px; border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.ws b { font-size: 18px; }
.ws span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws .ico { position: absolute; right: 8px; top: 10px; color: var(--pos); }
.ws.now { background: var(--accent-soft); }
.ws.now b { color: var(--accent); }
.ws.done span { color: var(--pos); }
.ws.miss span { color: var(--muted); text-decoration: line-through; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.details .link { display: inline-block; margin-bottom: 4px; }
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.log-table td { padding: 3px 6px 3px 0; }
.log-table input { height: 34px; width: 80px; }
.plan-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px; gap: 4px; }
.pw { padding: 10px; display: flex; flex-direction: column; gap: 5px; border-radius: var(--r-sm); min-width: 0; }
.pw.now { background: var(--accent-soft); }
.pw small { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.pw-w { font-size: 13px; font-weight: 550; padding: 3px 7px; border-radius: 4px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw .muted { font-size: 13px; }
.workouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.days-line { display: flex; gap: 4px; padding: 0 18px 10px; }
.days-line span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.days-line span.on { background: var(--c); color: #fff; }
.ex-plan { padding: 0 18px 10px; counter-reset: ex; }
.ex-plan li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); counter-increment: ex; }
.ex-plan li::before { content: counter(ex); color: var(--muted); font-size: 12px; width: 16px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.ex-plan li span { flex: 1; }
.ex-plan li small { color: var(--muted); }
.ex-edit { display: flex; flex-direction: column; gap: 6px; }
.ex-head, .ex-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, .9fr) 72px; gap: 6px; align-items: center; }
.ex-head span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ex-row input { height: 36px; padding: 0 9px; }
.ex-act { display: flex; }
.heat-wrap { padding: 0 18px 16px; overflow-x: auto; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; min-width: 520px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.heat i.on { background: var(--pos); }
.heat i.fut { opacity: .35; }
.heat-months { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding-top: 6px; min-width: 520px; }

/* ---------- habitudes ---------- */
.habit-table { padding: 6px 0; overflow-x: auto; }
.ht-row { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(7, 44px) 64px 54px 40px; align-items: center; gap: 4px; padding: 5px 14px; min-width: max-content; }
.ht-row + .ht-row { border-top: 1px solid var(--line); }
.ht-row > span { display: flex; justify-content: center; align-items: center; gap: 4px; }
.ht-head > span { flex-direction: column; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; gap: 0; }
.ht-head b { font-size: 14px; color: var(--ink); }
.ht-head .now b { color: var(--accent); }
.hname { justify-content: flex-start !important; font-weight: 550; gap: 9px !important; }
.hname i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.off { color: var(--line-2); }
.streak-n { color: var(--c-orange); font-weight: 600; font-variant-numeric: tabular-nums; }
.habit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.hgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 18px 16px; }
.hgrid small { text-align: center; color: var(--muted); font-size: 11px; font-weight: 600; }
.hcell { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hcell.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.hcell.nd:not(.on) { background: transparent; border-style: dashed; }
.hcell.fut { opacity: .35; cursor: default; }
.hcell.now { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- argent ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; }
.kpi b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.money-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.money-side { display: flex; flex-direction: column; gap: 16px; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; color: var(--muted); background: var(--surface-2); }
.search input { border: 0 !important; background: none !important; box-shadow: none !important; height: 34px; padding: 0; }
.tx-list { padding: 0 8px 6px; }
.tx-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.tx-list li:hover { background: var(--hover); }
.tx-cat { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--ink-2); flex: none; text-transform: uppercase; }
.tx-l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-l b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-l small { color: var(--muted); }
.tx-a { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cat-bars { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.cb-h { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.cb-h b { font-variant-numeric: tabular-nums; font-weight: 600; }
.cb-h small { color: var(--muted); }
.cb-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); }
.cb-budget { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--line); }
.cb-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--ink-2); transition: width .4s; }
.cb-fill.over { background: var(--neg); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.legend i.inc, .bar.inc { background: var(--pos); }
.legend i.exp, .bar.exp { background: var(--neg); }
.bars { display: flex; align-items: stretch; gap: 10px; }
.bar-g { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: center; min-width: 0; }
.bar-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { width: 40%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 1px; opacity: .85; transition: height .4s; }
.bar-g span { font-size: 12px; color: var(--muted); }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* ---------- notes ---------- */
.notes-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.notes-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 140px); overflow-y: auto; position: sticky; top: 20px; }
.notes-list li { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.notes-list li:hover { background: var(--hover); }
.notes-list li.on { background: var(--accent-soft); }
.notes-list li b { display: flex; gap: 6px; align-items: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-list li b .ico { color: var(--accent); }
.notes-list li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 12.5px; padding: 3px 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.note-ed { min-height: 60dvh; display: flex; flex-direction: column; }
.note-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.note-title { border: 0 !important; box-shadow: none !important; font-size: 24px; font-weight: 650; height: auto !important; padding: 18px 22px 2px !important; letter-spacing: -.01em; background: none !important; }
.note-tags { border: 0 !important; box-shadow: none !important; height: 30px !important; padding: 0 22px !important; color: var(--accent); font-size: 13.5px; background: none !important; }
.note-body { flex: 1; border: 0 !important; box-shadow: none !important; padding: 12px 22px 22px !important; min-height: 50dvh; resize: none; font-size: 15.5px; line-height: 1.6; background: none !important; }
.md { padding: 12px 22px 26px; line-height: 1.65; font-size: 15.5px; }
.md h2, .md h3, .md h4 { margin: 16px 0 6px; }
.md p { margin: 0 0 6px; min-height: 1em; }
.md ul, .md ol { padding-left: 22px; margin: 4px 0 10px; list-style: disc; }
.md ol { list-style: decimal; }
.md ul.cl { list-style: none; padding-left: 0; }
.md ul.cl li { display: flex; gap: 10px; align-items: baseline; cursor: pointer; padding: 2px 0; }
.md .box { width: 16px; height: 16px; border: 1.6px solid var(--line-2); border-radius: 4px; flex: none; transform: translateY(3px); }
.md li.on { color: var(--muted); text-decoration: line-through; }
.md li.on .box { background: var(--accent); border-color: var(--accent); }
.md code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .9em; }
.md a { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }

/* ---------- suivis ---------- */
.tracker-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tc { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; text-align: left; transition: border-color .12s; }
.tc:hover { border-color: var(--accent-line); }
.tc-h { display: flex; justify-content: space-between; align-items: baseline; }
.tc-h small { color: var(--muted); }
.tc-v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tc-v small { font-size: 14px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.tracker { display: flex; flex-direction: column; gap: 16px; }
.chart { position: relative; }
.chart svg { display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.chart .dot.hot { fill: var(--accent); }
.chart .cursor { stroke: var(--line-2); }
.chart .tip { position: absolute; top: 4px; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 6px; padding: 5px 9px; font-size: 12.5px; display: flex; flex-direction: column; line-height: 1.3; transform: translateX(-50%); white-space: nowrap; }
.chart-empty { padding: 30px 0; text-align: center; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-table th:first-child, .grid-table td:first-child { padding-left: 16px; }
.grid-table td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.grid-table tr:last-child td { border-bottom: 0; }
.grid-table input { border-color: transparent; height: 36px; background: transparent; min-width: 90px; }
.grid-table input:hover { border-color: var(--line); }
.grid-table input[type=date] { min-width: 140px; }
.grid-table td.t-number input { text-align: right; font-variant-numeric: tabular-nums; max-width: 120px; }
.grid-table td.t-check { text-align: center; }
.t-act { width: 44px; }
.col-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px 34px; gap: 6px; margin-bottom: 6px; }
.col-row input, .col-row select { height: 36px; }

/* ---------- réglages ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-grid > section:first-child { grid-row: span 3; }
.tab-admin { padding: 0 10px 12px; }
.tab-admin li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); }
.tab-admin li:hover { background: var(--hover); }
.tab-admin li > span { flex: 1; display: flex; gap: 8px; align-items: baseline; font-weight: 500; }
.tab-admin li small { color: var(--muted); font-size: 12px; }
.tab-admin li.off > span, .tab-admin li.off > .ico { opacity: .45; }
.tab-admin .switch { margin-left: 6px; }
.cat-admin { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.cat-admin li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cat-admin input { height: 34px; flex: 1 1 140px; width: auto; }
.cat-admin .colors button { width: 20px; height: 20px; }
.type-pick { display: flex; flex-direction: column; gap: 8px; }
.type-pick button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.type-pick button.on { border-color: var(--accent); background: var(--accent-soft); }
.type-pick button .ico { color: var(--accent); }
.type-pick b { display: block; }
.type-pick small { color: var(--muted); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-2); }
.icon-pick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- connexion ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 30px 28px; box-shadow: var(--shadow); }
.err { color: var(--neg); font-size: 14px; }

/* ---------- tablette : rail d'icônes ---------- */
@media (max-width: 1199px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash .span2 { grid-column: span 2; }
  .cal-layout { grid-template-columns: 1fr; }
  .day-panel { position: static; }
  .money-grid { grid-template-columns: 1fr; }
  .money-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 1023px) {
  :root { --side: 76px; }
  .sidebar { padding: 16px 8px; align-items: stretch; }
  .brand { justify-content: center; padding: 4px 0 16px; }
  .brand b { display: none; }
  .sidebar nav a { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 11px; text-align: center; }
  .sidebar nav a span { max-width: 100%; }
  .add-btn { padding: 0; }
  .add-btn span, .offline span { display: none; }
  .split { grid-template-columns: 1fr; }
  .side-filters { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .side-filters h3 { display: none; }
  .side-filters button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); flex: none; }
  .side-filters button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
  .side-filters button.on .ico, .side-filters button.on .hash, .side-filters button.on small { color: inherit; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > section:first-child { grid-row: auto; }
}
@media (max-width: 899px) {
  .notes-layout { grid-template-columns: 1fr; }
  .notes-list { position: static; max-height: none; }
  .notes.reading .notes-list, .notes.reading > .page-h { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .wday { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .wday header { width: 100%; padding-bottom: 2px; }
  .wadd { opacity: 1; margin: 0 0 0 auto; }
}

/* ---------- téléphone : barre d'onglets en bas ---------- */
@media (max-width: 719px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  body { font-size: 15.5px; }
  .page { gap: 14px; }
  .page-h h1 { font-size: 23px; }
  .hide-sm { display: none !important; }
  .btn.primary .ico + .hide-sm { display: none; }
  .dash { grid-template-columns: 1fr; }
  .dash .span2 { grid-column: auto; }
  .today-h { align-items: flex-start; }
  .day-score { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
  .stats, .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats b, .kpi b { font-size: 20px; }
  .month .day { min-height: 54px; padding: 4px 2px; align-items: center; }
  .dow { text-align: center; padding: 8px 0; }
  .agenda-mini li { grid-template-columns: 82px 1fr; }
  .agenda-mini li > small { display: none; }
  .ag-day { grid-template-columns: 1fr; gap: 4px; }
  .week-strip, .plan-week { grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 4px; gap: 2px; }
  .ws, .pw { padding: 8px 2px; align-items: center; text-align: center; }
  .ws span, .pw-w, .pw .muted { display: none; }
  .ws .ico { position: static; }
  .pw small { font-size: 10.5px; }
  .pw::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
  .ex-head { display: none; }
  .ex-row { grid-template-columns: 1fr 1fr 1fr; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .ex-row input:first-child { grid-column: 1 / -1; }
  .ex-act { grid-column: 1 / -1; justify-content: flex-end; }
  .mini-list.hist .hd { flex-basis: 90px; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
  .modal-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .quick { grid-template-columns: 1fr; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); }
  .col-row { grid-template-columns: 1fr 96px 34px; }
  .col-row .unit { grid-column: 1 / 3; }
  .notes-list { padding: 10px; }
  .note-ed { min-height: 70dvh; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; } /* pas de zoom iOS */
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.tabbar a, .tabbar > button:not(.fab) { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; color: var(--muted); font-size: 11px; font-weight: 550; }
.tabbar .on { color: var(--ink); }
.tabbar .on .ico { color: var(--accent); }
.fab { justify-self: center; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.sheet-o { align-items: flex-end; padding: 0; }
.sheet { width: 100%; background: var(--surface); border-radius: 16px 16px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13px; font-weight: 550; text-align: center; }
.sheet-grid a.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .modal, .sheet, .overlay, .toast, .chk.on { animation-duration: .01ms !important; }
}

/* ---------- retouches après relecture des captures ---------- */
.inline-add input, .inline-add input:focus { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: none !important; }
.day-panel .card-h { flex-wrap: wrap; }
.day-panel .card-h h2 { flex: 1 1 100%; }
@media (max-width: 719px) {
  .habit-table { overflow: visible; }
  .ht-row { grid-template-columns: minmax(0, 1fr) repeat(7, 30px) 30px; gap: 2px; padding: 5px 8px; min-width: 0; }
  .ht-row .hname { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
  .ht-row .hname i { display: none; }
  .ht-row .chk svg { width: 20px; height: 20px; }
  .ht-head > span { font-size: 10px; }
  .ht-head b { font-size: 13px; }
}
.sport-card .wq { padding-top: 16px; }
