/* Boîte de réception GO! — confort de réponse, sans modifier le routage WhatsApp. */
.inbox-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 15px;
}

.inbox-composer {
  min-width: 0;
}

.inbox-window {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.45;
}

.inbox-window.open {
  border: 1px solid #c9e4cf;
  background: #eff8f0;
  color: #17662f;
}

.inbox-window.expired {
  border: 1px solid #ead9b6;
  background: #fff8e8;
  color: #765316;
}

.inbox-window a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.inbox-composer-label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 850;
}

.inbox-reply textarea.inbox-reply-text {
  display: block;
  width: 100%;
  min-height: 132px;
  max-height: 280px;
  padding: 15px 16px;
  border: 1.5px solid #bdcbbf;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  scroll-margin-bottom: 120px;
}

.inbox-reply textarea.inbox-reply-text::placeholder {
  color: #7d8880;
}

.inbox-reply textarea.inbox-reply-text:focus {
  outline: none;
  border-color: var(--green2);
  box-shadow: 0 0 0 4px rgba(23, 102, 47, .11);
}

.inbox-reply textarea.inbox-reply-text:disabled {
  border-color: #d9dfd9;
  background: #f4f5f3;
  color: #7b837d;
  cursor: not-allowed;
}

.inbox-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  padding: 5px 2px 0;
  color: var(--muted);
  font-size: .7rem;
}

.inbox-character-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.inbox-character-count.near-limit {
  color: #9b6500;
}

.inbox-quick-replies {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.inbox-quick-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.inbox-quick-replies button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #d5ded6;
  border-radius: 999px;
  background: #f6f9f5;
  color: #294a33;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.inbox-quick-replies button:hover,
.inbox-quick-replies button:focus-visible {
  border-color: var(--green2);
  background: #edf7ef;
  outline: none;
}

.inbox-quick-replies button:disabled {
  border-color: #e0e4e0;
  background: #f4f5f3;
  color: #929993;
  cursor: not-allowed;
}

.inbox-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.inbox-actions button {
  min-height: 50px;
}

.inbox-actions .primary {
  min-width: 250px;
}

.inbox-actions button:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
}

@media (max-width: 540px) {
  .inbox-message {
    scroll-margin-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  .inbox-reply textarea.inbox-reply-text {
    min-height: 150px;
    max-height: 250px;
    padding: 15px;
    font-size: 16px;
    scroll-margin-bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .inbox-composer-meta {
    align-items: flex-end;
  }

  .inbox-keyboard-hint {
    max-width: 72%;
    line-height: 1.3;
  }

  .inbox-desktop-shortcut {
    display: none;
  }

  .inbox-quick-replies {
    margin-inline: -2px;
    padding: 1px 2px 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .inbox-quick-replies::-webkit-scrollbar {
    display: none;
  }

  .inbox-quick-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .inbox-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
    border: 1px solid rgba(12, 58, 26, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 28px rgba(12, 58, 26, .12);
  }

  .inbox-reply:focus-within .inbox-actions {
    position: sticky;
    z-index: 4;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .inbox-actions .primary {
    width: 100%;
    min-width: 0;
    min-height: 56px;
  }

  .inbox-actions .mark-read {
    width: 100%;
  }
}

@media (min-width: 541px) {
  .inbox-actions .mark-read {
    min-width: 150px;
  }
}
