/* Lupin Vida: estilos do aplicativo. Tudo usa tokens (tokens.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--t-base); line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--btn); color: var(--btn-ink); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- estrutura ---------- */
#app { min-height: 100dvh; display: block; }
.shell { max-width: 680px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 0 10px; }
.topbar__t { flex: 1; min-width: 0; }
.topbar__date { font-size: var(--t-xs); color: var(--muted); letter-spacing: .02em; }
.topbar__date::first-letter, .mes-nav__t::first-letter { text-transform: uppercase; }
.topbar__h { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
@media (min-width: 700px) { .topbar__h { font-size: var(--t-2xl); } }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-md); color: var(--ink-2); transition: background var(--dur) var(--ease); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { background: var(--line); }
.icon-btn .badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
:root[data-theme="dark"] .icon-btn .badge { color: #1a0a09; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-btn .badge { color: #1a0a09; } }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav__in { display: flex; width: 100%; max-width: 680px; }
.nav__a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: .01em; border: 0; background: none; position: relative; }
.nav__a[aria-current="page"] { color: var(--accent); }
.nav__a[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.nav__a:hover { color: var(--ink); }

.fab { position: fixed; right: max(16px, calc(50% - 340px + 16px)); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 31; height: 56px; min-width: 56px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--btn); color: var(--btn-ink); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--t-base); box-shadow: var(--shadow-2); transition: transform var(--dur) var(--ease), filter var(--dur); }
.fab span { display: none; }
@media (min-width: 700px) { .fab { padding: 0 22px 0 18px; } .fab span { display: inline; } }
.fab:hover { filter: brightness(1.06); }
.fab:active { transform: scale(.97); }

@media (min-width: 960px) {
  .shell { max-width: 760px; margin-left: 240px; margin-right: auto; padding-bottom: 96px; }
  #app { padding-left: 0; }
  .nav { top: 0; bottom: auto; right: auto; width: 224px; height: 100dvh; border-top: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 24px 12px; align-items: flex-start; justify-content: flex-start; }
  .nav__in { flex-direction: column; gap: 4px; max-width: none; }
  .nav__brand { display: block !important; font-weight: 700; font-size: var(--t-lg); letter-spacing: -.02em; padding: 4px 12px 18px; }
  .nav__a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: var(--r-md); font-size: var(--t-base); }
  .nav__a[aria-current="page"] { background: var(--accent-soft); }
  .nav__a[aria-current="page"]::before { display: none; }
  .fab { right: 32px; bottom: 32px; }
}
.nav__brand { display: none; }

