.school-assistant {
  --school-assistant-teal: #087f80;
  --school-assistant-ink: #18333d;
  --school-assistant-muted: #647782;
  --school-assistant-border: #dce8e9;
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1040;
  font-family: inherit;
}

.school-assistant button,
.school-assistant input,
.school-assistant textarea {
  font: inherit;
}

.school-assistant-launcher,
.school-assistant-close,
.school-assistant-service,
.school-assistant-choice,
.school-assistant-submit,
.school-assistant-secondary {
  cursor: pointer;
}

.school-assistant-launcher {
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #0a9290, #086873);
  box-shadow: 0 0.65rem 1.8rem rgb(9 83 89 / 28%);
  font-size: 1.45rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.school-assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.85rem 2rem rgb(9 83 89 / 34%);
}

.school-assistant-launcher i {
  font-size: inherit;
}

.school-assistant-submit:hover {
  background: #066c6d;
}

.school-assistant-launcher:focus-visible,
.school-assistant button:focus-visible,
.school-assistant input:focus-visible,
.school-assistant textarea:focus-visible {
  outline: 3px solid rgba(8, 127, 128, .35);
  outline-offset: 2px;
}

.school-assistant-panel {
  position: absolute;
  left: 0;
  bottom: 4.5rem;
  display: flex;
  flex-direction: column;
  width: min(23.5rem, calc(100vw - 2rem));
  height: min(39rem, calc(100dvh - 7rem));
  min-height: min(25rem, calc(100dvh - 7rem));
  overflow: hidden;
  border: 1px solid rgb(220 232 233 / 90%);
  border-radius: 1.3rem;
  background: #fff;
  box-shadow: 0 1.2rem 3.5rem rgb(15 43 53 / 23%);
  transform: scale(0.12);
  opacity: 0;
  transform-origin: bottom left;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
}
::-webkit-scrollbar {
  width: 2px;
}
.school-assistant-panel[hidden] {
  display: none;
}

.school-assistant.is-open .school-assistant-panel {
  transform: scale(1);
  opacity: 1;
}

.school-assistant-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 4.5rem;
  padding: 0.8rem 0.95rem;
  color: #fff;
  background: linear-gradient(110deg, #087f80, #145d6b);
}

.school-assistant-avatar {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  font-size: 1.2rem;
}

.school-assistant-heading {
  flex: 1;
  min-width: 0;
}

.school-assistant-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.school-assistant-heading span {
  display: block;
  margin-top: 2px;
  color: rgb(255 255 255 / 84%);
  font-size: .72rem;
}

.school-assistant-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #9df1c7;
  vertical-align: 1px;
}

.school-assistant-close {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 13%);
  font-size: 1.1rem;
}

.school-assistant-close:hover {
  background: rgb(255 255 255 / 24%);
}

.school-assistant-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.85rem 4.5rem;
  background:
    radial-gradient(ellipse at top left, rgba(214, 239, 237, .4), transparent 60%),
    #f3f7f7;
  overscroll-behavior: contain;
}

.school-assistant-message {
  display: flex;
  margin: 0 0 12px;
  animation: school-assistant-message-in 160ms ease-out both;
}

.school-assistant-message--user {
  justify-content: flex-end;
}

.school-assistant-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border: 1px solid var(--school-assistant-border);
  border-radius: 15px 15px 15px 5px;
  color: var(--school-assistant-ink);
  background: #fff;
  font-size: .88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.school-assistant-message--user .school-assistant-bubble {
  border-color: #c5e6df;
  border-radius: 15px 15px 5px 15px;
  color: var(--school-assistant-ink);
  background: #e1f4ed;
}

.school-assistant-bubble--typing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 54px;
  min-height: 38px;
}

.school-assistant-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #84979d;
  animation: school-assistant-typing 1.1s infinite ease-in-out;
}

.school-assistant-typing-dot:nth-child(2) {
  animation-delay: 140ms;
}

.school-assistant-typing-dot:nth-child(3) {
  animation-delay: 280ms;
}

.school-assistant-bubble--review {
  width: 100%;
}

.school-assistant-services,
.school-assistant-choices {
  display: grid;
  gap: 8px;
}

.school-assistant-service,
.school-assistant-choice {
  width: 100%;
  border: 1px solid var(--school-assistant-border);
  border-radius: 13px;
  color: var(--school-assistant-ink);
  background: #fff;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.school-assistant-service {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 62px;
  column-gap: 9px;
  padding: 11px 12px;
}

.school-assistant-service > i {
  grid-row: span 2;
  color: var(--school-assistant-teal);
  font-size: 18px;
}

.school-assistant-service-title {
  font-size: .88rem;
  font-weight: 750;
}

.school-assistant-service small {
  margin-top: 3px;
  color: var(--school-assistant-muted);
  font-size: .74rem;
  line-height: 1.35;
}

.school-assistant-service:hover,
.school-assistant-choice:hover {
  border-color: var(--school-assistant-teal);
  background: #f0f9f8;
}

