/* Cores de public/theme.json. Sem fonte remota: a pilha do tema, sem o pedido ao Google Fonts. */
:root {
  --rtm-font: "Segoe UI", system-ui, sans-serif;
  --rtm-bg: hsl(0 0% 100%);
  --rtm-fg: hsl(220 40% 15%);
  --rtm-primary: hsl(356 85% 45%);
  --rtm-primary-fg: hsl(0 0% 100%);
  --rtm-secondary: hsl(220 15% 96%);
  --rtm-muted: hsl(220 10% 40%);
  --rtm-accent: hsl(356 70% 95%);
  --rtm-accent-fg: hsl(356 85% 35%);
  --rtm-border: hsl(220 13% 91%);
  color-scheme: light;
}

html[data-theme="dark"] {
  --rtm-bg: hsl(220 30% 8%);
  --rtm-fg: hsl(0 0% 98%);
  --rtm-primary: hsl(356 75% 55%);
  --rtm-secondary: hsl(220 20% 18%);
  --rtm-muted: hsl(220 10% 65%);
  --rtm-accent: hsl(356 40% 20%);
  --rtm-accent-fg: hsl(356 75% 75%);
  --rtm-border: hsl(220 20% 18%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--rtm-font);
  background: var(--rtm-bg);
  color: var(--rtm-fg);
}

.app { height: 100%; display: flex; flex-direction: column; }

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rtm-border);
}

.logo { height: 28px; width: auto; }
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }

.who { flex: 1; min-width: 0; }
.who h1 { margin: 0; font-size: 15px; font-weight: 650; }
.who p { margin: 0; font-size: 12px; color: var(--rtm-muted); }

.ghost, .icon, .send, .chip button, .starters button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

.ghost { font-size: 12px; color: var(--rtm-primary); padding: 6px; }

.transcript { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; }

.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg img { width: 28px; height: 28px; border-radius: 8px; flex: none; }

.bubble { border-radius: 14px; padding: 10px 12px; line-height: 1.45; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.msg.assistant .bubble { max-width: calc(100% - 36px); }
.msg.assistant .bubble { background: var(--rtm-secondary); }
.msg.user .bubble { background: var(--rtm-primary); color: var(--rtm-primary-fg); max-width: 85%; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin: 0; }
.bubble h3, .bubble h4 { margin: 8px 0 4px; font-size: 14px; font-weight: 650; }
.bubble h3:first-child, .bubble h4:first-child { margin-top: 0; }
.bubble hr { border: 0; border-top: 1px solid var(--rtm-border); margin: 8px 0; }
.bubble ul, .bubble ol { margin: 4px 0; padding-left: 18px; }
.bubble code { font-family: ui-monospace, monospace; font-size: 12px; background: var(--rtm-accent); color: var(--rtm-accent-fg); padding: 1px 4px; border-radius: 4px; }
.msg.user .bubble code { background: transparent; color: inherit; }
.bubble pre { margin: 0; overflow-x: auto; }
.bubble pre code { display: block; padding: 8px; background: transparent; }
.bubble table { border-collapse: collapse; width: 100%; font-size: 13px; }
.bubble th, .bubble td { border: 1px solid var(--rtm-border); padding: 4px 6px; text-align: left; }
.bubble a { color: var(--rtm-primary); }
.msg.user .bubble a { color: inherit; }

.file {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--rtm-bg);
  color: var(--rtm-primary);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--rtm-border);
}

.starters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 8px; }
.starters button {
  border: 1px solid var(--rtm-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: var(--rtm-bg);
}
.starters button:hover { background: var(--rtm-accent); color: var(--rtm-accent-fg); }

.status, .note { margin: 0; padding: 0 14px 6px; font-size: 12px; color: var(--rtm-muted); min-height: 0; }
.status:empty { display: none; }

.alert { margin: 0 14px 8px; padding: 10px 12px; border-radius: 10px; background: var(--rtm-accent); color: var(--rtm-accent-fg); font-size: 14px; }
.alert[hidden] { display: none; }

.composer { padding: 0 14px 8px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--rtm-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: var(--rtm-bg);
}
textarea:focus, .send:focus-visible, .icon:focus-visible, .ghost:focus-visible, .starters button:focus-visible {
  outline: 2px solid var(--rtm-primary);
  outline-offset: 1px;
}
.icon, .send { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.icon svg, .send svg { width: 20px; height: 20px; }
.send { background: var(--rtm-primary); color: var(--rtm-primary-fg); }
.send:disabled, .icon:disabled { opacity: .4; cursor: default; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  background: var(--rtm-accent);
  color: var(--rtm-accent-fg);
  font-size: 13px;
}
.chip[hidden] { display: none; }
.chip button { font-size: 16px; line-height: 1; color: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
