/* ====================================================
   TAMX v2 — Mobile-first RTL CSS layer
   Common patterns for both admin and client new pages
   ==================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

/* ---- Common shell ---- */
.tx2-page { padding: 16px; padding-bottom: 80px; }
.tx2-page__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tx2-page__title { font-size: 1.25rem; font-weight: 800; color: #F8FAFC; margin: 0; }
.tx2-page__subtitle { font-size: .85rem; color: #94A3B8; margin: 4px 0 0; }

/* ---- Buttons ---- */
.tx2-btn { min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
           font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
           justify-content: center; transition: all .15s ease; font-size: .95rem; }
.tx2-btn--primary { background: linear-gradient(135deg, #D4AF37 0%, #B8901E 100%); color: #1A1A1A; }
.tx2-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,175,55,.35); }
.tx2-btn--ghost { background: rgba(255,255,255,.06); color: #E2E8F0; border-color: rgba(255,255,255,.12); }
.tx2-btn--danger { background: rgba(239,68,68,.12); color: #FCA5A5; border-color: rgba(239,68,68,.3); }
.tx2-btn--success { background: rgba(34,197,94,.12); color: #86EFAC; border-color: rgba(34,197,94,.3); }
.tx2-btn--sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.tx2-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Cards ---- */
.tx2-card { background: rgba(255,255,255,.03); border: 1.5px solid rgba(255,255,255,.1); border-radius: 14px;
            padding: 16px; margin-bottom: 14px; }

/* ---- Form inputs ---- */
.tx2-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tx2-field__label { font-size: .85rem; font-weight: 700; color: #CBD5E1; }
.tx2-field__input,
.tx2-field__select,
.tx2-field__textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.12);
  color: #F8FAFC; font-family: inherit; font-size: .95rem; outline: none;
  transition: border-color .15s ease;
}
.tx2-field__textarea { min-height: 80px; resize: vertical; }
.tx2-field__input:focus,
.tx2-field__select:focus,
.tx2-field__textarea:focus { border-color: rgba(212,175,55,.6); }
.tx2-field__hint { font-size: .75rem; color: #64748B; margin-top: 2px; }
.tx2-field__error { font-size: .8rem; color: #FCA5A5; margin-top: 4px; display: none; }
.tx2-field--error .tx2-field__input,
.tx2-field--error .tx2-field__select,
.tx2-field--error .tx2-field__textarea { border-color: rgba(239,68,68,.6); }
.tx2-field--error .tx2-field__error { display: block; }

/* Checkbox row */
.tx2-check { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px;
             background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); cursor: pointer;
             margin-bottom: 10px; min-height: 48px; }
.tx2-check input { width: 18px; height: 18px; accent-color: #D4AF37; flex-shrink: 0; }
.tx2-check__label { color: #E2E8F0; font-size: .9rem; }

/* ---- QR upload zone ---- */
.tx2-qr { display: flex; flex-direction: column; gap: 10px; }
.tx2-qr__dropzone {
  border: 2px dashed rgba(212,175,55,.3); border-radius: 12px;
  padding: 24px 16px; text-align: center; cursor: pointer;
  background: rgba(212,175,55,.04); transition: all .15s ease;
  min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.tx2-qr__dropzone:hover, .tx2-qr__dropzone.is-dragover { background: rgba(212,175,55,.08); border-color: rgba(212,175,55,.6); }
.tx2-qr__dropzone i { font-size: 32px; color: #D4AF37; }
.tx2-qr__dropzone-text { color: #CBD5E1; font-size: .9rem; }
.tx2-qr__dropzone-hint { color: #64748B; font-size: .75rem; }
.tx2-qr__preview {
  position: relative; max-width: 220px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.1); background: #fff; padding: 8px;
}
.tx2-qr__preview img { width: 100%; height: auto; display: block; border-radius: 8px; }
.tx2-qr__remove {
  position: absolute; top: 6px; left: 6px; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(239,68,68,.9); color: #fff;
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.tx2-qr__error { color: #FCA5A5; font-size: .85rem; padding: 8px; background: rgba(239,68,68,.08); border-radius: 8px; display: none; }
.tx2-qr__error.show { display: block; }

/* ---- Status badges ---- */
.tx2-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
             border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1; }
.tx2-badge--success { background: rgba(34,197,94,.15); color: #86EFAC; border: 1px solid rgba(34,197,94,.3); }
.tx2-badge--warning { background: rgba(245,158,11,.15); color: #FCD34D; border: 1px solid rgba(245,158,11,.3); }
.tx2-badge--info    { background: rgba(59,130,246,.15); color: #93C5FD; border: 1px solid rgba(59,130,246,.3); }
.tx2-badge--danger  { background: rgba(239,68,68,.15); color: #FCA5A5; border: 1px solid rgba(239,68,68,.3); }
.tx2-badge--neutral { background: rgba(148,163,184,.15); color: #CBD5E1; border: 1px solid rgba(148,163,184,.3); }

/* ---- Toast ---- */
#tx2-toast-host { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 32px); }
.tx2-toast { background: rgba(15,23,42,.96); color: #F8FAFC; padding: 10px 14px; border-radius: 10px; font-size: .9rem;
             box-shadow: 0 10px 30px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.1); pointer-events: auto;
             animation: tx2ToastIn .25s ease; max-width: 100%; }
.tx2-toast--success { border-color: rgba(34,197,94,.4); }
.tx2-toast--error   { border-color: rgba(239,68,68,.4); }
.tx2-toast--warning { border-color: rgba(245,158,11,.4); }
@keyframes tx2ToastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Modal ---- */
.tx2-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9000; display: none;
                       animation: tx2FadeIn .2s ease; backdrop-filter: blur(2px); }
.tx2-modal-backdrop.show { display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.tx2-modal { background: linear-gradient(180deg, #1A2238 0%, #0D1326 100%); border: 1px solid rgba(255,255,255,.12);
             border-radius: 18px; width: 100%; max-width: 560px; margin: 32px auto; padding: 20px;
             box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: tx2SlideUp .25s ease; }
@keyframes tx2FadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes tx2SlideUp { from{opacity:0; transform: translateY(20px);} to{opacity:1; transform: translateY(0);} }
.tx2-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tx2-modal__title { font-size: 1.1rem; font-weight: 800; color: #F8FAFC; }
.tx2-modal__close { background: rgba(255,255,255,.05); border: none; color: #CBD5E1; width: 36px; height: 36px;
                    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tx2-modal__body { max-height: calc(100vh - 200px); overflow-y: auto; padding-right: 4px; }
.tx2-modal__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; padding-top: 14px;
                    border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.tx2-modal__foot .tx2-btn { flex: 1 1 130px; }

/* Skeleton */
.tx2-skel { background: linear-gradient(90deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.05) 100%);
             background-size: 200% 100%; animation: tx2Shimmer 1.4s infinite; border-radius: 8px; height: 16px; }
@keyframes tx2Shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty state */
.tx2-empty { text-align: center; padding: 32px 16px; color: #94A3B8; }
.tx2-empty i { font-size: 40px; opacity: .5; margin-bottom: 8px; display: block; }

/* Transactions cards (replacement for buggy old display) */
.tx2-tx-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.tx2-tx-card { background: rgba(255,255,255,.03); border: 1.5px solid rgba(255,255,255,.1); border-radius: 14px;
                padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
                align-items: center; min-width: 0; overflow: hidden; }
.tx2-tx-card__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
                     justify-content: center; font-size: 18px; flex-shrink: 0; }
.tx2-tx-card[data-type="deposit"] .tx2-tx-card__icon { background: rgba(34,197,94,.15); color: #86EFAC; }
.tx2-tx-card[data-type="withdraw"] .tx2-tx-card__icon { background: rgba(245,158,11,.15); color: #FCD34D; }
.tx2-tx-card__body { min-width: 0; }
.tx2-tx-card__title { font-weight: 700; color: #F8FAFC; font-size: .95rem; overflow: hidden;
                       text-overflow: ellipsis; white-space: nowrap; }
.tx2-tx-card__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px;
                      color: #94A3B8; font-size: .78rem; }
.tx2-tx-card__amount { font-weight: 800; color: #F8FAFC; font-size: 1rem; text-align: left; white-space: nowrap; flex-shrink: 0; }
.tx2-tx-card[data-type="deposit"]  .tx2-tx-card__amount::before { content: "+"; color: #86EFAC; }
.tx2-tx-card[data-type="withdraw"] .tx2-tx-card__amount::before { content: "−"; color: #FCD34D; }
.tx2-tx-card__footer { grid-column: 1/-1; display: flex; gap: 8px; align-items: center;
                        flex-wrap: wrap; justify-content: space-between; padding-top: 10px;
                        border-top: 1px solid rgba(255,255,255,.06); margin-top: 6px; }
.tx2-tx-card__id { font-family: 'SF Mono', Menlo, monospace; font-size: .72rem; color: #64748B; }

/* Responsive — make icon smaller on very narrow screens */
@media (max-width: 360px) {
  .tx2-tx-card { gap: 8px; padding: 12px; }
  .tx2-tx-card__icon { width: 36px; height: 36px; font-size: 15px; }
  .tx2-tx-card__title { font-size: .88rem; }
  .tx2-tx-card__amount { font-size: .92rem; }
}

/* ============================================================
   PAGE 2 — Payment methods admin + Bonus admin grid
   ============================================================ */
.tx2-pm-grid { display: grid; grid-template-columns: 1fr; gap: 14px; width: 100%; max-width: 100%; }
@media (min-width: 720px)  { .tx2-pm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .tx2-pm-grid { grid-template-columns: repeat(3, 1fr); } }

.tx2-pm-card { background: rgba(255,255,255,.03); border: 1.5px solid rgba(255,255,255,.1);
               border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
               min-width: 0; overflow: hidden; }
.tx2-pm-card.is-deleted { opacity: .55; filter: grayscale(.4); }
.tx2-pm-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tx2-pm-card__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
                     justify-content: center; font-size: 20px; flex-shrink: 0; }
.tx2-pm-card__title { flex: 1; min-width: 0; }
.tx2-pm-card__name { font-weight: 800; color: #F8FAFC; font-size: 1rem; overflow: hidden;
                     text-overflow: ellipsis; }
.tx2-pm-card__sub { color: #94A3B8; font-size: .78rem; margin-top: 2px; }

.tx2-pm-card__qr { background: #fff; border-radius: 10px; padding: 10px; display: flex;
                   flex-direction: column; align-items: center; gap: 8px; }
.tx2-pm-card__qr img { max-width: 100%; max-height: 200px; width: auto; height: auto;
                        display: block; border-radius: 6px; }
.tx2-pm-card__qr--empty { background: rgba(255,255,255,.03); border: 1.5px dashed rgba(255,255,255,.12);
                          padding: 24px 10px; text-align: center; }

.tx2-pm-card__details { display: grid; grid-template-columns: minmax(110px,auto) 1fr; column-gap: 10px;
                        row-gap: 4px; margin: 0; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06);
                        border-bottom: 1px solid rgba(255,255,255,.06); font-size: .82rem; }
.tx2-pm-card__details dt { color: #94A3B8; font-weight: 600; }
.tx2-pm-card__details dd { color: #E2E8F0; margin: 0; word-break: break-word; }
.tx2-pm-card__notes { background: rgba(212,175,55,.06); border: 1px solid rgba(212,175,55,.15);
                       border-radius: 8px; padding: 8px 10px; font-size: .82rem; color: #E2E8F0; line-height: 1.6; }
.tx2-pm-card__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tx2-pm-card__actions .tx2-btn { flex: 1 1 auto; }

/* QR dropzone state */
.tx2-qr__dropzone.is-drag { background: rgba(212,175,55,.12); border-color: rgba(212,175,55,.7); }

/* ============================================================
   Modal v2 — controlled by .is-open class
   ============================================================ */
.tx2-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 9000;
                      display: none; align-items: flex-start; justify-content: center;
                      padding: 16px; overflow-y: auto; backdrop-filter: blur(2px); }
.tx2-modal-backdrop.is-open,
.tx2-modal-backdrop.show { display: flex; }
.tx2-modal__head h3 { margin: 0; color: #F8FAFC; font-size: 1.1rem; font-weight: 800; }

/* Row helper for paired fields */
.tx2-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .tx2-row { grid-template-columns: 1fr; } }

/* Plain input (outside tx2-field) */
.tx2-input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
             background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.12);
             color: #F8FAFC; font-family: inherit; font-size: .92rem; outline: none; }
.tx2-input:focus { border-color: rgba(212,175,55,.6); }

/* tx2-field input/select/textarea direct children (no .tx2-field__input class needed) */
.tx2-field input:not([type="checkbox"]):not([type="radio"]),
.tx2-field select,
.tx2-field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.12);
  color: #F8FAFC; font-family: inherit; font-size: .95rem; outline: none;
  transition: border-color .15s ease;
}
.tx2-field textarea { min-height: 80px; resize: vertical; }
.tx2-field input:focus, .tx2-field select:focus, .tx2-field textarea:focus { border-color: rgba(212,175,55,.6); }
.tx2-field label { font-size: .85rem; font-weight: 700; color: #CBD5E1; }
.tx2-field__error { font-size: .8rem; color: #FCA5A5; min-height: 1em; }

/* ============================================================
   AI conversations admin
   ============================================================ */
.tx2-user-row { width: 100%; display: flex; align-items: center; gap: 12px;
                background: rgba(255,255,255,.03); border: 1.5px solid rgba(255,255,255,.08);
                border-radius: 12px; padding: 10px 12px; text-align: right; color: inherit;
                cursor: pointer; font-family: inherit; min-height: 60px; }
.tx2-user-row:hover { background: rgba(255,255,255,.06); border-color: rgba(212,175,55,.3); }
.tx2-user-row__avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(212,175,55,.15);
                        color: #D4AF37; display: flex; align-items: center; justify-content: center;
                        font-weight: 800; flex-shrink: 0; }
.tx2-user-row__body { flex: 1; min-width: 0; }
.tx2-user-row__name { color: #F8FAFC; font-weight: 700; font-size: .92rem; overflow: hidden;
                       text-overflow: ellipsis; white-space: nowrap; }
.tx2-user-row__email { color: #94A3B8; font-size: .78rem; }
.tx2-user-row__meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; flex-shrink: 0; }

.tx2-msg { background: rgba(255,255,255,.03); border-radius: 12px; padding: 10px 12px;
            border-inline-start: 3px solid #94A3B8; max-width: 100%; }
.tx2-msg--user { border-inline-start-color: #93C5FD; background: rgba(59,130,246,.06); }
.tx2-msg--ai   { border-inline-start-color: #D4AF37; background: rgba(212,175,55,.06); }
.tx2-msg__role { font-size: .72rem; font-weight: 700; color: #94A3B8; margin-bottom: 4px; }
.tx2-msg__text { color: #E2E8F0; font-size: .9rem; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.tx2-msg__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px;
                  color: #64748B; font-size: .72rem; }

/* ============================================================
   Audit log
   ============================================================ */
.tx2-log-row { background: rgba(255,255,255,.03); border-radius: 10px; border: 1px solid rgba(255,255,255,.06); }
.tx2-log-row > summary { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px;
                          flex-wrap: wrap; color: #E2E8F0; font-size: .88rem; list-style: none; }
.tx2-log-row > summary::-webkit-details-marker { display: none; }
.tx2-log-row[open] > summary { background: rgba(255,255,255,.04); border-radius: 10px 10px 0 0; }
.tx2-log-row__body { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06);
                      color: #CBD5E1; font-size: .85rem; display: flex; flex-direction: column; gap: 8px; }
.tx2-log-row__body code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px;
                           font-family: 'SF Mono', Menlo, monospace; font-size: .8rem; }

/* ============================================================
   CLIENT — Deposit / Withdraw method picker
   ============================================================ */
.tx2-method-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .tx2-method-grid { grid-template-columns: repeat(2, 1fr); } }

.tx2-method-card { background: rgba(255,255,255,.03); border: 1.5px solid rgba(255,255,255,.1);
                   border-radius: 14px; padding: 14px; cursor: pointer; transition: all .15s ease;
                   display: flex; align-items: center; gap: 12px; min-height: 72px; }
.tx2-method-card:hover { border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.05); }
.tx2-method-card.is-selected { border-color: #D4AF37; background: rgba(212,175,55,.1); }
.tx2-method-card__icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
                          justify-content: center; font-size: 22px; flex-shrink: 0; }
.tx2-method-card__body { flex: 1; min-width: 0; }
.tx2-method-card__name { color: #F8FAFC; font-weight: 800; font-size: .98rem; overflow: hidden;
                          text-overflow: ellipsis; white-space: nowrap; }
.tx2-method-card__sub { color: #94A3B8; font-size: .78rem; margin-top: 2px; }
.tx2-method-card__check { color: #D4AF37; font-size: 18px; opacity: 0; transition: opacity .15s ease; }
.tx2-method-card.is-selected .tx2-method-card__check { opacity: 1; }

/* Method instructions panel */
.tx2-method-detail { background: rgba(212,175,55,.04); border: 1.5px solid rgba(212,175,55,.18);
                     border-radius: 14px; padding: 16px; margin-top: 14px; }
.tx2-method-detail__qr { background: #fff; border-radius: 10px; padding: 12px; display: flex;
                          align-items: center; justify-content: center; cursor: zoom-in;
                          transition: transform .15s ease, box-shadow .15s ease; position: relative;
                          width: 100%; max-width: 360px; }
.tx2-method-detail__qr:hover { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tx2-method-detail__qr:focus-visible { outline: 2px solid #D4AF37; outline-offset: 3px; }
.tx2-method-detail__qr img { width: 100%; height: auto; max-width: 100%; display: block; }
.tx2-method-detail__qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tx2-qr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.tx2-qr-btn { background: rgba(212,175,55,.12); color: #D4AF37; border: 1px solid rgba(212,175,55,.35);
               padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: .82rem;
               font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
               transition: background .15s ease, transform .1s ease; font-family: inherit; }
.tx2-qr-btn:hover { background: rgba(212,175,55,.22); }
.tx2-qr-btn:active { transform: translateY(1px); }
.tx2-qr-btn:disabled { opacity: .6; cursor: not-allowed; }
.tx2-qr-btn--primary { background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
                       color: #0F172A; border-color: transparent; }
.tx2-qr-btn--primary:hover { background: linear-gradient(135deg, #E5C04A 0%, #C9A52E 100%); }
.tx2-qr-btn .fa-spinner { animation: tx2-spin 0.8s linear infinite; }
@keyframes tx2-spin { to { transform: rotate(360deg); } }

.tx2-method-detail__row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
                          padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap; }
.tx2-method-detail__row:last-child { border-bottom: none; }
.tx2-method-detail__label { color: #94A3B8; font-size: .82rem; }
.tx2-method-detail__value { color: #F8FAFC; font-family: 'SF Mono', Menlo, monospace; font-size: .82rem;
                             word-break: break-all; text-align: left; flex: 1 1 auto; }
.tx2-copy-btn { background: rgba(212,175,55,.15); color: #D4AF37; border: none; padding: 4px 10px;
                 border-radius: 6px; cursor: pointer; font-size: .78rem; font-weight: 700; flex-shrink: 0;
                 transition: background .15s ease, color .15s ease; font-family: inherit; }
.tx2-copy-btn:hover { background: rgba(212,175,55,.25); }
.tx2-copy-btn.is-copied { background: rgba(34,197,94,.2); color: #4ADE80; }
.tx2-copy-btn.is-failed { background: rgba(239,68,68,.2); color: #FCA5A5; }

/* QR Lightbox modal */
.tx2-qr-lightbox { position: fixed; inset: 0; z-index: 9999; display: none;
                    align-items: center; justify-content: center; padding: 16px; }
.tx2-qr-lightbox.is-open { display: flex; }
.tx2-qr-lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78);
                              backdrop-filter: blur(4px); cursor: pointer; }
.tx2-qr-lightbox__panel { position: relative; background: #1E293B; border: 1.5px solid rgba(212,175,55,.3);
                           border-radius: 16px; max-width: 480px; width: 100%; max-height: 92vh;
                           overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6);
                           display: flex; flex-direction: column; animation: tx2-lb-in .2s ease; }
@keyframes tx2-lb-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.tx2-qr-lightbox__head { display: flex; align-items: center; justify-content: space-between;
                          padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tx2-qr-lightbox__title { color: #F8FAFC; font-weight: 800; font-size: 1rem; margin: 0; }
.tx2-qr-lightbox__close { background: rgba(255,255,255,.06); color: #CBD5E1; border: none;
                           width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
                           font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
                           transition: background .15s ease; }
.tx2-qr-lightbox__close:hover { background: rgba(239,68,68,.2); color: #FCA5A5; }
.tx2-qr-lightbox__body { padding: 20px; background: #fff; display: flex; align-items: center;
                          justify-content: center; }
.tx2-qr-lightbox__body img { max-width: 100%; max-height: 60vh; display: block;
                              border-radius: 8px; }
.tx2-qr-lightbox__actions { padding: 14px 16px; display: flex; gap: 10px; justify-content: center;
                             flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.08); }

@media (max-width: 480px) {
  .tx2-qr-btn { padding: 7px 12px; font-size: .78rem; }
  .tx2-qr-actions { gap: 6px; }
  .tx2-qr-lightbox__body img { max-height: 50vh; }
}

/* ============================================================
   CLIENT — Bonus card
   ============================================================ */
.tx2-bonus-card { background: linear-gradient(135deg, rgba(212,175,55,.15) 0%, rgba(212,175,55,.05) 100%);
                  border: 1.5px solid rgba(212,175,55,.4); border-radius: 16px; padding: 16px;
                  display: flex; align-items: center; gap: 14px; }
.tx2-bonus-card__icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(212,175,55,.25);
                         color: #FFD700; display: flex; align-items: center; justify-content: center;
                         font-size: 24px; flex-shrink: 0; }
.tx2-bonus-card__body { flex: 1; min-width: 0; }
.tx2-bonus-card__title { color: #F8FAFC; font-weight: 800; font-size: 1rem; }
.tx2-bonus-card__sub { color: #CBD5E1; font-size: .82rem; margin-top: 3px; }
.tx2-bonus-card__action { flex-shrink: 0; }

/* ============================================================
   CLIENT — AI chat widget
   ============================================================ */
.tx2-ai-fab { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 7000;
              width: 56px; height: 56px; border-radius: 50%;
              background: linear-gradient(135deg, #D4AF37 0%, #B8901E 100%);
              color: #1A1A1A; border: none; cursor: pointer; box-shadow: 0 8px 24px rgba(212,175,55,.45);
              display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tx2-ai-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(212,175,55,.55); }

.tx2-ai-panel { position: fixed; bottom: 88px; inset-inline-start: 16px; z-index: 7000;
                width: calc(100% - 32px); max-width: 380px; height: 60vh; max-height: 540px;
                background: linear-gradient(180deg, #1A2238 0%, #0D1326 100%); border: 1px solid rgba(212,175,55,.3);
                border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6); display: none;
                flex-direction: column; overflow: hidden; }
.tx2-ai-panel.is-open { display: flex; }
.tx2-ai-panel__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
                       border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(212,175,55,.05); }
.tx2-ai-panel__head .icon { width: 32px; height: 32px; border-radius: 50%; background: rgba(212,175,55,.2);
                              color: #D4AF37; display: flex; align-items: center; justify-content: center; }
.tx2-ai-panel__head .title { flex: 1; color: #F8FAFC; font-weight: 800; font-size: .95rem; }
.tx2-ai-panel__head .close { background: none; border: none; color: #94A3B8; cursor: pointer; font-size: 18px; }
.tx2-ai-panel__body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tx2-ai-panel__bubble { padding: 10px 14px; border-radius: 14px; max-width: 86%; word-break: break-word;
                         line-height: 1.55; font-size: .95rem; }
.tx2-ai-panel__bubble--user { align-self: flex-end; background: rgba(59,130,246,.18); color: #DBEAFE; }
.tx2-ai-panel__bubble--ai   { align-self: flex-start; background: rgba(212,175,55,.12); color: #FEF3C7; }
.tx2-ai-panel__foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08);
                       padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); align-items: center; }
.tx2-ai-panel__foot input { flex: 1; min-height: 44px; padding: 10px 14px; border-radius: 12px;
                              background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
                              color: #F8FAFC; font-family: inherit;
                              /* PHASE-AT-iOS-FIX: 16px prevents iOS Safari auto-zoom on focus */
                              font-size: 16px; line-height: 1.4; outline: none;
                              -webkit-appearance: none; appearance: none;
                              touch-action: manipulation;
                              -webkit-tap-highlight-color: transparent; }
.tx2-ai-panel__foot input:focus { border-color: rgba(212,175,55,.55); background: rgba(255,255,255,.07); }
.tx2-ai-panel__foot button { min-width: 44px; height: 44px; border-radius: 12px;
                               background: #D4AF37; color: #1A1A1A; border: none; cursor: pointer; font-weight: 800;
                               font-size: 15px; touch-action: manipulation;
                               -webkit-tap-highlight-color: transparent; transition: transform .15s, box-shadow .15s; }
.tx2-ai-panel__foot button:active { transform: scale(.96); }
.tx2-ai-panel__foot button:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Toast hide animation
   ============================================================ */
.tx2-toast--hide { opacity: 0; transform: translateY(-6px); transition: all .35s ease; }

/* ============================================================
   Side menu cleanup (RTL — open from right + proper cleanup)
   ============================================================ */
body.menu-open { overflow: hidden; }
/* When menu is closed, reset everything that could leak */
body:not(.menu-open):not(.modal-open) { overflow-x: hidden; pointer-events: auto; }
.backdrop { pointer-events: auto; }
.backdrop:not(.show) { pointer-events: none; opacity: 0; }

/* ============================================================
   FAILSAFE — prevent any white screen on errors
   ============================================================ */
html, body { min-height: 100vh; background: #070B1A; color: #E2E8F0; }
img { max-width: 100%; height: auto; }
button, a { color: inherit; }



/* ============================================================
   PHASE-AT-iOS-FIX — Mobile-friendly live support widget
   Goal: prevent iOS Safari auto-zoom + nicer mobile dimensions
   ============================================================ */
/* All chat inputs across the widget should be at least 16px on mobile
   to avoid iOS Safari focus-zoom. Apply globally just in case. */
.tx2-ai-panel input,
.tx2-ai-panel textarea,
.tx2-ai-panel select {
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
}

/* On phones, give the panel more breathing room and proper safe areas */
@media (max-width: 480px) {
  .tx2-ai-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    inset-inline-start: 16px;
    width: 54px; height: 54px;
  }
  .tx2-ai-panel {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    inset-inline-start: 12px;
    inset-inline-end: 12px;
    width: auto;
    max-width: none;
    height: 70vh;
    max-height: calc(100vh - 120px - env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
  }
  .tx2-ai-panel__head { padding: 14px 16px; }
  .tx2-ai-panel__head .title { font-size: 1rem; }
  .tx2-ai-panel__body { padding: 14px; gap: 12px; }
  .tx2-ai-panel__bubble { font-size: 1rem; padding: 11px 15px; max-width: 88%; }
  .tx2-ai-panel__foot { padding: 12px; gap: 10px; }
  .tx2-ai-panel__foot input { min-height: 46px; padding: 11px 14px; border-radius: 14px; }
  .tx2-ai-panel__foot button { min-width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
}

/* Extra tiny screens (iPhone SE etc.) */
@media (max-width: 360px) {
  .tx2-ai-panel { inset-inline-start: 8px; inset-inline-end: 8px; }
  .tx2-ai-panel__foot { padding: 10px; gap: 8px; }
}
