:root {
  --bg: #F6F7F4;
  --card: #FFFFFF;
  --ink: #14213D;
  --ink-2: #5B6478;
  --ink-3: #98A0B0;
  --line: #E9ECEF;
  --blue: #14306B;
  --blue-2: #1F4AA8;
  --blue-soft: #E8EEFA;
  --green: #2E9E6E;
  --green-soft: #E3F4EC;
  --amber: #C98A12;
  --amber-soft: #FFF4DC;
  --red: #D04E5B;
  --red-soft: #FDECEE;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .04), 0 6px 24px rgba(20, 33, 61, .05);
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); }
body.sheet-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h2 { font-size: 1rem; margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: .4rem 0; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.center { text-align: center; }
.mt { margin-top: .75rem; }
.pos { color: var(--green); }
.neg { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }

/* ---------- Structure ---------- */
.content { max-width: 640px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + 96px + var(--safe-b)); }
.view { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.month-label { font-weight: 700; font-size: 1.05rem; padding: 8px 14px; border-radius: 999px; min-width: 170px; }
.month-label:hover { background: var(--blue-soft); }
.month-nav { width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; line-height: 1; color: var(--blue); background: var(--card); box-shadow: var(--shadow); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.brand { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--blue); }
.tab.active svg { stroke-width: 2.2; }

.fab {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px + var(--safe-b));
  display: flex; align-items: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 1rem; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(20, 48, 107, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab span { font-size: 1.3rem; line-height: 1; }
.fab:active { transform: translateX(-50%) scale(.97); }
body[data-tab="analyses"] .fab, body[data-tab="settings"] .fab, body.sheet-open .fab { display: none; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.link { color: var(--blue-2); font-weight: 600; font-size: .9rem; }
.link.danger { color: var(--red); }

.hero {
  border-radius: 24px; padding: 22px 20px 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2B5CC7 0%, var(--blue) 55%, #0E2350 100%);
  box-shadow: 0 14px 34px rgba(20, 48, 107, .28);
}
.hero.over { background: radial-gradient(120% 140% at 100% 0%, #C9566A 0%, #8E2C3F 60%, #5E1A29 100%); }
.hero-top { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; opacity: .9; }
.pill { background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.hero-amount { font-size: 2.2rem; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 14px; }
.hero-amount.sm { font-size: 1.4rem; }
.hero-hint { opacity: .85; margin: 0 0 14px; }
.hero .bar { background: rgba(255, 255, 255, .18); }
.hero .bar span { background: #8EE3B9; }
.hero .bar.warn span { background: #FFD27A; }
.hero .bar.over span { background: #FFB3BD; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.hero-stats > * { text-align: left; background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 10px 12px; color: #fff; }
.hero-stats small { display: block; font-size: .75rem; opacity: .8; }
.hero-stats b { font-size: .98rem; }

.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--green)); transition: width .4s ease; }
.bar.ok span { background: var(--green); }
.bar.warn span { background: var(--amber); }
.bar.over span { background: var(--red); }
.bar.neutral span { background: var(--c, var(--blue-2)); }

.notice { border-radius: 16px; padding: 14px 16px; font-size: .92rem; line-height: 1.4; }
.notice.info { background: var(--blue-soft); }
.notice.warn { background: var(--amber-soft); }
.notice.danger { background: var(--red-soft); color: #7A1F2B; }
.notice-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 14px; padding: 13px 18px; font-weight: 650; transition: background .15s; }
.btn.sm { padding: 8px 14px; font-size: .88rem; border-radius: 12px; }
.btn.block { width: 100%; margin-top: 10px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.ghost { background: var(--blue-soft); color: var(--blue); }
.btn.light { background: #fff; color: var(--blue); }
.btn.danger-ghost { color: var(--red); background: var(--red-soft); }

/* ---------- Dépenses ---------- */
.bubble { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-size: 1.2rem; background: color-mix(in srgb, var(--c) 18%, white); }
.bubble.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; }
.exp-list { display: flex; flex-direction: column; }
.exp-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; text-align: left; border-radius: 12px; width: 100%; }
.exp-row + .exp-row { border-top: 1px solid var(--line); }
.exp-row:hover { background: #FAFBFC; }
.exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exp-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-meta { font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 18px 8px; color: var(--ink-2); }
.empty-icon { font-size: 2rem; }
.empty b { display: block; color: var(--ink); margin-top: 6px; }

.split { display: flex; align-items: center; gap: 18px; }
.donut { width: 132px; height: 132px; flex: none; }
.donut-k { font-size: 10px; fill: var(--ink-2); }
.donut-v { font-size: 15px; font-weight: 700; fill: var(--ink); }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.legend-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { font-weight: 650; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }

/* Bilan du jour */
.daily { background: linear-gradient(180deg, #fff 0%, #FBFCFF 100%); }
.daily.good { background: linear-gradient(180deg, #fff 0%, var(--green-soft) 140%); }
.daily-msg { font-size: 1.02rem; font-weight: 600; color: var(--blue); margin: 0 0 6px; }
.daily.good .daily-msg { color: var(--green); }
.streak { font-size: .82rem; font-weight: 700; background: var(--amber-soft); color: #8A5A00; padding: 4px 10px; border-radius: 999px; }
.dots { display: flex; justify-content: space-between; margin: 14px 0 12px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.day i { width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; }
.day.on i { background: var(--green); }
.day.on i::after { content: "✓"; color: #fff; font-style: normal; font-size: .8rem; font-weight: 800; }
.day.today { color: var(--blue); }
.day.today i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-soft); }
.daily-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Barre d'outils, filtres */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 6px; }
.icon-btn { font-size: .82rem; font-weight: 650; color: var(--blue); background: var(--card); padding: 8px 12px; border-radius: 12px; box-shadow: var(--shadow); }
.seg { display: inline-flex; background: #E9ECF2; border-radius: 14px; padding: 4px; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.seg button { padding: 8px 18px; border-radius: 10px; font-weight: 650; font-size: .9rem; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters input[type="search"], .range { grid-column: 1 / -1; }
.filters select, .filters input, .range input {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; font-size: 16px; min-width: 0;
}
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range label { font-size: .8rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.summary-strip { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; color: var(--ink-2); }
.summary-strip b { color: var(--ink); font-size: 1.1rem; }
.day-group { padding: 12px 14px; }
.day-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); padding: 2px 4px 6px; font-weight: 600; }
.day-head span::first-letter { text-transform: uppercase; }
.day-head b { color: var(--ink); }

/* Tableur */
.sheet-card { padding: 0; overflow: hidden; }
.sheet-scroll { overflow: auto; max-height: 65vh; -webkit-overflow-scrolling: touch; }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 820px; font-size: 15px; table-layout: fixed; }
.sheet col, .sheet th { width: 160px; }
.sheet th { position: sticky; top: 0; z-index: 2; background: #F1F4FA; color: var(--blue); text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.sheet td { border-bottom: 1px solid var(--line); padding: 0; background: #fff; overflow: hidden; }
/* Date + Désignation figées à gauche pendant le défilement horizontal */
.sheet .c-date { position: sticky; left: 0; z-index: 1; width: 62px; }
.sheet .c-label { position: sticky; left: 62px; z-index: 1; width: 150px; box-shadow: 1px 0 0 var(--line); }
.sheet th.c-date, .sheet th.c-label { z-index: 3; }
.sheet th.num { width: 108px; }
.sheet th:last-child { width: 44px; }
.sheet tbody tr:not(.subtotal) td.c-date { box-shadow: inset 3px 0 0 var(--c, transparent); }
.date-cell { position: relative; display: block; padding: 11px 6px 11px 10px; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.date-cell input { position: absolute; inset: 0; opacity: 0; width: 100%; padding: 0; cursor: pointer; }
.date-cell:focus-within { background: var(--blue-soft); }
.sheet input, .sheet select { width: 100%; border: 0; background: transparent; padding: 11px 8px; font-size: 16px; border-radius: 0; min-width: 0; text-overflow: ellipsis; }
.sheet select:disabled { color: var(--ink-3); }
.sheet input:focus, .sheet select:focus { outline: none; background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue-2); }
.sheet .num, .sheet input.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.sheet input.zero { color: var(--ink-3); }
.sheet tr.subtotal td { background: #FAFBFD; color: var(--ink-2); font-size: .82rem; padding: 7px 8px; font-weight: 600; }
.sheet tr.subtotal td.num { color: var(--ink); }
.sheet tfoot td { position: sticky; bottom: 0; background: var(--blue); color: #fff; font-weight: 700; padding: 12px 8px; }
.row-del { width: 36px; height: 36px; color: var(--ink-3); border-radius: 10px; }
.row-del:hover { color: var(--red); background: var(--red-soft); }
.add-row { display: block; width: 100%; padding: 14px; color: var(--blue-2); font-weight: 650; border-top: 1px solid var(--line); }
.add-row:hover { background: var(--blue-soft); }

.cat-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cat-line + .cat-line { border-top: 1px solid var(--line); }
.cat-line-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.cat-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Analyses */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpis > div { background: #F7F9FC; border-radius: 14px; padding: 10px; min-width: 0; }
.kpis small { display: block; color: var(--ink-2); font-size: .72rem; }
.kpis b { display: block; font-size: clamp(.78rem, 3.5vw, .98rem); margin-top: 2px; white-space: nowrap; }
.kpis em { display: block; font-style: normal; font-size: .7rem; color: var(--ink-3); }
.ana-cat { padding: 10px 0; }
.ana-cat + .ana-cat { border-top: 1px solid var(--line); }
.ana-cat-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-bottom: 8px; }
.ana-cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ana-cat-name { font-weight: 650; }
.ana-cat-head b { white-space: nowrap; }
.ana-sub { margin: 10px 0 0 54px; display: flex; flex-direction: column; gap: 2px; }
.sub-line { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cat-budget { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: 8px; }
.cat-budget input { width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; text-align: right; }
.tag { font-size: .68rem; padding: 2px 7px; border-radius: 999px; vertical-align: 2px; }
.tag.danger { background: var(--red-soft); color: var(--red); }

.ychart { width: 100%; height: auto; display: block; }
.ychart text { font-size: 9px; fill: var(--ink-3); font-weight: 600; }
.ybar { cursor: pointer; }
.ybar .spent { fill: #A9C0EE; }
.ybar.cur .spent { fill: var(--blue-2); }
.ybar.over .spent { fill: #EE9AA5; }
.ybar.cur text { fill: var(--blue); }
.budget-mark { stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; }
.legend-inline { display: flex; gap: 16px; justify-content: center; font-size: .78rem; color: var(--ink-2); }
.sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; }
.sw.spent { background: var(--blue-2); }
.sw.mark { background: var(--green); height: 3px; vertical-align: 2px; }
.months-table { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.mt-row { display: grid; grid-template-columns: 56px 1fr 1fr 1fr; gap: 6px; padding: 10px 6px; text-align: right; font-size: .9rem; border-radius: 10px; width: 100%; }
.mt-row > :first-child { text-align: left; font-weight: 650; }
.mt-row + .mt-row { border-top: 1px solid var(--line); }
.mt-head { color: var(--ink-3); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.mt-row.cur { background: var(--blue-soft); }
button.mt-row:hover { background: #F4F6FA; }

/* Réglages */
.field-row { display: flex; align-items: center; gap: 10px; }
.big-input { flex: 1; font-size: 1.5rem; font-weight: 700; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.unit { font-weight: 700; color: var(--ink-2); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; margin: 14px 0 8px; }
.set-cat-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; }
.set-cat + .set-cat { border-top: 1px solid var(--line); }
.chev { color: var(--ink-3); font-size: 1.4rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row input[type="time"] { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: #D5DAE3; position: relative; transition: background .2s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.data-grid .btn { font-size: .86rem; padding: 12px 10px; }
.version { text-align: center; color: var(--ink-3); font-size: .78rem; }

/* ---------- Feuille modale ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root:empty { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(14, 25, 50, .35); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
#sheet-root.show { pointer-events: auto; }
#sheet-root.show .backdrop { opacity: 1; }
#sheet-root.show .sheet-panel { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; }
.sheet-title { text-align: center; font-size: 1.08rem; margin-bottom: 12px; }
.amount-box { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 4px 0 14px; }
.amount-box span { font-weight: 700; color: var(--ink-2); }
.amount-input { width: 100%; max-width: 260px; border: 0; text-align: right; font-size: 2.6rem; font-weight: 750; color: var(--blue); padding: 4px; letter-spacing: -.02em; background: transparent; }
.amount-input:focus { outline: none; }
.amount-box:focus-within { background: var(--blue-soft); border-radius: 16px; }
.err { color: var(--red); text-align: center; font-size: .88rem; margin-top: -8px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 14px; font-size: .7rem; font-weight: 600; color: var(--ink-2); line-height: 1.15; text-align: center; border: 2px solid transparent; }
.cat-pick span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-pick.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, white); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chips:empty { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; background: #F1F3F7; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--c); color: #fff; }
.field { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px; margin-top: 10px; background: #fff; min-width: 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-pair .btn { width: 100%; }
.check { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink-2); margin: 4px 0 6px; }
.icon-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.icon-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 1.15rem; }
.icon-grid button.on { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue-2); }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-row button { width: 30px; height: 30px; border-radius: 50%; }
.color-row button.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.sub-edit { display: flex; align-items: center; gap: 6px; }
.sub-edit .field { margin-top: 6px; }
.sub-edit .btn { margin-top: 6px; white-space: nowrap; }
.preview { background: #F7F9FC; border-radius: 14px; padding: 6px 12px; margin: 10px 0; }
.week-total { text-align: center; font-size: 2rem; font-weight: 750; color: var(--blue); margin: 4px 0; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 150px; margin: 16px 0 10px; }
.wb { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.wb i { width: 70%; min-height: 4px; border-radius: 8px 8px 4px 4px; background: #C9D6F2; }
.wb.on i { background: var(--blue-2); }
.wb.future { opacity: .4; }
.wb-val { font-size: .6rem; color: var(--ink-2); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 84px + var(--safe-b)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .92rem; font-weight: 550;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: #9CC0FF; font-weight: 700; }

/* ---------- Ordinateur ---------- */
@media (min-width: 900px) {
  .tabbar {
    top: 0; right: auto; width: 230px; height: auto; padding: 22px 14px;
    display: flex; flex-direction: column; gap: 4px; border-top: 0; border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--blue); padding: 4px 12px 22px; }
  .brand-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: .95rem; border-radius: 12px; }
  .tab.active { background: var(--blue-soft); }
  .content { margin-left: 230px; max-width: none; padding: 0 32px 120px; }
  .content > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .topbar { justify-content: flex-start; padding-left: 16px; }
  body[data-tab="home"] .view { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  body[data-tab="home"] .view > .hero, body[data-tab="home"] .view > .notice { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 1fr 2fr; }
  .filters input[type="search"] { grid-column: auto; }
  .fab { left: auto; right: 36px; bottom: 32px; transform: none; }
  .fab:active { transform: scale(.97); }
  #toast { bottom: 100px; }
  .sheet-panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 480px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; transition: transform .2s, opacity .2s; padding-bottom: 22px; }
  #sheet-root.show .sheet-panel { transform: translate(-50%, -50%); opacity: 1; }
  .grab { display: none; }
  .sheet-scroll { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
