/* CLEAR Finanças — Material Design 3, fonte Google Sans Flex, claro e escuro.
   Layout: uma coluna (até 600px) com barra superior, conteúdo rolável, barra de navegação e FAB. */

:root {
  color-scheme: light;
  /* cor: esquema M3 azul (tons do Google Material 3) */
  --primary: #0b57d0;
  --on-primary: #ffffff;
  --primary-container: #d3e3fd;
  --on-primary-container: #041e49;
  --secondary-container: #c2e7ff;
  --on-secondary-container: #001d35;
  --tertiary: #146c2e;
  --tertiary-container: #c4eed0;
  --on-tertiary-container: #072711;
  --error: #b3261e;
  --on-error: #ffffff;
  --error-container: #f9dedc;
  --on-error-container: #410e0b;
  --warning: #8a5300;
  --warning-container: #ffdeae;
  --on-warning-container: #2c1700;
  --spend-container: #ffdbcf;
  --on-spend-container: #380d00;
  --bg: #f0f4f9;
  --surface: #ffffff;
  --surface-low: #f8fafd;
  --surface-high: #e9eef6;
  --surface-highest: #dde3ea;
  --on-surface: #1f1f1f;
  --on-surface-variant: #444746;
  --outline: #747775;
  --outline-variant: #c4c7c5;
  --inverse-surface: #303030;
  --inverse-on-surface: #f2f2f2;
  --inverse-primary: #a8c7fa;
  --scrim: rgba(0, 0, 0, 0.32);
  --nav-bg: #f0f4f9;
  --bar-scrolled: #e9eef6;
  --sheet-bg: #f8fafd;
  --dialog-bg: #f8fafd;
  /* texto com significado */
  --income-text: #146c2e;
  --negative-text: #b3261e;
  /* marcas dos gráficos (paleta categórica validada) */
  --income: #1baf7a;
  --expense: #eb6834;
  --c-blue: #2a78d6; --c-orange: #eb6834; --c-aqua: #1baf7a; --c-yellow: #eda100;
  --c-magenta: #e87ba4; --c-green: #008300; --c-violet: #6250d6; --c-red: #e34948; --c-gray: #898781;
  /* elevação */
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --elev-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --elev-3: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15);
  /* tipo */
  --font: "Google Sans Flex", "Google Sans", Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  /* forma */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-li: 20px; --r-xl: 28px; --r-full: 999px;
  /* medidas */
  --top-h: 64px;
  --nav-h: 80px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --maxw: 600px;
  --rail-w: 0px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #a8c7fa; --on-primary: #062e6f; --primary-container: #0842a0; --on-primary-container: #d3e3fd;
    --secondary-container: #004a77; --on-secondary-container: #c2e7ff;
    --tertiary: #6dd58c; --tertiary-container: #0f5223; --on-tertiary-container: #c4eed0;
    --error: #f2b8b5; --on-error: #601410; --error-container: #8c1d18; --on-error-container: #f9dedc;
    --warning: #ffb95c; --warning-container: #5f3700; --on-warning-container: #ffdeae;
    --spend-container: #6e2a10; --on-spend-container: #ffdbcf;
    --bg: #131314; --surface: #1e1f20; --surface-low: #1b1b1b; --surface-high: #282a2c; --surface-highest: #333537;
    --on-surface: #e3e3e3; --on-surface-variant: #c4c7c5; --outline: #8e918f; --outline-variant: #444746;
    --inverse-surface: #e3e3e3; --inverse-on-surface: #303030; --inverse-primary: #0b57d0;
    --scrim: rgba(0, 0, 0, 0.5);
    --nav-bg: #1e1f20; --bar-scrolled: #1e1f20; --sheet-bg: #1e1f20; --dialog-bg: #282a2c;
    --income-text: #6dd58c; --negative-text: #f2b8b5;
    --income: #199e70; --expense: #d95926;
    --c-blue: #3987e5; --c-orange: #d95926; --c-aqua: #199e70; --c-yellow: #c98500;
    --c-magenta: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767; --c-gray: #898781;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #a8c7fa; --on-primary: #062e6f; --primary-container: #0842a0; --on-primary-container: #d3e3fd;
  --secondary-container: #004a77; --on-secondary-container: #c2e7ff;
  --tertiary: #6dd58c; --tertiary-container: #0f5223; --on-tertiary-container: #c4eed0;
  --error: #f2b8b5; --on-error: #601410; --error-container: #8c1d18; --on-error-container: #f9dedc;
  --warning: #ffb95c; --warning-container: #5f3700; --on-warning-container: #ffdeae;
  --spend-container: #6e2a10; --on-spend-container: #ffdbcf;
  --bg: #131314; --surface: #1e1f20; --surface-low: #1b1b1b; --surface-high: #282a2c; --surface-highest: #333537;
  --on-surface: #e3e3e3; --on-surface-variant: #c4c7c5; --outline: #8e918f; --outline-variant: #444746;
  --inverse-surface: #e3e3e3; --inverse-on-surface: #303030; --inverse-primary: #0b57d0;
  --scrim: rgba(0, 0, 0, 0.5);
  --nav-bg: #1e1f20; --bar-scrolled: #1e1f20; --sheet-bg: #1e1f20; --dialog-bg: #282a2c;
  --income-text: #6dd58c; --negative-text: #f2b8b5;
  --income: #199e70; --expense: #d95926;
  --c-blue: #3987e5; --c-orange: #d95926; --c-aqua: #199e70; --c-yellow: #c98500;
  --c-magenta: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767; --c-gray: #898781;
}

