@font-face {
  font-family: Raleway;
  src: url('/raleway.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #080618;
  --panel: #100f23;
  --ink: #fff;
  --muted: #b7b4cb;
  --line: #302e47;
  --cyan: #00cafe;
  font-family: Raleway, Arial, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: radial-gradient(ellipse at 81% 66%, #101c36 0%, transparent 56%), var(--background);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #8de9ff; outline-offset: 4px; }

.layout { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 96px;
  border-bottom: 1px solid #ffffff1a;
}

.brand img { width: 136px; height: auto; display: block; }
.handle { color: var(--muted); font: .8rem ui-monospace, monospace; }

.main {
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  min-height: calc(100vh - 96px);
  min-height: calc(100dvh - 96px);
  padding-block: 44px;
}

.intro::before {
  content: '';
  display: block;
  height: 3px;
  width: 36px;
  border-radius: 2px;
  background: var(--cyan);
  margin-bottom: 23px;
}

h1 { margin: 0; font-size: clamp(2.6rem, 5.9vw, 5.25rem); font-weight: 780; line-height: .99; letter-spacing: -.072em; }
h1 strong { display: block; color: var(--cyan); font-weight: inherit; }
.intro p { margin: 24px 0 0; max-width: 29ch; color: var(--muted); font-size: 1.18rem; font-weight: 540; line-height: 1.55; }

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  height: clamp(516px, 72dvh, 657px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 66px #03020f9c, 0 -1px 0 #00cafe44;
}

.chat-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.avatar { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #00cafe4a; border-radius: 50%; background: #172e44; }
.avatar img { width: 26px; height: 26px; object-fit: contain; }
.contact h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; font-weight: 760; }
.contact p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; font-weight: 630; }
.progress { display: grid; gap: 6px; color: var(--muted); text-align: right; font: .7rem ui-monospace, monospace; white-space: nowrap; }
.progress-track { display: flex; gap: 4px; }
.progress-track i { width: 16px; height: 3px; border-radius: 3px; background: #504c67; }
.progress-track i:first-child, .progress-track[data-step='2'] i:last-child, .progress-track[data-step='3'] i:last-child { background: var(--cyan); }

.thread {
  position: relative;
  isolation: isolate;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  padding: 25px 20px;
  background: radial-gradient(circle, #b6dfff14 1px, transparent 1.5px) 0 0 / 21px 21px, #0c0b1e;
  scrollbar-width: thin;
  scrollbar-color: #44415e transparent;
}

.thread::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url('/marca.svg') right 26px bottom 18px / min(45%, 190px) auto no-repeat;
  opacity: .07;
  pointer-events: none;
}

.bubble {
  width: max-content;
  max-width: 90%;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 15px;
  line-height: 1.45;
  font-size: .98rem;
  font-weight: 605;
  overflow-wrap: anywhere;
  animation: arrive .22s ease-out both;
}

.incoming { color: #f3f3fc; background: #201e39; border: 1px solid #332f50; border-radius: 3px 15px 15px 15px; }
.outgoing { align-self: flex-end; color: #d0f6ff; background: #14364a; border: 1px solid #24637a; border-radius: 15px 3px 15px 15px; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.composer { padding: 14px 18px; background: #15132b; border-top: 1px solid var(--line); }
.reply-row { display: grid; grid-template-columns: minmax(0, 1fr) 50px; gap: 10px; }
.reply-row input {
  min-width: 0;
  border: 1px solid #494565;
  border-radius: 13px;
  padding: 11px 14px;
  background: #0e0c20;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 640;
}
.reply-row input::placeholder { color: #a39fb9; }
.reply-row input[aria-invalid='true'] { border-color: #ff9fae; }

.send, .open {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  background: var(--cyan);
  border: 1px solid transparent;
  border-radius: 13px;
  color: #080618;
  font-weight: 820;
  text-decoration: none;
  box-shadow: 0 4px 17px #00cafe25;
  transition: background .18s, transform .18s;
}
.send:hover, .open:hover { background: #85e9ff; }
.send:active, .open:active { transform: scale(.97); }
.error { color: #ffb5c1; font-size: .85rem; font-weight: 670; line-height: 1.35; margin: 9px 0 0; }
.edit { display: block; min-height: 44px; padding: 6px 2px; color: #bceafa; font-size: .82rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; margin: 2px 0 -7px; }
.edit:hover { color: var(--ink); }
.handoff .edit { margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 780px) {
  .layout { width: min(510px, calc(100% - 30px)); }
  .brand { min-height: 65px; }
  .brand img { width: 109px; }
  .handle { font-size: .71rem; }
  .main { display: flex; flex-direction: column; gap: 18px; min-height: calc(100dvh - 65px); padding: 21px 0 max(15px, env(safe-area-inset-bottom)); }
  .intro { width: 100%; }
  .intro::before { display: none; }
  h1 { font-size: clamp(2rem, 8.9vw, 3.05rem); letter-spacing: -.063em; }
  .intro p { display: none; }
  .chat { width: 100%; flex: 1 0 auto; min-height: 330px; height: 0; border-radius: 20px; }
  .chat-header { padding: 13px 14px; gap: 9px; }
  .avatar { width: 42px; height: 42px; }
  .thread { padding: 18px 13px; }
  .bubble { padding: 10px 12px; }
  .composer { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
