:root {
  --bg: #e7edf1;
  --surface: #ffffff;
  --surface-soft: #f5f8fa;
  --surface-strong: #edf3f5;
  --line: #d7e1e8;
  --text-main: #172033;
  --text-soft: #607184;
  --text-dim: #8b9aaa;
  --accent: #0f766e;
  --accent-strong: #0b5e59;
  --accent-soft: #e2f4f1;
  --incoming: #ffffff;
  --outgoing: #d9fdd3;
  --danger: #ef4444;
  --ok: #1faa59;
  --shadow: 0 18px 50px rgba(18, 30, 42, 0.16);
  --bubble-shadow: 0 1px 2px rgba(18, 30, 42, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --visual-height: 100dvh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text-main); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }

.app-shell {
  width: 100vw;
  height: var(--visual-height);
  overflow: hidden;
  background: var(--bg);
}

.panel {
  width: 100%;
  height: var(--visual-height);
  display: grid;
  grid-template-columns: clamp(340px, 27vw, 440px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
}

.inbox-column,
.chat-section {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.inbox-column {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.inbox-header {
  flex: 0 0 auto;
  padding: calc(16px + var(--safe-top)) 16px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow,
.status-label {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inbox-header h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle,
.small-text,
.agent-desc,
.conversation-meta,
.status-line,
.hint {
  color: var(--text-soft);
}

.subtitle { margin: 7px 0 0; font-size: .88rem; line-height: 1.35; }
.small-text { margin: 4px 0 0; font-size: .78rem; }

.inbox-actions { display: flex; gap: 8px; }

.header-icon,
.header-walkie {
  border: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.header-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.header-icon.dark {
  background: var(--surface-soft);
  color: var(--text-main);
}

.header-icon:hover,
.header-walkie:hover { filter: brightness(.96); }

.header-icon.notifications-on {
  color: #fff;
  background: var(--accent);
}

.header-icon.has-unread {
  color: #fff;
  background: var(--danger);
  font-size: .9rem;
  font-weight: 900;
}

.agent-section {
  flex: 0 0 auto;
  min-height: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.agent-list {
  max-height: min(36vh, 360px);
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 4px 1px 1px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.agent-list::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.attachments-list::-webkit-scrollbar { width: 10px; height: 10px; }

.agent-list::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.attachments-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(96, 113, 132, .35);
  background-clip: content-box;
}

.agent-pill {
  --agent-color: var(--accent);
  width: 100%;
  min-width: 0;
  min-height: 62px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  padding: 9px 10px 9px 8px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  background: var(--surface);
  color: var(--text-main);
  text-align: left;
}

.agent-pill:hover,
.agent-pill.active {
  border-color: var(--line);
  border-left-color: var(--agent-color);
  background: var(--surface-soft);
}

.agent-avatar-small {
  width: 38px;
  height: 38px;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--agent-color);
  font-weight: 900;
}

.agent-name,
.conversation-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.agent-desc {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}

.conversation-section {
  min-height: 0;
  flex: 1 1 auto;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  background: #fbfcfd;
}

.section-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 { margin: 0; font-size: 1.05rem; letter-spacing: 0; }

.conversation-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1px 4px 12px 1px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.conversation-item {
  position: relative;
  min-width: 0;
}

.conversation-pill {
  position: relative;
  width: 100%;
  min-height: 68px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 96px 12px 12px;
  color: var(--text-main);
  background: transparent;
  text-align: left;
}

.conversation-pill:hover,
.conversation-pill.active {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(18, 30, 42, .05);
}

.conversation-pill::after {
  content: none;
}

.conversation-meta {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}

.conversation-pill time {
  position: absolute;
  right: 88px;
  top: 13px;
  color: var(--text-dim);
  font-size: .68rem;
}

.conversation-action {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: var(--text-dim);
  background: transparent;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.conversation-rename { right: 43px; font-size: 1rem; }
.conversation-delete { right: 8px; }

.conversation-rename:hover,
.conversation-rename:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.conversation-delete:hover,
.conversation-delete:focus-visible {
  color: #991b1b;
  background: #fee2e2;
  outline: none;
}

.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 850;
}

.chat-section {
  display: flex;
  flex-direction: column;
  background: #eef4f6;
}

.chat-header {
  flex: 0 0 auto;
  min-height: 68px;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(18, 30, 42, .12);
  z-index: 2;
}

#backToInbox { display: none; }

.chat-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--accent);
  background: #fff;
  font-weight: 900;
}

.chat-title-text { min-width: 0; }

.chat-header h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.status-line {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: .76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-walkie {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  font-size: 1.1rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.header-walkie.is-active {
  background: var(--danger);
  transform: scale(.95);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .18);
}

.messages {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px clamp(22px, 3.6vw, 72px);
  background: #eef4f6;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.empty-state {
  max-width: 380px;
  margin: auto;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--text-soft);
  text-align: center;
  background: rgba(255, 255, 255, .82);
}

.message-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-row.user {
  align-self: stretch;
  justify-content: flex-end;
}

.message-row.assistant {
  align-self: stretch;
  justify-content: flex-start;
}

.message-row.grouped { margin-top: -2px; }

.message-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
}

.message-row.grouped .message-avatar { visibility: hidden; }

.message-bubble {
  position: relative;
  width: fit-content;
  min-width: 96px;
  max-width: min(76%, 980px);
  padding: 10px 44px 18px 12px;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid rgba(18, 30, 42, .06);
  background: var(--incoming);
  color: var(--text-main);
  box-shadow: var(--bubble-shadow);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.42;
  animation: fadeIn .18s ease;
}

.message-bubble.user {
  border-radius: 16px 16px 4px 16px;
  border-color: rgba(15, 118, 110, .1);
  background: var(--outgoing);
  color: #12321c;
}

.message-bubble time {
  position: absolute;
  right: 10px;
  bottom: 4px;
  font-size: .62rem;
  opacity: .62;
}

.source-pill { display: inline-flex; margin-left: 6px; opacity: .75; }

.message-attachments {
  width: min(520px, 100%);
  margin-top: 9px;
  display: grid;
  gap: 7px;
}

.image-preview-button {
  display: block;
  width: min(520px, 100%);
  min-height: 140px;
  max-height: 360px;
  margin: 2px 0 6px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .55);
  color: inherit;
  text-align: center;
}

.image-preview-button img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: rgba(18, 30, 42, .04);
}

.message-bubble.assistant .image-preview-button,
.message-bubble:not(.user) .image-preview-button { background: #e5ebef; }

.image-loading,
.image-error {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 12px;
  color: inherit;
  opacity: .8;
  font-size: .85rem;
}

.message-attachment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  font-size: .84rem;
}

.message-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment.image-link { opacity: .82; }

.attachment-preview {
  display: block;
  width: min(520px, 100%);
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
}

.composer {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -6px 24px rgba(18, 30, 42, .08);
  z-index: 3;
}

.attachments-list {
  max-height: 156px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, 100%);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: .84rem;
}

