/* Base layout & components. Colors, fonts and tokens: numexia.css */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plane); color: var(--ink-1); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.emoji { margin-right: 6px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Shell ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 18px; }
.splash .logo { width: 64px; height: 64px; font-size: 32px; border-radius: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 16px; }
.brand > div { display: flex; flex-direction: column; }
.sidebar { display: none; }
.main { padding: 0 16px calc(96px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; position: sticky; top: 0; z-index: 5; background: var(--plane); }
.topbar .logo { width: 30px; height: 30px; font-size: 16px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-decoration: none; color: var(--ink-3); padding: 4px 0; }
.tabbar a.on { color: var(--accent); font-weight: 600; }
.fab {
  justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--plane);
  background: var(--accent); color: var(--accent-ink); font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(74, 58, 167, .35);
}
.sync { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-good); }
.sync-busy .dot { background: var(--accent); animation: pulse 1s infinite; }
.sync-off .dot { background: var(--ink-3); }
.sync-err .dot { background: var(--st-critical); }
@keyframes pulse { 50% { opacity: .3; } }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
  .sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--border); background: var(--surface); }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
  .sidebar nav a:hover { background: var(--surface-2); }
  .sidebar nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .side-foot { margin-top: auto; }
  .tabbar, .topbar { display: none; }
  .main { padding: 28px 32px 48px; width: 100%; }
}

