* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font:
    16px -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: #eeeee8;
  color: #192a24;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #548e63;
  outline-offset: 3px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px clamp(12px, 4vw, 58px);
  border-bottom: 1px solid #d4d8ce;
  background: #f7f7f2;
}
header strong {
  letter-spacing: -0.05em;
  font-size: 21px;
}
nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #e1e5dc;
  border-radius: 14px;
}
nav button,
.quiet {
  border: 0;
  background: none;
  color: #43534a;
  font-size: 14px;
  font-weight: 600;
  border-radius: 11px;
  padding: 8px 14px;
}
nav button[aria-pressed="true"] {
  background: white;
  color: #142e21;
  box-shadow: 0 1px 3px #0002;
}
.quiet {
  text-decoration: underline;
  text-underline-offset: 3px;
}
main {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px;
}
#phone {
  position: relative;
  aspect-ratio: 1406 / 2822;
  width: min(430px, 100%, calc((100dvh - 111px) * 0.49823));
  filter: drop-shadow(0 6px 8px #17252920);
}
.screen {
  position: absolute;
  inset: 3.47% 7%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: 15.5% / 7.2%;
}
.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.status {
  height: 6.2%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7%;
  color: #17191b;
  font-size: 13px;
}
.contact {
  display: grid;
  place-items: center;
  gap: 3px;
  background: #f6f6f5;
  padding: 7px 8px 10px;
  border-bottom: 1px solid #e1e2df;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #205641;
  color: white;
  font-weight: 700;
  font-size: 23px;
}
.contact small,
.team-head p {
  color: #5d6b63;
  font-size: 12px;
}
#chat {
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding: 13px 12px;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  flex: none;
  align-self: flex-start;
  max-width: 87%;
  background: #ebebe9;
  color: #191c1b;
  border-radius: 18px 18px 18px 5px;
  padding: 9px 13px;
  line-height: 1.34;
  animation: appear 0.19s ease-out;
}
.bubble.user {
  background: #298548;
  color: #fff;
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
}
.bubble a,
.review {
  color: #12623c;
  text-underline-offset: 3px;
}
.review {
  align-self: center;
  font-size: 12px;
  padding: 5px;
}
.home {
  height: 4px;
  width: 92px;
  border-radius: 10px;
  background: #1e211e;
  align-self: center;
  flex: none;
  margin: 4px 0 5px;
}
form {
  margin: 6px 10px;
  display: flex;
  border: 1px solid #cbd0c9;
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
}
input {
  border: 0;
  min-width: 0;
  flex: 1;
  background: transparent;
  padding: 3px 9px;
}
form button,
#accept {
  background: #205b42;
  color: white;
  border: 0;
}
form button {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}
footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 1px 12px 6px;
  align-items: center;
  font-size: 11px;
  color: #495750;
}
#notice:empty {
  display: none;
}
#notice:not(:empty) {
  background: #fff6cd;
  padding: 3px 8px;
  border-radius: 8px;
}
#team {
  width: min(700px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
.team-head small {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
}
.team-head h1 {
  font-size: 42px;
  letter-spacing: -0.065em;
  margin: 3px 0;
}
.team-head p {
  margin: 0 0 15px;
}
.sheet,
details {
  background: white;
  border-radius: 16px;
  border: 1px solid #d9ded5;
  padding: 19px 22px;
  margin: 9px 0;
}
.case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.case-head b {
  font-size: 20px;
  letter-spacing: -0.04em;
}
#badge {
  font-size: 12px;
  background: #eff3e9;
  padding: 5px 9px;
  border-radius: 20px;
  font-weight: 600;
}
#details p {
  margin: 12px 0;
  line-height: 1.3;
}
#details small {
  display: block;
  font-size: 11px;
  color: #657569;
  margin-bottom: 3px;
}
#decisions button {
  border-radius: 9px;
  border: 1px solid #a8b8ab;
  padding: 8px 15px;
  font-weight: 600;
  margin-right: 6px;
}
#decline {
  background: white;
  color: #33483b;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
#history {
  max-height: 180px;
  overflow: auto;
}
#history p {
  line-height: 1.35;
  margin: 10px 0;
  font-size: 14px;
}
#history b {
  display: block;
  font-size: 11px;
  color: #637068;
}
#phone[hidden],
section[hidden],
[hidden] {
  display: none !important;
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@keyframes appear {
  from {
    transform: translateY(4px);
    opacity: 0.4;
  }
}
@media (max-width: 540px) {
  header {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 7px 10px;
  }
  header strong {
    font-size: 15px;
  }
  nav {
    grid-row: 2;
    grid-column: 1/-1;
    justify-self: center;
  }
  main {
    padding: 5px;
  }
  .quiet {
    grid-column: 2;
    grid-row: 1;
    padding: 3px 5px;
  }
  nav button {
    padding: 5px 13px;
  }
}
@media (max-height: 510px) {
  header {
    display: flex;
    padding: 3px 8px;
  }
  .contact {
    display: flex;
    justify-content: center;
    padding: 4px;
    gap: 8px;
  }
  .avatar {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
  .status {
    height: 20px;
  }
  main {
    padding: 3px;
  }
  .team-head h1 {
    font-size: 23px;
  }
  .team-head p {
    margin-bottom: 3px;
  }
  .sheet,
  details {
    padding: 8px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

/* On small screens the conversation uses the device the visitor is holding. */
@media (max-width: 540px), (max-height: 670px) {
  #phone {
    width: min(550px, 100%);
    height: 100%;
    aspect-ratio: auto;
  }
  .screen {
    inset: 0;
    border-radius: 15px;
  }
  .device-frame,
  .status,
  .home {
    display: none;
  }
  #compose {
    margin-bottom: max(9px, env(safe-area-inset-bottom));
  }
}

.studio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.studio img {
  background: #172529;
  border-radius: 5px;
}
.studio:hover,
.studio:focus-visible {
  text-decoration: underline;
}
.avatar {
  font-size: 15px;
}

#decisions label {
  display: block;
  font-size: 12px;
  color: #455448;
  margin-bottom: 4px;
}
#confirmedTime {
  display: block;
  border: 1px solid #a8b8ab;
  border-radius: 7px;
  padding: 6px 9px;
  width: min(100%, 280px);
  margin-bottom: 9px;
}
