/* Shakk / Fluqxo -- tokens de marca extraídos do documento de branding */
:root {
  --ink: #101923;
  --fluqxo-teal: #1e6f68;
  --signal: #4cb8b2;
  --sand: #d9c6a5;
  --ivory: #f7f4ed;
  --slate: #52606d;
  --border: #d8dee3;
  --danger: #b3432b;
  --surface: #ffffff;
  /* fixo -- cor de marca da sidebar, nunca muda com o tema (ao contrário
     de --ink, que é reaproveitado como cor de texto e se inverte no
     modo escuro; usar --ink na sidebar deixava o fundo dela claro
     quando o tema ficava escuro) */
  --brand-ink: #101923;

  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-brand: "Manrope", var(--font-ui);
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* 100dvh (com fallback 100vh) -- no PWA instalado (standalone, sem
   barra de endereço) o 100vh "clássico" não bate com a área visível
   de verdade em todo aparelho, e sem overflow controlado aqui a
   página inteira rolava (cabeçalho e composer se moviam junto) em vez
   de só a lista de mensagens rolar internamente. */
.view {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}
.view[hidden] { display: none !important; }

/* ---------- marca ---------- */
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.brand-name {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand-endorse {
  font-size: 0.78rem;
  color: var(--slate);
  font-weight: 500;
}
.brand-compact .brand-name { font-size: 1.05rem; }

/* ---------- botões genéricos ---------- */
.btn {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--fluqxo-teal); color: #fff; }
.btn-primary:hover { background: #185f59; }
.btn-secondary { background: var(--ivory); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fluqxo-teal); }
.btn-ghost { background: transparent; color: var(--slate); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); text-decoration: underline; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--slate);
  border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { background: rgba(16, 25, 35, 0.06); color: var(--ink); }
.icon-btn-mobile { display: none; }

/* ---------- landing ---------- */
.top-bar { padding: calc(1.5rem + env(safe-area-inset-top)) 2rem 1.5rem; }
.landing-hero {
  max-width: 640px;
  margin: 6vh auto 0;
  padding: 0 1.5rem 4rem;
  text-align: center;
}
.landing-title {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.landing-sub {
  color: var(--slate);
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 auto 2.5rem;
  max-width: 46ch;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
  box-shadow: 0 1px 2px rgba(16, 25, 35, 0.04);
}
#btn-google { width: 100%; margin-bottom: 1.1rem; }
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--slate); font-size: 0.8rem; margin: 0.5rem 0 1.1rem;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: flex; flex-direction: column; gap: 0.6rem; }
.auth-form input {
  font-family: var(--font-ui); font-size: 0.95rem;
  padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.auth-form input:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
.auth-form-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.auth-form-actions .btn { flex: 1; }
.auth-error { color: var(--danger); font-size: 0.85rem; margin: 0.9rem 0 0; }

/* ---------- layout do chat ---------- */
#view-chat {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}
#view-chat.sidebar-collapsed { grid-template-columns: 0 1fr; }

.sidebar {
  background: var(--brand-ink);
  color: #fff;
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
  transition: padding 0.15s ease;
}
#view-chat.sidebar-collapsed .sidebar { padding: 1.1rem 0; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 0.25rem; }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-endorse { color: rgba(255, 255, 255, 0.55); }
.sidebar .icon-btn { color: rgba(255, 255, 255, 0.7); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar .btn-secondary {
  background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.14);
}
.sidebar .btn-secondary:hover { border-color: var(--signal); }

.sidebar-heading {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4); padding: 0.4rem 0.4rem 0;
}
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.15rem; }
.conversation-item {
  position: relative;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.55rem 0.35rem 0.55rem 0.6rem; border-radius: 7px; font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}
.conversation-item:hover { background: rgba(255, 255, 255, 0.06); }
.conversation-item.is-active { background: rgba(76, 184, 178, 0.18); color: #fff; }
.conversation-item-title {
  flex: 1; min-width: 0; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conversation-item-title-input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--fluqxo-teal); border-radius: 5px; padding: 0.1rem 0.35rem;
}
.conversation-item-menu-btn {
  flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: rgba(255, 255, 255, 0.55); border-radius: 6px; cursor: pointer;
}
.conversation-item-menu-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.conversation-item-menu {
  position: absolute; top: calc(100% + 2px); right: 0.35rem; z-index: 25;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 25, 35, 0.25); padding: 0.3rem; width: 160px;
}
.conv-menu-option {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: none; border: none; text-align: left; color: var(--ink);
  font-family: var(--font-ui); font-size: 0.85rem; padding: 0.45rem 0.5rem; border-radius: 7px; cursor: pointer;
}
.conv-menu-option:hover { background: var(--ivory); }
.conv-menu-option.is-danger { color: var(--danger); }