/* ---------- Views & cards ---------- */
.view { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 2px; }
.view-head.sub { margin-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.hero { display: flex; flex-direction: column; gap: 8px; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.hero-num { font-size: 44px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.hero.is-neg .hero-num { color: var(--neg); }
.hero-sub { color: var(--ink-2); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.hero-meta strong { color: var(--ink-1); font-weight: 600; }

.banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; width: 100%; text-align: left; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--accent-soft); color: var(--ink-1); }
.banner span:nth-child(2) { flex: 1; }

/* ---------- Buttons & inputs ---------- */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-1); border-radius: 12px; padding: 10px 16px; font-weight: 600; min-height: 44px; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--neg); }
.btn.armed, .icon-btn.armed { background: var(--st-critical); color: #fff; border-color: transparent; }
.btn:disabled { opacity: .6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.icon-btn { border: 1px solid transparent; background: transparent; border-radius: 10px; min-width: 36px; height: 36px; padding: 0 8px; color: var(--ink-2); font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.danger { color: var(--ink-3); }
.input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-height: 44px; font-size: 16px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
select.input { appearance: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.form, .addform { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr; } }
.emoji-row { grid-template-columns: 80px 1fr; }
.emoji-input { text-align: center; font-size: 20px; }
.form-error { color: var(--neg); font-weight: 600; font-size: 14px; }
.switch { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 7px 12px; font-size: 14px; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.ghost { background: transparent; border-style: dashed; }
.chip.tag { font-size: 13px; }
.chip .muted { font-size: 12px; }
.chip.on .muted { color: inherit; opacity: .8; }
.tag-input { width: 130px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.input.date { width: auto; min-height: 36px; padding: 5px 10px; font-size: 14px; border-radius: 999px; }
.input.search { margin-bottom: 4px; }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; border: 1px solid var(--border); }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-weight: 600; color: var(--ink-2); min-height: 38px; }
.seg button.on { background: var(--surface); color: var(--ink-1); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small button { min-height: 32px; padding: 4px 8px; font-size: 13px; }

/* ---------- Sheets & toasts ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.sheet-body { overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b)); overscroll-behavior: contain; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } .sheet-actions .btn { flex: 0 0 auto; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink-1); color: var(--plane); padding: 12px 16px; border-radius: 12px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: up .2s; }
.toast-critical { background: var(--st-critical); color: #fff; }
.toast-warning { background: var(--st-warning); color: #0b0b0b; }

/* ---------- Add form ---------- */
.amount-wrap { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 6px 0; }
.amount-input { border: 0; background: transparent; font-size: 52px; font-weight: 750; letter-spacing: -0.03em; text-align: right; width: 5.2ch; min-width: 2ch; padding: 0; }
.amount-input:focus { outline: none; }
.amount-cur { font-size: 32px; font-weight: 600; color: var(--ink-3); }
.amount-wrap.income .amount-input { color: var(--pos); }
.favs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.favs::-webkit-scrollbar { display: none; }
.more { display: flex; flex-direction: column; gap: 12px; }
.picker { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.picker-cat-name { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.grp { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 8px; border: 1px solid var(--border); color: var(--ink-2); }
.grp-besoins { border-color: var(--g-besoins); }
.grp-envies { border-color: var(--g-envies); }
.grp-epargne { border-color: var(--g-epargne); }

/* ---------- Status ---------- */
.chip-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip-status span { font-size: 9px; }
.status-critical span:first-child, .status-critical > span[aria-hidden] { color: var(--st-critical); }
.chip-status.status-critical { background: color-mix(in srgb, var(--st-critical) 14%, transparent); }
.chip-status.status-serious { background: color-mix(in srgb, var(--st-serious) 18%, transparent); }
.chip-status.status-serious span { color: var(--st-serious); }
.chip-status.status-warning { background: color-mix(in srgb, var(--st-warning) 20%, transparent); }
.chip-status.status-warning span { color: #b27700; }
.chip-status.status-good { background: color-mix(in srgb, var(--st-good) 14%, transparent); }
.chip-status.status-good span { color: var(--st-good); }
.status { font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--ink-2); }
.status-critical [aria-hidden] { color: var(--st-critical); }
.status-warning [aria-hidden] { color: #b27700; }
.legend-status { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-3); justify-content: center; }
.legend-status .status-critical span { color: var(--st-critical); }
.legend-status .status-serious span { color: var(--st-serious); }
.legend-status .status-warning span { color: var(--st-warning); }
.legend-status .status-good span { color: var(--st-good); }

/* ---------- Bars & progress ---------- */
.track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: visible; }
.track.small { height: 8px; border-radius: 4px; }
.track .fill { height: 100%; border-radius: 4px; max-width: 100%; transition: width .3s; }
.track .target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-1); border-radius: 1px; }
.track .pace-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); box-shadow: 0 0 0 1px var(--ink-3); }
.split { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.split-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.split-label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.split-val { font-weight: 600; white-space: nowrap; }
.split-val.is-bad { color: var(--neg); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-line { height: 3px; width: 14px; vertical-align: 3px; }
.sw-actual { background: var(--accent); }
.sw-ideal { background: var(--ink-3); }
.sw-ideal.dashed { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 7px); height: 3px; width: 16px; vertical-align: 3px; }
.why { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

.hbars { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 6px 4px; border-radius: 8px; }
.hbar.is-click:hover { background: var(--surface-2); }
.hbar-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { font-weight: 600; white-space: nowrap; }
.hbar-track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 4px; }
.hbar-fill { display: block; height: 100%; border-radius: 4px; }
.subrows { list-style: none; margin: 4px 0 8px; padding: 0 4px 0 28px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.subrows.big { padding: 0; font-size: 15px; gap: 10px; }
.subrows li { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; touch-action: pan-y; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.line-ideal { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 5 5; }
.line-actual { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dot-actual { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.dot-ideal { fill: var(--ink-3); stroke: var(--surface); stroke-width: 2; }
.crosshair { stroke: var(--ink-3); stroke-width: 1; }
.income-tick { stroke: var(--ink-1); stroke-width: 2.5; stroke-linecap: round; }
.ybar .hit { fill: transparent; }
.ybar:hover .hit { fill: var(--surface-2); }
.ybar.is-current text { font-weight: 700; fill: var(--ink-1); }
.tooltip { position: absolute; top: 6px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); border-radius: 10px; padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 150px; z-index: 3; display: flex; flex-direction: column; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* ---------- Home lists ---------- */
.watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.watch-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-weight: 500; }
.watch-val { font-weight: 600; white-space: nowrap; }
.watch-note { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rec { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--ink-3); }
.rec-critical { border-left-color: var(--st-critical); }
.rec-serious { border-left-color: var(--st-serious); }
.rec-warning { border-left-color: var(--st-warning); }
.rec-good { border-left-color: var(--st-good); }
.rec-icon { font-size: 20px; line-height: 1.2; }
.rec-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.rec-body p { color: var(--ink-2); font-size: 14px; }
.rec-body .link { align-self: flex-start; }
.good-list { margin-top: 12px; }
.good-list summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upcoming li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; font-weight: 500; }
.up-day { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; }
.steps li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.steps li.done > span { background: var(--st-good); color: #fff; }
.steps li.done strong { text-decoration: line-through; color: var(--ink-3); }
.steps p { color: var(--ink-3); font-size: 13px; }

/* ---------- Month ---------- */
.month-strip { display: flex; align-items: center; gap: 4px; }
.month-strip .year { font-size: 15px; min-width: 42px; text-align: center; }
.months { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; margin-left: 6px; scrollbar-width: none; flex: 1; }
.months::-webkit-scrollbar { display: none; }
.mchip { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; position: relative; }
.mchip.has { color: var(--ink-1); }
.mchip.has::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.mchip.now { border-color: var(--accent); }
.mchip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mchip.on::after { background: var(--accent-ink); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi > span:first-child { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi strong { font-size: 22px; letter-spacing: -0.02em; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ink-2); }
.delta.down { color: var(--ink-2); }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 700px) { .filters { grid-template-columns: 2fr 1fr; } }
.day-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px 6px; }
.txs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.txs li + li { border-top: 1px solid var(--border); }
.tx { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 12px; min-height: 56px; }
.tx:hover { background: var(--surface-2); }
.tx-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-size: 18px; }
.tx-main { display: flex; flex-direction: column; min-width: 0; }
.tx-main strong, .tx-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tx-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.verdict { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.verdict-text { font-size: 18px; font-weight: 600; margin-top: 6px; }
.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { font-weight: 700; border-bottom: 0; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 16px; color: var(--ink-2); }
.empty-icon { font-size: 36px; }
.empty p { color: var(--ink-3); max-width: 340px; }
.empty .btn { margin-top: 10px; }

/* ---------- Goals ---------- */
.goal-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .goal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .goal-grid { grid-template-columns: repeat(3, 1fr); } }
.goal { display: flex; flex-direction: column; gap: 10px; }
.goal-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.goal-head > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.goal-emoji { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); font-size: 22px; }
.goal-amt { display: flex; align-items: baseline; gap: 2px; }
.goal-amt strong { font-size: 24px; letter-spacing: -0.02em; }
.goal-pct { margin-left: auto; font-weight: 700; color: var(--ink-2); }
.goal-facts { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.goal .btn { align-self: flex-start; }

/* ---------- Settings ---------- */
.toc { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 4px; border-radius: 10px; font-weight: 600; }
.row.static { grid-template-columns: 1fr auto; }
.row:hover { background: var(--surface-2); }
.row.is-off { opacity: .5; }
.row-main { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.rows.compact .row { padding: 4px; }
.cats { display: flex; flex-direction: column; gap: 6px; }
.cat { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: var(--surface); padding: 10px 12px; text-align: left; min-height: 48px; }
.cat-head strong { flex: 1; }
.cat.open .cat-head { background: var(--surface-2); }
.cat-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.subs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sub { display: grid; grid-template-columns: 1fr 40px 110px 40px; gap: 6px; align-items: center; }
.sub .input { min-height: 40px; padding: 6px 10px; font-size: 15px; }
.eye { opacity: .35; filter: grayscale(1); }
.eye.on { opacity: 1; filter: none; background: var(--accent-soft); }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.install { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.auth-card .link { align-self: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .track .fill, .hbar-fill { forced-color-adjust: none; } }
.small-date { white-space: pre-line; font-size: 11px; line-height: 1.05; text-align: center; width: 38px; height: 38px; }
.upcoming li { grid-template-columns: 40px 1fr auto; }
.up-name { min-width: 0; }
.row-amt { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; white-space: nowrap; }
.row { grid-template-columns: 40px 1fr auto; }
.notice { background: color-mix(in srgb, var(--st-warning) 16%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.notif-device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.notif-device > div:first-child { display: flex; flex-direction: column; }
.btn-row.tight { margin: 0; flex-wrap: nowrap; }
.toggles { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.toggle > span { display: flex; flex-direction: column; }

/* Réglages › Notifications (v26: quand / quoi / combien / résumés / aperçu) */
.notif-card .nsec { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; }
.notif-card .nsec summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: 8px 0; }
.notif-card .nsec summary::-webkit-details-marker { display: none; }
.notif-card .nsec summary h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.notif-card .nsec summary::after { content: '▸'; color: var(--ink-3); transition: transform .2s; margin-left: 8px; }
.notif-card .nsec[open] summary::after { transform: rotate(90deg); }
.nsec-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 10px; }
.nsec-body > p { margin: 0; }
.nwhen { display: flex; flex-direction: column; gap: 10px; }
.nslot { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.nslot-label { flex: 1; min-width: 0; font-weight: 500; }
.nslot .switch { flex: none; }
.input.hour { width: auto; min-height: 38px; padding: 6px 10px; font-size: 15px; flex: none; }
.nquiet-range { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.nopt { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.nopt-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.nopt-row { display: flex; gap: 12px; align-items: flex-start; }
.nopt-row > .nopt { flex: 1 1 0; min-width: 0; }
.nopt-input { display: flex; align-items: center; gap: 6px; }
.nopt-input .input { width: 76px; min-height: 38px; padding: 6px 8px; font-size: 15px; text-align: right; }
.ndays .chip { min-height: 34px; padding: 5px 10px; font-size: 13px; text-transform: capitalize; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.nchecks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ntypes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ntype { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.ntype.off { opacity: .75; }
.ntype-head { display: flex; gap: 10px; align-items: flex-start; }
.ntype-head .switch { flex: none; margin-top: 2px; }
.ntype-title { display: flex; flex-direction: column; min-width: 0; }
.ntype-opts { display: flex; flex-direction: column; gap: 10px; }
.ntype-opts .seg button { padding: 4px 4px; font-size: 12px; }
.nsum { display: flex; flex-direction: column; gap: 10px; padding-left: 4px; }
.npreview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.npreview li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.np-when { flex: none; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 3px 8px; white-space: nowrap; margin-top: 1px; }
.np-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.np-title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.np-title strong { font-size: 14px; overflow-wrap: anywhere; }
.np-body { overflow-wrap: anywhere; white-space: pre-line; }
.np-app { font-size: 12px; color: var(--ink-3); font-style: italic; }
.npreview li.app-only .np-when { opacity: .6; }
