/* Caisse familiale — warm, light, mobile-first. System fonts only (nothing to download on slow networks). */
:root {
  --bg: #faf6f0; --card: #fff; --ink: #24201b; --muted: #6b6259; --faint: #9a9087; --line: #ece3d7; --line2: #f3ede5;
  --pri: #0e6b58; --pri-2: #0a5747; --pri-soft: #e2f1ec; --pri-ink: #fff;
  --acc: #c8691c; --acc-soft: #fcefe0;
  --ok: #1d7a4c; --ok-soft: #e1f3e8; --warn: #9a5a00; --warn-soft: #fff1d4; --bad: #b2372d; --bad-soft: #fbe5e2; --info-soft: #eaf1fb; --info: #2a5ea8;
  --r: 16px; --r-sm: 11px; --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -14px rgba(60, 40, 20, .22);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pri); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13.5px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .row.top { align-items: flex-start; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; } .stack-s > * + * { margin-top: 8px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.app { min-height: 100vh; display: flex; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.top { position: sticky; top: 0; z-index: 20; background: rgba(250, 246, 240, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 58px; }
.top .brand { font-weight: 750; font-size: 17px; display: flex; align-items: center; gap: 9px; min-width: 0; }
.top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .back { width: 40px; height: 40px; margin-left: -8px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.top .back:active { background: var(--line2); }
.logo { width: 30px; height: 30px; border-radius: 9px; flex: none; background: var(--pri); display: grid; place-items: center; }
.logo svg { width: 18px; height: 18px; }
.lang { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 650; cursor: pointer; min-height: 36px; }
.view { padding: 16px; max-width: 1120px; margin: 0 auto; }
.offline { background: var(--warn-soft); color: var(--warn); font-size: 13.5px; padding: 8px 16px; text-align: center; border-bottom: 1px solid #f3dfb2; }

.bnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: var(--safe-b); box-shadow: 0 -6px 20px -16px rgba(60, 40, 20, .35); }
.bnav a { height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11.5px; font-weight: 600; position: relative; }
.bnav a svg { width: 24px; height: 24px; }
.bnav a.on { color: var(--pri); }
.bnav a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--pri); }
.bnav .dot, .side .dot { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: #fff; font-size: 10.5px; display: grid; place-items: center; }

@media (min-width: 960px) {
  .side { display: flex; flex-direction: column; width: 248px; flex: none; position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; padding: 4px 8px 18px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 15px; position: relative; }
  .side nav a svg { width: 21px; height: 21px; }
  .side nav a:hover { background: var(--line2); color: var(--ink); }
  .side nav a.on { background: var(--pri-soft); color: var(--pri-2); }
  .side .dot { position: static; margin-left: auto; }
  .side .sep { height: 1px; background: var(--line); margin: 10px 6px; }
  .side .who { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
  .bnav { display: none; }
  .main { padding-bottom: 32px; }
  .top { padding: 12px 28px; background: rgba(250, 246, 240, .9); }
  .top .brand.m { display: none; }
  .view { padding: 24px 28px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .grid2 > * + * { margin-top: 0 !important; }
  .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .col-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .col-main > .stack { margin-top: 0 !important; }
}
@media (min-width: 640px) and (max-width: 959px) { .grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { flex: 1; font-size: 16.5px; }
.card-h a, .link { font-size: 14px; font-weight: 650; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h1 { flex: 1; min-width: 0; }
.hello { margin: 2px 0 14px; }
.hello h1 { font-size: 25px; }

.hero { background: linear-gradient(150deg, #0e6b58 0%, #0b5a4a 62%, #0a4f42 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 209, 140, .28), transparent); }
.hero .lbl { font-size: 13.5px; opacity: .85; font-weight: 600; }
.hero .big { font-size: 34px; font-weight: 780; letter-spacing: -.02em; margin: 2px 0 10px; }
.hero .sub { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .pill { background: rgba(255, 255, 255, .13); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; flex: 1; min-width: 130px; }
.hero .pill b { display: block; font-size: 16px; margin-top: 1px; }
.hero .chk { margin-top: 12px; font-size: 13.5px; opacity: .92; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--ink); min-height: 78px; justify-content: center; box-shadow: var(--shadow); text-align: center; line-height: 1.2; }
.qa .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.qa .ic svg { width: 20px; height: 20px; }
.ic.iin { background: var(--ok-soft); color: var(--ok); } .ic.out { background: var(--acc-soft); color: var(--acc); } .ic.chk { background: var(--info-soft); color: var(--info); }

/* ---------- lists ---------- */
.list { margin: 0 -16px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line2); color: var(--ink); min-height: 60px; }
.li:first-child { border-top: 0; }
a.li:active, button.li:active { background: var(--line2); }
button.li { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.li .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 13px; color: var(--muted); }
.li .amt { font-weight: 700; text-align: right; }
.li.void { opacity: .55; } .li.void .amt { text-decoration: line-through; }
.chev { color: var(--faint); flex: none; width: 18px; height: 18px; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 14.5px; }

.av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.av.av-s { width: 30px; height: 30px; font-size: 12px; }
.av.av-l { width: 56px; height: 56px; font-size: 20px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--line2); color: var(--muted); }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); } .chip.pri { background: var(--pri-soft); color: var(--pri-2); } .chip.acc { background: var(--acc-soft); color: var(--acc); }

.bar { height: 9px; border-radius: 9px; background: var(--line2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 9px; background: var(--pri); min-width: 3px; }
.bar.warn > i { background: #d69a2a; } .bar.done > i { background: var(--ok); }
.env { padding: 13px 0; border-top: 1px solid var(--line2); }
.env:first-child { border-top: 0; padding-top: 2px; }
.env .row { margin-bottom: 7px; }
.env .nm { font-weight: 650; flex: 1; min-width: 0; }
.env .pc { font-weight: 750; font-size: 14.5px; }
.env-card .big { font-size: 22px; font-weight: 760; margin: 8px 0 2px; }
.env-card .bar { margin: 10px 0 10px; height: 11px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }

.banner { display: flex; gap: 12px; align-items: center; border-radius: 14px; padding: 13px 14px; font-size: 14.5px; font-weight: 550; }
.banner svg { width: 22px; height: 22px; flex: none; }
.banner.warn { background: var(--warn-soft); color: #6e4100; border: 1px solid #f2dcae; }
.banner.bad { background: var(--bad-soft); color: #7c241c; border: 1px solid #f2c9c3; }
.banner.info { background: var(--info-soft); color: #1f4a86; border: 1px solid #cfdcf1; }
.banner.ok { background: var(--ok-soft); color: #155c39; border: 1px solid #c4e5d1; }
.banner a { font-weight: 700; margin-left: auto; white-space: nowrap; }

.confirm-card { border-left: 4px solid var(--acc); }
.confirm-card .amt { font-size: 22px; font-weight: 760; margin: 4px 0; }

/* ---------- forms ---------- */
.field { display: block; }
.field > span { display: block; font-size: 13.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.in, select.in, textarea.in { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
select.in { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6259' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.in { min-height: 110px; resize: vertical; line-height: 1.45; }
.in:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
.in.money { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.form { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 1em; }
.seg { display: flex; background: var(--line2); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button, .seg a { flex: 1; border: 0; background: none; border-radius: 10px; padding: 9px 6px; font-weight: 650; font-size: 14px; color: var(--muted); cursor: pointer; text-align: center; min-height: 42px; white-space: nowrap; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(60, 40, 20, .14); }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 650; font-size: 14px; color: var(--muted); min-height: 42px; display: flex; align-items: center; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; }
.chips span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.chips input:checked + span { border-color: var(--pri); background: var(--pri-soft); color: var(--pri-2); }
.chips input:focus-visible + span { box-shadow: 0 0 0 3px var(--pri-soft); }
.switch { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line2); cursor: pointer; }
.switch:first-child { border-top: 0; }
.switch .txt { flex: 1; } .switch .txt b { display: block; font-weight: 650; } .switch .txt small { color: var(--muted); font-size: 13px; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 30px; background: #d9d1c6; position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::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, .25); transition: transform .15s; }
.switch input:checked { background: var(--pri); } .switch input:checked::after { transform: translateX(20px); }
.split-row { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; padding: 6px 0; }
.split-row .in { min-height: 44px; padding: 9px 12px; }
.preview { background: var(--pri-soft); color: var(--pri-2); border-radius: 12px; padding: 10px 14px; font-weight: 650; }
.photo { display: flex; gap: 12px; align-items: center; }
.photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.receipt-img { max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--pri); color: #fff; text-align: center; }
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.sec { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost { background: none; color: var(--pri); padding: 0 10px; }
.btn.bad { background: var(--bad); } .btn.ok { background: var(--ok); }
.btn.soft { background: var(--pri-soft); color: var(--pri-2); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns .btn { flex: 1; }
.sticky-save { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 5; }
@media (min-width: 960px) { .sticky-save { bottom: 16px; } }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 58px; height: 58px; border-radius: 50%; background: var(--acc); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(200, 105, 28, .7); border: 0; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 960px) { .fab { display: none; } }
.only-desk { display: none; } @media (min-width: 960px) { .only-desk { display: inline-flex; } }

.month-nav { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.month-nav a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.month-nav a:active { background: var(--line2); }
.month-nav b { min-width: 118px; text-align: center; font-size: 14.5px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 600; } .stat .v { font-size: 19px; font-weight: 760; margin-top: 2px; }
.stat.in .v { color: var(--ok); } .stat.out .v { color: var(--acc); }
@media (min-width: 960px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 650; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line2); }
table.t td.num, table.t th.num { text-align: right; padding-right: 0; }
table.t tr:last-child td { border-bottom: 0; }

.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.steps div { flex: 1; min-width: 74px; text-align: center; font-size: 12px; font-weight: 650; color: var(--faint); }
.steps div i { display: block; height: 6px; border-radius: 6px; background: var(--line); margin-bottom: 6px; }
.steps .done { color: var(--pri-2); } .steps .done i { background: var(--pri); }
.steps .cur { color: var(--ink); } .steps .cur i { background: var(--acc); }
.decisions { margin: 0; padding-left: 22px; } .decisions li { padding: 5px 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment { background: var(--line2); border-radius: 14px; padding: 10px 13px; }
.comment .by { font-size: 12.5px; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.hist { font-size: 13px; border-left: 2px solid var(--line); padding: 2px 0 8px 12px; margin-left: 4px; }
.hist b { font-weight: 650; }
.diff { color: var(--muted); }
.diff del { color: var(--bad); } .diff ins { color: var(--ok); text-decoration: none; }
details.more > summary { cursor: pointer; font-weight: 650; color: var(--muted); font-size: 14px; padding: 6px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
.file { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); }
.file:first-child { border-top: 0; }
.file .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--info-soft); color: var(--info); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.share-box { width: 100%; min-height: 220px; font: 14px/1.45 ui-monospace, Menlo, monospace; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 28px 18px 24px; background: radial-gradient(1200px 500px at 50% -180px, #f6e3c8 0%, transparent 70%), var(--bg); }
.login .box { width: 100%; max-width: 440px; }
.login .head { text-align: center; margin: 10px 0 22px; }
.login .head .logo { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 14px; }
.login .head .logo svg { width: 32px; height: 32px; }
.login .head h1 { font-size: 25px; }
.login .head p { margin: 6px 0 0; color: var(--muted); }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 64px; border-radius: 15px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 650; font-size: 15.5px; text-align: left; box-shadow: var(--shadow); }
.person:active { border-color: var(--pri); }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinwrap { text-align: center; }
.pinwrap .who { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px; }
.dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c9bfb2; }
.dots i.f { background: var(--pri); border-color: var(--pri); }
.dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 18px auto 0; }
.pad button { height: 66px; border-radius: 18px; border: 0; background: #fff; font-size: 26px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; border: 1px solid var(--line); }
.pad button:active { background: var(--pri-soft); }
.pad button.fn { background: none; box-shadow: none; border: 0; font-size: 15px; color: var(--muted); font-weight: 650; }
.pad button svg { width: 26px; height: 26px; }

/* ---------- sheet / toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(36, 28, 20, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); max-height: 90vh; overflow: auto; animation: up .2s; }
@media (min-width: 640px) { .scrim { align-items: center; } .sheet { border-radius: 22px; } }
.sheet h2 { margin-bottom: 10px; }
.bigpin { font-size: 44px; font-weight: 800; letter-spacing: .25em; text-align: center; background: var(--pri-soft); color: var(--pri-2); border-radius: 16px; padding: 14px; margin: 14px 0; font-variant-numeric: tabular-nums; }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(30px); opacity: .4; } }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }
.loading { padding: 40px; text-align: center; color: var(--faint); }

/* ---------- print (month report → PDF) ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .side, .bnav, .top, .fab, .no-print, .offline { display: none !important; }
  .main { padding: 0; } .view { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  a { color: inherit; }
}
.print-only { display: none; }

/* "Comment c'est calculé" */
details.how { margin-top: 10px; font-size: 13px; }
details.how > summary { cursor: pointer; list-style: none; color: var(--pri); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; }
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary::before { content: "ⓘ"; font-weight: 700; }
details.how .how-l { background: var(--pri-soft); color: var(--pri-2); border-radius: 10px; padding: 8px 11px; margin-top: 6px; white-space: normal; line-height: 1.5; }
details.how.light > summary { color: #ffe1b5; }
details.how.light .how-l { background: rgba(255, 255, 255, .14); color: #fff; }
.hist.flag { border-left-color: #e0a537; background: #fff8ea; border-radius: 0 10px 10px 0; padding-top: 6px; }
.sheet p { white-space: pre-line; }
@media (min-width: 960px) { .only-mob { display: none; } }

.main-env { background: linear-gradient(160deg, #fffaf2, #fff 60%); border-color: #f0d9b8; }
.alloc-prev .chip { margin-right: 8px; }

.actions.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 400px) { .actions.four { grid-template-columns: repeat(2, 1fr); } }
.qitem { padding: 12px 0; border-top: 1px solid var(--line2); } .qitem:first-of-type { border-top: 0; padding-top: 0; }
.pchip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 650; font-size: 14px; cursor: pointer; }
.pchip.top { border-color: var(--pri); background: var(--pri-soft); color: var(--pri-2); }
.pchip small { font-weight: 600; opacity: .75; font-size: 11.5px; }
.pchip:not(:has(.av)) { padding-left: 12px; }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > div { position: absolute; right: 0; top: 44px; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; }
details.menu > div button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 12px; border-radius: 9px; font-weight: 600; cursor: pointer; }
details.menu > div button:hover { background: var(--line2); }
/* overflow guards: date/month inputs have a large intrinsic width on mobile Chrome */
.field, .two > *, .split-row > * { min-width: 0; }
.in { min-width: 0; max-width: 100%; }
input[type=date].in, input[type=month].in { width: 100%; display: block; }
.btns .btn { flex: 1 1 auto; }
table.t td.num, table.t th.num { padding-left: 12px; }
@media (max-width: 520px) { table.t { font-size: 13px; } table.t td { padding-top: 8px; padding-bottom: 8px; } }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.right > div { margin-top: 4px; }
@media (max-width: 959px) { .col-main { display: flex; flex-direction: column; gap: 14px; } .col-main > .stack + .stack { margin-top: 0; } .first-mobile { order: -1; } }
