/* YenNote – sistema visual (mesmo padrão do protótipo) */
:root {
  --ink: #14202E;
  --ground: #F5F4EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --line: #E3E1D9;
  --line-2: #EEECE6;
  --border: #D4D1C7;
  --muted: #5A6472;
  --muted-2: #4A5563;
  --accent: #B8432A;
  --accent-dark: #9A3620;
  --slate: #2F5D8A;
  --dark-muted: #C3CAD3;
  --dark-line: #34435A;
  --blue-bg: #E8EEF5;
  --blue-fg: #1F3F60;
  --green-bg: #E4EEE8;
  --green-fg: #1E4A36;
  --green: #2E6B4F;
  --orange-bg: #FBEFE3;
  --orange-fg: #6B3A12;
  --dashed: #9AA3AE;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --serif: 'Source Serif 4', Georgia, serif;
  --jp: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  --tabbar-h: 72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.4; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ground); }
@media (min-width: 600px) {
  body { background: #E9E7E0; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* Estrutura */
.screen { flex: 1; display: flex; flex-direction: column; }
.content { flex: 1; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.has-tabbar .content { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 24px 20px 12px; }
.topbar .titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar.sub { justify-content: flex-start; padding: 20px 12px 8px; }
.topbar.sub .actions { margin-left: auto; }
.topbar .actions { display: flex; gap: 4px; align-items: center; }
.eyebrow { font-size: 13px; color: var(--muted); }
.month-label { display: inline-block; font-size: 17px; font-weight: 600; color: var(--ink); }
.month-label::first-letter, .cap::first-letter { text-transform: uppercase; }
.title { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.2; }
.topbar.sub .title { font-size: 22px; }

.icon-btn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--ink); border-radius: 12px; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
/* Ícone com o nome embaixo (ex.: engrenagem + "Ajustes") */
.icon-btn.labeled { width: auto; height: auto; min-width: 48px; min-height: 44px; padding: 2px 6px; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted-2); }
.icon-btn.labeled:hover { color: var(--ink); }
.icon-btn.labeled + .add-btn { margin-left: 10px; } /* um respiro entre "Ajustes" e o botão laranja */
/* Botão de voltar: seta com haste, dentro de um círculo (diferente das setas de trocar mês) */
.back-btn { width: 40px; height: 40px; margin: 2px 4px 2px 0; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 32, 46, 0.06); }
.back-btn:hover { background: var(--surface); border-color: var(--ink); }
.icon-btn.primary {background: var(--accent); color: #fff; }
.icon-btn.primary:hover { background: var(--accent-dark); color: #fff; }
.add-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.add-btn:hover { background: var(--accent-dark); color: #fff; }

/* Cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.list { padding: 0 14px; gap: 0; }
/* Cartão inteiro clicável */
.card-link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color 0.15s; }
.card-link:hover { color: inherit; border-color: var(--ink); }
.card-link .link { text-decoration: underline; }
.card.dark { background: var(--ink); color: var(--ground); border: none; border-radius: 16px; padding: 20px; gap: 14px; }
.card.dark a { color: var(--ground); }
.card.accent-border { border: 2px solid var(--accent); }

/* Topo do Painel e da aba Gastos: título grande + botão; o mês num seletor logo abaixo */
.title.big { font-size: 30px; }
.add-btn.sm { min-height: 36px; padding: 0 12px 0 9px; font-size: 13.5px; border-radius: 10px; }
.month-pill-wrap { padding: 0 20px 4px; display: flex; flex-direction: column; gap: 8px; }
.month-pill { display: flex; align-items: center; justify-content: space-between; background: var(--line-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.month-pill a { width: 40px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); text-decoration: none; }
.month-pill a:hover { background: rgba(20, 32, 46, 0.07); color: var(--ink); }
.month-pill span { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink); padding: 8px 0; }
.ms-today { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: var(--line-2); color: var(--muted-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ms-today:hover { color: var(--ink); }
@media (max-width: 360px) { .month-pill-wrap { padding-left: 16px; padding-right: 16px; } .title.big { font-size: 26px; } }

/* Aba Gastos: resumo escuro, atalhos e cartões reorganizáveis */
.g-content { gap: 16px; }
#cards { display: flex; flex-direction: column; gap: 16px; }
.gcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.gcard h2 { margin: 0; font-size: 16px; font-weight: 600; }
.gcard .sub { margin: -8px 0 0; font-size: 12.5px; color: var(--muted); }
.ghead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ghead h2 { flex: 1; min-width: 0; }
.grip, .gcard .mv { display: none; }
.organizing .ghead .link { display: none; }
.organizing .grip { display: inline-flex; width: 36px; height: 36px; margin: -8px -8px -8px 0; align-items: center; justify-content: center; color: var(--muted); font-size: 20px; cursor: grab; touch-action: none; border-radius: 8px; }
.organizing .gcard .mv { display: inline-flex; gap: 4px; }
.gcard .mv button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; }
.gcard .mv button:disabled { opacity: 0.3; cursor: default; }
.organizing .gcard { border-style: dashed; border-color: var(--border); }
.organizing .gcard > :not(.ghead) { display: none; }
.gcard.dragging { z-index: 5; box-shadow: 0 18px 36px -14px rgba(20, 32, 46, 0.45); border-style: solid !important; border-color: var(--accent) !important; }
.org-btn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-end; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted-2); font: 600 12.5px var(--sans); cursor: pointer; margin-bottom: -6px; }
.organizing .org-btn { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.org-hint { display: none; font-size: 12.5px; color: var(--muted); text-align: center; margin: -6px 0 0; }
.organizing .org-hint { display: block; }

.hero-g { background: var(--ink); color: var(--ground); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.hero-g .muted { color: var(--dark-muted); }
.hero-g .big-num { font-size: 36px; }
.hero-bar { height: 10px; border-radius: 6px; background: var(--dark-line); overflow: hidden; display: flex; }
.hero-bar i { display: block; height: 100%; }
.legend-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dark-muted); }
.legend-row b { color: var(--ground); font-family: var(--mono); font-weight: 500; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--muted-2); font-size: 12px; text-align: center; }
.quick a:hover { border-color: var(--ink); color: var(--ink); }
.quick a svg { color: var(--accent); }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.leg { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.leg div { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 7px; align-items: center; font-size: 13px; }
.leg div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg div b { grid-column: 2; font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.leg i { width: 10px; height: 10px; border-radius: 3px; }
.leg small { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 4px; }
/* Legenda das categorias: nome, valor e porcentagem em colunas alinhadas */
.cat-list { width: 100%; display: flex; flex-direction: column; }
.cat-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.cat-row:last-child { border-bottom: none; padding-bottom: 0; }
.cat-row i { width: 10px; height: 10px; border-radius: 3px; }
.cat-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .v { font-family: var(--mono); font-size: 13.5px; font-weight: 500; text-align: right; }
.cat-row .p { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; background: var(--line-2); border-radius: 6px; padding: 2px 0; text-align: center; }
/* Ritmo do mês: resumo dos dois meses acima do gráfico */
.rt-stats { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.rt-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-stats span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rt-stats span i { width: 10px; height: 4px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.rt-stats b { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.rt-stats .pill { align-self: center; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted-2); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }

.sb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.sb-month { font-size: 12.5px; color: var(--muted); }
.sb-val { font-family: var(--mono); font-size: 24px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.sb-cmp { font-size: 12px; color: var(--muted); text-align: right; }
.sb-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sb-foot div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.sb-foot span { font-size: 11.5px; color: var(--muted); }
.sb-foot b { font-family: var(--mono); font-size: 15px; font-weight: 500; }

.cv-total { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.cv-total .m { display: flex; flex-direction: column; gap: 2px; }
.cv-total .m:last-child { text-align: right; }
.cv-total .m span { font-size: 12px; color: var(--muted); }
.cv-total .m b { font-family: var(--mono); font-size: 17px; font-weight: 500; }
.cv-total .m:last-child b { color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.up { background: var(--orange-bg); color: var(--accent); }
.pill.down { background: var(--green-bg); color: var(--green); }
.cv-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted-2); }
.cv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cv-legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.cv-row { display: flex; flex-direction: column; gap: 5px; }
.cv-row .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.cv-row .top b { font-weight: 600; }
.cv-bars { display: grid; grid-template-columns: minmax(0, 1fr) 70px; row-gap: 3px; column-gap: 8px; align-items: center; }
.cv-bars .b { height: 9px; border-radius: 5px; min-width: 2px; }
.cv-bars .b.prev { background: var(--border); }
.cv-bars .b.cur { background: var(--accent); }
.cv-bars .v { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; }
.cv-bars .v.cur { color: var(--ink); font-weight: 500; }
.stack-bar { height: 14px; border-radius: 7px; overflow: hidden; display: flex; background: var(--line-2); }
.stack-bar i { display: block; height: 100%; }

/* Painel: valor aproximado em reais embaixo do saldo e do líquido */
.brl-approx { font-family: var(--mono); font-size: 12px; color: var(--dark-muted); margin-top: 2px; }
.big-num + .brl-approx { font-size: 13.5px; }

/* Painel: cotação do dia, discreta, entre o título e o seletor de mês (abre o conversor) */
.fx-wrap { padding: 0 20px 10px; margin-top: -4px; }
.fx-strip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 5px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line); color: var(--muted-2); text-decoration: none; font-size: 12px; }
.fx-strip:hover { color: var(--ink); border-color: var(--border); }
.fx-strip-ico { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--muted-2); flex-shrink: 0; }
.fx-strip-t { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.fx-strip-t b { font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.fx-strip-l { font-size: 11px; opacity: 0.8; }
.fx-strip-go { font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 360px) { .fx-wrap { padding-left: 16px; padding-right: 16px; } }

/* Painel: atalho para a calculadora (ela saiu da barra de baixo na versão Premium) */
.calc-link { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.calc-link > svg { color: var(--accent); flex-shrink: 0; }
.calc-link .stack { flex: 1; min-width: 0; }
.calc-link b { font-size: 15px; }

/* Painel: cartão de gastos, com o mesmo peso do cartão do holerite */
.spend-card { border-radius: 16px; padding: 20px; gap: 14px; border: 1px solid var(--border); box-shadow: 0 10px 24px -18px rgba(20, 32, 46, 0.45); }
.spend-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.spend-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--orange-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.spend-card .mid-num { margin-top: 4px; }
.spend-cats { text-decoration: none; color: inherit; padding-top: 12px; border-top: 1px solid var(--line-2); }
.spend-cats:hover { color: inherit; }
.spend-links { display: flex; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: -4px; }
.spend-links a { color: var(--muted-2); font-weight: 500; }
.dark .muted { color: var(--dark-muted); }
.dark .divider { border-top: 1px solid var(--dark-line); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: var(--mono); }
.jp { font-family: var(--jp); }
.strong { font-weight: 600; }
.big-num { font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.mid-num { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cols { display: flex; gap: 12px; }
.cols > * { flex: 1 1 0; min-width: 0; }
.pos { color: var(--green); }

/* Seções */
.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-head .jp { font-size: 13px; color: var(--muted); }
.subtotal { display: flex; justify-content: space-between; padding: 0 4px; font-size: 14px; }
.subtotal .mono { font-weight: 500; }

/* Seções do holerite: cabeçalho com total à direita e divisória entre seções */
.sheet-section { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sheet-head .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.2; }
.sheet-head .t .jp { font-size: 12px; color: var(--muted); }
.sheet-head .total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.sheet-head .total .mono { font-size: 17px; font-weight: 500; }

#pay-check:empty, #resident-warning:empty { display: none; }

/* Campos que mudam todo mês e ainda estão vazios */
.money.todo { border: 1.5px dashed var(--accent); background: var(--surface); }
.hour-box input::placeholder { color: var(--dashed); }
.money::placeholder, .hour-box.todo input::placeholder { color: var(--accent); font-family: var(--sans); font-size: 13px; opacity: 0.85; }
.hour-box.todo { border: 1.5px dashed var(--accent); }.prev { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Itens iguais ao mês passado (recolhidos) */
.stable-card > summary { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0; cursor: pointer; list-style: none; }
.stable-card > summary::-webkit-details-marker { display: none; }
.stable-card > summary .stack { flex: 1; min-width: 0; }
.stable-card > summary b { font-size: 14px; font-weight: 600; }
.stable-card > summary .names { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stable-card > summary .toggle { display: inline-flex; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 999px; background: var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.stable-card > summary .toggle::before { content: 'Ver'; }
.stable-card[open] > summary .toggle::before { content: 'Fechar'; }
.stable-card[open] > summary .toggle svg { transform: rotate(180deg); }
.stable-card[open] > summary { border-bottom: 1px solid var(--line-2); }

/* Linhas de holerite */
.row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: none; }
.row .label { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row .kanji { font-family: var(--jp); font-size: 16px; font-weight: 700; }
.row .name { font-size: 15px; font-weight: 500; }
.row .pt { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--blue-fg); background: var(--blue-bg); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; font-family: var(--sans); }
.help { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; cursor: pointer; flex-shrink: 0; }
.help:hover { border-color: var(--ink); color: var(--ink); }
.hint { font-size: 12px; line-height: 1.45; color: var(--blue-fg); background: var(--blue-bg); border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; }

/* Campos */
.money { width: 116px; height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; text-align: right; font-family: var(--mono); font-size: 15px; background: var(--surface-2); flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted-2); }
.field .help-text { font-weight: 400; color: var(--muted); }
.input { height: 48px; width: 100%; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-family: var(--sans); font-size: 16px; color: var(--ink); }
.input.mono { font-family: var(--mono); }
select.input { padding: 0 12px; }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.money:focus, .input:focus, .hour-box input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); background: var(--surface); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hour-box { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hour-box .top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.hour-box .top .jp { white-space: nowrap; flex-shrink: 0; }
.hour-box input { height: 34px; width: 100%; border: none; padding: 0; background: transparent; font-family: var(--mono); font-size: 17px; border-radius: 4px; }
.hour-box:focus-within { border-color: var(--accent); }
.rate-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; cursor: text; }
.rate-card:focus-within { border-color: var(--accent); }
.rate-input { display: flex; align-items: center; gap: 4px; width: 128px; height: 48px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); flex-shrink: 0; }
.rate-input span { font-family: var(--mono); font-size: 16px; color: var(--muted); }
.rate-input input { width: 100%; min-width: 0; border: none; background: transparent; font-family: var(--mono); font-size: 20px; font-weight: 500; text-align: right; color: var(--ink); outline: none; }
.switch-row {display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.mini-toggle { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: var(--muted-2); cursor: pointer; }
.mini-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }

/* Botões */
.btn { min-height: 52px; width: 100%; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-family: var(--sans); font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 0 16px; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }
.btn.secondary:hover { background: var(--line-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); min-height: 48px; font-size: 15px; }
.btn.ghost:hover { background: var(--orange-bg); color: var(--accent-dark); }
.btn.small { min-height: 44px; width: auto; font-size: 14px; padding: 0 14px; border-radius: 10px; }
/* Botão secundário sobre fundo escuro (cartões .dark). Vem depois de .btn.small para valer a altura menor. */
.btn.on-dark { min-height: 36px; background: transparent; color: var(--ground); border: 1px solid var(--dark-line); }
.btn.on-dark:hover { background: rgba(245, 244, 239, 0.1); color: var(--ground); border-color: var(--dark-muted); }
.btn.on-dark:disabled { opacity: 0.6; cursor: default; }
.btn-dashed { min-height: 44px; border: 1.5px dashed var(--dashed); border-radius: 12px; background: transparent; color: var(--ink); font-family: var(--sans); font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; padding: 0 12px; }
.btn-dashed:hover { border-color: var(--ink); color: var(--ink); }
.link { color: var(--ink); font-size: 13px; font-weight: 600; }
.link-blue { color: var(--blue-fg); font-size: 14px; font-weight: 600; text-decoration: none; }

/* Avisos */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.note svg { flex-shrink: 0; margin-top: 1px; }
.note.blue { background: var(--blue-bg); color: var(--blue-fg); }
.note.green { background: var(--green-bg); color: var(--green-fg); }
.note.orange { background: var(--orange-bg); color: var(--orange-fg); }
.dark .note.green { background: #1E3A2E; color: #CFE8DA; }
.dark .note.orange { background: #4A3320; color: #F6D9BD; }
.dark .note.blue { background: #22344A; color: #D6E2EF; }

.banner { padding: 14px; font-size: 14px; }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-actions .btn.small { min-height: 40px; font-size: 13px; }
.note.blue .btn.ghost, .note.orange .btn.ghost { color: inherit; border-color: currentColor; background: transparent; }
.note.blue .btn.ghost:hover, .note.orange .btn.ghost:hover { color: inherit; background: rgba(20, 32, 46, 0.07); }

/* Barras */
.bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.bar > i.over { background: var(--accent); }
.bar.lg { height: 8px; }

/* Barra de navegação */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; justify-content: space-around; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 10; }
.tab { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab:hover { color: var(--ink); }

/* Abas */
.segmented { display: flex; background: var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented a { flex: 1; text-align: center; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--muted-2); }
.segmented a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 32, 46, 0.08); }

/* Opções (rádio grande) */
.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.option:has(input:checked) { border: 2px solid var(--accent); padding: 13px 15px; }
.option input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.option .body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option .body b { font-size: 16px; font-weight: 600; }
.option .body span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.option .jp { font-size: 18px; font-weight: 700; }
fieldset { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { padding: 0 0 10px; font-size: 15px; font-weight: 600; }

/* Lista de marcar (catálogo) */
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.check-row:last-child { border-bottom: none; }
.check-row input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check-row .kanji { font-family: var(--jp); font-size: 18px; font-weight: 700; }
.check-row .pt { font-size: 14px; font-weight: 500; }
.check-row .aka { font-size: 12px; color: var(--muted); }
details.more > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--blue-fg); font-size: 14px; font-weight: 600; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary svg { transform: rotate(180deg); }

.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* Listas */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { color: inherit; background: var(--surface-2); }
.list-item .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-item .main b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .main span { font-size: 12px; color: var(--muted); }
.list-item .amt { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--mono); font-size: 14px; }
.date-badge { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.date-badge b { font-size: 17px; font-weight: 600; }
.date-badge span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.empty { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Valor grande (gasto rápido) */
.amount-field { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.amount-field:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.amount-field span { font-family: var(--mono); font-size: 26px; color: var(--muted); }
.amount-field input.amount { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; font-family: var(--mono); font-size: 30px; font-weight: 500; color: var(--ink); outline: none; }

/* Categorias em botões (um toque) */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 48px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Página da versão completa */
.yen-approx { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--dark-muted); white-space: nowrap; }
.save-tag {font-size: 12px; font-weight: 700; color: var(--ink); background: #E9C46A; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand img { border-radius: 9px; display: block; }
.brand.sm { gap: 9px; font-size: 24px; }
.brand.sm img { width: 34px; height: 34px; border-radius: 8px; }
.topbar.compact { padding-top: 16px; padding-bottom: 4px; }
/* Logo e botão laranja alinhados com a engrenagem (a palavra "Ajustes" fica embaixo, como legenda) */
.topbar.compact, .topbar.compact .actions { align-items: flex-start; }
.topbar.compact .brand { margin-top: -4px; }
.topbar.compact .pro-pill { margin-top: 1px; }
.segmented.sm { padding: 3px; }
.segmented.sm a { padding: 7px; font-size: 13px; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
/* Símbolo fixo dentro do campo (ex.: ¥), sem mudar o tamanho do campo */
.input-prefix { position: relative; display: block; }
.input-prefix > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 16px; font-weight: 400; color: var(--muted); pointer-events: none; }
.grid3 .input-prefix .input { padding-left: 26px; }
@media (max-width: 360px) { .jp-opt { display: none; } }
/* "h" pequeno logo depois do número: uma cópia invisível do número empurra o "h" para o lugar certo */
.input-unit { position: relative; display: block; }
.input-unit .input { padding-right: 24px; }
.input-unit .ghost { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 16px; white-space: pre; pointer-events: none; }
.grid3 .input-unit .ghost { left: 11px; }
.input-unit .ghost .val { visibility: hidden; }
.input-unit .ghost .unit { margin-left: 2px; font-size: 12px; color: var(--muted); }
.input-unit .ghost .val:empty + .unit { display: none; }
.grid3 .input { padding: 0 10px; }
.grid3 .field { white-space: nowrap; }
.more-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.more-toggle:hover { color: var(--accent); }
.upsell-card { border: 1px dashed var(--accent); }

/* ── Página Premium (vendas) ── */
.pv-hero { background: var(--ink); color: var(--ground); padding: 18px 20px 28px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.pv-hero-top { display: flex; align-items: center; justify-content: space-between; }
.pv-hero .brand { color: var(--ground); font-size: 21px; }
.pv-hero .brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px var(--dark-line); }
.pv-hero .icon-btn.labeled { color: var(--dark-muted); }
.pv-hero .icon-btn.labeled:hover { color: var(--ground); background: rgba(245, 244, 239, 0.12); }
.pv-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #E9C46A; color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pv-hero h1 { margin: 0; font-family: var(--serif); font-size: 31px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.pv-hero h1 .hl { color: #F4A582; }
.pv-hero p { margin: 0; color: var(--dark-muted); line-height: 1.55; font-size: 15px; }
.pv-hero p b { color: var(--ground); }
.pv-moments { display: flex; flex-direction: column; gap: 8px; }
.pv-hero .btn { min-height: 54px; font-size: 17px; }
.pv-from { text-align: center; font-size: 13px; line-height: 1.5; color: var(--dark-muted); margin-top: -6px; }
.pv-from b { color: var(--ground); }
.pv-yen { font-family: var(--mono); font-size: 12px; }
/* Prévia no topo: gráfico de gastos + conferência do holerite (exemplo) */
.pv-peek { position: relative; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.pv-peek-tag { position: absolute; top: -9px; right: 12px; background: #E9C46A; color: var(--ink); border-radius: 999px; padding: 1px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pv-peek-row { display: flex; align-items: center; gap: 14px; }
.pv-peek-row svg { flex-shrink: 0; }
.pv-peek-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pv-peek-info > b { font-size: 14px; }
.pv-peek-info ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pv-peek-info li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 7px; align-items: center; font-size: 12.5px; color: var(--muted-2); }
.pv-peek-info li i { width: 10px; height: 10px; border-radius: 3px; }
.pv-peek-info li span { line-height: 1.3; }
.pv-peek-info li b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.pv-peek-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: var(--orange-bg); color: var(--orange-fg); font-size: 12.5px; }
.pv-peek-check svg { flex-shrink: 0; }
@media (max-width: 360px) { .pv-hero h1 { font-size: 27px; } }

.pv-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 18px 16px 4px; }
.pv-trust div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11.5px; line-height: 1.3; color: var(--muted-2); }
.pv-trust svg { color: var(--green); background: var(--green-bg); border-radius: 10px; padding: 7px; width: 34px; height: 34px; }

.pv-sec { padding: 26px 20px 0; display: flex; flex-direction: column; gap: 12px; }.pv-sec > h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.pv-sub { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 360px) { .pv-sec { padding-left: 16px; padding-right: 16px; } }

.pv-carousel { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; overflow-y: hidden; transition: height 0.25s ease; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 2px 20px 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
.pv-carousel::-webkit-scrollbar { display: none; }
.pv-slide { flex: 0 0 84%; scroll-snap-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pv-n { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.pv-t { font-size: 17px; line-height: 1.3; }
.pv-slide p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted-2); }
.pv-mock { margin-top: 4px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.pv-mock::before { content: 'exemplo'; position: absolute; top: -9px; right: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
/* Exemplo "Lançar o holerite é rápido": caixas de horas + pagamentos preenchidos */
.pv-hb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pv-hb-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.pv-hb-box span { font-size: 11px; font-weight: 600; color: var(--muted-2); }
.pv-hb-box b { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.pv-hb-box small { font-size: 10px; color: var(--muted); margin-left: 1px; }
.pv-hb-rows { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; }
.pv-hb-auto, .pv-hb-fixed { font-family: var(--mono); font-size: 13px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.pv-hb-auto { background: #EAF3EE; color: var(--green-fg); border: 1px solid #CFE3D7; }
.pv-hb-fixed { background: var(--blue-bg); color: var(--blue-fg); border: 1px solid #D3DEEA; }
.pv-hb-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted-2); }
.pv-hb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pv-hb-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pv-hb-legend i.a { background: #EAF3EE; border: 1px solid #A9CDB8; }
.pv-hb-legend i.f { background: var(--blue-bg); border: 1px solid #B5C8DC; }
.pv-dots { display: flex; justify-content: center; gap: 2px; }
.pv-dots button { width: 22px; height: 22px; padding: 0; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pv-dots button::before { content: ''; width: 7px; height: 7px; border-radius: 4px; background: var(--border); transition: width 0.2s, background 0.2s; }
.pv-dots button.on::before { width: 20px; background: var(--accent); }
.pv-dots button.on { width: 32px; }

/* Setas do carrossel: só em aparelhos com mouse (no celular basta arrastar com o dedo) */
.pv-car-wrap { position: relative; }
.pv-arrow { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 6px 16px -8px rgba(20, 32, 46, 0.45); }
.pv-arrow:hover:not(:disabled) { border-color: var(--ink); }
.pv-arrow:disabled { opacity: 0; pointer-events: none; }
.pv-arrow.prev { left: -6px; }
.pv-arrow.next { right: -6px; }
.pv-carousel.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.mouse-only { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pv-arrow { display: flex; }
  .pv-carousel { cursor: grab; }
  .touch-only { display: none; }
  .mouse-only { display: inline; }
}

.pv-compare { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pv-head, .pv-r { display: grid; grid-template-columns: minmax(0, 1fr) 50px 64px; align-items: stretch; }
.pv-head > span, .pv-r > span { padding: 11px 0; }
.pv-head > span:first-child, .pv-r > span:first-child { padding-left: 14px; padding-right: 6px; }
.pv-head { background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.pv-head > span:nth-child(n+2), .pv-r > span:nth-child(n+2) { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); }
.pv-head > span:last-child { color: var(--accent); }
.pv-r { border-bottom: 1px solid var(--line-2); }
.pv-r:last-child { border-bottom: none; }
.pv-r b { display: block; font-size: 14px; }
.pv-r small { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 2px; }
.pv-r > span:last-child, .pv-head > span:last-child { background: rgba(184, 67, 42, 0.05); }
.pv-yes { color: var(--green); font-weight: 700; }
.pv-no { color: var(--border); }

.pv-plans { display: grid; gap: 12px; padding-top: 6px; }
.pv-plan { position: relative; display: flex; gap: 12px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; cursor: pointer; }
.pv-plan:has(input:checked) { border: 2px solid var(--accent); padding: 15px; box-shadow: 0 10px 24px -16px rgba(184, 67, 42, 0.7); }
.pv-plan input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.pv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-info b { font-size: 16px; }
.pv-info span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.pv-price { text-align: right; display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.pv-price b { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.pv-price span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pv-badge { position: absolute; top: -10px; left: 16px; background: #E9C46A; color: var(--ink); font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pv-pay { text-align: center; font-size: 12.5px; color: var(--muted); }
.pv-end { height: 96px; }
.pv-legal { margin: 0; text-align: center; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.pv-accept { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; line-height: 1.5; color: var(--muted-2); cursor: pointer; }
.pv-accept input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.pv-accept a { color: var(--ink); font-weight: 600; }
.pv-accept.need { border-color: var(--accent); background: var(--orange-bg); }
.pv-legal a, .pv-links a { color: var(--muted-2); }
.pv-links { margin: 24px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* Termos de uso e Política de privacidade */
.legal { gap: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted-2); }
.legal h2 { margin: 22px 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal b { color: var(--ink); }
.legal a { color: var(--ink); font-weight: 600; }
.legal-date { font-size: 12.5px; color: var(--muted); }
.legal-box { margin: 4px 0 10px; padding: 12px 14px; border-radius: 10px; background: var(--orange-bg); color: var(--orange-fg); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.legal-box b { color: var(--orange-fg); }
.legal-table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 13px; line-height: 1.45; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.legal-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); padding: 8px; }
.legal-table td { padding: 8px; border-top: 1px solid var(--line-2); vertical-align: top; }
.legal-table td:first-child { font-weight: 600; color: var(--ink); }
/* No celular, cada linha da tabela vira um bloco (3 colunas não cabem) */
@media (max-width: 480px) {
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
  .legal-table tr:first-child { display: none; }
  .legal-table tr { padding: 10px 12px; border-top: 1px solid var(--line-2); }
  .legal-table tr:nth-child(2) { border-top: none; }
  .legal-table td { padding: 0; border: none; }
  .legal-table td:nth-child(2) { margin-top: 2px; }
  .legal-table td:nth-child(3) { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
  .legal-table td:nth-child(3)::before { content: 'Base legal: '; }
}

.pv-sticky { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; background: var(--ink); color: var(--ground); border-radius: 16px; box-shadow: 0 14px 30px -14px rgba(20, 32, 46, 0.6); z-index: 9; }
.pv-s { flex: 1; display: flex; flex-direction: column; font-size: 12px; color: var(--dark-muted); }
.pv-s b { color: var(--ground); font-size: 15px; }
.pv-sticky .btn { width: auto; min-height: 44px; padding: 0 20px; font-size: 15px; }

/* Botão laranja "Versão completa" no topo da calculadora grátis, ao lado de Ajustes */
.pro-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; margin-right: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; letter-spacing: 0.01em; font-weight: 600; text-decoration: none; white-space: nowrap; box-shadow: 0 4px 10px -6px rgba(184, 67, 42, 0.8); }
.pro-pill:hover { background: var(--accent-dark); color: #fff; }
.pro-pill svg { color: #FFE2A8; flex-shrink: 0; }
.pro-pill .short { display: none; }
@media (max-width: 374px) { .pro-pill .long { display: none; } .pro-pill .short { display: inline; } .pro-pill { padding: 0 8px; margin-right: 2px; } }
@media (max-width: 360px) { .brand.sm { font-size: 20px; } }

/* Explicação que abre ao tocar (ex.: +35% x +25%) */
.rate-card { padding: 10px 14px; }
.rate-card .rate-input { height: 42px; }

/* Holerite: caixas de horas compactas (3 por linha) */
.hours-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hours-grid .hour-box { padding: 8px 10px; gap: 1px; border-radius: 10px; }
.hour-box .hb-label { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.hour-box .hb-sub { font-size: 11px; color: var(--muted); line-height: 1.3; }
.hour-box .input-unit { margin-top: auto; padding-top: 2px; }
.hours-grid .hour-box input { height: 30px; font-size: 17px; padding: 0; }
.hour-box .input-unit .input, .hour-box .input-unit input { padding-right: 30px; }
.hour-box .input-unit .ghost { left: 0; font-size: 17px; }
.hour-box.todo input::placeholder { font-size: 12px; }
@media (max-width: 360px) { .hours-grid { gap: 6px; } .hours-grid .hour-box { padding: 7px 8px; } }

.help-details { background: var(--blue-bg); color: var(--blue-fg); border-radius: 10px; font-size: 13px; line-height: 1.5; }
.help-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; font-weight: 600; }
.help-details > summary::-webkit-details-marker { display: none; }
.help-details > summary svg:last-child { margin-left: auto; transition: transform 0.15s; }
.help-details[open] > summary svg:last-child { transform: rotate(180deg); }
.help-details .body { padding: 0 12px 12px; }
.help-details p { margin: 0 0 8px; }
.help-details ul { margin: 0 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.help-details .ex { margin: 0; padding-top: 8px; border-top: 1px solid rgba(31, 63, 96, 0.15); }

/* Ajustes: escolha do modo do holerite (dois cartões lado a lado) */
.mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-opt { display: flex; gap: 8px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.mode-opt:has(input:checked) { border: 2px solid var(--accent); padding: 11px; }
.mode-opt input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.mode-opt b { font-size: 15px; font-weight: 600; }
.mode-opt span span { font-size: 12px; line-height: 1.4; color: var(--muted); }

/* Boas-vindas: passos do primeiro uso */
.steps-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.steps-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; counter-increment: step; }
.steps-list li::before { content: counter(step); width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; border: 1px solid var(--dark-muted); }
.upsell-card p svg { color: var(--accent); vertical-align: -2px; }
.plan-chip {display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.plan-chip svg { color: #E9C46A; }
.pitch { margin: 0; font-family: var(--serif); font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.pitch .hl { color: var(--accent); }
@media (max-width: 360px) { .pitch { font-size: 27px; } }
.preview-item { display: flex; flex-direction: column; gap: 10px; }
.preview-head { display: flex; gap: 12px; align-items: flex-start; }
.preview-head b { font-size: 16px; font-weight: 600; }
.preview-head .small { line-height: 1.5; }
.preview-num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.preview-mock { position: relative; display: flex; flex-direction: column; gap: 10px; margin-left: 40px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 20px -14px rgba(20, 32, 46, 0.35); }
.preview-tag { position: absolute; top: -9px; right: 12px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--ground); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
details.faq { border-bottom: 1px solid var(--line-2); }
details.faq:last-child { border-bottom: none; }
details.faq > summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq[open] > summary svg { transform: rotate(180deg); }
details.faq > p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--muted-2); }

/* Aviso de venda discreto (plano grátis) */
.upsell { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.5; color: var(--muted-2); text-decoration: none; }
.upsell:hover { color: var(--muted-2); border-style: solid; }
.upsell svg { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.upsell b { color: var(--ink); }
.upsell .go { display: block; margin-top: 4px; color: var(--accent); font-weight: 600; }

.lock-bar { width: 60px; height: 12px; border-radius: 4px; background: var(--line); }

.bottom-actions { position: sticky; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ground); display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.bottom-actions .count { font-size: 13px; color: var(--muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 30; box-shadow: 0 12px 24px -12px rgba(20, 32, 46, 0.4); max-width: calc(100% - 40px); }

/* Painel que sobe de baixo (compartilhar) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 32, 46, 0.45); z-index: 20; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--ground); border-radius: 18px 18px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; z-index: 21; box-shadow: 0 -12px 32px -12px rgba(20, 32, 46, 0.35); animation: sheet-up 0.2s ease-out; }
.sheet::before { content: ''; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--border); }
.sheet-title { margin: 0; font-size: 18px; font-weight: 600; }
@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.share-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.share-opt:has(input:checked) { border: 2px solid var(--accent); padding: 13px; }
.share-opt input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.share-preview { font-size: 13px; line-height: 1.5; color: var(--muted-2); background: var(--surface-2); border-left: 3px solid var(--line); padding: 8px 10px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Não corta palavras em japonês no meio */
.kanji, .jp { word-break: keep-all; }

.ellipsis { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Celulares pequenos (até 360 px): um pouco menos de margem e campos de valor mais estreitos */
@media (max-width: 360px) {
  .title { font-size: 22px; }
  .add-btn { padding: 0 12px 0 8px; }
  .icon-btn.labeled + .add-btn { margin-left: 4px; }
  .icon-btn.labeled { min-width: 44px; padding: 2px 2px; }
  .content { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .money { width: 100px; }
  .card.list { padding: 0 12px; }
  .row .kanji { font-size: 15px; }
}

/* Painel: 3 atalhos na mesma linha (Enviado · Metas · Calcular) */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 104px; min-width: 0; }
.mini:hover { border-color: var(--ink); color: var(--ink); }
.mini .hd { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.mini .ico { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--orange-bg); color: var(--accent); }
.mini .t { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; color: var(--muted-2); line-height: 1.25; }
.mini .v { font-family: var(--mono); font-size: 16px; font-weight: 500; line-height: 1.1; overflow-wrap: anywhere; }
.mini .v.word { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.mini .s { font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: auto; overflow-wrap: anywhere; }
.mini .bar { height: 5px; }
@media (max-width: 360px) { .mini { padding: 10px 8px; } .mini .hd { gap: 5px; } .mini .t { font-size: 11px; } .mini .v { font-size: 14.5px; } .mini .v.word { font-size: 13px; } }

/* Entrar no Premium: campo do código de 6 números */
.code-input { font-size: 26px; letter-spacing: 0.35em; text-align: center; padding-left: 0.35em; }
.pv-login { display: block; text-align: center; font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 0; }
.pv-login b { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pv-hero .pv-login { color: var(--dark-muted); padding: 2px 0 0; }
.pv-hero .pv-login b { color: #FFFFFF; }

/* Holerites: grade "Lançar outro mês" (dentro do cartão escuro) */
.mp { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--dark-line); }
.mp-head { display: flex; align-items: center; justify-content: space-between; color: var(--ground); }
.mp-head b { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.mp-nav { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--dark-line); border-radius: 10px; background: transparent; color: var(--ground); cursor: pointer; }
.mp-nav:disabled { opacity: 0.3; cursor: default; }
.mp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mp-cell { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: 10px; border: 1px solid var(--dark-line); color: var(--ground); text-decoration: none; font-size: 14px; }
.mp-cell:hover { border-color: var(--dark-muted); color: var(--ground); }
.mp-cell.done { background: rgba(255, 255, 255, 0.08); color: var(--dark-muted); }
.mp-cell.off { opacity: 0.3; }

/* Página de vendas: modo rápido x completo */
.pv-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pv-mode { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.pv-mode b { font-size: 15px; }
.pv-mode p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted-2); }
.pv-mode-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--orange-bg); color: var(--accent); }
@media (max-width: 340px) { .pv-modes { grid-template-columns: 1fr; } }

/* Ajustes: Ajuda (reportar um problema) */
.help-row { display: flex; align-items: center; gap: 12px; }
.help-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--orange-bg); color: var(--accent); }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.copy-row .mono { font-size: 14px; overflow-wrap: anywhere; }
.copy-btn { flex: none; min-height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 12px; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.copy-btn:hover { border-color: var(--ink); }
