/* 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); }
.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: 22px; }
.brand.sm img { width: 32px; height: 32px; border-radius: 8px; }
.topbar.compact { padding-top: 16px; padding-bottom: 4px; }
.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); }
.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-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; }
@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; gap: 12px; overflow-x: auto; 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: auto; 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; }
.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; }
.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-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; }
}
