/* chat.css — AURA AI (página /ia e widget) */
.ac { display: flex; flex-direction: column; min-height: 0; height: 100%; position: relative; }
.ac-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 4px 12px; display: flex; flex-direction: column; gap: 22px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.ac-log:focus { outline: none; }

.ac-welcome { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 20px 8px; }
.ac-welcome-mark { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: var(--cyan); border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 6px; animation: markIn 0.8s var(--ease) both; }
.ac-welcome-mark img { width: 30px; height: 33px; object-fit: contain; }
@keyframes markIn { from { opacity: 0; transform: scale(0.8) rotate(-10deg); } }
.ac-welcome-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.025em; }
.ac-welcome-text { color: var(--ink-2); font-size: 15px; max-width: 46ch; }
.ac-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 640px; margin-top: 14px; }
.ac-sugg { text-align: left; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 44px; transition: all 0.2s var(--ease); animation: fadeUp2 0.5s var(--ease) both; }
.ac-sugg:nth-child(2) { animation-delay: 0.05s; } .ac-sugg:nth-child(3) { animation-delay: 0.1s; } .ac-sugg:nth-child(4) { animation-delay: 0.15s; } .ac-sugg:nth-child(5) { animation-delay: 0.2s; } .ac-sugg:nth-child(6) { animation-delay: 0.25s; }
@keyframes fadeUp2 { from { opacity: 0; transform: translateY(8px); } }
.ac-sugg:hover { border-color: var(--line-3); background: var(--surface-2); }
.ac-sugg .k { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 3px; }

.ac-msg { display: flex; gap: 12px; animation: fadeUp2 0.35s var(--ease) both; }
.ac-msg.user { justify-content: flex-end; }
.ac-bubble { max-width: min(82%, 560px); padding: 11px 16px; border-radius: 18px 18px 6px 18px; background: var(--ink); color: #041015; font-size: 15px; font-weight: 500; line-height: 1.55; overflow-wrap: anywhere; }
.ac-avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; color: var(--cyan); border: 1px solid var(--line-2); background: var(--surface); margin-top: 2px; }
.ac-avatar img { width: 17px; height: 19px; object-fit: contain; }
.ac-body { flex: 1; min-width: 0; }
.ac-md { font-size: 15.5px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.ac-md > *:first-child { margin-top: 0; }
.ac-md p { margin: 0 0 0.8em; color: #d5e6ea; }
.ac-md h3, .ac-md h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 1.2em 0 0.5em; }
.ac-md h3 { font-size: 17.5px; } .ac-md h4 { font-size: 15.5px; color: var(--ink); }
.ac-md strong { color: #fff; font-weight: 700; }
.ac-md em { color: var(--ink-2); }
.ac-md ul, .ac-md ol { margin: 0 0 0.9em 1.25em; color: #d5e6ea; }
.ac-md li { margin: 0.25em 0; padding-left: 2px; }
.ac-md li.sub { margin-left: 1.1em; list-style: circle; }
.ac-md li::marker { color: var(--cyan); }
.ac-md a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(34, 230, 255, 0.35); text-underline-offset: 3px; }
.ac-md a:hover { text-decoration-color: var(--cyan); }
.ac-md code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.ac-md hr { border: 0; height: 1px; background: var(--line-2); margin: 1.2em 0; }
.ac-md blockquote { border-left: 2px solid var(--cyan); padding-left: 12px; color: var(--ink-2); margin: 0 0 0.9em; }
.ac-md .md-table { overflow-x: auto; margin: 0.4em 0 1em; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.ac-md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ac-md th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ac-md td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ac-md tr:last-child td { border-bottom: 0; }
.ac-md .pmid-link { font-family: var(--font-mono); font-size: 0.86em; text-decoration: none; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.ac-caret { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; background: var(--cyan); animation: blink2 0.9s steps(2) infinite; }
@keyframes blink2 { 50% { opacity: 0; } }
.ac-typing { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 13.5px; }
.ac-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: dot 1.2s ease-in-out infinite; }
.ac-typing span:nth-child(2) { animation-delay: 0.15s; } .ac-typing span:nth-child(3) { animation-delay: 0.3s; }
.ac-typing em { font-style: normal; margin-left: 6px; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ac-msg.err .ac-md p { color: #ffb3bf; }
.ac-notice { margin-top: 6px; font-size: 13px; color: var(--amber); }
.ac-actions { display: flex; gap: 4px; margin-top: 6px; opacity: 0.6; transition: opacity 0.2s; }
.ac-msg:hover .ac-actions, .ac-msg:focus-within .ac-actions { opacity: 1; }
.ac-actions button { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.ac-actions button:hover { color: var(--ink); background: var(--surface-2); }

.ac-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 20px; border: 1px solid var(--line-2); background: #070e14; transition: border-color 0.2s, box-shadow 0.2s; }
.ac-composer:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 230, 255, 0.1); }
.ac-input { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.5; padding: 10px 10px; max-height: 180px; min-height: 44px; }
.ac-input::placeholder { color: var(--ink-3); }
.ac-send { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: var(--cyan); color: #021116; transition: transform 0.2s var(--ease), background 0.2s; }
.ac-send svg { width: 20px; height: 20px; }
.ac-send:hover { background: var(--cyan-2); }
.ac-send:active { transform: scale(0.94); }
.ac-send.stop { background: var(--ink); }
.ac-foot { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* ─── Widget flutuante ─── */
.aura-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 150;
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 18px;
  background: var(--ink); color: #041015; font-weight: 800; font-size: 14.5px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s var(--ease), opacity 0.3s; animation: fabIn 0.6s 1.2s var(--ease) both;
}
@keyframes fabIn { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
.aura-fab:hover { transform: translateY(-2px); }
.aura-fab svg { width: 22px; height: 22px; color: #041015; }
.aura-fab.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.aura-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 160; width: min(440px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 32px));
  display: flex; flex-direction: column; border-radius: 24px; border: 1px solid var(--line-2); background: rgba(5, 10, 15, 0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 40px 100px -30px #000;
  opacity: 0; transform: translateY(16px) scale(0.98); transform-origin: bottom right; pointer-events: none; visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s;
}
.aura-panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0s; }
.aura-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.aura-panel-head .t { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.aura-panel-head .s { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.aura-panel-head .s i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.aura-panel-head .sp { flex: 1; }
.aura-icon-btn { min-width: 44px; min-height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); font-size: 13px; font-weight: 700; padding: 0 10px; }
.aura-icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.aura-icon-btn svg { width: 20px; height: 20px; }
.aura-panel .ac { padding: 0 12px 12px; }
.aura-panel .ac-suggestions { grid-template-columns: 1fr; }
.aura-panel .ac-welcome-title { font-size: 21px; }

@media (max-width: 600px) {
  .aura-fab { height: 50px; padding: 0 14px; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .aura-fab .lbl { display: none; }
  .aura-panel { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .aura-panel .ac { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .ac-suggestions { grid-template-columns: 1fr; }
  .ac-bubble { max-width: 88%; }
  .ac-md { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .aura-panel { transform: none; }
  .ac-msg, .ac-sugg { animation-name: fadeOnly; }
}
@keyframes fadeOnly { from { opacity: 0; } }
.ac-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
