/* Ticket modal — shell + messages */
body.ticket-modal-open { overflow: hidden; }

.ticket-modal {
  position: fixed;
  inset: 0;
  z-index: 100000025;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  padding: 16px;
}

.ticket-modal.open {
  opacity: 1;
  pointer-events: all;
}

.ticket-box {
  background: #12121a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-height: 88vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  width: min(920px, calc(100vw - 2rem));
}

.ticket-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.t-status {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.t-status.open {
  background: rgba(232, 48, 74, 0.15);
  color: #f87171;
  border: 1px solid rgba(232, 48, 74, 0.3);
}

.t-status.replied {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.t-status.closed {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ticket-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 52vh;
}

.ticket-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.ticket-msg.user {
  align-self: flex-end;
  background: rgba(232, 48, 74, 0.2);
  border: 1px solid rgba(232, 48, 74, 0.35);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.ticket-msg.staff-msg,
.ticket-msg.bot-msg {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  border-bottom-left-radius: 5px;
  max-width: 88%;
}

.ticket-msg-from {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ticket-msg-ts {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 5px;
  text-align: right;
}

.ticket-msg.staff-msg .ticket-msg-ts,
.ticket-msg.bot-msg .ticket-msg-ts {
  text-align: left;
}

.ticket-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ticket-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ticket-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-shrink: 0;
}

.ticket-send {
  background: #e8304a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  align-self: flex-end;
  min-height: 58px;
}

.ticket-send:hover {
  background: #c02040;
}

.ticket-bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.ticket-bot-chip {
  background: rgba(247, 127, 0, 0.12);
  border: 1px solid rgba(247, 127, 0, 0.35);
  color: #ffb347;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.ticket-msg-file {
  display: inline-block;
  margin-top: 8px;
  color: #9b8cf8;
  font-size: 12px;
}

.ticket-msg-html {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.ticket-msg-html p {
  margin: 0 0 10px;
}

.ticket-msg-html p:last-child {
  margin-bottom: 0;
}

.ticket-msg-html ol {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.ticket-msg-html li {
  margin-bottom: 6px;
}

.ticket-msg-html strong {
  color: #fff;
  font-weight: 700;
}

.ticket-bot-paypal-link {
  display: inline-block;
  margin: 6px 0;
  padding: 11px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0070ba, #003087);
  color: #fff !important;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0, 112, 186, 0.35);
}

.ticket-bot-paypal-link:hover {
  filter: brightness(1.08);
}
