/* Rumo 2027 — um planner simples, quente e colorido. */
:root {
  --bg: #FBF6EE;
  --paper: #FFFFFF;
  --soft: #F5EFE5;
  --line: #ECE4D7;
  --ink: #2E2A33;
  --ink2: #6E6873;
  --ink3: #A7A0A9;

  --coral: #F0735A;
  --orange: #F39A3D;
  --yellow: #F2B937;
  --green: #2FAE78;
  --teal: #22A6AE;
  --blue: #4A8BE6;
  --violet: #8A6CEF;
  --pink: #E5689B;
  --red: #E0574F;

  --c: var(--coral);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 6px 20px rgba(60, 40, 20, .06);
  --shadow-lg: 0 10px 40px rgba(40, 25, 10, .18);
  --r: 22px;
  --r-s: 14px;
  --tint: 13%;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1820; --paper: #26222B; --soft: #2F2A35; --line: #39333F;
    --ink: #F4EFEA; --ink2: #B9B1BC; --ink3: #7F7784;
    --coral: #F7866F; --orange: #F6A955; --yellow: #F5C553; --green: #46C08C; --teal: #3BBAC1;
    --blue: #6AA2F0; --violet: #A28AF5; --pink: #EE82AE; --red: #F06D66;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    --tint: 20%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1820; --paper: #26222B; --soft: #2F2A35; --line: #39333F;
  --ink: #F4EFEA; --ink2: #B9B1BC; --ink3: #7F7784;
  --coral: #F7866F; --orange: #F6A955; --yellow: #F5C553; --green: #46C08C; --teal: #3BBAC1;
  --blue: #6AA2F0; --violet: #A28AF5; --pink: #EE82AE; --red: #F06D66;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --tint: 20%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.2; }
h3 { font-size: 18px; font-weight: 800; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
.ico { display: inline-flex; flex: none; }
.ico svg { display: block; }

/* ---------- casca ---------- */
#app { min-height: 100dvh; }
#view { outline: none; }
.page {
  max-width: 560px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px calc(112px + var(--safe-b));
  animation: in .22s ease both;
}
#app[data-mode="detail"] .page { padding-top: 0; padding-bottom: calc(40px + var(--safe-b)); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .page, .sheet, .scrim { animation: none !important; transition: none !important; } }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.s { gap: 8px; }
.stack.l { gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; align-items: center; }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.b { font-weight: 800; }
.good-t { color: var(--green); }
.bad-t { color: var(--red); }
.sp { height: 8px; }

/* cabeçalho de separador */
.hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.hdr .kick { color: var(--ink2); font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.hdr h1 .em { display: inline-block; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: color-mix(in srgb, var(--c) 80%, var(--ink));
  font-weight: 800; font-size: 13px; white-space: nowrap;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: var(--ink2); background: var(--paper); box-shadow: var(--shadow);
}
.icon-btn.flat { background: none; box-shadow: none; }

/* título de secção */
.sec { margin-top: 26px; }
.sec-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.sec-t h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.sec-t .count { color: var(--ink3); font-weight: 800; font-size: 14px; }
.link { color: color-mix(in srgb, var(--c) 85%, var(--ink)); font-weight: 800; font-size: 14.5px; padding: 6px 4px; }

/* ---------- cartões ---------- */
.card { background: var(--paper); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1.5px solid var(--line); }
.tint { background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); box-shadow: none; }
.tint-strong { background: var(--c); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 35%, transparent); }
.card + .card { margin-top: 10px; }
.card-t { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); margin-bottom: 8px; }
a.card, button.card { display: block; width: 100%; transition: transform .12s ease; }
a.card:active, button.card:active { transform: scale(.985); }