/* ─── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--on-surface);
  font: 400 16px/24px var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.38; }
a { color: var(--primary); }
h1, h2, h3 { font-weight: 400; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.ic { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--on-surface-variant); }
.faint { color: var(--outline); }
.tc { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-income { color: var(--income-text); }
.t-expense { color: var(--negative-text); }
.t-warn { color: var(--warning); }
.t-primary { color: var(--primary); }

/* tipografia M3 */
.display-s { font-size: 36px; line-height: 44px; font-weight: 400; letter-spacing: -0.25px; }
.headline-s { font-size: 24px; line-height: 32px; font-weight: 400; }
.title-l { font-size: 22px; line-height: 28px; font-weight: 400; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.1px; }
.title-s { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.body-l { font-size: 16px; line-height: 24px; }
.body-m { font-size: 14px; line-height: 20px; }
.body-s { font-size: 12px; line-height: 16px; letter-spacing: 0.2px; }
.label-l { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.label-m { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; }

/* camada de estado (hover/pressionado) dos elementos tocáveis */
.btn, .chip, .li[data-act], button.li, label.li, .pick, .tf.select, .segmented button, .fab, .fab-menu-item, .fab-close,
.month-btn, .lg-row, .mini-card, button.card, .icon-btn, .nav-item .ind, .menu-item, .month-grid button, .toast button { position: relative; }
.btn::after, .chip::after, .li[data-act]::after, button.li::after, label.li::after, .pick::after, .tf.select::after,
.segmented button::after, .fab::after, .fab-menu-item::after, .fab-close::after, .month-btn::after, .lg-row::after,
.mini-card::after, button.card::after, .icon-btn::after, .nav-item .ind::after, .menu-item::after, .month-grid button::after, .toast button::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0;
  transition: opacity 0.15s; pointer-events: none;
}
.icon-btn::after { inset: 4px; border-radius: 50%; }
@media (hover: hover) {
  .btn:hover::after, .chip:hover::after, .li[data-act]:hover::after, button.li:hover::after, label.li:hover::after, .pick:hover::after,
  .tf.select:hover::after, .segmented button:hover::after, .fab:hover::after, .fab-menu-item:hover::after, .fab-close:hover::after,
  .month-btn:hover::after, .lg-row:hover::after, .mini-card:hover::after, button.card:hover::after, .icon-btn:hover::after,
  .nav-item:hover .ind::after, .menu-item:hover::after, .month-grid button:hover::after, .toast button:hover::after { opacity: 0.08; }
}
.btn:active::after, .chip:active::after, .li[data-act]:active::after, button.li:active::after, label.li:active::after, .pick:active::after,
.tf.select:active::after, .segmented button:active::after, .fab:active::after, .fab-menu-item:active::after, .fab-close:active::after,
.month-btn:active::after, .lg-row:active::after, .lg-row.hl::after, .mini-card:active::after, button.card:active::after, .icon-btn:active::after,
.nav-item:active .ind::after, .menu-item:active::after, .month-grid button:active::after, .toast button:active::after { opacity: 0.12; }

/* ─── esqueleto ────────────────────────────────────────────────────────── */
#app {
  position: fixed; inset: 0;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#topbar { flex: none; padding-top: var(--safe-t); background: var(--bg); z-index: 5; transition: background-color 0.2s; }
#topbar.scrolled { background: var(--bar-scrolled); }
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 0; padding: 0 4px 0 16px; }
.topbar-title { flex: 1; min-width: 0; margin: 0; font-size: 22px; line-height: 28px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { font-weight: 700; color: var(--primary); letter-spacing: 0.6px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; color: var(--on-surface-variant);
}
.icon-btn.sm { width: 40px; height: 40px; }
.icon-btn.sm::after { inset: 0; }
.icon-btn.tonal, .icon-btn.filled { width: 40px; height: 40px; margin: 4px; }
.icon-btn.tonal::after, .icon-btn.filled::after { inset: 0; }
.icon-btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.icon-btn.filled { background: var(--primary); color: var(--on-primary); }
.icon-btn.warn { color: var(--warning); }
.icon-btn.err { color: var(--error); }
.icon-btn.prim { color: var(--primary); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 96px);
  scroll-padding-bottom: 140px;
}
.page { display: flex; flex-direction: column; gap: 12px; }
.page > .intro { margin: 0 4px; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }

/* barra de navegação inferior */
#nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none; }
#nav > * { pointer-events: auto; }
.bottom-nav {
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--nav-bg);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  padding-top: 12px; color: var(--on-surface-variant);
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px;
}
.nav-item .ind { width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background-color 0.2s; }
.nav-item.on { color: var(--on-surface); font-weight: 700; }
.nav-item.on .ind { background: var(--secondary-container); color: var(--on-secondary-container); }

/* FAB */
.fab {
  position: absolute; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 56px; height: 56px; border-radius: var(--r-lg);
  background: var(--primary-container); color: var(--on-primary-container);
  display: grid; place-items: center; box-shadow: var(--elev-3);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
}
body.has-toast .fab { transform: translateY(-72px); }

/* ─── cabeçalhos de seção e navegação de mês ───────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin: 8px 4px -4px; }
.section-head h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.1px; }
.section-head .aside { font-size: 14px; color: var(--on-surface-variant); }
.subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 16px 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--on-surface-variant); letter-spacing: 0.1px; }
.subhead:first-child { margin-top: 4px; }
.subhead .num { font-weight: 500; }
.h1 { font-size: 24px; line-height: 32px; margin: 4px 4px 0; }
.sub { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); margin: 0 4px; }
.overline { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; color: var(--on-surface-variant); }

.month-nav { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 0; margin: 0 -8px; }
.month-btn {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 8px 0 16px; border-radius: 20px;
  font-size: 16px; line-height: 24px; font-weight: 500; color: var(--on-surface); white-space: nowrap;
}
.month-btn .ic { color: var(--on-surface-variant); }
.month-nav .today { justify-self: end; margin-right: 8px; }

/* ─── cartões (cards) ──────────────────────────────────────────────────── */
.card {
  display: block; width: 100%; text-align: left; color: var(--on-surface);
  background: var(--surface); border-radius: var(--r-li); padding: 16px;
  --field-bg: var(--surface);
}
.card.outlined { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-variant); --field-bg: var(--bg); }
.card.filled { background: var(--surface-high); --field-bg: var(--surface-high); }
.card.flush { padding: 8px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.1px; }
.card-head .sup { display: block; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); font-weight: 400; letter-spacing: 0; }
.card.flush .card-head { padding: 8px 16px 0; margin-bottom: 4px; }
.divider { height: 1px; background: var(--outline-variant); margin: 12px 0; border: 0; }
.divider.flush { margin: 0; }

