/* Layout: app de celular em coluna única. Número do lucro real no topo, detalhe embaixo, abas fixas na base. */
:root{
  --bg:#EDF1EF; --raised:#FFFFFF; --ink:#13211C; --muted:#586861; --line:#D3DBD7;
  --accent:#0B6E4F; --on-accent:#FFFFFF; --accent-soft:#D6EBE2;
  --warn:#8F5A00; --warn-soft:#F6E7C7;
  --bad:#B03A32; --on-bad:#FFFFFF; --bad-soft:#F4DAD7;
  --bar:#9CC3B4; --map-bg:#E3EAE7;
  --f-display:'Bricolage Grotesque','Segoe UI',system-ui,sans-serif;
  --f-body:'Instrument Sans','Segoe UI',system-ui,sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0E1714; --raised:#16221E; --ink:#E5EEEA; --muted:#93A59E; --line:#283833;
    --accent:#4CC38A; --on-accent:#07140F; --accent-soft:#1D3A2E;
    --warn:#E0A33A; --warn-soft:#3A2D12;
    --bad:#E8776E; --on-bad:#1A0907; --bad-soft:#3B1D1A;
    --bar:#2F5E4C; --map-bg:#13201B; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0E1714; --raised:#16221E; --ink:#E5EEEA; --muted:#93A59E; --line:#283833;
  --accent:#4CC38A; --on-accent:#07140F; --accent-soft:#1D3A2E;
  --warn:#E0A33A; --warn-soft:#3A2D12;
  --bad:#E8776E; --on-bad:#1A0907; --bad-soft:#3B1D1A;
  --bar:#2F5E4C; --map-bg:#13201B; color-scheme:dark;
}
*{box-sizing:border-box}
body{background:var(--bg); color:var(--ink); font-family:var(--f-body); font-size:15px; line-height:1.45}
#screen-app{padding-block:max(14px, env(safe-area-inset-top, 0px)) 112px;
  padding-left:max(16px, env(safe-area-inset-left, 0px));
  padding-right:max(16px, env(safe-area-inset-right, 0px))}
.wrap{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:22px;min-width:0}
h1,h2,h3{font-family:var(--f-display);margin:0;text-wrap:balance;letter-spacing:-0.01em}
h2{font-size:19px;font-weight:700}
h3{font-size:15px;font-weight:600}
p{margin:0}
small{color:var(--muted);font-size:12.5px}
button,input,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}

.top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px}
.brand-mark{width:34px;height:34px;border-radius:10px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;flex:none}
.brand h1{font-size:20px;font-weight:700;line-height:1.1}
.brand p{font-size:12.5px;color:var(--muted);text-transform:capitalize}

.banner{display:flex;gap:12px;align-items:center;justify-content:space-between;background:var(--warn-soft);color:var(--ink);border-radius:12px;padding:10px 12px;font-size:13.5px}
.banner button{flex:none}

