/* o atributo hidden sempre esconde, mesmo em elementos com display próprio (ex.: .field é flex) */
[hidden] { display: none !important; }

/* Finapp — sistema visual
   Mobile-first: estilos base para celular; o layout de computador entra em @media (min-width: 960px).
   Princípios: bordas finas no lugar de sombras; números tabulares; uma única peça de destaque (a balança do mês). */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --abyss: #070b14;        /* fundo */
  --navy: #0b1220;         /* menu lateral, barras */
  --surface: #111a2a;      /* painéis */
  --raised: #182236;       /* campos, linhas em foco */
  --line: #222d43;         /* bordas */
  --line-strong: #2f3c57;
  --text: #e7ebf3;
  --muted: #8b95aa;
  --faint: #5d6880;
  --pos: #3dd68c;          /* resultado positivo */
  --pos-soft: rgba(61, 214, 140, .12);
  --neg: #f0616d;          /* resultado negativo */
  --neg-soft: rgba(240, 97, 109, .12);
  --info: #5b8def;         /* informação, ação principal */
  --info-soft: rgba(91, 141, 239, .14);
  --warn: #e8b04b;
  --warn-soft: rgba(232, 176, 75, .13);
  --violet: #9b8cf2;
  --r-panel: 14px;
  --r-ctl: 9px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Display", var(--font);
  --nums: "tnum" 1, "zero" 1, "ss01" 1, "cv11" 1;
  --side: 248px;
  --tabbar: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--abyss); color: var(--text); }
body {
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 500; }
p { margin: 0; }
.num, .money { font-feature-settings: var(--nums); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.info { color: var(--info); }
.warn { color: var(--warn); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ estrutura */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.main { padding: 16px 16px 32px; max-width: 1240px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(7, 11, 20, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.topbar .spacer { flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 8px 0 18px; }
.page-head .grow { flex: 1 1 220px; }
.page-head p { margin-top: 4px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 18, 32, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; text-decoration: none;
}
.tabbar a.active { color: var(--text); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar .fab {
  align-self: center; justify-self: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--info); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer;
}
.tabbar .fab svg { width: 24px; height: 24px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-ctl);
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav-list a svg { width: 19px; height: 19px; flex: none; }
.nav-list a:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.nav-list a.active { color: var(--text); background: var(--raised); }
.nav-list a.active svg { color: var(--info); }

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .tabbar, .topbar .mobile-only { display: none; }
  .shell { display: grid; grid-template-columns: var(--side) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
    padding: 22px 14px; background: var(--navy); border-right: 1px solid var(--line);
  }
  .sidebar .brand { font-family: var(--display); font-weight: 600; font-size: 19px; padding: 2px 12px 8px; letter-spacing: -0.02em; }
  .sidebar .brand .mark { color: var(--info); }
  .sidebar .foot { margin-top: auto; padding: 0 12px; }
  .topbar { display: none; }
  .main { padding: 22px 28px 48px; }
  h1 { font-size: 28px; }
}

/* ------------------------------------------------------------------ painéis */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px; }
:not(.grid-2):not(.grid-3):not(.grid-4):not(.stack) > .panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* KPI: rótulo em caixa normal, valor grande, variação discreta */
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-family: var(--display); font-size: 22px; font-weight: 600; margin-top: 4px; font-feature-settings: var(--nums); }
.kpi .delta { font-size: 12px; margin-top: 2px; color: var(--muted); }
.delta .up { color: var(--pos); } .delta .down { color: var(--neg); }

/* ---------------------------------------------- a balança do mês (destaque) */
.beam { padding: 20px; position: relative; overflow: hidden; }
.beam .result-label { color: var(--muted); font-size: 14px; }
.beam .result {
  font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1.05; letter-spacing: -0.03em;
  font-feature-settings: var(--nums); margin: 6px 0 4px;
}
.beam .sub { color: var(--muted); font-size: 13px; }
.beam .bars { margin-top: 20px; display: grid; gap: 10px; }
.beam .bar-row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.beam .track { height: 10px; background: var(--raised); border-radius: 6px; overflow: hidden; }
.beam .fill { height: 100%; border-radius: 6px; transform-origin: left; animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.beam .fill.in { background: var(--pos); }
.beam .fill.out { background: var(--neg); }
.beam .rate { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; }
@media (min-width: 640px) { .beam .rate { position: absolute; right: 24px; top: 22px; margin: 0; display: block; text-align: right; } }
.beam .rate .v { font-family: var(--display); font-size: 22px; font-weight: 600; font-feature-settings: var(--nums); }
@media (min-width: 960px) { .beam .result { font-size: 56px; } .beam { padding: 26px 28px; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--raised); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #3d4c6b; text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--info); border-color: var(--info); color: #fff; }
.btn.primary:hover { background: #6b99f2; }
.btn.danger { background: transparent; border-color: rgba(240, 97, 109, .5); color: var(--neg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 38px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--raised); color: var(--text); border-color: var(--line-strong); }

.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--navy); border: 1px solid var(--line); border-radius: 11px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--raised); color: var(--text); }
.seg button.on.t-expense { color: var(--neg); } .seg button.on.t-income { color: var(--pos); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  height: 42px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--navy); color: var(--text); width: 100%; min-width: 0;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--info); outline: none; box-shadow: 0 0 0 3px var(--info-soft); }
.input.money-big {
  height: 60px; font-family: var(--display); font-size: 30px; font-weight: 600; font-feature-settings: var(--nums);
}
.input.compact { height: 34px; font-size: 13px; padding: 0 8px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
/* campos de data/mês: o Safari do iPhone desenha do jeito dele (texto centralizado, altura própria, largura que
   vaza); aqui ficam iguais aos outros campos */
input.input[type="date"], input.input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0;
  height: 42px; line-height: 40px; text-align: left;
}
input.input[type="date"]::-webkit-date-and-time-value, input.input[type="month"]::-webkit-date-and-time-value {
  text-align: left; margin: 0; min-height: 0;
}
input.input[type="date"]::-webkit-datetime-edit, input.input[type="month"]::-webkit-datetime-edit { padding: 0; }
.form-grid > *, .field { min-width: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--info); }
.search { position: relative; flex: 1 1 200px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: var(--faint); }
.search .input { padding-left: 36px; }
.row > select.input, .row > input.input[type=date] { width: auto; flex: 1 1 150px; }

