html, body {
  height: 100%;
  overflow: hidden;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0, #292a30, #101014 70%);
  color: #f2f2f4;
  font: 14px system-ui, sans-serif;
}
main {
  width: min(100%, 420px);
  height: 100dvh;
  margin: 0;
  background: #0f0f12;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px #0008;
}
.hero {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid #ffffff0d;
  background: #121216;
}
.portrait {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 0 0 2px #ffffff18;
}
.hero-content {
  min-width: 0;
  flex: 1;
}
h1 {
  font-size: 16px;
  letter-spacing: .8px;
  margin: 0;
  font-weight: 700;
}
.presence {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a9a9b0;
  font-size: 12px;
  margin: 3px 0 0;
}
.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}
.presence.offline .presence-dot, .presence.blocked .presence-dot {
  background: #707077;
  box-shadow: none;
}
.debug-link {
  border: 1px solid #ffffff24;
  border-radius: 8px;
  background: transparent;
  color: #bbb;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
}
.auth {
  flex: 1;
  padding: 32px 22px;
  color: #bbb;
}
.auth p {
  line-height: 1.55;
}
#app:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 18px;
  overscroll-behavior: contain;
  background: linear-gradient(#0f0f12, #111116);
}
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  margin: 0 0 14px;
}
.message.you {
  align-items: flex-end;
  margin-left: auto;
}
.message.jane {
  align-items: flex-start;
}
.message.system {
  align-items: stretch;
  max-width: none;
  margin: 4px 0 18px;
}
.message.image-message {
  width: fit-content;
  max-width: min(80%, 280px);
}
.bubble {
  position: relative;
  padding: 10px 13px;
  border-radius: 18px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.you .bubble {
  padding-right: 38px;
  background: #0f9d6f;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.jane .bubble {
  background: #24242a;
  color: #f2f2f4;
  border-bottom-left-radius: 5px;
}
.system .bubble {
  width: 100%;
  border: 1px solid #ef4444;
  background: transparent;
  color: #fca5a5;
  border-radius: 10px;
  text-align: center;
}
.label {
  font-size: 10px;
  color: #81818a;
  margin: 0 5px 4px;
}
.system .label {
  display: none;
}
.receipt {
  position: absolute;
  right: 11px;
  bottom: 8px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: -3px;
}
.typing-message .bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  height: 38px;
  padding: 0 14px;
}
.typing-message i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9a9b0;
  animation: typing 1.2s infinite ease-in-out;
}
.typing-message i:nth-child(2) {
  animation-delay: .15s;
}
.typing-message i:nth-child(3) {
  animation-delay: .3s;
}
@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: .45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.message-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 360px;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  background: #24242a;
}
.trace-button {
  display: block;
  margin: 6px 3px 0;
  padding: 4px 9px;
  border: 1px solid #ffffff1c;
  border-radius: 999px;
  background: #ffffff0a;
  color: #9a9aa2;
  font-size: 10.5px;
  cursor: pointer;
}
.trace-button:hover {
  color: #f2f2f4;
  border-color: #ffffff38;
}
.composer {
  flex: none;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid #ffffff0b;
  background: #121216;
}
form {
  display: flex;
  gap: 9px;
  align-items: center;
}
input {
  min-width: 0;
  flex: 1;
  height: 48px;
  padding: 0 17px;
  border: 1px solid #ffffff1f;
  border-radius: 24px;
  background: #1b1b20;
  color: #f2f2f4;
  font: inherit;
  outline: none;
}
input:focus {
  border-color: #34d399;
}
button {
  font: inherit;
}
form button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #0f9d6f;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
button:disabled {
  opacity: .55;
  cursor: wait;
}
.toast {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%) translateY(8px);
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border-radius: 9px;
  background: #27272d;
  color: #fff;
  box-shadow: 0 8px 28px #0008;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#status {
  min-height: 0;
  margin: 0;
  font-size: 0;
}
[hidden] {
  display: none!important;
}
@media(max-width:520px) {
  .chat {
    padding: 18px 13px;
  }
  .hero {
    padding: 12px 14px;
  }
  .composer {
    padding-left: 12px;
    padding-right: 12px;
  }
}
