.t2t-thread-shell {
  --t2t-primary: #B41E8E;
  --t2t-primary-hover: #9f187d;
  --t2t-primary-active: #861267;
  --t2t-primary-soft: #fff3fb;
  --t2t-card: #fffafd;
  --t2t-agent: #4a2a42;
  --t2t-customer: #fff;
  --t2t-text: #352a34;
  --t2t-muted: #7b6877;
  --t2t-line: #f1d7e9;
  direction: rtl;
  font-family: var(--e-global-typography-text-font-family, IranYekan), Tahoma, sans-serif;
  color: var(--t2t-text);
}

.t2t-thread-shell *,
.t2t-thread-shell *::before,
.t2t-thread-shell *::after {
  box-sizing: border-box;
  font-family: inherit;
}

.t2t-thread-shell [hidden] {
  display: none !important;
}

.t2t-thread-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px 28px 34px;
  min-height: 620px;
  border: 1px solid rgba(180, 30, 142, .08);
}

.t2t-thread-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
}

.t2t-thread-number {
  direction: ltr;
  color: #000;
  font-weight: 900;
  text-align: right;
}

.t2t-thread-title {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.t2t-thread-title h2 {
  font-size: 17px;
  text-align: center;
  margin: 0;
  color: var(--t2t-text);
  font-weight: 900;
}

.t2t-thread-department {
  font-size: 13px;
  color: #000;
  font-weight: 900;
}

.t2t-thread-back,
.t2t-thread-shell .t2t-front-btn-soft {
  border: 1px solid var(--t2t-primary) !important;
  background: #fff !important;
  color: var(--t2t-primary) !important;
  box-shadow: none !important;
}

.t2t-thread-back {
  justify-self: end;
  text-decoration: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.t2t-thread-back:hover,
.t2t-thread-shell .t2t-front-btn-soft:hover {
  background: var(--t2t-primary-soft) !important;
  color: var(--t2t-primary-hover) !important;
}

.t2t-thread-back:active,
.t2t-thread-shell .t2t-front-btn-soft:active {
  background: #fde7f6 !important;
  color: var(--t2t-primary-active) !important;
  transform: translateY(1px);
}

.t2t-thread-back:focus-visible,
.t2t-thread-shell .t2t-front-btn-soft:focus-visible {
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .14) !important;
}

.t2t-conversation {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0;
}

.t2t-date-sep {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--t2t-muted);
  font-size: 12px;
  justify-content: center;
}

.t2t-date-sep:before,
.t2t-date-sep:after {
  content: "";
  height: 1px;
  background: #e7e7e7;
  flex: 1;
}

.t2t-date-sep span {
  background: #fff3fb;
  color: #000;
  padding: 5px 14px;
  border-radius: 8px;
}

.t2t-bubble {
  display: flex;
}

.t2t-bubble.is-agent { justify-content: flex-start; }
.t2t-bubble.is-customer { justify-content: flex-end; }

.t2t-bubble-inner {
  max-width: 72%;
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
  line-height: 2;
}

.t2t-bubble.is-agent .t2t-bubble-inner {
  background: var(--t2t-agent);
  color: #fff;
  border-bottom-left-radius: 6px;
}

.t2t-bubble.is-customer .t2t-bubble-inner {
  background: var(--t2t-customer);
  color: var(--t2t-text);
  border-bottom-right-radius: 6px;
}

.t2t-bubble-inner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.t2t-bubble-body p { margin: .2em 0; }

.t2t-bubble-inner time {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  opacity: .72;
}

.t2t-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.t2t-attachments a {
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .18);
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}

.t2t-attachments {
  align-items: flex-start;
}

.t2t-attachment-preview {
  width: 118px;
  display: grid;
  gap: 0;
  padding: 2px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(180, 30, 142, .18);
  background: #fff !important;
  color: var(--t2t-primary) !important;
  text-align: center;
  text-decoration: none !important;
  cursor: zoom-in;
  outline: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.t2t-attachment-preview:hover {
  background: #fff3fb !important;
  border-color: rgba(180, 30, 142, .42);
  box-shadow: 0 10px 24px rgba(180, 30, 142, .12);
  transform: translateY(-1px);
}

.t2t-attachment-preview:active {
  background: #fde7f6 !important;
  transform: translateY(1px);
}

.t2t-attachment-preview:focus-visible {
  border-color: var(--t2t-primary);
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .14);
}

.t2t-attachment-thumb {
  width: 100%;
  height: 78px;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #fff3fb;
  border: 1px solid rgba(180, 30, 142, .12);
}

.t2t-attachment-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.t2t-attachment-name {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--t2t-primary);
  word-break: break-word;
}

