:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #202b24;
  background: #fcf3e4;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: clamp(0.625rem, 1.1vw, 1rem);
}

.support {
  display: flex;
  flex-direction: column;
  height: calc(100vh - clamp(1.25rem, 2.2vw, 2rem));
  height: calc(100dvh - clamp(1.25rem, 2.2vw, 2rem));
  min-height: 20rem;
  overflow: hidden;
  border: 1px solid #9eb591;
  border-radius: clamp(1.1rem, 2.4vw, 2.25rem);
  background: #faf7f0;
}

.masthead {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: 0 0 clamp(5rem, 15.2vh, 9.5rem);
  overflow: hidden;
  padding: 0.5rem;
  color: #fffef9;
  background: linear-gradient(135deg, #225b37, #174a2c 70%, #215d38);
}

.masthead::before,
.masthead::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 42%;
  height: 125%;
  border-radius: 55%;
  border-top: 0.55rem solid #8eb98233;
  transform: rotate(-13deg);
  pointer-events: none;
}

.masthead::before {
  left: -8%;
  top: 39%;
}

.masthead::after {
  right: -17%;
  top: 43%;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.35vw, 3.75rem);
  font-weight: 800;
  letter-spacing: 0.015em;
  text-align: center;
  line-height: 1.2;
}

.conversation {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  background: #faf7f0;
}

.transcript {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 3.2vw, 3rem);
  scrollbar-color: #a4b699 #faf7f0;
  text-align: start;
}

.message {
  flex: none;
  max-width: min(45rem, 85%);
  border-radius: 1.1rem 1.1rem 1.1rem 0.3rem;
  padding: 0.7em 0.95em;
  font-size: clamp(1rem, 2.2vw, 1.95rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.support-message {
  background: #dce9ce;
}

.user-message {
  align-self: flex-end;
  color: #fff;
  background: #215d38;
  border-radius: 1.1rem 1.1rem 0.3rem 1.1rem;
}

.support-message a {
  color: #175238;
  text-underline-offset: 0.15em;
}

.composer {
  display: flex;
  flex: none;
  gap: clamp(0.5rem, 1vw, 0.9rem);
  padding: 0.6rem clamp(0.7rem, 1.6vw, 1.45rem) max(0.9rem, env(safe-area-inset-bottom));
}

.composer input,
.composer button {
  min-height: 3rem;
  min-height: clamp(3rem, 6.6vh, 4.8rem);
  font: inherit;
  font-size: clamp(1rem, 2.15vw, 1.75rem);
  border-radius: clamp(0.65rem, 1.25vw, 1.1rem);
}

.composer input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45em 0.85em;
  color: #202b24;
  background: #fffdf8;
  border: 1px solid #93ab89;
}

.composer input::placeholder {
  color: #676d68;
}

.composer button {
  flex: none;
  padding-inline: clamp(1rem, 3.7vw, 3.5rem);
  border: 1px solid #215d38;
  color: #fff;
  background: #215d38;
  font-weight: 700;
  cursor: pointer;
}

.composer button:hover {
  background: #15482a;
}

:focus-visible {
  outline: 2px solid #35694a;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 38rem) {
  .message {
    max-width: 92%;
  }
}