/* ---------- blocos ---------- */
.sec { margin-top: 22px; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sec__t { font-size: var(--t-sm); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.link { background: none; border: 0; padding: 8px 4px; color: var(--accent); font-weight: 500; font-size: var(--t-sm); border-radius: 6px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; border-bottom: 1px solid var(--line); background: var(--surface); }
.row:last-child { border-bottom: 0; }
.row--tap { cursor: pointer; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.row--tap:hover { background: var(--surface-2); }
.row__main { flex: 1; min-width: 0; }
.row__t { font-weight: 500; overflow-wrap: anywhere; }
.row__s { font-size: var(--t-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
.row__r { text-align: right; flex: none; }
.row.is-done .row__t { color: var(--muted); text-decoration: line-through; }

.check { flex: none; width: 44px; height: 44px; margin: -6px -6px -6px -8px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; }
.check__box { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--field-line); display: grid; place-items: center; color: transparent; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.check:hover .check__box { border-color: var(--accent); }
.check[aria-pressed="true"] .check__box, .check.is-on .check__box { background: var(--ok); border-color: var(--ok); color: var(--surface); transform: scale(1.04); }
.check.p1 .check__box { border-color: var(--bad); }
.check.p2 .check__box { border-color: var(--warn); }
.check.p3 .check__box { border-color: var(--accent); }
.check.p1[aria-pressed="true"] .check__box { border-color: var(--ok); }

.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 1px 9px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
button.chip { min-height: 38px; padding: 0 14px; font-size: var(--t-sm); border: 1px solid var(--line); background: var(--surface); }
button.chip:hover { border-color: var(--accent-line); }
button.chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--bad { background: var(--bad-soft); color: var(--bad); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--p1 { background: var(--bad-soft); color: var(--bad); }
.chip--p2 { background: var(--warn-soft); color: var(--warn); }
.chip--p3 { background: var(--info-soft); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { min-height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: filter var(--dur), background var(--dur), transform var(--dur) var(--ease); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--btn); color: var(--btn-ink); }
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn--danger { color: #1a0a09; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--danger { color: #1a0a09; } }
.btn--small { min-height: 38px; padding: 0 14px; font-size: var(--t-sm); border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--block { width: 100%; }
.row-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.row-actions .btn { flex: 1 1 140px; }

.seg { display: flex; background: var(--surface-2); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg__op { flex: 1; min-height: 40px; border: 0; background: none; border-radius: 10px; font-size: var(--t-sm); font-weight: 500; color: var(--muted); padding: 0 10px; white-space: nowrap; transition: background var(--dur), color var(--dur); }
.seg__op.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.seg--scroll { overflow-x: auto; scrollbar-width: none; }
.seg--scroll .seg__op { padding: 0 9px; font-size: .875rem; }
.seg--scroll::-webkit-scrollbar { display: none; }

.field { display: block; margin-top: 14px; }
.field__lab { display: block; font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field__hint { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 4px; }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--field-line); background: var(--surface); font-size: 1rem; }
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
.input--valor { font-family: var(--mono); font-size: 2rem; font-weight: 600; min-height: 64px; letter-spacing: -.03em; border-width: 2px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline > * { flex: 1; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

/* ---------- avisos ---------- */
.aviso { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); align-items: flex-start; }
.aviso + .aviso { margin-top: 8px; }
.aviso__ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.aviso--critico { background: var(--bad-soft); border-color: var(--bad-line); } .aviso--critico .aviso__ic { background: var(--bad); color: var(--surface); }
.aviso--atencao { background: var(--warn-soft); border-color: var(--warn-line); } .aviso--atencao .aviso__ic { background: var(--warn); color: var(--surface); }
.aviso--info { background: var(--info-soft); border-color: var(--info-line); } .aviso--info .aviso__ic { background: var(--info); color: var(--surface); }
.aviso__t { font-weight: 600; }
.aviso__x { font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px; }
.aviso__a { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.aviso__main { flex: 1; min-width: 0; }

/* ---------- Hoje ---------- */
.prog { display: flex; align-items: center; gap: 10px; }
.prog__txt { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.dot.is-on { background: var(--ok); }
.dia-fechado { background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: var(--r-lg); padding: 14px 16px; }
.dia-fechado h3 { font-size: var(--t-base); }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat { text-align: center; padding: 10px 4px; background: var(--surface); border-radius: var(--r-md); }
.stat__v { font-family: var(--mono); font-size: var(--t-xl); font-weight: 600; }
.stat__l { font-size: var(--t-xs); color: var(--muted); }
.dinheiro1 { display: block; width: 100%; text-align: left; border: 0; padding: 14px 16px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.dinheiro1__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.dinheiro1__v { font-family: var(--mono); font-weight: 600; font-size: var(--t-xl); letter-spacing: -.03em; }

/* ---------- Grade de rotinas ---------- */
.grade { width: 100%; border-collapse: separate; border-spacing: 3px; }
.grade th { font-weight: 500; font-size: 10.5px; color: var(--muted); padding: 0; text-align: center; }
.grade th.nome, .grade td.nome { text-align: left; font-size: var(--t-xs); padding-right: 6px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 500; }
.grade td.c { height: 22px; min-width: 14px; border-radius: 5px; background: var(--surface-2); }
.grade td.c.f { background: var(--ok); }
.grade td.c.n { background: color-mix(in srgb, var(--bad) 22%, var(--surface-2)); }
.grade td.c.x { background: transparent; }
.grade .hoje-col { outline: 2px solid var(--accent); outline-offset: -1px; }
.legenda { display: flex; gap: 14px; font-size: var(--t-xs); color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; }

/* ---------- Dinheiro ---------- */
.escada { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 16px 12px 8px; }
.escada__t { padding: 0 6px 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chart { width: 100%; max-width: 520px; height: auto; display: block; overflow: visible; margin: 0 auto; }
.ch-trilho { fill: var(--surface-2); } .ch-preenche { fill: var(--accent); }
.ch-marca { stroke-width: 2; stroke-linecap: round; } .ch-m1 { stroke: var(--warn); } .ch-m2 { stroke: var(--s1); } .ch-m3 { stroke: var(--ink); }
.ch-rot { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.ch-val { font-family: var(--mono); font-size: 11.5px; font-weight: 600; fill: var(--ink); }
.ch-atual { font-family: var(--font); font-size: 12px; font-weight: 600; fill: var(--accent); }
.ch-seta { fill: var(--accent); }
.ch-eixo { stroke: var(--line-strong); stroke-width: 1; }
.ch-ent { fill: var(--s1); } .ch-sai { fill: var(--s4); } .ch-hoje { fill: var(--accent); }
.ch-meta { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ch-linha { stroke: var(--accent); } .ch-proj { stroke: var(--muted); } .ch-ponto { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.ch-trilho-s { stroke: var(--surface-2); }
.ch-s0 { stroke: var(--s0); } .ch-s1 { stroke: var(--s1); } .ch-s2 { stroke: var(--s2); } .ch-s3 { stroke: var(--s3); } .ch-s4 { stroke: var(--s4); } .ch-s5 { stroke: var(--s5); } .ch-s6 { stroke: var(--s6); } .ch-s7 { stroke: var(--s7); }
.sw0 { background: var(--s0); } .sw1 { background: var(--s1); } .sw2 { background: var(--s2); } .sw3 { background: var(--s3); } .sw4 { background: var(--s4); } .sw5 { background: var(--s5); } .sw6 { background: var(--s6); } .sw7 { background: var(--s7); }
.leg-list { display: grid; gap: 6px; font-size: var(--t-sm); }
.leg-list li { display: flex; align-items: center; gap: 8px; list-style: none; }
.leg-list { padding: 0; margin: 0; }
.leg-list .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.leg-list .v { margin-left: auto; font-family: var(--mono); }
.mes-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 4px; }
.mes-nav__t { font-weight: 600; }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 5px; background: var(--accent); transition: width 300ms var(--ease); }
.bar__fill--ok { background: var(--ok); } .bar__fill--atencao { background: var(--warn); } .bar__fill--ruim { background: var(--bad); } .bar__fill--azul { background: var(--accent); }
.pote { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pote:last-child { border-bottom: 0; }
.pote__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.pote__nome { font-weight: 600; }
.pote__val { font-family: var(--mono); font-size: var(--t-sm); }
.pote__sub { font-size: var(--t-xs); color: var(--muted); margin-top: 4px; }
.trava { opacity: .75; }
.dia-sep { font-size: var(--t-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 14px 4px 6px; }
.valor-ent { color: var(--ok); } .valor-sai { color: var(--ink); } .valor-pro { color: var(--accent); }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 12px 14px; }
.kpi__l { font-size: var(--t-xs); color: var(--muted); }
.kpi__v { font-family: var(--mono); font-size: var(--t-xl); font-weight: 600; letter-spacing: -.03em; }
.kpi__s { font-size: var(--t-xs); color: var(--muted); }
.hero-num { font-family: var(--mono); font-size: var(--t-3xl); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }

/* ---------- vazio ---------- */
.empty { text-align: center; padding: 28px 16px; background: var(--surface); border-radius: var(--r-lg); border: 1px dashed var(--line-strong); }
.empty__t { font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- folha (modal) ---------- */
#sheet-root { position: relative; z-index: 50; }
.sheet-bg { position: fixed; inset: 0; background: var(--scrim); z-index: 50; animation: fade var(--dur) var(--ease); }
.sheet { position: fixed; z-index: 51; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-2); padding: 8px 18px 0; animation: subir 220ms var(--ease); overscroll-behavior: contain; }
.sheet:focus { outline: none; }
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 6px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet__title { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; }
@media (min-width: 700px) { .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 22px; max-height: 88dvh; animation: surgir 200ms var(--ease); } }
@keyframes fade { from { opacity: 0; } }
@keyframes subir { from { transform: translate(-50%, 24px); opacity: 0; } }
@keyframes surgir { from { transform: translate(-50%, -48%); opacity: 0; } }

#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); padding: 12px 14px 12px 18px; border-radius: 14px; box-shadow: var(--shadow-2); max-width: 520px; animation: fade var(--dur) var(--ease); }
.toast--erro { background: var(--bad); color: #fff; }
.toast__btn { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; padding: 6px 4px; min-height: 36px; }
@media (min-width: 960px) { #toast-root { bottom: 100px; padding-left: 240px; } }

/* ---------- banners ---------- */
.banner { padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); font-size: var(--t-sm); margin-top: 8px; }
.banner--info { background: var(--info-soft); border-color: var(--info-line); }
.banner button { margin-left: 6px; }
.manage-row { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.manage-row:last-child { border-bottom: 0; }
.dias-sel { display: flex; gap: 6px; flex-wrap: wrap; }
.dias-sel button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--field-line); background: var(--surface); font-size: var(--t-sm); font-weight: 500; }
.dias-sel button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); font-weight: 600; }
details.cx { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin-top: 10px; }
details.cx > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
details.cx > summary::-webkit-details-marker { display: none; }
details.cx > summary::after { content: ''; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--dur); margin-right: 4px; }
details.cx[open] > summary::after { transform: rotate(-135deg); }
details.cx > .cx__in { padding: 0 0 4px; }
.sugestao { font-size: var(--t-xs); color: var(--accent); margin-top: 4px; }
.preview-tarefa { min-height: 24px; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media print { .nav, .fab, .icon-btn { display: none !important; } body { background: #fff; } }

/* ---------- login (modo servidor) ---------- */
.login { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.login__card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 24px; }

/* ações da folha ficam sempre à vista, mesmo com o formulário rolando */
.sheet__body { padding-bottom: 6px; }
.sheet .row-actions { position: sticky; bottom: 0; z-index: 2; background: var(--surface); padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); margin: 14px 0 0; border-top: 1px solid var(--line); }
.sheet .row-actions--flat { position: static; border-top: 0; padding-top: 0; margin-top: 0; }
details.cx--leve { box-shadow: none; border: 1px solid var(--line); margin-top: 12px; background: var(--surface); }
details.cx--leve > summary { min-height: 46px; font-weight: 500; color: var(--ink-2); }

.card .stat { background: var(--surface-2); }

/* ---------- textos e números longos nunca estouram a tela ---------- */
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.row__main, .aviso__main, .pote__nome { min-width: 0; }
.row__r { max-width: 48%; overflow-wrap: anywhere; text-align: right; }
.num, .kpi__v, .hero-num, .pote__val, .dinheiro1__v, .stat__v { overflow-wrap: anywhere; }
.hero-num { font-size: clamp(1.5rem, 9vw, 2.25rem); }
.kpi__v { font-size: clamp(1.05rem, 5.4vw, 1.375rem); }
.kpi { min-width: 0; }
.pote__top { flex-wrap: wrap; }
.dinheiro1__top { flex-wrap: wrap; }
.mes-nav__t { text-align: center; }
.sec__head { flex-wrap: wrap; }
.field__lab, .field__hint { overflow-wrap: anywhere; }
.grade { table-layout: fixed; width: 100%; }
.grade th.nome, .grade td.nome { width: 72px; max-width: 72px; }
.grade td.c { min-width: 0; height: 20px; }
.donut-grid { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 380px) { .donut-grid { grid-template-columns: minmax(0, 1fr); } }
.leg-list li { min-width: 0; }
.leg-list li > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }

/* categorias em árvore */
.catsel { display: grid; gap: 8px; }
.catsel__nivel { align-items: center; }
.catsel__pai { font-size: var(--t-sm); color: var(--muted); padding-right: 2px; }
.chip--novo { border: 1px dashed var(--field-line); background: transparent; color: var(--accent, inherit); min-height: 36px; padding: 0 12px; border-radius: 999px; font: inherit; cursor: pointer; }
.catsel__criar { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
button.pote--toque { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
button.pote--toque:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.pote--sub .pote__nome { font-weight: 400; color: var(--muted); }

/* seções com seta */
details.cx--sec { margin-top: 12px; }
details.cx--sec > summary { font-size: var(--t-sm); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
details.cx--sec > .cx__sec { padding: 0 12px 12px; display: grid; gap: 10px; }
.cx__extra { display: flex; justify-content: flex-end; }
.cx__busca { width: 100%; }

/* progresso da venda */
.etapas { display: flex; gap: 4px; margin: 6px 0 2px; max-width: 160px; }
.etapas span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.etapas span.on { background: var(--accent, var(--s1)); }

/* QR do autenticador */
.qr-box { display: flex; justify-content: center; padding: 12px; margin: 6px 0 10px; background: #fff; border-radius: 12px; }
.qr-img { width: 220px; height: 220px; image-rendering: pixelated; }
.chave-totp { display: block; font-family: var(--mono, monospace); font-size: var(--t-sm); word-break: break-all; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; user-select: all; }

/* login */
.login__senha { position: relative; }
.login__senha .input { padding-right: 84px; }
.login__ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--accent, inherit); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer; border-radius: 8px; }
.login__ver:focus-visible { outline: 2px solid var(--accent, currentColor); }
.login__manter { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: var(--t-sm); cursor: pointer; min-height: 44px; }
.login__manter input { width: 20px; height: 20px; }