/* ------------------------------------------------------------- listas e tabelas */
.list { display: flex; flex-direction: column; }
.item {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 11px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: rgba(255, 255, 255, .015); }
.item .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.item .ico svg { width: 18px; height: 18px; }
.item .ico.in { color: var(--pos); background: var(--pos-soft); }
.item .ico.out { color: var(--neg); background: var(--neg-soft); }
.item .ico.mv { color: var(--info); background: var(--info-soft); }
.item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amt { text-align: right; font-weight: 600; font-feature-settings: var(--nums); }
.item .amt .s { font-weight: 400; }
.day-head { padding: 14px 4px 6px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }

.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.r, table.data th.r { text-align: right; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); }
table.data tr.clickable { cursor: pointer; } table.data tr.clickable:hover td { background: rgba(255, 255, 255, .015); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 500; background: var(--raised); color: var(--muted); white-space: nowrap;
}
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.meter { height: 8px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 5px; background: var(--info); }
.meter.ok > i { background: var(--pos); } .meter.warning > i { background: var(--warn); } .meter.over > i { background: var(--neg); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 16px; }
.empty .btn { margin-top: 14px; }
.skeleton { background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.alert-row:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--warn); }
.dot.danger { background: var(--neg); }

/* --------------------------------------------------------- folha (modal / bottom sheet) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(3, 6, 12, .66); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet .sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet .sheet-head h2 { flex: 1; font-size: 19px; }
/* abas do formulário (Despesa · Receita · Transferência · Cartão) presas no topo da folha ao rolar */
.sheet .sheet-tabs {
  position: sticky; top: -18px; z-index: 3; background: var(--surface);
  margin: 0 -16px; padding: 6px 16px 10px; border-bottom: 1px solid transparent;
}
@media (min-width: 720px) { .sheet .sheet-tabs { top: -22px; margin: 0 -24px; padding: 6px 24px 10px; } }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.sheet .actions .btn { flex: 1 1 auto; }
.sheet .actions.sticky-actions {
  --pad: calc(18px + env(safe-area-inset-bottom));
  position: sticky; bottom: calc(-1 * var(--pad)); background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 0 var(--pad); margin-bottom: calc(-1 * var(--pad));
}
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { width: min(620px, 94vw); border-radius: 18px; padding: 22px 24px; }
  .sheet.wide { width: min(980px, 96vw); }
  .sheet .actions .btn { flex: none; }
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(440px, 92vw); }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { background: var(--raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--pos); border-radius: 10px; padding: 11px 14px; font-size: 14px; animation: up .2s ease; }
.toast.error { border-left-color: var(--neg); }
.toast.warn { border-left-color: var(--warn); }

