.tk-dir-rtl { font-family: "Vazirmatn", Tahoma, sans-serif; direction: rtl; text-align: right; }
.tk-dir-ltr { font-family: system-ui, -apple-system, sans-serif; direction: ltr; text-align: left; }
.tk-front-box { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; box-shadow: 0 4px 20px rgba(15,23,42,.05); color: #0f172a; }
.tk-field { margin-bottom: 12px; }
.tk-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #334155; }
.tk-field input, .tk-field select, .tk-field textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 13px; font-family: inherit; }
.tk-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-btn-primary { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border: none; border-radius: 10px; background: var(--tk-primary, #4F46E5); color: #ffffff; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.tk-btn-primary:hover { opacity: .92; }
.tk-form-feedback { margin-top: 10px; font-size: 13px; font-weight: 600; color: #059669; }
.tk-portal-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
@media (max-width: 768px) { .tk-portal-grid, .tk-field-row { grid-template-columns: 1fr; } }
.tk-ticket-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #f8fafc; }
.tk-badge { background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.tk-ticket-thread { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tk-reply { padding: 10px 12px; border-radius: 10px; font-size: 13px; background: #fff; border: 1px solid #e2e8f0; }
.tk-reply-agent { background: #eef2ff; border-color: #c7d2fe; }
.tk-chat-widget { position: fixed; z-index: 99990; }
.tk-chat-launcher { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: none; background: var(--tk-primary, #4F46E5); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 12px 28px rgba(79,70,229,.35); cursor: pointer; }
.tk-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.tk-status-dot.online { background: #34d399; }
.tk-chat-drawer { width: var(--tk-w, 360px); max-width: calc(100vw - 32px); background: var(--tk-body-bg, #fff); border: 1px solid #e2e8f0; border-radius: var(--tk-radius, 18px); box-shadow: 0 20px 45px rgba(15,23,42,.18); overflow: hidden; margin-bottom: 10px; }
.tk-chat-head { background: var(--tk-primary, #4F46E5); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.tk-chat-sub { font-size: 11px; opacity: .9; margin-top: 2px; }
.tk-chat-close { background: transparent; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.tk-chat-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--tk-body-bg, #fff); }
.tk-chat-body input, .tk-chat-body select, .tk-chat-body textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 12px; font-family: inherit; background: var(--tk-input-bg, #fff); }
.tk-chat-offline-alert { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 10px; border-radius: 10px; font-size: 11px; line-height: 1.6; }
.tk-sec-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.tk-sec-chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tk-sec-chk input { width: auto !important; }
.tk-file-lbl { font-size: 11px; color: #475569; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.tk-chat-err { color: #dc2626; font-size: 11px; font-weight: 600; }
.tk-chat-messages { max-height: calc(var(--tk-h, 460px) - 180px); min-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.tk-chat-bubble { padding: 8px 12px; border-radius: 12px; font-size: 12px; max-width: 85%; position: relative; }
.tk-chat-bubble.visitor { align-self: flex-start; background: var(--tk-visitor-bg, #4F46E5); color: var(--tk-visitor-text, #fff); }
.tk-chat-bubble.agent { align-self: flex-end; background: var(--tk-agent-bg, #f1f5f9); color: var(--tk-agent-text, #0f172a); }
.tk-chat-ended-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.tk-chat-ended-box p { margin: 0; line-height: 1.6; font-weight: 600; }
.tk-reactions-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tk-react-chip { background: rgba(255,255,255,.22); border: 1px solid rgba(148,163,184,.35); border-radius: 999px; font-size: 10px; padding: 1px 6px; cursor: pointer; color: inherit; }
.tk-emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 6px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.tk-emoji-bar button { background: transparent; border: none; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.tk-mini-btn { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; }
.tk-chat-footer { display: flex; gap: 6px; padding-top: 6px; border-top: 1px solid #e2e8f0; align-items: center; }
.tk-chat-head-link { background: rgba(255,255,255,.18); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 8px; text-decoration: none; border: 1px solid rgba(255,255,255,.28); }
.tk-chat-head-link:hover { background: rgba(255,255,255,.28); color: #fff; }
.tk-logged-hint { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; background: #eef2ff; border: 1px solid #c7d2fe; color: #312e81; padding: 9px 12px; border-radius: 10px; font-size: 12px; margin-bottom: 12px; }
.tk-logged-hint a { color: #4338ca; font-weight: 700; text-decoration: none; }
.tk-user-page-banner { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 20px; margin-bottom: 14px; }
.tk-user-page-banner h1 { margin: 0 0 4px; font-size: 18px; color: #0f172a; }
.tk-user-page-banner p { margin: 0; font-size: 12px; color: #64748b; }
.tk-up-summary-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 640px) { .tk-up-summary-bar { grid-template-columns: 1fr; } }
.tk-up-stat-pill { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #334155; }
.tk-up-stat-pill strong { font-size: 16px; color: #4F46E5; }
.tk-up-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid #e2e8f0; }
.tk-up-tab { border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tk-up-tab.is-active { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.tk-up-panel { display: none; }
.tk-up-panel.is-active { display: block; }
.tk-up-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-up-panel-head h3 { margin: 0 0 3px; font-size: 15px; color: #0f172a; }
.tk-up-panel-head p { margin: 0; font-size: 12px; color: #64748b; }
.tk-up-stack { display: flex; flex-direction: column; gap: 10px; }
.tk-empty-box { padding: 18px; border-radius: 12px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #64748b; font-size: 13px; text-align: center; }
.tk-order-prefill-note { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 8px 12px; border-radius: 10px; font-size: 12px; margin-bottom: 10px; }
.tk-badge-order { background: #dcfce7; color: #166534; }
.tk-muted-time { font-size: 11px; color: #64748b; margin-inline-start: auto; }
.tk-reply-head { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; margin-bottom: 4px; }
.tk-reply-system { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.tk-reply-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.tk-ticket-reply-form textarea, .tk-user-chat-followup-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 12px; font-family: inherit; }
.tk-woo-order-support-box { margin-top: 16px; padding: 14px 18px; border-radius: 14px; background: #eef2ff; border: 1px solid #c7d2fe; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.tk-woo-order-support-box strong { display: block; font-size: 14px; color: #1e1b4b; }
.tk-woo-order-support-box span { font-size: 12px; color: #4338ca; }