/* saldo do mês */
.hero { padding: 20px 16px 16px; }
.hero-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--on-surface-variant); }
.hero-value { font-size: 36px; line-height: 44px; font-weight: 400; letter-spacing: -0.5px; margin: 4px 0 16px; overflow-wrap: anywhere; }
.hero-value.neg { color: var(--negative-text); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-lg); background: var(--bg); min-width: 0; }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.stat-ic.in { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.stat-ic.out { background: var(--spend-container); color: var(--on-spend-container); }
.stat-k { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; color: var(--on-surface-variant); }
.stat-v { font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-h { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 12px 4px 0; border-top: 1px solid var(--outline-variant); font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.hero-foot b { color: var(--on-surface); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.people { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-sm); background: var(--secondary-container); color: var(--on-secondary-container); font-size: 12px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; }

/* faixas de aviso (banners) */
.banner {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 12px 8px 12px 16px; border-radius: var(--r-li);
  background: var(--secondary-container); color: var(--on-secondary-container);
  font-size: 14px; line-height: 20px;
}
.banner > .ic { flex: none; }
.banner .banner-text { flex: 1; min-width: 0; }
.banner .banner-text b { font-weight: 500; }
.banner .btn.text { color: inherit; font-weight: 700; padding: 0 12px; height: 36px; flex: none; }
.banner.warn { background: var(--warning-container); color: var(--on-warning-container); }
.banner.err { background: var(--error-container); color: var(--on-error-container); }
.banner.neutral { background: var(--surface); color: var(--on-surface); }
.banner.neutral > .ic { color: var(--primary); }

/* ─── listas ───────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 2px; }
.list > .li { background: var(--surface); border-radius: var(--r-xs); }
.list > .li:first-child { border-top-left-radius: var(--r-li); border-top-right-radius: var(--r-li); }
.list > .li:last-child { border-bottom-left-radius: var(--r-li); border-bottom-right-radius: var(--r-li); }
.list.plain { gap: 0; }
.list.plain > .li { background: transparent; border-radius: 0; }
.li {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px;
  padding: 8px 16px; text-align: left; color: var(--on-surface);
}
.li.tall { min-height: 72px; }
.li.bleed { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
.li > .ic { color: var(--on-surface-variant); }
.li.prim > .ic { color: var(--primary); }
.li-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.li-head { font-size: 16px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sup { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sup.wrap { white-space: normal; }
.li-trail { flex: none; display: flex; align-items: center; gap: 4px; color: var(--on-surface-variant); font-size: 14px; line-height: 20px; }
.li.danger > .ic, .li.danger .li-head { color: var(--error); }
.li.disabled { opacity: 0.38; pointer-events: none; }
.li .count { font-size: 14px; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }

/* lançamentos */
.tx { min-height: 72px; }
.tx.ignored .li-head, .tx.ignored .tx-amt { opacity: 0.55; }
.tx-title { font-size: 16px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap; color: var(--on-surface); font-variant-numeric: tabular-nums; }
.tx-amt.in { color: var(--income-text); }
.tx-amt.ign { text-decoration: line-through; text-decoration-thickness: 1px; }
.tx-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dirty-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--warning); display: inline-block; margin-left: 8px; vertical-align: middle; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px;
  font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.3px; white-space: nowrap;
  background: var(--surface-high); color: var(--on-surface-variant);
}
.badge .ic { width: 14px; height: 14px; }
.badge.ok { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.badge.err { background: var(--error-container); color: var(--on-error-container); }
.badge.hot { background: var(--error); color: var(--on-error); }
.badge.warn { background: var(--warning-container); color: var(--on-warning-container); }
.badge.info { background: var(--secondary-container); color: var(--on-secondary-container); }
.badge.gray { background: var(--surface-high); color: var(--on-surface-variant); }
button.badge { cursor: pointer; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 16px; color: var(--on-surface-variant); font-size: 14px; line-height: 20px; text-align: center; }
.empty > .ic { color: var(--on-surface-variant); opacity: 0.7; }

/* próximos vencimentos */
.due .li-sup { display: flex; align-items: center; gap: 6px; }
.due .li-sup .late { color: var(--negative-text); font-weight: 500; }
.due .tx-amt { font-size: 14px; }
.check-btn { width: 40px; height: 40px; margin: 0 -8px 0 -8px; border-radius: 50%; display: grid; place-items: center; color: var(--on-surface-variant); position: relative; flex: none; }
.check-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; transition: opacity 0.15s; }
.check-btn:active::after { opacity: 0.12; }
.check-btn:active { color: var(--tertiary); }

/* indicador de progresso linear (M3 Expressive: trilho separado e ponto de parada) */
.progress { display: flex; align-items: center; gap: 4px; height: 8px; }
.progress .bar { height: 100%; border-radius: 4px; background: var(--primary); min-width: 4px; transition: flex-basis 0.3s; }
.progress .rest { flex: 1 1 auto; height: 100%; border-radius: 4px; background: var(--primary-container); position: relative; min-width: 8px; }
.progress .rest::after { content: ""; position: absolute; right: 2px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--primary); }
.progress.thin { height: 4px; }
.progress.thin .rest::after { display: none; }
.progress.warn .bar { background: var(--warning); }
.progress.warn .rest { background: var(--warning-container); }
.progress.warn .rest::after { background: var(--warning); }
.progress.over .bar { background: var(--error); }
.progress.over .rest { background: var(--error-container); }
.progress.over .rest::after { background: var(--error); }
.pct-label { font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--primary); }
.pct-label.warn { color: var(--warning); }
.pct-label.over { color: var(--negative-text); }
.status-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; line-height: 20px; }
.status-line.warn { color: var(--warning); }
.status-line.over { color: var(--negative-text); }
.budget-nums { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.budget-nums b { font-size: 22px; line-height: 28px; font-weight: 400; font-variant-numeric: tabular-nums; }
.budget-nums span { font-size: 14px; color: var(--on-surface-variant); }

/* ─── gráficos ─────────────────────────────────────────────────────────── */
.cat-card { container-type: inline-size; }
.donut-wrap { display: grid; grid-template-columns: 1fr; gap: 8px; justify-items: center; }
/* rosca ao lado da legenda só quando o próprio cartão tem largura para isso */
@container (min-width: 500px) { .donut-wrap { grid-template-columns: 176px minmax(0, 1fr); align-items: center; gap: 24px; } }
@container (min-width: 680px) { .donut-wrap { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; padding: 0 8px; } .donut { width: 200px; height: 200px; } }
.donut { width: 176px; height: 176px; display: block; }
.donut-center .k { font-size: 11px; font-weight: 500; letter-spacing: 0.5px; fill: var(--on-surface-variant); }
.donut-center .v { font-size: 15px; font-weight: 500; fill: var(--on-surface); font-variant-numeric: tabular-nums; }
.seg { cursor: pointer; transition: opacity 0.15s; }
.legend { display: flex; flex-direction: column; min-width: 0; width: 100%; }
.lg-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; text-align: left; padding: 4px 4px 4px 8px; border-radius: var(--r-md); font-size: 14px; line-height: 20px; }
.lg-sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lg-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-val { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-pct { width: 48px; text-align: right; flex: none; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.lg-row .ic { color: var(--on-surface-variant); }
.bars { width: 100%; height: auto; display: block; overflow: visible; }
.bars .axis { stroke: var(--outline-variant); stroke-width: 1; }
.bars .grid { stroke: var(--outline-variant); stroke-width: 1; stroke-dasharray: 2 4; }
.bars .tick { font-size: 10px; fill: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.bars .xl { font-size: 11px; fill: var(--on-surface-variant); font-weight: 500; }
.bars .xl.on { fill: var(--on-surface); font-weight: 700; }
.bars .hit { fill: transparent; cursor: pointer; }
.bars .sel-bg { fill: var(--surface-high); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); margin: 0 0 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.readout div { text-align: center; min-width: 0; }
.readout small { display: block; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.readout b { font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ─── cartões de crédito ───────────────────────────────────────────────── */
.cc { display: flex; gap: 16px; align-items: center; width: 100%; text-align: left; }
.cc-art { width: 56px; height: 36px; border-radius: 6px; flex: none; position: relative; overflow: hidden; }
.cc-art::after { content: ""; position: absolute; left: 7px; top: 9px; width: 11px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.75); }
.cc-art::before { content: ""; position: absolute; right: -14px; bottom: -18px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.cc-name { font-size: 16px; line-height: 24px; font-weight: 500; }
.cc-sub { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.cc-amt { font-size: 18px; line-height: 24px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-right { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cc-limit { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); margin: 16px 0 8px; }
.cc-limit b { color: var(--on-surface); font-weight: 500; font-variant-numeric: tabular-nums; }
.cc-closed { margin-top: 12px; }
.carousel { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.mini-card { flex: 0 0 auto; width: 168px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: var(--r-li); padding: 16px; text-align: left; scroll-snap-align: start; color: var(--on-surface); }
.mini-card .cc-art { width: 40px; height: 26px; border-radius: 5px; margin-bottom: 10px; }
.mini-card .cc-art::after { left: 5px; top: 7px; width: 8px; height: 6px; }
.mini-card small { display: block; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.mini-card .name { font-size: 14px; line-height: 20px; font-weight: 500; }
.mini-card b { font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.invoice-switch { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0 -8px; }
.invoice-switch span { font-size: 16px; line-height: 24px; font-weight: 500; text-align: center; min-width: 0; }

/* ─── botões ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: var(--r-full);
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; white-space: nowrap;
}
.btn .ic { width: 18px; height: 18px; margin-left: -8px; }
.btn.block { width: 100%; }
.btn.lg { height: 56px; padding: 0 28px; font-size: 16px; line-height: 24px; }
.btn.lg .ic { width: 24px; height: 24px; }
.btn.sm { height: 32px; padding: 0 16px; }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.outlined, .btn.outline { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--outline); }
.btn.text, .btn.ghost { background: transparent; color: var(--primary); padding: 0 12px; }
.btn.text .ic, .btn.ghost .ic { margin-left: -4px; }
.btn.neutral { background: var(--surface-high); color: var(--on-surface); }
.btn.danger { background: var(--error); color: var(--on-error); }
.btn.danger.text, .btn.danger-text { background: transparent; color: var(--error); padding: 0 12px; }
.btn.danger-outline { background: transparent; color: var(--error); box-shadow: inset 0 0 0 1px var(--outline); }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.link-btn { color: var(--primary); font-size: 14px; font-weight: 500; padding: 0 12px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; position: relative; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 32px; padding: 0 16px; border-radius: var(--r-sm); flex: none;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--outline-variant); color: var(--on-surface-variant);
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px;
}
.chip > .ic { width: 18px; height: 18px; margin-left: -8px; }
.chip > .ic.trail { margin-left: -4px; margin-right: -8px; }
.chip.on { background: var(--secondary-container); color: var(--on-secondary-container); box-shadow: none; }
.chip input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* botão segmentado */
.segmented { display: flex; height: 40px; border-radius: var(--r-full); box-shadow: inset 0 0 0 1px var(--outline); overflow: hidden; }
.segmented button {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px;
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; color: var(--on-surface); white-space: nowrap;
}
.segmented button + button { box-shadow: inset 1px 0 0 var(--outline); }
.segmented button.on { background: var(--secondary-container); color: var(--on-secondary-container); }
.segmented button .ic { width: 18px; height: 18px; }

/* ─── campos (text field outlined, rótulo sempre flutuando) ───────────── */
.tf {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 0 16px; border-radius: var(--r-xs); text-align: left; color: var(--on-surface);
  box-shadow: inset 0 0 0 1px var(--outline); background: transparent;
}
.tf:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.tf-label {
  position: absolute; left: 12px; top: 0; transform: translateY(-50%); padding: 0 4px; max-width: calc(100% - 24px);
  font-size: 12px; line-height: 16px; color: var(--on-surface-variant); background: var(--field-bg, var(--surface));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.tf:focus-within .tf-label { color: var(--primary); }
.tf > .ic { color: var(--on-surface-variant); }
.tf-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 16px 0; font-size: 16px; line-height: 24px; color: inherit; }
.tf-input::placeholder { color: var(--on-surface-variant); opacity: 0.75; }
select.tf-input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 24px; }
.tf .drop { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--on-surface-variant); }
.tf-value { flex: 1; min-width: 0; padding: 16px 0; font-size: 16px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-value.ph { color: var(--on-surface-variant); }
.tf .cat-dot { width: 28px; height: 28px; }
.tf .cat-dot .ic { width: 18px; height: 18px; }
.tf.error { box-shadow: inset 0 0 0 2px var(--error); }
.tf.error .tf-label { color: var(--error); }
.tf-help { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); margin: 4px 16px 0; }
.tf input[type="date"].overlay { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.fields { display: flex; flex-direction: column; gap: 20px; }
.field-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--on-surface-variant); margin: 0 4px 8px; letter-spacing: 0.1px; }
.field { display: block; margin-bottom: 20px; }
.field > span { display: block; font-size: 14px; font-weight: 500; color: var(--on-surface-variant); margin: 0 4px 8px; }
input.input {
  width: 100%; min-height: 56px; border-radius: var(--r-xs); border: 0; box-shadow: inset 0 0 0 1px var(--outline);
  background: transparent; padding: 16px; font-size: 16px; line-height: 24px; outline: 0;
}
input.input:focus { box-shadow: inset 0 0 0 2px var(--primary); }

/* barra de busca M3 */
.searchbar {
  display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 4px 0 16px; border-radius: 28px;
  background: var(--surface-high); color: var(--on-surface);
}
.searchbar > .ic { color: var(--on-surface-variant); margin-right: 12px; }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; line-height: 24px; height: 100%; }
.searchbar input::placeholder { color: var(--on-surface-variant); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.sheet-search { margin-bottom: 8px; height: 48px; border-radius: 24px; }

/* switch M3 */
.switch { position: relative; width: 52px; height: 32px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch .track { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-highest); box-shadow: inset 0 0 0 2px var(--outline); transition: background-color 0.2s, box-shadow 0.2s; }
.switch .handle {
  position: absolute; top: 50%; left: 16px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline);
  transform: translate(-50%, -50%); display: grid; place-items: center; color: transparent;
  transition: left 0.25s cubic-bezier(0.2, 0, 0, 1), width 0.2s, height 0.2s, background-color 0.2s;
}
.switch .handle .ic { width: 16px; height: 16px; }
.switch input:checked + .track { background: var(--primary); box-shadow: none; }
.switch input:checked + .track .handle { left: 36px; width: 24px; height: 24px; background: var(--on-primary); color: var(--primary); }
.switch input:active + .track .handle { width: 28px; height: 28px; }
.switch input:disabled + .track { opacity: 0.38; }
.switch input:focus-visible + .track { outline: 3px solid var(--primary); outline-offset: 2px; }

/* rádio */
.radio { width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; box-shadow: inset 0 0 0 2px var(--on-surface-variant); }
.radio.on { box-shadow: inset 0 0 0 2px var(--primary); }
.radio.on::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--primary); }
.check { width: 18px; height: 18px; border-radius: 2px; flex: none; box-shadow: inset 0 0 0 2px var(--on-surface-variant); display: grid; place-items: center; color: transparent; }
.check.on { background: var(--primary); box-shadow: none; color: var(--on-primary); }
.check .ic { width: 16px; height: 16px; }

/* cor por categoria (avatares) */
.cat-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.cat-dot.sm { width: 32px; height: 32px; }
.cat-dot.sm .ic { width: 18px; height: 18px; }
[data-c="blue"] { --cc: var(--c-blue); } [data-c="orange"] { --cc: var(--c-orange); } [data-c="aqua"] { --cc: var(--c-aqua); }
[data-c="yellow"] { --cc: var(--c-yellow); } [data-c="magenta"] { --cc: var(--c-magenta); } [data-c="green"] { --cc: var(--c-green); }
[data-c="violet"] { --cc: var(--c-violet); } [data-c="red"] { --cc: var(--c-red); } [data-c="gray"] { --cc: var(--c-gray); }
.cat-dot[data-c] { background: var(--surface-high); background: color-mix(in srgb, var(--cc) 16%, var(--surface)); color: var(--cc); }
.swatch[data-c], .cc-art[data-c], .lg-sw[data-c] { background: var(--cc); }
.cc-art[data-c] { background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 55%, #000)); }

/* ─── formulário de lançamento ─────────────────────────────────────────── */
.amount-box { padding: 20px 4px 8px; text-align: center; }
.amount-label { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.amount-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 4px; }
.amount-line .cur { font-size: 24px; line-height: 32px; color: var(--on-surface-variant); }
.amount-input {
  width: 9ch; min-width: 0; max-width: 100%; field-sizing: content; text-align: left;
  font-size: 45px; line-height: 52px; font-weight: 400; border: 0; outline: 0; background: transparent; padding: 0;
  caret-color: var(--primary); color: var(--on-surface); font-variant-numeric: tabular-nums;
}
.amount-input::placeholder { color: var(--on-surface-variant); opacity: 0.6; }
.amount-input.in { color: var(--income-text); }
.amount-underline { height: 2px; width: 120px; margin: 6px auto 0; border-radius: 1px; background: var(--primary); opacity: 0.6; }
.form-section { margin-top: 24px; }
.form-list { margin: 8px -16px 0; }
.form-list .li { padding: 8px 16px; }
.form-list .li > .ic { color: var(--on-surface-variant); }
.repeat-row { padding: 0 0 8px 56px; }
.suggest { margin: -12px 0 0; padding: 8px 0; border-radius: var(--r-xs); background: var(--surface-high); display: flex; flex-direction: column; }
.suggest button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 16px; font-size: 14px; line-height: 20px; min-height: 48px; position: relative; }
.suggest button .ic { color: var(--on-surface-variant); }
.suggest button small { color: var(--on-surface-variant); font-size: 12px; margin-left: auto; white-space: nowrap; }
.hint { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.hint.box { background: var(--surface-high); color: var(--on-surface-variant); padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; line-height: 20px; display: flex; gap: 12px; align-items: flex-start; }
.hint.box .ic { flex: none; margin-top: 2px; }
.warn-box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-lg); background: var(--error-container); color: var(--on-error-container); font-size: 14px; line-height: 20px; margin-top: 16px; }
.warn-box .ic { flex: none; }
.info-box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-lg); background: var(--secondary-container); color: var(--on-secondary-container); font-size: 14px; line-height: 20px; margin: 8px 0 0; }
.info-box .ic { flex: none; }
.receipt-card { display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 8px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.receipt-card img { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.receipt-card > .ic { margin: 0 8px; color: var(--primary); }
.receipt-card .grow b { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.receipt-card .grow small { display: block; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.file-btn { position: relative; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.form-meta { margin-top: 24px; text-align: center; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }

/* ─── sobreposições ────────────────────────────────────────────────────── */
#overlays { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.ov { position: fixed; inset: 0; pointer-events: auto; display: flex; justify-content: center; }
.ov-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade 0.2s ease-out; }
.ov-panel { position: relative; width: 100%; max-width: var(--maxw); display: flex; flex-direction: column; background: var(--bg); color: var(--on-surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(32px); opacity: 0; } }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }
@keyframes slide { from { transform: translateY(24px); opacity: 0; } }
@keyframes rise { from { transform: translateY(16px) scale(0.9); opacity: 0; } }

/* folha inferior (bottom sheet) */
.ov-sheet { align-items: flex-end; }
.ov-sheet .ov-panel {
  max-height: 90vh; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--sheet-bg); --field-bg: var(--sheet-bg);
  padding-bottom: var(--safe-b); animation: up 0.28s cubic-bezier(0.2, 0, 0, 1);
}
@supports (height: 1dvh) { .ov-sheet .ov-panel { max-height: 90dvh; } }
.ov-sheet.tall .ov-panel { height: 90vh; }
@supports (height: 1dvh) { .ov-sheet.tall .ov-panel { height: 90dvh; } }
.grab { width: 32px; height: 4px; border-radius: 2px; background: var(--on-surface-variant); opacity: 0.4; margin: 16px auto 8px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px 24px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 400; flex: 1; min-width: 0; }
.sheet-body { overflow-y: auto; padding: 8px 24px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; }
.sheet-foot { padding: 8px 24px 16px; display: flex; flex-direction: column; gap: 8px; flex: none; }
.sheet-foot.row { flex-direction: row; justify-content: flex-end; }

/* listas de seleção (dentro das folhas) */
.pick-list { display: flex; flex-direction: column; margin: 0 -24px; }
.pick { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 24px; width: 100%; text-align: left; color: var(--on-surface); }
.pick .name { flex: 1; min-width: 0; font-size: 16px; line-height: 24px; }
.pick .name small { display: block; color: var(--on-surface-variant); font-size: 14px; line-height: 20px; }
.pick.off .name { color: var(--on-surface-variant); text-decoration: line-through; }
.pick > .ic { color: var(--on-surface-variant); }
.pick-row { display: flex; align-items: center; padding-right: 12px; }
.pick-row .pick { flex: 1; min-width: 0; padding-right: 8px; }
.pick-tools { display: flex; align-items: center; }
.pick-add { color: var(--primary); }
.pick-add > .ic { color: var(--primary); }

/* diálogo */
.ov-dialog { align-items: center; padding: 24px; }
.ov-dialog .ov-panel {
  max-width: 400px; min-width: 280px; border-radius: var(--r-xl); padding: 24px;
  background: var(--dialog-bg); --field-bg: var(--dialog-bg);
  max-height: 85vh; overflow-y: auto; animation: pop 0.2s cubic-bezier(0.2, 0, 0, 1); box-shadow: var(--elev-3);
}
.dlg-icon { display: grid; place-items: center; color: var(--primary); margin: 0 auto 16px; }
.dlg-icon.danger { color: var(--error); }
.ov-dialog h3 { margin: 0 0 16px; font-size: 24px; line-height: 32px; font-weight: 400; }
.dlg-icon + h3 { text-align: center; }
.ov-dialog p { margin: 0 0 8px; color: var(--on-surface-variant); font-size: 14px; line-height: 20px; }
.ov-dialog .actions { margin-top: 24px; }
.dlg-list { display: flex; flex-direction: column; margin: 8px -24px 0; }
.dlg-list .li { padding: 8px 24px; min-height: 56px; }
.dlg-list .li > .ic { color: var(--on-surface-variant); }
.dlg-list .li.danger > .ic, .dlg-list .li.danger .li-head { color: var(--error); }
.choice { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 12px 24px; min-height: 64px; }

/* tela cheia (full-screen dialog) */
.ov-full .ov-panel { height: 100%; animation: slide 0.25s cubic-bezier(0.2, 0, 0, 1); --field-bg: var(--bg); }
.ov-full.surface .ov-panel { background: var(--surface); --field-bg: var(--surface); }
.full-head { display: flex; align-items: center; gap: 4px; padding: var(--safe-t) 4px 0; min-height: calc(var(--top-h) + var(--safe-t)); flex: none; background: inherit; }
.full-head h2 { flex: 1; min-width: 0; margin: 0 0 0 4px; font-size: 22px; line-height: 28px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.full-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 16px calc(32px + var(--safe-b)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.full-foot { flex: none; display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); background: inherit; border-top: 1px solid var(--outline-variant); }
.full-foot .btn { flex: 1; }
.full-foot .btn.lg { height: 48px; }

/* menu suspenso */
.ov-menu { justify-content: flex-end; }
.ov-menu .ov-scrim { background: transparent; animation: none; }
.ov-menu .ov-panel { position: absolute; top: calc(var(--safe-t) + 56px); right: max(8px, calc((100vw - var(--maxw)) / 2 + 8px)); width: auto; min-width: 200px; max-width: 280px; border-radius: var(--r-xs); padding: 8px 0; background: var(--surface-high); box-shadow: var(--elev-2); animation: pop 0.15s ease-out; transform-origin: top right; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; height: 48px; padding: 0 16px; font-size: 14px; }
.menu-item .ic { color: var(--on-surface-variant); }

/* menu do FAB (M3 Expressive) */
.ov-radial .ov-scrim { background: var(--scrim); }
.ov-radial .ov-panel { position: relative; height: 100%; background: transparent; pointer-events: none; }
.fab-menu { position: absolute; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: auto; }
.fab-menu-item {
  height: 56px; padding: 0 24px 0 16px; border-radius: 28px; display: inline-flex; align-items: center; gap: 12px;
  background: var(--primary-container); color: var(--on-primary-container);
  font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap;
  animation: rise 0.28s cubic-bezier(0.2, 0, 0, 1) both;
}
.fab-close {
  margin-top: 4px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--elev-3); animation: pop 0.2s ease-out;
}

/* aviso (snackbar) */
#toast { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); display: flex; justify-content: center; pointer-events: none; z-index: 40; padding: 0 16px; }
.toast {
  pointer-events: auto; width: 100%; max-width: 568px; min-height: 48px; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 16px; border-radius: var(--r-xs); background: var(--inverse-surface); color: var(--inverse-on-surface);
  font-size: 14px; line-height: 20px; box-shadow: var(--elev-3); animation: up 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.toast .grow { padding: 10px 0; }
.toast button { color: var(--inverse-primary); font-size: 14px; font-weight: 500; letter-spacing: 0.1px; height: 40px; padding: 0 12px; border-radius: 20px; flex: none; }
.toast.err { background: var(--error-container); color: var(--on-error-container); }
.toast.err button { color: var(--on-error-container); }

/* ─── abertura e boas-vindas ───────────────────────────────────────────── */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; transition: opacity 0.25s; }
.boot.gone { opacity: 0; pointer-events: none; }
.welcome { padding: calc(var(--safe-t) + 32px) 8px calc(var(--safe-b) + 24px); display: flex; flex-direction: column; min-height: 100%; }
body.onboarding .screen { padding: 0 16px; }
.welcome .logo-img { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 24px; }
.welcome .logo { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-container); color: var(--on-primary-container); margin-bottom: 24px; }
.welcome h1 { font-size: 32px; line-height: 40px; font-weight: 400; margin: 0 0 8px; }
.welcome p { color: var(--on-surface-variant); margin: 0 0 24px; font-size: 16px; line-height: 24px; }
.feature { display: flex; gap: 16px; align-items: flex-start; padding: 8px 0; font-size: 14px; line-height: 20px; }
.feature .ic { color: var(--primary); margin-top: 2px; }
.feature b { display: block; font-size: 16px; line-height: 24px; font-weight: 500; }
.feature .muted { display: block; }
.welcome .btn-stack { margin-top: 24px; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--on-surface-variant); line-height: 20px; display: grid; gap: 8px; }
.code-box { background: var(--surface-high); color: var(--on-surface); font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 12px; border-radius: var(--r-md); max-height: 180px; overflow: auto; white-space: pre; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--outline-variant); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--on-surface-variant); }
details.help { margin-top: 16px; border-radius: var(--r-md); background: var(--surface-high); padding: 0 16px; }
details.help summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-size: 14px; font-weight: 500; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary .ic { color: var(--on-surface-variant); }
details.help[open] summary .chev { transform: rotate(180deg); }
details.help .steps { padding-bottom: 16px; }
details.help .btn { margin-bottom: 16px; }

