@font-face {
  font-family: "Schibsted Grotesk"; src: url("/fonte.woff2") format("woff2");
  font-weight: 400 900; font-display: swap;
}
:root {
  --cal: #e9e8e3;        /* reboco */
  --papel: #f8f8f6;
  --grafite: #24272b;
  --suave: #686c72;
  --musgo: #33584b;
  --musgo-escuro: #26443a;
  --travertino: #b8a588;
  --linha: #d6d4cc;
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--grafite); background: var(--cal);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--musgo); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Topo */
.topo { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.1rem; padding-top: max(.7rem, env(safe-area-inset-top)); border-bottom: 1px solid var(--linha); }
.marca strong { display: block; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.marca span { display: block; font-size: .78rem; color: var(--suave); }
@media (max-width: 30rem) { .marca span { display: none; } }
.previas { display: flex; gap: .25rem; align-items: center; }
.previas a { color: var(--grafite); text-decoration: none; font-weight: 500; font-size: .9rem; padding: .45rem .7rem; border-radius: 6px; white-space: nowrap; }
.previas a:hover { background: var(--papel); }
.previas a::after { content: "\2197"; margin-left: .3em; color: var(--musgo); }
.icone { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 6px; background: none; color: var(--suave); fill: currentColor; }
.icone:hover { background: var(--papel); color: var(--grafite); }
.opcoes { position: absolute; right: 1rem; top: calc(100% + .35rem); z-index: 5; min-width: 15rem; background: var(--papel);
  border: 1px solid var(--linha); border-radius: 8px; box-shadow: 0 12px 32px -12px rgb(36 39 43 / .35); padding: .3rem; }
.opcoes button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .65rem .8rem; border-radius: 5px; }
.opcoes button:hover { background: var(--cal); }
.opcoes form { margin: 0; border-top: 1px solid var(--linha); margin-top: .3rem; padding-top: .3rem; }

/* Conversa */
.conversa { flex: 1; overflow-y: auto; padding: 1.5rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.conversa > * { width: 100%; max-width: 42rem; margin-inline: auto; }

.boas-vindas { margin-block: auto; padding-block: 1rem 2rem; }
.boas-vindas h1 { font-size: clamp(2.3rem, 8vw, 3.6rem); line-height: 1.02; font-weight: 750; letter-spacing: -.035em; margin: 0 0 1.1rem; text-wrap: balance; }
.boas-vindas p { max-width: 34rem; margin: 0; color: var(--suave); font-size: 1.05rem; }
.sugestoes { display: flex; flex-direction: column; margin-top: 2rem; border-top: 1px solid var(--grafite); }
.sugestoes button { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--linha); padding: 1rem .15rem; font-size: 1.05rem; font-weight: 500; }
.sugestoes button::after { content: "+"; font-size: 1.4rem; font-weight: 300; color: var(--musgo); line-height: 1; }
.sugestoes button:hover { color: var(--musgo); }