.t2t-attachment-file {
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff3fb !important;
  color: var(--t2t-primary) !important;
  border: 1px solid rgba(180, 30, 142, .16);
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 800;
}

.t2t-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(37, 17, 32, .82);
  direction: rtl;
}

.t2t-lightbox[hidden] {
  display: none !important;
}

.t2t-lightbox__panel {
  width: min(920px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  position: relative;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.t2t-lightbox__image {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  background: #fff3fb;
}

.t2t-lightbox__close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--t2t-primary);
  background: #fff;
  color: var(--t2t-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  outline: none;
}

.t2t-lightbox__close:hover {
  background: #fff3fb;
}

.t2t-lightbox__close:active {
  background: #fde7f6;
  transform: translateY(1px);
}

.t2t-lightbox__close:focus-visible {
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .16);
}

.t2t-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.t2t-lightbox__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--t2t-text);
  word-break: break-word;
}

.t2t-lightbox__download {
  border: 1px solid var(--t2t-primary);
  background: #fff;
  color: var(--t2t-primary);
  border-radius: 12px;
  padding: 8px 14px;
  text-decoration: none;
  font-weight: 900;
  outline: none;
}

.t2t-lightbox__download:hover {
  background: #fff3fb;
}

.t2t-lightbox__download:focus-visible {
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .14);
}



.t2t-reply-ticket {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.t2t-reply-ticket textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  outline: none;
  resize: vertical;
  color: var(--t2t-text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .07);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.t2t-reply-ticket textarea:hover {
  border-color: rgba(180, 30, 142, .18);
  background: #fffbfd;
}

.t2t-reply-ticket textarea:focus {
  border-color: var(--t2t-primary);
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .12), 0 12px 26px rgba(180, 30, 142, .08);
}

.t2t-reply-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.t2t-rating-box {
  text-align: center;
  border-top: 1px solid var(--t2t-line);
  padding-top: 20px;
  margin-top: 10px;
}

.t2t-rating-box button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--t2t-text);
  margin: 0 12px;
  cursor: pointer;
  font-weight: 900;
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.t2t-rating-box button:hover {
  background: var(--t2t-primary-soft);
  color: var(--t2t-primary);
}

.t2t-rating-box button:active {
  background: #fde7f6;
  color: var(--t2t-primary-active);
  transform: translateY(1px);
}

.t2t-rating-box button:focus-visible {
  border-color: var(--t2t-primary);
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .14);
}

.t2t-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 900;
  font-size: 12px;
  background: #fff3fb;
  color: var(--t2t-primary);
  border: 1px solid rgba(180, 30, 142, .14);
}

.t2t-status-pill.status-pending { background: #fff7fc; color: #8f176f; }
.t2t-status-pill.status-answered { background: #f7e2f0; color: #861267; }
.t2t-status-pill.status-closed { background: #f4eef2; color: #6f5368; }

.t2t-thread-shell .t2t-front-btn {
  border-radius: 14px;
  padding: 13px 24px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  outline: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.t2t-thread-shell .t2t-front-btn-primary {
  border: 1px solid var(--t2t-primary);
  background: var(--t2t-primary);
  color: #fff;
  box-shadow: 0 4px 26px rgba(180, 30, 142, .07);
}

.t2t-thread-shell .t2t-front-btn-primary:hover {
  background: var(--t2t-primary-hover);
  border-color: var(--t2t-primary-hover);
  transform: translateY(-1px);
}

.t2t-thread-shell .t2t-front-btn-primary:active {
  background: var(--t2t-primary-active);
  border-color: var(--t2t-primary-active);
  transform: translateY(1px);
}

.t2t-thread-shell .t2t-front-btn-primary:focus-visible {
  box-shadow: 0 0 0 4px rgba(180, 30, 142, .18), 0 14px 26px rgba(180, 30, 142, .22);
}

.t2t-front-alert,
.t2t-front-notice {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

.t2t-front-alert,
.t2t-front-notice.is-error {
  background: #fff1f8;
  color: #a31771;
  border: 1px solid #f4c8e4;
}

.t2t-front-notice.is-success {
  background: #fff3fb;
  color: var(--t2t-primary);
  border: 1px solid rgba(180, 30, 142, .2);
}

.t2t-front-notice.is-info {
  background: #fff7fc;
  color: #8f176f;
  border: 1px solid rgba(180, 30, 142, .16);
}

@media (max-width: 767px) {
  .t2t-thread-card { padding: 20px 14px; }
  .t2t-thread-head { grid-template-columns: 1fr; justify-items: center; }
  .t2t-thread-number { text-align: center; }
  .t2t-thread-back { justify-self: center; }
  .t2t-bubble-inner { max-width: 92%; }
}
