/* ---------- reset / tokens ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:         #f5f5f7;
  --bg-elev:    #ffffff;
  --bg-card:    #ffffff;
  --bg-input:   #f5f5f7;
  --border:     #d2d2d7;
  --border-light: #e8e8ed;
  --text:       #1d1d1f;
  --text-dim:   #6e6e73;
  --text-xdim:  #767676;
  --accent:      #c9a040;
  --accent-soft: rgba(201,160,64,0.12);
  --accent-hover:#d4aa4a;
  --accent-text: #7d5e10;
  --navy:        #0a1628;
  --green:      #34c759;
  --yellow:     #ff9500;
  --red:        #ff3b30;
  /* A rubrica canônica do Spider tem 4 faixas (kb/spider-ring.md): 0-2 vermelho,
     3-5 laranja, 6-7 AMARELO, 8-10 verde. O token --yellow acima é laranja
     apesar do nome (#ff9500), então a faixa "Bom" precisa de um amarelo de
     verdade. --yellow não foi renomeado: tem outros consumidores. */
  --amber:      #ffcc00;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --font:       -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
}

.content { flex: 1; overflow-y: auto; padding: 40px 48px; background: var(--bg); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 14px; font-weight: 600; color: var(--text); }
.brand-text span { font-size: 11px; color: var(--text-dim); }

/* ---------- nav section labels ---------- */
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-xdim);
  padding: 14px 10px 5px;
}

/* ---------- nav ---------- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 15px; flex-shrink: 0; }

/* ---------- sidebar close button (mobile only) ---------- */
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px; right: 12px;
  background: none; border: none;
  color: rgba(255,255,255,0.55);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 6px;
  border-radius: var(--radius-sm);
}
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ---------- negotiation list in sidebar ---------- */
.neg-list { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.neg-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 13px 10px;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-dim); font-family: var(--font); font-size: 13px;
  text-align: left; cursor: pointer;
  transition: background 0.1s, color 0.1s;
  gap: 6px;
}
.neg-item:hover { background: var(--bg); color: var(--text); }
.neg-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.neg-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.neg-new {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 11px 10px; margin-bottom: 4px;
  background: transparent; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-family: var(--font); font-size: 13px; cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.neg-new:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  padding: 16px 10px 2px;
  font-size: 11px;
  color: var(--text-xdim);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.version-label {
  padding: 2px 0 4px;
  font-size: 11px;
  color: var(--text-xdim);
}
.lang-switch {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  user-select: none;
}
.ls-opt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  transition: background 0.18s, color 0.18s;
}
.lang-switch.pt .ls-opt[data-lang="pt"],
.lang-switch.en .ls-opt[data-lang="en"] {
  background: var(--accent);
  color: #fff;
}

/* ---------- modules ---------- */
.module { display: none; max-width: 860px; margin: 0 auto; }
.module.active { display: block; }
.quiz-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* badge "Demo" no item da sidebar */
.nav-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 1px 6px; margin-left: 4px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}

/* ---------- Simulador (Demo) ---------- */
.sim-chat { display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 820px; margin: 0 auto; }
/* banner fixo no topo: é irmão da .sim-log (a única que rola), então fica
   sempre visível enquanto a conversa rola embaixo */
.sim-banner { flex-shrink: 0; width: 100%; height: 280px; overflow: hidden; border-bottom: 1px solid var(--border-light); }
.sim-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; display: block; transform: scaleX(-1); }
.sim-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.sim-head-title { display: flex; align-items: center; gap: 8px; }
.sim-head-title strong { font-size: 15px; font-weight: 700; color: var(--text); }
.sim-head-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
}
.sim-reset {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border-light); border-radius: 8px;
  padding: 6px 10px; font-family: var(--font); font-size: 12.5px; color: var(--text-dim);
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.sim-reset:hover { background: var(--bg); color: var(--text); }
.sim-reset svg { width: 14px; height: 14px; }

.sim-log { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.sim-msg { display: flex; }
.sim-user { justify-content: flex-end; }
.sim-assistant { justify-content: flex-start; }
.sim-bubble { max-width: 82%; padding: 11px 15px; border-radius: 15px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.sim-user .sim-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.sim-assistant .sim-bubble { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text); border-bottom-left-radius: 5px; }
.sim-bubble p { margin: 0 0 8px; }
.sim-bubble p:last-child { margin-bottom: 0; }
.sim-bubble ul, .sim-bubble ol { margin: 6px 0; padding-left: 20px; }
.sim-bubble strong { font-weight: 700; }

.sim-typing { display: inline-flex; gap: 4px; align-items: center; }
.sim-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-xdim); animation: simBlink 1.2s infinite ease-in-out; }
.sim-typing span:nth-child(2) { animation-delay: 0.2s; }
.sim-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes simBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.sim-composer { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--bg); flex-shrink: 0; }
.sim-composer textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 42px;
  padding: 11px 14px; border: 1px solid var(--border-light); border-radius: 12px;
  font-family: var(--font); font-size: 14.5px; line-height: 1.4; color: var(--text); background: var(--bg-card);
}
.sim-composer textarea:focus { outline: none; border-color: var(--accent); }
.sim-send {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; border: none;
  background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.1s;
}
.sim-send:hover { opacity: 0.9; }
.sim-send:disabled { opacity: 0.45; cursor: default; }
.sim-send svg { width: 18px; height: 18px; }

/* "Sua negociação": seletor de negociação antes do chat */
.nav-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-left: 3px; }
.simneg-picker { display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 760px; margin: 0 auto; overflow-y: auto; }
.simneg-hint { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 14px 20px 6px; }
.simneg-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 20px 24px; }
.simneg-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; position: relative;
  text-align: left; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px;
  padding: 14px 40px 14px 16px; font-family: var(--font); cursor: pointer; transition: border-color 0.1s, background 0.1s;
}
.simneg-item:hover { border-color: var(--accent); background: var(--bg); }
.simneg-item-title { font-size: 15px; font-weight: 600; color: var(--text); }
.simneg-item-meta { font-size: 12.5px; color: var(--text-dim); }
.simneg-item-caret { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-xdim); }
.simneg-back {
  background: transparent; border: none; cursor: pointer; color: var(--text-dim);
  padding: 4px; border-radius: 8px; line-height: 0; display: inline-flex; margin-right: 2px;
}
.simneg-back:hover { background: var(--bg); color: var(--text); }
.simneg-back svg { width: 18px; height: 18px; }

/* tela cheia, sidebar visível — mesma ideia do in-neg/in-quiz */
body.in-sim .content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-sim #module-simulador.active,
body.in-sim #module-simulador-neg.active { max-width: none; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ===================== Relatório ===================== */
body.in-relatorio .content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-relatorio #module-relatorio.active { max-width: none; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* picker */
.rel-picker { height: 100%; overflow-y: auto; width: 100%; max-width: 780px; margin: 0 auto; padding: 26px 20px 48px; }
.rel-picker-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.rel-picker-head p { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; margin-top: 8px; max-width: 64ch; }
.rel-group { margin-top: 24px; }
.rel-group h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 8px; }
.rel-list { display: flex; flex-direction: column; gap: 8px; }
.rel-empty { color: var(--text-dim); font-size: 13.5px; }
.rel-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; position: relative;
  text-align: left; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px;
  padding: 13px 40px 13px 16px; font-family: var(--font); cursor: pointer; transition: border-color 0.1s, background 0.1s;
}
.rel-item:hover { border-color: var(--accent); background: var(--bg); }
.rel-item-title { font-size: 15px; font-weight: 600; color: var(--text); }
.rel-item-meta { font-size: 12.5px; color: var(--text-dim); }
.rel-item-caret { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-xdim); }