.attachment-chip.has-preview { padding: 6px 8px 6px 6px; }

.attachment-chip img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .12);
  color: inherit;
  font-weight: 900;
}

.composer-input-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 8px;
}

.plus-button,
.plane-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.plus-button { background: var(--accent); color: #fff; font-size: 1.25rem; }
.plane-button { background: transparent; color: var(--text-soft); font-size: 1rem; }
.plane-button:not(:disabled) { color: var(--accent); }

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 150px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 11px 14px;
  outline: none;
  color: var(--text-main);
  background: #fff;
  line-height: 1.35;
}

textarea:focus {
  border-color: rgba(15, 118, 110, .55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.walkie-overlay {
  position: absolute;
  inset: auto 14px calc(76px + var(--safe-bottom)) 14px;
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 32, 51, .94);
  text-align: center;
  box-shadow: var(--shadow);
}

.walkie-overlay strong,
.walkie-overlay span { display: block; }

.walkie-pulse {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.1s infinite;
}

.health-chip,
.status-dot { display: none; }

.notice-toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 8px;
  color: var(--text-main);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
  animation: fadeIn .18s ease;
}

.notice-toast strong,
.notice-toast span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-toast strong {
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: .86rem;
}

.notice-toast span {
  color: var(--text-soft);
  font-size: .84rem;
  white-space: nowrap;
}

.login-view {
  min-height: var(--visual-height);
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-form { margin-top: 20px; display: grid; gap: 10px; }

.login-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  outline: none;
}

.login-form .send-button,
.settings-buttons .send-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
}

.settings-drawer,
.install-help-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  background: rgba(23, 32, 51, .45);
  backdrop-filter: blur(4px);
}

.settings-modal,
.install-help-modal {
  width: 100%;
  padding: 24px;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.settings-modal h2,
.install-help-modal h2 { margin-top: 0; letter-spacing: 0; }
.install-help-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.install-help-text { margin: 12px 0; color: var(--text-soft); line-height: 1.45; }
.install-help-steps { margin: 0; padding-left: 22px; color: var(--text-main); line-height: 1.55; }
.install-help-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.install-help-actions .send-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
}
.settings-status-grid { display: grid; gap: 10px; margin: 14px 0; }
.settings-status-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }

.settings-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-status-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}

