/* Orca Chat — tema baseado nas capturas de ecrã (teal + serif) */

:root {
  --paper: #ffffff;
  --wash: #f5f7f8;
  --line: #e7ecef;
  --ink: #16181d;
  --muted: #6b7480;
  --faint: #98a1ab;
  --teal: #0f766e;
  --teal-strong: #0d5f59;
  --teal-soft: #eaf5f3;
  --teal-border: #bfe0da;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --radius: 14px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* EffortSlider (lumesec) */
  --lumesec: #6219f3;
  --lumesec-glint: #c9bdff;
  --ef-muted: #71717b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--teal); }
::selection { background: #cfe9e4; }
svg { display: block; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 30;
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 10px;
  color: var(--ink);
}
.icon-btn:hover { background: var(--wash); }
.icon-btn svg { width: 20px; height: 20px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 25%, #14b8a6 0%, var(--teal) 55%, #0a4540 100%);
  display: grid; place-items: center; flex: none;
}
.brand-logo svg { width: 18px; height: 18px; color: #fff; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
}

/* ── Sidebar ────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .38);
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(320px, 86vw);
  background: var(--paper);
  border-right: 1px solid var(--line);
  z-index: 41;
  display: flex; flex-direction: column;
  transform: translateX(-102%);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sidebar.open { transform: none; }
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.new-chat-btn {
  margin: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--teal-border);
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-weight: 600; font-size: 14px;
  border-radius: 12px;
}
.new-chat-btn:hover { background: #dcefeb; }
.new-chat-btn svg { width: 16px; height: 16px; }
.chat-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.chat-list-label { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 4px; }
.chat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 14px; color: var(--ink);
  cursor: pointer; border: 0; background: transparent;
  width: 100%; text-align: left;
}
.chat-item:hover { background: var(--wash); }
.chat-item.active { background: var(--teal-soft); color: var(--teal-strong); font-weight: 600; }
.chat-item .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .del { opacity: 0; border: 0; background: transparent; color: var(--faint); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.chat-item:hover .del { opacity: 1; }
.chat-item .del:hover { color: var(--danger); background: var(--danger-soft); }
.chat-item .del svg { width: 15px; height: 15px; }
.chat-item svg.lead { width: 15px; height: 15px; color: var(--faint); flex: none; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px; }
.side-user .email { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px; border: 0; background: transparent;
  font-size: 14px; color: var(--ink); width: 100%; text-align: left;
}
.mini-btn:hover { background: var(--wash); }
.mini-btn svg { width: 17px; height: 17px; color: var(--muted); }

/* ── Vista principal ────────────────────────────────────── */
.view { height: calc(100dvh - 56px); display: flex; flex-direction: column; overflow: hidden; }
.scroll-area { flex: 1; overflow-y: auto; }

/* Home */
.home { max-width: 900px; margin: 0 auto; padding: clamp(24px, 6vh, 64px) 20px 20px; display: flex; flex-direction: column; align-items: center; }
.hero {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -.01em;
  text-align: center;
  margin: 0;
}
.hero-sub {
  margin: 14px 0 0;
  max-width: 620px;
  text-align: center;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17.5px);
}
.presets {
  margin-top: clamp(24px, 5vh, 44px);
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.preset {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-align: left;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.preset:hover { box-shadow: 0 10px 28px -14px rgba(16, 24, 40, .22); transform: translateY(-1px); border-color: #d8e2e6; }
.preset-icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid; place-items: center;
}
.preset-icon svg { width: 20px; height: 20px; }
.preset h3 { margin: 2px 0 4px; font-size: 15px; font-weight: 600; }
.preset p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ── Composer ───────────────────────────────────────────── */
.composer-zone { padding: 10px 16px 14px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mode-pills { display: flex; gap: 8px; align-items: center; width: min(760px, 100%); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  transition: all .15s ease;
}
.pill svg { width: 15px; height: 15px; }
.pill:hover { border-color: var(--teal-border); color: var(--teal-strong); }
.pill.active { background: var(--teal-soft); border-color: var(--teal-border); color: var(--teal-strong); font-weight: 600; }

.composer {
  width: min(760px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 14px 34px -18px rgba(16, 24, 40, .25), 0 2px 6px -2px rgba(16, 24, 40, .06);
  padding: 12px 14px 10px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.composer:focus-within { border-color: var(--teal-border); }
.composer textarea {
  border: 0; outline: none; resize: none;
  width: 100%;
  font-size: 15.5px;
  line-height: 1.5;
  max-height: 200px;
  background: transparent;
  padding: 4px 6px 2px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-bar { display: flex; align-items: center; gap: 4px; }
.comp-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 11px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.comp-btn:hover { background: var(--wash); color: var(--ink); }
.comp-btn svg { width: 17px; height: 17px; }
.comp-btn.active { background: var(--teal-soft); color: var(--teal-strong); }
.send-btn {
  margin-left: auto;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  transition: background .15s ease, transform .1s ease, opacity .15s ease;
}
.send-btn:hover { background: var(--teal-strong); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { background: #c9d4d2; cursor: default; }
.send-btn svg { width: 19px; height: 19px; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 240px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--wash); font-size: 12.5px; color: var(--ink);
}
.chip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .sz { color: var(--faint); flex: none; }
.chip button { border: 0; background: transparent; color: var(--faint); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; padding: 0; }
.chip button:hover { color: var(--danger); }
.chip button svg { width: 12px; height: 12px; }
.chip svg.doc { width: 14px; height: 14px; color: var(--teal); flex: none; }
.hints {
  width: min(760px, 100%);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--faint);
  padding: 0 6px;
}

/* ── Chat ───────────────────────────────────────────────── */
.chat-wrap { max-width: 820px; margin: 0 auto; padding: 24px 18px 8px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  margin-top: 2px;
}
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 18px 18px 6px 18px;
  padding: 10px 16px;
  max-width: 78%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.ai .bubble { max-width: 100%; min-width: 0; }
.msg-avatar.ai { background: radial-gradient(120% 120% at 30% 25%, #14b8a6 0%, var(--teal) 55%, #0a4540 100%); color: #fff; }
.msg-avatar.ai svg { width: 17px; height: 17px; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.msg-files.ai { justify-content: flex-start; }
.error-box {
  background: var(--danger-soft);
  border: 1px solid #f2c1bd;
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.error-box button { margin-left: auto; border: 1px solid #ecc8c4; background: #fff; color: var(--danger); border-radius: 8px; padding: 5px 12px; font-size: 13px; flex: none; }

/* Markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 16px 0 8px; line-height: 1.3; }
.md h1 { font-size: 21px; } .md h2 { font-size: 18.5px; } .md h3 { font-size: 16.5px; } .md h4 { font-size: 15px; }
.md blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid var(--teal-border); color: var(--muted); }
.md code.inline { background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md a { word-break: break-all; }
.md .cb { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbfcfd; }
.md .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: var(--wash); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.md .cb-head button { border: 0; background: transparent; color: var(--muted); font-size: 12px; display: inline-flex; gap: 5px; align-items: center; padding: 3px 8px; border-radius: 6px; }
.md .cb-head button:hover { background: #fff; color: var(--ink); }
.md .cb-head svg { width: 13px; height: 13px; }
.md .cb pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.caret::after { content: "▍"; color: var(--teal); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Artefactos (modo Site / ficheiros da IA) ───────────── */
.artifact {
  width: min(760px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 14px 34px -20px rgba(16, 24, 40, .3);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: rise .25s ease;
}
.artifact-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--wash); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); font-weight: 600; }
.artifact-head .grow { flex: 1; }
.file-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 12px 0; }
.file-tab {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.file-tab.active { border-color: var(--teal-border); background: var(--teal-soft); color: var(--teal-strong); font-weight: 600; }
.file-tab svg { width: 13px; height: 13px; }
.artifact-body { min-height: 260px; height: min(46vh, 480px); background: #fff; }
.artifact-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.artifact-body pre.code {
  margin: 0; height: 100%; overflow: auto;
  padding: 14px 16px;
  font-size: 12.5px; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: #fbfcfd;
  white-space: pre;
}
.artifact-body .file-empty { padding: 30px; color: var(--faint); text-align: center; }

/* ── Botões genéricos ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.btn:hover { background: var(--wash); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-strong); }
.btn.primary:disabled { background: #9ec4bf; border-color: #9ec4bf; cursor: default; }
.btn.danger { color: var(--danger); border-color: #eec9c5; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }

/* ── Popover do esforço ─────────────────────────────────── */
.ef-pop {
  position: fixed;
  z-index: 60;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
}
.ef-pop.open { opacity: 1; pointer-events: auto; transform: none; }

/* ── EffortSlider (port do componente) ──────────────────── */
.ef-root { display: inline-block; width: 248px; max-width: calc(100vw - 32px); -webkit-tap-highlight-color: transparent; }
.ef-root[data-disabled] { pointer-events: none; opacity: .5; }
.ef-panel {
  display: grid; gap: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px 12px 10px;
  font-size: 13px; line-height: 1.3; color: var(--ink);
  box-shadow: 0 10px 30px -10px rgba(20, 18, 30, .25), 0 2px 6px -2px rgba(20, 18, 30, .12);
}
.ef-row { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.ef-muted { color: var(--ef-muted); }
.ef-level {
  position: relative;
  display: inline-grid; justify-items: start;
  margin: -6px 0; padding: 6px 0;
  font-weight: 600; letter-spacing: .005em;
  perspective: 180px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}
.ef-word {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transform-origin: 50% 50% -11px;
}
.ef-word.ultra {
  background: linear-gradient(100deg, var(--lumesec) 0%, var(--lumesec) 38%, var(--lumesec-glint) 50%, var(--lumesec) 62%, var(--lumesec) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  background-position: 100% 0;
  color: transparent;
}
.ef-help {
  margin-left: auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--ef-muted); padding: 0;
}
.ef-help:hover, .ef-help[aria-expanded="true"] { background: rgba(24, 22, 33, .08); color: var(--ink); }
.ef-help svg { width: 14px; height: 14px; }
.ef-note { margin: -4px 0 0; font-size: 12px; line-height: 1.45; color: var(--ef-muted); }
.ef-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ef-muted); }
.ef-track {
  position: relative;
  height: 22px;
  border-radius: 8px;
  background: #f1f0f4;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.ef-track:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lumesec); }
.ef-track[data-dragging] { cursor: grabbing; }
.ef-track canvas.dots { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; display: block; }
.ef-ticks { position: absolute; inset: 0; pointer-events: none; }
.ef-tick {
  position: absolute; top: 8px;
  width: 2px; height: 6px; margin-left: -1px;
  border-radius: 1px;
  background: rgba(24, 22, 33, .24);
  transition: opacity .3s ease, background-color .3s ease, top .3s ease, height .3s ease;
}
.ef-tick.rec { top: 6px; height: 10px; background: rgba(24, 22, 33, .48); }
.ef-track[data-ultra] ~ * .ef-tick, .ef-track[data-ultra] .ef-tick { opacity: .45; }
.ef-fx {
  position: absolute; top: -40px; left: -32px;
  z-index: 1;
  width: calc(100% + 64px); height: calc(100% + 80px);
  pointer-events: none;
}
.ef-thumb {
  position: absolute; top: 0;
  z-index: 2;
  width: 16px; height: 22px;
  pointer-events: none;
  will-change: transform;
}
.ef-flash {
  position: absolute; top: 50%; left: 50%;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lumesec-glint) 0%, color-mix(in srgb, var(--lumesec) 70%, transparent) 30%, transparent 68%);
  opacity: 0;
}
.ef-ring { position: absolute; inset: 0; border: 2px solid var(--lumesec); border-radius: 7px; opacity: 0; }
.ef-knob {
  position: absolute; inset: 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .18);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
}
.ef-track[data-dragging] .ef-knob { transform: scale(.9, .94); }
.ef-track[data-ultra] .ef-knob {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 1px color-mix(in srgb, var(--lumesec) 55%, transparent), 0 0 14px 2px color-mix(in srgb, var(--lumesec) 50%, transparent);
}
.ef-caption-row { position: relative; height: 15px; }
.ef-caption {
  position: absolute; top: 0;
  transform: translateX(-50%);
  font-size: 11.5px; white-space: nowrap;
  color: var(--ef-muted);
}

/* ── Modais / settings ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(15, 23, 42, .45);
  display: grid; place-items: center;
  padding: 18px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 600px;
  max-height: min(88dvh, 780px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45);
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 700; flex: 1; }
.modal-body { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 0; }
.provider-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.provider-card.default { border-color: var(--teal-border); box-shadow: 0 0 0 1px var(--teal-border) inset; }
.provider-top { display: flex; align-items: center; gap: 8px; }
.provider-top .pname { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 700; color: var(--teal-strong); background: var(--teal-soft); border: 1px solid var(--teal-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.badge.ok { color: #14734a; background: #e8f7ee; border-color: #bfe6d0; }
.badge.err { color: var(--danger); background: var(--danger-soft); border-color: #f2c1bd; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; background: #fff; outline: none;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.field .hintline { font-size: 11.5px; color: var(--faint); }
.kw-wrap { position: relative; display: flex; }
.kw-wrap input { padding-right: 40px; }
.kw-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--faint); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.kw-wrap .eye:hover { color: var(--ink); background: var(--wash); }
.kw-wrap .eye svg { width: 16px; height: 16px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); }
.check-row input { width: 16px; height: 16px; accent-color: var(--teal); }
.provider-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.test-result { font-size: 12.5px; border-radius: 10px; padding: 8px 12px; }
.test-result.ok { background: #e8f7ee; color: #14734a; border: 1px solid #bfe6d0; }
.test-result.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #f2c1bd; }
.empty-providers { border: 1px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ── Auth ───────────────────────────────────────────────── */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; background: linear-gradient(180deg, #f7faf9 0%, #eef4f2 100%); padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .28);
  padding: 30px 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 4px; }
.auth-brand .brand-logo { width: 46px; height: 46px; }
.auth-brand .brand-logo svg { width: 26px; height: 26px; }
.auth-title { font-family: var(--serif); font-size: 26px; font-weight: 700; text-align: center; margin: 0; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: -6px 0 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--wash); padding: 4px; border-radius: 12px; }
.auth-tabs button { border: 0; background: transparent; padding: 8px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.auth-error { background: var(--danger-soft); border: 1px solid #f2c1bd; color: var(--danger); font-size: 13px; border-radius: 10px; padding: 9px 12px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--faint); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 90;
  background: #111827; color: #fff;
  font-size: 13.5px;
  border-radius: 12px;
  padding: 10px 18px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4);
  animation: rise .2s ease;
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast.err { background: var(--danger); }

/* ── Menus (Prompts, anexos) ────────────────────────────── */
.menu {
  position: fixed; z-index: 65;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px -14px rgba(16, 24, 40, .3);
  padding: 6px;
  min-width: 230px;
  animation: pop .16s ease;
  max-height: 300px; overflow-y: auto;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--ink); text-align: left;
}
.menu-item:hover { background: var(--wash); }
.menu-item svg { width: 16px; height: 16px; color: var(--teal); flex: none; }
.menu-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px 4px; }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .presets { grid-template-columns: 1fr; }
  .msg.user .bubble { max-width: 88%; }
  .hints .right { display: none; }
  .hints { justify-content: center; }
  .fgrid { grid-template-columns: 1fr; }
  .artifact-body { height: min(40vh, 380px); }
  .mode-pills { justify-content: center; }
}