.bolha { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.bolha.lu { align-self: flex-end; width: auto; max-width: min(85%, 34rem); margin-inline: auto 0;
  background: var(--musgo); color: #fff; padding: .7rem 1rem; border-radius: 14px 14px 3px 14px; }
@media (min-width: 46rem) { .bolha.lu { margin-right: calc((100% - 42rem) / 2); } }
.bolha.claude { padding: .1rem 0 .1rem 1rem; border-left: 2px solid var(--travertino); }
.bolha a { color: var(--musgo); font-weight: 600; text-underline-offset: 3px; }
.bolha.lu a { color: #fff; }
.bolha strong { font-weight: 650; }

/* Trabalhando */
.trabalhando { display: flex; align-items: center; gap: .65rem; width: 100%; max-width: 44.2rem; margin-inline: auto;
  padding: .55rem 1.1rem; color: var(--suave); font-size: .9rem; }
.trabalhando button { margin-left: auto; background: none; border: 1px solid var(--linha); border-radius: 6px; padding: .3rem .85rem; }
.trabalhando button:hover { border-color: var(--grafite); color: var(--grafite); }
.bolinha { width: .55rem; height: .55rem; border-radius: 50%; background: var(--musgo); animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .bolinha { animation: none; } }

/* Envio */
.envio { display: flex; align-items: flex-end; gap: .35rem; width: calc(100% - 1.5rem); max-width: 42rem; margin: 0 auto .75rem;
  margin-bottom: max(.75rem, env(safe-area-inset-bottom)); padding: .35rem; background: var(--papel);
  border: 1px solid var(--linha); border-radius: 14px; box-shadow: 0 6px 20px -14px rgb(36 39 43 / .5); }
.envio:focus-within { border-color: var(--grafite); }
.envio textarea { flex: 1; resize: none; border: 0; background: none; padding: .6rem .4rem; font-size: 16px; line-height: 1.4; max-height: 160px; }
.envio textarea:focus { outline: none; }
.envio textarea::placeholder { color: var(--suave); }
.envio button { background: var(--musgo); color: #fff; border: 0; border-radius: 10px; padding: .6rem 1.05rem; font-weight: 600; }
.envio button:hover { background: var(--musgo-escuro); }
.envio button:disabled { opacity: .45; cursor: default; }
.foto { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; color: var(--suave); cursor: pointer; flex: none; }
.foto:hover { background: var(--cal); color: var(--grafite); }
.foto { position: relative; }
.foto input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.foto:focus-within { outline: 2px solid var(--musgo); }

/* Publicação e anexos (acima da caixa de texto) */
.publicacao, .anexos { width: calc(100% - 1.5rem); max-width: 42rem; margin: 0 auto .5rem; }
.publicacao { padding: .55rem .85rem; border-radius: 10px; font-size: .9rem; background: var(--papel); border: 1px solid var(--linha); color: var(--suave); }
.publicacao.no-ar { border-color: var(--musgo); color: var(--musgo); }
.publicacao.falhou { border-color: #9b2c2c; color: #9b2c2c; }
.anexos { display: flex; flex-wrap: wrap; gap: .4rem; }
.anexo { display: inline-flex; align-items: center; gap: .25rem; max-width: 100%; padding: .3rem .3rem .3rem .7rem;
  background: var(--papel); border: 1px solid var(--linha); border-radius: 8px; font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo.enviando { color: var(--suave); padding-right: .7rem; }
.anexo .tirar { border: 0; background: none; width: 1.8rem; height: 1.8rem; border-radius: 6px; font-size: 1.1rem; line-height: 1; color: var(--suave); }
.anexo .tirar:hover { background: var(--cal); color: var(--grafite); }

.soltar { position: fixed; inset: .75rem; z-index: 20; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--musgo); border-radius: 16px; background: rgb(233 232 227 / .92); }
.soltar p { margin: 0; font-size: 1.4rem; font-weight: 650; color: var(--musgo); }

/* Versões anteriores */
.versoes { width: min(36rem, calc(100% - 1.5rem)); max-height: min(80dvh, 44rem); padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--linha); border-radius: 14px; background: var(--papel); color: var(--grafite); }
.versoes::backdrop { background: rgb(36 39 43 / .45); }
.versoes-topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.versoes h2 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.versoes-ajuda { color: var(--suave); font-size: .92rem; margin: .4rem 0 1rem; }
.versoes h3 { margin: 1.1rem 0 .3rem; font-size: 1rem; font-weight: 700; }
.versoes ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--grafite); }
.versoes li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--linha); }
.versoes li > div { min-width: 0; display: flex; flex-direction: column; }
.v-desc { overflow-wrap: anywhere; }
.v-quando { font-size: .8rem; color: var(--suave); }
.v-atual { flex: none; font-size: .8rem; font-weight: 600; color: var(--musgo); }
.versoes li button { flex: none; background: none; border: 1px solid var(--linha); border-radius: 8px; padding: .45rem .75rem; font-size: .88rem; }
.versoes li button:hover { border-color: var(--grafite); }

/* Entrar */
.pagina-entrar { justify-content: center; padding: 1.5rem; }
.cartao { width: 100%; max-width: 24rem; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.cartao h1 { margin: 0 0 .4rem; font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.02; font-weight: 750; letter-spacing: -.035em; }
.cartao p { margin: 0; color: var(--suave); }
.cartao input { border: 1px solid var(--linha); border-radius: 10px; padding: .8rem .95rem; font-size: 16px; background: var(--papel); }
.cartao input:focus { outline: none; border-color: var(--grafite); }
.cartao button { background: var(--musgo); color: #fff; border: 0; border-radius: 10px; padding: .85rem; font-weight: 600; }
.cartao button:hover { background: var(--musgo-escuro); }
.erro { color: #9b2c2c !important; }