.settings-section label { display: block; margin-bottom: 8px; font-weight: 700; }
.settings-input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.settings-hint { color: var(--text-soft); font-size: .85rem; }
.settings-buttons { display: flex; gap: 10px; margin-top: 14px; }
.settings-buttons button { flex: 1; }

.danger-button {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  color: #991b1b;
  background: #fee2e2;
  font-weight: 850;
}

@media (min-width: 821px) {
  .app-shell { padding: 10px; }
  .panel {
    height: calc(var(--visual-height) - 20px);
    border: 1px solid rgba(18, 30, 42, .08);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  .settings-drawer,
  .install-help-drawer { align-items: center; justify-content: center; }
  .settings-modal,
  .install-help-modal { width: 440px; border-radius: 8px; }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .panel { grid-template-columns: 330px minmax(0, 1fr); }
  .messages { padding-left: 22px; padding-right: 22px; }
  .message-bubble { max-width: min(84%, 760px); }
}

@media (max-width: 820px) {
  html,
  body,
  .app-shell {
    height: var(--visual-height);
    min-height: var(--visual-height);
    overflow: hidden;
  }

  .panel {
    height: var(--visual-height);
    min-height: var(--visual-height);
    grid-template-columns: 1fr;
  }

  .chat-section { display: none; height: var(--visual-height); }
  .inbox-column { height: var(--visual-height); border-right: 0; }
  .panel[data-view="chat"] .inbox-column { display: none; }
  .panel[data-view="chat"] .chat-section { display: flex; min-height: 0; }

  .inbox-header { padding: calc(12px + var(--safe-top)) 12px 10px; }
  .inbox-header h1 { font-size: 1.45rem; }
  .subtitle { font-size: .82rem; }
  .header-icon.dark { width: 40px; height: 40px; }

  .agent-section { padding: 10px; }
  .agent-list {
    max-height: min(42vh, 340px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .agent-pill {
    min-height: 60px;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 8px;
    column-gap: 8px;
  }
  .agent-avatar-small { width: 32px; height: 32px; font-size: .82rem; }
  .agent-name { font-size: .9rem; }
  .agent-desc { font-size: .72rem; }

  .conversation-section { padding: 12px 10px 10px; }
  .conversation-pill { min-height: 64px; padding-left: 10px; padding-right: 88px; }
  .conversation-pill time { right: 82px; }
  .conversation-rename { right: 41px; }
  .conversation-delete { right: 6px; }

  .chat-header {
    position: sticky;
    top: 0;
    min-height: 70px;
    grid-template-columns: 42px minmax(0, 1fr) 46px;
    padding: calc(8px + var(--safe-top)) 10px 8px;
    gap: 8px;
  }

  #backToInbox { display: grid; }
  .chat-avatar { width: 36px; height: 36px; }
  .chat-header h2 { font-size: .98rem; }
  .status-line { font-size: .72rem; }

  .messages {
    padding: 12px 8px 10px;
    gap: 7px;
  }

  .message-avatar { display: none; }
  .message-bubble {
    max-width: 94%;
    min-width: 86px;
    padding: 9px 40px 17px 10px;
    border-radius: 15px 15px 15px 4px;
    font-size: .94rem;
  }
  .message-bubble.user { border-radius: 15px 15px 4px 15px; }
  .message-attachments,
  .image-preview-button { width: min(360px, 100%); }
  .image-preview-button { min-height: 116px; max-height: 260px; }
  .image-preview-button img { max-height: 260px; }

  .composer { padding: 8px 8px calc(8px + max(var(--safe-bottom), 12px)); }
  .attachments-list { max-height: 124px; }
  .attachment-chip { max-width: 100%; }
  .attachment-chip img { width: 48px; height: 48px; }
  .composer-input-row { grid-template-columns: 40px minmax(0, 1fr) 40px; min-height: 48px; gap: 7px; }
  textarea { min-height: 40px; padding: 10px 13px; }
  .plus-button,
  .plane-button { width: 40px; height: 40px; }
  .header-walkie { width: 44px; height: 44px; }
  .walkie-overlay { inset: auto 10px calc(70px + var(--safe-bottom)) 10px; }
  .notice-toast {
    right: 10px;
    bottom: calc(78px + var(--safe-bottom));
    width: calc(100vw - 20px);
  }

  html.keyboard-active .chat-section,
  html.composer-focused .chat-section {
    overflow: hidden;
  }

  html.keyboard-active .composer {
    flex-shrink: 0;
    transform: translateZ(0);
  }
}

@media (max-width: 380px) {
  .agent-list { grid-template-columns: 1fr; }
  .login-card h1 { font-size: 2.2rem; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
