:root {
  --creme: #F7F0E6;
  --papel: #FFFDF9;
  --ardosia: #3F555C;
  --escuro: #2E4046;
  --secundario: #516A72;
  --dourado: #EFC165;
  --borda: #E6D9C4;
  --bege: #DCCDB6;
  --claro: #E8E0D3;
  --font: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--creme);
  color: var(--escuro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ardosia); }
a:hover { color: var(--escuro); }
button { font-family: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; flex-direction: column; min-height: 100dvh; }
.screen.active { display: flex; }

/* cabeçalho */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; }
.brand { font-size: 18px; font-weight: 800; }
.logo { width: 150px; height: auto; display: block; }
.help-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; background: var(--escuro); color: var(--papel); border: none;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.icon-btn { width: 44px; height: 44px; border: none; background: transparent; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 0; }

/* entrada */
.entry-main { flex: 1; padding: 4px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--secundario); }
h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; }
.lead { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ardosia); }
.card { background: var(--papel); border: 1px solid var(--borda); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.45; }
.card p { margin: 0; }
.note { background: var(--creme); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.35; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ardosia); flex-shrink: 0; }
.entry-foot { padding: 12px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.primary {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 14px;
  background: var(--dourado); color: var(--escuro); border: none; font-size: 16px; font-weight: 800; text-decoration: none;
}
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 14px; padding: 0 18px;
  background: var(--papel); color: var(--escuro); border: 1.5px solid var(--ardosia); font-size: 14px; font-weight: 700; text-decoration: none;
}
.dark-btn { background: var(--escuro); color: var(--papel); border: none; }
.foot-note { margin: 0; text-align: center; font-size: 12px; color: var(--secundario); }
.error-text { color: #8a2f2f; font-size: 13px; text-align: center; margin: 0; }

/* trilha */
.trail { padding: 6px 20px 14px; border-bottom: 1px solid var(--borda); }
.trail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.trail-line, .trail-fill { position: absolute; left: 12.5%; top: 11px; height: 3px; border-radius: 2px; }
.trail-line { right: 12.5%; background: var(--bege); }
.trail-fill { width: 0; background: var(--dourado); transition: width .5s ease; }
.stop { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.dot {
  width: 25px; height: 25px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: var(--creme); border: 2px solid var(--bege); color: var(--secundario);
  transition: all .3s ease;
}
.stop-label { font-size: 11.5px; font-weight: 500; text-align: center; line-height: 1.2; color: var(--secundario); }
.stop.done .dot { background: var(--ardosia); border-color: var(--ardosia); }
.stop.done .stop-label { color: var(--escuro); font-weight: 600; }
.stop.current .dot { background: var(--dourado); border-color: var(--dourado); color: var(--escuro); font-weight: 800; box-shadow: 0 0 0 5px rgba(239,193,101,.35); }
.stop.current .stop-label { color: var(--escuro); font-weight: 700; }

/* conversa */
.chat { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 88%; padding: 12px 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bot { align-self: flex-start; background: var(--papel); border: 1px solid var(--borda); border-radius: 18px 18px 18px 4px; }
.user { align-self: flex-end; max-width: 80%; background: var(--ardosia); color: var(--papel); border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.bot.crisis-msg { border: 2px solid var(--escuro); }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--secundario); opacity: .4; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 2px; }
.chip {
  min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ardosia);
  background: var(--creme); color: var(--escuro); font-size: 14px; font-weight: 600; text-align: left; line-height: 1.25;
}
.chip:hover, .chip:focus-visible { background: var(--dourado); }
.composer { padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--creme); }
.composer form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.composer textarea {
  flex: 1; min-height: 48px; max-height: 140px; resize: none; border: 1.5px solid var(--bege); border-radius: 16px;
  background: var(--papel); padding: 13px 14px; font-family: inherit; font-size: 16px; color: var(--escuro); line-height: 1.35;
}
.composer textarea:focus { outline: 2px solid var(--ardosia); outline-offset: 1px; }
.send { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--escuro); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send:disabled { opacity: .5; }
.locked-bar { background: var(--papel); border: 1px solid var(--borda); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.locked-bar a { font-weight: 800; }

/* menu */
.menu { position: fixed; inset: 0; background: rgba(46,64,70,.55); display: none; align-items: flex-start; justify-content: center; z-index: 30; }
.menu.open { display: flex; }
.menu-panel { width: min(520px, 100%); background: var(--creme); border-radius: 0 0 22px 22px; padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 10px; }

/* crise */
.overlay { position: fixed; inset: 0; background: rgba(46,64,70,.82); display: none; align-items: flex-end; justify-content: center; z-index: 40; }
.overlay.open { display: flex; }
.sheet { width: min(520px, 100%); background: var(--creme); border-radius: 26px 26px 0 0; padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 14px; max-height: 92dvh; overflow-y: auto; }
.sheet h2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 800; }
.sheet p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ardosia); }
.call { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-radius: 16px; background: var(--papel); border: 1.5px solid var(--ardosia); color: var(--escuro); text-decoration: none; }
.call.main { background: var(--escuro); color: var(--papel); border-color: var(--escuro); }
.call .num { font-size: 26px; font-weight: 800; min-width: 58px; }
.call.main .num { color: var(--dourado); }
.call .what { display: flex; flex-direction: column; gap: 2px; }
.call .what strong { font-size: 15px; }
.call .what span { font-size: 12.5px; color: var(--secundario); }
.call.main .what span { color: var(--claro); }

/* resumo */
.summary-main { flex: 1; padding: 6px 16px 0; display: flex; flex-direction: column; gap: 14px; }
.summary-card { background: var(--escuro); color: var(--papel); border-radius: 22px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.summary-card h1 { font-size: 20px; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill { font-size: 12px; font-weight: 700; color: var(--escuro); background: var(--dourado); border-radius: 999px; padding: 5px 10px; }
.sum-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sum-list li { display: flex; gap: 12px; }
.sum-n { width: 24px; height: 24px; border-radius: 50%; background: var(--dourado); color: var(--escuro); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sum-t { display: flex; flex-direction: column; gap: 2px; }
.sum-t small { font-size: 12px; color: var(--claro); }
.sum-t span { font-size: 14.5px; line-height: 1.4; }
.next { background: var(--ardosia); border-radius: 14px; padding: 11px 13px; font-size: 13.5px; line-height: 1.45; }
.next strong { color: var(--dourado); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-links { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.45; }
.summary-foot { padding: 10px 16px 20px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--borda); margin-top: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.link-btn { min-height: 44px; border: none; background: transparent; color: var(--ardosia); font-size: 12.5px; font-weight: 700; text-decoration: underline; padding: 0; }

/* telas simples */
.simple-main { flex: 1; padding: 0 28px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.simple-main p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ardosia); }
.simple-foot { padding: 14px 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.help-card { background: var(--papel); border: 1px solid var(--borda); border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.45; }
.help-card a { font-weight: 800; }
.err-calls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.err-calls a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border-radius: 12px; background: var(--papel); color: var(--escuro); text-decoration: none; }
.err-calls a.main { background: var(--dourado); }
.err-calls strong { font-size: 20px; } .err-calls span { font-size: 11.5px; font-weight: 600; }
.help-dark { background: var(--escuro); color: var(--papel); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.help-dark h2 { margin: 0; font-size: 15px; font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--escuro); color: var(--papel); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