.confirm-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(16, 25, 35, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.confirm-box {
  background: var(--surface); border-radius: 14px; padding: 1.25rem; max-width: 340px;
  box-shadow: 0 12px 32px rgba(16, 25, 35, 0.3);
}
.confirm-box p { margin: 0 0 1rem; color: var(--ink); font-size: 0.92rem; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #962f1f; }

.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 0.6rem; display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-footer-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: none; border: none; color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-ui); font-size: 0.88rem; padding: 0.5rem 0.4rem;
  border-radius: 7px; cursor: pointer; text-align: left; width: 100%;
}
.sidebar-footer-row:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-footer-icon { width: 1.1rem; text-align: center; flex-shrink: 0; }
.sidebar-chevron { margin-left: auto; flex-shrink: 0; transition: transform 0.15s ease; }
.account-panel { display: flex; flex-direction: column; gap: 0.1rem; padding-top: 0.2rem; }
.account-panel[hidden] { display: none; }
.account-panel-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.4rem;
  color: rgba(255, 255, 255, 0.55); font-size: 0.8rem;
}
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(16, 25, 35, 0.5); z-index: 20;
}
.sidebar-backdrop[hidden] { display: none; }

/* ---------- chat principal ---------- */
/* grid-column explícito: no mobile a sidebar vira position:fixed (gaveta)
   e sai do fluxo do grid, deixando .chat-main como único item -- sem
   isso ele é auto-posicionado na coluna 1 (a da sidebar) em vez da 2. */
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; grid-column: 2; }
.chat-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1.25rem 0.75rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mode-button {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600;
  background: var(--ivory); border: 1px solid var(--border); color: var(--ink);
  border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer;
}
.mode-button:hover { border-color: var(--fluqxo-teal); }

.mode-backdrop { position: fixed; inset: 0; z-index: 29; }
.mode-backdrop[hidden] { display: none; }
.mode-popover {
  position: absolute; top: 3.4rem; right: 1.25rem; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 25, 35, 0.12);
  width: 280px; padding: 0.5rem;
}
.mode-popover[hidden] { display: none; }
.mode-popover-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--slate); margin: 0.4rem 0.6rem 0.3rem;
}
.mode-option {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; background: none; border: none; text-align: left;
  padding: 0.55rem 0.6rem; border-radius: 8px; cursor: pointer;
  font-family: var(--font-ui);
}
.mode-option:hover { background: var(--ivory); }
.mode-option.is-active { background: rgba(30, 111, 104, 0.08); }
.mode-option-copy strong { display: block; font-size: 0.9rem; color: var(--ink); }
.mode-option-copy small { color: var(--slate); font-size: 0.78rem; }
.mode-check { color: var(--fluqxo-teal); font-weight: 700; }
.mode-popover-divider { height: 1px; background: var(--border); margin: 0.35rem 0.6rem; }
.mode-option-title { display: flex !important; align-items: center; gap: 0.4rem; color: var(--fluqxo-teal) !important; }

/* ---------- mensagens ---------- */
.messages { flex: 1; min-height: 0; overflow-y: auto; }
.empty-state {
  max-width: 560px; margin: 8vh auto 0; padding: 0 1.5rem; text-align: center;
}
.empty-state h1 {
  font-family: var(--font-brand); font-weight: 800; font-size: 1.8rem;
  margin: 0 0 0.6rem; text-wrap: balance;
}
.empty-state em { font-style: normal; color: var(--fluqxo-teal); }
.empty-state p { color: var(--slate); line-height: 1.5; margin: 0 0 2rem; }

.suggestion-grid { display: grid; gap: 0.6rem; }
.suggestion-card {
  display: flex; align-items: center; gap: 0.75rem; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.85rem 1rem; cursor: pointer; font-family: var(--font-ui); font-size: 0.9rem;
  color: var(--ink);
}
.suggestion-card:hover { border-color: var(--fluqxo-teal); }
.suggestion-num { font-family: var(--font-mono); color: var(--signal); font-size: 0.8rem; font-weight: 500; }

.message-list { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; max-width: 760px; margin: 0 auto; }
.message-list[hidden] { display: none; }

