/* DailyConnect — UI v2 : lavande, verre dépoli, pills, animations */
:root {
  --bg: #f4effc; --bg1: #f6f0ff; --bg2: #fdf0ea;
  --glass: rgba(255,255,255,.62); --glass-2: rgba(255,255,255,.86); --stroke: rgba(255,255,255,.85);
  --line: rgba(60,40,120,.08);
  --text: #16121f; --muted: #8b8698; --faint: #b9b3c7;
  --accent: #7b5cff; --accent-2: #a78bfa; --accent-soft: rgba(123,92,255,.12); --on-accent: #fff;
  --lime: #d4ec9a; --lime-text: #33410f;
  --good: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  --card: var(--glass-2);
  --shadow: 0 14px 34px -16px rgba(76,48,160,.30), 0 2px 6px -2px rgba(76,48,160,.08);
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px;
  --blob1: #c9b6ff; --blob2: #ffd3c2; --blob3: #f5c4ef;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0a18; --bg1: #120d20; --bg2: #170f1f;
    --glass: rgba(34,27,54,.55); --glass-2: rgba(40,32,64,.82); --stroke: rgba(255,255,255,.07);
    --line: rgba(255,255,255,.07);
    --text: #f4f1fb; --muted: #a29bb8; --faint: #6c6584;
    --accent: #9d85ff; --accent-2: #c4b5fd; --accent-soft: rgba(157,133,255,.16);
    --lime: #c3df7e; --lime-text: #20290a;
    --shadow: 0 18px 40px -18px rgba(0,0,0,.7);
    --blob1: #4b2fa8; --blob2: #6b2f4a; --blob3: #3b2370;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); background: var(--bg);
  font: 16px/1.45 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: linear-gradient(160deg, var(--bg1), var(--bg2)); background-attachment: fixed; }
.hidden { display: none !important; }
.ph, .ph-fill { line-height: 1; flex: none; }
.round i { font-size: 20px; }

/* --- fond animé --- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .75; }
.b1 { width: 420px; height: 420px; background: var(--blob1); top: -140px; right: -120px; animation: drift1 18s ease-in-out infinite alternate; }
.b2 { width: 360px; height: 360px; background: var(--blob2); top: -80px; left: -160px; animation: drift2 22s ease-in-out infinite alternate; }
.b3 { width: 380px; height: 380px; background: var(--blob3); bottom: -160px; left: 20%; animation: drift1 26s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(-60px, 80px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(70px, 50px) scale(.92); } }

/* --- structure --- */
#app { max-width: 760px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
header.top { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; transition: background .25s, box-shadow .25s; }
header.top.scrolled { background: color-mix(in srgb, var(--bg1) 72%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 var(--line); }
.hello { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #ffb59e, #b49bff); color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 16px -6px rgba(123,92,255,.6); }
.greet { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.hbtns { display: flex; gap: 8px; flex: none; }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid var(--stroke);
  background: var(--glass-2); color: var(--text); box-shadow: var(--shadow); text-decoration: none; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .2s var(--ease); }
.round:active { transform: scale(.9); }
.round.accent { background: linear-gradient(135deg, var(--accent), #9f7bff); color: #fff; border: 0;
  box-shadow: 0 10px 22px -8px rgba(123,92,255,.75); }
.round.accent i { font-size: 22px; }
.round.off { color: var(--muted); }
.round.spin i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hide-sm { display: grid; }
@media (max-width: 380px) { .hide-sm { display: none; } }

main { padding: 0 16px; }
.view { display: block; }
.hero { font-size: 34px; line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin: 8px 0 18px; }
.hero span { color: var(--faint); font-weight: 600; }
.sec { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.sec h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; font-weight: 700; }
.sec .link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; }

/* --- cartes verre --- */
.glass, .card { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-xl); box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }

/* progression */
.progress { display: flex; align-items: center; gap: 18px; padding: 20px; }
.progress .lbl { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.ring { position: relative; width: 128px; height: 128px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--accent-soft); }
.ring .val { stroke: url(#gradRing); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .pct { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.ring .pct small { font-size: 14px; font-weight: 700; color: var(--muted); }
.ring .glow { position: absolute; inset: 18px; border-radius: 50%; background: radial-gradient(circle, rgba(167,139,250,.35), transparent 70%); }
.pstats { flex: 1; display: grid; gap: 12px; border-left: 1px solid var(--line); padding-left: 18px; min-width: 0; }
.pstat { display: flex; align-items: center; gap: 10px; }
.pstat .pi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pstat .pi i { font-size: 17px; }
.pstat b { display: block; font-size: 17px; line-height: 1.1; }
.pstat span { font-size: 12px; color: var(--muted); }

/* chips */
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 18px -16px 0; padding: 4px 16px 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; border-radius: 99px;
  background: var(--glass-2); border: 1px solid var(--stroke); font: inherit; font-weight: 600; font-size: 15px; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); transition: transform .2s var(--ease), background .25s, color .25s; }
.chip .n { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--glass-2);
  border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: var(--lime); color: var(--lime-text); border-color: transparent; }
