.has-abba-chat .footer { padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }

.abba-chat-launcher,
.abba-chat-dialog {
  --chat-edge: max(.95rem, env(safe-area-inset-right, 0px));
  --chat-gap: max(.95rem, env(safe-area-inset-bottom, 0px));
  font-family: var(--sans);
}

.abba-chat-launcher {
  position: fixed;
  z-index: 8;
  right: var(--chat-edge);
  bottom: var(--chat-gap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .57rem;
  min-height: 3rem;
  padding: .62rem 1.05rem;
  color: #fff;
  background: var(--pine);
  border: 1px solid #9eb69b;
  border-radius: 3rem;
  box-shadow: 0 4px 16px #0a30292b;
  font-weight: 590;
  font-size: .95rem;
  line-height: 1;
}

.abba-chat-launcher:hover,
.abba-chat-compose button:hover { background: #205148; }
.abba-chat-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 15px;
  border: 1.7px solid var(--accent);
  border-radius: 5px 5px 5px 1px;
}
.abba-chat-icon::before,
.abba-chat-icon::after {
  content: '';
  position: absolute;
  height: 1.5px;
  left: 3px;
  background: var(--accent);
}
.abba-chat-icon::before { width: 9px; top: 4px; }
.abba-chat-icon::after { width: 6px; top: 7.5px; }

.abba-chat-dialog {
  position: fixed;
  inset: auto var(--chat-edge) calc(var(--chat-gap) + var(--chat-bottom-inset, 0px)) auto;
  margin: 0;
  padding: 0;
  width: min(24rem, calc(100% - var(--chat-edge) - .8rem));
  height: min(35rem, calc(var(--chat-visible-height, 100dvh) - var(--chat-gap) - 1rem));
  max-width: none;
  max-height: none;
  background: var(--paper);
  color: var(--text);
  border: 1px solid #bdcfbf;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 12px 54px #0a302942;
  font-size: 1rem;
  line-height: 1.5;
}
.abba-chat-dialog[open] { display: flex; flex-direction: column; }
.abba-chat-dialog::backdrop { background: #102e262b; }

.abba-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: .95rem 1.15rem 1.05rem;
  background: var(--pine);
  color: white;
}
.abba-chat-head h2 { font: 400 2.05rem/1.05 var(--serif); letter-spacing: -.025em; }
.abba-chat-head p { color: #dfedcf; font-size: .87rem; margin-top: .22rem; }
.abba-chat-close {
  align-self: flex-start;
  border: 1px solid #73978a;
  border-radius: 50%;
  padding: 0;
  width: 2.75rem;
  height: 2.75rem;
  background: transparent;
  color: white;
  font-size: 1.65rem;
  line-height: 1;
}
.abba-chat-close:hover { background: #285449; }
.abba-chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.1rem;
  scrollbar-width: thin;
}
.abba-chat-greeting { color: var(--text); font-weight: 520; line-height: 1.45; }
.abba-chat-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .48rem; margin-top: .8rem; }
.abba-chat-choices button {
  text-align: start;
  min-height: 2.75rem;
  border-radius: .5rem;
  border: 1px solid #a4bba7;
  padding: .48rem .64rem;
  background: white;
  color: var(--pine);
  font-size: .9rem;
  line-height: 1.35;
}
.abba-chat-choices button:hover { background: #edf4e6; border-color: #648368; }
.abba-chat-turn { margin-top: 1.1rem; }
.abba-chat-asked,
.abba-chat-reply {
  border-radius: .75rem;
  padding: .67rem .78rem;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.abba-chat-asked {
  margin-left: auto;
  max-width: 90%;
  width: fit-content;
  color: #214634;
  background: #dceccf;
  border-bottom-right-radius: .18rem;
}
.abba-chat-reply { color: var(--text); background: #fff; border: 1px solid var(--line); margin: .45rem 0 0; border-top-left-radius: .18rem; }
.abba-chat-links { display: flex; flex-wrap: wrap; gap: .25rem .8rem; padding: .35rem .12rem; }
.abba-chat-links a,
.abba-chat-contact {
  color: #27583c;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .2em;
  font-size: .89rem;
}
.abba-chat-links a { padding: .25rem 0; }
.abba-chat-bottom { flex: none; border-top: 1px solid var(--line); padding: .62rem 1rem .9rem; background: white; }
.abba-chat-contact { display: inline-block; margin-bottom: .35rem; padding: .18rem 0; }
.abba-chat-compose { display: flex; gap: .5rem; }
.abba-chat-compose input {
  display: block;
  min-width: 0;
  flex: 1;
  border: 1px solid #a4bba7;
  border-radius: .4rem;
  padding: .59rem .65rem;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}
.abba-chat-compose button {
  min-height: 2.75rem;
  border: 0;
  border-radius: .4rem;
  padding: .5rem .8rem;
  font-weight: 580;
  background: var(--pine);
  color: #fff;
}
.abba-chat-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 400px) {
  .abba-chat-dialog { --chat-edge: max(.5rem, env(safe-area-inset-right, 0px)); --chat-gap: max(.5rem, env(safe-area-inset-bottom, 0px)); width: calc(100% - var(--chat-edge) - .5rem); }
}
@media (max-height: 440px) {
  .abba-chat-head { padding-block: .45rem; }
  .abba-chat-head h2 { font-size: 1.45rem; }
  .abba-chat-bottom { padding-block: .35rem; }
}
@media print {
  .abba-chat-launcher, .abba-chat-dialog { display: none !important; }
  .has-abba-chat .footer { padding-bottom: 1.5rem; }
}
