* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(180deg, #e8f6f4 0%, #f4f6f7 260px);
  color: #222;
  min-height: 100vh;
}

.portada {
  text-align: center;
  padding: 32px 16px 8px;
}
.portada h1 {
  color: #0f766e;
  margin: 0 0 6px;
  font-size: 26px;
}
.portada p {
  color: #555;
  margin: 0;
  font-size: 14px;
}

.chat-widget {
  max-width: 420px;
  margin: 24px auto 40px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  height: 70vh;
  min-height: 480px;
  overflow: hidden;
}

.chat-header {
  background: #0f766e;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-sub {
  font-size: 12px;
  opacity: .85;
}

.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9f9;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}
.msg.bot {
  background: #fff;
  border: 1px solid #e2e8e7;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.user {
  background: #0f766e;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.resumen {
  background: #fffbea;
  border: 1px solid #f0d97a;
  align-self: stretch;
}
.msg.resumen table { width: 100%; border-collapse: collapse; font-size: 13px; }
.msg.resumen td { padding: 3px 0; }
.msg.resumen td:first-child { color: #777; padding-right: 8px; white-space: nowrap; }

.chat-opciones {
  padding: 0 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f7f9f9;
}
.opcion-btn {
  background: #e6f4f2;
  border: 1px solid #0f766e;
  color: #0f766e;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}
.opcion-btn:hover { background: #0f766e; color: #fff; }
.opcion-btn:disabled { opacity: .5; cursor: not-allowed; }

.chat-form {
  display: flex;
  border-top: 1px solid #e2e8e7;
}
.chat-form input {
  flex: 1;
  border: none;
  padding: 14px;
  font-size: 14px;
  outline: none;
}
.chat-form button {
  border: none;
  background: #0f766e;
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: bold;
}
.chat-form.oculto { display: none; }

.typing {
  align-self: flex-start;
  font-size: 12px;
  color: #999;
  padding-left: 4px;
}
