/* Customizações além do Tailwind — usa @apply em classes utilitárias. */
.input {
  @apply w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-lb-primary focus:border-lb-primary outline-none;
}
.btn-primary {
  @apply bg-lb-primary text-white rounded-lg px-4 py-2 text-sm font-semibold hover:bg-slate-800 transition disabled:opacity-50;
}
.card-home {
  @apply bg-white rounded-xl p-4 shadow hover:shadow-md transition flex flex-col items-start gap-2 text-sm font-medium text-slate-800;
}
.msg-bubble {
  @apply max-w-[85%] px-3 py-2 rounded-2xl text-sm whitespace-pre-wrap;
}
.msg-user { @apply bg-lb-primary text-white ml-auto rounded-br-sm; }
.msg-ia { @apply bg-white border border-slate-200 rounded-bl-sm; }
.msg-contador { @apply bg-lb-gold/20 border border-lb-gold rounded-bl-sm; }

/* Como Tailwind CDN não processa @apply, reescrevemos em CSS puro abaixo (fallback) */
.input { width:100%; border:1px solid #cbd5e1; border-radius:.5rem; padding:.5rem .75rem; font-size:.875rem; outline:none; }
.input:focus { border-color:#1a2e4a; box-shadow:0 0 0 2px rgba(26,46,74,.25); }
.btn-primary { background:#1a2e4a; color:#fff; border-radius:.5rem; padding:.5rem 1rem; font-size:.875rem; font-weight:600; }
.btn-primary:hover { background:#0f172a; }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.card-home { background:#fff; border-radius:.75rem; padding:1rem; box-shadow:0 1px 3px rgba(0,0,0,.1); display:flex; flex-direction:column; gap:.5rem; align-items:flex-start; font-size:.875rem; font-weight:500; color:#1e293b; }
.card-home:hover { box-shadow:0 4px 10px rgba(0,0,0,.08); }
.msg-bubble { max-width: 92%; padding: .65rem .9rem; border-radius: 1.1rem; font-size: .9rem; white-space: pre-wrap; line-height: 1.55; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.msg-user { background: linear-gradient(135deg, #1a2e4a 0%, #243b5f 100%); color: #fff; margin-left: auto; border-bottom-right-radius: .3rem; }
.msg-ia { background: #ffffff; border: 1px solid #e2e8f0; border-bottom-left-radius: .3rem; color: #0f172a; }
.msg-contador { background: linear-gradient(180deg, #fff8e6 0%, #fdf4d7 100%); border: 1px solid #c9a84c; border-bottom-left-radius: .3rem; }

/* Avatar ao lado do balão da IA/contador */
.msg-row { display: flex; align-items: flex-end; gap: .5rem; margin: .15rem 0; }
.msg-row.from-user { justify-content: flex-end; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.msg-avatar.ia { background: linear-gradient(135deg, #1a2e4a, #0f172a); color: #c9a84c; }
.msg-avatar.contador { background: #c9a84c; color: #1a2e4a; }
.screen { animation: fadein .15s ease; }
@keyframes fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.msg-row { animation: msgin .18s ease; }
@keyframes msgin { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.dot-pulse { animation: dotp 1.1s ease-in-out infinite; display:inline-block; font-size:1.2em; line-height:1; color:#1a2e4a; }
@keyframes dotp { 0%,80%,100% { opacity:.2; transform:translateY(0); } 40% { opacity:1; transform:translateY(-3px); } }

/* Resultado das calculadoras */
.resultado-calc { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .65rem; padding: .75rem; font-size: .85rem; }
.resultado-calc .resgrupo { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .55rem .75rem; margin: .35rem 0; }
.resultado-calc .resgrupo h5 { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: 0 0 .25rem; font-weight: 600; }
.resultado-calc .resgrupo dl { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; margin: 0; }
.resultado-calc .resgrupo dt { color: #475569; font-size: .8rem; }
.resultado-calc .resgrupo dd { margin: 0; font-weight: 500; color: #0f172a; text-align: right; }
.resultado-calc .resitem { display: flex; justify-content: space-between; align-items: center; padding: .4rem .6rem; border-bottom: 1px solid #e2e8f0; }
.resultado-calc .resitem:last-of-type { border-bottom: none; }
.resultado-calc .resitem span { color: #475569; }
.resultado-calc .resitem strong { color: #0f172a; font-weight: 600; }
.resultado-calc .resitem.destaque { background: linear-gradient(90deg, #fef3c7 0%, #fef9e0 100%); border: 1px solid #fde68a; border-radius: .5rem; margin-top: .5rem; padding: .55rem .8rem; font-size: .92rem; }
.resultado-calc .resitem.destaque span { color: #78350f; font-weight: 600; }
.resultado-calc .resitem.destaque strong { color: #1a2e4a; font-size: 1.05rem; }
.resultado-calc .resdisclaimer { margin-top: .55rem; font-size: .72rem; color: #78350f; background: #fef9e0; border-left: 3px solid #c9a84c; padding: .4rem .55rem; border-radius: 0 .35rem .35rem 0; }

/* Markdown renderizado dentro das bolhas da IA */
.md { font-size: .9rem; line-height: 1.55; color: #0f172a; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-weight: 700; color: #1a2e4a; margin: .85em 0 .35em; line-height: 1.3; letter-spacing: -.01em; }
.md h1 { font-size: 1.05rem; border-bottom: 2px solid #c9a84c; padding-bottom: .2em; display: inline-block; }
.md h2 { font-size: 1rem; color: #1a2e4a; }
.md h2::before { content: ""; display: inline-block; width: 4px; height: 14px; background: #c9a84c; border-radius: 2px; margin-right: .5em; vertical-align: -2px; }
.md h3 { font-size: .92rem; color: #334155; }
.md p { margin: .4em 0; }
.md strong { color: #0f172a; font-weight: 650; }
.md em { color: #475569; }
.md ul, .md ol { margin: .4em 0 .4em 0; padding-left: 1.4em; }
.md ul { list-style: none; padding-left: 0; }
.md ul > li { position: relative; padding-left: 1.15em; margin: .25em 0; }
.md ul > li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: #c9a84c; }
.md ol { list-style: decimal; }
.md ol > li { margin: .25em 0; padding-left: .2em; }
.md ol > li::marker { color: #1a2e4a; font-weight: 700; }
.md code { background: #f1f5f9; color: #0f172a; padding: 2px 6px; border-radius: 4px; font-size: .82em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.md pre { background: #0f172a; color: #e2e8f0; padding: .7em .9em; border-radius: .6rem; overflow-x: auto; margin: .5em 0; font-size: .78rem; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.md pre code { background: transparent; color: inherit; padding: 0; }
.md blockquote { border-left: 3px solid #c9a84c; padding: .4em .8em; color: #475569; margin: .5em 0; background: linear-gradient(90deg, #fff8e6 0%, #fffdf5 100%); border-radius: 0 .5rem .5rem 0; font-style: italic; }
.md a { color: #1a2e4a; text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.md a:hover { color: #c9a84c; }
.md hr { border: none; border-top: 1px dashed #cbd5e1; margin: .8em 0; }
.md table { border-collapse: collapse; font-size: .82rem; margin: .5em 0; width: 100%; }
.md th, .md td { border: 1px solid #e2e8f0; padding: .4em .6em; text-align: left; }
.md th { background: #f8fafc; color: #1a2e4a; font-weight: 600; }
.md tr:nth-child(even) td { background: #fafbfc; }
/* Disclaimer final (tipo "⚠️ Orientação preliminar") em destaque sutil */
.md p:last-child:has(strong) { background: #fef3c7; border: 1px solid #fde68a; padding: .5em .7em; border-radius: .5rem; font-size: .82em; color: #78350f; margin-top: .8em; }


