@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfafc;
  --line: #e3e0e6;
  --text: #34323b;
  --muted: #77717f;
  --primary: #ff4050;
  --primary-strong: #d92f3d;
  --primary-soft: #fff0f2;
  --danger: #c62838;
  --incoming: #ffffff;
  --outgoing: #fff0f2;
  --shadow: 0 10px 30px rgba(36, 34, 43, 0.16);
  --radius: 12px;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: "Open Sans", sans-serif;
  letter-spacing: 0;
  /* Trava qualquer estouro horizontal da página (iPhone/Safari inclusive). */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  /* iOS infla o texto ao girar a tela sem isso, "desconfigurando" o layout. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea:disabled {
  background: #eef1f7;
  color: #8b90a1;
}

/* ---------- Login ---------- */

.chat-login {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--primary) 0 34%, var(--bg) 34% 100%);
}

.chat-login::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 18px);
  content: "";
  pointer-events: none;
}

.login-panel {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  gap: 18px;
  justify-items: stretch;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  padding: 32px;
  box-shadow: var(--shadow);
  z-index: 1;
}

/* No desktop os agrupamentos do login não criam caixas próprias. */
.login-hero,
.login-sheet {
  display: contents;
}

.login-mark {
  display: grid;
  width: 220px;
  height: 78px;
  place-items: center;
  border-radius: 18px;
  background: #ffffff;
  padding: 20px 22px;
  box-shadow: none;
}

.login-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.login-heading {
  display: grid;
  gap: 3px;
}

.login-heading span,
.field span,
.agent-chip small,
.customer-heading small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.login-heading h1 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.field {
  display: grid;
  gap: 6px;
}

.field.compact {
  max-width: 190px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #8b90a1;
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap input {
  padding-left: 40px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 64, 80, 0.16);
}

/* ---------- Buttons ---------- */

.primary-action,
.secondary-action,
.danger-action,
.icon-button,
.send-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.primary-action {
  background: var(--primary);
  color: #ffffff;
  min-height: 54px;
  font-size: 1rem;
  border-radius: 10px;
}

.primary-action:hover {
  background: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(13, 35, 88, 0.3);
}

.secondary-action {
  border-color: var(--line);
  background: var(--surface);
  color: #33384a;
  padding: 0 14px;
  font-size: 0.86rem;
}

.secondary-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.danger-action {
  border-color: var(--line);
  background: var(--surface);
  color: #434a5a;
  padding: 0 14px;
  font-size: 0.86rem;
}

.danger-action:hover {
  border-color: rgba(198, 40, 40, 0.35);
  background: #fff6f6;
  color: var(--danger);
}

.icon-button,
.send-button {
  width: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: transparent;
  color: #495062;
}

.icon-button:hover {
  background: rgba(255, 64, 80, 0.1);
  color: var(--primary-strong);
}

.send-button {
  background: var(--primary);
  color: #ffffff;
}

.send-button:hover:not(:disabled) {
  background: var(--primary-strong);
  transform: scale(1.05);
}

.send-button:disabled {
  background: #c3ccdb;
  color: #eef1f8;
  opacity: 1;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ---------- App shell ---------- */

.chat-app {
  display: grid;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  /* A linha única precisa ser exatamente a altura da viewport; sem isso a
     coluna cresce com o conteúdo das mensagens e o composer sai da tela. */
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.conversation-panel,
.conversation-view {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
}

.app-header,
.conversation-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px 14px;
}

.agent-chip,
.customer-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.agent-chip div,
.customer-heading div {
  min-width: 0;
}

.agent-chip strong,
.customer-heading strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.customer-heading small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, #c9d5ee, #aec1e6);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.contact-avatar-frame {
  position: relative;
  overflow: hidden;
}

.contact-avatar-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.header-actions,
.conversation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button.attention {
  position: relative;
}

.icon-button.attention::after {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb300;
  box-shadow: 0 0 0 2px var(--surface-soft);
  content: "";
}