/* configurações */
.settings-label { margin: 24px 16px 8px; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; color: var(--primary); }
.settings-label:first-child { margin-top: 8px; }
.settings-card { background: var(--surface); border-radius: var(--r-li); padding: 20px 16px 16px; --field-bg: var(--surface); display: flex; flex-direction: column; gap: 20px; }
.theme-pick { padding: 4px 16px 16px; background: var(--surface); }
.list > .theme-pick:last-child { border-bottom-left-radius: var(--r-li); border-bottom-right-radius: var(--r-li); }
.foot-note { text-align: center; margin: 24px 16px 8px; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.icon-grid button { height: 48px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--on-surface-variant); background: var(--surface-high); position: relative; }
.icon-grid button.on { background: var(--secondary-container); color: var(--on-secondary-container); box-shadow: inset 0 0 0 2px var(--primary); }
.color-row { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.swatch.on { box-shadow: 0 0 0 3px var(--field-bg, var(--surface)), 0 0 0 5px var(--cc); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 40px; text-align: center; font-size: 22px; line-height: 28px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; background: var(--secondary-container); color: var(--on-secondary-container); display: grid; place-items: center; position: relative; }
.radio-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; width: 100%; text-align: left; font-size: 16px; line-height: 24px; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.month-grid button { height: 40px; border-radius: 20px; font-size: 14px; font-weight: 500; text-transform: capitalize; color: var(--on-surface-variant); }
.month-grid button.now { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.month-grid button.on { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.year-nav { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 12px; font-size: 16px; line-height: 24px; font-weight: 500; }
.viewer img { width: 100%; border-radius: var(--r-md); display: block; }
.demo-band { margin: 0; }


/* ════════════════════════════════════════════════════════════════════════
   TABLET E COMPUTADOR (layout adaptativo do Material 3)
   médio ≥ 600px: trilho de navegação recolhido • expandido ≥ 1024px: trilho com rótulos e várias colunas
   ════════════════════════════════════════════════════════════════════════ */
.cards-grid { display: flex; flex-direction: column; gap: 12px; }
.budget-cols { display: contents; }
.budget-side { display: flex; flex-direction: column; gap: 12px; }
.welcome-intro { flex: 1 1 auto; display: flex; flex-direction: column; }
.welcome-actions h2 { display: none; }
.add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 168px; background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--outline-variant); font-size: 14px; font-weight: 500; }
.add-tile:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.table-wrap { overflow-x: auto; }
.tx-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; table-layout: fixed; }
.tx-table td { overflow: hidden; text-overflow: ellipsis; }
.tx-table.compact th:nth-child(1) { width: 76px; }
.tx-table.compact th:nth-child(3) { width: 132px; }
.tx-table.compact th:nth-child(4) { width: 136px; }
.tx-table.ledger th:nth-child(2) { width: 140px; }
.tx-table.ledger th.col-pay { width: 220px; }
.tx-table.ledger th:nth-child(4) { width: 236px; }
.tx-table.ledger th:nth-child(5) { width: 140px; }
.tx-table th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; color: var(--on-surface-variant); padding: 10px 16px; border-bottom: 1px solid var(--outline-variant); white-space: nowrap; }
.tx-table td { padding: 10px 16px; border-bottom: 1px solid var(--outline-variant); vertical-align: middle; }
.tx-table tbody tr:last-child td { border-bottom: 0; }
.tx-table .r { text-align: right; white-space: nowrap; }
.tx-table .w-date { width: 64px; white-space: nowrap; }
.tx-table td.muted { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tx-table .day-row td { background: var(--surface-low); color: var(--on-surface-variant); font-size: 13px; font-weight: 500; padding: 8px 16px; }
.tx-table .tx-badges { margin: 0; flex-wrap: wrap; }
.tx-table .tx-amt { font-size: 14px; }
.tx-tr { cursor: pointer; }
.tx-tr:hover td { background: var(--surface-low); background: color-mix(in srgb, var(--on-surface) 5%, var(--surface)); }
.tx-tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tx-tr.ignored td > * { opacity: 0.55; }
.cell-desc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-desc .tx-title { font-size: 14px; line-height: 20px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-text { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; }
.cell-sub { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-ic.acc { background: var(--secondary-container); color: var(--on-secondary-container); }
.kbd { flex: none; margin-right: 12px; min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--on-surface-variant); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.cell-desc .dirty-dot { margin-left: 0; flex: none; }
.cell-desc .rcpt { width: 32px; height: 32px; margin: -6px -4px; }
.cell-desc .rcpt::after { inset: 0; }
.table-card { overflow: hidden; padding: 0; }

@media (min-width: 600px) {
  :root { --rail-w: 96px; }
  #app { max-width: none; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #nav { position: relative; inset: auto; grid-column: 1; grid-row: 1 / 3; z-index: 6; pointer-events: auto; }
  #topbar { grid-column: 2; grid-row: 1; }
  #screen { grid-column: 2; grid-row: 2; min-height: 0; }
  .screen { padding: 4px 24px 40px; }
  .page { max-width: 760px; margin: 0 auto; }
  body.onboarding #app { grid-template-columns: minmax(0, 1fr); }
  body.onboarding #nav, body.onboarding #topbar { display: none; }
  body.onboarding #screen { grid-column: 1; grid-row: 1 / 3; }

  /* trilho de navegação */
  .rail { height: 100%; display: flex; flex-direction: column; align-items: center; background: var(--bg); padding: calc(var(--safe-t) + 16px) 0 16px; overflow-y: auto; scrollbar-width: none; }
  .rail-fab {
    width: 56px; height: 56px; flex: none; border-radius: var(--r-lg); display: grid; place-items: center;
    background: var(--primary-container); color: var(--on-primary-container); box-shadow: var(--elev-1); margin-bottom: 32px; position: relative;
  }
  .rail-fab::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 0.15s; }
  .rail-fab:hover::after { opacity: 0.08; }
  .rail-fab:active::after { opacity: 0.12; }
  .rail-items { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
  .rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 80px; color: var(--on-surface-variant); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; }
  .rail-item .ind { width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; position: relative; transition: background-color 0.2s; }
  .rail-item .ind::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 0.15s; }
  .rail-item:hover .ind::after { opacity: 0.08; }
  .rail-item:active .ind::after { opacity: 0.12; }
  .rail-item.on { color: var(--on-surface); font-weight: 700; }
  .rail-item.on .ind { background: var(--secondary-container); color: var(--on-secondary-container); }
  .rail-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }

  /* barra superior larga: título, mês e ações da tela */
  .topbar.wide { padding: 0 16px 0 24px; gap: 8px; max-width: 808px; margin: 0 auto; }
  .topbar.wide .topbar-title { flex: none; min-width: 0; margin-right: 12px; }
  .month-nav.inline { display: flex; align-items: center; gap: 0; margin: 0; }
  .month-nav.inline .today { margin: 0 0 0 4px; }
  .topbar.wide .btn { flex: none; }

  /* folhas inferiores viram diálogos; telas cheias viram painéis laterais (side sheets) */
  .ov-panel { max-width: none; }
  .ov-sheet { align-items: center; padding: 24px; }
  .ov-sheet .ov-panel { width: 100%; max-width: 560px; max-height: min(800px, calc(100vh - 48px)); border-radius: var(--r-xl); padding-bottom: 0; box-shadow: var(--elev-3); animation: pop 0.2s cubic-bezier(0.2, 0, 0, 1); }
  .ov-sheet.tall .ov-panel { height: min(760px, calc(100vh - 48px)); }
  .ov-sheet .grab { display: none; }
  .ov-sheet .sheet-head { padding-top: 20px; }
  .ov-full { justify-content: flex-end; }
  .ov-full .ov-panel { width: 100%; max-width: 480px; border-radius: var(--r-lg) 0 0 var(--r-lg); box-shadow: var(--elev-3); animation: from-right 0.28s cubic-bezier(0.2, 0, 0, 1); }
  .ov-full.wide .ov-panel { max-width: 640px; }
  .ov-full .full-head { padding-top: 8px; min-height: 72px; }
  .ov-full .full-body { padding: 8px 24px 32px; }
  .ov-full .full-foot { padding: 16px 24px; }
  .ov-full .full-body .page { max-width: none; }

  /* menu do "+" ancorado no botão do trilho */
  .ov-radial .ov-scrim { background: transparent; animation: none; }
  .fab-menu.anchored {
    position: fixed; right: auto; bottom: auto; flex-direction: column-reverse; align-items: stretch; gap: 0;
    min-width: 248px; padding: 8px 0; border-radius: var(--r-lg); background: var(--surface-high); box-shadow: var(--elev-2);
    animation: pop 0.15s ease-out; transform-origin: top left;
  }
  .fab-menu.anchored .fab-menu-item { height: 48px; border-radius: 0; padding: 0 24px 0 16px; background: transparent; color: var(--on-surface); font-size: 14px; line-height: 20px; animation: none; }
  .fab-menu.anchored .fab-menu-item .ic { color: var(--on-surface-variant); }
  .fab-menu.anchored .fab-close { display: none; }

  /* snackbar no canto inferior esquerdo da área de conteúdo */
  #toast { left: var(--rail-w); bottom: 24px; justify-content: flex-start; padding: 0 24px; }
  .toast { width: auto; min-width: 344px; max-width: 560px; }
  body.has-toast .fab { transform: none; }
  body.onboarding #toast { left: 0; justify-content: center; }

  /* cartões em grade */
  .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
  .cards-page { max-width: 1320px; }

  /* boas-vindas */
  .welcome { max-width: 520px; margin: 0 auto; padding-top: 48px; }
  .welcome.invite { max-width: 480px; }
}

