/* Os 5 Poderes do Dinheiro para Crianças — identidade visual
   Fundo creme, títulos azul-marinho e roxo, cartões em tons suaves, bordas arredondadas. */

@font-face { font-family: 'Baloo 2'; font-weight: 600; font-display: swap; src: url(/fonts/baloo-2-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 700; font-display: swap; src: url(/fonts/baloo-2-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url(/fonts/baloo-2-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 700; font-display: swap; src: url(/fonts/baloo-2-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(/fonts/nunito-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(/fonts/nunito-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(/fonts/nunito-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(/fonts/nunito-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --cream: #FFFBF2;
  --paper: #FFFFFF;
  --navy: #1C2766;
  --purple: #6A2BB0;
  --purple-strong: #5A1FA0;
  --ink: #26304F;
  --muted: #535B7C;
  --line: #E6DFF0;
  --lilac: #F1E9FE; --lilac-b: #D8C6F7; --lilac-d: #7A45C2;
  --blue: #E5F1FD;  --blue-b: #B9D6F5;  --blue-d: #2D63B5;
  --yellow: #FFF6D1; --yellow-b: #F2DC8A; --yellow-d: #9A6A00;
  --green: #E6F5E0; --green-b: #BADFAE; --green-d: #2F7A2F;
  --pink: #FDE8F0;  --pink-b: #F3BED3;  --pink-d: #B23A6E;
  --star: #FFC93C;
  --ok: #2F7A2F; --warn: #9A5B00; --err: #B3261E;
  --radius: 20px; --radius-s: 12px;
  --shadow: 0 2px 0 rgba(28, 39, 102, .06), 0 8px 24px rgba(28, 39, 102, .07);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #6A2BB0;
  --font-h: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(241, 233, 254, .9) 0 90px, transparent 91px),
    radial-gradient(circle at 96% 30%, rgba(229, 241, 253, .9) 0 120px, transparent 121px);
  background-attachment: fixed;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--purple-strong); }
h1, h2, h3, h4 { font-family: var(--font-h); color: var(--navy); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; }
h2 { font-size: clamp(24px, 4.2vw, 32px); font-weight: 800; }
h3 { font-size: 21px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
.purple { color: var(--purple); }
p { margin: 0 0 .8em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
main { padding: 20px 0 80px; min-height: 60vh; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.five { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.center { text-align: center; }
.mt0 { margin-top: 0 !important; }
.hide { display: none !important; }

/* ---------- Topo ---------- */
.topbar { background: var(--paper); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar::after {
  content: ''; display: block; height: 8px; margin-bottom: -8px; position: relative;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 0 Q10 8 20 4 T40 2 V0Z' fill='%23E6DFF0'/%3E%3C/svg%3E") repeat-x;
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-family: var(--font-h); font-weight: 800; font-size: 19px; line-height: 1.05; }
.brand small { display: block; color: var(--purple); font-size: 13px; font-weight: 700; }
.brand .logo { width: 40px; height: 40px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a, .nav button.linklike { text-decoration: none; color: var(--navy); font-weight: 700; padding: 8px 12px; border-radius: 999px; font-size: 15.5px; }
.nav a[aria-current="page"], .nav a:hover { background: var(--lilac); color: var(--purple-strong); }
.menu-btn { display: none; margin-left: auto; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--paper); padding: 10px 16px 16px; border-bottom: 2px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

.child-top { background: var(--paper); border-bottom: 2px solid var(--line); }
.child-top .wrap { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.child-top .who { display: flex; align-items: center; gap: 10px; font-family: var(--font-h); font-weight: 800; color: var(--navy); font-size: 20px; }

/* ---------- Botões ---------- */
.btn {
  -webkit-appearance: none; appearance: none; border: 2px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 16px/1.1 var(--font); padding: 12px 20px; min-height: 48px; border-radius: 999px;
  background: var(--purple); color: #fff; text-decoration: none; transition: transform .08s ease, background .15s;
}
.btn:hover { background: var(--purple-strong); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--paper); color: var(--navy); border-color: var(--lilac-b); }
.btn.secondary:hover { background: var(--lilac); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--purple); border-color: transparent; padding-inline: 12px; }
.btn.ghost:hover { background: var(--lilac); }
.btn.yellow { background: var(--star); color: var(--navy); }
.btn.yellow:hover { background: #F7BB1F; color: var(--navy); }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #8f1d17; }
.btn.small { min-height: 38px; padding: 7px 14px; font-size: 14.5px; }
.btn.big { min-height: 64px; font-size: 20px; padding: 16px 28px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.big svg { width: 26px; height: 26px; }
.icon-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; }

/* ---------- Cartões ---------- */
.card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.soft { box-shadow: none; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.tone-lilac { background: var(--lilac); border-color: var(--lilac-b); }
.tone-blue { background: var(--blue); border-color: var(--blue-b); }
.tone-yellow { background: var(--yellow); border-color: var(--yellow-b); }
.tone-green { background: var(--green); border-color: var(--green-b); }
.tone-pink { background: var(--pink); border-color: var(--pink-b); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; border-radius: 999px; padding: 4px 11px; background: var(--lilac); color: var(--purple-strong); border: 1.5px solid var(--lilac-b); }
.chip.ok { background: var(--green); color: var(--green-d); border-color: var(--green-b); }
.chip.warn { background: var(--yellow); color: var(--yellow-d); border-color: var(--yellow-b); }
.chip.err { background: #FDECEA; color: var(--err); border-color: #F3C2BD; }
.chip.blue { background: var(--blue); color: var(--blue-d); border-color: var(--blue-b); }
.chip svg { width: 15px; height: 15px; }
.kicker { font-family: var(--font-h); font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }

.pill-title { display: inline-block; background: var(--lilac); color: var(--purple-strong); border-radius: 999px; padding: 4px 16px; font-family: var(--font-h); font-weight: 800; }

/* Página com cabeçalho do módulo */
.hero { border-radius: 28px; overflow: hidden; border: 2px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.hero .art { aspect-ratio: 2.1 / 1; background: var(--lilac); }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .body { padding: 22px; }
.hero.lilac { border-color: var(--lilac-b); } .hero.lilac .body { background: var(--lilac); }
.hero.blue { border-color: var(--blue-b); } .hero.blue .body { background: var(--blue); }
.hero.yellow { border-color: var(--yellow-b); } .hero.yellow .body { background: var(--yellow); }
.hero.green { border-color: var(--green-b); } .hero.green .body { background: var(--green); }
.hero.pink { border-color: var(--pink-b); } .hero.pink .body { background: var(--pink); }

/* Cartões de módulos */
.module-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--radius); border: 2px solid var(--line); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); transition: transform .12s; }
.module-card:hover { transform: translateY(-2px); color: inherit; }
.module-card .top { padding: 16px 16px 12px; display: flex; align-items: center; gap: 12px; }
.module-card .sym { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: #fff; flex: none; border: 2px solid rgba(0,0,0,.05); }
.module-card .sym svg { width: 34px; height: 34px; }
.module-card .num { font-family: var(--font-h); font-weight: 800; color: var(--purple); font-size: 14px; }
.module-card h3 { margin: 0; font-size: 20px; }
.module-card .bottom { padding: 0 16px 16px; font-size: 15px; color: var(--muted); flex: 1; display: flex; flex-direction: column; gap: 10px; }
.module-card.locked { opacity: .8; }
.bar { height: 10px; border-radius: 999px; background: rgba(28,39,102,.08); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--purple); border-radius: 999px; }

/* Avatares */
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--lilac-b); flex: none; background: var(--lilac); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 112px; height: 112px; }
.avatar.small { width: 40px; height: 40px; border-width: 2px; }

/* ---------- Formulários ---------- */
label.lbl, .lbl { display: block; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.hint { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; font: 600 16.5px/1.4 var(--font); color: var(--ink); background: #fff;
  border: 2px solid #D9D3E6; border-radius: 14px; padding: 11px 14px; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(106,43,176,.15); }
.field { margin-bottom: 18px; }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field .err-msg { color: var(--err); font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--purple); flex: none; }
.money-input { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.money-input span { font-weight: 800; color: var(--navy); }
.form-error { background: #FDECEA; border: 2px solid #F3C2BD; color: var(--err); padding: 12px 14px; border-radius: 14px; font-weight: 700; margin-bottom: 16px; }
.form-ok { background: var(--green); border: 2px solid var(--green-b); color: var(--green-d); padding: 12px 14px; border-radius: 14px; font-weight: 700; margin-bottom: 16px; }

/* Escolhas grandes */
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; padding: 0; border: 0; }
.choices legend { padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--lilac-b); background: #fff; font-weight: 800; color: var(--navy); cursor: pointer; }
.choice input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.choice span svg { width: 22px; height: 22px; }

.seg { display: inline-flex; background: var(--lilac); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 8px; }
.seg button { border: 0; background: transparent; font: 800 14.5px var(--font); color: var(--purple-strong); padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Conteúdo dos módulos ---------- */
.step-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.step-head .sym { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; flex: none; background: #fff; border: 2px solid var(--line); }
.step-head .sym svg { width: 36px; height: 36px; }
.content-card { background: var(--paper); border: 2px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
.content-card + .content-card { margin-top: 18px; }
.content-card > h3 { color: var(--purple); }
.content-card .optional { margin-bottom: 12px; }
.box { border-radius: 18px; padding: 16px 18px; margin: 14px 0; border: 2px solid var(--line); background: #FFFEFA; }
.box > h4 { margin-bottom: 6px; }
.callout { display: flex; gap: 12px; align-items: flex-start; border-radius: 18px; padding: 14px 16px; margin: 14px 0; font-weight: 700; }
.callout svg { width: 26px; height: 26px; flex: none; margin-top: 1px; }
.callout.info { background: var(--blue); color: #183E78; }
.callout.star { background: var(--yellow); color: #5A4100; }
.callout.warn { background: #FFF0DE; color: #7A3E00; border: 2px solid #F6CF9F; }
.callout p { margin: 0; }
.callout strong.t { display: block; font-family: var(--font-h); font-size: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.tag { background: #fff; border: 2px dashed var(--lilac-b); border-radius: 12px; padding: 4px 12px; font-weight: 800; color: var(--navy); font-size: 15px; }
.adult-note { background: #F4F6FB; border: 2px dashed #C5CBE0; border-radius: 16px; padding: 12px 14px; margin: 12px 0; font-size: 15px; color: #36406A; }
.adult-note b { color: var(--navy); }
.qfield { margin: 18px 0; }
.qfield > .lbl { font-size: 17.5px; }
.content-img { border-radius: 18px; overflow: hidden; border: 2px solid var(--line); margin: 6px 0 14px; }
ul.content-list { padding-left: 1.2em; margin: 0 0 .8em; }
ul.content-list li { margin: .25em 0; }
ul.checks-list { list-style: none; padding: 0; }
ul.checks-list li { display: flex; gap: 8px; }
ul.checks-list li::before { content: '✓'; color: var(--ok); font-weight: 900; }

.calc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 17.5px; margin: 10px 0; }
.calc input { width: 92px; min-height: 44px; text-align: center; font-weight: 800; padding: 8px; }
.calc .ok { color: var(--ok); }
.calc .retry { color: var(--warn); }
.feedback { margin-top: 6px; font-weight: 700; font-size: 15.5px; }
.feedback.ok { color: var(--ok); }
.feedback.retry { color: var(--warn); }

/* Barra de etapas */
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(28,39,102,.15); }
.dots span.on { background: var(--purple); }
.dots span.done { background: var(--ok); }

.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.step-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--paper); border: 2px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.step-list a:hover { border-color: var(--lilac-b); background: #FCFAFF; }
.step-list .st { margin-left: auto; }
.step-list .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--lilac); color: var(--purple); flex: none; }
.step-list .ic svg { width: 22px; height: 22px; }

.runner-nav { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--cream) 24%); padding: 22px 0 14px; margin-top: 16px; z-index: 5; }
.runner-nav .row { justify-content: space-between; }
.save-status { font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
.save-status.saving { color: var(--blue-d); }
.save-status.saved { color: var(--ok); }
.save-status.error { color: var(--err); }

/* Modo infantil: maior e mais simples */
body.child { font-size: 19px; }
body.child .content-card { padding: 26px; }
body.child .btn { min-height: 56px; font-size: 18px; }
body.child .choice span { min-height: 56px; font-size: 18px; padding: 12px 22px; }
body.child textarea, body.child input { font-size: 19px; }
.child-home-tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 26px 18px; border-radius: 28px; text-decoration: none; color: var(--navy); font-family: var(--font-h); font-weight: 800; font-size: 24px; border: 3px solid transparent; min-height: 170px; box-shadow: var(--shadow); }
.tile svg { width: 56px; height: 56px; }
.tile:hover { transform: translateY(-2px); color: var(--navy); }

/* ---------- Pintura ---------- */
.paint { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .paint { grid-template-columns: 1fr 300px; align-items: start; } }
.paint-stage { background: #fff; border: 2px solid var(--line); border-radius: 22px; overflow: auto; max-height: 78vh; position: relative; touch-action: none; }
.paint-stage.pan { touch-action: pan-x pan-y; cursor: grab; }
.paint-stage canvas { display: block; width: 100%; height: auto; margin: 0 auto; }
.paint-tools { background: var(--paper); border: 2px solid var(--line); border-radius: 22px; padding: 14px; display: grid; gap: 14px; }
@media (max-width: 979px) { .paint-tools { box-shadow: var(--shadow); } .swatches { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); } }
.toolrow { display: flex; flex-wrap: wrap; gap: 8px; }
.tool { border: 2px solid var(--line); background: #fff; border-radius: 14px; min-width: 52px; min-height: 52px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 800 12px var(--font); color: var(--navy); cursor: pointer; padding: 4px 8px; }
.tool svg { width: 24px; height: 24px; }
.tool[aria-pressed="true"] { background: var(--purple); color: #fff; border-color: var(--purple); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; }
.swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #D9D3E6; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--navy); transform: scale(1.08); }
.color-custom { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.color-custom input { width: 48px; height: 40px; border: 0; padding: 0; background: none; }
.thumb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.thumb { text-decoration: none; color: var(--navy); background: #fff; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.thumb img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; background: #fff; }
.thumb span { padding: 8px 12px 12px; font-weight: 800; font-size: 15px; }
.thumb:hover { border-color: var(--lilac-b); }

/* Passaporte */
.passport-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pass-item { border-radius: 22px; padding: 14px; border: 2px solid; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.pass-item .sym-img { width: 100%; max-width: 200px; aspect-ratio: 1.2; background: #fff; border-radius: 16px; display: grid; place-items: center; overflow: hidden; }
.pass-item .sym-img img { max-height: 100%; object-fit: contain; }
.pass-item h3 { margin: 0; font-size: 22px; letter-spacing: .02em; }

/* Certificado */
.certificate { background: #fff; border: 3px solid var(--lilac-b); border-radius: 30px; padding: clamp(20px, 5vw, 48px); text-align: center; position: relative; box-shadow: var(--shadow); }
.certificate::before { content: ''; position: absolute; inset: 10px; border: 2px dashed var(--lilac-b); border-radius: 22px; pointer-events: none; }
.certificate .who { font-family: var(--font-h); font-size: clamp(30px, 6vw, 48px); color: var(--purple); font-weight: 800; border-bottom: 3px dotted var(--lilac-b); display: inline-block; padding: 0 20px; margin: 4px 0 14px; }
.certificate .powers { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }

/* Widgets */
.market-items { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.product { border: 2px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; font: inherit; color: var(--navy); }
.product svg { width: 48px; height: 48px; }
.product .price { font-family: var(--font-h); font-weight: 800; font-size: 22px; }
.product[aria-pressed="true"] { border-color: var(--purple); background: var(--lilac); box-shadow: 0 0 0 3px rgba(106,43,176,.2); }
.product .name { font-weight: 800; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.totals > div { border-radius: 16px; padding: 12px; background: #fff; border: 2px solid var(--line); text-align: center; }
.totals b { display: block; font-family: var(--font-h); font-size: 26px; color: var(--navy); }
.totals .neg b { color: var(--err); }
@media (max-width: 480px) { .totals b { font-size: 21px; } }
.trail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.trail button { width: 64px; height: 64px; border-radius: 50%; border: 3px dashed var(--yellow-b); background: #fff; font: 800 14px var(--font); color: var(--navy); cursor: pointer; }
.trail button[aria-pressed="true"] { background: var(--star); border-style: solid; border-color: #E0A800; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; align-items: center; }
.token { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, #F2B705); border: 2px solid #C99200; }
.token.added { background: radial-gradient(circle at 35% 35%, #CFF5C2, #5DBB4A); border-color: #2F7A2F; }
.token.removed { background: #fff; border: 2px dashed #C99200; opacity: .6; }
.ledger { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.ledger th, .ledger td { text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--line); }
.ledger td.num, .ledger th.num { text-align: right; white-space: nowrap; }

/* Tabelas da administração */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1.5px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #FAF8FF; color: var(--navy); font-weight: 800; white-space: nowrap; }
.admin-layout { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .admin-layout { grid-template-columns: 220px 1fr; } }
.admin-side { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 979px) { .admin-side { flex-direction: row; overflow-x: auto; padding-bottom: 4px; } .admin-side a { white-space: nowrap; } }
.admin-side a { text-decoration: none; font-weight: 800; color: var(--navy); padding: 10px 14px; border-radius: 12px; }
.admin-side a[aria-current="page"], .admin-side a:hover { background: var(--lilac); color: var(--purple-strong); }
.editor-split { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .editor-split { grid-template-columns: 1fr 1fr; } }
textarea.code { font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 520px; white-space: pre; }
.text-edit-item { border-left: 4px solid var(--lilac-b); padding-left: 12px; margin-bottom: 14px; }
.text-edit-item .path { font-size: 12.5px; color: var(--muted); font-weight: 700; }

/* Estados */
.state { text-align: center; padding: 40px 16px; color: var(--muted); }
.state svg { width: 48px; height: 48px; color: var(--lilac-d); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--lilac-b); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }

/* Toast e modal */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(92vw, 460px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow); }
.toast.ok { background: #1F5E2A; }
.toast.err { background: var(--err); }
.modal-back { position: fixed; inset: 0; background: rgba(28, 39, 102, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--paper); border-radius: 24px; padding: 24px; width: min(100%, 480px); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 26px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.pin-input { font-size: 30px !important; letter-spacing: .4em; text-align: center; font-weight: 800 !important; }

/* Página inicial pública */
.landing-hero { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; padding: 18px 0; }
@media (min-width: 900px) { .landing-hero { grid-template-columns: 1.05fr 1fr; } }
.landing-hero .art { border-radius: 28px; overflow: hidden; border: 3px solid var(--lilac-b); box-shadow: var(--shadow); }
.power-strip { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); margin: 18px 0; }
@media (max-width: 560px) { .power-strip { grid-template-columns: repeat(3, 1fr); } }
.power { border-radius: 18px; padding: 12px 6px; text-align: center; font-family: var(--font-h); font-weight: 800; color: var(--navy); border: 2px solid; font-size: 15px; }
.power svg { width: 34px; height: 34px; margin: 0 auto 4px; display: block; }
.auth-box { max-width: 460px; margin: 10px auto; }
footer.site { border-top: 2px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14.5px; }
footer.site a { color: var(--muted); }

/* Impressão */
#print-area { display: none; }
@media print {
  body { background: #fff !important; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; }
  #print-area img { width: 100%; max-height: 100vh; object-fit: contain; }
  .no-print, .topbar, .child-top, .runner-nav, footer.site, .toasts { display: none !important; }
  .certificate { box-shadow: none; border-color: #999; }
  main { padding: 0; }
}

/* Ajustes */
.btn.menu-btn { display: none; }
@media (max-width: 860px) { .btn.menu-btn { display: inline-flex; } }
.nav a.btn, .nav a.btn:hover { color: #fff; background: var(--purple); }
[tabindex="-1"]:focus { box-shadow: none; outline: none; }
.save-status svg { width: 18px; height: 18px; flex: none; }
.paint-stage canvas { height: auto; }
.tiles-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tiles-3 .tile { min-height: 130px; font-size: 21px; }
@media (max-width: 600px) { .hide-sm { display: none; } .runner-nav .save-status { font-size: 12.5px; } }
.child-top .wrap { flex-wrap: nowrap; }
.child-top .who { min-width: 0; }
.child-top .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.child-top .row { flex-wrap: nowrap; gap: 6px; }
.runner-nav .row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.runner-nav .row > :nth-child(2) { text-align: center; justify-self: center; }
.market-items { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
@media (max-width: 600px) {
  .content-card, body.child .content-card { padding: 16px; border-radius: 20px; }
  .box { padding: 12px; }
  .totals { gap: 6px; }
  .totals > div { padding: 8px 4px; font-size: 13.5px; }
  .totals b { font-size: 18px; }
  .runner-nav .btn { padding: 10px 14px; }
  .runner-nav .btn .lbl-long { display: none; }
  body.child .btn { font-size: 17px; }
  .child-top .who { font-size: 17px; }
  .product { padding: 10px; }
  .product svg { width: 36px; height: 36px; }
  .product .price { font-size: 19px; }
  h1 { font-size: 30px; }
}
