:root {
  --bg: #f5f5f0;
  --surface: #fff;
  --surface-2: #f0f1ec;
  --ink: #1b211e;
  --muted: #646c66;
  --faint: #8b928c;
  --line: #e4e6e0;
  --green: #2f7a59;
  --green-ink: #235c43;
  --green-soft: #e6f1ea;
  --red: #b2463a;
  --red-soft: #fbeceb;
  --amber: #946013;
  --amber-soft: #fcf1df;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 8px 24px rgba(20, 30, 25, .05);
  --nav-h: 68px;
  --display: Manrope, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* ── Estructura ── */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 240px; display: flex; flex-direction: column; gap: 28px; padding: 28px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); text-decoration: none; font: 800 24px/1 var(--display); letter-spacing: -1px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: #fff; font-size: 20px; }
.brand b { color: var(--green); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav-item .ic { width: 22px; height: 22px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--green-soft); color: var(--green-ink); }
.main { margin-left: 240px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 40px 16px; background: rgba(245, 245, 240, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.page-title { margin: 0; font: 800 28px/1.2 var(--display); letter-spacing: -.8px; }
.sync-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.sync-chip .ic { width: 18px; height: 18px; }
.sync-chip.on, .sync-chip.saving { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.sync-chip.error { background: var(--red-soft); border-color: transparent; color: var(--red); }
#view { max-width: 880px; display: flex; flex-direction: column; gap: 16px; padding: 4px 40px 48px; }

/* ── Tarjetas ── */
.card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card h2 { margin: 0; font: 700 18px/1.3 var(--display); letter-spacing: -.3px; }
.card.danger h2 { color: var(--red); }
.card > .muted + .btn-row, .card > .muted + .rates { margin-top: 14px; }
.label { margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; }
.muted { margin: 0; color: var(--muted); }
.small { font-size: 14px; }
.link { color: var(--green); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ── Saldo total ── */
.hero-amount { margin: 4px 0 2px; font: 800 40px/1.1 var(--display); letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.wallet-list { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--line); }
.wallet { width: 100%; display: grid; grid-template-columns: 42px 1fr auto 20px; align-items: center; gap: 12px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.wallet:last-child { border-bottom: 0; }
.wallet-name { font-weight: 600; }
.wallet-name small { display: block; color: var(--faint); font-size: 13px; font-weight: 500; }
.wallet-amount { font: 700 17px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet .wallet-edit { width: 18px; height: 18px; color: var(--faint); }
.wallet:hover .wallet-edit { color: var(--green); }
.avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--c, var(--green)); background: var(--surface-2); background: color-mix(in srgb, var(--c, #2f7a59) 13%, white); font: 800 17px var(--display); }

/* ── Acciones rápidas ── */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; font-weight: 700; transition: transform .1s; }
.quick-btn .ic { width: 26px; height: 26px; }
.quick-btn.in .ic { color: var(--green); }
.quick-btn.out .ic { color: var(--red); }
.quick-btn:active { transform: scale(.97); }

/* ── Resúmenes ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stat { min-width: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
#view > .stats .stat { background: var(--surface); border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 18px var(--display); font-variant-numeric: tabular-nums; }
.stat.wide { background: var(--surface); border: 1px solid var(--line); }

/* ── Filas ── */
.rows { display: flex; flex-direction: column; }
.row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.rows > .row:last-child { border-bottom: 0; }
.row-main { min-width: 0; }
.row-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.amount { text-align: right; white-space: nowrap; font: 700 16px var(--display); font-variant-numeric: tabular-nums; }
.amount small { display: block; color: var(--muted); font: 500 13px 'DM Sans', sans-serif; }
.row-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.date-badge { width: 48px; padding: 6px 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); text-align: center; }
.date-badge b { display: block; color: var(--ink); font: 800 18px/1.1 var(--display); }
.date-badge small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.row.late .date-badge { background: var(--amber-soft); color: var(--amber); }
.row.late .row-main small { color: var(--amber); }
.move-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.move-ic.in { background: var(--green-soft); color: var(--green); }
.move-ic.out { background: var(--red-soft); color: var(--red); }
.group + .group { margin-top: 8px; }
.group-date { margin: 0 0 2px; color: var(--faint); font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; vertical-align: 2px; }

/* ── Botones ── */
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); font-size: 15px; font-weight: 700; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-ghost { background: none; border-color: var(--red-soft); color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 700; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-sm.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-sm.ghost { color: var(--muted); }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-actions.end { justify-content: flex-end; }
.page-actions .stat { flex: 1; }

/* ── Movimientos ── */
.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.month-switch span { font: 700 17px var(--display); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Gráfico ── */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 10px; margin-top: 16px; }
.bar-col { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track { width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(100%, 40px); display: block; border-radius: 8px 8px 4px 4px; background: #9cc6ae; }
.bar-col:first-child .bar { background: var(--green); }
.bar-val { color: var(--muted); font: 700 12px var(--display); white-space: nowrap; }
.bar-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: capitalize; }

/* ── Vacíos ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 8px; color: var(--muted); text-align: center; }
.empty p { max-width: 340px; margin: 0; }

/* ── Hoja de formulario ── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(18, 26, 22, .45); }
.sheet { width: min(100%, 480px); max-height: min(92vh, 780px); overflow: auto; padding: 20px 20px 24px; background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font: 800 22px var(--display); letter-spacing: -.5px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { color: var(--muted); font-size: 14px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; outline: none; }
.field input:focus, .field select:focus, .money-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.money-input { display: flex; align-items: center; padding-left: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.money-input > span { color: var(--muted); font: 700 18px var(--display); }
.field .money-input input { min-height: 54px; border: 0; box-shadow: none; font: 700 20px var(--display); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 11px 6px; border-radius: 9px; color: var(--muted); font-weight: 700; text-align: center; cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--green); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-weight: 600; }
.switch input { width: 24px; height: 24px; accent-color: var(--green); }
.preview { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green-ink); font-size: 15px; font-weight: 600; }
.preview:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form .form-actions .btn { flex: 1; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rates .form-actions { grid-column: 1 / -1; }

/* ── Cobros por mes ── */
.ink { color: var(--ink); }
.hero-actions { margin-top: 16px; }
.hero-actions .btn { flex: 1; }
.btn.block { width: 100%; }
.btn.big { min-height: 58px; font-size: 17px; }
.field-hint { color: var(--faint); font-size: 13px; font-weight: 500; }
.field-hint:empty { display: none; }
.progress { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.progress-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.progress-legend b { color: var(--ink); font-family: var(--display); }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row.late .row-main small { color: var(--amber); }
.link.more { display: inline-block; margin-top: 8px; }
.bill-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.amount.big { font-size: 21px; }
.bill-lines { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.bill-lines div { display: flex; justify-content: space-between; gap: 12px; }
.bill-lines span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paid { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green-ink); font-size: 15px; }
.paid > span { flex: 1; }
.client-head { justify-content: flex-start; }
.client-head .row-main { flex: 1; }
.client-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; text-align: left; }
.client-toggle .row-main b { font-size: 17px; }
.client-toggle .toggle-ic { width: 22px; height: 22px; color: var(--faint); transform: rotate(180deg); transition: transform .15s; }
.account.collapsed .toggle-ic { transform: none; }
.account.collapsed .card-head { margin-bottom: 0; }
.row.compact { grid-template-columns: minmax(0, 1fr) auto; }
.btn-sm.add { margin-top: 10px; }

/* ── Previsión ── */
.forecast { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fc-box { min-width: 0; }
.fc-box .hero-amount { font-size: 34px; overflow-wrap: anywhere; }
.fc-box.future { padding-left: 14px; border-left: 1px solid var(--line); }
.fc-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 10px; color: var(--muted); font-size: 15px; font-weight: 600; }
.fc-controls input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; font-weight: 600; }
.fc-detail { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.fc-detail .fc-more { width: 22px; height: 22px; flex: none; }
.group .rows .amount small { font-size: 12px; }
#sheetBody .group .row-main small { white-space: normal; }
.fc-breakdown { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 4px; color: var(--muted); font-size: 14px; }
.fc-breakdown b { color: var(--ink); font-family: var(--display); }
@media (max-width: 420px) { .fc-box .hero-amount { font-size: 26px; } }

/* ── Productos y anotaciones ── */
a.btn { text-decoration: none; }
.prod-list { display: flex; flex-direction: column; }
.prod-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.prod-item:last-child { border-bottom: 0; }
.prod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.units-toggle { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.units-toggle .toggle-ic { width: 18px; height: 18px; transition: transform .15s; }
.units-toggle.open .toggle-ic { transform: rotate(180deg); }
.units { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.unit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; font-size: 15px; }
.unit span { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.unit b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.unit small { color: var(--muted); font-size: 13px; }
.unit.empty b { color: var(--green); font-weight: 600; }
.unit.more { display: block; color: var(--green); font-weight: 600; text-align: center; background: none; }
.prod-row.paused { opacity: .6; }
.prod-main { min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.prod-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.prod-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.prod-main small.prod-notes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 2px; color: var(--faint); white-space: pre-line; }
.field textarea { width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; outline: none; }
.field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field .grid2 input, .field .grid2 select { min-height: 50px; }
.counter { display: flex; align-items: center; gap: 6px; }
.counter .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
.counter .icon-btn:disabled { opacity: .35; cursor: default; }
.counter .icon-btn.add { background: var(--green); border-color: var(--green); color: #fff; }
.counter .icon-btn.add:active { transform: scale(.94); }
.count { min-width: 32px; text-align: center; font: 800 20px var(--display); font-variant-numeric: tabular-nums; }
.btn-row.tight { gap: 8px; margin-top: 12px; }
.account-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; }
.account-total small { display: block; color: var(--faint); font-size: 13px; font-weight: 500; }
.account-total b { font: 800 22px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Plan de retiros ── */
.segmented.four span { padding: 11px 4px; font-size: 14px; line-height: 1.2; }
.table { display: flex; flex-direction: column; margin-top: 14px; font-size: 14px; }
.table-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table-row span:not(:first-child) { text-align: right; white-space: nowrap; }
.table-head { color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.table-row.hit span:last-child { color: var(--green); font-weight: 700; }
.sub { margin: 20px 0 4px; font: 700 16px var(--display); }
.compare-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: 0; }
.compare-row small { display: block; color: var(--muted); font-size: 13px; }
.compare-row.current b { color: var(--green-ink); }
#planResult { margin-top: 16px; }

/* ── Aviso ── */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Móvil ── */
@media (max-width: 899px) {
  .sidebar { inset: auto 0 0 0; width: auto; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); flex-direction: row; padding: 6px 6px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); }
  .sidebar .brand { display: none; }
  .nav { width: 100%; flex-direction: row; gap: 2px; }
  .nav-item { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 2px; border-radius: 12px; font-size: 12px; }
  .nav-item .ic { width: 26px; height: 26px; }
  .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { margin-left: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
  .topbar { padding: max(14px, env(safe-area-inset-top)) 16px 12px; }
  .page-title { font-size: 26px; }
  #view { gap: 14px; padding: 4px 16px 24px; }
  .card { padding: 16px; }
  .hero-amount { font-size: 36px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:nth-child(3):last-child { grid-column: 1 / -1; }
  .page-actions { flex-direction: column; align-items: stretch; }
  .rates { grid-template-columns: 1fr; }
  .sheet-backdrop { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  .toast { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
}
@media (max-width: 380px) {
  .sync-chip span { display: none; }
  .stat b { font-size: 16px; }
  .quick-btn { font-size: 14px; }
}
