/* Púlpito Pronto — vinho e dourado, leitura confortável, celular primeiro */
:root {
  --bg: #f4f2ef; --surface: #ffffff; --surface-2: #f6f3ef; --ink: #2d2a27; --muted: #6e6862; --line: #e7e1d9;
  --wine: #6b0f1a; --wine-2: #861726; --wine-ink: #ffffff; --wine-box: #6b0f1a; --verse-bg: #fbf4f3;
  --gold: #a87a0b; --gold-soft: #fdf8ee; --gold-line: #efdfbb; --mark: #fff0bf; --ok: #2f6b45; --warn: #9a4a0f;
  --font-display: "Merriweather", Georgia, "Times New Roman", serif;
  --font-body: "Lato", "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151210; --surface: #1e1a17; --surface-2: #26211d; --ink: #ede6de; --muted: #aaa096; --line: #3a322b;
    --wine: #ec98a0; --wine-2: #f3b0b6; --wine-ink: #1e1a17; --wine-box: #5c0d17; --verse-bg: #2a1c1c;
    --gold: #e2b85c; --gold-soft: #262016; --gold-line: #4a3c22; --mark: #3d3412; --ok: #7cc597; --warn: #f0b27a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }
a { color: var(--wine); }
.boot { text-align: center; padding: 80px 16px; color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }

/* Barra do topo */
.top { position: sticky; top: 0; z-index: 15; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.logo { font-family: var(--font-display); font-weight: 900; font-size: 19px; color: var(--wine); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--gold); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; }
.nav a[aria-current="page"] { background: var(--verse-bg); color: var(--wine); }
.nav a:hover { color: var(--wine); }
.nav a.btn, .nav a.btn:hover { color: var(--wine-ink); }
.tabbar, .btn.only-mobile { display: none; }
@media (max-width: 760px) {
  .nav.app-nav { display: none; }
  .btn.only-mobile { display: inline-flex; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; padding: 9px 4px 8px; display: flex; flex-direction: column; gap: 2px; align-items: center; }
  .tabbar a b { font-size: 19px; line-height: 1; font-weight: 400; }
  .tabbar a[aria-current="page"] { color: var(--wine); }
  body.logged { padding-bottom: 68px; }
}

/* Botões e campos */
.btn { font: inherit; font-weight: 700; border-radius: 9px; padding: 11px 18px; cursor: pointer; border: 1px solid var(--wine); background: var(--wine); color: var(--wine-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: var(--wine-2); border-color: var(--wine-2); }
.btn.ghost { background: transparent; color: var(--wine); }
.btn.ghost:hover { background: var(--verse-bg); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 13.5px; }
.btn.big { padding: 15px 26px; font-size: 17px; }
.btn.danger { background: transparent; border-color: var(--line); color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label.lbl, legend.lbl { font-weight: 700; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
label.lbl em { font-style: normal; font-weight: 400; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .row2 { grid-template-columns: 1fr; } }
input[type=text], input[type=email], input[type=password], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; }
textarea { resize: vertical; min-height: 96px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page { padding-block: 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; font-size: clamp(22px, 3.2vw, 30px); color: var(--wine); }
.step-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; }
.step-title .n { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; color: var(--wine-ink); background: var(--wine); border-radius: 999px; width: 24px; height: 24px; display: inline-grid; place-items: center; flex: none; }
.tag { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 0; }
.notice { font-size: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 9px; padding: 10px 14px; margin: 0; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14.5px; max-width: 92vw; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
#toast.err { background: var(--warn); color: #fff; }

/* Página de venda */
.hero { padding: clamp(36px, 7vw, 84px) 0 clamp(28px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-weight: 900; font-size: clamp(31px, 5.2vw, 52px); line-height: 1.12; margin: 10px 0 16px; color: var(--wine); }
.hero p.lead { font-size: clamp(17px, 2vw, 19.5px); color: var(--muted); max-width: 56ch; margin: 0 0 24px; }
.hero .mini { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 18px 50px rgba(60,40,20,.12); transform: rotate(-.6deg); }
.paper h3 { color: var(--wine); font-size: 21px; margin: 0 0 4px; text-align: center; }
.paper .meta { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.paper .vh { background: var(--wine-box); color: #fff; border-radius: 10px; padding: 14px 16px; font-family: var(--font-display); font-style: italic; font-size: 14px; text-align: center; line-height: 1.6; }
.paper .vh b { display: block; font: 700 11px var(--font-body); letter-spacing: .1em; color: #f3d9a4; margin-top: 6px; font-style: normal; }
.paper h4 { font-family: var(--font-display); color: var(--wine); margin: 16px 0 4px; font-size: 16px; }
.paper .lab { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--gold); margin: 8px 0 2px; }
.paper p { margin: 0 0 6px; font-size: 14px; }
.paper .ap { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 9px; padding: 8px 12px; }
.paper .imp { font-family: var(--font-display); font-weight: 700; color: var(--wine); }
.band { background: var(--surface); border-block: 1px solid var(--line); padding: clamp(32px, 6vw, 64px) 0; }
.sec-title { font-size: clamp(23px, 3.4vw, 32px); color: var(--wine); margin: 6px 0 22px; }
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: st; }
.steps3 > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; counter-increment: st; }
.steps3 > div::before { content: counter(st); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--wine); color: var(--wine-ink); font-weight: 700; margin-bottom: 10px; }
.steps3 h3 { margin: 0 0 6px; font-size: 18px; }
.steps3 p { margin: 0; color: var(--muted); }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 28px; padding: 0; margin: 0; list-style: none; }
.feats li { padding-left: 28px; position: relative; }
.feats li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; font-size: 18px; }
.feats b { display: block; }
.feats span { color: var(--muted); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan.best { border: 2px solid var(--gold); }
.plan h3 { margin: 0; font-size: 19px; }
.plan .price { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--wine); }
.plan .price small { font: 400 14px var(--font-body); color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; flex: 1; }
.foot { padding: 28px 0 40px; color: var(--muted); font-size: 13.5px; text-align: center; }
@media (max-width: 760px) { .steps3 { grid-template-columns: 1fr; } .paper { transform: none; } }

/* Entrar / criar conta */
.auth { max-width: 420px; margin: clamp(24px, 6vw, 64px) auto; }
.auth h1 { font-size: 26px; color: var(--wine); margin: 0; }

/* Listas */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.item h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.item .grow { flex: 1 1 220px; min-width: 0; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--ink); white-space: nowrap; }
.pill.ok { border-color: transparent; background: var(--verse-bg); color: var(--wine); }
.empty { color: var(--muted); text-align: center; padding: 34px 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty .big { font-family: var(--font-display); font-size: 22px; color: var(--wine); font-weight: 700; }

/* Perfil: materiais */
.drop { border: 2px dashed var(--gold-line); background: var(--gold-soft); border-radius: var(--radius); padding: 22px 16px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--wine); }
.drop b { display: block; font-size: 16.5px; }
.drop span { color: var(--muted); font-size: 13.5px; }
.mats { display: flex; flex-direction: column; gap: 6px; }
.mat { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 14px; }
.mat .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat small { color: var(--muted); white-space: nowrap; }
.mat.err small { color: var(--warn); white-space: normal; }
.mat button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--gold-line); border-top-color: var(--wine); border-radius: 50%; animation: sp 0.8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
#dna { min-height: 360px; font-size: 14.5px; line-height: 1.55; }

