/* Customer support chat UI (support.js) */
.mobile-nav-item { position: relative; }

.support-nav-badge,
.support-header-badge,
.v2-support-card-badge,
.rx-support-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff4757;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(255, 71, 87, .45);
}
.support-nav-badge.hidden,
.support-header-badge.hidden,
.v2-support-card-badge.hidden,
.rx-support-badge[hidden] { display: none !important; }

.support-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 24px);
  pointer-events: none;
}
.support-header-badge { margin-left: 4px; }

.v2-support-card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v2-support-card-legacy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(216, 255, 79, .3);
  border-radius: 14px;
  background: rgba(216, 255, 79, .08);
  color: #eef2f4;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.v2-support-card-legacy .v2-support-card-badge {
  position: absolute;
  top: 12px;
  right: 14px;
}

.pay-support-btn,
.v2-member-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 10px;
  margin: 0 4px;
  border: 1px solid rgba(216, 255, 79, .45);
  border-radius: 999px;
  background: rgba(216, 255, 79, .14);
  color: #d8ff4f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: baseline;
}
.pay-support-btn:hover,
.v2-member-support-btn:hover { background: rgba(216, 255, 79, .24); }
.pay-tip-backup,
.v2-member-support-backup {
  display: inline-block;
  margin-left: 4px;
  color: #8f9ca6;
  font-size: 11px;
}
.pay-tip-backup a,
.v2-member-support-backup a { color: #9aa6ae; text-decoration: underline; }
.pay-dialog-support {
  margin: 10px 0 0;
  color: #9aa6ae;
  font-size: 12px;
  text-align: center;
}

/* Fullscreen on phones, centered modal on desktop */
dialog.support-dialog {
  width: min(680px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 48px));
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 1px solid #2b343b;
  border-radius: 20px;
  background: #0d1115;
  color: #eef2f4;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .65);
  overflow: hidden;
}
dialog.support-dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog.support-dialog::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(3px);
}

@media (max-width: 619px) {
  dialog.support-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    margin: 0;
  }
}

.support-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: max(10px, env(safe-area-inset-top)) 10px 10px 16px;
  border-bottom: 1px solid #222a30;
  background: #13181d;
}
.support-head-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.support-official-avatar,
.support-msg-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8ff4f, #87dfff);
  color: #0e130b;
  font-weight: 800;
  font-size: 15px;
}
.support-head-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.support-head-title-row { display: flex; align-items: center; gap: 6px; }
.support-head-title-row h2 { margin: 0; font-size: 16px; font-weight: 700; }
.support-official-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(216, 255, 79, .18);
  color: #d8ff4f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}
.support-head-sub {
  color: #9aa6ae;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-close {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9aa6ae;
  cursor: pointer;
}
.support-close:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.support-close svg,
.support-pick-btn svg,
.support-lightbox-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.support-load-more {
  align-self: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #2b343b;
  border-radius: 999px;
  background: #161c22;
  color: #9aa6ae;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.support-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.support-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.support-msg.is-user {
  justify-content: flex-end;
}
.support-msg-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(82%, 480px);
}
.support-msg.is-user .support-msg-col {
  align-items: flex-end;
}
.support-msg-who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b8c2ca;
}
.support-bubble {
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid #2b343b;
  background: #161c22;
  color: #eef2f4;
  font-size: 14px;
  line-height: 1.55;
}
.support-msg.is-official .support-bubble {
  border-top-left-radius: 4px;
}
.support-msg.is-user .support-bubble {
  border-color: rgba(216, 255, 79, .28);
  background: rgba(216, 255, 79, .14);
  color: #f4f8eb;
  border-top-right-radius: 4px;
}
.support-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.support-msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.support-bubble > .support-msg-images:first-child { margin-top: 0; }
.support-msg-img-btn {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: #0d1115;
  overflow: hidden;
  cursor: zoom-in;
}
.support-msg-img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  object-fit: cover;
}
.support-img-expired {
  padding: 10px 12px;
  border: 1px dashed #3a454d;
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: #8b98a2;
  font-size: 12px;
}
.support-msg-time {
  color: #7d8992;
  font-size: 11px;
  padding: 0 2px;
}

dialog.support-dialog > .support-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #222a30;
  background: #13181d;
}
.support-banner {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 181, 77, .35);
  background: rgba(255, 181, 77, .12);
  color: #ffcf8a;
  font-size: 13px;
  line-height: 1.5;
}
.support-banner.hidden { display: none; }
.support-pending {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.support-pending.hidden { display: none; }
.support-pending-item {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #303a42;
  overflow: hidden;
  background: #0d1115;
}
.support-pending-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.support-pending-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px 4px;
  background: rgba(0, 0, 0, .72);
  color: #d8ff4f;
  font-size: 10px;
  text-align: center;
}
.support-pending-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.support-form { display: flex; flex-direction: column; gap: 6px; }
.support-form.hidden { display: none; }
.support-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.support-pick-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #303a42;
  border-radius: 12px;
  background: #1a2128;
  color: #c8d2d9;
  cursor: pointer;
}
.support-pick-btn:disabled { opacity: .45; cursor: not-allowed; }
.support-input {
  flex: 1 1 auto;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 12px;
  border: 1px solid #303a42;
  border-radius: 12px;
  background: #0d1115;
  color: #eef2f4;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
}
.support-input:focus { outline: none; border-color: #d8ff4f; }
.support-input:disabled { opacity: .55; }
.support-send-btn {
  flex: none;
  min-width: 64px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #d8ff4f;
  color: #11160b;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.support-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.support-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #828e98;
  font-size: 11px;
}

dialog.support-lightbox {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 8px;
  border: 1px solid #2b343b;
  border-radius: 14px;
  background: #0d1115;
}
dialog.support-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.support-lightbox-img {
  display: block;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 64px);
  object-fit: contain;
  border-radius: 10px;
}
.support-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  cursor: pointer;
}
