/* Contact us page — list + messaging-style thread */
.contact-tickets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-ticket {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-white);
  cursor: pointer;
  text-align: start;
  font: inherit;
  width: 100%;
  color: inherit;
}

.contact-ticket:hover {
  border-color: var(--burgundy-mid, #a84d72);
}

.contact-ticket__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.contact-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f4ecef;
  color: var(--burgundy-deep);
  white-space: nowrap;
}

.contact-thread {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: min(78vh, 720px);
}

.contact-chat-header {
  border-radius: 0;
}

.contact-chat-header .chat-header__back {
  display: inline-flex;
}

.contact-chat-messages {
  flex: 1;
  min-height: 280px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fc;
  /* Physical LTR so "user = right", "staff = left" regardless of page RTL */
  direction: ltr;
}

.contact-msg {
  display: flex;
  width: 100%;
}

.contact-msg--user {
  justify-content: flex-end;
}

.contact-msg--staff {
  justify-content: flex-start;
}

.contact-msg__inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: min(78%, 420px);
}

.contact-msg--user .contact-msg__inner {
  flex-direction: row-reverse;
}

.contact-msg__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  unicode-bidi: plaintext;
  text-align: start;
}

.contact-msg--user .contact-msg__bubble {
  background: linear-gradient(135deg, var(--burgundy-mid, #a84d72), var(--burgundy-deep, #7a2e4a));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.contact-msg--staff .contact-msg__bubble {
  background: #fff;
  border: 1px solid var(--border-light, #eaeaef);
  color: var(--text-primary, #1a1a2e);
  border-bottom-left-radius: 4px;
}

.contact-msg__who {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0.9;
}

.contact-msg__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-msg__img {
  display: block;
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.contact-msg__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.85;
}

.contact-msg__delete {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-light, #eaeaef);
  background: #fff;
  color: var(--text-muted, #8a8aa8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-thread .chat-composer.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.contact-delete-chat {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.settings-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.settings-switch input {
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d7cdd2;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.settings-switch input:checked {
  background: var(--burgundy-deep, #7a2e4a);
}

.settings-switch input:checked::after {
  transform: translateX(-20px);
}

[dir='ltr'] .settings-switch input:checked::after {
  transform: translateX(20px);
}

.hidden {
  display: none !important;
}