/* Gerador */
.grid { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.groups { display: flex; flex-direction: column; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.card { text-align: left; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card b { font-size: 14px; }
.card small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.card:hover { border-color: var(--wine); }
.card[aria-pressed="true"] { border-color: var(--wine); background: var(--verse-bg); box-shadow: inset 3px 0 0 var(--wine); }
.model-detail { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.model-detail h3 { margin: 0 0 4px; font-size: 16.5px; color: var(--wine); }
.model-detail p { margin: 0 0 4px; }
.model-detail ol { margin: 4px 0 0; padding-left: 20px; }
.verses { display: flex; align-items: center; gap: 12px; }
.verses input[type=range] { flex: 1; accent-color: var(--wine); }
.verses output { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; min-width: 2.2ch; text-align: right; color: var(--wine); }
.verses .lvl { font-size: 13px; color: var(--muted); min-width: 8ch; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; }
@media (max-width: 460px) { .checks { grid-template-columns: 1fr; } }
.checks label { display: flex; gap: 8px; align-items: flex-start; }
.checks input { accent-color: var(--wine); margin-top: 4px; }
.checks small { color: var(--muted); display: block; font-size: 12.5px; }
fieldset { border: 0; padding: 0; margin: 0; }
.understand { border: 1px dashed var(--wine); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.understand .quote { font-family: var(--font-display); font-size: 16px; line-height: 1.55; margin: 0; font-style: italic; }
.list-box { font-size: 14px; border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.list-box.ask { background: var(--gold-soft); }
.list-box h4 { margin: 0 0 4px; font: 700 12px var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.list-box ul { margin: 0; padding-left: 18px; }
.out-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.status { font-size: 14px; color: var(--muted); min-height: 1.5em; margin: 0; }
.status.err { color: var(--warn); }
.review { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.review-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.review-head b { font-family: var(--font-display); color: var(--wine); }
.review ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 16px; font-size: 13.5px; }
.review li { display: flex; gap: 8px; align-items: baseline; }
.review li .i { flex: none; font-weight: 700; width: 1.2em; text-align: center; }
.review li.ok .i { color: var(--ok); } .review li.no .i { color: var(--warn); }
.review li small { color: var(--muted); display: block; }

/* A folha da pregação */
.sermon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4.5vw, 56px) clamp(14px, 4.5vw, 64px); min-width: 0; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(60,40,20,.06); }
.sermon .doc { max-width: 70ch; margin: 0 auto; font-size: 17px; line-height: 1.75; }
.sec { position: relative; border-radius: 8px; padding: 2px 10px; margin: 0 -10px; }
.sec:hover { background: var(--surface-2); }
.sec-tools { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin: 2px 0 6px; }
.sec-tools button { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface); color: var(--wine); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.sec textarea.sec-edit { min-height: 280px; font-size: 15px; line-height: 1.55; margin-top: 6px; }
.sermon h1 { font-weight: 900; color: var(--wine); font-size: clamp(26px, 3.8vw, 38px); line-height: 1.2; margin: 6px 0 10px; text-align: center; }
.sermon .meta { color: var(--muted); font-size: 13.5px; text-align: center; margin: 0; line-height: 1.6; }
.ornament { display: flex; align-items: center; gap: 12px; color: var(--gold); margin: 18px 0 24px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sermon h2 { font-weight: 700; color: var(--wine); font-size: 22px; line-height: 1.35; margin: 34px 0 12px; }
.sermon h3 { font: 700 12px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 20px 0 8px; }
.sermon p { margin: 0 0 14px; white-space: pre-line; }
.sermon ul, .sermon ol { margin: 0 0 14px; padding-left: 24px; }
.sermon li::marker { color: var(--gold); font-weight: 700; }
.sermon .ref { color: var(--wine); font-weight: 700; white-space: nowrap; }
.sermon .verse { margin: 12px 0 18px; padding: 12px 16px 12px 18px; background: var(--verse-bg); border-left: 3px solid var(--wine); border-radius: 0 10px 10px 0; font-family: var(--font-display); font-style: italic; font-size: 15.5px; line-height: 1.7; }
.sermon .verse .vref { display: block; margin-top: 6px; font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--wine); }
.sermon .verse .vref::before { content: "✝ "; }
.sermon .hero-label { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); text-align: center; margin: 0 0 10px; }
.sermon .verse-hero { margin: 0 0 18px; padding: 22px 24px; background: var(--wine-box); color: #fff; border-radius: 12px; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 16.5px; line-height: 1.7; }
.sermon .verse-hero .vref { display: block; margin-top: 10px; font: 700 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: #f3d9a4; }
.sermon .box-apply { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: 4px 18px 6px; margin: 8px 0 18px; }
.sermon .box-pray { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 2px; margin: 4px 0 18px; font-family: var(--font-display); font-style: italic; }
.sermon .impact { font-family: var(--font-display); font-weight: 700; color: var(--wine); font-size: 18px; line-height: 1.6; margin: 16px 0; }
.sermon .callout { font-size: 14.5px; line-height: 1.65; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.sermon .callout strong { color: var(--gold); }
.sermon .note { color: var(--muted); font-style: italic; }
.sermon .target { background: var(--mark) !important; border-radius: 4px; box-shadow: 0 0 0 4px var(--mark); }
.sermon .changed { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--mark); } to { background: transparent; } }
.edit-tip { font-size: 13.5px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 8px; padding: 8px 12px; margin: 0; }

/* Barra de mudança por trecho */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 2px solid var(--gold); box-shadow: 0 -8px 28px rgba(0,0,0,.16); padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-height: 80vh; overflow: auto; }
.bar-inner { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bar-head b { font-family: var(--font-display); font-size: 17px; color: var(--wine); }
.bar .excerpt { font-size: 14px; color: var(--muted); border-left: 3px solid var(--gold); padding-left: 10px; max-height: 3.2em; overflow: hidden; margin: 0; font-style: italic; }
.bar textarea { min-height: 64px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
body.bar-open { padding-bottom: 340px; }
@media (prefers-reduced-motion: reduce) { .sermon .changed, .spin { animation: none; } }
