/* Analista de IA (#/analista): lista de conversas à esquerda e a conversa com a IA à direita. Cores só pelos tokens do tema. */
.an { display: grid; grid-template-columns: 280px 1fr; height: 100%; min-height: 0; }
.an-side { border-right: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; min-height: 0; }
.an-side-h { padding: 12px; border-bottom: 1px solid var(--line); display: flex; }
.an-list { flex: 1; overflow-y: auto; padding: 6px; }
.an-ci { display: flex; align-items: center; gap: 6px; padding: 9px 8px 9px 11px; border-radius: 9px; cursor: pointer; }
.an-ci:hover { background: var(--hover); }
.an-ci.on { background: var(--brand-bg); }
.an-ci.on .an-ct { color: var(--brand2); }
.an-ct { display: block; font-weight: 600; font-size: 13px; color: var(--text); }
.an-ci .an-cm { width: 28px; height: 28px; opacity: 0; color: var(--muted); }
.an-ci:hover .an-cm, .an-ci.on .an-cm, .an-ci:focus-within .an-cm { opacity: 1; }
.an-none { padding: 14px 10px; }
.an-side-f { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 7px; align-items: flex-start; line-height: 1.45; }
.an-side-f svg.i { flex: none; margin-top: 1px; }

.an-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.an-top { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--bg2); min-height: 56px; }
.an-tav { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.an-tt { font-weight: 700; font-size: 14px; }
.an-listbtn { display: none; }

.an-msgs { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 22px 0 14px; display: flex; flex-direction: column; gap: 16px; }
.an-m { display: flex; gap: 10px; width: 100%; max-width: 880px; margin: 0 auto; padding: 0 22px; }
.an-m.user { justify-content: flex-end; }
.an-m.user .an-b { background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; padding: 10px 14px; max-width: 78%; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.an-m.ai .an-b { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.an-av { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-bg); color: var(--brand2); display: grid; place-items: center; flex: none; margin-top: 2px; }

.an-md { line-height: 1.62; color: var(--text); overflow-wrap: anywhere; }
.an-md p { margin: 0 0 10px; }
.an-md p:last-child, .an-md ul:last-child, .an-md ol:last-child { margin-bottom: 0; }
.an-md ul, .an-md ol { margin: 0 0 10px; padding-left: 22px; }
.an-md li { margin: 3px 0; }
.an-md li::marker { color: var(--faint); }
.an-md b { font-weight: 700; }
.an-md .an-h { font-weight: 700; margin-top: 4px; }
.an-tw { overflow-x: auto; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 10px; }
.an-tbl th, .an-tbl td { padding: 7px 10px; font-size: 13px; }
.an-tbl th { position: static; background: var(--panel2); }
.an-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-ref { display: inline-flex; align-items: center; gap: 3px; color: var(--brand2); font-weight: 600; border-bottom: 1px dashed var(--brand-line); line-height: 1.3; }
.an-ref:hover { border-bottom-style: solid; }
.an-ref svg.i { width: 13px; height: 13px; }
.an-ref.off { color: inherit; border-bottom: 0; }

.an-srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.an-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; color: var(--text2); max-width: 260px; }
.an-chip svg.i { width: 13px; height: 13px; color: var(--muted); }
.an-chip:hover { border-color: var(--brand-line); color: var(--brand2); }
.an-chip:hover svg.i { color: var(--brand2); }
.an-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.an-steps-t { border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; font-size: 11.5px; font-weight: 600; }
.an-steps-t:hover { color: var(--text); }
.an-steps-t svg.i { transition: transform .15s; }
.an-steps-t.on svg.i { transform: rotate(180deg); }
.an-steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.an-work { display: flex; align-items: center; gap: 10px; }
.an-done { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text2); }
.an-done li { display: flex; gap: 6px; align-items: flex-start; }
.an-done svg.i { color: var(--green); margin-top: 2px; width: 14px; height: 14px; }
.an-err { color: var(--red2); display: flex; gap: 7px; align-items: flex-start; }
.an-err svg.i { margin-top: 2px; }

.an-input { display: flex; gap: 8px; align-items: flex-end; width: 100%; max-width: 880px; margin: 0 auto; padding: 10px 22px 6px; }
.an-input textarea { flex: 1; min-height: 46px; max-height: 180px; resize: none; padding: 12px 14px; border-radius: 12px; line-height: 1.45; background: var(--panel); }
.an-input .btn { height: 46px; border-radius: 12px; padding: 0 16px; }
.an-hint { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 22px 12px; }

.an-hello { width: 100%; max-width: 780px; margin: auto; padding: 18px 22px; text-align: center; }
.an-logo { width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent); }
.an-hello h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; font-size: 24px; }
.an-hello > p { margin: 0 auto 20px; max-width: 580px; line-height: 1.55; }
.an-sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.an-sug { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; font-size: 13px; line-height: 1.45; color: var(--text2); box-shadow: var(--shadow-sm); transition: border-color .12s, background .12s; }
.an-sug:hover { border-color: var(--brand-line); background: var(--brand-bg); color: var(--text); }
.an-sug svg.i { color: var(--brand2); margin-top: 1px; }

@media (max-width: 820px) {
  .an { grid-template-columns: 1fr; }
  .an-side { display: none; }
  .an.show-list .an-side { display: flex; }
  .an.show-list .an-main { display: none; }
  .an-listbtn { display: inline-flex; padding: 0 8px; }
  .an-top { padding: 8px 10px; gap: 8px; }
  .an-top .an-tav { display: none; }
  .an-sugs { grid-template-columns: 1fr; }
  .an-m, .an-input, .an-hint { padding-left: 12px; padding-right: 12px; }
  .an-m.user .an-b { max-width: 88%; }
  .an-m.ai .an-av { display: none; }
  .an-input .btn span { display: none; }
  .an-input .btn { padding: 0 14px; }
  .an-hello h2 { font-size: 21px; }
}
