:root {
  --pink: #e31c79;
  --pink-deep: #c41266;
  --ink: #111827;
  --muted: #64748b;
  --line: #f3c2da;
  --ok: #12b76a;
  --shadow: 0 8px 14px -4px rgb(17 24 39 / 0.12);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 17px;
}

strong, b {
  font-weight: 600;
}

svg.icon-svg {
  width: 1.2em;
  height: 1.2em;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #e8ecf1;
  color: var(--ink);
}

.chat-shell {
  width: min(100%, 28rem);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(17 24 39 / 0.06);
  overflow: hidden;
}

.chat-header {
  flex: none;
  background: var(--pink);
  color: #fff;
  padding: max(0.35rem, env(safe-area-inset-top)) 0.75rem 0.45rem;
}

.chat-header__inner {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
}

.chat-header img {
  height: 34px;
  width: auto;
  max-width: 210px;
  justify-self: center;
  display: block;
}

.chat-header__close {
  justify-self: end;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.3);
  background: linear-gradient(135deg, #25D366 0%, #1EBE5D 100%);
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.chat-header__close:hover,
.chat-header__close:active {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.24);
}

.chat-header__close svg { width: 20px; height: 20px; display: block; flex: none; }

.chat-header__pulse {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 0 rgb(255 255 255 / 0.7);
  animation: wa-pulse 2.2s infinite;
  flex: none;
}

@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0.75); }
  70% { box-shadow: 0 0 0 6px rgb(255 255 255 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0); }
}

.chat-main {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.watermark {
  pointer-events: none;
  background: url("/brand/chubb-mark.png") center / min(78%, 280px) no-repeat;
  opacity: 0.32;
  mix-blend-mode: multiply;
}

.stage--bottom .watermark { flex: 1; min-height: 7.5rem; }

.stage--top .watermark { position: absolute; inset: 0; }

.sheet { padding: 1.15rem 1rem max(1rem, env(safe-area-inset-bottom)); }

.stage--top .sheet {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.stage--top .sheet:has(.created),
.stage--top .sheet:has(.history) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.85rem 0.75rem max(0.85rem, env(safe-area-inset-bottom));
}

.stage--bottom .sheet { flex: none; padding-top: 0.35rem; }

.intro {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-wrap;
}

.menu {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.stage--top .menu { overflow-y: auto; }

.choice {
  width: 100%;
  min-height: 3.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff5f9;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  font-size: 1.05rem;
  text-align: left;
  padding: 0.7rem 1rem 0.7rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.choice span.icon, .call .icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.choice span.icon svg, .call .icon svg { width: 1.2rem; height: 1.2rem; display: block; }

.choice span.icon.icon-bg {
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.choice span.icon.icon-bg img.icon-bg-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.guide {
  width: 100%;
  border-radius: 18px;
  display: block;
  margin-bottom: 0.75rem;
}

.composer {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.composer input, .gate input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e6edf5;
  background: #fff;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.composer input:focus, .gate input:focus { border-color: var(--pink); }

.composer button, .primary, .locate {
  border: 0;
  background: var(--pink);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.composer button {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}

.composer button svg { width: 1.25rem; height: 1.25rem; }

.primary, .locate {
  width: 100%;
  min-height: 3.25rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary svg,
.locate svg,
.track svg,
.created .primary svg,
.created .track svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex: none;
}

.locate { background: #0ea5e9; }

.hint, .err { margin: 0.45rem 0 0; font-size: 0.82rem; }
.hint { color: var(--muted); }
.err { color: var(--pink-deep); font-weight: 700; }

.created {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 1.5px solid #f3c2da;
  border-radius: 28px;
  padding: 2rem 1.25rem 1.4rem;
  box-shadow: 0 18px 40px rgb(17 24 39 / 0.08);
}

.created--ok { border-color: #c8ead4; }

.created h2 { margin: 1rem 0 0.35rem; font-size: 1.7rem; }

.created-mark {
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 8px #fff, 0 0 0 10px #f3c2da;
  display: grid;
  place-items: center;
}

.created--ok .created-mark {
  background: var(--ok);
  box-shadow: 0 0 0 8px #fff, 0 0 0 10px #c8ead4;
}

.created-mark svg { width: 2.6rem; height: 2.6rem; display: block; }

.created .service { margin: 0 0 0.85rem; color: var(--pink); font-size: 1.15rem; font-weight: 800; }
.created .case { margin: 0.15rem 0; color: var(--muted); font-weight: 700; }
.created-facts {
  width: 100%;
  margin: 0.85rem 0 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: #f4faf6;
  text-align: left;
}
.created-facts .created-vehicle {
  display: block;
  margin: 0 0 0.55rem;
  font-weight: 700;
  line-height: 1.35;
}
.created-facts p {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.95rem;
}
.created-facts span { color: var(--muted); font-weight: 400; }
.created-facts strong { font-weight: 600; }
.created-copy { margin: 0.8rem 0 1.1rem; max-width: 22rem; line-height: 1.45; font-weight: 400; }

.created .track {
  width: 100%;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 2px solid var(--pink);
  border-radius: 999px;
  background: #fff;
  color: var(--pink);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.created .track + .primary { margin-top: 1.7rem; }
.created .primary + .track { margin-top: 1rem; }

.history, .contacts {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0.7rem;
}

.history { flex: 1; }
.history h2, .contacts h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.history-list, .call-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.assist, .call {
  border: 1.5px solid #f3c2da;
  border-radius: 18px;
  background: #fff;
  padding: 0.85rem 0.95rem;
}

.assist h3 { margin: 0.15rem 0; font-size: 1rem; }
.assist p, .call small { margin: 0; color: var(--muted); }
.assist-kicker { font-size: 0.78rem; font-weight: 800; color: var(--ink); }
.assist .status--proceso { color: #128a3e; font-weight: 800; }
.assist .status--concluida { color: var(--pink); font-weight: 800; }
.assist-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.7rem;
}
.assist-track {
  width: 100%;
  min-height: 2.6rem;
  border-radius: 999px;
  border: 2px solid var(--pink);
  background: #fff;
  color: var(--pink);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assist-cancel {
  width: 100%;
  margin-top: 0;
  min-height: 2.6rem;
  border-radius: 999px;
  border: 0;
  background: var(--pink);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.call {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.call > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.call strong { color: var(--pink); }

.notices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notice {
  border: 1.5px solid #f3c2da;
  border-radius: 20px;
  background: #fff;
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow);
}

.notice h3 { margin: 0 0 0.35rem; font-size: 1.08rem; }

.notice p {
  margin: 0 0 0.8rem;
  line-height: 1.4;
  font-weight: 600;
}

.dial {
  min-height: 2.85rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 800;
}

.dial svg { width: 1.05rem; height: 1.05rem; display: block; flex: none; }

.empty { margin: 0; color: var(--muted); text-align: center; }
