body {
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(15, 110, 107, .16), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 100%, rgba(196, 92, 38, .1), transparent 50%),
    var(--bg);
}
#blocked-view { height: 100vh; height: 100dvh; }
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  background: #f7f4ef;
  position: relative;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(135deg, #176e69 0%, #0f564f 100%);
  color: #fff;
  flex: none;
}
.chat-header .avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.head-info { flex: 1; min-width: 0; }
.agent-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-status { font-size: 12px; color: rgba(255, 255, 255, .78); min-height: 16px; margin-top: 2px; }
#agent-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
  vertical-align: 1px;
}
#agent-status.on { color: #d1fae5; }
#agent-status.on::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .28); }
.typing { color: #d1fae5; }
.sound-toggle {
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  flex: none;
}
.sound-toggle:hover { background: rgba(255, 255, 255, .2); }
.sound-toggle[aria-pressed=false] { color: rgba(255, 255, 255, .65); }
.conn-banner { background: #fef3c7; color: #92400e; text-align: center; padding: 6px 8px; font-size: 12px; flex: none; }
.messages { flex: 1; min-height: 0; }
.composer {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tool-btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #44403c;
}
.tool-btn:hover { background: #fff; border-color: #d6cfc4; }
.upload-state { color: var(--accent); font-size: 12px; }
.counter { margin-left: auto; color: var(--faint); font-size: 12px; }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-row textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  line-height: 1.45;
  font-size: 16px;
  border-radius: 18px;
  background: var(--bg-2);
  border-color: transparent;
  padding: 10px 14px;
}
.input-row textarea:focus { background: #fff; border-color: #8fd0cb; }
.send-btn { height: 40px; flex: none; border-radius: 999px; padding: 0 18px; }
@media (min-width: 800px) {
  .chat-app {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    margin: 24px auto;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 24px 60px rgba(28, 25, 23, .14);
  }
  .input-row textarea { font-size: 14px; }
}
