:root {
  --bg: #efeae2;
  --panel: #ffffff;
  --header: #075e54;
  --bubble-bot: #ffffff;
  --bubble-user: #dcf8c6;
  --text: #1c1c1c;
  --muted: #667781;
  --accent: #128c7e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b141a;
    --panel: #202c33;
    --header: #202c33;
    --bubble-bot: #202c33;
    --bubble-user: #005c4b;
    --text: #e9edef;
    --muted: #8696a0;
    --accent: #00a884;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: var(--header);
  color: #fff;
}

.site-header .brand {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  opacity: 0.9;
}

.site-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 16px;
  text-align: center;
}

.hero h1 {
  font-size: 26px;
  margin: 0 0 8px;
}

.hero p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.widget-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 20px 8px;
}

.app {
  width: 100%;
  max-width: 640px;
  height: min(600px, 75vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.app-header {
  border-radius: 0;
}

.ad-slot {
  max-width: 640px;
  min-height: 90px;
  margin: 16px auto;
  padding: 0 20px;
}

/* Some visível quando o código de anúncio for colado dentro (deixa de estar :empty) */
.ad-slot:empty {
  min-height: 0;
  margin: 0;
}

.content-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  line-height: 1.6;
}

.content-section h2 {
  font-size: 19px;
  margin: 28px 0 10px;
}

.content-section.legal-page h1 {
  font-size: 24px;
}

.content-section.legal-page {
  padding-top: 32px;
}

.steps {
  padding-left: 20px;
}

.steps li {
  margin-bottom: 10px;
}

.content-section details {
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.content-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
}

.content-section details p {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  text-align: center;
  padding: 24px 20px 32px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer p {
  margin: 4px 0;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--header);
  color: #fff;
  font-size: 13px;
  z-index: 100;
}

.cookie-banner a {
  color: #fff;
  text-decoration: underline;
}

.cookie-banner p {
  margin: 0;
  max-width: 560px;
}

body.has-cookie-banner {
  padding-bottom: 76px;
}

.cookie-banner button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.app-header {
  background: var(--header);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.app-header h2 {
  font-size: 16px;
  margin: 0;
}

.status {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-image: radial-gradient(circle at 20px 20px, rgba(0,0,0,0.02) 1px, transparent 0);
  background-size: 24px 24px;
}

.message {
  display: flex;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  word-break: break-word;
}

.message.bot .bubble {
  background: var(--bubble-bot);
  border-top-left-radius: 2px;
}

.message.user .bubble {
  background: var(--bubble-user);
  border-top-right-radius: 2px;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.05);
  margin-bottom: 4px;
}

.file-chip .icon {
  font-size: 22px;
}

.file-chip .name {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.typing {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.error .bubble {
  background: #ffe0e0;
  color: #8a1f1f;
}

.composer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border-top: 1px solid rgba(0,0,0,0.08);
}

.attach-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.attach-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-hint {
  font-size: 12.5px;
  color: var(--muted);
}