/* azulejo com emoji */
.tile {
  width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center; font-size: 24px; line-height: 1;
  background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: var(--c);
}
.tile.s { width: 38px; height: 38px; border-radius: 12px; font-size: 20px; }
.tile.l { width: 60px; height: 60px; border-radius: 19px; font-size: 32px; }
.tile.solid { background: var(--c); color: #fff; }

/* linhas de lista */
.list { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; min-height: 64px; }
.item + .item { border-top: 1.5px solid var(--line); }
.item b { display: block; font-weight: 800; }
.item small { display: block; color: var(--ink2); font-size: 14px; margin-top: 1px; }
.item .chev { color: var(--ink3); }
a.item:active, button.item:active { background: var(--soft); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 16px; font-weight: 800; font-size: 16px;
  background: var(--c); color: #fff; transition: transform .12s ease, filter .12s;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 30%, transparent);
}
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 18px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btn.soft { background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: color-mix(in srgb, var(--c) 85%, var(--ink)); box-shadow: none; }
.btn.ghost { background: var(--soft); color: var(--ink); box-shadow: none; }
.btn.line { background: transparent; color: var(--ink2); box-shadow: none; border: 2px dashed var(--line); }
.btn.white { background: #fff; color: var(--c); box-shadow: none; }
.btn.danger { --c: var(--red); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft); color: var(--ink); font-weight: 700; font-size: 15px; border: 2px solid transparent;
}
.chip.on { background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); border-color: var(--c); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }

/* segmentos */
.seg { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 11px; font-weight: 800; font-size: 14.5px; color: var(--ink2); text-align: center; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-weight: 800; font-size: 15px; }
.hint { color: var(--ink2); font-size: 14px; }
.input {
  width: 100%; min-height: 52px; padding: 13px 15px; border-radius: var(--r-s);
  background: var(--soft); border: 2px solid transparent; outline: none; font-size: 16.5px; font-weight: 600;
}
.input::placeholder { color: var(--ink3); font-weight: 500; }
.input:focus { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: var(--paper); }
textarea.input { resize: none; line-height: 1.5; min-height: 96px; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 56px; }
.input-unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink2); font-weight: 800; }
.big-num { font-size: 34px; font-weight: 800; text-align: center; min-height: 72px; letter-spacing: -.01em; }
input[type="date"].input { appearance: none; -webkit-appearance: none; }

/* entrada em linha (adicionar tarefa) */
.add-line { display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 58px; }
.add-line .plus { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); }
.add-line input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16.5px; font-weight: 600; padding: 8px 0; }
.add-line input::placeholder { color: var(--ink3); }

/* ---------- tarefas ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; }
.task + .task, .task + .add-line, .add-line + .task { border-top: 1.5px solid var(--line); }
.tick {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2.5px solid color-mix(in srgb, var(--c) 55%, var(--line)); color: transparent; transition: all .15s ease;
}
.tick.on { background: var(--c); border-color: var(--c); color: #fff; animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
.task .txt { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.task .txt small { display: block; font-weight: 600; color: var(--ink2); font-size: 13.5px; }
.task.done .txt > span { text-decoration: line-through; color: var(--ink3); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: color-mix(in srgb, var(--c) 80%, var(--ink)); white-space: nowrap; }

/* ---------- semana ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--paper); border-radius: var(--r); padding: 8px; box-shadow: var(--shadow); }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 15px; position: relative; }
.wd span { font-size: 12px; font-weight: 800; color: var(--ink3); text-transform: uppercase; }
.wd b { font-size: 17px; font-weight: 800; }
.wd i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.wd.has i { background: var(--c); }
.wd.today b { color: var(--c); }
.wd.on { background: var(--c); color: #fff; }
.wd.on span { color: rgba(255, 255, 255, .8); }
.wd.on b { color: #fff; }
.wd.on i { background: transparent; }
.wd.on.has i { background: #fff; }

/* foco */
.focus { padding: 18px; }
.focus textarea {
  width: 100%; border: 0; outline: 0; background: none; resize: none; padding: 0;
  font-size: 20px; font-weight: 800; line-height: 1.3; min-height: 30px; color: var(--ink); overflow: hidden;
}
.focus textarea::placeholder { color: color-mix(in srgb, var(--c) 45%, var(--ink3)); }

