.ast-wrap{--ast-primary:#2563eb;--ast-primary-dark:#1d4ed8;--ast-bg:#f4f7fb;--ast-card:#fff;--ast-border:#e4e9f2;--ast-text:#162033;--ast-muted:#72809a;--ast-success:#16a34a;--ast-warning:#d97706;--ast-danger:#dc2626;font-family:inherit;color:var(--ast-text);background:var(--ast-bg);border:1px solid var(--ast-border);border-radius:22px;overflow:hidden;box-shadow:0 18px 55px rgba(28,43,74,.08);min-height:620px}.ast-wrap *{box-sizing:border-box}.ast-shell{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:620px}.ast-sidebar{background:#101827;color:#fff;padding:26px 18px;display:flex;flex-direction:column}.ast-brand{display:flex;gap:12px;align-items:center;padding:0 8px 25px;border-bottom:1px solid rgba(255,255,255,.1)}.ast-brand-icon{width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,#3b82f6,#1d4ed8);display:flex;align-items:center;justify-content:center;font-size:20px}.ast-brand strong{display:block;font-size:15px}.ast-brand small{display:block;color:#9ca9bc;margin-top:3px}.ast-nav{display:flex;flex-direction:column;gap:7px;margin-top:24px}.ast-nav a,.ast-nav button{border:0;background:transparent;color:#bac5d6;text-align:right;padding:12px 13px;border-radius:11px;text-decoration:none;cursor:pointer;font:inherit;display:flex;align-items:center;justify-content:space-between}.ast-nav a:hover,.ast-nav a.is-active,.ast-nav button:hover{background:rgba(255,255,255,.09);color:#fff}.ast-nav-badge{background:#ef4444;color:#fff;font-size:10px;min-width:20px;height:20px;border-radius:99px;display:inline-flex;align-items:center;justify-content:center}.ast-userbox{margin-top:auto;padding:16px 10px 0;border-top:1px solid rgba(255,255,255,.1)}.ast-userbox strong{font-size:13px;display:block}.ast-userbox small{color:#8fa0b7}.ast-main{padding:28px;min-width:0}.ast-page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.ast-page-head h2{font-size:24px;margin:0 0 5px}.ast-page-head p{margin:0;color:var(--ast-muted)}.ast-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:11px;padding:11px 18px;font:inherit;font-weight:700;cursor:pointer;text-decoration:none;transition:.2s}.ast-btn-primary{background:var(--ast-primary);color:#fff}.ast-btn-primary:hover{background:var(--ast-primary-dark);color:#fff;transform:translateY(-1px)}.ast-btn-secondary{background:#eef3fb;color:#334155}.ast-btn-danger{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}.ast-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:22px}.ast-stat{background:#fff;border:1px solid var(--ast-border);border-radius:16px;padding:18px}.ast-stat-top{display:flex;align-items:center;justify-content:space-between}.ast-stat-icon{width:38px;height:38px;border-radius:12px;background:#eff6ff;color:var(--ast-primary);display:flex;align-items:center;justify-content:center}.ast-stat strong{font-size:25px;display:block;margin-top:14px}.ast-stat span{font-size:12px;color:var(--ast-muted)}.ast-card{background:#fff;border:1px solid var(--ast-border);border-radius:17px;padding:22px;box-shadow:0 6px 20px rgba(27,39,66,.035)}.ast-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.ast-toolbar h3{margin:0;font-size:17px}.ast-search{max-width:270px}.ast-wrap input,.ast-wrap select,.ast-wrap textarea{width:100%;border:1px solid #d9e0eb;border-radius:10px;background:#fff;padding:11px 13px;font:inherit;color:var(--ast-text);outline:none;box-shadow:none}.ast-wrap input:focus,.ast-wrap select:focus,.ast-wrap textarea:focus{border-color:#93b4ff;box-shadow:0 0 0 3px rgba(37,99,235,.09)}.ast-table-wrap{overflow:auto}.ast-ticket-table{width:100%;border-collapse:collapse;min-width:680px}.ast-ticket-table th{text-align:right;color:#7b879c;font-size:12px;font-weight:600;padding:12px;border-bottom:1px solid var(--ast-border)}.ast-ticket-table td{padding:15px 12px;border-bottom:1px solid #edf1f6;vertical-align:middle}.ast-ticket-table tr:last-child td{border-bottom:0}.ast-ticket-table tr:hover td{background:#fafcff}.ast-subject-link{font-weight:700;color:#172033;text-decoration:none;display:block}.ast-ticket-meta{font-size:11px;color:var(--ast-muted);margin-top:4px}.ast-status{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:99px;font-size:11px;font-weight:700;white-space:nowrap}.ast-status:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.ast-status-open{background:#eff6ff;color:#2563eb}.ast-status-waiting_operator{background:#fff7ed;color:#c2410c}.ast-status-waiting_customer{background:#f5f3ff;color:#7c3aed}.ast-status-answered{background:#ecfdf5;color:#15803d}.ast-status-closed{background:#f1f5f9;color:#64748b}.ast-empty{padding:50px 20px;text-align:center;color:var(--ast-muted)}.ast-empty-icon{font-size:38px;margin-bottom:10px}.ast-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.ast-field-full{grid-column:1/-1}.ast-wrap label{display:block;font-size:12px;font-weight:700;margin-bottom:7px;color:#46536a}.ast-form-actions{display:flex;gap:10px;align-items:center;margin-top:18px}.ast-response{font-size:12px;margin-top:10px}.ast-response.is-error{color:var(--ast-danger)}.ast-response.is-success{color:var(--ast-success)}.ast-ticket-layout{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:18px}.ast-ticket-top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.ast-ticket-top h2{font-size:21px;margin:5px 0}.ast-back{color:var(--ast-primary);font-size:12px;text-decoration:none}.ast-thread{background:#f7f9fc;border:1px solid var(--ast-border);border-radius:15px;padding:18px;max-height:570px;overflow:auto}.ast-message{max-width:82%;margin-bottom:16px}.ast-message.is-customer{margin-right:auto}.ast-message.is-operator{margin-left:auto}.ast-message-bubble{padding:14px 16px;border-radius:15px;line-height:1.9;font-size:13px;box-shadow:0 4px 12px rgba(20,32,55,.04)}.ast-message.is-customer .ast-message-bubble{background:var(--ast-primary);color:#fff;border-bottom-left-radius:4px}.ast-message.is-operator .ast-message-bubble{background:#fff;border:1px solid var(--ast-border);border-bottom-right-radius:4px}.ast-message-meta{font-size:10px;color:#8490a4;margin-bottom:6px}.ast-message.is-customer .ast-message-meta{text-align:left}.ast-attachment{display:inline-flex;margin-top:9px;padding:6px 9px;background:rgba(255,255,255,.15);border-radius:7px;color:inherit;font-size:11px;text-decoration:none}.ast-reply-box{margin-top:15px;background:#fff;border:1px solid var(--ast-border);border-radius:15px;padding:14px}.ast-reply-box textarea{border:0;padding:4px;resize:vertical;min-height:95px}.ast-reply-actions{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--ast-border);padding-top:12px;margin-top:8px}.ast-file-label{cursor:pointer;color:#59677d;font-size:12px}.ast-file-label input{display:none}.ast-side-card{background:#fff;border:1px solid var(--ast-border);border-radius:15px;padding:18px;margin-bottom:14px}.ast-side-card h4{margin:0 0 14px;font-size:14px}.ast-info-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px dashed #e8edf4;font-size:12px}.ast-info-row:last-child{border-bottom:0}.ast-info-row span{color:var(--ast-muted)}.ast-process{position:relative;padding-right:20px}.ast-process:before{content:"";position:absolute;right:5px;top:8px;bottom:8px;width:2px;background:#e3e8f0}.ast-step{position:relative;padding:0 16px 18px 0;font-size:12px;color:#9aa5b6}.ast-step:before{content:"";position:absolute;right:-19px;top:4px;width:11px;height:11px;border-radius:50%;background:#d9e0eb;border:3px solid #fff;box-shadow:0 0 0 1px #d9e0eb}.ast-step.is-done{color:#27344a}.ast-step.is-done:before{background:var(--ast-primary);box-shadow:0 0 0 1px var(--ast-primary)}.ast-login-layout{display:grid;grid-template-columns:1fr 1fr;min-height:620px;background:#fff}.ast-login-visual{padding:55px;background:linear-gradient(145deg,#111827,#1e3a8a);color:#fff;display:flex;flex-direction:column;justify-content:center}.ast-login-visual h2{font-size:31px;line-height:1.5;margin:0 0 12px}.ast-login-visual p{color:#c8d4ea;line-height:2}.ast-login-features{margin-top:25px;display:grid;gap:11px;font-size:13px}.ast-login-panel{display:flex;align-items:center;justify-content:center;padding:42px}.ast-login-card{width:100%;max-width:390px}.ast-login-card h3{font-size:23px;margin:0 0 8px}.ast-login-card>p{color:var(--ast-muted);margin-bottom:26px}.ast-login-card .ast-field{margin-bottom:15px}.ast-login-card .ast-btn{width:100%;margin-top:5px}.ast-closed-note{background:#f8fafc;border:1px solid var(--ast-border);padding:15px;border-radius:12px;text-align:center;color:#64748b;margin-top:15px}@media(max-width:900px){.ast-shell{grid-template-columns:1fr}.ast-sidebar{padding:16px}.ast-nav{flex-direction:row;overflow:auto;margin-top:15px}.ast-userbox{display:none}.ast-main{padding:18px}.ast-stats{grid-template-columns:1fr 1fr}.ast-ticket-layout{grid-template-columns:1fr}.ast-login-layout{grid-template-columns:1fr}.ast-login-visual{display:none}}@media(max-width:600px){.ast-stats{grid-template-columns:1fr 1fr}.ast-page-head{align-items:flex-start;flex-direction:column}.ast-form-grid{grid-template-columns:1fr}.ast-field-full{grid-column:auto}.ast-message{max-width:94%}.ast-main{padding:14px}.ast-card{padding:15px}.ast-login-panel{padding:25px 18px}.ast-wrap{border-radius:14px}}
.ast-auth-tabs{display:grid;grid-template-columns:1fr 1fr;background:#f1f5f9;border-radius:12px;padding:4px;margin-bottom:24px}.ast-auth-tabs button{border:0;background:transparent;padding:10px;border-radius:9px;font:inherit;font-weight:700;color:#64748b;cursor:pointer}.ast-auth-tabs button.is-active{background:#fff;color:#1d4ed8;box-shadow:0 3px 10px rgba(15,23,42,.08)}.ast-auth-pane{display:none}.ast-auth-pane.is-active{display:block}.ast-auth-pane .ast-btn{width:100%;margin-top:14px}

/* v1.3 conversation experience */
.ast-ticket-page{max-width:1060px;margin:0 auto}.ast-ticket-header{margin-bottom:18px}.ast-ticket-heading{background:#fff;border:1px solid var(--ast-border);border-radius:18px;padding:20px 22px}.ast-ticket-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-top:10px}.ast-ticket-title-row h2{margin:0 0 7px;font-size:22px;line-height:1.5}.ast-current-state{display:flex;gap:12px;align-items:flex-start;margin-top:12px;padding:14px 16px;border:1px solid #dbe6f5;border-radius:14px;background:#f8fbff}.ast-current-state-icon{width:10px;height:10px;border-radius:50%;background:currentColor;margin-top:6px;box-shadow:0 0 0 5px rgba(37,99,235,.09)}.ast-current-state strong{display:block;font-size:13px}.ast-current-state p{margin:4px 0 0;color:var(--ast-muted);font-size:12px;line-height:1.8}.ast-current-state-waiting_operator{color:#c2410c;background:#fffaf5;border-color:#fed7aa}.ast-current-state-waiting_customer{color:#7c3aed;background:#faf8ff;border-color:#ddd6fe}.ast-current-state-answered{color:#15803d;background:#f4fff8;border-color:#bbf7d0}.ast-current-state-closed{color:#64748b;background:#f8fafc;border-color:#e2e8f0}.ast-conversation-card{background:#fff;border:1px solid var(--ast-border);border-radius:18px;overflow:hidden;box-shadow:0 10px 28px rgba(23,32,51,.045)}.ast-conversation-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 22px;border-bottom:1px solid var(--ast-border)}.ast-conversation-head h3{margin:0 0 4px;font-size:16px}.ast-conversation-head p{margin:0;color:var(--ast-muted);font-size:11px}.ast-last-update{color:var(--ast-muted);font-size:11px;white-space:nowrap}.ast-conversation-card .ast-thread{display:flex;flex-direction:column;gap:16px;background:#f5f7fb;border:0;border-radius:0;padding:24px;max-height:590px;min-height:320px}.ast-conversation-card .ast-message{display:flex;flex-direction:column;width:auto;max-width:min(76%,680px);margin:0!important}.ast-conversation-card .ast-message.is-customer{align-self:flex-end;align-items:flex-end}.ast-conversation-card .ast-message.is-operator{align-self:flex-start;align-items:flex-start}.ast-message-author{font-size:11px;font-weight:700;margin:0 8px 6px;color:#64748b}.ast-conversation-card .ast-message-bubble{min-width:110px;padding:13px 16px;line-height:1.9;font-size:13px}.ast-conversation-card .ast-message.is-customer .ast-message-bubble{background:var(--ast-primary);color:#fff;border:0;border-radius:16px 16px 5px 16px}.ast-conversation-card .ast-message.is-operator .ast-message-bubble{background:#fff;color:var(--ast-text);border:1px solid var(--ast-border);border-radius:16px 16px 16px 5px}.ast-message-time{font-size:10px;color:#8a96a8;margin:5px 8px 0}.ast-system-event{align-self:center;display:flex;align-items:center;gap:8px;max-width:90%;background:#fff;border:1px solid #dde5f0;border-radius:999px;padding:7px 12px;color:#64748b;font-size:10px}.ast-system-event span{width:7px;height:7px;border-radius:50%;background:#2563eb}.ast-system-event p{margin:0}.ast-system-event time{color:#9aa5b4;border-right:1px solid #e5eaf2;padding-right:8px}.ast-composer{padding:16px 20px 18px;border-top:1px solid var(--ast-border);background:#fff}.ast-composer textarea{min-height:100px;resize:vertical;border:1px solid #dce3ed;background:#fbfcfe}.ast-composer-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:12px}.ast-composer-actions{display:flex;align-items:center;gap:9px}.ast-composer .ast-file-label{display:inline-flex;align-items:center;gap:7px;margin:0;padding:9px 12px;border:1px dashed #cbd5e1;border-radius:10px;background:#f8fafc}.ast-composer .ast-file-label:before{content:"📎"}.ast-composer .ast-file-label span{font-size:11px}.ast-composer .ast-btn{padding:10px 15px;font-size:12px}@media(max-width:700px){.ast-ticket-heading{padding:16px}.ast-ticket-title-row,.ast-conversation-head,.ast-composer-footer{align-items:flex-start;flex-direction:column}.ast-last-update{white-space:normal}.ast-conversation-card .ast-thread{padding:16px}.ast-conversation-card .ast-message{max-width:90%}.ast-composer-actions{width:100%;justify-content:flex-end}.ast-composer .ast-file-label{width:100%}}

/* v1.3.2 - deterministic physical message placement */
.ast-conversation-card .ast-thread{
    direction:rtl;
}
.ast-conversation-card .ast-thread .ast-message{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    align-self:stretch !important;
    display:flex !important;
    flex-direction:column !important;
}
.ast-conversation-card .ast-thread .ast-message.is-customer{
    align-items:flex-end !important;
    text-align:right !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator{
    align-items:flex-start !important;
    text-align:right !important;
}
.ast-conversation-card .ast-thread .ast-message .ast-message-bubble{
    width:fit-content !important;
    max-width:min(76%,680px) !important;
}
.ast-conversation-card .ast-thread .ast-message.is-customer .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-customer .ast-message-time{
    width:auto !important;
    max-width:min(76%,680px) !important;
    text-align:right !important;
    align-self:flex-end !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-operator .ast-message-time{
    width:auto !important;
    max-width:min(76%,680px) !important;
    text-align:left !important;
    align-self:flex-start !important;
}
@media(max-width:700px){
    .ast-conversation-card .ast-thread .ast-message .ast-message-bubble,
    .ast-conversation-card .ast-thread .ast-message .ast-message-author,
    .ast-conversation-card .ast-thread .ast-message .ast-message-time{
        max-width:90% !important;
    }
}


/* v1.3.3 - physical right/left placement fix for RTL pages
 * The thread uses an LTR flex cross-axis so flex-end is always the physical right.
 * Message content remains RTL for Persian text.
 */
.ast-conversation-card .ast-thread{
    direction:ltr !important;
}
.ast-conversation-card .ast-thread .ast-message{
    direction:rtl !important;
    width:100% !important;
    max-width:100% !important;
    align-self:stretch !important;
}
.ast-conversation-card .ast-thread .ast-message.is-customer{
    align-items:flex-end !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator{
    align-items:flex-start !important;
}
.ast-conversation-card .ast-thread .ast-message.is-customer > *{
    align-self:flex-end !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator > *{
    align-self:flex-start !important;
}
.ast-conversation-card .ast-thread .ast-message-bubble,
.ast-conversation-card .ast-thread .ast-message-author,
.ast-conversation-card .ast-thread .ast-message-time{
    direction:rtl !important;
}
.ast-conversation-card .ast-thread .ast-system-event{
    direction:rtl !important;
    align-self:center !important;
}

/* v1.3.5 - definitive physical placement; independent of RTL/LTR and flex direction */
.ast-conversation-card .ast-thread .ast-message.is-customer > .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-customer > .ast-message-bubble,
.ast-conversation-card .ast-thread .ast-message.is-customer > .ast-message-time {
    align-self:unset !important;
    margin-left:auto !important;
    margin-right:0 !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator > .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-operator > .ast-message-bubble,
.ast-conversation-card .ast-thread .ast-message.is-operator > .ast-message-time {
    align-self:unset !important;
    margin-left:0 !important;
    margin-right:auto !important;
}
.ast-conversation-card .ast-thread .ast-message.is-customer > .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-customer > .ast-message-time {
    text-align:right !important;
}
.ast-conversation-card .ast-thread .ast-message.is-operator > .ast-message-author,
.ast-conversation-card .ast-thread .ast-message.is-operator > .ast-message-time {
    text-align:left !important;
}

.ast-login-visual{align-items:center;text-align:center}.ast-login-visual h2{margin:0;max-width:420px}.ast-login-logo{display:block;max-width:220px;max-height:120px;width:auto;height:auto;object-fit:contain;margin:0 auto 24px}


/* SLA confirmation after ticket creation */
.ast-sla-success{display:flex;flex-direction:column;gap:7px;margin:0 0 18px;padding:16px 18px;border:1px solid #b7ebc6;border-radius:14px;background:#f0fff5;color:#14532d;direction:rtl;text-align:right;box-shadow:0 8px 22px rgba(20,83,45,.06)}
.ast-sla-success strong{font-size:15px;font-weight:800}.ast-sla-success span{font-size:14px;line-height:1.9;color:#287044}

/* v1.3.11 - SLA notice directly below the latest customer message */
.ast-message.is-customer .ast-sla-inline{width:min(100%,520px);margin:10px 0 0 auto !important;align-self:flex-end !important;box-shadow:none}
.ast-message.is-customer .ast-sla-inline strong,.ast-message.is-customer .ast-sla-inline span{text-align:right !important}


/* v1.3.12 - Sidebar brand layout */
.ast-sidebar .ast-brand{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:10px!important;text-align:center!important;padding:2px 8px 24px!important}
.ast-sidebar .ast-brand-icon{display:none!important}
.ast-sidebar-logo{display:block;max-width:96px;max-height:78px;width:auto;height:auto;object-fit:contain;margin:0 auto 2px}
.ast-brand-copy{display:block;width:100%;text-align:center}
.ast-brand-copy strong{display:block;font-size:15px;line-height:1.7}
.ast-brand-copy small{display:block;color:#9ca9bc;margin-top:2px;line-height:1.6}