.conversation-actions {
  max-width: min(100%, 590px);
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Conversation list ---------- */

.list-tools {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 14px;
}

.conversation-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.conversation-item {
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  color: inherit;
  text-align: left;
  transition: background-color 0.12s ease;
}

.conversation-item + .conversation-item {
  margin-top: 2px;
}

.conversation-item:hover {
  background: #eef1f8;
}

.conversation-item.is-active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.conversation-copy {
  min-width: 0;
}

.conversation-copy strong,
.conversation-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy strong {
  font-size: 0.9rem;
}

.conversation-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.79rem;
}

.conversation-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
}

.count-badge,
.status-badge {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 850;
}

.status-badge {
  background: #eef0f6;
  color: #535c6e;
}

/* ---------- Conversation view ---------- */

.conversation-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(240, 242, 249, 0.55), rgba(240, 242, 249, 0.55)),
    url("/chat-bg.jpg") repeat;
  background-size: auto, 420px auto;
}

.conversation-header,
.messages,
.composer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.back-button {
  display: none;
}

.conversation-menu-toggle {
  display: none;
}

.conversation-actions select {
  width: 150px;
  min-height: 40px;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 20px 7% 12px;
  background: transparent;
}

.conversation-list::-webkit-scrollbar,
.messages::-webkit-scrollbar {
  width: 6px;
}

.conversation-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(30, 36, 52, 0.18);
}

.conversation-list::-webkit-scrollbar-thumb:hover,
.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 36, 52, 0.32);
}

.message-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 8px;
}

.message-row.outgoing {
  justify-content: flex-end;
}

.message-row.system {
  justify-content: center;
  margin: 14px 0;
}

.message-bubble {
  min-width: 0;
  max-width: min(620px, 78%);
  border: 0;
  border-radius: var(--radius);
  background: var(--incoming);
  padding: 8px 12px 6px;
  box-shadow: 0 1px 1.5px rgba(18, 24, 40, 0.13);
}

.message-row.incoming .message-bubble {
  border-top-left-radius: 4px;
}

.message-row.outgoing .message-bubble {
  border-top-right-radius: 4px;
  background: var(--outgoing);
}

.message-author {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.message-row.incoming .message-author {
  color: #c0392b;
}

.message-row.system .message-bubble {
  max-width: min(420px, 88%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 16px;
  box-shadow: 0 1px 1px rgba(18, 24, 40, 0.08);
  text-align: center;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.45;
}

.message-row.system .message-bubble p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.message-bubble time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
}

.message-row.system .message-bubble time {
  display: none;
}

.attachment-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  color: var(--primary-strong);
  font-weight: 750;
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}

/* ---------- Composer ---------- */

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
  border-top: 0;
  background: transparent;
  padding: 6px 12px 12px;
}

.composer-field {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 2px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 24, 40, 0.16);
  padding: 2px 8px 2px 2px;
}

.emoji-button {
  margin: 2px 0;
}

.composer textarea {
  border: 0;
  background: transparent;
  border-radius: 0;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  line-height: 1.4;
  padding: 10px 8px 10px 2px;
}

.composer textarea:focus {
  box-shadow: none;
  outline: none;
}

.composer textarea:disabled {
  background: transparent;
}

.emoji-panel {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 10px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, 38px);
  gap: 2px;
  max-width: calc(100vw - 24px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
  box-shadow: var(--shadow);
}

.emoji-panel button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color 0.12s ease, transform 0.1s ease;
}

.emoji-panel button:hover {
  background: #eef1f8;
  transform: scale(1.12);
}

.send-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  min-height: 46px;
  box-shadow: 0 2px 6px rgba(13, 35, 88, 0.3);
}

/* ---------- Misc ---------- */

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  padding: 20px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
}