.school-assistant-choice {
  padding: 9px 11px;
  font-size: .83rem;
}

.school-assistant-choice[aria-pressed="true"] {
  border-color: var(--school-assistant-teal);
  color: #fff;
  background: var(--school-assistant-teal);
}

.school-assistant-service:disabled,
.school-assistant-choice:disabled {
  border-color: #e2e8e9;
  color: #77868b;
  background: #f0f3f3;
  cursor: not-allowed;
  opacity: .72;
}

.school-assistant-choice[aria-pressed="true"]:disabled {
  border-color: #a9c5c6;
  color: #526a70;
  background: #dce8e9;
}

.school-assistant-choices--topics {
  max-height: 200px;
  overflow-y: auto;
}

.school-assistant-footer {
  flex: 0 0 auto;
}

.school-assistant-form {
  display: grid;
  gap: 9px;
}

.school-assistant-skip {
  display: table;
  align-items: center;
  min-height: 30px;
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid #b7d9d7;
  border-radius: 999px;
  color: var(--school-assistant-teal);
  background: #f7ffff;
  font-size: .82rem;
  font-weight: 700;
}

.school-assistant-skip:hover {
  background: #f0f9f8;
}

.school-assistant-bubble--choices {
  width: 100%;
  max-width: 100%;
}

.school-assistant-bubble--choices .school-assistant-form {
  width: 100%;
}

.school-assistant-message--user .school-assistant-bubble--input {
  width: min(100%, 20rem);
  max-width: 100%;
}

.school-assistant-bubble--input .school-assistant-form {
  width: 100%;
}

.school-assistant-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9d8da;
  border-radius: 12px;
  color: var(--school-assistant-ink);
  background: #fff;
  font-size: .9rem;
}

.school-assistant-field:focus {
  border-color: var(--school-assistant-teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(8,127,128,.12);
}

.school-assistant-field[rows] {
  resize: none;
  max-height: 128px;
  overflow-y: hidden;
}

.school-assistant-hint {
  margin: 0;
  font-size: .78rem;
}

.school-assistant-hint {
  color: var(--school-assistant-muted);
}

.school-assistant-message--error .school-assistant-bubble {
  border: 1px solid #f3c4bf;
  color: #8f2118;
  background: #fff4f2;
}

.school-assistant-submit,
.school-assistant-secondary {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--school-assistant-teal);
  border-radius: 999px;
  color: #fff;
  background: var(--school-assistant-teal);
  font-size: .86rem;
  font-weight: 700;
}

.school-assistant-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 52px;
  width: fit-content;
  padding-inline: 14px;
}

.school-assistant-primary {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 2;
  box-shadow: 0 0.35rem 1rem rgb(9 83 89 / 24%);
}

.school-assistant-primary:disabled {
  cursor: wait;
  opacity: .65;
}

.school-assistant-submit i {
  font-size: .9rem;
}

.school-assistant-secondary {
  color: var(--school-assistant-teal);
  background: #fff;
}

.school-assistant-secondary:hover {
  background: #f0f9f8;
}

.school-assistant-review {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin: 0;
}

.school-assistant-review dt {
  color: var(--school-assistant-muted);
  font-size: .75rem;
  font-weight: 700;
}

.school-assistant-review dd {
  margin: 0 0 7px;
  font-size: .84rem;
}

.school-assistant-review-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.school-assistant-pricing {
  width: 100%;
  max-width: 100%;
}

.school-assistant-pricing > strong {
  display: block;
  margin-bottom: 8px;
}

.school-assistant-pricing-lines {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.school-assistant-pricing-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--school-assistant-border);
  font-size: .82rem;
}

.school-assistant-pricing-lines li small {
  grid-column: 1 / -1;
  color: var(--school-assistant-muted);
  font-size: .74rem;
}

.school-assistant-cost-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 0 0;
  font-size: .84rem;
}

.school-assistant-cost-row--total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--school-assistant-teal);
  font-size: .96rem;
}

.school-assistant-payment-summary {
  margin: 10px 0 0;
  color: var(--school-assistant-muted);
  font-size: .82rem;
}

.school-assistant-review-content > p {
  margin-bottom: 10px;
}

@keyframes school-assistant-message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes school-assistant-typing {
  0%, 60%, 100% { opacity: .4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 480px) {
  .school-assistant {
    left: max(0.75rem, env(safe-area-inset-left));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .school-assistant-panel {
    width: min(23.5rem, calc(100vw - 1.5rem));
    height: min(39rem, calc(100dvh - 6.25rem));
    min-height: min(24rem, calc(100dvh - 6.25rem));
    bottom: 4.35rem;
  }

  .school-assistant-launcher {
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .school-assistant,
  .school-assistant-panel,
  .school-assistant-message {
    transition: none;
    animation: none;
  }

  .school-assistant-typing-dot {
    animation: none;
  }
}