/* hábitos */
.habits { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.habit { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 18px; background: var(--paper); text-align: center; min-height: 104px; }
.habit .em { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--soft); transition: all .15s; position: relative; }
.habit small { font-size: 12.5px; font-weight: 700; color: var(--ink2); line-height: 1.2; }
.habit.on .em { background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); animation: pop .25s ease; }
.habit.on small { color: var(--ink); }
.habit.on .em::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--paper); }

/* humor */
.moods { display: flex; justify-content: space-between; gap: 6px; }
.mood { flex: 1; height: 54px; border-radius: 16px; font-size: 28px; display: grid; place-items: center; background: var(--paper); filter: grayscale(.6); opacity: .75; transition: all .15s; }
.mood.on { filter: none; opacity: 1; background: var(--c); transform: scale(1.06); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 35%, transparent); }

/* ---------- progresso ---------- */
.bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, var(--soft)); overflow: hidden; width: 100%; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); transition: width .4s ease; min-width: 0; }
.bar.thin { height: 7px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; color: var(--c); }
.ring svg { display: block; }
.ring b { position: absolute; font-size: 14px; font-weight: 800; color: var(--ink); }

/* ---------- metas ---------- */
a.card.goal, .goal { display: flex; gap: 14px; align-items: center; padding: 16px; }
.goal .grow b { display: block; font-weight: 800; font-size: 16.5px; line-height: 1.25; }
.goal .meta-l span:last-child { white-space: nowrap; }
.goal .meta-l { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.goal .bar { margin-top: 8px; }
.add-card { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border-radius: var(--r); border: 2.5px dashed color-mix(in srgb, var(--c) 40%, var(--line)); color: color-mix(in srgb, var(--c) 85%, var(--ink)); font-weight: 800; width: 100%; margin-top: 10px; }
.hero { border-radius: 28px; padding: 22px 20px; position: relative; overflow: hidden; }
.hero.tint-strong h2, .hero.tint-strong p { color: #fff; }
.hero .deco { position: absolute; right: -20px; top: -20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.hero .deco.b { right: 40px; top: auto; bottom: -50px; width: 90px; height: 90px; background: rgba(255, 255, 255, .1); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 52px; height: 52px; border-radius: 16px; background: var(--soft); font-size: 26px; font-weight: 800; flex: none; display: grid; place-items: center; }
.stepper .input { text-align: center; font-size: 22px; font-weight: 800; }

.tint-strong .ring b { color: #fff; font-size: 16px; }
.tint-strong .ring svg circle:first-child { stroke: rgba(255, 255, 255, .28); }

/* ---------- dinheiro ---------- */
.money-hero { padding: 20px; border-radius: 26px; }
.money-hero .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 14px; overflow-wrap: anywhere; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo > div { background: var(--paper); border-radius: 16px; padding: 12px; min-width: 0; }
.duo small { display: flex; align-items: center; gap: 5px; font-weight: 800; color: var(--ink2); font-size: 13px; }
.duo b { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }
.amt { font-weight: 800; white-space: nowrap; }
.amt.in { color: var(--green); }
.amt.out { color: var(--ink); }
.day-h { font-size: 13px; font-weight: 800; color: var(--ink3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px 4px; }
.cat-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.cat-row + .cat-row { margin-top: 12px; }
.cat-row .bar { grid-column: 2 / 4; margin-top: -4px; }
.month-sw { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--paper); border-radius: 18px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 14px; }
.month-sw b { font-weight: 800; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 150px; padding-top: 10px; }
.bars .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; position: relative; }
.bars .col .stk { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.bars .col .plan { position: absolute; bottom: 0; width: 100%; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--c) 18%, var(--soft)); }
.bars .col .real { position: relative; width: 62%; border-radius: 6px 6px 3px 3px; background: var(--c); }
.bars .col span { font-size: 11px; font-weight: 800; color: var(--ink3); }
.bars .col.cur span { color: var(--c); }
.legend { display: flex; gap: 14px; font-size: 13px; font-weight: 700; color: var(--ink2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- caderno ---------- */
.chapters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chapter { border-radius: var(--r); padding: 14px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); position: relative; overflow: hidden; }
.chapter::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 5px; border-radius: 0 5px 5px 0; background: var(--c); }
.chapter .em { font-size: 30px; line-height: 1; }
.chapter b { display: block; font-weight: 800; font-size: 16px; line-height: 1.2; }
.chapter small { display: block; color: var(--ink2); font-size: 13px; font-weight: 700; margin-top: 4px; }
.chapter .bar { height: 6px; background: color-mix(in srgb, var(--c) 22%, var(--paper)); }
.starter { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.starter::-webkit-scrollbar { display: none; }
.starter .card { flex: 0 0 72%; max-width: 260px; scroll-snap-align: start; margin: 0; }
.page-done { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; flex: none; }
.page-todo { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); flex: none; }

/* página (missão) */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 0 10px; margin: 0 -16px; padding-left: 12px; padding-right: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar h1 { flex: 1; font-size: 17px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 16px; }
.pg-head small { display: block; font-weight: 800; color: color-mix(in srgb, var(--c) 80%, var(--ink)); font-size: 14px; }
.pg-intro { font-size: 16.5px; line-height: 1.55; color: var(--ink2); margin-bottom: 4px; }
.pg-intro b { color: var(--ink); }
details.tips { border-radius: 18px; background: color-mix(in srgb, var(--yellow) var(--tint), var(--paper)); padding: 0 16px; margin: 14px 0 6px; }
details.tips summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 800; cursor: pointer; }
details.tips summary::-webkit-details-marker { display: none; }
details.tips summary .ico:last-child { margin-left: auto; transition: transform .2s; }
details.tips[open] summary .ico:last-child { transform: rotate(180deg); }
details.tips ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
details.tips .ex { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--paper); font-style: italic; color: var(--ink2); }
.paper { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 16px; margin-top: 14px; }
.paper .field + .field { margin-top: 22px; }
.paper .lbl { font-size: 16px; }
.lined {
  width: 100%; border: 0; outline: 0; resize: none; padding: 4px 2px; font-size: 16.5px; font-weight: 600;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--line) 31px, var(--line) 33px);
  line-height: 33px; min-height: 66px; background-attachment: local; color: var(--ink);
}
.lined::placeholder { color: var(--ink3); font-weight: 500; }
input.lined { min-height: 40px; line-height: 1.5; background: none; border-bottom: 2px solid var(--line); border-radius: 0; padding: 6px 2px; }
input.lined:focus, textarea.lined:focus { border-color: var(--c); }
.list-row { display: flex; align-items: center; gap: 10px; }
.list-row .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: var(--c); flex: none; }
.rowcards { display: flex; flex-direction: column; gap: 8px; }
.rowcard { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--soft); width: 100%; }
.rowcard b { display: block; font-weight: 800; }
.rowcard small { display: block; color: var(--ink2); font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--green) var(--tint), var(--paper)); color: var(--green); }
.badge.warn { background: color-mix(in srgb, var(--orange) var(--tint), var(--paper)); color: color-mix(in srgb, var(--orange) 80%, var(--ink)); }
.badge.bad { background: color-mix(in srgb, var(--red) var(--tint), var(--paper)); color: var(--red); }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 14px; }
.stat { border-radius: 16px; padding: 12px 14px; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); }
.stat b { display: block; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.stat span { font-size: 13px; font-weight: 700; color: var(--ink2); }
.stat.good { --c: var(--green); }
.stat.warn { --c: var(--orange); }
.stat.bad { --c: var(--red); }
.preview { margin-top: 14px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); line-height: 1.55; }
.next-step { margin-top: 14px; border-radius: var(--r); padding: 16px; background: color-mix(in srgb, var(--green) var(--tint), var(--paper)); --c: var(--green); }
.sticky-cta { position: sticky; bottom: 0; padding: 14px 0 calc(14px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: 10px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 48px; height: 48px; border-radius: 14px; position: relative; overflow: hidden; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(0,0,0,.06); }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch.add { background: var(--soft); color: var(--ink2); }
.checks { display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 4px; width: 100%; font-weight: 700; }
.check .box { width: 26px; height: 26px; border-radius: 8px; border: 2.5px solid var(--line); flex: none; display: grid; place-items: center; color: transparent; }
.check.on .box { background: var(--c); border-color: var(--c); color: #fff; }

/* clientes */
.person { padding: 14px; }
.person .top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.person .acts { display: flex; gap: 8px; margin-top: 12px; }
.person .acts .btn { flex: 1; }

/* ---------- barra inferior ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 8px calc(8px + var(--safe-b)); background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -1px 0 var(--line), 0 -8px 30px rgba(40, 25, 10, .05);
}
#app[data-mode="tab"] #tabbar { display: grid; }
#app:not([data-mode="tab"]) #tabbar { display: none; }
#tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; font-size: 12px; font-weight: 800; color: var(--ink3); }
#tabbar a .ico { width: 44px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .15s; }
#tabbar a.on { color: var(--ink); }
#tabbar a.on .ico { background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); color: var(--c); }
#tabbar .plus { justify-self: center; width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: var(--coral); color: #fff; margin-bottom: 6px; box-shadow: 0 8px 22px color-mix(in srgb, var(--coral) 45%, transparent); transform: translateY(-8px); }
#tabbar .plus:active { transform: translateY(-8px) scale(.94); }

/* ---------- folha (bottom sheet) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(30, 20, 15, .38); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  max-width: 600px; margin: 0 auto;
}
.sheet.in { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 18px 16px 8px 20px; background: var(--bg); }
.sheet-head h2 { flex: 1; font-size: 21px; }
.grab { position: absolute; left: 50%; top: 7px; width: 40px; height: 5px; border-radius: 9px; background: var(--line); transform: translateX(-50%); }
.sheet-body { padding: 6px 16px calc(22px + var(--safe-b)); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 20px; background: color-mix(in srgb, var(--c) var(--tint), var(--paper)); font-weight: 800; font-size: 16px; min-height: 108px; }
.quick button .em { font-size: 30px; line-height: 1; }
.quick button small { display: block; font-weight: 700; font-size: 13px; color: var(--ink2); margin-top: 2px; }
.quick .wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 70px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60; transform: translate(-50%, 20px); opacity: 0; transition: all .22s; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); padding: 13px 18px; border-radius: 16px; font-weight: 700; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); width: max-content; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast button { color: var(--yellow); font-weight: 800; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* vazio / ilustração */
.empty { text-align: center; padding: 26px 18px; }
.empty .art { margin: 0 auto 12px; width: 120px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink2); margin-bottom: 16px; }
.big-emoji { font-size: 56px; line-height: 1; }

/* ---------- boas-vindas ---------- */
.onb { min-height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(28px + var(--safe-t)) 22px calc(24px + var(--safe-b)); animation: in .3s ease both; }
.onb .art { width: min(280px, 78vw); margin: 10px auto 22px; }
.onb h1 { font-size: 31px; text-align: center; }
.onb .lead { text-align: center; color: var(--ink2); font-size: 17px; margin: 12px auto 0; max-width: 340px; }
.onb .feats { display: grid; gap: 10px; margin: 26px 0; }
.onb .feat { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.onb .grow-space { flex: 1; }
.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.dots i { width: 8px; height: 8px; border-radius: 9px; background: var(--line); }
.dots i.on { width: 22px; background: var(--coral); }

/* ---------- imprimir ---------- */
.doc h2 { margin: 24px 0 8px; font-size: 20px; color: var(--c); }
.doc h3 { margin: 14px 0 4px; font-size: 16px; }
.doc p, .doc li { color: var(--ink); white-space: pre-wrap; }
@media print {
  #tabbar, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card, .paper, .list { box-shadow: none; border: 1px solid #ddd; }
}

@media (min-width: 700px) {
  .page { padding-left: 24px; padding-right: 24px; }
  .chapters { grid-template-columns: 1fr 1fr 1fr; }
}