/* ------------------------------------------------------------------ gráficos */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { fill: var(--faint); font-size: 11px; font-feature-settings: var(--nums); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--abyss); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 5;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.donut-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; }
@media (min-width: 640px) { .donut-wrap { grid-template-columns: 180px 1fr; } }
.share-list { display: flex; flex-direction: column; gap: 9px; }
.share-list .r { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.share-list .r i { width: 10px; height: 10px; border-radius: 3px; }
.share-list .r .p { color: var(--muted); width: 48px; text-align: right; font-feature-settings: var(--nums); }

/* ------------------------------------------------------------------ cartões de crédito */
.credit {
  padding: 18px; border-radius: 16px; border: 1px solid var(--line-strong); cursor: pointer;
  background: radial-gradient(120% 140% at 100% 0%, rgba(91, 141, 239, .18), transparent 55%), var(--surface);
}
.credit .nm { font-family: var(--display); font-weight: 600; font-size: 18px; }
.credit .inv { font-family: var(--display); font-size: 28px; font-weight: 600; font-feature-settings: var(--nums); margin: 14px 0 2px; }

/* ------------------------------------------------------------------ importação */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel); padding: 28px 16px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--navy); display: block; width: 100%; box-sizing: border-box;
}
.drop.over { border-color: var(--info); background: var(--info-soft); color: var(--text); }
.drop strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 16px; }
.imp-line { border-bottom: 1px solid var(--line); padding: 12px 2px; display: grid; gap: 8px; }
.imp-line.review { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
.imp-line .top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.imp-line .why { font-size: 12.5px; color: var(--warn); }
.imp-line .controls { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
@media (min-width: 960px) { .imp-line .controls { grid-template-columns: 140px 1fr 1fr auto; align-items: center; } }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .box { width: min(400px, 100%); }
.auth .logo { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth .logo .mark { color: var(--info); }

.loading-screen { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-feature-settings: var(--nums); }

/* aviso enquanto o servidor acorda (primeira abertura depois de um tempo parado) */
.waking { position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 90;
  margin: 0 auto; width: fit-content; max-width: 520px; text-align: center; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: var(--panel, #111827); color: var(--text, #e5e7eb); border: 1px solid var(--line, #263042);
  box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: waking-in .2s ease-out; }
@keyframes waking-in { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------------------ celular (até 959px)
   - campos com 16px: abaixo disso o Safari do iPhone dá zoom sozinho ao tocar no campo;
   - textos pequenos 1px maiores (aprovado em 19/11/2026);
   - filtros de período vão até a borda da tela, deixando aparecer a "beirinha" do próximo. */
@media (max-width: 959.98px) {
  /* sem zoom de pinça: o menu de baixo fica sempre na tela (rolagem continua normal) */
  html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .input, select.input, textarea.input, .input.compact { font-size: 16px; }
  .tabbar a { font-size: 12px; }
  .small { font-size: 14px; } .tiny { font-size: 13px; }
  .kpi .label { font-size: 14px; } .kpi .delta { font-size: 13px; }
  .beam .sub, .beam .bar-row { font-size: 14px; } .beam .result-label { font-size: 15px; }
  .field > span { font-size: 14px; }
  .chip, .seg button { font-size: 14px; }
  .item .s, table.data th, .legend { font-size: 13.5px; }
  .chips.bleed { margin-right: -16px; padding-right: 16px; }
  .chips.bleed .chip { padding: 0 11px; }
}