.chip.on .n { background: rgba(255,255,255,.75); border-color: transparent; color: var(--lime-text); }
.chip.dark.on { background: var(--text); color: var(--bg1); }
.chip.dark.on .n { background: rgba(255,255,255,.18); color: inherit; }
.chip.plain { padding: 10px 18px; }
.chip:active { transform: scale(.95); }

/* cartes de task */
.cards { display: grid; gap: 12px; }
.tcard { padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--glass-2); border: 1px solid var(--stroke);
  box-shadow: var(--shadow); transition: transform .25s var(--ease), opacity .3s; cursor: pointer; }
.tcard:active { transform: scale(.985); }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  background: var(--glass-2); border: 1px solid var(--line); white-space: nowrap; }
.tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tag.bad i { background: var(--bad); } .tag.warn i { background: var(--warn); } .tag.good i { background: var(--good); }
.tag.ai { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tc-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; margin: 8px 0 12px; overflow-wrap: anywhere; }
.tc-notes { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.tc-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.when { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.when i { font-size: 16px; }
.check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--faint); background: transparent; display: grid; place-items: center;
  color: transparent; cursor: pointer; padding: 0; flex: none; transition: all .25s var(--ease); }
.check i { font-size: 18px; }
.check.on { background: linear-gradient(135deg, var(--accent), #a083ff); border-color: transparent; color: #fff; }
.check.pop { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.tcard.done .tc-title { text-decoration: line-through; color: var(--muted); }
.tcard.done { opacity: .62; }
.tcard.leaving { animation: leave .45s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(40px) scale(.96); } }

/* timeline (onglet tasks) */
.tl { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: stretch; }
.tl .tm { text-align: right; padding-top: 16px; font-weight: 700; font-size: 15px; position: relative; }
.tl .tm small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.tl .tm::after { content: ""; position: absolute; right: -7px; top: 50px; bottom: -14px; width: 2px; background: var(--line); border-radius: 2px; }
.tl + .tl { margin-top: 12px; }
.group-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 22px 4px 10px; }

/* semaine */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 4px; }
.day { display: grid; justify-items: center; gap: 8px; padding: 10px 0 8px; border-radius: 99px; background: var(--glass); border: 1px solid var(--stroke);
  cursor: pointer; font: inherit; color: var(--text); transition: transform .2s var(--ease), background .25s; position: relative; }
.day .dn { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.day .dd { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--glass-2); }
.day .dot { position: absolute; top: 6px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.day.on { background: var(--text); }
.day.on .dn { color: var(--bg1); }
.day.on .dd { background: var(--bg1); color: var(--text); }
.day.today:not(.on) .dd { box-shadow: inset 0 0 0 2px var(--accent); }
.day:active { transform: scale(.94); }

/* habits */
.hcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--glass-2);
  border: 1px solid var(--stroke); box-shadow: var(--shadow); }
