:root {
  color: #172820;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  --green: #176448;
  --forest: #153e30;
  --ink: #172820;
  --muted: #4d6257;
  --tint: #e7f4eb;
  --paper: #f6f9f6;
  --border: #d4e1d9;
  --error: #9a3935;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
:focus-visible { outline: 2px solid #20825b; outline-offset: 2px; }
p, h1, h2 { margin: 0; }
a { color: var(--green); }
.visually-hidden, .notice:empty, #send-status:empty, .message[data-grouped] h2 {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.launcher {
  position: absolute;
  inset: auto 6px 6px auto;
  inline-size: 94px;
  block-size: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 100px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 2px 8px #143e303c;
  font-weight: 650;
}
.launcher:hover { background: var(--green); }
.unread-badge {
  position: absolute;
  inset: 0 0 auto auto;
  min-inline-size: 1.3rem;
  padding: 2px 5px;
  border-radius: 100px;
  background: #d5efb1;
  color: #173e2a;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.2;
}
.chat-icon {
  position: relative;
  inline-size: 18px;
  block-size: 15px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
}
.chat-icon::after {
  content: "";
  position: absolute;
  inset: auto auto -3px 3px;
  inline-size: 4px;
  block-size: 4px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  background: inherit;
  transform: skewY(-30deg);
}

.panel {
  position: absolute;
  inset: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c7d8ce;
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 3px 12px #173b3229;
  transform-origin: right bottom;
}
@media (prefers-reduced-motion: no-preference) {
  .panel[data-motion] {
    transition: opacity 190ms ease-out, transform 260ms cubic-bezier(.2, .75, .25, 1);
  }
  .panel[data-motion][data-closing] {
    opacity: 0;
    transform: scale(.96);
    transition-duration: 165ms;
    transition-timing-function: ease-in;
  }
  @starting-style {
    .panel[data-motion]:not([data-closing]) {
      opacity: 0;
      transform: scale(.96);
    }
  }
}
.panel-head {
  flex: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  background: var(--forest);
  color: #fff;
}
.panel-head h1 { font-size: 1rem; overflow-wrap: anywhere; }
.panel-head p { font-size: .78rem; color: #d0e9da; }
.team-mark {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--forest);
  font-weight: 700;
}
.minimize {
  display: grid;
  place-items: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
}
.minimize:hover { background: #ffffff20; }
.minimize:focus-visible { outline-color: #e1f5e7; outline-offset: -2px; }
.minimize span {
  inline-size: 14px;
  block-size: 8px;
  border-bottom: 2px solid currentColor;
}

.intro { min-block-size: 0; overflow: auto; padding: 18px; scroll-padding: 12px; }
.intro h2 { margin-block-end: 4px; font-size: 1.32rem; line-height: 1.2; }
.intro p { color: var(--muted); font-size: .875rem; }
.intro form { display: grid; gap: 10px; margin-block: 14px 12px; }
.start-attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.start-attachment small { color: var(--muted); font-size: .75rem; }
.field { display: grid; gap: 4px; }
label { font-weight: 650; font-size: .82rem; }
input, textarea {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 9px 11px;
  border: 1px solid #a7baaf;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.42;
}
textarea { resize: vertical; max-block-size: 115px; }
[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: .76rem; }
.privacy-note { color: var(--muted); font-size: .76rem; }
@media (max-width: 340px) {
  .intro { padding: 14px; }
  .intro form { gap: 8px; margin-block: 12px 9px; }
  .field { gap: 3px; }
}

.primary, .secondary {
  min-block-size: 44px;
  padding: 9px 13px;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
  color: #fff;
  font-weight: 650;
}
.primary:hover:not(:disabled) { background: var(--green); }
.secondary { background: var(--tint); color: var(--forest); }
.secondary:hover:not(:disabled) { background: #d6ebdd; }

.notice { flex: none; padding: 8px 16px; background: #f6edda; color: #53401d; font-size: .82rem; overflow-wrap: anywhere; }
.conversation { display: flex; flex: 1; min-block-size: 0; flex-direction: column; }
.thread { position: relative; display: flex; flex: 1; min-block-size: 0; }
.messages {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-block-size: 0;
  min-inline-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  scroll-padding: 14px;
}
.messages > :first-child { margin-block-start: auto; }
.messages:focus-visible { outline-offset: -2px; }
.greeting, .day-divider { align-self: center; color: var(--muted); font-size: .8rem; }
.day-divider { flex: none; margin-block: 3px 12px; font-weight: 650; }
.message { flex: none; align-self: flex-start; max-inline-size: 90%; margin-block-end: 11px; }
.message.visitor { align-self: flex-end; }
.message:has(+ .message[data-grouped]) { margin-block-end: 4px; }
.message[data-grouped] .message-meta { margin-block-end: 1px; }
.message-meta { display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: baseline; margin-block-end: 3px; }
.message.visitor .message-meta { justify-content: end; }
.message h2 { font-size: .75rem; font-weight: 650; overflow-wrap: anywhere; }
.message time { font-size: .7rem; color: var(--muted); }
.message-text {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 11px 11px 11px 3px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .94rem;
}
.message.visitor .message-text { border-color: #cfe5d8; border-radius: 11px 11px 3px 11px; background: var(--tint); }
.attachment-card {
  display: grid;
  gap: 7px;
  min-inline-size: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: .83rem;
}
.message-text + .attachment-card { margin-block-start: 5px; }
.attachment-card strong, .file-selection span { min-inline-size: 0; overflow-wrap: anywhere; }
.attachment-card small { color: var(--muted); }
.attachment-card img, .attachment-card audio, .attachment-card video {
  display: block;
  max-inline-size: 100%;
}
.attachment-card img, .attachment-card video { max-block-size: 230px; border-radius: 6px; object-fit: contain; }
.attachment-card img { block-size: auto; }
.attachment-card video, .attachment-card audio { inline-size: 100%; }
.attachment-actions { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.attachment-actions button, .jump-latest {
  min-block-size: 44px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  color: var(--forest);
  font-size: .78rem;
  font-weight: 650;
}
.jump-latest {
  position: absolute;
  inset: auto 50% 9px auto;
  translate: 50% 0;
  white-space: nowrap;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 2px 8px #143e303c;
}
.jump-latest:hover { background: var(--green); }
.typing { margin: 0 14px 6px; font-size: .8rem; color: var(--muted); }
.typing:empty { margin: 0; }

.composer, .closed { flex: none; background: #fff; padding: 10px 12px; border-block-start: 1px solid var(--border); }
.message-bar { display: flex; align-items: end; gap: 8px; }
.message-bar textarea { flex: 1; field-sizing: content; }
.send-button { inline-size: 44px; padding: 0; font-size: 1.25rem; }
.file-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-inline-start: 10px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--forest);
  font-size: .8rem;
}
.composer .file-selection { margin-block-end: 8px; }
.attach-button, .icon-button {
  min-block-size: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  color: var(--forest);
  font-weight: 650;
  font-size: .8rem;
}
.attach-button span, .icon-button { font-size: 1.2rem; }
.icon-button { min-inline-size: 44px; }
.icon-button:hover, .attach-button:hover, .attachment-actions button:hover { background: #d6ebdd; }
form[data-file-drag] { outline: 2px dashed var(--green); outline-offset: -2px; }
#upload-progress { display: block; inline-size: 100%; margin-block-end: 7px; accent-color: var(--green); }
.send-feedback { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#send-status:not(:empty) { margin-block-start: 6px; color: var(--muted); font-size: .78rem; }
#send-status[data-error] { color: var(--error); }
.retry-send { min-block-size: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--green); font-weight: 650; }
.closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.closed p { font-size: .85rem; }

.privacy { margin: 2rem auto; padding: 0 1rem; max-width: 42rem; background: var(--paper); }
.privacy h1 { font-weight: 650; margin-block: 1rem; }
.privacy h2 { font-size: 1rem; margin-block: 1.3rem .3rem; }
