.assistant-launch {
  position: fixed;
  z-index: 12;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #87bbeb;
  border-radius: 8px;
  background: var(--brand-navy);
  box-shadow: 0 6px 20px #091f5830;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.assistant-launch:hover { background: var(--brand-blue); }
.assistant-launch svg { width: 22px; height: 22px; color: var(--brand-ice); }
body:has(.assistant-launch) footer { padding-bottom: 78px; }

.site-assistant {
  position: fixed;
  inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
  width: min(422px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #9ebcdb;
  border-radius: 12px;
  background: #fff;
  color: var(--brand-navy);
  box-shadow: 0 12px 48px #091f5840;
}
.site-assistant::backdrop { background: #081b4d42; }
.assistant-panel { display: grid; grid-template-rows: auto auto minmax(88px, 1fr) auto auto; max-height: calc(100dvh - 34px); }
.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
  background: linear-gradient(125deg, var(--brand-navy), var(--brand-blue));
  color: #fff;
}
.assistant-kicker { color: #d1ecff; font-size: 9px; font-weight: 650; letter-spacing: .12em; }
.assistant-head h2 {
  margin: 4px 0 0;
  font-family: var(--body);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.assistant-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #b4e3ff84;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.assistant-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 10px; }
.assistant-topics button {
  min-height: 33px;
  padding: 5px 8px;
  border: 1px solid #bdd7ee;
  border-radius: 5px;
  background: #fff;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.assistant-topics button:hover { background: var(--brand-pale); }
.assistant-log { min-height: 95px; max-height: 276px; overflow: auto; padding: 2px 14px 10px; font-size: 13px; line-height: 1.55; }
.assistant-exchange { display: grid; gap: 7px; margin-top: 9px; }
.assistant-asked {
  justify-self: end;
  max-width: 88%;
  padding: 7px 10px;
  border-radius: 7px 7px 2px 7px;
  background: var(--brand-blue);
  color: #fff;
  overflow-wrap: anywhere;
}
.assistant-answer { padding: 9px 11px; border-radius: 2px 7px 7px; background: var(--brand-pale); }
.assistant-answer a, .assistant-feedback {
  display: inline-block;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.assistant-answer a { margin-top: 5px; }
.assistant-form { display: grid; gap: 4px; padding: 8px 14px 10px; border-top: 1px solid var(--line); }
.assistant-form label { font-size: 12px; font-weight: 650; }
.assistant-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.assistant-input-row input, .assistant-input-row button { min-height: 42px; border-radius: 5px; font: inherit; }
.assistant-input-row input { min-width: 0; padding: 8px; border: 1px solid #9ebcdb; color: var(--brand-navy); font-size: 16px; }
.assistant-input-row input::placeholder { color: #516780; font-size: 12px; }
.assistant-input-row button { padding-inline: 14px; border: 0; background: var(--brand-blue); color: #fff; font-size: 13px; font-weight: 650; cursor: pointer; }
.assistant-foot { padding: 9px 14px 12px; border-top: 1px solid var(--line); }
.assistant-foot p { color: #425b76; font-size: 11px; line-height: 1.5; }
.assistant-foot a { margin-top: 3px; }
.site-assistant :focus-visible, .assistant-launch:focus-visible { outline: 2px solid #2279c5; outline-offset: 3px; }
.assistant-head :focus-visible { outline-color: var(--brand-ice); }

@media (max-width: 420px) {
  .site-assistant { width: auto; inset-inline: 10px; }
  .assistant-log { max-height: 34dvh; }
}