/* viewer + toolbar */
.rel-viewer { display: flex; flex-direction: column; height: 100%; }
.rel-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-light); background: var(--bg); flex-shrink: 0; }
.rel-tb-title { flex: 1; font-weight: 600; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-tb-actions { display: flex; gap: 8px; }
.rel-tbtn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border-light); border-radius: 8px; padding: 7px 11px; font-family: var(--font); font-size: 13px; color: var(--text-dim); cursor: pointer; transition: background 0.1s, color 0.1s; }
.rel-tbtn:hover { background: var(--bg); color: var(--text); }
.rel-tbtn svg { width: 15px; height: 15px; }
.rel-tbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rel-tbtn.primary:hover { opacity: 0.92; color: #fff; }

.rel-stage { flex: 1; min-height: 0; overflow: auto; background: #e9edf2; padding: 22px; display: block; text-align: center; }
.rel-loading { padding: 70px 20px; text-align: center; color: #5a6b7b; font-size: 14px; }
.rel-loading-sub { font-size: 12.5px; color: #8595a4; margin-top: 2px; }
.rel-cache-nota { max-width: 900px; margin: 0 auto 12px; font-size: 12.5px; color: #5a6b7b; text-align: center; }
.rel-spin { width: 30px; height: 30px; border: 3px solid #d7dde5; border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 14px; animation: relspin 0.8s linear infinite; }
@keyframes relspin { to { transform: rotate(360deg); } }

/* ---- o documento A4 (sempre claro, pronto para impressão) ---- */
.rel-a4 {
  width: 210mm; min-height: 296mm; background: #fff; color: #1c2b3a;
  box-shadow: 0 2px 22px rgba(10, 37, 64, 0.18); padding: 13mm 14mm;
  font-family: Georgia, 'Times New Roman', serif; font-size: 9.5px; line-height: 1.45;
  display: inline-block; text-align: left; vertical-align: top;
}
.rel-doc-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 2px solid #0A2540; padding-bottom: 6px; }
.rel-doc-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 800; letter-spacing: 0.08em; color: #0A2540; font-size: 13px; }
.rel-doc-meta { text-align: right; font-family: var(--font); }
.rel-doc-meta b { display: block; font-size: 11px; letter-spacing: 0.1em; color: #0A2540; }
.rel-doc-meta span { font-size: 9px; color: #5a6b7b; letter-spacing: 0.03em; }
.rel-doc-title { margin: 8px 0 2px; }
.rel-doc-title h1 { font-family: var(--font); font-size: 19px; font-weight: 700; color: #0A2540; letter-spacing: -0.2px; }
.rel-doc-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rel-chip { font-family: var(--font); font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: #eef2f6; color: #33475b; border: 1px solid #dde4ec; border-radius: 10px; padding: 2px 9px; }
.rel-doc-desc { margin-top: 8px; color: #33475b; }
.rel-doc-desc p { margin: 0 0 4px; }

.rel-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm 8mm; align-items: start; margin-top: 6mm; }
.rel-sec { break-inside: avoid; }
.rel-sec.full { grid-column: 1 / -1; }
.rel-sec h2 { font-family: var(--font); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: #0A2540; border-bottom: 1.5px solid #c9a040; padding-bottom: 3px; margin: 0 0 6px; display: flex; align-items: center; gap: 7px; }
.rel-sn { background: #0A2540; color: #fff; min-width: 17px; height: 17px; border-radius: 3px; font-size: 9.5px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 3px; }
.rel-sec-body p { margin: 0 0 4px; }
.rel-sec-body h4 { font-family: var(--font); font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: #0A2540; margin: 7px 0 3px; }
.rel-na { color: #9aa7b4; }

.rel-tbl { width: 100%; border-collapse: collapse; font-size: 8.7px; margin: 2px 0; }
.rel-tbl th { background: #0A2540; color: #fff; font-family: var(--font); font-weight: 600; text-align: left; padding: 3px 6px; letter-spacing: 0.02em; }
.rel-tbl td { border: 1px solid #e2e7ee; padding: 3px 6px; vertical-align: top; }
.rel-tbl tbody tr:nth-child(even) { background: #f6f8fa; }
.rel-td-score { text-align: center; white-space: nowrap; }
.rel-score { display: inline-block; min-width: 15px; text-align: center; font-family: var(--font); font-weight: 700; font-size: 8.5px; border-radius: 3px; padding: 1px 5px; }
.rel-score.c0 { background: #fbe3e3; color: #9c2a2a; }
.rel-score.c2 { background: #fdf0d9; color: #8a5a12; }
.rel-score.c3 { background: #e4eef0; color: #1f5566; }
.rel-score.c4 { background: #dce9df; color: #1f6b3a; }
.rel-score.na { background: #eef1f4; color: #8595a4; }
/* (08/10, nota honesta) hipótese: "~N" dourado e tracejado, sem o fundo da faixa (a régua do painel) */
.rel-score.hip { background: #fffaf0; color: #8a6a1c; border: 1px dashed #b8862b; padding: 0 4px; font-style: italic; }
.rel-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 3px 0 0; font-size: 8px; color: #5a6b7b; }
.rel-legenda > span { display: inline-flex; align-items: center; gap: 4px; }

.rel-kv { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 2.5px 0; border-bottom: 1px dotted #e2e7ee; }
.rel-k { font-family: var(--font); font-size: 8px; text-transform: uppercase; letter-spacing: 0.04em; color: #5a6b7b; font-weight: 600; }
.rel-v { color: #1c2b3a; }
.rel-exec { background: #f6f8fa; border-left: 3px solid #c9a040; padding: 6px 12px; }
.rel-nums { columns: 2; column-gap: 14px; margin-bottom: 4px; }
.rel-nums .rel-kv { break-inside: avoid; }

.rel-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rel-ul { margin: 2px 0 2px 0; padding-left: 15px; }
.rel-ul li { margin-bottom: 2px; }
.rel-rod { color: #8595a4; font-size: 8px; }
.rel-fazer h4 { color: #1f6b3a; }
.rel-evitar h4 { color: #9c2a2a; }

.rel-mom { margin-bottom: 7px; break-inside: avoid; }
.rel-mom-h { font-family: var(--font); font-weight: 700; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.04em; color: #0A2540; }
.rel-quote { font-style: italic; color: #33475b; border-left: 2px solid #c9a040; padding-left: 7px; margin: 2px 0 3px; }
.rel-cego { margin-bottom: 5px; }
.rel-cego b { color: #0A2540; }
.rel-reescrita { margin-bottom: 5px; break-inside: avoid; }
.rel-orig { color: #9c2a2a; }
.rel-melhor { color: #1f6b3a; }

.rel-fraqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; }
.rel-fraq { break-inside: avoid; border: 1px solid #e2e7ee; border-top: 2px solid #c9a040; border-radius: 4px; padding: 7px 9px; background: #fbfcfd; }
.rel-fraq-h { font-family: var(--font); font-weight: 700; font-size: 10px; color: #0A2540; display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }

.rel-ind { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.rel-ind-radar { display: flex; justify-content: center; }
/* (08/10) a legenda do radar (hipótese ~ / sem nota —) desce para baixo do gráfico, na largura dele */
.rel-ind-radar:has(.rel-radar-na) { flex-wrap: wrap; }
.rel-ind-radar .rel-radar-na { flex-basis: 100%; }
#rel-radar { display: block; }

/* ---- Colinha (formulário de UMA página A4 retrato) ---- */
.col-a4 { font-size: 8.6px; line-height: 1.38; padding: 11mm 12mm; min-height: 297mm; }
.col-a4 .rel-doc-title { margin: 6px 0 4px; }
.col-a4 .rel-doc-title h1 { font-size: 15px; }
.col-sintese { color: #33475b; margin: 2px 0 7px; font-style: italic; }
/* caixas de formulário */
.col-box { border: 1px solid #cdd6e0; border-radius: 3px; overflow: hidden; }
.col-box > h4 { background: #eef2f6; border-bottom: 1px solid #cdd6e0; color: #0A2540; font-family: var(--font); font-weight: 700; font-size: 7.8px; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 7px; margin: 0; }
.col-box > h4.ok { color: #1f6b3a; } .col-box > h4.no { color: #c0392b; }
.col-box-body { padding: 5px 8px; }
.col-box-body p { margin: 0 0 3px; } .col-box-body p:last-child { margin: 0; }
.col-box-body .rel-ul { margin: 0; padding-left: 14px; } .col-box-body .rel-ul li { margin-bottom: 2px; }
.col-row { display: grid; gap: 7px; margin-bottom: 7px; }
.col-row.r2 { grid-template-columns: 1fr 1fr; }
.col-row.r3 { grid-template-columns: 1fr 1fr 1fr; }
.col-top { display: grid; grid-template-columns: 232px 1fr; gap: 7px; margin-bottom: 7px; align-items: stretch; }
.col-radar-box .col-box-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#col-radar { display: block; }
.col-etapas { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.col-etapa { font-family: var(--font); font-size: 7.5px; text-align: center; color: #33475b; }
.col-etapa b { display: block; font-size: 12px; color: #0A2540; }
.col-line { padding: 3px 0; border-bottom: 1px dotted #e2e7ee; }
.col-line:last-child { border-bottom: 0; }
.col-line .k { display: block; font-family: var(--font); font-size: 7px; text-transform: uppercase; letter-spacing: 0.04em; color: #5a6b7b; font-weight: 700; }
.col-fraco-h { font-family: var(--font); font-weight: 700; font-size: 9px; color: #0A2540; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.col-next { margin-top: 7px; background: #0A2540; color: #fff; padding: 6px 10px; border-radius: 3px; font-family: var(--font); font-size: 9.5px; }
.col-next b { color: #c9a040; text-transform: uppercase; letter-spacing: 0.05em; font-size: 8px; margin-right: 6px; }

.rel-doc-foot { margin-top: 8mm; border-top: 1px solid #dde4ec; padding-top: 5px; font-family: var(--font); font-size: 7.5px; color: #8595a4; text-align: center; letter-spacing: 0.02em; }

/* impressão: só o documento, em A4 paisagem */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  #rel-stage, #rel-stage *, #col-stage, #col-stage * { visibility: visible !important; }
  #rel-stage, #col-stage { position: absolute; left: 0; top: 0; width: 100%; padding: 0; margin: 0; background: #fff; overflow: visible; display: block; }
  .rel-a4 { width: 100%; min-height: 0; box-shadow: none; padding: 0; margin: 0; }
  .col-a4 { page-break-after: avoid; }
  .rel-cache-nota { display: none !important; }
}
.module-head { margin-bottom: 28px; }
.module-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.module-head p { color: var(--text-dim); margin-top: 5px; font-size: 14.5px; }

/* ---------- chat ----------
   Track B (spec 09/08): a conversa É a tela — o pane #tab-chat vira coluna
   flex de altura cheia, o .chat-log é O scroll da página e o composer fica
   ancorado embaixo. Nada de moldura com scroll próprio. */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px 16px 8px; }
.chat-thread {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 22px;
  min-height: 100%;
}

/* bubble wrapper for positioning copy button */
.bubble-wrap {
  display: flex; align-items: flex-end; gap: 6px;
  position: relative;
  animation: bubble-in 0.22s ease both;
}
.bubble-wrap.user { flex-direction: row-reverse; }
.bubble-wrap.bot { flex-direction: row; }

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bubble {
  max-width: 76%;
  padding: 12px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14.5px;
  line-height: 1.6;
}
.bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,113,227,0.2);
}
.bubble.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}
.bubble.bot p { margin: 0 0 8px; }
.bubble.bot p:last-child { margin-bottom: 0; }
.bubble.bot ul, .bubble.bot ol { margin: 6px 0 8px 20px; }
.bubble.bot strong { color: var(--text); font-weight: 600; }
.bubble.bot code {
  background: var(--bg); padding: 2px 6px; border-radius: 5px;
  font-size: 0.88em; border: 1px solid var(--border-light);
}

/* C2 (spec 09/08): tabela, bloco de código e citação dentro da bolha do
   assistente — marked.js já parseava isso, só faltava o estilo. Tema
   sóbrio, mesmas variáveis do resto da bolha; tabela e código rolam na
   horizontal em vez de espremer/quebrar a coluna de 720px (C1). */
.bubble.bot pre {
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 12px 14px;
  margin: 4px 0 10px; overflow-x: auto;
}
.bubble.bot pre code {
  background: none; border: none; padding: 0;
  font-size: 0.85em; line-height: 1.5; white-space: pre;
}
.bubble.bot table {
  display: block; overflow-x: auto; max-width: 100%;
  width: max-content; min-width: 0;
  border-collapse: collapse; margin: 4px 0 10px; font-size: 0.9em;
}
.bubble.bot th, .bubble.bot td {
  border: 1px solid var(--border-light); padding: 6px 10px; text-align: left;
}
.bubble.bot th { background: var(--bg); font-weight: 600; color: var(--text); }
.bubble.bot blockquote {
  border-left: 3px solid var(--accent-soft);
  margin: 4px 0 10px; padding: 2px 14px;
  color: var(--text-dim); font-style: italic;
}
.bubble.bot blockquote p:last-child { margin-bottom: 0; }
/* (08/10, pesquisa de formato F1) componentes da resposta: web/js/chat-markdown.js#aplicarComponentes */
.bubble.bot li.tem-farol { list-style: none; margin-left: -1.1em; }
.bubble.bot .farol-selo {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: 1px;
  font-size: 0.78em; font-weight: 600; font-style: normal; line-height: 1;
  padding: 3px 8px 3px 6px; margin-right: 6px; border-radius: 999px; white-space: nowrap;
}
.bubble.bot .farol-ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bubble.bot .farol-verde { background: rgba(52,199,89,0.14); color: #1e7a3a; }
.bubble.bot .farol-verde .farol-ponto { background: var(--green); }
.bubble.bot .farol-amarelo { background: rgba(255,149,0,0.14); color: #8a5000; }
.bubble.bot .farol-amarelo .farol-ponto { background: var(--yellow); }
.bubble.bot .farol-vermelho { background: rgba(255,59,48,0.12); color: #b0261d; }
.bubble.bot .farol-vermelho .farol-ponto { background: var(--red); }
.bubble.bot blockquote.diga-na-mesa {
  font-style: normal; color: var(--text); background: var(--accent-soft);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px 12px;
}
.bubble.bot .mesa-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.bubble.bot .mesa-rotulo { font-size: 0.78em; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent-text); }
.bubble.bot .mesa-copiar {
  font: inherit; font-size: 0.8em; font-weight: 600; color: var(--accent-text); background: var(--bg-elev);
  border: 1px solid var(--border-light); border-radius: 999px; padding: 4px 12px; min-height: 28px; cursor: pointer;
}
.bubble.bot .mesa-copiar:hover { border-color: var(--accent); }
.bubble.bot .mesa-copiar.copiado { color: #1e7a3a; border-color: rgba(52,199,89,0.5); }
.bubble.bot details.para-aprofundar { border-top: 1px solid var(--border-light); margin: 12px 0 8px; padding-top: 8px; }
.bubble.bot details.para-aprofundar > summary { cursor: pointer; font-weight: 600; color: var(--text-dim); list-style-position: inside; padding: 4px 0; }
.bubble.bot details.para-aprofundar[open] > summary { color: var(--text); margin-bottom: 6px; }
.bubble.bot hr { border: none; border-top: 1px solid var(--border-light); margin: 14px 0; }
.bubble.bot h1, .bubble.bot h2, .bubble.bot h3 {
  font-weight: 600; color: var(--text); margin: 14px 0 6px; line-height: 1.35;
}
.bubble.bot h1:first-child, .bubble.bot h2:first-child, .bubble.bot h3:first-child { margin-top: 0; }
.bubble.bot h1 { font-size: 1.15em; }
.bubble.bot h2 { font-size: 1.08em; }
.bubble.bot h3 { font-size: 1em; }

/* copy button on bot bubbles */
.bubble-copy {
  opacity: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-xdim);
  padding: 5px 7px;
  cursor: pointer;
  display: flex; align-items: center;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
  transition: opacity 0.15s, color 0.1s, background 0.1s;
}
.bubble-copy svg { width: 13px; height: 13px; stroke-width: 2; }
.bubble-wrap.bot:hover .bubble-copy { opacity: 1; }
.bubble-copy:hover { color: var(--accent); background: var(--accent-soft); border-color: rgba(0,113,227,0.2); }

.chat-empty {
  color: var(--text-dim); text-align: center;
  margin: auto; padding: 40px; font-size: 15px;
  line-height: 1.7;
}

/* loader "pensando" */
.typing { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-xdim);
  animation: blink 1.3s infinite ease-in-out both;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- trace de raciocínio (S3 · Ticket U) ---------- */
/* UMA linha de status discreta (padrão Claude/ChatGPT): tipografia pequena,
   shimmer sutil varrendo o texto, troca com fade suave e recolhimento quando
   a resposta chega. Nada de pills empilhadas — a rota completa do turno vive
   no payload e em turn_traces (Ticket T). O texto NUNCA é fabricado no front:
   ou é evento real do backend, ou é frase de marca do fallback. */
.bubble.bot.trace-strip {
  background: none;
  border: none;
  box-shadow: none;
  padding: 4px 2px;
}
.trace-line {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.01em;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
  background: linear-gradient(90deg, var(--text-dim) 38%, var(--text) 50%, var(--text-dim) 62%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: traceShimmer 2.4s linear infinite;
  transition: opacity 0.25s ease;
}
.trace-line.trace-fading { opacity: 0; }
@keyframes traceShimmer {
  from { background-position: 210% 0; }
  to   { background-position: -110% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .trace-line { animation: none; -webkit-text-fill-color: currentColor; background: none; }
}
.trace-collapse {
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.22s ease-in, transform 0.22s ease-in;
}

/* ---------- suggestion chips ---------- */
.chips-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 0 10px;
}
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: var(--font); font-size: 13px;
  color: var(--text-dim); cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.chip:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(0,113,227,0.25); }
.chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,113,227,0.25);
  font-weight: 500;
}
.chip-accent:hover { background: rgba(0,113,227,0.16); }

/* ---------- toast ---------- */
.chat-toast {
  position: fixed;
  bottom: 90px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: rgba(29,29,31,0.88);
  color: #fff;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13.5px; font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  white-space: nowrap;
}
.chat-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- chat input ---------- */
.chat-input {
  position: relative; /* âncora do .rec-overlay e do .rec-lock */
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 10px 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Nada no composer é texto selecionável — exceto o próprio textarea.
   Achado em campo (26/08, print do Rafa): durante o segurar-pra-gravar, o
   reconhecedor de toque-longo do Android dispara o menu nativo de seleção
   ("Copiar/Compartilhar/…") sobre qualquer texto selecionável que esteja
   sob o dedo — e isso roda no SO, fora do alcance de preventDefault(). */
.chat-input-wrap,
.chat-input-wrap * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.chat-input-wrap textarea {
  -webkit-user-select: text;
  user-select: text;
}
.chat-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}
.chat-input textarea {
  flex: 1;
  background: transparent; border: none; resize: none;
  color: var(--text); font-family: var(--font); font-size: 14.5px;
  line-height: 1.55; max-height: 140px; outline: none;
  padding: 2px 0;
}
.chat-input textarea::placeholder { color: var(--text-xdim); }

.chat-input-actions { display: flex; gap: 6px; align-items: flex-end; }

.btn-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: transparent; color: var(--text-dim);
  border: none; border-radius: var(--radius-sm);
  font-size: 17px; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.1s, color 0.1s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.recording { color: var(--red); animation: pulse-rec 1s infinite; }
/* mic sem SpeechRecognition: visível mas atenuado; o clique explica a alternativa */
.btn-icon.mic-unsupported { opacity: .45; }
/* segurar-pra-falar no toque não pode rolar o chat por baixo do dedo (B4) —
   nem disparar o gesto de toque-longo do sistema (menu de contexto / seleção
   de texto / callout do iOS), que cancela o ponteiro no meio do segurar.
   touch-action:none só resolve rolagem; os 3 abaixo resolvem o resto.
   Achado em teste real de celular (não pega em toque simulado via CDP). */
#chat-mic {
  position: relative; z-index: 4; /* acima do .rec-overlay: o dedo fica nele o toque inteiro */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* feedback de que soltar agora cancela e descarta o ditado (arrasto, B4) */
.btn-icon.mic-cancel-zone { color: var(--red); background: rgba(255,59,48,0.12); }
@keyframes pulse-rec { 0%,100%{opacity:1} 50%{opacity:0.5} }

.btn-send {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.1s, opacity 0.1s;
  box-shadow: 0 2px 6px rgba(0,113,227,0.25);
}
.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { opacity: 0.4; cursor: default; }

.link-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font); font-size: 12.5px; cursor: pointer;
  transition: color 0.1s;
}
.link-btn:hover { color: var(--accent); }

/* ---------- spider ring ---------- */
.ring-quiz { display: flex; flex-direction: column; gap: 14px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ring-q {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
  animation: card-in 0.25s ease both;
}
.ring-q:focus-within { border-color: var(--accent); }
.ring-q-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.ring-q-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.ring-q h3 { font-size: 14.5px; font-weight: 600; color: var(--text); }
.ring-q .ring-q-desc { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; margin-left: 32px; }
.ring-slider-row { display: flex; align-items: center; gap: 14px; margin-left: 32px; }
.ring-slider-row input[type=range] {
  flex: 1; accent-color: var(--accent);
  height: 4px; cursor: pointer;
}
.ring-val {
  width: 40px; text-align: center;
  border-radius: var(--radius-sm); padding: 4px 0;
  font-weight: 700; font-size: 14px;
  transition: color 0.2s, background 0.2s;
  background: var(--accent-soft); color: var(--accent);
}

.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 28px; font-size: 15px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: background 0.1s, box-shadow 0.1s;
  box-shadow: 0 2px 8px rgba(0,113,227,0.2);
  margin-top: 8px;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(0,113,227,0.3); }

/* ring result */
.ring-result { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.ring-canvas-wrap {
  width: 100%; max-width: 520px; aspect-ratio: 1 / 1; position: relative;
}
.ring-canvas-wrap canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
}

/* readout */
.ring-readout {
  width: 100%;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow);
}
.readout-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.readout-score { font-size: 32px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.readout-level {
  font-size: 13px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.readout-level.dev { background: rgba(255,59,48,0.1); color: var(--red); }
.readout-level.strategic { background: rgba(255,149,0,0.1); color: var(--yellow); }
.readout-level.advanced { background: rgba(52,199,89,0.1); color: var(--green); }

.readout-titulo { font-size: 13px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.2px; }
.readout-base { font-size: 11.5px; color: var(--text-xdim); margin: -12px 0 16px; }
.readout-dims { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.readout-dim { display: flex; align-items: center; gap: 10px; }
.readout-dim-label { width: 168px; font-size: 13px; color: var(--text-dim); flex-shrink: 0; }
.readout-dim-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.readout-dim-bar { height: 100%; border-radius: 4px; width: 0; transition: width 0.5s ease; }
/* as 4 faixas da rubrica canônica — os nomes das classes vêm de FAIXAS[].cor
   em elementos.js, e só valem dentro do readout do Ring */
.readout-dim-bar.green { background: var(--green); }
.readout-dim-bar.yellow { background: var(--amber); }
.readout-dim-bar.orange { background: var(--yellow); }
.readout-dim-bar.red { background: var(--red); }
.readout-dim-score { width: 22px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text); }

.readout-attention { margin-bottom: 18px; }
.readout-attention-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-xdim); margin-bottom: 10px;
}
.readout-insight {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,149,0,0.06); border: 1px solid rgba(255,149,0,0.15);
  margin-bottom: 6px;
}
.readout-insight.critical { background: rgba(255,59,48,0.06); border-color: rgba(255,59,48,0.15); }
.readout-insight-dim { font-size: 13px; font-weight: 600; color: var(--text); min-width: 130px; }
.readout-insight-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.readout-cta {
  width: 100%; padding: 11px 16px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0,113,227,0.2); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background 0.1s;
  text-align: center;
}
.readout-cta:hover { background: rgba(0,113,227,0.15); }

/* ── Spider Ring: o radar de estado (spec 03/09) ─────────────────────────────
   O radar passou a desenhar do banco, e cada elemento carrega de ONDE veio a
   nota. As marcas abaixo são as mesmas do gráfico — losango cheio = sua nota,
   círculo cheio = confirmado com evidência, círculo vazado = hipótese do
   agente, traço = sem informação. Repetir a forma no readout é o que permite
   ler o gráfico sem legenda depois da primeira vez. */

/* A etapa como TRILHA: as 4 na ordem canônica, a atual em destaque. O hover de
   cada chip traz o "o que se faz" do cânone (kb/framework-core.md §3.1), e a
   linha de baixo traz a evidência que o agente escreveu. */
.ring-etapa { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-etapa-trilha { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.ring-etapa-chip {
  font-size: 11.5px; color: var(--text-xdim); background: var(--bg);
  border: 1px solid var(--border-light); border-radius: 20px; padding: 3px 11px;
  cursor: help; white-space: nowrap;
}
.ring-etapa-chip.atual {
  color: var(--accent-text); background: var(--accent-soft);
  border-color: rgba(201,160,64,0.35); font-weight: 650;
}
.ring-etapa-seta { color: var(--border); font-size: 12px; }
.ring-etapa-atual { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; max-width: 560px; text-align: center; }
.ring-etapa-atual b { color: var(--text); font-weight: 650; }
.ring-etapa-indef { color: var(--text-xdim); font-style: italic; }
.ring-etapa-evidencia {
  font-size: 12px; color: var(--text-dim); line-height: 1.55; max-width: 560px;
  text-align: center; border-left: 2px solid var(--accent); padding-left: 10px;
  text-align: left; background: var(--bg); border-radius: 0 6px 6px 0; padding: 8px 12px;
}

/* Estado vazio — honesto: o radar aparece sem polígono e a frase diz o que
   fazer. Nunca um decágono de 5 (o produto já respondeu com dez notas
   inventadas uma vez). */
.ring-vazio {
  max-width: 420px; text-align: center;
  font-size: 13.5px; line-height: 1.6; color: var(--text-dim);
}

/* Fora de foco na etapa — os elementos que a matriz elemento × etapa não
   coloca em jogo agora. Saem do radar e ficam aqui, nomeados: "não relevante"
   é informação, e desenhá-los perto do centro afirmaria nota baixa, que o
   cânone proíbe. */
.ring-fora-foco { width: 100%; padding-top: 16px; border-top: 1px dashed var(--border); }
.ring-fora-foco-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-xdim); text-transform: uppercase; margin-bottom: 10px;
}
.ring-fora-foco-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-foco {
  font-size: 11.5px; color: var(--text-xdim); background: var(--bg);
  border: 1px solid var(--border-light); border-radius: 20px; padding: 3px 11px;
}
/* Elemento fora de foco que MESMO ASSIM tem nota (a sua, tipicamente): a nota
   não pode sumir da tela só porque o eixo saiu do radar. */
.chip-foco b { color: var(--text-dim); font-weight: 600; }
.ring-fora-foco-nota { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* Legenda do radar — a resposta à pergunta "o que é o círculo vazado?".
   Sem ela, a distinção confirmado × hipótese vivia só no atributo title, que no
   celular não existe. Só entram as marcas que APARECEM: legenda de estado que
   não está na tela é ruído. */
.ring-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; max-width: 520px; }
.ring-legenda-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.ring-legenda-item .readout-dim-mark { width: 10px; height: 10px; }

/* Marca de estado no readout — mesma forma do vértice no gráfico. */
.readout-dim-mark { width: 11px; height: 11px; flex-shrink: 0; position: relative; }
.readout-dim-mark::before {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.readout-dim-mark.m-usuario::before {
  width: 8px; height: 8px; background: var(--accent); transform: translate(-50%, -50%) rotate(45deg);
}
.readout-dim-mark.m-confirmado::before {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.readout-dim-mark.m-hipotese::before {
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg-card);
  border: 2px solid var(--accent); box-sizing: border-box;
}
.readout-dim-mark.m-sem-informacao::before {
  width: 9px; height: 2px; background: var(--border);
}
.readout-dim-mark.m-nao-relevante::before {
  width: 5px; height: 5px; border-radius: 50%; background: var(--border-light);
}

.readout-dim.fora-foco .readout-dim-label,
.readout-dim.fora-foco .readout-dim-score { color: var(--text-xdim); opacity: 0.75; }
.readout-dim-score.vazio { color: var(--text-xdim); font-weight: 400; }

/* A linha inteira é o alvo quando há evidência — no celular, um vértice de
   canvas é alvo pequeno demais. Sem modal: a evidência abre embaixo, empurrando
   o resto, e nada fica preso atrás de backdrop. */
.readout-dim.tem-evidencia { cursor: pointer; border-radius: var(--radius-sm); }
.readout-dim.tem-evidencia:hover { background: var(--bg); }
.readout-dim.tem-evidencia:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.readout-dim-chevron {
  width: 14px; flex-shrink: 0; text-align: center;
  font-size: 11px; color: var(--text-xdim); transition: transform 0.18s ease;
}
.readout-dim.aberta .readout-dim-chevron { transform: rotate(90deg); }

.readout-evidencia {
  margin: 2px 0 10px 21px; padding: 10px 13px;
  background: var(--bg); border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px; line-height: 1.6; color: var(--text-dim);
}
.readout-evidencia-label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: 5px;
}

@media (max-width: 640px) {
  .readout-dim-mark { width: 10px; height: 10px; }
  .readout-evidencia { margin-left: 0; }
}

/* ---------- setup de negociação ---------- */
.setup { display: flex; flex-direction: column; gap: 40px; }
.setup-intro {
  background: var(--accent-soft);
  border: 1px solid rgba(0,113,227,0.15);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
}
.setup-intro strong { color: var(--accent); }
.setup-field { display: flex; flex-direction: column; gap: 1px; }
.setup-field label { font-size: 13px; font-weight: 600; color: var(--text); }
.setup-field .setup-hint { font-size: 12px; color: var(--text-xdim); }
.setup-field textarea {
  width: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px;
  color: var(--text); font-family: var(--font); font-size: 14px;
  resize: vertical; min-height: 72px; outline: none; margin-top: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-top: 4px;
}
.setup-field textarea::placeholder { color: var(--text-xdim); }
.setup-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}
.setup-save {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: background 0.1s;
  align-self: flex-start;
}
.setup-save:hover { background: var(--accent-hover); }
.setup-saved {
  font-size: 13px; color: var(--green); font-weight: 500;
  align-self: center; opacity: 0;
  transition: opacity 0.3s;
}
.setup-saved.show { opacity: 1; }
.setup-footer {
  display: flex; align-items: center; gap: 14px; margin-top: 4px;
}

/* ---------- autosave indicator ---------- */
.autosave-ok {
  font-size: 12px; color: var(--green);
  opacity: 0; transition: opacity 0.3s;
}
.autosave-ok.show { opacity: 1; }

/* ---------- entity cards (setup contexto) ---------- */
.entity-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.entity-section + .entity-section { margin-top: 14px; }
.entity-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.entity-section-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.entity-add-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 11px;
  font-family: var(--font); font-size: 12.5px;
  color: var(--text-dim); cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.entity-add-btn svg { width: 12px; height: 12px; stroke-width: 2.5; }
.entity-add-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(0,113,227,0.25); }

.entity-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.entity-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 13px;
}
.entity-card-name { font-weight: 600; color: var(--text); }
.entity-card-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-xdim); padding: 1px;
  display: flex; align-items: center;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
  margin-left: auto;
}
.entity-card-remove svg { width: 13px; height: 13px; stroke-width: 2; }
.entity-card-remove:hover { color: var(--red); background: rgba(255,59,48,0.08); }

.entity-tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 500;
}
.entity-tag.secondary { background: var(--bg); color: var(--text-dim); border: 1px solid var(--border-light); }
.entity-tag.style { background: rgba(52,199,89,0.1); color: var(--green); }

.entity-empty { font-size: 13px; color: var(--text-xdim); padding: 4px 0; }

/* ---------- entity modal ---------- */
.entity-modal-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from{opacity:0} to{opacity:1} }

.entity-modal {
  background: var(--bg-elev);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.entity-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.entity-modal-header strong { font-size: 16px; font-weight: 600; color: var(--text); }
.entity-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-xdim); padding: 4px;
  display: flex; align-items: center; border-radius: 6px;
  transition: color 0.1s, background 0.1s;
}
.entity-modal-close svg { width: 18px; height: 18px; stroke-width: 2; }
.entity-modal-close:hover { color: var(--text); background: var(--bg); }

.entity-modal-section { margin-bottom: 16px; }
.entity-modal-section-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-xdim); margin-bottom: 8px;
}
.entity-existing-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.entity-existing-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  font-family: var(--font); font-size: 13px; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.entity-existing-item:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(0,113,227,0.25); }
.entity-modal-divider {
  font-size: 12px; color: var(--text-xdim); text-align: center;
  padding: 8px 0 4px; border-top: 1px solid var(--border-light);
}

.entity-form { display: flex; flex-direction: column; gap: 14px; }
.entity-form-row { display: flex; flex-direction: column; gap: 5px; }
.entity-form-row label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.entity-form-row .required { color: var(--red); }
.entity-form-row input, .entity-form-row select, .entity-form-row textarea {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entity-form-row input:focus, .entity-form-row select:focus, .entity-form-row textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}
.entity-form-row select { cursor: pointer; }
.entity-form-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px;
}
.entity-form-cancel {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 18px;
  font-family: var(--font); font-size: 14px; color: var(--text-dim);
  cursor: pointer; transition: background 0.1s;
}
.entity-form-cancel:hover { background: var(--bg); }

/* ---------- profile inner tabs ---------- */
.profile-tab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px; margin-top: 8px;
}
.profile-inner-tab {
  padding: 9px 16px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-dim); font-family: var(--font);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.profile-inner-tab:hover { color: var(--text); }
.profile-inner-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.profile-inner-pane { display: none; }
.profile-inner-pane.active { display: block; }

/* profile entity card (Empresas/Stakeholders tabs) */
.profile-entity-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); margin-bottom: 10px;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px;
  position: relative;
}
.pec-delete {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text-xdim); padding: 4px; border-radius: 6px;
  opacity: 0; transition: opacity 0.15s, color 0.1s, background 0.1s;
  line-height: 0;
}
.profile-entity-card:hover .pec-delete { opacity: 1; }
.pec-delete:hover { color: var(--red); background: rgba(255,59,48,0.08); }
.pec-delete svg { width: 15px; height: 15px; stroke-width: 2; }
.pec-name { font-size: 15px; font-weight: 600; color: var(--text); width: 100%; margin-bottom: 2px; }
.pec-notes { font-size: 13px; color: var(--text-dim); width: 100%; margin-top: 4px; margin-bottom: 4px; }
.pec-negs { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; margin-top: 4px; }

/* resultados de questionários */
.quest-score { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 2px; }
.quest-score b { font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.quest-score span:not(.entity-tag) { font-size: 13px; color: var(--text-dim); margin-left: -4px; }
.quest-date { width: 100%; margin: 6px 0 0; font-size: 12px; color: var(--text-xdim); }

/* ---------- biblioteca ---------- */
.library { display: flex; gap: 24px; }
.lib-list { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.lib-list button {
  text-align: left; padding: 10px 13px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-family: var(--font); font-size: 13.5px; cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  box-shadow: var(--shadow);
}
.lib-list button:hover { color: var(--text); border-color: var(--border); }
.lib-list button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.lib-doc {
  flex: 1; min-width: 0;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 28px 32px;
  max-height: calc(100vh - 200px); overflow-y: auto;
  box-shadow: var(--shadow);
}
.lib-placeholder { color: var(--text-dim); }
.lib-search {
  width: 100%; margin-bottom: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 13px;
  color: var(--text); font-family: var(--font); font-size: 13px; outline: none;
}
.lib-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }

/* markdown render */
.md h1 { font-size: 22px; font-weight: 700; margin: 4px 0 16px; letter-spacing: -0.2px; }
.md h2 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.md h3 { font-size: 15px; font-weight: 600; margin: 18px 0 7px; }
.md p { margin: 0 0 12px; color: var(--text-dim); }
.md ul, .md ol { margin: 0 0 12px 22px; }
.md li { margin-bottom: 4px; color: var(--text-dim); }
.md strong { color: var(--text); font-weight: 600; }
.md table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.md th, .md td { border: 1px solid var(--border-light); padding: 7px 10px; text-align: left; }
.md th { background: var(--bg); font-weight: 600; color: var(--text); }
.md td { color: var(--text-dim); }
.md code { background: var(--bg); padding: 2px 5px; border-radius: 4px; font-size: 0.88em; border: 1px solid var(--border-light); }
.md blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px; margin: 0 0 12px; color: var(--text-dim);
}
.md hr { border: none; border-top: 1px solid var(--border-light); margin: 20px 0; }

/* ---------- Lucide SVG icons ---------- */
.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-icon svg { width: 16px; height: 16px; stroke-width: 2; }
.bn-icon { display: flex; align-items: center; justify-content: center; }
.bn-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.neg-new-icon { display: flex; align-items: center; flex-shrink: 0; }
.neg-new-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
.btn-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.btn-send svg { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- neg-item context menu ---------- */
.neg-item-more {
  opacity: 0; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  padding: 2px 3px; color: var(--text-xdim);
  display: flex; align-items: center;
  border-radius: 4px;
  transition: opacity 0.1s, background 0.1s, color 0.1s;
}
.neg-item-more svg { width: 14px; height: 14px; stroke-width: 2; }
.neg-item:hover .neg-item-more { opacity: 1; }
.neg-item-more:hover { background: var(--border-light); color: var(--text-dim); }

.neg-item-menu {
  position: fixed; z-index: 500;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  min-width: 168px;
  animation: menu-in 0.1s ease;
}
@keyframes menu-in {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.neg-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 14px;
  background: none; border: none;
  font-family: var(--font); font-size: 13px;
  color: var(--text-dim); text-align: left; cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.neg-menu-item svg { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; }
.neg-menu-item:hover { background: var(--bg); color: var(--text); }
.neg-menu-item.danger { color: var(--red); }
.neg-menu-item.danger:hover { background: rgba(255,59,48,0.06); color: var(--red); }
.neg-menu-sep { height: 1px; background: var(--border-light); margin: 4px 0; }

/* ---------- neg-item rename ---------- */
.neg-item-rename {
  flex: 1; background: var(--bg-card);
  border: 1px solid var(--accent); border-radius: 4px;
  padding: 2px 6px; font-family: var(--font); font-size: 13px;
  color: var(--text); outline: none;
}

/* ---------- neg header (substitui a tab bar — Track B1) ---------- */
.neg-header {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 14px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(245, 245, 247, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
  z-index: 20;
}
.neg-back {
  display: none;
  width: 40px; height: 40px;
  border: none; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.neg-back:hover { background: var(--bg); color: var(--text); }
.neg-back svg { width: 20px; height: 20px; stroke-width: 2; }
.neg-header-title {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.neg-views {
  display: flex; gap: 2px;
  background: var(--bg-input);
  border-radius: 11px; padding: 3px;
  flex-shrink: 0;
}
.neg-view {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; min-height: 32px;
  border: none; background: transparent; border-radius: 8px;
  color: var(--text-dim); font-family: var(--font); font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.neg-view svg { width: 15px; height: 15px; stroke-width: 2; }
.neg-view:hover { color: var(--text); }
.neg-view.active {
  background: var(--bg-elev); color: var(--text);
  font-weight: 600; box-shadow: var(--shadow);
}
.neg-header-action {
  width: 38px; height: 38px; flex-shrink: 0;
  border: none; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-xdim); cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
}
.neg-header-action:hover { background: var(--bg); color: var(--text); }
.neg-header-action svg { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- tab panes (fade transition) ---------- */
.neg-tab-pane { display: none; opacity: 0; transition: opacity 0.15s ease; }
.neg-tab-pane.visible { display: block; }
.neg-tab-pane.active { opacity: 1; }

.tab-pane-head { margin-bottom: 24px; }
.tab-pane-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.tab-pane-head p { color: var(--text-dim); margin-top: 6px; font-size: 14px; line-height: 1.5; }

/* chat ajustes para tab layout */
.chat-input-wrap { position: relative; }

/* garante que [hidden] funciona mesmo com display explícito */
[hidden] { display: none !important; }

/* ---------- recording bar (nota de voz, #vn-bar em voicenote.js) ---------- */
.recording-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff5f5;
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

/* ---------- overlay de gravação do chat (UX WhatsApp) ----------
   Cobre o composer por cima (position:absolute) em vez de esconder
   textarea/send — trocar o DOM no meio do toque mudava o que estava
   embaixo do dedo e acionava o gesto de seleção do Android (ver o
   comentário em .chat-input-wrap). O mic (z-index:4) fica sempre visível
   no canto: durante o segurar é onde o dedo está; travado, vira o stop. */
.rec-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: #fff5f5;
  border-radius: inherit;
  /* 96px à direita = mic (36) + gap (6) + send coberto (36) + paddings —
     o mic NÃO é o canto: o send fica à direita dele (coberto pelo overlay,
     desabilitado). A lixeira precisa parar ANTES do mic, não embaixo dele. */
  padding: 0 96px 0 14px;
  overflow: hidden;
}
.rec-overlay .rec-text { text-overflow: clip; } /* JS rola pro fim: as últimas palavras importam mais que as primeiras */
/* dica "‹ Deslize para cancelar" — acompanha o dedo via transform inline */
.rec-text.rec-hint { color: var(--text-dim); font-style: normal; }

/* pílula de lock (cadeado + seta), flutuando acima do mic durante o segurar */
.rec-lock {
  /* centralizada sobre o MIC (right-70 ± 20): padding 10 + send 36 + gap 6 → mic começa em right-52 */
  position: absolute; right: 50px; bottom: calc(100% + 14px); z-index: 4;
  width: 40px; padding: 8px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: var(--text-dim);
}
.rec-lock svg { width: 17px; height: 17px; stroke-width: 2; }
.rec-lock svg:first-child { animation: lock-nudge 1.1s ease-in-out infinite; }
@keyframes lock-nudge {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50%      { transform: translateY(-3px); opacity: 1; }
}
/* waveform bars — visual feedback que o áudio está sendo capturado */
.rec-wave {
  display: flex; align-items: center; gap: 3px;
  flex-shrink: 0;
}
.rec-wave span {
  display: block; width: 3px; background: var(--red); border-radius: 2px;
  animation: wave-bar 1.2s ease-in-out infinite;
}
.rec-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.rec-wave span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.rec-wave span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.rec-wave span:nth-child(4) { height: 16px; animation-delay: 0.45s; }
.rec-wave span:nth-child(5) { height: 8px;  animation-delay: 0.6s; }
@keyframes wave-bar {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50%       { transform: scaleY(1);   opacity: 1; }
}
.rec-text {
  flex: 1; font-size: 13px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-timer {
  font-size: 14px; font-weight: 700; color: var(--red);
  flex-shrink: 0; min-width: 36px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.rec-cancel {
  background: none; border: none;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.rec-cancel svg { width: 18px; height: 18px; stroke-width: 2; }
.rec-cancel:hover, .rec-cancel:active { background: rgba(255,59,48,0.08); color: var(--red); }

/* ---------- áudio do chat (spec 18/09): estados novos do composer ----------
   Tudo aqui é aditivo. As defesas de 26/08 (.chat-input-wrap sem seleção,
   overlay absoluto, #chat-mic touch-action:none/z-index:4) não mudam. */

/* waveform AO VIVO: com nível real do mic, a animação decorativa sai e a
   altura vem do JS (style.height). É o único feedback de captação — não há
   mais texto ao vivo. */
.rec-wave.live span { animation: none; transform: none; opacity: 1; transition: height 0.07s linear; }

/* transcrevendo: "Ouvindo o que você disse…" com movimento discreto + Cancelar.
   O timer some (não está mais contando); as barras ondulam devagar. */
.rec-overlay.transcribing { background: #f5f8ff; }
.rec-overlay.transcribing .rec-timer { display: none; }
.rec-overlay.transcribing .rec-wave span { background: var(--accent); animation: wave-think 1.6s ease-in-out infinite; }
.rec-overlay.transcribing .rec-text { color: var(--text); white-space: normal; line-height: 1.25; font-size: 12.5px; }
@keyframes wave-think {
  0%, 100% { transform: scaleY(0.35); opacity: 0.45; }
  50%       { transform: scaleY(0.8);  opacity: 0.9; }
}
.rec-cancel-transcribe {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-family: var(--font); font-size: 13px;
  color: var(--text-dim); cursor: pointer; flex-shrink: 0;
}
.rec-cancel-transcribe:hover, .rec-cancel-transcribe:active { color: var(--text); background: var(--bg); }

/* Enviar em destaque depois da transcrição (D2=A): pulsa 2× e fica realçado
   até o próximo input ou envio. */
.btn-send.hot { box-shadow: 0 0 0 4px rgba(0,113,227,0.22), 0 2px 6px rgba(0,113,227,0.35); animation: send-hot 0.7s ease-in-out 2; }
@keyframes send-hot {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

/* "Transcrito · edite ou envie" — linha discreta abaixo do campo */
.chat-audio-status { font-size: 12px; color: var(--text-dim); padding: 4px 6px 0; }

/* cartão de erro inline — título, motivo, o que fazer, "Entendi". Fora do
   .chat-input-wrap: texto selecionável e botão clicável sem disputar o toque. */
.mic-erro {
  margin: 0 0 8px; padding: 10px 12px;
  background: #fff5f5; border: 1px solid rgba(255,59,48,0.25); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); line-height: 1.45;
}
.mic-erro-titulo { font-weight: 600; margin-bottom: 2px; }
.mic-erro-motivo { color: var(--text-dim); }
.mic-erro-ok {
  margin-top: 8px; padding: 6px 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--font); font-size: 13px; color: var(--text); cursor: pointer;
}
.mic-erro-ok:hover, .mic-erro-ok:active { background: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  .btn-send.hot { animation: none; }
  .rec-overlay.transcribing .rec-wave span { animation: none; transform: scaleY(0.6); }
}

/* ---------- revisão UX/UI do composer de áudio (19/09, gate humano do Rafa) ----------
   Achado: no estado "gravando travado" a lixeira (descartar) e o mic (parar =
   transcrever) ficavam colados no canto direito, com o mesmo peso visual.
   Regras: (1) descartar no canto OPOSTO do parar; (2) parar é o botão primário
   — círculo vermelho cheio com ■; (3) nada entra ou sai do DOM durante o toque:
   a lixeira reserva o lugar (visibility) e o ícone de parar já existe no mic;
   (4) alvos de toque ≥ 44 px no celular; (5) mic ocupado (transcrevendo /
   enviando) fica visivelmente inerte. Ao travar, a lixeira entra no canto
   ESQUERDO (o dedo está no mic, à direita: nada muda embaixo dele; reservar o
   lugar cortava a dica "Deslize para cancelar" em 375 px). As defesas de 26/08
   não mudam. */
.rec-overlay .rec-cancel { order: -1; margin-right: 2px; }
.rec-overlay .rec-cancel { width: 40px; height: 40px; color: var(--text-dim); }
.rec-overlay .rec-cancel svg { width: 20px; height: 20px; }
.rec-overlay .rec-cancel:hover, .rec-overlay .rec-cancel:active { background: rgba(255,59,48,0.10); color: var(--red); }
.rec-overlay.transcribing .rec-cancel { display: none; }

/* o mic como botão de PARAR (travado): cheio, vermelho, ■ branco */
#chat-mic .mic-stop-ico { display: none; }
#chat-mic.locked { background: var(--red); color: #fff; animation: none; border-radius: 50%; }
#chat-mic.locked .mic-ico { display: none; }
#chat-mic.locked .mic-stop-ico { display: block; width: 14px; height: 14px; stroke-width: 0; fill: currentColor; }
#chat-mic.locked:hover { background: #e0342a; color: #fff; }

/* mic ocupado (transcrevendo / enviando áudio): inerte, e parece inerte */
#chat-mic.mic-busy { opacity: .35; pointer-events: none; }

/* "Cancelar" da transcrição: alvo confortável e afastado do mic */
.rec-cancel-transcribe { min-height: 36px; margin-right: 6px; }

@media (max-width: 480px) {
  .rec-overlay .rec-cancel { width: 44px; height: 44px; }
  .rec-overlay { padding-left: 8px; gap: 8px; }
  .rec-cancel-transcribe { min-height: 40px; padding: 8px 14px; }
  /* o botão flutuante de feedback (📣) senta sobre o canto do cartão de erro em 375 px */
  .mic-erro { padding-right: 84px; }
}

/* ---------- gravando no padrão ChatGPT/WhatsApp/Claude (08/10, feedback do Rafa) ----------
   "Quando acabei de falar, não fica claro como termino a gravação. O botão de
   enviar o áudio é vermelho." Agora: a faixa é neutra; o único vermelho é o
   ponto que pulsa (está gravando) e a lixeira quando o dedo/mouse está nela
   (descartar). À direita, o Enviar de sempre, com a cor do produto, por cima
   da faixa: PARAR E ENVIAR. Ao lado dele, o mic vira ✓ neutro: PARAR E REVISAR.
   Nada sai do lugar durante o toque (as defesas de 26/08 seguem). */
.rec-overlay.gravando { background: var(--bg-card); }
.rec-ponto {
  width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%;
  background: var(--red); animation: pulse-rec 1.2s ease-in-out infinite;
}
.rec-overlay.transcribing .rec-ponto, .rec-overlay.uploading .rec-ponto { display: none; }
.rec-overlay.gravando .rec-timer { color: var(--text); font-weight: 600; min-width: 0; text-align: left; }
.rec-overlay.gravando .rec-wave span { background: var(--text-dim); }
.rec-overlay.gravando .rec-text { color: var(--text-dim); }
/* o Enviar fica à vista, habilitado, acima da faixa */
.btn-send.rec-enviar { position: relative; z-index: 4; }
/* o mic gravando (sem dedo): ✓ neutro, "parar e revisar o texto" */
#chat-mic.locked { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 50%; animation: none; }
#chat-mic.locked:hover { background: var(--border-light, #ececf0); color: var(--text); }
#chat-mic.locked .mic-stop-ico { width: 18px; height: 18px; stroke-width: 2.4; fill: none; }
@media (prefers-reduced-motion: reduce) { .rec-ponto { animation: none; } }

/* ---------- bolha de áudio (PR-C, atrás de NEWGO_FLAGS.audioChat) ----------
   Player mínimo dentro da bolha do usuário: ▶/⏸ · barra · m:ss. A transcrição
   (= content) fica sempre visível embaixo. Sem <audio controls> nativo. */
.rec-overlay.uploading { background: #f5f8ff; }
/* a bolha do usuário é o cartão cinza claro (#eef0f3, tema atual) — o player
   usa o texto e o acento do tema, não branco */
.bubble.user.has-audio { min-width: 220px; }
.audio-msg {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.audio-msg-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.audio-msg-btn:hover { filter: brightness(1.06); }
.audio-msg-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.audio-msg.loading .audio-msg-btn { animation: pulse-rec 1s infinite; }
.audio-msg-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,0.12); overflow: hidden; min-width: 60px;
}
.audio-msg-prog { height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 0.15s linear; }
.audio-msg-time { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.audio-msg.unavailable .audio-msg-bar { opacity: .4; }
.audio-msg audio { display: none; }
.audio-msg-text { white-space: pre-wrap; }

/* ---------- áudio na hora (opção A, feedback 63, 08/10) ----------
   A maquete `maquetes/audio-no-chat/opcao-a.html`: a bolha entra na conversa no toque — play (44 px), a forma de
   onda (as barras tocadas acendem), a duração; a transcrição embaixo, separada por uma linha; sob a bolha, as ações
   em texto com ícone ("Cancelar envio · Corrigir", "até a resposta começar"; depois, "Corrigir transcrição").
   Alvos ≥ 44 px. Sem animação com movimento reduzido. */
.bubble.user.has-audio { width: min(86%, 360px); min-width: 0; padding: 8px 12px 10px 8px; border-radius: 22px; }
.has-audio .audio-msg { padding: 0; margin: 0; border-bottom: 0; gap: 10px; }
.has-audio .audio-msg-btn, .audio-ed .audio-msg-btn { width: 44px; height: 44px; font-size: 0; box-shadow: none; }
.audio-msg-btn svg { width: 18px; height: 18px; display: block; }
.audio-msg-ico { display: grid; place-items: center; }
.audio-msg-onda { flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; gap: 2px; cursor: pointer; border-radius: 6px; }
.audio-msg-onda i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: #a9b5cb; }
.audio-msg-onda i.on { background: var(--accent); }
.audio-msg.unavailable .audio-msg-onda { opacity: .4; }
.has-audio .audio-msg-time, .audio-ed .audio-msg-time { min-width: 34px; text-align: right; font-size: 13px; }
.has-audio .audio-msg-text { margin: 8px 4px 0 6px; padding-top: 8px; border-top: 1px solid rgba(10, 22, 40, 0.10); }
.audio-msg-text.recolhida { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.audio-mais { display: inline-flex; align-items: center; min-height: 44px; margin: -4px 0 -10px 2px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.audio-msg-editado { font-size: 12px; color: var(--text-dim); margin: 6px 6px 0; }
.audio-transcrevendo { color: var(--text-dim); }
.audio-shimmer {
  background: linear-gradient(90deg, var(--text-dim) 0%, var(--text-dim) 40%, #c2c8d2 50%, var(--text-dim) 60%, var(--text-dim) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: audio-sh 1.6s linear infinite;
}
@keyframes audio-sh { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.bubble.user.audio-erro { background: var(--bg-card, #fff); border: 1px solid var(--border); }
.audio-estado { display: flex; gap: 8px; align-items: flex-start; margin: 8px 4px 0 6px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 15px; line-height: 1.5; }
.audio-estado svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: #b4541a; }
.audio-estado small { display: block; color: var(--text-dim); font-size: 13px; }
.audio-acoes { display: flex; flex-direction: column; align-items: flex-end; max-width: 100%; }
.audio-acoes:empty { display: none; }
.audio-acoes-linha { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.audio-lnk {
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; color: var(--text-dim); cursor: pointer;
}
.audio-lnk:hover { background: var(--bg); color: var(--text); }
.audio-lnk svg { width: 16px; height: 16px; flex: none; }
.audio-sep { width: 1px; height: 16px; background: var(--border); }
.audio-cap { font-size: 12.5px; color: var(--text-dim); margin: -6px 12px 0 0; text-align: right; }
.msg-refeita { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-dim); margin: 0 0 6px; }
.msg-refeita svg { width: 14px; height: 14px; flex: none; }
/* Corrigir: a bolha abre no lugar, com o texto editável */
.audio-ed {
  width: min(92%, 520px); background: #fff; border: 1px solid var(--accent); border-radius: 22px;
  padding: 10px 12px 8px; box-shadow: 0 2px 8px rgba(10,22,40,.05), 0 8px 30px rgba(10,22,40,.08);
}
.audio-ed .audio-msg { margin: -2px 0 6px -4px; padding: 0; border: 0; gap: 10px; }
.audio-ed-texto {
  display: block; width: 100%; min-height: 96px; border: 0; resize: none; outline: none; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.55; color: var(--text); padding: 4px 2px;
  -webkit-user-select: text; user-select: text;
}
.audio-ed-aviso { display: flex; gap: 6px; align-items: flex-start; margin: 2px 2px 8px; font-size: 13px; color: var(--text-dim); }
.audio-ed-aviso svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.audio-ed-acoes { display: flex; justify-content: flex-end; gap: 6px; }
.audio-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.audio-btn-sec { background: none; color: var(--text-dim); }
.audio-btn-sec:hover { background: var(--bg); }
.audio-btn-pri { background: var(--accent); color: #fff; }
/* "Áudio cancelado. O Ring não recebeu nada. · Desfazer" */
.chat-toast.chat-toast-acao { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px; max-width: calc(100% - 32px); }
.chat-toast-btn { min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: #e8d6a6; font: inherit; font-weight: 600; cursor: pointer; }
.chat-toast-btn:hover { background: rgba(255,255,255,.08); }
/* gravando: "Descartar" rotulado à esquerda; o mic sai da linha (sem o ✓ sem rótulo, D3); o Enviar é a pílula "↑ Enviar" */
.rec-cancel-rot { display: none; }
.rec-overlay.gravando:not(.segurando) .rec-cancel { width: auto; min-width: 44px; padding: 0 10px 0 8px; gap: 4px; display: inline-flex; align-items: center; border-radius: 999px; font-family: inherit; font-size: 14px; }
.rec-overlay.gravando:not(.segurando) .rec-cancel-rot { display: inline; }
.rec-overlay.gravando:not(.segurando) .rec-text { display: none; }
.rec-overlay.gravando:not(.segurando) { padding-right: 124px; }
.rec-overlay.gravando .rec-wave { flex: 1; min-width: 0; justify-content: flex-end; overflow: hidden; height: 26px; align-items: center; display: flex; gap: 2px; }
.rec-overlay.gravando .rec-wave span { flex: none; width: 3px; border-radius: 2px; }
#chat-mic.locked { display: none; }
.send-rot { display: none; }
.btn-send.rec-enviar { width: auto; padding: 0 14px 0 10px; gap: 6px; display: inline-flex; align-items: center; border-radius: 999px; }
.btn-send.rec-enviar .send-rot { display: inline; font-weight: 600; font-size: 15px; }
.bubble-wrap.sem-entrada { animation: none; }
.sr-audio { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rec-dica { text-align: center; font-size: 13px; color: var(--text-dim); margin: 0 auto 6px; }
.rec-dica[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .audio-shimmer { animation: none; color: var(--text-dim); background: none; } }

/* ---------- mobile header (hamburger) ---------- */
.mobile-header { display: none; }
.mobile-hamburger {
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-dim);
  transition: background 0.1s, color 0.1s; flex-shrink: 0;
}
.mobile-hamburger:hover { background: var(--bg); color: var(--text); }
.mobile-hamburger svg { width: 22px; height: 22px; stroke-width: 2; }
.mobile-header-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; user-select: none;
}
.mobile-header-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 7px; font-size: 13px;
}
.mobile-header-end { width: 40px; }
.drawer-backdrop { display: none; }

/* ---------- mobile bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-elev);
  border-top: 1px solid var(--border-light);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}
.bottom-nav-items { display: flex; justify-content: space-around; }
.bottom-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  padding: 6px 12px;
  color: var(--text-dim); font-family: var(--font); font-size: 10px;
  transition: color 0.1s;
  min-width: 56px;
}
.bottom-nav-btn .bn-icon { font-size: 20px; line-height: 1; }
.bottom-nav-btn.active { color: var(--accent); }
.bottom-nav-btn:hover { color: var(--text); }

/* ---------- home page ---------- */
.home-header { margin-bottom: 32px; }
.home-header h1 { font-size: 26px; font-weight: 700; color: var(--text); }
.home-header p { font-size: 14px; color: var(--text-dim); margin-top: 4px; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.home-neg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.15s;
}
.home-neg-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
}
.hnc-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}
.hnc-meta { display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.hnc-date { font-size: 12px; color: var(--text-xdim); }
.hnc-msgs {
  font-size: 11.5px; font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 1px 8px;
}
.home-new-card {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
  box-shadow: none;
  transform: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.home-new-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hnc-plus { font-size: 28px; font-weight: 300; line-height: 1; }
.home-new-card .hnc-title { font-size: 13.5px; color: inherit; font-weight: 500; flex: 0; }

/* brand is now clickable */
.brand { cursor: pointer; }
.brand:hover .brand-mark { background: var(--accent-hover); }

/* ---------- confirm modal ---------- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  max-width: 320px; width: 100%;
  box-shadow: var(--shadow-md);
  animation: menu-in 0.12s ease;
}
.confirm-msg {
  font-size: 15px; color: var(--text);
  margin-bottom: 6px; line-height: 1.5;
}
.confirm-sub {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 22px; line-height: 1.4;
}
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-cancel {
  padding: 9px 18px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim); font-family: var(--font); font-size: 14px;
  cursor: pointer; transition: background 0.1s;
}
.confirm-cancel:hover { background: var(--bg); }
.confirm-ok {
  padding: 9px 18px;
  background: var(--red); border: none;
  border-radius: var(--radius-sm);
  color: #fff; font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.1s;
}
.confirm-ok:hover { opacity: 0.88; }

/* ---------- aviso de documento processando (B4, spec higiene 18/09) ---------- */
.doc-wait-send { background: var(--accent); }
.doc-wait-pending { flex-direction: column; align-items: flex-end; gap: 4px; }
.doc-wait-pending .bubble { opacity: 0.55; }
.doc-wait-status {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-dim);
}
.doc-wait-status .doc-wait-cancel {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim); font-family: var(--font); font-size: 12.5px;
  padding: 3px 10px; cursor: pointer; transition: background 0.1s;
}
.doc-wait-status .doc-wait-cancel:hover { background: var(--bg); }

/* ---------- responsivo ---------- */
@media (max-width: 768px) {
  /* sidebar becomes slide-in drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh; height: 100dvh;
    width: 280px;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0,0,0,0.2);
  }
  .drawer-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 399;
    animation: fade-in 0.2s ease;
  }
  .drawer-backdrop.show { display: block; }
  /* mobile sticky header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-light);
    padding: 0 12px;
    z-index: 200;
  }
  .bottom-nav { display: block; }
  .app { flex-direction: column; }
  /* flex layout — eliminates scroll-overflow and empty gap below chat */
  .content { padding: 68px 16px 0; overflow: hidden; height: 100dvh; display: flex; flex-direction: column; }
  .module.active { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
  #module-home.active, #module-library.active, #module-profile.active { overflow-y: auto; padding-bottom: 0; }
  /* no celular o questionário preenche edge-to-edge, mantendo a barra do topo */
  body.in-quiz .content { padding: 68px 0 0; }
  /* o simulador mantém a barra do topo e o bottom-nav: reserva espaço embaixo */
  body.in-sim .content { padding: 68px 0 calc(58px + env(safe-area-inset-bottom)); }
  /* relatório: tela cheia com a barra do topo; bottom-nav e FAB saem (foco no doc) */
  body.in-relatorio .content { padding: 68px 0 0; }
  body.in-relatorio .bottom-nav, body.in-relatorio .fb-fab { display: none !important; }
  .rel-tbtn span { display: none; }
  .rel-stage { padding: 12px; }
  /* o FAB de "Reportar problema" cobre o botão de enviar do chat (e os
     controles do questionário) no mobile — esconde nessas superfícies aqui */
  body.in-sim .fb-fab,
  body.in-quiz .fb-fab { display: none !important; }
  /* aperto do chat no mobile: usa melhor a largura, dá folga ao botão enviar */
  .sim-banner { height: 180px; }
  .sim-head { padding: 12px 14px 10px; }
  .sim-log { padding: 16px 14px; gap: 12px; }
  .sim-bubble { max-width: 86%; }
  .sim-composer { padding: 10px 12px; gap: 8px; }
  .sim-reset span { display: none; }
  .sim-reset { padding: 7px; }
  .simneg-hint { margin: 12px 14px 4px; }
  .simneg-list { padding: 8px 14px 20px; }
  .neg-tab-pane.visible { display: flex; flex-direction: column; }
  .neg-tab-pane.active  { flex: 1; min-height: 0; overflow: hidden; }
  /* setup e ring não têm scroll interno — devem rolar como página */
  #tab-setup.active, #tab-ring.active { overflow-y: auto; padding-bottom: 0; }
  /* iOS Safari ignora padding-bottom em overflow containers — spacer real garante scroll completo */
  #module-home::after, #module-library::after, #module-profile::after,
  #tab-setup::after, #tab-ring::after {
    content: ''; display: block; height: 80px; flex-shrink: 0; min-height: 80px;
  }
  /* chat fills the pane (bottom-nav some dentro da negociação — Track B5) */
  .chat { height: auto; flex: 1; min-height: 0; overflow: hidden; }
  .module-head h1 { font-size: 22px; }
  .tab-pane-head h2 { font-size: 20px; }
  .ring-canvas-wrap { max-width: 100%; }
  .library { flex-direction: column; }
  .lib-list { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .lib-doc { max-height: none; overflow: visible; }
  .readout-dim-label { width: 120px; font-size: 12px; }
  .sidebar-close { display: flex; align-items: center; justify-content: center; }
  .entity-cards { flex-direction: column; }
  .entity-card { flex-direction: row; flex-wrap: wrap; }
  .chips-row { gap: 6px; }
  .chip { font-size: 12.5px; padding: 6px 12px; white-space: normal; text-align: center; }
  .chat-toast { bottom: 75px; }
  .profile-inner-tab { padding: 8px 12px; font-size: 12.5px; }
  .entity-modal { max-width: 100%; }
  .entity-modal-overlay { padding: 12px; align-items: flex-end; }
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .setup-intro { font-size: 13.5px; }
  .ring-slider-row { gap: 8px; }
  .pec-delete { opacity: 0.5; }
  /* hide native scrollbars — content still scrollable */
  * { scrollbar-width: none; }
  *::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .content { padding: 68px 12px 0; }
  .bubble { max-width: 90%; font-size: 14px; }
  .ring-q { padding: 14px 16px; }
  .ring-q .ring-q-desc { margin-left: 0; }
  .ring-slider-row { margin-left: 0; }
  .ring-val { min-width: 28px; font-size: 13px; }
  .readout-dim-label { width: 100px; font-size: 11px; }
  .entity-section { padding: 12px 14px; }
  .profile-tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .profile-inner-tab { white-space: nowrap; }
  .home-grid { grid-template-columns: 1fr; }
  .home-header h1 { font-size: 22px; }
  .entity-modal-overlay { padding: 0; align-items: flex-end; }
  .entity-modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 88vh; }
  .setup-field label { font-size: 13.5px; }
  .setup-hint { font-size: 12px; }
  .chips-row { gap: 6px; }
  .chip { font-size: 12px; padding: 5px 11px; }
  .readout-dim-bar-wrap { flex: 1; min-width: 60px; }
}

/* ---------- tema navy + gold (Newgotiation brand) ---------- */
.sidebar {
  background: var(--navy);
  border-right-color: rgba(255,255,255,0.08);
}
.brand-mark { background: none; border-radius: 0; box-shadow: none; font-size: 0; }
.brand:hover .brand-mark { background: none; }
.brand-text strong { color: #fff; }
.brand-text span   { color: rgba(255,255,255,0.5); }
.nav-section-label { color: rgba(255,255,255,0.3); }
.nav-item          { color: rgba(255,255,255,0.55); }
.nav-item:hover    { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active   { background: rgba(201,160,64,0.12); color: var(--accent); }
.neg-item          { color: rgba(255,255,255,0.5); }
.neg-item:hover    { background: rgba(255,255,255,0.06); color: #fff; }
.neg-item.active   { background: rgba(201,160,64,0.12); color: var(--accent); }
.neg-new           { color: rgba(255,255,255,0.45); border-color: rgba(255,255,255,0.15); }
.neg-new:hover     { background: rgba(201,160,64,0.12); color: var(--accent); border-color: var(--accent); }
.sidebar-foot      { border-top-color: rgba(255,255,255,0.1); }
.version-label     { color: rgba(255,255,255,0.35); }
.lang-switch       { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.ls-opt            { color: rgba(255,255,255,0.5); }
.lang-switch.pt .ls-opt[data-lang="pt"],
.lang-switch.en .ls-opt[data-lang="en"] { background: var(--accent); color: var(--navy); }

.mobile-header {
  background: var(--navy);
  border-bottom-color: rgba(255,255,255,0.08);
}
.mobile-hamburger       { color: rgba(255,255,255,0.7); }
.mobile-hamburger:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mobile-header-brand    { color: #fff; }
.mobile-header-mark { background: none; border-radius: 0; font-size: 0; padding: 0; }

.bottom-nav              { background: var(--navy); border-top-color: rgba(255,255,255,0.08); }
.bottom-nav-btn          { color: rgba(255,255,255,0.5); }
.bottom-nav-btn.active   { color: var(--accent); }
.bottom-nav-btn:hover    { color: #fff; }

/* ---------- LLM-style chat (override WhatsApp bubbles) ---------- */
.chat-log { gap: 20px; padding: 28px 0; }

/* user message: subtle card, right-aligned but not gold bubble */
.bubble-wrap.user { flex-direction: column; align-items: flex-end; gap: 0; }
.bubble.user {
  align-self: auto;
  background: #eef0f3;
  color: var(--text);
  border-radius: 18px 18px 4px 18px;
  box-shadow: none;
  font-size: 0.93rem;
  max-width: 72%;
}

/* bot message: no bubble — just clean text, full width */
.bubble-wrap.bot { flex-direction: column; align-items: flex-start; gap: 4px; }
.bubble.bot {
  align-self: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  max-width: 100%;
  font-size: 0.95rem;
  line-height: 1.7;
  /* marked.js já traduz as quebras significativas para blocos/<br>.
     `pre-wrap` aqui transformava também os `\n` entre tags em linhas vazias. */
  white-space: normal;
}
.bubble.bot p  { margin: 0 0 8px; }
.bubble.bot p:last-child { margin-bottom: 0; }
.bubble.bot ul, .bubble.bot ol { margin: 4px 0 8px 22px; }
.bubble.bot li { margin: 2px 0; }
.bubble.bot li > p { margin: 0; }
.bubble.bot li > ul, .bubble.bot li > ol { margin-top: 2px; margin-bottom: 6px; }

/* copy button below bot message */
.bubble-wrap.bot .bubble-copy {
  position: static;
  opacity: 0;
  margin-top: 2px;
  align-self: flex-start;
}
.bubble-wrap.bot:hover .bubble-copy { opacity: 1; }

/* remove the "box" look on desktop — use full content width */
@media (min-width: 769px) {
  .content { padding: 32px 40px; }
}

/* F7 — cap line length on ultra-wide displays */
@media (min-width: 1200px) {
  .module { max-width: 920px; margin-left: auto; margin-right: auto; }
}

/* ─── B6: documentos da negociação ─────────────────────────── */

.docs { display: flex; flex-direction: column; gap: 16px; }

.docs-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 30px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.docs-drop:hover, .docs-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.docs-drop i { width: 26px; height: 26px; color: var(--accent); }
.docs-drop strong { font-size: 14px; color: var(--text); }
.docs-drop span   { font-size: 12px; color: var(--text-dim); }

/* nota de voz — gravar direto na aba Documentos */
.docs-voice { display: flex; flex-direction: column; gap: 10px; }
.btn-voice-note {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 16px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--text); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-voice-note svg { width: 16px; height: 16px; stroke-width: 2; }
.btn-voice-note:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-voice-note.recording {
  border-color: rgba(255,59,48,.4); color: var(--red);
  background: #fff5f5; animation: pulse-rec 1s infinite;
}
.vn-status { font-size: 12.5px; color: var(--text-dim); margin: 0; }

.docs-list { display: flex; flex-direction: column; gap: 8px; }

.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.doc-item.error { border-color: rgba(255,59,48,.35); }

.doc-icon { width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; }
.doc-main { flex: 1; min-width: 0; }
.doc-name {
  font-size: 13.5px; color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.doc-status { font-weight: 600; }
.doc-status.processing { color: var(--yellow); }
.doc-status.ready      { color: var(--green); }
.doc-status.error      { color: var(--red); }

.doc-progress { height: 3px; background: var(--border-light); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.doc-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }

/* toggle "usar na análise" */
.doc-toggle { position: relative; width: 34px; height: 20px; flex-shrink: 0; cursor: pointer; }
.doc-toggle input { opacity: 0; width: 0; height: 0; }
.doc-toggle span { position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: background .15s; }
.doc-toggle span::before {
  content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.doc-toggle input:checked + span { background: var(--accent); }
.doc-toggle input:checked + span::before { transform: translateX(14px); }
.doc-toggle input:disabled + span { opacity: .45; cursor: not-allowed; }

.doc-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 4px; border-radius: 6px;
  display: grid; place-items: center; flex-shrink: 0;
}
.doc-btn:hover { background: var(--bg-input); color: var(--text); }
.doc-btn.danger:hover { color: var(--red); }
.doc-btn i { width: 15px; height: 15px; }

.docs-empty { font-size: 13px; color: var(--text-dim); text-align: center; padding: 8px 20px; }

@media (max-width: 640px) {
  .docs-drop { padding: 22px 14px; }
  .doc-name { font-size: 13px; }
}

/* ─── Aba Resumo (brain_md + summary_md por documento, visual Biblioteca) ── */
/* reaproveita .library / .lib-list / .lib-doc / .md da Biblioteca */
.lib-list button.brain-item { display: flex; flex-direction: column; gap: 3px; align-items: stretch; }
.brain-item .bi-title {
  display: flex; align-items: center; gap: 7px; font-weight: 500; color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brain-item .bi-title i { width: 14px; height: 14px; flex-shrink: 0; }
.brain-item .bi-sub { font-size: 11.5px; color: var(--text-xdim); padding-left: 21px; }
.brain-item.active .bi-sub { color: var(--accent); }
.brain-item[disabled] { opacity: .55; cursor: default; box-shadow: none; }
.brain-item[disabled]:hover { color: var(--text-dim); border-color: var(--border-light); }
/* citação da fonte [arquivo] não quebra o layout em telas estreitas */
.brain-view .md li, .brain-view .md p { overflow-wrap: anywhere; }

/* ═══════════════════════════════════════════════════════════════════════════
   Track B (spec 09/08) — chat como superfície nativa
   Benchmark: o que Claude e ChatGPT têm em comum. Gemini/Apple como polish.
   ═══════════════════════════════════════════════════════════════════════ */

/* Dentro da negociação o content vira moldura de tela cheia (sem padding,
   sem scroll próprio) — quem rola é o chat-log. */
body.in-neg .content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

/* Questionários embedados: o content vira moldura de tela cheia e o iframe
   preenche, sem perder a sidebar — mesma ideia do in-neg. */
body.in-quiz .content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-quiz #module-qessencial.active,
body.in-quiz #module-qpro.active { max-width: none; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.in-neg #module-neg.active {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  max-width: none; margin: 0; width: 100%;
}

/* pane do chat = coluna flex que preenche o módulo */
#tab-chat.visible { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* panes não-chat: rolam como página, conteúdo em coluna centrada */
body.in-neg .neg-tab-pane.visible:not(#tab-chat) {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 32px 24px 64px;
}
body.in-neg .neg-tab-pane:not(#tab-chat) > * {
  max-width: 860px; margin-left: auto; margin-right: auto;
}

/* ---------- composer (ancorado embaixo, coluna centrada) ---------- */
.chat-composer { padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); flex-shrink: 0; }
.chat-composer > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.chat-composer .chips-row { padding: 0 2px 8px; }
.chat-input {
  border-radius: 24px;
  border-color: var(--border-light);
  padding: 10px 10px 10px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.chat-input:focus-within {
  border-color: rgba(201, 160, 64, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07), 0 0 0 3px var(--accent-soft);
}
.btn-send { border-radius: 50%; transition: background 0.15s, transform 0.12s; }
.btn-send:active { transform: scale(0.92); }
.btn-send.stop { background: var(--text); box-shadow: none; }
.btn-send.stop:hover { background: #3a3a3c; }

/* ---------- estado vazio ---------- */
.chat-empty { margin: auto; max-width: 460px; padding: 32px 20px; }
.chat-empty-mark { font-size: 26px; color: var(--accent); margin-bottom: 10px; }
.chat-empty-lead { font-size: 15.5px; color: var(--text); line-height: 1.65; }
.chat-empty-hint { font-size: 13px; color: var(--text-xdim); margin-top: 10px; }

/* ---------- voltar ao fim (scroll inteligente) ---------- */
.scroll-bottom {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 148px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: grid; place-items: center;
  color: var(--text-dim); cursor: pointer; z-index: 15;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.scroll-bottom:hover { color: var(--text); transform: translateX(-50%) translateY(-1px); }
.scroll-bottom svg { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- linha de trace viva (nível 1+2 durante o turno) ---------- */
.trace-strip-live { padding: 2px 0 4px; }
.bubble-wrap.bot.streaming .trace-strip-live { opacity: 0.75; }

/* ---------- rota do turno (persistente, 3 níveis — Track B2) ---------- */
.trace-route { width: 100%; }
.trace-summary {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; padding: 2px 0;
  color: var(--text-xdim); font-family: var(--font); font-size: 12.5px;
  cursor: pointer; transition: color 0.15s;
}
.trace-summary:hover { color: var(--text-dim); }
.trace-summary svg { width: 13px; height: 13px; stroke-width: 2; }
.trace-caret { transition: transform 0.2s ease; }
.trace-route.open .trace-caret { transform: rotate(180deg); }
.trace-detail {
  margin: 6px 0 4px;
  border-left: 2px solid var(--border-light);
  padding-left: 12px;
  display: flex; flex-direction: column; gap: 1px;
}
.trace-step {
  display: flex; gap: 8px; align-items: baseline;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 3px 6px; border-radius: 6px;
  font-family: var(--font); font-size: 12.5px; color: var(--text-dim);
  transition: background 0.12s;
  max-width: 100%;
}
.trace-step:hover { background: var(--bg-elev); }
.trace-step-kind {
  color: var(--text-xdim); flex-shrink: 0;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
.trace-step-alvo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trace-step-deep {
  padding: 2px 6px 8px 10px;
  font-size: 12px; color: var(--text-dim);
  display: flex; flex-direction: column; gap: 2px;
  overflow-wrap: anywhere;
}
.trace-step-deep .trace-step-t { color: var(--text-xdim); font-variant-numeric: tabular-nums; }

/* ---------- ações por mensagem (copiar · regenerar · editar) ---------- */
.msg-actions { display: flex; gap: 2px; margin-top: 2px; opacity: 0; transition: opacity 0.15s; }
.bubble-wrap:hover .msg-actions,
.bubble-wrap:focus-within .msg-actions { opacity: 1; }
.msg-action {
  width: 30px; height: 30px;
  border: none; background: transparent; border-radius: 8px;
  color: var(--text-xdim); cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.msg-action:hover { background: var(--bg-elev); color: var(--text); }
.msg-action:active { transform: scale(0.9); }
.msg-action svg { width: 14px; height: 14px; stroke-width: 2; }
.bubble-wrap.user .msg-actions { justify-content: flex-end; }
@media (hover: none) {
  .msg-actions { opacity: 0.55; }
}

/* ---------- erro + retry ---------- */
.bubble.bot.bubble-error {
  color: #b3261e;
  background: rgba(255, 59, 48, 0.05);
  border: 1px solid rgba(255, 59, 48, 0.16);
  border-radius: 12px; padding: 10px 14px;
  max-width: fit-content;
}
.bubble-retry {
  align-self: flex-start;
  display: inline-flex; gap: 6px; align-items: center;
  margin-top: 6px;
  border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text-dim); border-radius: 16px; padding: 6px 12px;
  font-family: var(--font); font-size: 12.5px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.bubble-retry:hover { color: var(--accent-text); border-color: var(--accent); }
.bubble-retry svg { width: 13px; height: 13px; }

/* resposta de turno interrompido (06/10; 08/10 no padrão ChatGPT/Claude): o texto que chegou fica como
   está, sem esmaecer; embaixo, uma nota discreta. Nunca a cara de erro. */
.msg-interrompida {
  align-self: flex-start;
  margin-top: 4px;
  color: var(--text-xdim, #8e8e93); font-family: var(--font); font-size: 12.5px;
}
.bubble-wrap.nota-interrompida .msg-interrompida { margin-top: 0; }
/* depois de interromper: o lápis da mensagem dela fica à vista, com o que faz escrito */
.msg-actions.msg-actions-fixas { opacity: 1; }
.msg-action.msg-action-rotulo {
  width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 15px; color: var(--text-dim);
  font-family: var(--font); font-size: 12.5px;
}
.msg-action.msg-action-rotulo:hover { color: var(--text); }

/* ---------- banner de edição ---------- */
.edit-banner {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 12px; padding: 6px 12px; margin-bottom: 6px;
}
.edit-banner svg { width: 13px; height: 13px; stroke-width: 2; }
.edit-cancel {
  margin-left: auto; border: none; background: none;
  color: inherit; cursor: pointer; display: grid; place-items: center;
  padding: 2px; border-radius: 6px;
}
.edit-cancel:hover { background: rgba(201, 160, 64, 0.18); }
.edit-cancel svg { width: 13px; height: 13px; }

/* ---------- mobile: requisito de primeira classe (Track B5) ---------- */
@media (max-width: 768px) {
  /* dentro da negociação: o cabeçalho da negociação é o ÚNICO chrome —
     mobile-header e bottom-nav saem, o teclado redimensiona o layout
     (interactive-widget=resizes-content no viewport) */
  body.in-neg .mobile-header { display: none; }
  body.in-neg .bottom-nav { display: none; }
  body.in-neg .content { padding: 0; height: 100dvh; }
  body.in-neg .app { height: 100dvh; }

  .neg-header {
    flex-wrap: wrap; min-height: 0;
    padding: calc(6px + env(safe-area-inset-top)) 8px 8px;
    row-gap: 4px;
  }
  .neg-back { display: grid; order: 1; width: 44px; height: 44px; }
  .neg-header-title { order: 2; font-size: 15px; }
  .neg-header-action { order: 3; width: 44px; height: 44px; }
  .neg-views {
    order: 4; width: 100%;
    background: transparent; padding: 0; gap: 6px;
    overflow-x: auto; scrollbar-width: none;
  }
  .neg-views::-webkit-scrollbar { display: none; }
  .neg-view {
    background: var(--bg-input);
    border-radius: 18px; min-height: 44px; min-width: 44px;
    justify-content: center; padding: 6px 13px;
    flex-shrink: 0; font-size: 12.5px;
  }
  .neg-view.active { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
  /* rótulos SEMPRE visíveis (a fileira rola) — ícone sem rótulo é o smell
     "mystery navigation" do interface-auditor; rolar custa menos que decorar */

  .chat-log { padding: 14px 14px 6px; }
  .chat-thread { gap: 18px; }
  .chat-composer { padding: 4px 10px calc(10px + env(safe-area-inset-bottom)); }
  .btn-send, .btn-icon { width: 44px; height: 44px; }
  .msg-action { width: 40px; height: 40px; }
  .scroll-bottom { bottom: 132px; width: 40px; height: 40px; }
  body.in-neg .neg-tab-pane.visible:not(#tab-chat) { padding: 20px 16px 96px; }
  .chat-toast { bottom: 120px; }
}

/* ---------- micro-interações (Track B6) — nada decorativo sem função ---------- */
.neg-view, .chip, .msg-action, .btn-send, .neg-back, .neg-header-action { -webkit-tap-highlight-color: transparent; }
.chip:active { transform: scale(0.97); }
.neg-view:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .bubble-wrap { animation: none; }
  .trace-caret, .btn-send, .chip, .neg-view, .scroll-bottom { transition: none; }
  .chat-log { scroll-behavior: auto; }
}

/* ================================================================
   Rota do Turno — sessão 2 (spec 25/08): faixa-resumo (B6),
   bottom sheet (B7) e feedback flutuante (B8)
   ================================================================ */

/* ---------- B6: faixa-resumo embaixo de cada resposta ---------- */
.rota-faixa {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; padding: 4px 0 2px;
  color: var(--text-xdim); font-family: var(--font); font-size: 12.5px;
  cursor: pointer; transition: color 0.15s; text-align: left;
  max-width: 100%;
}
.rota-faixa:hover { color: var(--text-dim); }
.rota-faixa svg { width: 13px; height: 13px; stroke-width: 2; flex-shrink: 0; }
.rota-faixa-txt { overflow-wrap: anywhere; }
.rota-faixa-caret { opacity: 0.7; }

/* ---------- B7: bottom sheet — padrão "ver detalhes" ---------- */
/* backdrop translúcido: a resposta continua visível acima (spec B7) */
.rota-backdrop {
  position: fixed; inset: 0; z-index: 920;
  background: rgba(15, 15, 20, 0.28);
  opacity: 0; transition: opacity 0.22s ease;
}
.rota-backdrop.show { opacity: 1; }
.rota-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 930;
  max-height: 86dvh;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(100%); transition: transform 0.24s ease;
  overflow: hidden;
  /* rolagem horizontal NUNCA (PC-12) — todo conteúdo quebra linha */
  overflow-wrap: anywhere;
}
.rota-sheet.show { transform: translateY(0); }
.rota-grab { padding: 8px 0 2px; display: grid; place-items: center; touch-action: none; }
.rota-grab span {
  width: 38px; height: 4px; border-radius: 2px; background: var(--border, #d9d9de);
}
.rota-head {
  padding: 4px 18px 12px; border-bottom: 1px solid var(--border-light, #ececf0);
  position: relative; touch-action: none;
}
.rota-title { font-size: 15px; font-weight: 600; color: var(--text); }
.rota-close {
  position: absolute; top: 0; right: 10px;
  width: 40px; height: 40px; border: none; background: transparent;
  color: var(--text-xdim); cursor: pointer; border-radius: 10px;
  display: grid; place-items: center;
}
.rota-close:hover { background: var(--bg); color: var(--text); }
.rota-close svg { width: 16px; height: 16px; }
/* o que fica visível sem nenhum toque (D11): modelo · tokens · fichas+critério */
.rota-resumo { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.rota-chip {
  display: inline-flex; align-items: center;
  background: var(--bg-input); border-radius: 12px; padding: 3px 10px;
  font-size: 12px; color: var(--text-dim);
}
.rota-chip-modelo { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.rota-resumo-fichas {
  width: 100%; font-size: 12.5px; color: var(--text-dim); line-height: 1.45;
}
.rota-resumo-fichas strong { color: var(--accent-text); }
.rota-body { overflow-y: auto; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); }

/* Trace v2 (28/09): leitura do coração no topo da rota + técnico atrás de um toque */
.rota-tecnico-toggle { margin-top: 4px; }
.rota-resumo-tecnico[hidden] { display: none; }
.rota-leitura {
  background: var(--bg-input); border-radius: 12px;
  padding: 10px 12px; margin: 2px 0 10px;
  border-left: 3px solid var(--accent-text);
}
.rota-leitura-ausente { border-left-color: #b3261e; }
.rota-leitura-kv .rota-kv-k { flex: 0 0 132px; min-width: 0; }
.rota-leitura-kv .rota-kv-v strong { color: var(--text); font-weight: 600; }
.rota-leitura-frase { display: block; margin-top: 2px; font-style: italic; }
.rota-leitura-alerta { margin-top: 6px; font-size: 12.5px; color: #b3261e; font-weight: 600; }
.rota-leitura-nota { margin-top: 6px; font-size: 12px; color: var(--text-xdim); }

/* "O que o Ring leu neste turno" (item K) — fontes agregadas no topo */
.rota-fontes {
  background: var(--bg-input); border-radius: 12px;
  padding: 10px 12px; margin: 2px 0 10px;
}
.rota-fontes-tit {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-xdim); margin-bottom: 6px;
}
.rota-fontes-vazio { font-size: 12.5px; color: var(--text-dim); font-style: italic; }
.rota-fonte-grupo { display: block; padding: 6px 0; font-size: 12.5px; }
.rota-fonte-rotulo {
  display: block; margin-bottom: 2px;
  color: var(--text-xdim); font-size: 11px; font-weight: 600;
  letter-spacing: 0.035em; text-transform: uppercase;
}
.rota-fonte-itens { display: block; color: var(--text-dim); overflow-wrap: anywhere; line-height: 1.5; }
.rota-fonte-item { display: block; }
.rota-fonte-itens em { color: var(--text-xdim); }

/* etapas: com conteúdo = expandidas; triviais = esmaecidas e colapsadas */
.rota-etapa { border-bottom: 1px solid var(--border-light, #f0f0f3); }
.rota-etapa:last-of-type { border-bottom: none; }
.rota-etapa-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; padding: 11px 2px;
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  cursor: pointer; text-align: left; min-height: 44px;
}
.rota-etapa.nada .rota-etapa-head { color: var(--text-xdim); }
.rota-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rota-etapa.fez .rota-dot { background: var(--accent); }
.rota-etapa.nada .rota-dot { background: var(--border, #d9d9de); }
.rota-etapa.falhou .rota-dot { background: #b3261e; }
.rota-etapa.falhou .rota-etapa-label { color: #b3261e; }
.rota-etapa-label { flex: 1; overflow-wrap: anywhere; }
.rota-etapa-caret { transition: transform 0.2s ease; color: var(--text-xdim); flex-shrink: 0; }
.rota-etapa-caret svg, .rota-etapa-caret { width: 14px; height: 14px; }
.rota-etapa.aberta .rota-etapa-caret { transform: rotate(180deg); }
.rota-etapa-body { display: none; padding: 0 2px 12px 18px; }
.rota-etapa.aberta .rota-etapa-body { display: block; }
.rota-detalhes { margin: 0; padding: 0 0 0 2px; list-style: none; }
.rota-detalhes li {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
  padding: 2px 0; overflow-wrap: anywhere;
}
.rota-narracao { margin: 6px 0 2px; padding-left: 2px; }
.rota-narracao-linha {
  font-size: 12.5px; font-style: italic; color: var(--accent-text);
  line-height: 1.5; padding: 2px 0;
}
.rota-deep-toggle {
  border: none; background: transparent; padding: 6px 2px;
  font-family: var(--font); font-size: 12px; color: var(--text-xdim);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  min-height: 34px;
}
.rota-deep-toggle:hover, .rota-deep-toggle.aberto { color: var(--accent-text); }
.rota-deep { padding: 4px 0 2px; }
.rota-deep-subtit {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-xdim); margin: 10px 0 4px;
}
.rota-deep-nota { font-size: 12px; color: var(--text-xdim); font-style: italic; padding: 4px 0; }
.rota-kv { display: flex; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.rota-kv-k { flex-shrink: 0; min-width: 84px; color: var(--text-xdim); }
.rota-kv-v { color: var(--text-dim); overflow-wrap: anywhere; min-width: 0; }
.rota-ficha-card {
  background: var(--bg-input); border-radius: 10px; padding: 8px 10px; margin: 6px 0;
}
.rota-ficha-meta { font-size: 12px; color: var(--text-dim); }
.rota-ficha-texto {
  margin-top: 6px; font-size: 12px; line-height: 1.55; color: var(--text-dim);
  white-space: pre-wrap; overflow-wrap: anywhere;
  border-left: 2px solid var(--border-light, #ececf0); padding-left: 8px;
}
.rota-ranking { display: flex; flex-direction: column; }
.rota-rank-row {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 3px 0; font-size: 12px; color: var(--text-dim);
  border-bottom: 1px dashed var(--border-light, #f0f0f3);
}
.rota-rank-row.cortada { color: var(--text-xdim); }
.rota-rank-pos { flex-shrink: 0; min-width: 26px; font-variant-numeric: tabular-nums; }
.rota-rank-nome { overflow-wrap: anywhere; min-width: 0; }
.rota-rank-meta { font-size: 11px; color: var(--text-xdim); }
.rota-mais {
  border: 1px solid var(--border-light, #ececf0); background: transparent;
  border-radius: 10px; padding: 8px 14px; margin: 8px 0 2px;
  font-family: var(--font); font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.rota-mais:hover { background: var(--bg-input); }
.rota-bloco { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 12px; }
.rota-bloco-nome { flex-shrink: 0; min-width: 66px; color: var(--text-xdim); }
.rota-bloco-bar {
  flex: 1; height: 6px; border-radius: 3px; background: var(--bg-input);
  overflow: hidden; min-width: 40px;
}
.rota-bloco-bar span { display: block; height: 100%; background: var(--accent); opacity: 0.65; }
.rota-bloco-num { flex-shrink: 0; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.rota-eventos { margin-top: 10px; }
.rota-eventos-lista { padding: 4px 0; }
.rota-evento { display: flex; gap: 8px; padding: 2px 0; font-size: 12px; align-items: baseline; }
.rota-evento-kind {
  flex-shrink: 0; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-xdim);
}
.rota-evento-alvo { color: var(--text-dim); overflow-wrap: anywhere; min-width: 0; }
body.rota-open { overflow: hidden; }

/* desktop: o sheet vira painel central estreito — mesmo componente (D4) */
@media (min-width: 769px) {
  .rota-sheet { left: 50%; right: auto; transform: translate(-50%, 100%); width: 620px; max-width: 92vw; }
  .rota-sheet.show { transform: translate(-50%, 0); }
}

/* ---------- B8: feedback flutuante ---------- */
.fb-fab {
  position: fixed; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 940;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s;
}
.fb-fab:hover { background: var(--accent-hover); }
.fb-fab:active { transform: scale(0.94); }
.fb-fab svg { width: 20px; height: 20px; stroke-width: 2; }
@media (min-width: 769px) {
  .fb-fab { bottom: 24px; right: 24px; }
}
.fb-backdrop {
  position: fixed; inset: 0; z-index: 945;
  background: rgba(15, 15, 20, 0.18);
  opacity: 0; transition: opacity 0.18s ease;
}
.fb-backdrop.show { opacity: 1; }
.fb-panel {
  position: fixed; z-index: 950;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-elev); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.24);
  padding: 14px 14px 12px;
  transform: translateY(12px); opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  overflow-wrap: anywhere;
}
.fb-panel.show { transform: translateY(0); opacity: 1; }
@media (min-width: 769px) {
  .fb-panel { left: auto; right: 24px; bottom: 84px; width: 360px; }
}
.fb-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
  font-size: 14px; color: var(--text);
}
.fb-ctx { flex: 1; font-size: 11.5px; color: var(--text-xdim); overflow-wrap: anywhere; }
.fb-close {
  border: none; background: transparent; color: var(--text-xdim);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.fb-close:hover { background: var(--bg); color: var(--text); }
.fb-close svg { width: 15px; height: 15px; }
.fb-text {
  width: 100%; resize: vertical; min-height: 74px;
  border: 1px solid var(--border-light, #ececf0); border-radius: 10px;
  background: var(--bg-input); color: var(--text);
  font-family: var(--font); font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; outline: none;
}
.fb-text:focus { border-color: var(--accent); }
.fb-status { font-size: 12px; color: var(--text-dim); padding: 6px 2px 0; margin: 0; }
.fb-status.erro { color: #b3261e; }
.fb-status.ok { color: var(--accent-text); }
.fb-actions { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.fb-mic {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-light, #ececf0); background: transparent;
  border-radius: 22px; min-height: 44px; padding: 8px 14px;
  font-family: var(--font); font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.fb-mic:hover { border-color: var(--accent); color: var(--accent-text); }
.fb-mic.recording { background: rgba(255, 59, 48, 0.08); border-color: #ff3b30; color: #b3261e; }
.fb-mic svg { width: 15px; height: 15px; }
.fb-timer { font-variant-numeric: tabular-nums; }
.fb-send {
  margin-left: auto; border: none; background: var(--accent); color: #fff;
  border-radius: 22px; min-height: 44px; padding: 8px 20px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.fb-send:hover { background: var(--accent-hover); }
.fb-send:disabled { opacity: 0.6; cursor: default; }

/* spec áudio do feedback (29/09): estados gravando · transcrevendo · enviado */
.fb-panel { transition: transform 0.18s ease, opacity 0.18s ease, bottom 0.12s ease; }
.fb-panel [hidden] { display: none !important; }
.fb-panel button { -webkit-tap-highlight-color: transparent; }
.fb-text { max-height: 40vh; }
.fb-text[readonly] { opacity: 0.7; }
.fb-mic .fb-ico-stop { display: none; width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.fb-mic.recording {
  margin-left: auto; background: #d93025; border-color: #d93025; color: #fff;
  font-weight: 600; padding: 8px 16px;
}
.fb-mic.recording:hover { color: #fff; border-color: #d93025; }
.fb-mic.recording .fb-ico-mic { display: none; }
.fb-mic.recording .fb-ico-stop { display: inline-block; }
.fb-discard {
  border: 1px solid var(--border-light, #ececf0); background: transparent; color: var(--text-dim);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.fb-discard svg { width: 17px; height: 17px; }
.fb-rec { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #b3261e; font-weight: 600; min-width: 0; }
.fb-rec[hidden] { display: none; }
.fb-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #d93025; animation: pulse-rec 1.1s ease-in-out infinite; flex-shrink: 0; }
.fb-level { display: inline-flex; align-items: center; gap: 2px; height: 18px; }
.fb-level span { width: 3px; height: 4px; border-radius: 2px; background: #d93025; transition: height 0.07s linear; }
.fb-retry, .fb-cancel {
  border: 1px solid var(--accent); background: transparent; color: var(--accent-text);
  border-radius: 22px; min-height: 44px; padding: 8px 14px;
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
}
.fb-cancel { border-color: var(--border-light, #ececf0); color: var(--text-dim); font-weight: 500; }
.fb-send.hot { box-shadow: 0 0 0 3px rgba(201, 160, 64, 0.35); }
.fb-transcrevendo .fb-status::before {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px;
  border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  animation: fb-spin 0.8s linear infinite;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 4px 4px; text-align: center; }
.fb-done[hidden], .fb-body[hidden] { display: none; }
.fb-done-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.fb-done-ico svg { width: 22px; height: 22px; stroke-width: 2.5; }
.fb-done-txt { margin: 0; font-size: 14px; color: var(--text); line-height: 1.45; }
.fb-done-ok {
  border: 1px solid var(--border-light, #ececf0); background: transparent; color: var(--text);
  border-radius: 22px; min-height: 44px; padding: 8px 22px; font-family: var(--font); font-size: 13.5px; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .rota-backdrop, .rota-sheet, .fb-backdrop, .fb-panel, .rota-etapa-caret { transition: none; }
  .fb-rec-dot, .fb-transcrevendo .fb-status::before { animation: none; }
}

/* ═══ Config do chat — aviso persistente + diálogo (spec 25/08) ═══ */

/* Aviso de modo não-Padrão: irmão ACIMA do .chat-log — a rolagem da conversa
   não o move (PC-07); não é toast, não some. */
.chat-mode-banner {
  flex: 0 0 auto;
  margin: 8px 12px 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.chat-mode-banner strong { color: var(--accent-text); }
.chat-mode-banner-modelo { color: var(--text-dim); white-space: nowrap; }

/* chip do modo no cabeçalho do bottom sheet */
.rota-chip-modo {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

/* diálogo de escolha — bottom sheet no celular, centrado no desktop */
.cfg-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10, 22, 40, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.cfg-modal {
  background: var(--bg-elev);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 480px;
  max-height: 86vh; overflow-y: auto;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0));
}
@media (min-width: 640px) {
  .cfg-backdrop { align-items: center; }
  .cfg-modal { border-radius: var(--radius); padding-bottom: 16px; }
}
.cfg-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.cfg-intro { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.cfg-sec {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-dim); margin: 14px 0 6px;
}
.cfg-modo-label { font-size: 14px; font-weight: 600; }
.cfg-modo-desc { grid-column: 2; font-size: 12.5px; color: var(--text-dim); }
.cfg-modelo {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text);
}
.cfg-check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 14px; cursor: pointer;
}
.cfg-check input { accent-color: var(--accent); }
.cfg-nota { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; }
.cfg-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.cfg-btn {
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer;
}
.cfg-btn.cfg-ok { background: var(--navy); border-color: var(--navy); color: #fff; }
.cfg-btn.cfg-ok:hover { filter: brightness(1.15); }

/* ═══ Config v2 — presets + switches (spec 27/08) ═══ */
.cfg-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; position: relative; }
.cfg-preset {
  display: grid; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card);
  font: inherit; color: var(--text);
}
.cfg-preset.sel { border-color: var(--accent); background: var(--accent-soft); }
.cfg-custom-pill {
  position: absolute; top: -30px; right: 0;
  font-size: 12px; font-weight: 600; color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 999px; padding: 2px 10px;
}
.cfg-avancado {
  margin-top: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 2px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.cfg-avancado.aberto .cfg-avancado-caret { display: inline-block; transform: rotate(180deg); }
.cfg-switches { display: grid; gap: 6px; margin-top: 4px; }
.cfg-sw {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); background: var(--bg-card); cursor: pointer;
}
.cfg-sw input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.cfg-sw-txt { display: grid; gap: 1px; }
.cfg-sw-label { font-size: 13.5px; font-weight: 600; }
.cfg-sw-desc { font-size: 12px; color: var(--text-dim); }
.cfg-sw.dep-off { opacity: 0.55; }

/* ============================================================
   Colinha — painel lateral de etapas (split com o chat).
   Abre à direita, o chat encolhe; no mobile vira overlay.
   A etapa "agora" vem do ring.md (web/js/colinha.js).
   ============================================================ */
.colinha-panel { display: none; }
#tab-chat.colinha-open { flex-direction: row; }
/* split 50/50: chat e painel dividem a largura */
#tab-chat.colinha-open .chat { flex: 1 1 0; min-width: 0; }
/* no split a coluna do chat encolhe até a largura do thread — sem um recuo
   próprio o texto encosta na borda; garante um respiro dos dois lados */
#tab-chat.colinha-open .chat-log { padding-left: 30px; padding-right: 30px; }
#tab-chat.colinha-open .chat-composer { padding-left: 30px; padding-right: 30px; }
#tab-chat.colinha-open .colinha-panel {
  display: flex; flex-direction: column;
  flex: 1 1 0; min-width: 0; min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  padding: 14px 22px calc(20px + env(safe-area-inset-bottom));
}
.colinha-spider .ring-canvas-wrap { max-width: 380px; }
/* seções do painel (Check-list / Spider Ring) + o Spider relocado */
.colinha-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 10px; }
.colinha-sep { height: 1px; background: var(--border-light); margin: 12px 0 12px; }
.colinha-spider { display: block; }
/* o bloco .ring vem da aba; no painel ele não precisa do padding da aba */
.colinha-spider .ring { padding: 0; }
.colinha-spider .ring-canvas-wrap { max-width: 340px; margin: 0 auto; }
.colinha-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.colinha-head-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.colinha-title { font-size: 15px; font-weight: 700; color: var(--text); }
.colinha-sub { font-size: 12px; color: var(--text-dim); }
.colinha-refresh, .colinha-close {
  flex: 0 0 auto; width: 28px; height: 28px; border: none; background: transparent;
  color: var(--text-dim); cursor: pointer; border-radius: 6px; display: grid; place-items: center;
}
.colinha-refresh:hover, .colinha-close:hover { background: var(--bg-input); color: var(--text); }
.colinha-refresh i, .colinha-close i { width: 16px; height: 16px; }
.colinha-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.colinha-item { display: flex; gap: 12px; position: relative; }
/* linha vertical do stepper conectando os marcadores */
.colinha-item:not(:last-child) .colinha-mark::after {
  content: ''; position: absolute; left: 50%; top: 20px; bottom: -8px; width: 2px;
  transform: translateX(-50%); background: var(--border-light);
}
.colinha-item.done:not(:last-child) .colinha-mark::after { background: var(--accent); }
.colinha-mark {
  flex: 0 0 auto; position: relative; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); margin-top: 1px; background: var(--bg-card);
}
.colinha-body { flex: 1; min-width: 0; padding-bottom: 12px; }
.colinha-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.colinha-desc { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
/* estados */
.colinha-item.done .colinha-mark { background: var(--accent); border-color: var(--accent); }
.colinha-item.done .colinha-mark::before {
  content: '✓'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.colinha-item.done .colinha-name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--text-xdim); }
.colinha-item.done .colinha-desc { color: var(--text-xdim); }
.colinha-item.current .colinha-mark { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.colinha-item.pending .colinha-name { color: var(--text-dim); }
.colinha-item.pending .colinha-desc { color: var(--text-xdim); }
.colinha-badge {
  display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; vertical-align: middle;
}
.colinha-badge.now { background: var(--accent); color: #fff; }
.colinha-badge.done { background: var(--bg-input); color: var(--text-dim); }
.colinha-hint { font-size: 12px; color: var(--text-dim); margin: 14px 2px 0; line-height: 1.45; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
/* mobile: painel cobre o chat (não cabe split) */
@media (max-width: 768px) {
  #tab-chat.colinha-open .colinha-panel {
    position: absolute; inset: 0; width: auto; flex-basis: auto; z-index: 40; border-left: none;
  }
}

/* ============================================================
   Canvas da negociação — 9 caixas preenchidas ao vivo + a folha
   exportável/imprimível (web/js/canvas.js).
   ============================================================ */
.colinha-canvas { display: block; }
.cv-prog { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.4; }
.cv-prog b { color: var(--text); }
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cv-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card);
  padding: 9px 10px; min-width: 0;
}
.cv-card.full { grid-column: 1 / -1; }
.cv-h {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.cv-n {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-text); font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.cv-f { display: flex; gap: 6px; font-size: 12px; line-height: 1.4; color: var(--text); margin-top: 3px; }
.cv-f .cv-tk { flex: 0 0 auto; color: var(--text-xdim); font-weight: 700; }
.cv-f .cv-tk.on { color: var(--accent); }
.cv-f .cv-k { color: var(--text-dim); font-weight: 600; }
.cv-f.empty .cv-empty { color: var(--text-xdim); font-style: italic; }
.cv-export {
  width: 100%; margin-top: 12px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-card); color: var(--text); font-size: 13px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cv-export:hover { background: var(--bg-input); }
.cv-export .cv-ic { color: var(--accent-text); font-weight: 800; }

/* A folha exportável — overlay com a página única, pronta pra PDF/impressão */
.canvas-sheet-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px;
}
.canvas-sheet-paper { width: 100%; max-width: 860px; }
.cs-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.cs-print, .cs-close {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cs-print { background: var(--accent); color: #fff; border-color: var(--accent); }
.sheet {
  background: #fff; color: #14110c; border-radius: 8px; padding: 28px 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.sheet-head { border-bottom: 2px solid #14110c; padding-bottom: 10px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0 0 4px; font-size: 20px; }
.sheet-head .meta { font-size: 12px; color: #6b6355; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet .sbox { border: 1px solid #ddd6c8; border-radius: 6px; padding: 10px 12px; break-inside: avoid; }
.sheet .sbox h3 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin: 0 0 6px; }
.sheet .sbox h3 .n {
  width: 18px; height: 18px; border-radius: 50%; background: #14110c; color: #fff;
  font-size: 11px; display: grid; place-items: center; flex: 0 0 auto;
}
.sheet .f { display: flex; gap: 6px; font-size: 12px; line-height: 1.45; margin-top: 3px; }
.sheet .f .tk { flex: 0 0 auto; color: #a89f8c; }
.sheet .f .k { color: #6b6355; font-weight: 600; }
.sheet .f.empty { color: #a89f8c; }

/* impressão: só a folha, o resto some (o overlay só existe quando aberto) */
@media print {
  body.canvas-sheet-open > *:not(.canvas-sheet-overlay) { display: none !important; }
  .canvas-sheet-overlay { position: static; background: none; padding: 0; overflow: visible; }
  .cs-bar { display: none !important; }
  .sheet { box-shadow: none; }
}

@media (max-width: 768px) {
  .cv-grid, .sheet-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Escolha — cards dos 3 pacotes de premissas (Estágio 1).
   Renderizados embaixo da resposta; clicar escolhe o pacote.
   ============================================================ */
.escolha-cards {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 720px; margin: 4px auto 8px; padding: 0 2px; width: 100%;
}
.escolha-card {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  width: 100%; padding: 12px 14px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .12s ease, background .12s ease, transform .06s ease;
  font: inherit; color: var(--text);
}
.escolha-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.escolha-card:active { transform: translateY(1px); }
.escolha-card-n {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--accent); color: #fff; margin-top: 1px;
}
.escolha-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.escolha-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.escolha-card-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.escolha-card-own { border-style: dashed; }
.escolha-card-own .escolha-card-n { background: var(--bg-input); }

/* ============================================================
   Painel de "questions" do contexto mínimo (03/09): todas as
   perguntas de uma vez, cada uma com opções (radio). Confirmar
   fecha o contexto de uma vez.
   ============================================================ */
.escolha-panel {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 720px; margin: 4px auto 8px; width: 100%;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
}
.escolha-q { display: flex; flex-direction: column; gap: 8px; }
.escolha-q-label { font-size: 14px; font-weight: 700; color: var(--text); }
.escolha-q-opts { display: flex; flex-direction: column; gap: 6px; }
.escolha-opt {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 12px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .12s ease, background .12s ease;
}
.escolha-opt:hover { border-color: var(--accent); }
.escolha-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.escolha-opt-title { font-size: 13.5px; font-weight: 600; }
.escolha-opt-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.escolha-panel-foot { display: flex; gap: 10px; align-items: center; padding-top: 2px; flex-wrap: wrap; }
.escolha-confirm {
  padding: 9px 20px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px;
}
.escolha-confirm:disabled { background: var(--bg-input); color: var(--text-xdim); cursor: not-allowed; }
.escolha-own {
  padding: 9px 14px; border-radius: 999px; border: 1px dashed var(--border);
  background: transparent; color: var(--text-dim); font-size: 13px; cursor: pointer;
}
.escolha-own:hover { border-color: var(--accent); color: var(--text); }

/* Stepper das "questions" do contexto: uma pergunta por vez + respiro. */
.escolha-step {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 720px; margin: 4px auto 8px; width: 100%;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
}
.escolha-prog { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.escolha-step .escolha-own { align-self: flex-start; margin-top: 2px; }
.escolha-thinking { display: flex; gap: 5px; padding: 16px 2px; }
.escolha-thinking span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  opacity: .4; animation: escpulse 1s infinite ease-in-out;
}
.escolha-thinking span:nth-child(2) { animation-delay: .15s; }
.escolha-thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes escpulse { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- comum.js: aviso de sessão expirada (B1 da nova jornada, 01/10) ----------
   Faixa fixa no topo, só quando o backend recusou o token duas vezes. */
.comum-sessao {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--navy); color: #fff; font-size: 14px; line-height: 1.35;
  box-shadow: var(--shadow-md);
}
.comum-sessao-btn {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--navy); font: inherit; font-weight: 600; cursor: pointer;
}
.comum-sessao-btn:hover { background: var(--accent-hover); }
.comum-sessao-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.comum-sessao-fechar {
  min-width: 44px; min-height: 44px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: #fff; font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.comum-sessao-fechar:hover { background: rgba(255,255,255,0.12); }
.comum-sessao-fechar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Cartão de opções: "Outro", "Ainda não sei", "Pular por agora" (B10 da nova jornada, 02/10) ----------
   O campo "Outro: escreva aqui" fica DENTRO do cartão, no lugar do botão
   "Prefiro escrever". Campo com fonte de 16 px (abaixo disso o iPhone dá zoom
   ao focar) e alvos de toque de 44 px. */
.escolha-outro {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 0 0 12px;
  background: var(--bg-elev); border: 1px dashed var(--border); border-radius: 10px;
}
.escolha-outro:focus-within { border-style: solid; border-color: var(--accent); }
.escolha-outro-label { font-size: 13.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.escolha-outro-input {
  flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; outline: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 16px;
}
.escolha-outro-input::placeholder { color: var(--text-dim); }
.escolha-outro-enviar {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--navy);
}
.escolha-outro-enviar svg { width: 18px; height: 18px; }
.escolha-outro-enviar:disabled { background: transparent; color: var(--text-xdim); cursor: default; }
.escolha-extras { display: flex; flex-wrap: wrap; gap: 8px; }
.escolha-extra {
  min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  font: inherit; font-size: 13.5px;
}
.escolha-extra:hover { border-color: var(--accent); color: var(--text); }
.escolha-extra:focus-visible, .escolha-outro-enviar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================================================================
   B19 — regras medíveis de interface no chat e na tela inicial
   (nova jornada, parte 1; 02/10/2026). Medida e prova:
   scripts/b19/medir-interface.mjs. Vale para toda conversa.
   Cada regra aqui altera uma regra existente só no que a medida pediu,
   com a menor mudança que atende; o desenho fica o mesmo, a não ser
   onde o comentário diz o contrário.
   ================================================================ */

/* ---------- alvo de toque de pelo menos 44 × 44 px ---------- */
/* Área de toque maior que o desenho: um ::after transparente, centrado,
   com 44 px de altura, responde ao toque pelo botão. O que se vê não muda. */
.chip,
.rota-faixa,
.bubble-retry,
.mobile-header-brand { position: relative; }
.chip::after,
.rota-faixa::after,
.bubble-retry::after,
.mobile-header-brand::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%; height: 44px;
  transform: translateY(-50%);
}
/* O "tentar de novo" é o último item da conversa quando um turno falha: sem
   espaço embaixo dele, a borda da área rolável cortava 7 px da área de toque.
   Muda o desenho: 8 px a mais de espaço embaixo do botão. */
.bubble-retry { margin-bottom: 8px; }
/* O "X" de cancelar a edição tem 17 px: área de toque de 44 × 44 em volta
   dele, sem mudar o desenho (achado na medida do estado de edição). */
.edit-cancel { position: relative; }
.edit-cancel::after {
  content: ''; position: absolute;
  left: 50%; top: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
/* A área de 44 px dos atalhos passa 8 px acima do botão (5,5 px no computador):
   sem espaço em cima da fileira, ela cobria a borda de baixo da conversa e
   roubava o toque de um botão que estivesse ali (achado pelo teste de
   clicáveis, B21). Muda o desenho: 4 px a mais acima dos atalhos. */
.chat-composer .chips-row { padding-top: 4px; }
/* Quando a fileira de atalhos quebra em duas linhas também no computador (o
   estado vazio tem seis), 8 px entre as linhas deixavam as áreas de 44 px se
   sobreporem. Muda o desenho: 12 px entre as linhas quebradas. */
.chips-row { row-gap: 12px; }
/* A linha "falta 1 de 3…" tem ~21 px; a área de 44 px precisa de ~12 px livres
   em cima e embaixo, senão cobre o topo do "Copiar" e do "Refazer" logo abaixo
   (revisão independente do PR). Muda o desenho: 7 px a mais acima e 6 px a mais
   abaixo da linha. */
.rota-faixa { margin-top: 7px; margin-bottom: 6px; }
@media (max-width: 768px) {
  /* Os atalhos quebram em duas linhas no celular: com 6 px entre as linhas,
     as duas áreas de 44 px se sobrepunham. O espaço entre as linhas sobe para
     16 px (muda o desenho: as linhas de atalho ficam 10 px mais afastadas). */
  .chips-row { row-gap: 16px; }
  .mobile-hamburger { width: 44px; height: 44px; }
  .msg-action { width: 44px; height: 44px; }
  .scroll-bottom { width: 44px; height: 44px; }
  /* Meu Perfil: no celular o módulo é uma coluna flexível e a barra de abas,
     com rolagem lateral, encolhia até 1 px: as abas Empresas, Stakeholders e
     Questionários não apareciam nem recebiam toque (achado na medida do item 5
     do §16.3). A barra deixa de encolher; o resto do perfil não muda. */
  .profile-tab-bar { flex-shrink: 0; }
  /* Editando uma mensagem, o botão flutuante de feedback ficava por cima do
     "X" de cancelar a edição (achado pelo teste de clicáveis, B21). Ele sai
     enquanto a edição está aberta, como já sai no Relatório e nos questionários. */
  body:has(#edit-banner:not([hidden])) .fb-fab { display: none !important; }
}

/* ---------- campo de texto: fonte de 16 px e 44 px de altura no celular ----------
   Abaixo de 16 px o iPhone dá zoom ao focar o campo. A altura vem do espaço
   interno: a caixa do campo continua do mesmo tamanho (os botões dela já têm
   44 px). Muda o desenho: o texto do campo fica maior no celular. */
@media (max-width: 768px), (pointer: coarse) {
  .chat-input textarea {
    font-size: 16px;
    line-height: 1.5;
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* ---------- contraste de texto no nível AA ----------
   O dourado de destaque (#c9a040) sobre o fundo dourado-claro dá 2:1; o
   dourado escuro de texto do próprio tema (--accent-text) passa. */
.chip-accent,
.chip:hover,
.hnc-msgs { color: var(--accent-text); }
/* A linha "falta 1 de 3…" embaixo da resposta: o cinza mais claro não passa
   sobre o fundo do chat; o cinza secundário do tema, sim. */
.rota-faixa { color: var(--text-dim); }
.rota-faixa:hover { color: var(--text); }
/* Barra lateral (tela inicial no computador): os rótulos apagados passam a
   ter a mesma força dos itens do menu. */
.nav-section-label,
.version-label,
.neg-new { color: rgba(255,255,255,0.55); }
.sidebar .nav-sub { color: inherit; }

/* ---------- composer: anexo no campo e listas ao digitar (07/10, js/composer.js) ---------- */
.chat-input .chat-attach { margin-left: -6px; }
.chat-input .chat-attach svg { width: 20px; height: 20px; }
/* com o "+" o campo fica mais estreito no celular: o texto de exemplo não quebra em meia linha cortada */
.chat-input textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* com anexo, os cartões ocupam a primeira linha do campo; o resto segue embaixo */
.chat-input.tem-anexos { flex-wrap: wrap; }
.chat-input.tem-anexos textarea { min-width: 0; flex-basis: 0; }
.anexo-bandeja {
  flex: 0 0 100%; order: -1;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 2px 0 6px;
}
.anexo-bandeja[hidden] { display: none; }
.anexo-card {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; max-width: 280px;
  padding: 7px 4px 7px 7px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.anexo-card.erro { max-width: 100%; border-color: rgba(255,59,48,0.45); background: rgba(255,59,48,0.05); }
.anexo-card.enviando { opacity: 0.7; }
.anexo-ico {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center;
  background: rgba(11,79,156,0.08); color: #0b4f9c;
}
.anexo-ico svg { width: 18px; height: 18px; }
.anexo-ico.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anexo-card.erro .anexo-ico { background: rgba(255,59,48,0.1); color: #b3261e; }
.anexo-info { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.anexo-nome { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anexo-meta { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.anexo-erro { font-size: 12px; color: #b3261e; white-space: normal; }
.anexo-remover {
  flex: 0 0 28px; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: 50%;
  color: var(--text-dim); cursor: pointer;
}
.anexo-remover:hover { background: var(--bg); color: var(--text); }
.anexo-remover:disabled { opacity: 0.4; cursor: default; }
.anexo-remover svg { width: 14px; height: 14px; }
@media (pointer: coarse) { .anexo-remover { flex-basis: 36px; width: 36px; height: 36px; } }
/* arrastar um arquivo sobre a conversa */
.anexo-veu {
  position: absolute; inset: 8px; z-index: 30;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.95); /* (07/10) a conversa por trás não "vaza" pelo rótulo */
  border: 2px dashed #0b4f9c; border-radius: 16px;
  pointer-events: none;
}
.anexo-veu[hidden] { display: none; }
.anexo-veu-caixa { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #0b4f9c; font-size: 15px; font-weight: 600; }
.anexo-veu-caixa svg { width: 32px; height: 32px; }
/* a bolha do usuário formatada (markdown com escape) e os anexos dela */
.bubble.user.user-formatada { white-space: normal; }
.bubble.user .user-md p { margin: 0; }
.bubble.user .user-md p + p,
.bubble.user .user-md p + ul, .bubble.user .user-md p + ol,
.bubble.user .user-md ul + p, .bubble.user .user-md ol + p { margin-top: 8px; }
.bubble.user .user-md ul, .bubble.user .user-md ol { margin: 4px 0; padding-left: 22px; }
.bubble.user .user-md li { margin: 2px 0; }
.bubble.user .user-md li > p { margin: 0; }
.bubble.user .user-md code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.bubble.user .user-md pre { white-space: pre-wrap; margin: 6px 0; }
.bubble.user .user-md h1, .bubble.user .user-md h2, .bubble.user .user-md h3 { font-size: 1em; margin: 0 0 4px; }
.msg-anexos { display: flex; flex-wrap: wrap; gap: 6px; }
.user-md + .msg-anexos { margin-top: 8px; }
.msg-anexo {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.75); border: 1px solid rgba(0,0,0,0.08);
  font-size: 13px; line-height: 1.4;
}
.msg-anexo svg { flex: 0 0 14px; width: 14px; height: 14px; color: #0b4f9c; }
.msg-anexo-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* (19/10, demo) a fase de cada arquivo no chip da bolha: enviando → lendo → pronto | falhou */
.msg-anexo-st { flex: 0 0 auto; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.msg-anexo-st:empty { display: none; }
.msg-anexo[data-fase="enviando"] .msg-anexo-st::before,
.msg-anexo[data-fase="lendo"] .msg-anexo-st::before {
  content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 4px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: msgAnexoGira 0.8s linear infinite;
}
.msg-anexo[data-fase="pronto"] .msg-anexo-st { color: #1f7a4d; }
.msg-anexo[data-fase="falhou"] { border-color: #e5a3a3; background: #fdf0f0; }
.msg-anexo[data-fase="falhou"] .msg-anexo-st { color: #b42318; font-weight: 600; }
@keyframes msgAnexoGira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .msg-anexo-st::before { animation: none !important; } }
/* (G2, 26/10) a etapa de cada arquivo no chip ("página 120 de 533", "na fila (3º)", "resumindo"): js/documents.js escreve
   `.msg-anexo-prog`; enquanto ela tem texto, toma o lugar do "Lendo…" genérico que chat.js mantém em `.msg-anexo-st` */
.msg-anexo-prog { flex: 0 0 auto; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-anexo-prog:empty { display: none; }
.msg-anexo[data-fase="lendo"] .msg-anexo-prog:not(:empty)::before {
  content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 4px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: msgAnexoGira 0.8s linear infinite;
}
.msg-anexo[data-fase="lendo"]:has(.msg-anexo-prog:not(:empty)) .msg-anexo-st { display: none; }
.msg-anexo:not([data-fase="lendo"]) .msg-anexo-prog { display: none; }
@media (prefers-reduced-motion: reduce) { .msg-anexo-prog::before { animation: none !important; } }
/* o total da bolha: barra fina, "2 de 6 prontos · faltam ~4 min" e a dica do que acontece se mandar antes */
.espera-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; width: min(100%, 420px); font-size: 12.5px; color: var(--text-dim); }
.espera-total .espera-total-tx { font-variant-numeric: tabular-nums; }
.espera-total .espera-dica { font-size: 11.5px; line-height: 1.4; text-align: right; color: var(--text-dim); opacity: 0.85; }
.espera-barra { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--border-light, rgba(0,0,0,0.08)); overflow: hidden; }
.espera-barra > span { display: block; height: 100%; width: 2%; border-radius: 2px; background: var(--accent); transition: width 0.6s ease; }
@media (prefers-reduced-motion: reduce) { .espera-barra > span { transition: none; } }
/* a lista antiga de documentos (#docs-list): a etapa no lugar de "processando…", o motivo do erro e o que fazer */
.doc-espera-rot { font-variant-numeric: tabular-nums; }
.doc-espera-barra span { transition: width 0.6s ease; }
.doc-espera-erro { margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--text); }
.doc-espera-motivo { color: var(--red); }
.doc-espera-ajuda { color: var(--text-dim); }
.doc-wait-status { flex-wrap: wrap; justify-content: flex-end; }
/* (19/10, demo) a espera longa da primeira mensagem quebra em 2 linhas no celular: alinhada à direita, junto da bolha */
.doc-wait-status .doc-wait-txt, .doc-wait-status #doc-wait-status-txt { text-align: right; }
.doc-wait-status .doc-wait-cancel.pri { background: var(--accent); color: #fff; border-color: transparent; }
.doc-wait-status .doc-wait-cancel.pri:hover { opacity: 0.88; background: var(--accent); }

/* ---------- (F2, 28/10) limites de uso por conta: faixa de aviso, recusa e campo travado (js/chat.js, UsoConta) ----------
   Cores da maquete aprovada (minha-conta-maquetes-2026-10-28, "No chat"): âmbar suave para o aviso, borda fina na
   recusa, campo cinza quando travado. */
.uso-faixa { display: flex; align-items: flex-start; gap: 10px; margin: 0 auto 8px; padding: 10px 8px 10px 12px; border-radius: 12px;
  background: #fbf4e3; color: #5c4304; border: 1px solid #e3c77a; font-size: 13.5px; line-height: 1.45; animation: uso-entra .2s ease-out; }
.uso-faixa > i, .uso-faixa > svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.uso-faixa-txt { flex: 1; min-width: 0; }
.uso-faixa-ver { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; padding: 0 2px; white-space: nowrap; align-self: center; }
.uso-faixa-x { border: 0; background: transparent; color: inherit; cursor: pointer; width: 28px; height: 28px; margin: -4px 0 -4px 2px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0; }
.uso-faixa-x:hover { background: rgba(92, 67, 4, .08); }
.uso-faixa-x svg, .uso-faixa-x i { width: 16px; height: 16px; }
.uso-faixa-ver:focus-visible, .uso-faixa-x:focus-visible, .uso-recusa-ver:focus-visible { outline: 2px solid #152848; outline-offset: 2px; }
.bubble.bot.uso-recusa, html[data-visual-a~="chat"] .bubble.bot.uso-recusa { background: #fff; border: 1px solid var(--border-light); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.5; color: var(--text); }
.bubble.bot.uso-recusa b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.uso-recusa-ver { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 600; color: #152848; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chat-input-wrap.uso-travado .chat-input { background: #f3f4f6; }
.chat-input-wrap.uso-travado textarea:disabled { cursor: not-allowed; color: #9aa1ab; -webkit-text-fill-color: #9aa1ab; }
.chat-input-wrap.uso-travado textarea::placeholder { color: #5b6472; opacity: 1; }
.chat-input-wrap.uso-travado .btn-send:disabled { background: #c9ced6; border-color: #c9ced6; cursor: not-allowed; opacity: 1; }
html[data-visual-a~="chat"] .chat-input-wrap.uso-travado .btn-send:disabled { background: transparent; opacity: 1; }
html[data-visual-a~="chat"] .chat-input-wrap.uso-travado .btn-send:disabled::before { background: #c9ced6; }
html[data-visual-a~="chat"] .chat-input-wrap.uso-travado .btn-send:disabled::after { color: #fff; }
.chat-input-wrap.uso-travado .chat-attach, .chat-input-wrap.uso-travado #chat-mic { pointer-events: none; opacity: .45; }
@keyframes uso-entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .uso-faixa { animation: none; } }
@media (max-width: 480px) { .uso-faixa { font-size: 13px; padding: 9px 6px 9px 10px; } }

/* ---------- (P7, 28/10) limite de uso nas ferramentas: botão que gera travado + a frase logo abaixo (js/comum.js) ---------- */
.uso-nota { display: block; flex-basis: 100%; width: 100%; margin: 8px 0 0; padding: 9px 12px; border-radius: 12px; background: #fbf4e3; color: #5c4304;
  border: 1px solid #e3c77a; font-size: 13.5px; line-height: 1.45; text-align: left; font-weight: 400; white-space: normal; }
.uso-nota.uso-nota-so-link { background: transparent; border: 0; padding: 4px 0 0; }
.uso-nota-ver { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.uso-nota-ver:focus-visible { outline: 2px solid #152848; outline-offset: 2px; }
.uso-bloqueado, .uso-bloqueado:hover { cursor: not-allowed !important; opacity: .5; }