.hero{background:var(--accent);color:var(--on-accent);border-radius:18px;padding:18px 18px 16px;display:flex;flex-direction:column;gap:10px}
.hero.neg{background:var(--bad);color:var(--on-bad)}
.hero .k{font-size:12.5px;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
.hero .big{font-family:var(--f-display);font-size:clamp(40px,13vw,56px);font-weight:700;line-height:1;letter-spacing:-0.02em}
.hero .sub{font-size:14px;opacity:.92}
.meter{height:8px;border-radius:99px;background:color-mix(in srgb, currentColor 25%, transparent);overflow:hidden}
.meter i{display:block;height:100%;background:currentColor;border-radius:99px}
.meta-row{display:flex;justify-content:space-between;font-size:12.5px;opacity:.9;gap:8px}

.rows{display:flex;flex-direction:column}
.row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row .l{min-width:0}
.row .l small{display:block}
.row .r{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}
.row.total{font-family:var(--f-display);font-size:17px;font-weight:700}
.pos{color:var(--accent)} .minus{color:var(--bad)}
.sec{display:flex;flex-direction:column;gap:8px;min-width:0}
.sec-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.hint{font-size:13px;color:var(--muted)}
.hint.err{color:var(--bad)}

.bars{display:flex;flex-direction:column;gap:12px}
.pbar .top2{display:flex;justify-content:space-between;gap:10px;font-weight:600}
.pbar .track{height:8px;background:var(--line);border-radius:99px;overflow:hidden;margin:5px 0 3px}
.pbar .track i{display:block;height:100%;background:var(--accent);border-radius:99px}
.pbar small{display:flex;justify-content:space-between;gap:8px}
.tag{display:inline-block;font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:99px;background:var(--accent-soft);color:var(--accent);vertical-align:middle;margin-left:6px}
.tag.warn{background:var(--warn-soft);color:var(--warn)}

.entry{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.entry:last-child{border-bottom:0}
.entry .m{flex:1;min-width:0}
.entry .m b{display:block;font-weight:600;overflow-wrap:anywhere}
.entry .v{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.x{width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:transparent;color:var(--muted);cursor:pointer;flex:none}
.x:hover{color:var(--bad);border-color:var(--bad)}

.btn{min-height:46px;padding:0 16px;border-radius:12px;border:1px solid var(--line);background:var(--raised);font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;color:var(--ink)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.small{min-height:36px;padding:0 12px;font-size:13.5px;border-radius:10px}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn.big{min-height:54px;font-size:17px;width:100%}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.actions .btn{flex:1 1 140px}

.seg{display:grid;grid-template-columns:1fr 1fr;background:var(--line);border-radius:14px;padding:4px;gap:4px}
.seg button{min-height:44px;border:0;border-radius:11px;background:transparent;font-weight:600;cursor:pointer;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--raised);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}

.formcard{background:var(--raised);border:1px solid var(--line);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
label,.lbl{font-size:13px;font-weight:600;color:var(--muted);display:block;margin-bottom:5px}
input[type=text],input[type=date],select{width:100%;min-height:46px;padding:0 12px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font-size:16px}
.money{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:0 14px}
.money span{font-family:var(--f-display);font-size:22px;color:var(--muted)}
.money input{border:0!important;background:transparent!important;font-family:var(--f-display);font-size:36px!important;font-weight:700;min-height:64px!important;padding:0!important;width:100%;min-width:0}
.money:focus-within{outline:2px solid var(--accent)}
.money input:focus-visible{outline:0}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.two>div{min-width:0}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{min-height:40px;padding:0 14px;border-radius:99px;border:1px solid var(--line);background:var(--bg);font-weight:500;cursor:pointer}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:600}

details.depot{background:var(--raised);border:1px solid var(--line);border-radius:12px;padding:10px 14px}
details.depot summary{cursor:pointer;font-weight:600}
details.depot .two{margin-top:12px}
.metrics{display:grid;grid-template-columns:repeat(2,1fr);gap:0 18px}
.metric{padding:10px 0;border-bottom:1px solid var(--line);min-width:0}
.metric small{display:block}
.metric b{font-family:var(--f-display);font-size:21px;font-variant-numeric:tabular-nums;font-weight:700}
.mapbox{background:var(--map-bg);border-radius:14px;overflow:hidden;border:1px solid var(--line)}
.mapbox svg{display:block;width:100%;height:auto}
.m-line{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:1 0}
.m-stop{fill:var(--accent)} .m-stop.done{fill:var(--muted);opacity:.7}
.m-depot{fill:var(--ink)}
.m-num{fill:var(--on-accent);font-size:11px;font-weight:700;font-family:var(--f-body)}
.m-dnum{fill:var(--bg);font-size:11px;font-weight:700;font-family:var(--f-body)}

.stop{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.stop:last-child{border-bottom:0}
.stop .n{width:30px;height:30px;border-radius:99px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;font-weight:700;font-size:13px;flex:none}
.stop.done .n{background:var(--muted)}
.stop.done .t{text-decoration:line-through;color:var(--muted)}
.stop .t{flex:1;min-width:0}
.stop .t b{display:block;font-weight:600;overflow-wrap:anywhere}
.stop .v{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}
.ck{width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:transparent;cursor:pointer;flex:none;color:var(--accent);font-size:17px;line-height:1}
.ck[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.toggle{display:flex;align-items:center;gap:10px;font-weight:500;color:var(--ink);font-size:14px;margin:0}
.toggle input{width:20px;height:20px;accent-color:var(--accent)}

.chart{overflow-x:auto}
.chart svg{display:block;width:100%;min-width:300px;height:auto}
.c-grid{stroke:var(--line);stroke-width:1}
.c-axis{fill:var(--muted);font-size:9.5px;font-family:var(--f-body)}
.c-val{fill:var(--ink);font-size:10px;font-weight:600;font-family:var(--f-body)}
.c-bar{fill:var(--bar)} .c-bar.today{fill:var(--accent)} .c-bar.neg{fill:var(--bad)}
.stat-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 18px}
.pill-row{display:flex;gap:8px;flex-wrap:wrap}
.cost-box{background:var(--accent-soft);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:4px}
.cost-box b{font-family:var(--f-display);font-size:30px;font-weight:700;color:var(--accent);letter-spacing:-0.01em}
.mei-track{height:12px;background:var(--line);border-radius:99px;overflow:hidden}
.mei-track i{display:block;height:100%;background:var(--accent);border-radius:99px}
.mei-track i.high{background:var(--warn)}

.tabbar{position:fixed;left:0;right:0;bottom:0;background:var(--raised);border-top:1px solid var(--line);
  padding:6px max(16px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));z-index:5}
.tabbar .in{max-width:560px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);gap:2px}
.tab-btn{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;border-radius:12px;color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;min-height:52px}
.tab-btn svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tab-btn[aria-selected="true"]{color:var(--accent);background:var(--accent-soft)}
.toast{position:fixed;left:max(16px, env(safe-area-inset-left, 0px));right:max(16px, env(safe-area-inset-right, 0px));bottom:calc(84px + env(safe-area-inset-bottom, 0px));max-width:528px;margin:0 auto;background:var(--ink);color:var(--bg);border-radius:12px;padding:12px 14px;display:flex;gap:12px;align-items:center;justify-content:space-between;z-index:6;font-weight:500}
.toast button{background:transparent;border:0;color:var(--bg);font-weight:700;text-decoration:underline;cursor:pointer}
.empty{background:var(--raised);border:1px dashed var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:10px;align-items:flex-start}
@media (max-width:380px){.metrics,.stat-grid{grid-template-columns:1fr}}
@media (prefers-reduced-motion:no-preference){.meter i,.pbar .track i,.mei-track i{transition:width .35s ease}}

/* ===== Site: base fora do artifact ===== */
:root{--gold:#F5B83D;color-scheme:light}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--gold:#F5B83D}}
:root[data-theme="dark"]{--gold:#F5B83D}
html{-webkit-text-size-adjust:100%;height:100%}
body{margin:0;min-height:100%}
[hidden]{display:none!important}
img{max-width:100%}

/* ===== Telas de acesso (entrar, comprar, recuperar) ===== */
.gate{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;align-items:center;
  padding-block:max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-left:max(16px, env(safe-area-inset-left, 0px));padding-right:max(16px, env(safe-area-inset-right, 0px))}
.gate-in{width:100%;max-width:420px;display:flex;flex-direction:column;gap:20px;min-width:0}
.gate .brandlock{display:flex;align-items:center;gap:12px}
.gate .brandlock img{width:48px;height:48px;border-radius:13px;flex:none}
.gate .brandlock b{font-family:var(--f-display);font-size:34px;font-weight:800;letter-spacing:-0.03em;line-height:1}
.gate .tagline{font-family:var(--f-display);font-size:clamp(24px,7vw,30px);font-weight:700;line-height:1.12;letter-spacing:-0.02em;text-wrap:balance}
.gate .tagline em{font-style:normal;color:var(--accent)}
.gate .lede{color:var(--muted)}
.gate form{display:flex;flex-direction:column;gap:14px}
.pass-wrap{position:relative}
.pass-wrap input{padding-right:84px}
.pass-wrap button{position:absolute;right:6px;top:5px;height:36px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:var(--accent);font-weight:600;cursor:pointer}
.linkbtn{background:none;border:0;padding:0;color:var(--accent);font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:3px;font-size:inherit;min-height:32px}
.gate-foot{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13.5px;color:var(--muted)}
.msg{border-radius:12px;padding:11px 14px;font-size:14px}
.guide{background:var(--accent-soft);border-radius:12px;padding:12px 14px;font-size:14px;display:flex;flex-direction:column;gap:6px}
.guide p{margin:0}
.guide ul,.guide ol{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:5px}
.guide .warnline{color:var(--warn)}
.msg.ok{background:var(--accent-soft);color:var(--ink)}
.msg.err{background:var(--bad-soft);color:var(--ink)}
input[type=email],input[type=password]{width:100%;min-height:48px;padding:0 12px;border-radius:10px;border:1px solid var(--line);background:var(--raised);font-size:16px}
.gate input[type=text]{background:var(--raised)}

.plan{background:var(--raised);border:1px solid var(--line);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:14px}
.plan .kicker{font-size:12.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--accent);font-weight:700}
.plan .price{font-family:var(--f-display);font-size:48px;font-weight:800;letter-spacing:-0.03em;line-height:1}
.plan .price small{display:block;font-family:var(--f-body);font-size:14px;font-weight:500;letter-spacing:0;line-height:1.4;margin-top:10px;color:var(--muted)}
.plan ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.plan li{display:flex;gap:10px;align-items:flex-start}
.plan li svg{flex:none;width:20px;height:20px;margin-top:1px;stroke:var(--accent);fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.waiting{display:flex;gap:12px;align-items:center}
.spin{width:22px;height:22px;border-radius:99px;border:3px solid var(--line);border-top-color:var(--accent);flex:none;animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:3s}}
.loadwrap{min-height:100vh;min-height:100dvh;display:grid;place-items:center}
.setup{max-width:520px}
.setup code{background:var(--line);padding:1px 6px;border-radius:6px;font-size:13px}

/* app */
.brand-mark img{width:34px;height:34px;border-radius:10px;display:block}
.brand-mark{background:transparent!important}
.brand h1{letter-spacing:-0.03em;font-weight:800}
.brand .sub2{font-size:12.5px;color:var(--muted);text-transform:none}
.brand .sub2::first-letter{text-transform:uppercase}
.help-card{background:var(--accent-soft);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:10px;align-items:flex-start}


/* planos e acesso */
.plan .planhead{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.plan .badge{font-size:12.5px;font-weight:700;background:var(--accent);color:var(--on-accent);border-radius:99px;padding:3px 10px}
.plan .price .per{font-family:var(--f-body);font-size:18px;font-weight:600;color:var(--muted);margin-left:6px;letter-spacing:0}
.plan .seg{margin-bottom:2px}
.giftbox{border:1px dashed var(--line);border-radius:14px;padding:12px 14px;background:transparent}
.giftbox summary{cursor:pointer;font-weight:600;color:var(--accent);min-height:28px;display:flex;align-items:center}
.giftbox[open] summary{margin-bottom:10px}
.giftrow{display:flex;gap:8px;flex-direction:row !important;align-items:stretch}
.giftrow input{flex:1;min-width:0;text-transform:uppercase;letter-spacing:.03em}
.giftrow .btn{flex:none}
.giftbox .msg{margin-top:10px}
.accbar{display:flex;gap:12px;align-items:center;justify-content:space-between;background:var(--accent-soft);color:var(--ink);border-radius:12px;padding:10px 12px;font-size:13.5px;margin-bottom:12px}
.accbar.warn{background:var(--warn-soft)}
.accbar button{flex:none}
.acc-actions{display:flex;flex-direction:column;gap:10px}
.acc-confirm{display:flex;flex-direction:column;gap:8px;background:var(--warn-soft);border-radius:12px;padding:12px}
.acc-confirm .two{display:flex;gap:8px}
.acc-confirm .two .btn{flex:1}

label small{font-weight:400;color:var(--muted)}