.hcard .grow { flex: 1; min-width: 0; }
.hcard .hn { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.hcard .hs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.hcard .hs i { font-size: 14px; color: #ff7a45; }
.wk { display: flex; gap: 5px; margin-top: 10px; }
.wk span { display: grid; justify-items: center; gap: 3px; font-size: 10px; color: var(--muted); font-weight: 600; }
.wk i { width: 22px; height: 8px; border-radius: 99px; background: var(--accent-soft); transition: background .3s; }
.wk i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hbtn { position: relative; width: 58px; height: 58px; border: 0; background: none; padding: 0; cursor: pointer; flex: none; color: var(--text); }
.hbtn svg.r { width: 100%; height: 100%; transform: rotate(-90deg); }
.hbtn .track { stroke: var(--accent-soft); }
.hbtn .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.hbtn .c { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.hbtn.ok .c { color: var(--accent); }
.hbtn:active { transform: scale(.92); }
.minus { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  display: grid; place-items: center; padding: 0; cursor: pointer; flex: none; }
.minus i { font-size: 15px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; }
.hscroll::-webkit-scrollbar { display: none; }
.hpill { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 99px; background: var(--glass-2);
  border: 1px solid var(--stroke); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); font-family: inherit; }
.hpill .hbtn { width: 40px; height: 40px; pointer-events: none; }
.hpill .hbtn .c { font-size: 11px; }

/* flouss */
.money-hero { padding: 22px; }
.money-hero .big { font-size: 44px; font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.money-hero .big small { font-size: 18px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.money-hero .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.donut { width: 132px; height: 132px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle.seg { transition: stroke-dasharray 1.1s var(--ease); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); }
.donut .center b { display: block; font-size: 18px; color: var(--text); }
.legend { flex: 1; display: grid; gap: 8px; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend .pc { color: var(--muted); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--stroke); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile.t1 { background: linear-gradient(150deg, #e9e3ff, #f6f2ff); }
.tile.t2 { background: linear-gradient(150deg, #e2e9ff, #f1f4ff); }
.tile.t3 { background: linear-gradient(150deg, #fbe3f6, #fdf1fa); }
@media (prefers-color-scheme: dark) {
  .tile.t1 { background: linear-gradient(150deg, #2c2152, #1f1838); }
  .tile.t2 { background: linear-gradient(150deg, #1f2850, #171b35); }
  .tile.t3 { background: linear-gradient(150deg, #47203f, #26162a); }
}
.tile .th { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.tile .th .ti { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.65); color: var(--accent); border: 1px solid var(--stroke); }
@media (prefers-color-scheme: dark) { .tile .th .ti { background: rgba(255,255,255,.08); } }
.tile .th .ti i { font-size: 17px; }
.tile .tv { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-top: 14px; font-variant-numeric: tabular-nums; }
.tile .ts { font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: var(--text); color: var(--bg1); white-space: nowrap; }
.badge.soft { background: var(--accent-soft); color: var(--accent); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #b45309; }
@media (prefers-color-scheme: dark) { .badge.warn { color: var(--warn); } }

.rows { border-radius: var(--r-lg); background: var(--glass-2); border: 1px solid var(--stroke); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.row:first-child { border-top: 0; }
.row:active { background: var(--accent-soft); }
.row .ri { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; font-size: 17px; }
.row .ri i { font-size: 18px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.row .s { color: var(--muted); font-size: 12.5px; }
.amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn-s { border: 0; border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--text); color: var(--bg1); transition: transform .2s var(--ease); }
.btn-s:active { transform: scale(.93); }
.empty { color: var(--muted); padding: 26px 16px; text-align: center; font-size: 14px; border-radius: var(--r-lg);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 25%, transparent); background: var(--glass); }
.empty b { display: block; font-size: 28px; margin-bottom: 4px; }

/* --- nav flottante --- */
nav.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 9;
  width: min(440px, calc(100% - 28px)); display: flex; gap: 4px; padding: 7px; border-radius: 99px;
  background: var(--glass-2); border: 1px solid var(--stroke); box-shadow: 0 20px 40px -14px rgba(60,30,140,.4);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
nav.dock .pill { position: absolute; top: 7px; bottom: 7px; left: 7px; border-radius: 99px; z-index: 0;
  background: linear-gradient(135deg, var(--accent), #a083ff); box-shadow: 0 8px 18px -8px rgba(123,92,255,.9);
  transition: transform .45s var(--ease), width .45s var(--ease); }
nav.dock button { position: relative; z-index: 1; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 0; background: none;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .3s; }
nav.dock button i { font-size: 22px; }
nav.dock button.on { color: #fff; }

/* --- toast + pull to refresh --- */
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 30; transform: translate(-50%, -140%);
  padding: 11px 18px; border-radius: 99px; background: var(--text); color: var(--bg1); font-size: 14px; font-weight: 600;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.35); transition: transform .45s var(--ease); max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--accent); transition: height .2s; }
.ptr i { font-size: 22px; transition: transform .1s; }

/* --- animations d'entrée --- */
.anim .a { opacity: 0; animation: up .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes up { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- feuilles (dialogs) --- */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; width: min(520px, 100vw); max-width: 100vw; max-height: 92vh;
  margin: auto auto 0; overflow: visible; }
@media (min-width: 700px) { dialog { margin: auto; } }
dialog::backdrop { background: rgba(20,10,40,.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog[open] .sheet { animation: sheetIn .45s var(--ease); }
dialog[open]::backdrop { animation: fade .3s ease; }
@keyframes sheetIn { from { transform: translateY(60px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--glass-2); border: 1px solid var(--stroke); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 40px -10px rgba(40,20,90,.35);
  backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%);
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; display: grid; gap: 14px; }
@media (min-width: 700px) { .sheet { border-radius: 30px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--faint); margin: 0 auto 2px; opacity: .6; }
.sheet .sh { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet .sh h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.sheet .sh .round { width: 40px; height: 40px; box-shadow: none; }
.sheet label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--glass-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 16px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1.5px solid var(--line); background: var(--glass-2); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all .2s var(--ease); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.big-btn { width: 100%; border: 0; border-radius: 99px; padding: 16px; font: inherit; font-weight: 700; font-size: 16px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #a083ff); box-shadow: 0 14px 28px -10px rgba(123,92,255,.8); transition: transform .2s var(--ease); }
.big-btn:active { transform: scale(.97); }
.del-btn { border: 0; background: none; color: var(--bad); font: inherit; font-weight: 700; cursor: pointer; padding: 6px; }
.qa { display: flex; gap: 8px; }
.qa input { border-radius: 99px; }
.qa .round { flex: none; width: 52px; height: 52px; }
.hint { color: var(--muted); font-size: 13px; }
.ex { display: flex; gap: 8px; flex-wrap: wrap; }
.qtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qtile { display: grid; justify-items: center; gap: 8px; padding: 14px 4px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass-2);
  font: inherit; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; transition: transform .2s var(--ease); }
.qtile .ti { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.qtile:active { transform: scale(.94); }

/* --- login --- */
.screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { padding: 28px; max-width: 400px; width: 100%; display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.login p { color: var(--muted); margin: 0; font-size: 14px; }
button.primary { border: 0; border-radius: 99px; padding: 14px; font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #a083ff); }

/* compat setup.html */
button.small { border: 0; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
code { font-size: 13px; background: var(--accent-soft); padding: 2px 7px; border-radius: 7px; }
h1 { letter-spacing: -.03em; }
h2 { letter-spacing: -.02em; }
.qtile .ti i { font-size: 21px; }
.cat-e { font-size: 19px; line-height: 1; }
.env { padding: 14px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.env:first-child { border-top: 0; }
.env .eh { display: flex; align-items: center; gap: 12px; }
.env .eh .grow { flex: 1; min-width: 0; }
.env .eh .t { font-weight: 600; }
.env .eh .s { color: var(--muted); font-size: 12.5px; }
.env .left { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.env .left small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.meter { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1s var(--ease), background .3s; }
.meter.warn > div { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.meter.bad > div { background: linear-gradient(90deg, #ef4444, #f87171); }
.left-hero { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.left-hero .lh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.left-hero .lh b { color: var(--text); font-size: 16px; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--glass-2);
  border: 1px solid var(--stroke); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }
.streak i { color: #ff7a45; font-size: 16px; }
.day-h { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 16px 6px; background: color-mix(in srgb, var(--accent) 4%, transparent); }
.fc { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.fc .dte { text-align: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); padding: 6px 0; font-weight: 800; font-size: 16px; line-height: 1.1; }
.fc .dte small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.pop { animation: pop .45s var(--ease); }

/* ===================== Blocs / colonnes ===================== */
.desk-only { display: none !important; }
.desk-quick, .dock-foot { display: none; }
.cols { display: flex; flex-direction: column; }
.col-main, .col-side { display: contents; }
.blk { order: var(--o, 0); }
.q3 { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.env .ri { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); flex: none; }
.day .dc { display: none; }
.check.sm { width: 28px; height: 28px; border-width: 2px; }
.check.sm i { font-size: 13px; }
kbd { font: inherit; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--glass-2); color: var(--muted); }

/* ===================== Version PC ===================== */
@media (min-width: 1000px) {
  .desk-only { display: revert !important; }
  .mob-only { display: none !important; }
  #app { max-width: none; padding: 0 0 48px 272px; }
  .ptr { display: none; }

  /* barre latérale */
  nav.dock { left: 20px; top: 20px; bottom: 20px; transform: none; width: 232px; flex-direction: column; gap: 4px;
    border-radius: 30px; padding: 22px 14px 16px; box-shadow: var(--shadow); }
  nav.dock .brand { font-size: 19px; font-weight: 800; letter-spacing: -.03em; padding: 4px 14px 22px; }
  nav.dock .brand span { color: var(--accent); }
  nav.dock .pill { top: 0; left: 14px; right: 14px; bottom: auto; width: auto !important;
    transition: transform .45s var(--ease), height .45s var(--ease); }
  nav.dock button { flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; font-size: 15px; border-radius: 99px; }
  nav.dock button:not(.on):hover { color: var(--text); background: var(--accent-soft); }
  nav.dock button i { font-size: 21px; }
  nav.dock .dock-foot { margin-top: auto; display: grid; gap: 12px; padding: 14px 10px 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.9; }
  nav.dock .dock-foot a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 8px; border-radius: 12px; }
  nav.dock .dock-foot a:hover { background: var(--accent-soft); }
  nav.dock .dock-foot a i { font-size: 18px; }

  /* barre du haut */
  header.top { padding: 22px 36px 16px; gap: 24px; }
  .desk-quick { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 560px; margin-left: auto; padding: 0 8px 0 18px; height: 50px;
    border-radius: 99px; background: var(--glass-2); border: 1px solid var(--stroke); box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
  .desk-quick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
  .desk-quick > i { font-size: 20px; color: var(--accent); }
  .desk-quick input { border: 0; background: none; box-shadow: none !important; padding: 0; height: 100%; font-size: 15px; border-radius: 0; }
  .desk-quick kbd { margin-right: 8px; }
  .hide-sm { display: grid !important; }
  #addBtn { display: none; }
  .round:hover { transform: translateY(-1px); }

  /* contenu */
  main { padding: 0 36px; max-width: 1280px; }
  .hero { font-size: 46px; margin: 10px 0 26px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 32px; align-items: start; }
  .col-main, .col-side { display: block; min-width: 0; }
  .col-side { position: sticky; top: 100px; }
  .col-side > .blk:first-child > .sec:first-child { margin-top: 0; }
  .col-main > .blk:first-child > .sec:first-child { margin-top: 0; }
  .chips { margin: 22px 0 0; padding: 4px 0 6px; flex-wrap: wrap; overflow: visible; }
  .cards.grid2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .tcard:hover, .hcard:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -18px rgba(76,48,160,.38); }
  .tcard, .hcard { transition: transform .25s var(--ease), box-shadow .25s; }
  .row:hover, .env:hover { background: var(--accent-soft); }
  .chip:hover { transform: translateY(-1px); }
  .progress { padding: 26px; gap: 28px; }
  .ring { width: 150px; height: 150px; }
  .ring .pct { font-size: 34px; }
  .money-hero .big { font-size: 56px; }

  /* semaine plus large */
  .week { gap: 12px; margin-bottom: 4px; }
  .day { border-radius: 22px; padding: 14px 0 12px; }
  .day .dd { width: 40px; height: 40px; font-size: 16px; }
  .day .dc { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
  .day.on .dc { color: var(--bg1); opacity: .7; }

  /* toast en bas à droite */
  .toast { left: auto; right: 28px; top: auto; bottom: 28px; transform: translateY(160%); }
  .toast.show { transform: translateY(0); }
}
@media (min-width: 1000px) and (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 24px; }
}

/* langue */
.lang-btn { width: auto; padding: 0 12px; gap: 5px; display: inline-flex; align-items: center; font: inherit; font-size: 12px; font-weight: 800; }
.lang-btn i { font-size: 17px !important; }
.langs { display: grid; gap: 10px; }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--glass-2); font: inherit; color: var(--text); cursor: pointer; text-align: left; transition: transform .2s var(--ease), border-color .2s; }
.lang-opt .lt { display: grid; gap: 2px; }
.lang-opt .lt b { font-size: 16px; }
.lang-opt .lt span { font-size: 13px; color: var(--muted); }
.lang-opt i { font-size: 22px; color: var(--accent); }
.lang-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.lang-opt:active { transform: scale(.98); }
.date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .lang-btn { padding: 0; width: 44px; justify-content: center; }
  .lang-btn i { display: none; }
  .greet { font-size: 16px; }
}

/* ===================== Business ===================== */
.mnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.mnav b { font-size: 17px; text-transform: capitalize; }
.mnav .round { width: 40px; height: 40px; }
.mnav .round[disabled] { opacity: .35; pointer-events: none; }
.bstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.bstats div { display: grid; gap: 3px; min-width: 0; }
.bstats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bstats b { font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bstats b.warnc { color: #d97706; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 18px; height: 140px; }
.bar-c { display: grid; grid-template-rows: 16px 1fr 18px; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--muted); }
.bar-c .bv { font-size: 10.5px; font-weight: 700; text-align: center; }
.bar-c .bt { display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; background: var(--accent-soft); overflow: hidden; }
.bar-c .bt i { display: block; width: 100%; border-radius: 10px; background: color-mix(in srgb, var(--accent) 45%, transparent); transition: height 1s var(--ease); }
.bar-c.on .bt i { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.bar-c.on { color: var(--text); }
.bar-c .bl { font-size: 11.5px; font-weight: 700; text-align: center; text-transform: capitalize; }
.jmeta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.jmeta i { font-size: 16px; }
.jamt { text-align: right; display: grid; }
.jamt b { font-size: 17px; font-variant-numeric: tabular-nums; }
.jamt small { font-size: 12px; color: var(--muted); font-weight: 600; }
.tag.good i { background: var(--good); }
.badge.soft { background: var(--accent-soft); color: var(--accent); }
.row .ri.av { color: #fff; font-weight: 800; font-size: 16px; }
.fxcard { padding: 16px 18px; display: grid; gap: 10px; }
.fxr { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.fxr span { color: var(--muted); font-weight: 600; }
.fxr b { font-size: 20px; font-variant-numeric: tabular-nums; }
.fxf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.btn-s.spin i { animation: spin .7s linear infinite; display: inline-block; }
@media (max-width: 999px) { nav.dock button { font-size: 10.5px; padding: 8px 2px; } nav.dock { width: min(470px, calc(100% - 20px)); } }

/* bilan */
.bal-lbl { margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.bal .big { margin-top: 2px; }
.posc { color: #16a34a; }
.negc { color: #dc2626; }
@media (prefers-color-scheme: dark) { .posc { color: #4ade80; } .negc { color: #f87171; } }
.bal .big.posc small, .bal .big.negc small { color: var(--muted); }
.bal-rows { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bal-rows div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.bal-rows span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.bal-rows span i { font-size: 16px; }
.bal-rows b { font-variant-numeric: tabular-nums; }
.bal .meter { margin-top: 14px; }
.bars-sm { height: 110px; }
.bar-c.neg .bt i { background: color-mix(in srgb, #ef4444 55%, transparent); }
.bar-c.neg.on .bt i { background: linear-gradient(180deg, #f87171, #dc2626); }
.bal-hint { margin-top: 12px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.bal-line { margin-top: 14px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); font-size: 13px; font-weight: 600; color: var(--text); }

/* ===================== Trésorerie ===================== */
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 18px; }
.acct { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 2px; align-items: center; text-align: left;
  padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass-2); font: inherit; color: var(--text); cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s; }
.acct:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.acct:active { transform: scale(.97); }
.acct .ai { grid-row: 1 / span 3; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.acct .ai.t-cash { background: #dcfce7; color: #15803d; }
.acct .ai.t-bank { background: #e0e7ff; color: #4338ca; }
.acct .ai.t-online { background: #dbeafe; color: #1d4ed8; }
@media (prefers-color-scheme: dark) {
  .acct .ai.t-cash { background: #14532d; color: #86efac; } .acct .ai.t-bank { background: #312e81; color: #c7d2fe; } .acct .ai.t-online { background: #1e3a8a; color: #bfdbfe; }
}
.acct .an { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct small { font-size: 11px; color: var(--muted); font-weight: 600; }
.acct.add { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border-style: dashed; color: var(--muted); min-height: 76px; }
.acct.add i { font-size: 20px; }
.tr-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-s.ghost { background: var(--accent-soft); color: var(--accent); }
.tile.wide { grid-column: 1 / -1; }
.tile .ts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-new { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px 16px; border-radius: 18px; border: 1.5px solid #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, var(--glass-2)); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; }
.card-new i:first-child { font-size: 20px; color: #d97706; }
.card-new span { flex: 1; }

/* espacement entre les blocs (cartes collées) */
.cols { gap: 16px; }
.blk:empty { display: none; }
@media (min-width: 1000px) {
  .col-main > .blk + .blk, .col-side > .blk + .blk { margin-top: 18px; }
}
.blk > .sec:first-child { margin-top: 10px; }
.blk > .card-new:first-child { margin-top: 0; }
.tiles + .rows, .rows + .rows, .glass + .glass { margin-top: 14px; }

/* ===================== En-tête mobile + menu animé ===================== */
.menu-btn, .qmenu { display: none; }
@media (max-width: 999px) {
  header.top { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "av . btns" "txt txt txt"; row-gap: 12px; align-items: center; }
  .hello { display: contents; }
  .hello .avatar { grid-area: av; }
  .hello .htxt { grid-area: txt; min-width: 0; }
  .hbtns { grid-area: btns; }
  .greet { font-size: 24px; font-weight: 800; letter-spacing: -.03em; white-space: normal; }
  .date { font-size: 14px; margin-top: 2px; }
  #langBtn, #refreshBtn, #setupBtn, #bellBtn { display: none !important; }
  .menu-btn { display: grid; }
  .menu-btn i { font-size: 22px; transition: transform .45s var(--ease); }
  body.qm-open .menu-btn i { transform: rotate(135deg); }

  .qmenu { display: block; position: fixed; inset: 0; z-index: 40; pointer-events: none; }
  .qmenu::before { content: ""; position: absolute; inset: 0; background: rgba(20,10,40,.28); opacity: 0;
    backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: opacity .35s ease, backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease; }
  body.qm-open .qmenu { pointer-events: auto; }
  body.qm-open .qmenu::before { opacity: 1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .qm-panel { position: absolute; right: 16px; top: 120px; display: grid; gap: 10px; justify-items: end; }
  .qm-close { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
    background: var(--text); color: var(--bg1); font-size: 22px; opacity: 0; transform: rotate(-90deg) scale(.6); transition: opacity .25s ease, transform .45s var(--ease); }
  body.qm-open .qm-close { opacity: 1; transform: none; }
  .qm-item { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border: 0; border-radius: 99px; background: var(--glass-2);
    border: 1px solid var(--stroke); box-shadow: 0 14px 30px -12px rgba(40,20,90,.45); color: var(--text); font: inherit; text-align: right; cursor: pointer;
    opacity: 0; transform: translateY(-14px) scale(.85); transform-origin: right top;
    transition: opacity .3s ease, transform .45s var(--ease); transition-delay: calc((4 - var(--i)) * 25ms); }
  body.qm-open .qm-item { opacity: 1; transform: none; transition-delay: calc(var(--i) * 55ms + 60ms); }
  .qm-item .qt { display: grid; line-height: 1.2; }
  .qm-item .qt b { font-size: 15px; }
  .qm-item .qt small { font-size: 12px; color: var(--muted); font-weight: 600; }
  .qm-item .qi { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; flex: none;
    background: var(--accent-soft); color: var(--accent); }
  .qm-item .qi.off { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
  .qm-item:active { transform: scale(.96); }
}

/* ===================== Mode discret : montants floutés ===================== */
/* Caché : trésorerie, bilan du mois, mouvements, tout l'onglet Business. Visible : les dépenses (ce mois, catégories, budgets, historique). */
:is(.trc, .bal, .tile[data-act], .jamt, .money-hero, .bstats, .bal-line, .amount) { --pv: 0; }
body.privacy :is(
  .trc .big, .trc .accts b, .trc .accts small,
  .bal .big, .bal .sub, .bal-rows b, .bal .bars, .bal .meter, .bal .lh,
  .tile[data-act] .tv, .tile[data-act] .ts,
  .row[data-act="tr-del-move"] .amount, .jamt) {
  filter: blur(10px); user-select: none; -webkit-user-select: none;
}
body.privacy[data-tab="biz"] :is(.money-hero .big, .money-hero .sub, .bstats b, .bal-line, .bars .bv, .amount, .row .s) {
  filter: blur(10px); user-select: none; -webkit-user-select: none;
}
:is(.big, .sub, .accts b, .accts small, .bal-rows b, .bars, .meter, .lh, .tv, .ts, .amount, .jamt, .bstats b, .bal-line) { transition: filter .35s ease; }
.eye-btn i { font-size: 21px; }
body.privacy .eye-btn { color: var(--muted); }
body:not(.privacy) .eye-btn { background: var(--accent); color: #fff; border-color: transparent; }
.eye-btn.wink i { animation: wink .35s ease; }
@keyframes wink { 50% { transform: scaleY(.1); } }
@media (max-width: 999px) { .eye-btn { display: grid !important; } }

/* ===================== Œil à côté du montant ===================== */
#eyeBtn { display: none !important; }
.big-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big-row .big { margin-top: 0 !important; min-width: 0; }
.bal .big-row { margin-top: 2px; }
.eye-in { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--accent-soft); color: var(--accent); font-size: 21px; transition: transform .2s var(--ease), background .25s, color .25s; }
body:not(.privacy) .eye-in { background: var(--accent); color: #fff; border-color: transparent; }
.eye-in:active { transform: scale(.9); }
.eye-in.wink i { animation: wink .35s ease; }
.tile .th .eye-in { width: 34px; height: 34px; font-size: 17px; }

/* ===================== Tailles mobile : rien ne dépasse du cadre ===================== */
html, body { overflow-x: hidden; }
.glass, .card, .rows, .tcard, .hcard, .tile, .acct, .blk, .cols, .col-main, .col-side { min-width: 0; max-width: 100%; }
.legend { grid-template-columns: minmax(0, 1fr); }
.legend div { min-width: 0; }
.big { overflow-wrap: anywhere; }
@media (max-width: 999px) {
  main { padding: 0 14px; }
  .chips, .hscroll { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .hero { font-size: clamp(26px, 8vw, 34px); }
  .money-hero { padding: 18px; }
  .money-hero .big { font-size: clamp(32px, 11vw, 44px); }
  .progress { padding: 16px; gap: 14px; }
  .ring { width: clamp(96px, 28vw, 128px); height: clamp(96px, 28vw, 128px); }
  .ring .pct { font-size: 24px; }
  .pstats { padding-left: 14px; }
  .accts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .acct { padding: 10px; column-gap: 8px; }
  .acct .ai { width: 34px; height: 34px; font-size: 16px; }
  .acct b { font-size: clamp(13px, 3.9vw, 16px); overflow: hidden; text-overflow: ellipsis; }
  .donut-wrap { gap: 12px; }
  .donut { width: clamp(92px, 27vw, 132px); height: clamp(92px, 27vw, 132px); }
  .legend div { padding: 7px 8px; font-size: 12.5px; gap: 6px; }
  .bstats { gap: 6px; }
  .bstats b { font-size: clamp(12px, 3.6vw, 15px); }
  .bstats span { font-size: 11px; }
  .bars { gap: 5px; }
  .bar-c .bv { font-size: 9.5px; white-space: nowrap; }
  .bar-c .bl { font-size: 10.5px; }
  .row { padding: 12px 12px; gap: 10px; }
  .row .ri { width: 36px; height: 36px; }
  .amount { font-size: 14.5px; }
  .fc { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
  .fc .btn-s { padding: 7px 10px; font-size: 12px; }
  .sec h2 { font-size: 18px; min-width: 0; }
  .sec { gap: 8px; }
  .btn-s { white-space: nowrap; }
  .tl { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .tl .tm { font-size: 13px; }
  .week { gap: 5px; }
  .day .dd { width: 30px; height: 30px; font-size: 13px; }
  .day .dn { font-size: 11px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile .tv { font-size: clamp(18px, 5.6vw, 24px); }
  .jamt b { font-size: 15px; }
  .env .left { font-size: 13px; }
  .fxf { flex-wrap: wrap; }
  .qtile { padding: 12px 2px; font-size: 11.5px; }
  .sheet { padding-left: 16px; padding-right: 16px; }
}

/* ===================== Mode discret v2 : étoiles à la place des montants (pas de flou, pas de rouge/vert) ===================== */
body.privacy :is(
  .trc .big, .trc .accts b, .trc .accts small,
  .bal .big, .bal-rows b,
  .tile[data-act] .tv, .tile[data-act] .ts,
  .row[data-act="tr-del-move"] .amount, .jamt),
body.privacy[data-tab="biz"] :is(.money-hero .big, .bstats b, .amount) {
  filter: none !important; visibility: hidden; position: relative; user-select: none; -webkit-user-select: none;
}
body.privacy :is(
  .trc .big, .trc .accts b,
  .bal .big, .bal-rows b,
  .tile[data-act] .tv,
  .row[data-act="tr-del-move"] .amount, .jamt)::after,
body.privacy[data-tab="biz"] :is(.money-hero .big, .bstats b, .amount)::after {
  content: "∗∗∗∗"; visibility: visible; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 700; letter-spacing: .12em; white-space: nowrap; line-height: 1;
}
body.privacy :is(.bal-rows b, .amount, .jamt)::after { left: auto !important; right: 0; }
body.privacy :is(.trc .big, .bal .big)::after, body.privacy[data-tab="biz"] .money-hero .big::after { color: var(--text); opacity: .55; }
/* tout ce qui trahit le signe ou le montant : caché sans étoiles */
body.privacy :is(.bal .sub, .bal .bars, .bal .meter, .bal .lh),
body.privacy[data-tab="biz"] :is(.money-hero .sub, .bal-line, .bars, .row .s) { filter: none !important; visibility: hidden; }
body.privacy .bal :is(.bars, .meter, .lh, .bal-hint) { display: none; }
body.privacy[data-tab="biz"] .money-hero .bars { display: none; }

/* Arabic: right-to-left page, system Arabic font (Plus Jakarta Sans has no Arabic glyphs) */
html[dir="rtl"] body { font-family: 'Segoe UI', 'Geeza Pro', 'Noto Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif; }

/* indicateur Apple Pay */
.ap-chip { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--glass-2); color: var(--text); font: inherit; text-align: left; font-size: 13px; }
.ap-chip > i:first-child { font-size: 20px; flex: none; }
.ap-chip span { display: grid; gap: 1px; flex: 1; min-width: 0; line-height: 1.25; }
.ap-chip b { font-size: 13px; }
.ap-chip small { font-size: 12px; color: var(--muted); font-weight: 600; }
button.ap-chip { cursor: pointer; }
.ap-chip.warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, var(--glass-2)); }
.ap-chip.warn > i:first-child { color: #d97706; }
.ap-chip.bad { border-color: #ef4444; background: color-mix(in srgb, #ef4444 10%, var(--glass-2)); }
.ap-chip.bad > i:first-child { color: #dc2626; }
.ap-chip.ok > i:first-child { color: #16a34a; }
.ap-chip.ok { padding: 9px 14px; }

/* ===================== Créances & dettes ===================== */
.dbt-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; margin-bottom: 10px; }
.dbt-sum > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dbt-sum span { font-size: 12px; color: var(--muted); font-weight: 600; }
.dbt-sum b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dbt-sum small { font-size: 11px; color: var(--muted); }
.dbt .amount { text-align: right; white-space: nowrap; }
.dbt .amount small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.dbt.done { opacity: .55; }
.dbt .meter { margin-top: 6px; height: 6px; }
.dbt-edit { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; font-size: 16px; }
.dbt-more { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dbt-hist { margin: 4px 0 10px; }
.dbt-p { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dbt-p span { flex: 1; color: var(--muted); }
.dbt-p .link { background: none; border: 0; color: var(--muted); cursor: pointer; }
/* mode discret : étoiles à la place des montants */
body.privacy :is(.dbt-tot, .dbt .amount) { visibility: hidden; position: relative; user-select: none; -webkit-user-select: none; }
body.privacy :is(.dbt-tot, .dbt .amount)::after { content: "∗∗∗∗"; visibility: visible; position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
body.privacy .dbt .amount::after { left: auto; right: 0; }
body.privacy .dbt .meter { display: none; }

/* Saisie rapide (Back Tap) : gros choix du type d'abord */
.qtiles.qpick { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qtiles.qpick .qtile { padding: 18px 4px; font-size: 13px; font-weight: 700; }
.qtiles.qpick .qtile .ti { width: 50px; height: 50px; border-radius: 16px; }
.qtiles.qpick .qtile .ti i { font-size: 25px; }

/* Démo publique : bandeau + bouton de remise à zéro */
#demoBar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; margin: 0 0 10px; border-radius: 16px;
  background: linear-gradient(90deg, #f59e0b22, #7b5cff22); border: 1px solid var(--line); font-size: 13px; font-weight: 600; text-align: center; }
#demoBar button { border: 0; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; background: var(--accent); color: #fff; white-space: nowrap; }
#demoBar button:active { transform: scale(.95); }
body.is-demo #bellBtn, body.is-demo #setupBtn { display: none; }

/* Écran du code de sécurité */
.login input { width: 100%; box-sizing: border-box; }
.login-err { min-height: 18px; color: #dc2626 !important; font-weight: 600; }
@media (prefers-color-scheme: dark) { .login-err { color: #f87171 !important; } }