@media (min-width: 1024px) {
  .page { max-width: 1320px; }
  .screen { padding: 8px 32px 48px; }
  .topbar.wide { padding: 0 24px 0 32px; max-width: 1384px; }

  /* Painel: indicadores numa linha + duas colunas */
  .dash-x { gap: 16px; }
  .dash-x .hero { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; }
  .dash-x .hero.no-acc { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
  .dash-x .hero-main { padding: 12px 12px 12px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
  .dash-x .hero-value { margin: 0; font-size: 34px; line-height: 44px; white-space: nowrap; }
  .dash-x .hero-label { flex-wrap: wrap; }
  .dash-x .hero-foot.stat { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; }
  .dash-x .hero-foot .stat-v { color: var(--on-surface); }
  .dash-x .hero-foot .stat-v.t-expense { color: var(--negative-text); }
  .tx-table .col-pay { display: none; }
  .dash-x .hero-stats { display: contents; }
  .dash-x .stat { padding: 16px; gap: 8px; }
  .dash-x .stat-v { font-size: 22px; line-height: 28px; font-weight: 400; }
  .dash-x .hero-foot { margin: 0; padding: 16px; border: 0; border-radius: var(--r-lg); background: var(--bg); flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; }
  .dash-x .hero-foot b { font-size: 22px; line-height: 28px; font-weight: 400; letter-spacing: 0; }
  .dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
  .dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .dash-x .card.flush .card-head { padding: 12px 16px 4px 20px; }
  .dash-x .card:not(.flush):not(.hero) { padding: 20px; }

  /* Extrato: barra de ferramentas numa linha */
  .toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .searchbar.sm { height: 48px; width: 360px; flex: none; border-radius: 24px; }
  .toolbar .chips.scroll { margin: 0; padding: 0; overflow: visible; }
  .totals-inline { display: flex; align-items: center; gap: 24px; }
  .totals-inline span { display: flex; flex-direction: column; align-items: flex-end; }
  .totals-inline small { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
  .totals-inline b { font-size: 16px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* Orçamentos: geral à esquerda, categorias à direita */
  .budget-x .budget-cols { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .budget-x .budget-side .section-head { margin-top: 0; }
  .budget-x .budget-main { padding: 20px; }

  /* boas-vindas em duas colunas */
  .welcome { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px); gap: 72px; align-items: center; padding: 48px 32px; min-height: 100%; }
  .welcome.invite { display: flex; max-width: 480px; }
  .welcome h1 { font-size: 45px; line-height: 52px; }
  .welcome .features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin-top: 8px; }
  .welcome-actions { background: var(--surface); border-radius: var(--r-xl); padding: 32px; }
  .welcome-actions h2 { display: block; margin: 0 0 24px; font-size: 22px; line-height: 28px; }
  .welcome .btn-stack { margin-top: 0; }
}


@media (min-width: 1280px) {
  :root { --rail-w: 280px; }
  .rail.expanded { align-items: stretch; padding: calc(var(--safe-t) + 12px) 12px 12px; }
  .rail-brand { display: flex; align-items: center; gap: 12px; padding: 12px 16px 20px; font-size: 20px; line-height: 28px; white-space: nowrap; }
  .rail-brand img { width: 32px; height: 32px; border-radius: 9px; }
  .rail-fab.extended { width: auto; height: 56px; align-self: flex-start; display: inline-flex; gap: 12px; padding: 0 20px 0 16px; margin: 0 4px 24px; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
  .rail.expanded .rail-items { align-items: stretch; gap: 2px; }
  .rail.expanded .rail-item { width: auto; display: block; font-size: 14px; line-height: 20px; letter-spacing: 0.1px; }
  .rail.expanded .rail-item .ind { width: 100%; height: 56px; border-radius: 28px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 16px; }
  .rail.expanded .rail-item.on { font-weight: 700; }
  .rail.expanded .rail-foot { align-items: stretch; gap: 4px; }
  .rail-status { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 40px; border-radius: 20px; text-align: left; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); position: relative; }
  .rail-status::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 0.15s; }
  .rail-status:hover::after { opacity: 0.08; }
  .rail-status.ok .ic { color: var(--tertiary); }
  .rail-status.error { color: var(--error); }
  .rail-status.offline, .rail-status.demo { color: var(--warning); }

  .dash-cols { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
  .dash-x .hero-value { font-size: 40px; line-height: 48px; }
}
@media (min-width: 1440px) {
  .tx-table .col-pay { display: table-cell; }
  .cell-sub { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  .screen, .full-body, .sheet-body, .table-wrap { scrollbar-width: thin; scrollbar-color: var(--outline-variant) transparent; }
  .li[data-act], button.li, .pick, .mini-card, button.card, .tx-tr { cursor: pointer; }
}
@keyframes from-right { from { transform: translateX(48px); opacity: 0; } }

@media print { body { overflow: visible; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