.empty-state.large {
  min-height: 100%;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #141a2e;
  color: #ffffff;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .chat-app {
    /* minmax(0, 1fr): sem o mínimo zero a coluna cresce além da tela
       quando algo interno é largo (mesmo bug do 1fr vertical). */
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
  }

  .conversation-view {
    display: none;
  }

  .chat-app.is-viewing .conversation-panel {
    display: none;
  }

  .chat-app.is-viewing .conversation-view {
    display: grid;
  }

  .back-button {
    display: inline-flex;
  }

  /* Barra superior com a identidade Mkt4you. */
  .app-header,
  .conversation-header {
    border-bottom: 0;
    background: linear-gradient(180deg, #ff4050, #d92f3d);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(80, 24, 34, 0.25);
  }

  .agent-chip strong,
  .customer-heading strong {
    color: #ffffff;
  }

  .agent-chip small,
  .customer-heading small {
    color: rgba(255, 255, 255, 0.82);
  }

  .app-header .icon-button,
  .conversation-header .icon-button {
    color: #ffffff;
  }

  .app-header .icon-button:hover,
  .conversation-header .icon-button:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .app-header .avatar,
  .conversation-header .avatar {
    background: #ffffff;
    color: var(--primary-strong);
  }

  .conversation-header .secondary-action {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .conversation-header .secondary-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
  }

  .conversation-header .danger-action {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .conversation-header .danger-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
  }

  .conversation-actions select {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .list-tools select {
    border-radius: 999px;
    padding: 10px 16px;
  }

  .conversation-header {
    position: relative;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
  }

  .customer-heading {
    flex: 1 1 auto;
    min-width: 0;
  }

  .conversation-menu-toggle:not([hidden]) {
    display: inline-flex;
  }

  .conversation-actions {
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    z-index: 50;
    display: none;
    width: min(312px, calc(100vw - 20px));
    min-width: 0;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid rgba(13, 35, 88, 0.14);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    padding: 10px;
    box-shadow: 0 18px 42px rgba(6, 14, 40, 0.26);
  }

  .conversation-actions.is-open:not([hidden]) {
    display: flex;
  }

  .conversation-actions::before {
    position: absolute;
    top: -7px;
    right: 17px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-top: 1px solid rgba(13, 35, 88, 0.14);
    border-left: 1px solid rgba(13, 35, 88, 0.14);
    content: "";
    transform: rotate(45deg);
  }

  .conversation-header .conversation-actions select {
    width: 100%;
    min-width: 0;
    border-color: var(--line);
    background: #ffffff;
    color: var(--text);
  }

  .conversation-header .conversation-actions .secondary-action,
  .conversation-header .conversation-actions .danger-action {
    width: 100%;
    justify-content: flex-start;
    border-color: #e6e9f1;
    background: #ffffff;
    color: #33384a;
    padding: 0 12px;
  }

  .conversation-header .conversation-actions .danger-action {
    background: #fff7f7;
    color: var(--danger);
  }

  .conversation-actions button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .messages {
    padding: 16px 12px;
  }

  .message-bubble {
    max-width: 86%;
  }
}

@media (max-width: 560px) {
  /* Login com cara de app e identidade Mkt4you. */
  .chat-login {
    align-items: stretch;
    justify-items: stretch;
    width: 100vw;
    padding: 0;
    overflow-x: hidden;
    background: linear-gradient(168deg, #ff6b78 0%, var(--primary) 45%, var(--primary-strong) 100%);
  }

  .login-panel {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .login-hero {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 20px;
    padding: max(48px, env(safe-area-inset-top)) 24px 36px;
    text-align: center;
  }

  .login-mark {
    width: min(76vw, 252px);
    height: 98px;
    border-radius: 20px;
    padding: 24px 26px;
    background: #ffffff;
    box-shadow: 0 20px 44px rgba(8, 20, 60, 0.32);
  }

  .login-heading {
    justify-items: center;
  }

  .login-heading span {
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.7rem;
  }

  .login-heading h1 {
    color: #ffffff;
    font-size: clamp(1.6rem, 7vw, 1.9rem);
  }

  .login-sheet {
    display: grid;
    gap: 16px;
    border-radius: 28px 28px 0 0;
    background: var(--surface);
    padding: 30px 22px max(26px, env(safe-area-inset-bottom));
    box-shadow: 0 -14px 34px rgba(6, 14, 40, 0.22);
  }

  .login-sheet input {
    min-height: 54px;
    border-radius: 14px;
    font-size: 1.02rem;
  }

  .primary-action {
    min-height: 58px;
    border-radius: 14px;
    font-size: 1.08rem;
  }

  .app-header,
  .conversation-header {
    min-height: 64px;
    padding: 10px;
  }

  .field.compact {
    max-width: none;
  }

  .list-tools {
    padding: 10px;
  }

  .conversation-list {
    padding: 4px;
  }

  .conversation-item {
    min-height: 72px;
    padding: 10px;
  }

  .messages {
    padding: 12px 10px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .composer {
    padding: 6px 8px max(10px, env(safe-area-inset-bottom));
  }

  .emoji-panel {
    left: 8px;
    grid-template-columns: repeat(7, 38px);
  }
}

@media (max-width: 380px) {
  .app-header,
  .conversation-header {
    min-height: 60px;
    gap: 6px;
    padding: 8px 6px;
  }

  .back-button,
  .conversation-menu-toggle {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .conversation-header .avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .customer-heading {
    gap: 8px;
  }

  .customer-heading strong {
    font-size: 0.86rem;
  }

  .customer-heading small {
    font-size: 0.68rem;
  }

  .messages {
    padding: 10px 8px;
  }

  .message-bubble {
    max-width: calc(100vw - 64px);
    padding: 8px 10px 6px;
  }

  .message-row.system .message-bubble {
    max-width: calc(100vw - 52px);
  }

  .message-bubble p {
    font-size: 0.89rem;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 6px;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  }

  .send-button {
    width: 42px;
    height: 42px;
  }

  .emoji-panel {
    grid-template-columns: repeat(6, 36px);
    max-width: calc(100vw - 16px);
    padding: 8px;
  }
}

/* ---------- Tela de ativação de notificações ---------- */

.push-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 16, 36, 0.62);
  backdrop-filter: blur(2px);
}

.push-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 360px);
  border-radius: 22px;
  background: var(--surface);
  padding: 28px 24px 20px;
  text-align: center;
  box-shadow: 0 26px 60px rgba(5, 12, 30, 0.45);
}

.push-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.push-mark svg {
  width: 30px;
  height: 30px;
}

.push-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.push-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.push-card .primary-action {
  width: 100%;
}

.push-later {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
}

/* ---------- Mídia no chat (anexos, câmera, voz) ---------- */

.media-button {
  width: 38px;
  flex: 0 0 38px;
  margin: 2px 0;
}

.send-button .icon-mic {
  display: none;
}

.send-button.mic-mode .icon-send {
  display: none;
}

.send-button.mic-mode .icon-mic {
  display: inline-flex;
}

.composer.is-recording .composer-field {
  display: none;
}

.voice-bar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 24, 40, 0.16);
  padding: 2px 6px 2px 16px;
}

.voice-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #e53935;
  animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
  50% { opacity: 0.25; }
}

.voice-timer {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.voice-hint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.voice-cancel {
  color: var(--danger);
}

.message-bubble .media-image img {
  display: block;
  max-width: min(280px, 100%);
  max-height: 320px;
  border-radius: 10px;
  margin: 3px 0 4px;
}

.media-video {
  display: block;
  max-width: min(300px, 100%);
  max-height: 320px;
  border-radius: 10px;
  margin: 3px 0 4px;
  background: #000;
}

.media-audio {
  display: block;
  width: min(280px, 100%);
  height: 40px;
  margin: 4px 0;
}

@media (max-width: 560px) {
  .message-bubble .media-image img,
  .media-video {
    max-width: 100%;
  }

  .media-audio {
    width: 220px;
    max-width: 100%;
  }
}