.message { max-width: 100%; padding: 0.7rem 1rem; border-radius: 12px; line-height: 1.55; }
.message p { margin: 0 0 0.6rem; }
.message p:last-child { margin-bottom: 0; }
.message code {
  font-family: var(--font-mono); font-size: 0.85em; background: rgba(16, 25, 35, 0.06);
  padding: 0.1em 0.35em; border-radius: 4px;
}
.message pre {
  font-family: var(--font-mono); font-size: 0.83rem; background: var(--ink); color: var(--ivory);
  padding: 0.85rem 1rem; border-radius: 8px; overflow-x: auto; margin: 0.5rem 0;
}
.message pre code { background: none; padding: 0; }

.message-row { display: flex; flex-direction: column; }
.message-row.role-user { align-items: flex-end; }
.message-row.role-assistant, .message-row.role-error, .message-row.role-search { align-items: flex-start; }
.message.role-user { background: var(--fluqxo-teal); color: #fff; border-bottom-right-radius: 4px; max-width: 70ch; }
.message.role-assistant { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; max-width: 70ch; }
.message.role-error { background: #fdf1ee; border: 1px solid var(--danger); color: var(--danger); max-width: 70ch; }
.message.role-search { background: var(--surface); border: 1px solid var(--border); width: 100%; }

/* ---------- ações de mensagem ---------- */
.msg-actions { display: flex; align-items: center; gap: 0.15rem; margin-top: 0.3rem; }
.msg-action-btn { width: 28px; height: 28px; }
.icon-btn-danger:hover { color: var(--danger); background: rgba(179, 67, 43, 0.1); }
.msg-action-btn.active-vote { color: var(--fluqxo-teal); }
.msg-action-btn.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.message.editing { width: min(100%, 480px); padding: 0.6rem; }
.edit-textarea {
  width: 100%; min-height: 1.4rem; max-height: 16rem; padding: 0.2rem 0.3rem;
  background: transparent; border: none; outline: none; resize: none;
  font: inherit; color: inherit; line-height: 1.55;
}
.edit-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.edit-cancel-btn, .edit-save-btn { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

.search-heading {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 700; color: var(--signal);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.6rem;
}
.source-list { display: flex; flex-direction: column; gap: 0.5rem; }
.source-card { display: block; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: inherit; }
.source-card:hover { border-color: var(--fluqxo-teal); }
.source-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin-bottom: 0.15rem; }
.source-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--slate); margin-bottom: 0.3rem; }
.source-favicon { width: 14px; height: 14px; border-radius: 3px; }
.source-snippet { font-size: 0.82rem; color: var(--slate); line-height: 1.4; }

/* chip de fonte anexado a uma resposta do assistente */
.source-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.source-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; color: var(--slate); background: var(--ivory);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.6rem;
  text-decoration: none;
}
.source-chip:hover { border-color: var(--fluqxo-teal); color: var(--ink); }
.source-chip img { width: 12px; height: 12px; border-radius: 2px; }

.activity-indicator {
  max-width: 760px; margin: 0 auto; padding: 0 1.5rem 0.5rem;
  font-size: 0.85rem; color: var(--signal); font-weight: 600;
  display: flex; align-items: center; gap: 0.4rem;
}
.activity-indicator[hidden] { display: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- composer ---------- */
.composer-area { border-top: 1px solid var(--border); flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom); }
.composer {
  display: flex; align-items: flex-end; gap: 0.5rem;
  max-width: 760px; margin: 0 auto; padding: 0.85rem 1.5rem 0.4rem;
}
.composer textarea {
  flex: 1; font-family: var(--font-ui); font-size: 0.95rem;
  padding: 0.6rem 0.2rem; border: none; resize: none; max-height: 8rem;
  background: transparent; color: var(--ink);
}
.composer textarea:focus { outline: none; }
.composer-send { width: 40px; height: 40px; padding: 0; border-radius: 10px; flex-shrink: 0; }
.composer-send:disabled { opacity: 0.4; cursor: not-allowed; }
.disclaimer { max-width: 760px; margin: 0 auto; padding: 0 1.5rem 0.75rem; font-size: 0.72rem; color: var(--slate); text-align: center; }
.composer-icon.is-active { background: rgba(30, 111, 104, 0.12); color: var(--fluqxo-teal); }

.refino-banner {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 760px; margin: 0 auto; padding: 0.5rem 1.5rem;
  color: var(--fluqxo-teal); font-size: 0.78rem; font-weight: 600;
  background: rgba(30, 111, 104, 0.08); border-bottom: 1px solid var(--border);
}
.refino-banner button { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; display: flex; padding: 0.2rem; }
.refino-banner[hidden] { display: none; }

