:root {
  color: #0d4a86;
  background: #eef6fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 166, 178, .13), transparent 36%),
    linear-gradient(160deg, #f8fcff 0%, #eaf4fa 100%);
}

button, textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.chat-shell {
  width: min(100%, 780px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: rgba(255,255,255,.92);
  box-shadow: 0 0 60px rgba(13,74,134,.12);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 18px 16px;
  color: white;
  background: linear-gradient(135deg, #0d4a86, #006a79);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #0d4a86;
  background: white;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0,0,0,.14);
}

.brand-copy { flex: 1; min-width: 0; }
.brand-copy strong { display: block; font-size: 17px; letter-spacing: .01em; }
.brand-copy span { display: block; margin-top: 2px; color: #d8f6f4; font-size: 12px; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #73e7a8;
  box-shadow: 0 0 0 5px rgba(115,231,168,.16);
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 16px 10px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin: 0 0 12px;
}

.message.visitor { justify-content: flex-end; }

.bubble {
  max-width: min(84%, 590px);
  padding: 11px 14px;
  border-radius: 18px 18px 18px 5px;
  background: #edf5fa;
  color: #173a5c;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 14px rgba(13,74,134,.06);
}

.visitor .bubble {
  color: white;
  background: linear-gradient(135deg, #0d69a6, #00899b);
  border-radius: 18px 18px 5px 18px;
}

.operator .bubble {
  background: #e7f7ed;
  border: 1px solid #bce8cb;
}

.message-label {
  display: block;
  margin-bottom: 4px;
  color: #15806a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.message-time {
  display: block;
  margin-top: 5px;
  opacity: .62;
  font-size: 10px;
  text-align: right;
}

.typing {
  padding: 2px 18px 8px;
  color: #65839b;
  font-size: 12px;
}

.composer {
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #dceaf2;
  background: rgba(255,255,255,.96);
}

.handoff {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin: 0 0 12px;
  padding: 12px 20px;
  border: 2px solid #0a6576;
  border-radius: 16px;
  color: #ffffff;
  background: #0a6576;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 101, 118, .18);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.handoff:hover {
  background: #084f5d;
  box-shadow: 0 6px 16px rgba(10, 101, 118, .24);
  transform: translateY(-1px);
}

.handoff:disabled {
  color: #0a6576;
  background: #effafb;
  border-color: #b6d9e4;
  box-shadow: none;
  transform: none;
  opacity: .72;
  cursor: default;
}

.message-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px;
  border: 1px solid #c8dfe9;
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 28px rgba(13,74,134,.08);
}

textarea {
  flex: 1;
  min-height: 40px;
  max-height: 130px;
  resize: none;
  padding: 9px 10px;
  border: 0;
  outline: 0;
  color: #173a5c;
  background: transparent;
  line-height: 1.35;
}

textarea::placeholder { color: #7d98ac; }

.send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #0d69a6, #008e9c);
  font-size: 22px;
  cursor: pointer;
}

.send:disabled { opacity: .45; cursor: default; }
.send:hover:not(:disabled) { filter: brightness(.95); }

.disclaimer {
  margin: 7px 4px 0;
  color: #7890a2;
  font-size: 10px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 800px) {
  body { padding: 28px; }
  .chat-shell { min-height: calc(100dvh - 56px); border-radius: 26px; overflow: hidden; }
}


/* LifeLogistica contact form */
.contact-form {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.contact-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.contact-grid input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
}
.contact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.contact-actions button {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
}
.contact-status {
  font-size: 13px;
}
@media (max-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* International phone input */
.contact-grid .iti {
  width: 100%;
}
.contact-grid .iti input {
  width: 100%;
  box-sizing: border-box;
}


/* LifeLogistica phone selector */
.phone-wrap {
  display: flex;
  width: 100%;
  gap: 6px;
}
.phone-wrap select {
  flex: 0 0 105px;
  min-width: 105px;
  box-sizing: border-box;
  padding: 10px 6px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.phone-wrap input {
  flex: 1;
  min-width: 0;
}


/* Operator waiting countdown */
.operator-wait {
  margin: -2px 0 12px;
  padding: 13px 16px;
  border: 1px solid #b6d9e4;
  border-radius: 14px;
  background: #effafb;
  color: #0a5262;
  display: grid;
  gap: 5px;
  font-size: 14px;
  line-height: 1.4;
}

.operator-wait strong {
  font-size: 15px;
  color: #074e5e;
}

.operator-wait b {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: #0a6576;
}

.operator-wait.answered {
  background: #eefaf3;
  border-color: #b7dfc5;
  color: #17633a;
}

.operator-wait.answered strong {
  color: #17633a;
}

.operator-wait.expired {
  background: #fff9e9;
  border-color: #ead9a8;
  color: #705716;
}

.handoff[hidden] {
  display: none !important;
}
