:root {
  --bg: #EEF3F8;          /* light cool blue-gray */
  --navy: #1F3A6E;        /* HHN deep blue */
  --navy-deep: #162C55;
  --cyan: #1FAACE;        /* HHN teal/cyan */
  --cyan-deep: #1892B3;
  --green: #6DB43F;       /* HHN leaf green */
  --ink: #1B2436;
  --muted: #5C6677;
  --line: #D7E0EC;
  --card: #FFFFFF;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app { height: 100%; display: flex; flex-direction: column; }

/* Header */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand { display: inline-flex; align-items: center; }
.logo { height: 44px; width: auto; display: block; }
.divider { width: 1px; height: 30px; background: var(--line); flex-shrink: 0; }
.sub {
  font-family: "Spectral", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.2px;
}

/* Scroll area */
.scroll { flex: 1 1 auto; overflow-y: auto; padding: 26px 20px 8px; }
.inner { max-width: 720px; margin: 0 auto; }

/* Empty state */
.empty { padding: 18px 0 8px; position: relative; }
.empty.hidden { display: none; }

/* --- Animated Benny intro --- */
.intro { opacity: 0; animation: fadeUp .5s ease forwards; }
.greet-row { display: flex; gap: 11px; align-items: flex-end; margin-bottom: 20px; }
.greet-av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; background: var(--cyan);
  box-shadow: 0 2px 8px rgba(31,58,110,.14);
}
.greet-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.greet-bubble {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; border-bottom-left-radius: 5px;
  padding: 13px 16px; max-width: 80%; font-size: 15.5px; line-height: 1.5;
  color: var(--ink); min-height: 22px;
  box-shadow: 0 2px 12px rgba(31,58,110,.06);
}
.greet-text { white-space: pre-wrap; }
.greet-text.typing::after {
  content: "▍"; color: var(--cyan); margin-left: 1px;
  animation: blink 1.05s steps(1, end) infinite;
}
.spanish-line { font-size: 13px; color: var(--muted); margin: 20px 0 0; }
.chip-in { animation: chipIn .38s ease backwards; }
.benny {
  position: fixed; left: 24px; top: 78px;
  width: 396px; height: auto; pointer-events: none; z-index: 5;
  opacity: 0; transform-origin: top center;
  filter: drop-shadow(0 14px 24px rgba(31,58,110,.16));
  animation: bennyIn .55s cubic-bezier(.22,1,.36,1) .35s forwards,
             bennyWiggle 1.1s ease 1.15s 2;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes chipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes bennyIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bennyWiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-6deg); }
  45% { transform: rotate(5deg); }
  70% { transform: rotate(-3deg); }
  88% { transform: rotate(2deg); }
}
@media (max-width: 1180px) { .benny { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .intro, .chip-in { animation: none; opacity: 1; }
  .benny { animation: bennyIn .4s ease forwards; }
  .greet-text.typing::after { display: none; }
}
.empty-h {
  font-family: "Spectral", Georgia, serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.18;
  color: var(--navy);
  margin: 0 0 10px;
  max-width: 16ch;
}
.empty-p { color: var(--muted); font-size: 15px; margin: 0 0 24px; max-width: 48ch; }
.starters-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 10px;
}
.starters { display: flex; flex-direction: column; gap: 8px; }
.chip {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, transform .08s, box-shadow .15s;
}
.chip:hover { border-left-color: var(--cyan); box-shadow: 0 2px 10px rgba(31,58,110,0.08); }
.chip:active { transform: translateY(1px); }

/* Messages */
.msgs { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.row { display: flex; gap: 11px; }
.row.user { justify-content: flex-end; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cyan);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bubble {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.bot { background: var(--card); border: 1px solid var(--line); border-top-left-radius: 5px; color: var(--ink); }
.bubble.user { background: var(--navy); color: #EEF3F8; border-top-right-radius: 5px; }
.bubble.err { background: #FBEDED; border: 1px solid #E6C3C3; color: #8A3030; }
.bubble.bot a { color: var(--cyan-deep); text-decoration: underline; text-underline-offset: 2px; }
.bubble.bot a:hover { color: var(--navy); }

/* Typing */
.dots { display: flex; gap: 5px; padding: 4px 2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: pulse 1.2s infinite ease-in-out; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,60%,100% { opacity:.25; transform: translateY(0);} 30% { opacity:.85; transform: translateY(-3px);} }

/* Composer */
.foot { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--bg); padding: 14px 20px 16px; }
.foot-inner { max-width: 720px; margin: 0 auto; }
.composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 8px 8px 14px;
}
.composer:focus-within { border-color: var(--navy); }
.input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  max-height: 130px;
  line-height: 1.5;
  padding: 5px 0;
}
.input::placeholder { color: #9AA6B5; }
.send {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: none; border-radius: 10px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.send:hover:not(:disabled) { background: var(--navy-deep); }
.send:disabled { background: #AEBAC9; cursor: not-allowed; }

.disclaimer {
  margin: 10px auto 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  max-width: 60ch;
}
.disclaimer b { color: #46514A; font-weight: 600; }

@media (max-width: 520px) {
  .empty-h { font-size: 25px; }
  .bubble { max-width: 86%; }
  .logo { height: 38px; }
  .sub { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}