.attachment-preview { max-width: 760px; margin: 0 auto; padding: 0.6rem 1.5rem 0; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ivory); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.4rem 0.6rem; font-size: 0.85rem; color: var(--ink);
}
.attachment-thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.attachment-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { background: none; border: none; color: var(--slate); cursor: pointer; display: flex; padding: 0.15rem; }
.attachment-chip button:hover { color: var(--danger); }

.message-attachment-image { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 0.5rem; }
.message-attachment-file {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--fluqxo-teal); font-size: 0.85rem; font-weight: 600;
  text-decoration: none; margin-bottom: 0.5rem;
}
.message-attachment-file:hover { text-decoration: underline; }

/* ---------- tema escuro ---------- */
:root[data-theme="dark"], :root:not([data-theme="light"]) {
  --surface-dark: #1b2027;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ivory: #14181d; --surface: #1b2027; --border: #2a313a; --ink: #eef2f4; --slate: #93a0ac;
  }
}
:root[data-theme="dark"] {
  --ivory: #14181d; --surface: #1b2027; --border: #2a313a; --ink: #eef2f4; --slate: #93a0ac;
}

@media (max-width: 760px) {
  #view-chat { grid-template-columns: 1fr; }
  .chat-main { grid-column: 1 / -1; }
  .sidebar {
    position: fixed; inset: 0 30% 0 0; z-index: 21; max-width: 280px;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  #view-chat:not(.sidebar-collapsed) .sidebar { transform: translateX(0); }
  #view-chat.sidebar-collapsed .sidebar { padding: 1.1rem 0.85rem; }
  .icon-btn-mobile { display: inline-flex; }
  .mode-popover { right: 0.75rem; left: 0.75rem; width: auto; }
}
@media (min-width: 761px) {
  .sidebar-backdrop { display: none !important; }
}

/* ---------- Shakk Code (agente de terminal) ---------- */
.agent-panel {
  position: fixed; top: 8vh; left: 1rem; right: 1rem; max-width: 480px; margin: 0 auto;
  max-height: 82vh; z-index: 31; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16, 25, 35, 0.3);
}
.agent-panel[hidden] { display: none; }
.agent-panel-header {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.agent-panel-header strong { flex: 1; }
.agent-status-pill { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--slate); }
.agent-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate); flex-shrink: 0; }
.agent-status-dot.is-online { background: var(--signal); box-shadow: 0 0 0 3px rgba(76, 184, 178, 0.2); }

.agent-pairing { padding: 1.1rem; overflow-y: auto; }
.agent-pairing p { color: var(--slate); font-size: 0.9rem; line-height: 1.5; margin: 0 0 1rem; }
.agent-code-box { margin-top: 1rem; text-align: center; }
.agent-code { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; letter-spacing: 0.2em; color: var(--fluqxo-teal); margin-bottom: 0.6rem; }
.agent-code-hint { font-size: 0.8rem; color: var(--slate); margin-bottom: 0.4rem; }
.agent-code-command { display: block; background: var(--ivory); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; font-family: var(--font-mono); font-size: 0.85rem; }

.agent-chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.agent-chat[hidden], .agent-pairing[hidden] { display: none; }
.agent-messages { flex: 1; min-height: 200px; max-height: 45vh; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.agent-composer { padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--border); }

/* ---------- refino (Refinaria de Intenções) ---------- */
.refine-bubble {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 0.6rem;
  display: flex;
  flex-direction: column;
  max-height: 45vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 25, 35, 0.12);
  overflow: hidden;
}
.refine-bubble-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; padding: 0.6rem 0.85rem 0.5rem; border-bottom: 1px solid var(--border);
}
.refine-bubble-label {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--fluqxo-teal); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.refine-bubble-close {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  padding: 0; color: var(--slate); background: transparent; border: 0; border-radius: 6px; cursor: pointer;
}
.refine-bubble-close:hover { color: var(--ink); background: rgba(16, 25, 35, 0.06); }
.refine-bubble-text {
  flex: 1; padding: 0.7rem 0.85rem; overflow-y: auto;
  color: var(--ink); font-size: 0.92rem; line-height: 1.6; white-space: pre-wrap;
}
.refine-bubble-text:empty::before { content: "Refinando..."; color: var(--slate); font-style: italic; }
.refine-bubble-acts { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; padding: 0.5rem 0.85rem 0.75rem; border-top: 1px solid var(--border); }
.refine-use-btn, .refine-copy-btn { padding: 0.45rem 0.9rem; font-size: 0.83rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 8px);
  background: var(--brand-ink); color: #fff; font-size: 0.85rem; font-weight: 500;
  padding: 0.6rem 1.1rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(16, 25, 35, 0.25);
  z-index: 40; opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
