:root {
  --brand: #0F766E; --brand-2: #14B8A6; --brand-ink: #064E48; --brand-soft: #E6F4F1;
  --accent: #F59E0B; --accent-soft: #FEF3C7;
  --ink: #0F172A; --ink-2: #334155; --muted: #64748B; --line: #E2E8F0;
  --bg: #F6F8F7; --card: #FFFFFF; --danger: #B91C1C; --danger-soft: #FEE2E2; --ok: #15803D;
  --radius: 18px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.06);
  --nav-h: 72px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  font-size: 17px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.boot-logo, .logo-mark { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px;
  background: url("icons/icon-192.png") center/cover; }

/* Layout */
.shell { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: calc(12px + var(--safe-t)) 16px calc(var(--nav-h) + 110px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.topbar .logo-mark { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.topbar h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: .85rem; margin: 0; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.icon-btn svg { width: 24px; height: 24px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.card .hint { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  font-size: .8rem; font-weight: 700; margin-right: 8px; vertical-align: 1px; }

/* Segmentos e chips */
.seg { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 8px; }
.seg button, .chip { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 8px 10px; font-weight: 600; font-size: .95rem; line-height: 1.2; }
.seg button small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.seg button[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 14px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px !important; margin-right: -16px !important; padding: 2px 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; white-space: nowrap; }

/* Stepper */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .label { font-weight: 600; }
.row .label small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 1.5rem; line-height: 1; color: var(--brand-ink); font-weight: 600; }
.stepper button:active { background: var(--brand-soft); }
.stepper output { min-width: 34px; text-align: center; font-size: 1.2rem; font-weight: 700; }
.switch { position: relative; width: 58px; height: 34px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #CBD5E1; transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(24px); }

/* Campos */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field > small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 12px 14px; font-size: 1rem; }
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(20,184,166,.2); }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input input { padding-left: 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { width: 104px; min-height: 48px; text-align: right; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 18px; border-radius: 16px; border: 0;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none; width: 100%; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--brand-ink); border: 1.5px solid var(--brand); }
.btn.ghost { background: transparent; color: var(--brand-ink); }
.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid #FCA5A5; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .92rem; width: auto; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* Barra de preço fixa */
.pricebar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 20; padding: 0 12px 10px; pointer-events: none; }
.pricebar-inner { max-width: 616px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 20px; padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.3); pointer-events: auto; }
.pricebar .p-label { font-size: .75rem; opacity: .75; text-transform: uppercase; letter-spacing: .06em; }
.pricebar .p-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pricebar .p-meta { font-size: .8rem; opacity: .8; }
.pricebar .btn { width: auto; background: var(--brand-2); color: #04201d; min-height: 52px; margin-left: auto; white-space: nowrap; }

/* Navegação inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.nav a svg { width: 26px; height: 26px; }
.nav a[aria-current="page"] { color: var(--brand); }

/* Resultado */
.hero-price { text-align: center; padding: 22px 18px; background: linear-gradient(160deg, var(--brand) 0%, #0B5F58 100%); color: #fff; border-radius: 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.hero-price .label { opacity: .85; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.hero-price .value { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0; }
.hero-price .meta { opacity: .9; font-size: .92rem; }
.adjust { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 14px; }
.adjust button { width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; font-size: 1.1rem; font-weight: 700; }
.adjust input { width: 132px; height: 52px; text-align: center; border-radius: 14px; border: 0; font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.reset-link { background: none; border: 0; color: #fff; text-decoration: underline; font-size: .85rem; margin-top: 8px; opacity: .9; min-height: 40px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--bg); border-radius: 14px; padding: 12px; }
.kpi .k { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpi .v { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.kpi .v.bad { color: var(--danger); }
.kpi .v.good { color: var(--ok); }
.alert { border-radius: 14px; padding: 12px 14px; font-size: .92rem; margin: 10px 0 0; }
.alert.warn { background: var(--accent-soft); color: #78350F; }
.alert.bad { background: var(--danger-soft); color: #7F1D1D; }
.alert.info { background: var(--brand-soft); color: var(--brand-ink); }

.breakdown { width: 100%; border-collapse: collapse; font-size: .92rem; }
.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.breakdown td:last-child { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 12px; }
.breakdown tr.total td { font-size: 1.05rem; border-bottom: 0; }
.breakdown small { color: var(--muted); display: block; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); min-height: 44px; display: flex; align-items: center; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "▾"; margin-left: 6px; transition: transform .2s; }
details.more[open] summary::after { transform: rotate(180deg); }

/* Listas */
.list-item { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 10px; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { color: var(--muted); font-size: .85rem; }
.list-item .price { font-weight: 800; font-size: 1.15rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--ink-2); }
.badge.sent { background: #DBEAFE; color: #1E3A8A; }
.badge.won { background: #DCFCE7; color: #14532D; }
.badge.lost { background: #F1F5F9; color: #64748B; }
.empty { text-align: center; color: var(--muted); padding: 40px 18px; }
.empty .logo-mark { opacity: .9; }

.msg { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; background: #fff; }
.msg h3 { font-size: .98rem; margin: 0 0 8px; }
.msg .en { font-size: 1rem; white-space: pre-wrap; }
.msg .pt { font-size: .88rem; color: var(--muted); margin-top: 8px; white-space: pre-wrap; border-top: 1px dashed var(--line); padding-top: 8px; }
.msg .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .tick { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: .85rem; margin-top: 2px; }
.check .pt { color: var(--muted); font-size: .85rem; }

/* Sheets e modais */
.backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 10px 16px calc(24px + var(--safe-b)); animation: up .25s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: #CBD5E1; margin: 4px auto 12px; }
.sheet h2 { margin: 4px 0 12px; font-size: 1.3rem; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 120px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 80; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: fade .2s; max-width: 90vw; text-align: center; }

/* Onboarding */
.onb { text-align: center; padding: 8px 4px 0; }
.onb .art { width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.onb .art svg { width: 54px; height: 54px; }
.onb h2 { font-size: 1.45rem; margin: 0 0 8px; }
.onb p { color: var(--ink-2); margin: 0 0 16px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.dots i { width: 8px; height: 8px; border-radius: 9px; background: #CBD5E1; }
.dots i.on { width: 22px; background: var(--brand); }
.onb .field { text-align: left; }

/* Ativação */
.gate { max-width: 460px; margin: 0 auto; padding: calc(36px + var(--safe-t)) 20px 40px; }
.gate .logo-mark { width: 76px; height: 76px; border-radius: 22px; }
.gate h1 { text-align: center; font-size: 1.6rem; margin: 6px 0 6px; }
.gate p.lead { text-align: center; color: var(--ink-2); margin: 0 0 22px; }
.gate .foot { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 18px; }
.linklike { background: none; border: 0; color: var(--brand-ink); font-weight: 700; text-decoration: underline; min-height: 44px; padding: 0 4px; }

/* Guia de instalação */
.install-step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.install-step .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.install-step svg.ill { display: block; width: 100%; max-width: 260px; height: auto; margin-top: 8px; }
.banner { display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.banner p { margin: 0; flex: 1; font-size: .92rem; }
.banner .btn { width: auto; min-height: 44px; background: var(--brand-2); color: #04201d; }
.logo-preview { width: 72px; height: 72px; border-radius: 14px; border: 1.5px dashed var(--line); background: #fff center/contain no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 4px 8px; }
.demo-lock { border: 1.5px dashed var(--brand); background: var(--brand-soft); color: var(--brand-ink); border-radius: 16px; padding: 14px; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
