/* Selene — Mapa Espiritual (docs/SELENE-CHAT.md). DESIGN.md: indigo/mystic purple
   base, lavender highlights, soft cyan for AI/clarity, large rounded panels,
   44px+ tap targets, no fixed mobile widths. */
.sl-stage {
  --sl-ink: #f5f3ff; --sl-muted: #c7d2fe; --sl-lav: #e4c48a; --sl-lav-pale: #f4efe4;
  --sl-cyan: #e7d3a8; --sl-violet: #8a6230; --sl-deep: #0c0a16;
  position: relative;
  background:
    radial-gradient(ellipse 80% 45% at 50% -10%, rgba(196,92,62,.28), transparent 60%),
    radial-gradient(ellipse 50% 35% at 90% 100%, rgba(103,232,249,.12), transparent 60%),
    linear-gradient(180deg, #0c0a16 0%, #161222 60%, #0c0a16 100%);
  padding: 40px 0 32px;
}
.sl-shell { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.sl-intro { text-align: center; margin-bottom: 22px; }
.sl-kicker { letter-spacing: .3em; font-size: 12px; font-weight: 700; color: var(--sl-lav); text-transform: uppercase; margin: 0; }
.sl-title { font-size: clamp(1.9rem, 5.5vw, 2.9rem); font-weight: 800; color: #fff; line-height: 1.1; margin: 10px 0 8px; text-shadow: 0 0 40px rgba(196,92,62,.55); }
.sl-lede, .sl-lede p { color: var(--sl-muted); font-size: 1.02rem; max-width: 520px; margin: 0 auto; }

/* ---- painel da conversa ---- */
.sl-panel {
  display: flex; flex-direction: column;
  height: min(78svh, 760px); min-height: 460px;
  background: rgba(22,18,34,.78);
  border: 1px solid rgba(228,196,138,.28);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.sl-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(228,196,138,.18); background: rgba(11,10,31,.35); }
.sl-who { flex: 1; min-width: 0; }
.sl-name { margin: 0; font-weight: 700; color: #fff; font-size: 1.05rem; line-height: 1.2; }
.sl-role { margin: 0; font-size: .8rem; color: var(--sl-muted); display: flex; align-items: center; gap: 6px; }
.sl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sl-cyan); box-shadow: 0 0 10px var(--sl-cyan); }
.sl-restart {
  min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(228,196,138,.35); background: transparent; color: var(--sl-lav-pale);
  font-size: .9rem; cursor: pointer;
}
.sl-restart:hover { background: rgba(228,196,138,.14); }
@media (max-width: 420px) { .sl-restart span { display: none; } }

.sl-avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d7a8, #a34b32 70%);
  color: #fff; font-size: 16px; box-shadow: 0 0 16px rgba(228,196,138,.5);
}
.sl-avatar--lg { width: 42px; height: 42px; font-size: 20px; }

.sl-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 16px 12px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(228,196,138,.35) transparent;
}
.sl-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; animation: sl-in .28s ease-out; }
.sl-bot.is-cont { padding-left: 40px; margin-top: -4px; }
.sl-msg { padding: 11px 15px; border-radius: 20px; font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; max-width: min(85%, 560px); }
.sl-bot .sl-msg { background: rgba(110,90,146,.42); color: var(--sl-ink); border: 1px solid rgba(228,196,138,.22); border-bottom-left-radius: 6px; }
.sl-bot.is-cont .sl-msg { border-bottom-left-radius: 20px; }
.sl-bot .sl-msg strong { color: #fff; }
.sl-bot .sl-msg a { color: var(--sl-cyan); text-decoration: underline; text-underline-offset: 3px; }
.sl-you { justify-content: flex-end; }
.sl-you .sl-msg { background: linear-gradient(135deg, #8a6230, #c45c3e); color: #fff; border-bottom-right-radius: 6px; }

.sl-typing { display: inline-flex; gap: 5px; padding: 14px 16px; margin-left: 40px; width: fit-content; border-radius: 20px; background: rgba(110,90,146,.32); }
.sl-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--sl-lav); animation: sl-blink 1.1s infinite ease-in-out; }
.sl-typing span:nth-child(2) { animation-delay: .15s; }
.sl-typing span:nth-child(3) { animation-delay: .3s; }

/* ---- carta de revelação ---- */
.sl-card {
  --sl-accent: #e4c48a;
  margin: 6px 0 6px 40px; padding: 18px 18px 16px; border-radius: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--sl-accent) 26%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(30,24,46,.92), rgba(12,10,22,.96));
  border: 1px solid color-mix(in srgb, var(--sl-accent) 50%, rgba(228,196,138,.3));
  box-shadow: 0 14px 40px rgba(0,0,0,.35), 0 0 30px color-mix(in srgb, var(--sl-accent) 18%, transparent);
  max-width: min(100% - 40px, 560px);
  animation: sl-bloom .55s cubic-bezier(.2,.8,.2,1);
}
.sl-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.sl-card-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 18px; font-size: 26px; color: #fff;
  background: color-mix(in srgb, var(--sl-accent) 35%, rgba(11,10,31,.6));
  border: 1px solid color-mix(in srgb, var(--sl-accent) 60%, transparent);
}
.sl-card-kicker { margin: 0; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sl-cyan); font-weight: 700; }
.sl-card-title { margin: 2px 0 0; font-size: 1.3rem; color: #fff; font-weight: 800; line-height: 1.2; }
.sl-card-body { margin: 6px 0 0; color: var(--sl-lav-pale); line-height: 1.55; }
.sl-card.is-summary .sl-card-body { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(228,196,138,.16); }
.sl-card-note { margin: 12px 0 0; font-size: .8rem; color: var(--sl-muted); font-style: italic; }
@media (max-width: 480px) { .sl-card { margin-left: 0; max-width: 100%; } }

.sl-consent { margin: 0 0 0 40px; font-size: .82rem; color: var(--sl-muted); max-width: 520px; }
.sl-fail { color: #fecaca; text-align: center; margin: 24px 0; }

/* ---- composer ---- */
.sl-composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(228,196,138,.18); background: rgba(12,10,22,.55); }
.sl-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sl-chips[hidden], .sl-form[hidden] { display: none; }
.sl-chips:not([hidden]) + .sl-form:not([hidden]) { margin-top: 8px; }
.sl-chip {
  min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-size: .98rem; font-weight: 600; line-height: 1.2;
  background: rgba(22,18,34,.85); color: var(--sl-lav-pale);
  border: 1px solid rgba(228,196,138,.5);
  transition: background .15s, border-color .15s, transform .1s;
}
.sl-chip:hover { background: rgba(110,90,146,.35); border-color: var(--sl-lav); }
.sl-chip:active { transform: scale(.97); }
.sl-chip.is-primary { background: linear-gradient(135deg, #8a6230, #c45c3e); color: #fff; border-color: transparent; box-shadow: 0 6px 20px rgba(196,92,62,.4); }
.sl-chip:focus-visible, .sl-send:focus-visible, .sl-input:focus-visible, .sl-restart:focus-visible { outline: 3px solid var(--sl-cyan); outline-offset: 2px; }
.sl-form { display: flex; gap: 8px; }
.sl-input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 18px; border-radius: 999px;
  background: rgba(12,10,22,.8); color: #fff; font-size: 16px;
  border: 1px solid rgba(228,196,138,.35); color-scheme: dark;
}
.sl-input::placeholder { color: #8b8fc7; }
.sl-send {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e7d3a8, #c45c3e); color: #0c0a16;
}
.sl-err { margin: 6px 4px 0; min-height: 0; font-size: .85rem; color: #fca5a5; }
.sl-err:empty { display: none; }

.sl-safety { margin: 16px auto 0; max-width: 600px; text-align: center; font-size: .82rem; color: var(--sl-muted); }

@keyframes sl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sl-bloom { from { opacity: 0; transform: scale(.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sl-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .sl-row, .sl-card { animation: none; }
  .sl-typing span { animation: none; opacity: .7; }
}
