/* Laid out for small iPhones first: iPhone SE 3rd gen (375 x 667, no notch)
   and iPhone 16e (390 x 844, with notch). */

:root {
  --brand: #025d68;
  --brand-dark: #014a53;
  --brand-tint: #e1eff0;
  --text: #3a3a3a;
  --muted: #58595c;
  --line: #d5d8dc;
  --page: #ffffff;
  --tip: #fff6dc;
  --tip-line: #ecd9a0;
  --app-height: 100dvh;
  --app-top: 0px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--brand);
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* The page is pinned to the visible part of the screen, so the message box
   sits just above the iPhone keyboard. */
.app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-top);
  height: var(--app-height);
  display: flex;
  flex-direction: column;
  background: var(--page);
}

/* Top bar. Padding clears the notch on the 16e; the SE has no notch. */
.bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: var(--brand);
  color: #ffffff;
}

.title {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: #ffffff;
  color: var(--brand);
  font-size: 16px;
  font-weight: 600;
}

.bar-button:active {
  background: var(--brand-tint);
}

.plus {
  font-size: 22px;
  line-height: 1;
  margin-top: -2px;
}

/* One-line tip above a new chat. */
.tip {
  flex: none;
  margin: 0;
  padding: 10px 16px;
  background: var(--tip);
  border-bottom: 1px solid var(--tip-line);
  font-size: 15px;
  line-height: 1.35;
}

.chat {
  flex: 1;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.chat > div,
.chat .webchat__basic-transcript,
.chat > div > div {
  height: 100%;
}

/* Full-screen panels: signing in, continue, errors. */
.panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.panel.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 4px auto 28px;
}

.hello {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
}

.lead {
  margin: 0 0 20px;
  font-size: 18px;
}

.detail {
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: #f2f5f7;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.big {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 2px solid var(--brand);
  border-radius: 14px;
  background: #ffffff;
  color: var(--brand);
  font-size: 18px;
  font-weight: 600;
}

.big.primary {
  background: var(--brand);
  color: #ffffff;
}

.big:active {
  opacity: 0.85;
}

.small {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.signed-in {
  margin-top: 28px;
  text-align: center;
}

.link {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--brand);
  text-decoration: underline;
  font-size: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border: 4px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Web Chat: 17px text everywhere, and 16px or more in the message box so
   iPhone doesn't zoom in when it's tapped. */
.chat .webchat__bubble__content,
.chat .webchat__text-content,
.chat .markdown,
.chat p,
.chat li {
  font-size: 17px !important;
  line-height: 1.45;
}

.chat textarea,
.chat input[type="text"] {
  font-size: 17px !important;
}

/* Paperclip and Send: 44 x 44 touch targets (Apple's minimum) with bigger
   icons, instead of Web Chat's 32 x 32. */
.chat .sendbox__toolbar-button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  color: var(--brand) !important;
}

.chat .sendbox__toolbar-button > * {
  transform: scale(1.35);
}

/* The "0/2000" character counter isn't useful here. */
.chat .sendbox__text-counter {
  visibility: hidden;
}

/* Less indent on lists in the agent's replies, so the form uses the width. */
.chat ul,
.chat ol {
  padding-left: 22px !important;
  margin: 6px 0 !important;
}

.chat ul ul {
  padding-left: 18px !important;
}

.chat .sendbox__sendbox {
  margin: 8px 10px 10px !important;
}
