/* Matches kaylabrizo.com: white, black, aqua accent; Montserrat headings, Sintony body. */
:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #5f5f5f;
  --accent: #47d7ed;
  --line: #e3e3e3;
  --bot-bubble: #f6f6f6;
  --heading: "Montserrat", Helvetica, Arial, sans-serif;
  --body: "Sintony", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

[hidden] { display: none !important; }

/* Full-height column: header / chat / footer */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 820px;
  margin: 0 auto;
}

/* Header */
.site-header {
  padding: 18px 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.name {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  /* Longer heading now ("Ask Baxter about Kayla's Career"), so a little smaller. */
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.name span {
  background: var(--accent);
  padding: 0.05em 0.35em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Chat */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.bot {
  align-self: flex-start;
  background: var(--bot-bubble);
  border-bottom-left-radius: 4px;
}
.msg.visitor {
  align-self: flex-end;
  background: var(--accent);
  border-bottom-right-radius: 4px;
}
.msg .who {
  display: block;
  font-family: var(--heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.msg a { color: var(--text); font-weight: 700; }
.msg.bot { white-space: normal; }
/* Several bubbles in a row from Baxter: show his name only on the first. */
.msg.bot + .msg.bot .who { display: none; }
.msg.bot p { margin: 0 0 0.6em; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot ul { margin: 0.2em 0 0.6em; padding-left: 1.2em; }
.msg.bot ul:last-child { margin-bottom: 0; }
.msg.bot li { margin: 0.2em 0; }

/* Typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Intro card */
.intro-card {
  align-self: stretch;
  border: 2px solid var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}
.intro-title {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.intro-card label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.intro-card em { color: var(--muted); font-style: normal; font-size: 0.85em; }
.intro-card input {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.intro-card input:focus { outline: 2px solid var(--accent); border-color: var(--text); }
.intro-card input.invalid { border-color: #c0262d; }
.intro-error { margin: 0; color: #c0262d; font-size: 0.85rem; }
.intro-note { margin: 0; color: var(--muted); font-size: 0.8rem; }
.intro-done {
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: 2px 10px;
}

/* Buttons */
.btn {
  align-self: flex-start;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--text);
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible { background: var(--accent); color: var(--text); }

/* Starter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.chip:hover, .chip:focus-visible { background: var(--accent); }

/* Message box */
.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer textarea {
  flex: 1;
  font: inherit;
  /* 16px keeps iPhones from zooming in when the box is tapped */
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  max-height: 160px;
  padding: 10px 14px;
  border: 1.5px solid var(--text);
  border-radius: 20px;
  background: #fff;
  color: var(--text);
}
.composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.send {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.send:hover, .send:focus-visible { background: var(--accent); color: var(--text); }
.send:disabled { opacity: 0.4; cursor: default; }
.counter {
  position: absolute;
  right: 72px;
  top: -20px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  padding: 0 6px;
}
.counter.over { color: #c0262d; font-weight: 700; }

/* Offline + loading */
.offline-view, .loading-view {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  text-align: center;
}
.loading-view { color: var(--muted); }
.offline-card { max-width: 420px; }
.offline-card h2 {
  font-family: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
}
.email-link {
  color: var(--text);
  font-weight: 700;
  border-bottom: 3px solid var(--text);
  text-decoration: none;
}
.email-link:hover { background: var(--accent); border-bottom-color: transparent; }

/* Footer */
.site-footer span { display: block; }
.footer-contact { margin-top: 2px; }
.site-footer a { color: var(--text); font-weight: 700; }
.site-footer {
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) {
  .name { font-size: 1.5rem; }
  .log { padding: 24px 24px 10px; }
  .composer { padding: 12px 24px 14px; }
  .msg { max-width: 75%; }
}
