/* =============================================================
   ACC Chat Widget — ویجت چت شناور
   ============================================================= */

/* ── Variables ──────────────────────────────────────────── */
:root {
    --cw-primary:   #3b82f6;
    --cw-primary-d: #1d4ed8;
    --cw-bg:        #ffffff;
    --cw-surface:   #f8fafc;
    --cw-border:    #e2e8f0;
    --cw-text:      #1e293b;
    --cw-muted:     #94a3b8;
    --cw-radius:    16px;
    --cw-shadow:    0 20px 60px rgba(0,0,0,.18), 0 4px 20px rgba(0,0,0,.1);
    --cw-z:         99999;
    --cw-w:         360px;
    --cw-h:         520px;
}

/* ── Launcher Button ─────────────────────────────────────── */
#acc-chat-launcher {
    position:       fixed;
    bottom:         24px;
    right:          24px;
    z-index:        var(--cw-z);
    display:        flex !important;
    flex-direction: column;
    align-items:    center;
    gap:            6px;
    cursor:         pointer;
    user-select:    none;
}
#acc-chat-launcher.cw-hidden {
    display: none !important;
}

.cw-launcher-btn {
    width:           56px;
    height:          56px;
    border-radius:   50%;
    background:      linear-gradient(135deg, var(--cw-primary), #6366f1);
    color:           #fff;
    font-size:       26px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    box-shadow:      0 4px 20px rgba(59,130,246,.45);
    transition:      transform .2s, box-shadow .2s;
    animation:       cwPulseRing 3s infinite;
}
#acc-chat-launcher:hover .cw-launcher-btn {
    transform:  scale(1.1);
    box-shadow: 0 6px 28px rgba(59,130,246,.6);
}

@keyframes cwPulseRing {
    0%,70%,100% { box-shadow: 0 4px 20px rgba(59,130,246,.45); }
    35% { box-shadow: 0 4px 20px rgba(59,130,246,.45), 0 0 0 10px rgba(59,130,246,.12); }
}

.cw-launcher-label {
    font-size:        11px;
    background:       rgba(30,41,59,.8);
    color:            #fff;
    padding:          3px 8px;
    border-radius:    10px;
    white-space:      nowrap;
    backdrop-filter:  blur(6px);
    font-family:      Tahoma, sans-serif;
}

/* ── Badge ───────────────────────────────────────────────── */
.cw-badge {
    position:        absolute;
    top:             -4px;
    left:            -4px;
    min-width:       18px;
    height:          18px;
    background:      #ef4444;
    color:           #fff;
    font-size:       10px;
    font-weight:     700;
    border-radius:   9px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         0 4px;
    opacity:         0;
    transform:       scale(.5);
    transition:      opacity .2s, transform .2s;
    border:          2px solid #fff;
    font-family:     monospace;
}
.cw-badge.show { opacity:1; transform:scale(1); }

/* ── Chat Window ─────────────────────────────────────────── */
#acc-chat-window {
    position:       fixed;
    bottom:         96px;
    right:          24px;
    z-index:        var(--cw-z);
    width:          var(--cw-w);
    height:         var(--cw-h);
    background:     var(--cw-bg);
    border-radius:  var(--cw-radius);
    box-shadow:     var(--cw-shadow);
    display:        flex;
    flex-direction: column;
    overflow:       hidden;
    opacity:        0;
    transform:      scale(.9) translateY(20px);
    pointer-events: none;
    transition:     opacity .25s cubic-bezier(.4,0,.2,1),
                    transform .25s cubic-bezier(.4,0,.2,1);
    font-family:    Tahoma, 'Vazir', 'IRANSans', sans-serif;
    direction:      rtl;
    font-size:      13px;
    color:          var(--cw-text);
}
#acc-chat-window.open {
    opacity:        1;
    transform:      scale(1) translateY(0);
    pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.cw-header {
    background:  linear-gradient(135deg, var(--cw-primary), #6366f1);
    color:       #fff;
    padding:     14px 14px 12px;
    display:     flex;
    align-items: center;
    gap:         10px;
    flex-shrink: 0;
}
.cw-header-avatar {
    width:           40px;
    height:          40px;
    background:      rgba(255,255,255,.2);
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       20px;
    flex-shrink:     0;
}
.cw-header-info { flex:1; min-width:0; }
.cw-header-name { font-size:14px; font-weight:700; }
.cw-header-status {
    font-size:   11px;
    opacity:     .85;
    display:     flex;
    align-items: center;
    gap:         5px;
    margin-top:  2px;
}
.cw-status-dot {
    width:        7px;
    height:       7px;
    background:   #4ade80;
    border-radius:50%;
    animation:    cwDotPulse 2s infinite;
}
@keyframes cwDotPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.cw-header-close {
    background:      rgba(255,255,255,.2);
    border:          none;
    border-radius:   50%;
    width:           28px;
    height:          28px;
    color:           #fff;
    font-size:       14px;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      background .15s;
    flex-shrink:     0;
}
.cw-header-close:hover { background:rgba(255,255,255,.35); }

/* ── Loading Bar ─────────────────────────────────────────── */
.cw-loading-bar {
    height:      3px;
    background:  transparent;
    flex-shrink: 0;
    overflow:    hidden;
}
.cw-loading-bar.active {
    background: linear-gradient(90deg,transparent,var(--cw-primary),transparent);
    background-size: 200%;
    animation:  cwLoad .8s linear infinite;
}
@keyframes cwLoad { from{background-position:-200%} to{background-position:200%} }

/* ── Tabs ────────────────────────────────────────────────── */
.cw-tabs {
    display:       flex;
    border-bottom: 1px solid var(--cw-border);
    background:    var(--cw-bg);
    flex-shrink:   0;
}
.cw-tab {
    flex:           1;
    border:         none;
    background:     transparent;
    padding:        9px 4px 8px;
    font-size:      11px;
    font-weight:    600;
    color:          var(--cw-muted);
    cursor:         pointer;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            3px;
    border-bottom:  2px solid transparent;
    transition:     color .15s, border-color .15s;
    font-family:    inherit;
}
.cw-tab:hover  { color: var(--cw-primary); }
.cw-tab.active { color: var(--cw-primary); border-bottom-color: var(--cw-primary); }
.cw-tab-icon { font-size:16px; }

/* ── Panels ──────────────────────────────────────────────── */
.cw-panel {
    display:        none;
    flex:           1;
    flex-direction: column;
    overflow:       hidden;
    min-height:     0;
}
.cw-panel.active { display:flex; }
#cw-panel-services .cw-home,
#cw-panel-services .cw-wizard { flex: 1; overflow-y: auto; min-height: 0; }

/* ── Home Panel ──────────────────────────────────────────── */
.cw-home {
    padding:        16px;
    overflow-y:     auto;
    flex:           1;
    display:        flex;
    flex-direction: column;
    gap:            14px;
}
.cw-welcome-card {
    background:    linear-gradient(135deg,#eff6ff,#f0f9ff);
    border:        1px solid #bfdbfe;
    border-radius: 12px;
    padding:       18px 14px;
    text-align:    center;
}
.cw-welcome-icon  { font-size:32px; margin-bottom:8px; }
.cw-welcome-title { font-size:15px; font-weight:700; color:var(--cw-text); }
.cw-welcome-sub   { font-size:12px; color:var(--cw-muted); margin-top:5px; line-height:1.6; }

.cw-quick-actions {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   8px;
}
.cw-qa-btn {
    background:      var(--cw-surface);
    border:          1px solid var(--cw-border);
    border-radius:   10px;
    padding:         10px 8px;
    cursor:          pointer;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             5px;
    font-size:       11px;
    font-weight:     600;
    color:           var(--cw-text);
    text-decoration: none;
    transition:      background .12s, border-color .12s;
    text-align:      center;
}
.cw-qa-btn:hover { background:#eff6ff; border-color:var(--cw-primary); color:var(--cw-primary); }
.cw-qa-icon { font-size:20px; }

/* ── Chat Panel ──────────────────────────────────────────── */
.cw-visitor-form {
    padding:        16px;
    display:        flex;
    flex-direction: column;
    gap:            10px;
    border-bottom:  1px solid var(--cw-border);
    flex-shrink:    0;
    background:     var(--cw-bg);
}
.cw-visitor-form h4 {
    margin:      0;
    font-size:   12px;
    color:       var(--cw-text);
    font-weight: 600;
}
.cw-visitor-input {
    border:        1px solid var(--cw-border);
    border-radius: 8px;
    padding:       8px 12px;
    font-size:     12px;
    font-family:   inherit;
    outline:       none;
    direction:     rtl;
    transition:    border-color .15s;
    width:         100%;
    box-sizing:    border-box;
}
.cw-visitor-input:focus { border-color: var(--cw-primary); }

.cw-start-btn {
    background:    linear-gradient(135deg, var(--cw-primary), #6366f1);
    color:         #fff;
    border:        none;
    border-radius: 8px;
    padding:       9px 0;
    font-size:     13px;
    font-weight:   700;
    cursor:        pointer;
    font-family:   inherit;
    width:         100%;
    transition:    opacity .15s;
}
.cw-start-btn:hover { opacity:.88; }

/* ── Chat Area (Messages) ────────────────────────────────── */
.cw-chat-area {
    flex:           1;
    overflow-y:     auto;
    padding:        12px 12px 6px;
    display:        flex;
    flex-direction: column;
    gap:            8px;
    background:     var(--cw-surface);
}
.cw-msg {
    display:    flex;
    align-items:flex-end;
    gap:        6px;
    animation:  cwMsgIn .2s ease;
}
@keyframes cwMsgIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

.cw-msg--out    { flex-direction:row-reverse; }
.cw-msg--in     { flex-direction:row; }
.cw-msg--system { justify-content:center; }

.cw-msg-avatar {
    width:           28px;
    height:          28px;
    background:      linear-gradient(135deg, var(--cw-primary), #6366f1);
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       14px;
    flex-shrink:     0;
}
.cw-msg-bubble {
    max-width:     68%;
    padding:       8px 12px;
    border-radius: 14px;
    font-size:     12px;
    line-height:   1.6;
    word-break:    break-word;
}
.cw-msg--out .cw-msg-bubble  { background:var(--cw-primary); color:#fff; border-bottom-right-radius:3px; }
.cw-msg--in  .cw-msg-bubble  { background:#fff; border:1px solid var(--cw-border); color:var(--cw-text); border-bottom-left-radius:3px; }
.cw-msg--system .cw-msg-bubble {
    background: transparent;
    border:     none;
    color:      var(--cw-muted);
    font-size:  11px;
    text-align: center;
    padding:    4px 8px;
}
.cw-msg-time {
    display:    block;
    font-size:  10px;
    opacity:    .65;
    margin-top: 3px;
    text-align: left;
}

/* ── Input Area ──────────────────────────────────────────── */
.cw-input-area {
    padding:     8px 10px;
    border-top:  1px solid var(--cw-border);
    display:     flex;
    gap:         6px;
    align-items: flex-end;
    background:  var(--cw-bg);
    flex-shrink: 0;
}
.cw-input {
    flex:          1;
    border:        1px solid var(--cw-border);
    border-radius: 10px;
    padding:       7px 11px;
    font-size:     12px;
    font-family:   inherit;
    resize:        none;
    outline:       none;
    direction:     rtl;
    transition:    border-color .15s;
    max-height:    80px;
    overflow-y:    auto;
}
.cw-input:focus { border-color: var(--cw-primary); }
.cw-send-btn {
    background:      var(--cw-primary);
    color:           #fff;
    border:          none;
    border-radius:   8px;
    width:           36px;
    height:          36px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       16px;
    cursor:          pointer;
    flex-shrink:     0;
    transition:      background .15s;
}
.cw-send-btn:hover { background: var(--cw-primary-d); }

/* ── Contact Panel ───────────────────────────────────────── */
.cw-contact {
    padding:    16px;
    overflow-y: auto;
    flex:       1;
}
.cw-contact-title {
    font-size:     14px;
    font-weight:   700;
    margin-bottom: 14px;
    color:         var(--cw-text);
}
.cw-contact-list { display:flex; flex-direction:column; gap:10px; }
.cw-contact-item {
    display:         flex;
    align-items:     center;
    gap:             12px;
    padding:         12px 14px;
    background:      var(--cw-surface);
    border:          1px solid var(--cw-border);
    border-radius:   10px;
    text-decoration: none;
    color:           var(--cw-text);
    font-size:       13px;
    transition:      background .12s;
}
.cw-contact-item:hover { background:#eff6ff; border-color:var(--cw-primary); }
.cw-contact-icon {
    width:           40px;
    height:          40px;
    border-radius:   10px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       20px;
    flex-shrink:     0;
}
.cw-contact-label { font-size:11px; color:var(--cw-muted); margin-top:2px; }

/* ── Scrollbar ───────────────────────────────────────────── */
.cw-chat-area::-webkit-scrollbar,
.cw-home::-webkit-scrollbar,
.cw-contact::-webkit-scrollbar { width:4px; }
.cw-chat-area::-webkit-scrollbar-track,
.cw-home::-webkit-scrollbar-track,
.cw-contact::-webkit-scrollbar-track { background:transparent; }
.cw-chat-area::-webkit-scrollbar-thumb,
.cw-home::-webkit-scrollbar-thumb,
.cw-contact::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:2px; }

/* ── Mobile — fullscreen + large readable type ─────────── */
@media (max-width: 720px) {
    #acc-chat-window {
        position:       fixed;
        inset:            0;
        bottom:           auto;
        left:             0;
        right:            0;
        top:              0;
        width:            100%;
        height:           100dvh;
        max-height:       100dvh;
        border-radius:    0;
        box-shadow:       none;
        padding-top:      env(safe-area-inset-top, 0);
        padding-bottom:   env(safe-area-inset-bottom, 0);
        font-size:        17px;
    }
    #acc-chat-window.open {
        transform: none;
    }
    #acc-chat-launcher.cw-hidden {
        display: none !important;
    }
    body.cw-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
    .cw-header {
        padding: 12px 14px;
        padding-top: max(12px, env(safe-area-inset-top));
    }
    .cw-home, .cw-contact, .cw-chat-area {
        padding: 14px 16px;
    }
    .cw-tabs {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .cw-tab {
        padding: 12px 4px 10px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        min-height: 58px !important;
        line-height: 1.25 !important;
    }
    .cw-tab-icon { font-size: 26px !important; }
    #acc-chat-launcher {
        right: 14px;
        bottom: max(14px, env(safe-area-inset-bottom));
        z-index: 99999;
    }

    /* Phone typography — deliberately large */
    .cw-launcher-label {
        font-size: 15px !important;
        padding: 6px 12px !important;
        font-weight: 600 !important;
    }
    .cw-launcher-btn {
        width: 64px !important;
        height: 64px !important;
        font-size: 30px !important;
    }
    .cw-badge {
        min-width: 22px !important;
        height: 22px !important;
        font-size: 13px !important;
        line-height: 22px !important;
    }
    .cw-header-name { font-size: 18px !important; font-weight: 800 !important; }
    .cw-header-status,
    .cw-header small { font-size: 14px !important; }
    .cw-welcome-icon { font-size: 42px !important; }
    .cw-welcome-title { font-size: 19px !important; font-weight: 800 !important; }
    .cw-welcome-sub { font-size: 16px !important; line-height: 1.65 !important; }
    .cw-qa-item,
    .cw-qa-q,
    .cw-qa-a,
    .cw-quick-btn,
    .cw-action-btn {
        font-size: 16px !important;
        line-height: 1.5 !important;
        min-height: 48px;
        padding: 12px 14px !important;
    }
    .cw-qa-icon { font-size: 24px !important; }
    .cw-msg,
    .cw-msg-bubble,
    .cw-bubble,
    .cw-message,
    .cw-message__text,
    #acc-chat-window .cw-msg-text {
        font-size: 17px !important;
        line-height: 1.65 !important;
    }
    .cw-msg-time,
    .cw-meta,
    .cw-hint {
        font-size: 13px !important;
    }
    .cw-input,
    .cw-composer textarea,
    .cw-composer input,
    #acc-chat-window textarea,
    #acc-chat-window input[type="text"],
    #acc-chat-window input[type="tel"] {
        font-size: 17px !important;
        min-height: 48px !important;
        padding: 12px 14px !important;
    }
    .cw-send,
    .cw-composer button {
        font-size: 18px !important;
        min-width: 48px;
        min-height: 48px;
    }
    .cw-contact-label,
    .cw-service-label,
    .cw-case-meta,
    .cw-tl-item,
    .cw-pay-label,
    .cw-case-title {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
    .cw-service-icon { font-size: 28px !important; }
    .cw-pay-amount { font-size: 26px !important; font-weight: 800 !important; }
    .cw-service-card,
    .cw-case-card {
        padding: 14px !important;
    }

    /* Shop / wholesale AI panels inside widget */
    .shop-ai,
    .ws-ai,
    .shop-ai__body,
    .ws-ai__body {
        font-size: 17px !important;
        line-height: 1.6 !important;
    }
    .shop-ai__head,
    .ws-ai__head {
        font-size: 17px !important;
        font-weight: 700 !important;
    }
    .shop-ai__head small,
    .ws-ai__head small,
    .shop-ai__typing,
    .ws-ai__typing {
        font-size: 14px !important;
    }
    .shop-ai-sug,
    .shop-ai__chips button,
    .ws-ai__chips button {
        font-size: 16px !important;
        padding: 10px 14px !important;
        min-height: 44px;
        line-height: 1.4 !important;
    }
    .shop-ai__input-row textarea,
    .ws-ai__input-row textarea {
        font-size: 17px !important;
        min-height: 48px !important;
    }
    .shop-ai__input-row button,
    .ws-ai__input-row button {
        width: 48px !important;
        height: 48px !important;
        font-size: 18px !important;
    }
}

@media (max-width: 480px) and (min-width: 641px) {
    #acc-chat-window {
        bottom:        0;
        left:          0;
        right:         0;
        width:         100%;
        height:        100dvh;
        border-radius: 0;
    }
}

/* ── Tracking Code Card ──────────────────────────────────── */
.cw-tracking-card {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    color: #fff;
    margin: 4px 0;
}
.cw-tracking-label {
    font-size: 11px;
    opacity: .85;
    margin-bottom: 6px;
}
.cw-tracking-code {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 6px;
    font-family: monospace;
    background: rgba(255,255,255,.15);
    border-radius: 8px;
    padding: 6px 12px;
    margin: 6px auto;
    display: inline-block;
}
.cw-tracking-hint {
    font-size: 10px;
    opacity: .8;
    line-height: 1.5;
    margin: 6px 0 8px;
}
.cw-copy-btn {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    padding: 4px 14px;
    cursor: pointer;
    transition: background .2s;
}
.cw-copy-btn:hover { background: rgba(255,255,255,.35); }

/* ── Support Hub ───────────────────────────────────────── */
.cw-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-text);
    margin: 8px 0 10px;
}
.cw-service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cw-service-card {
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.cw-service-card:active,
.cw-service-card:hover {
    border-color: var(--cw-primary);
    background: #eff6ff;
}
.cw-service-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.cw-service-label { font-size: 11px; font-weight: 600; line-height: 1.4; }
.cw-case-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}
.cw-case-card:active { background: #eff6ff; }
.cw-case-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 800;
    color: #1d4ed8;
    letter-spacing: 2px;
}
.cw-case-meta { font-size: 11px; color: var(--cw-muted); margin-top: 4px; }
.cw-case-bar {
    padding: 8px 12px;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.cw-track-lookup { margin-bottom: 12px; }
.cw-back-btn {
    background: none;
    border: none;
    color: var(--cw-primary);
    font-size: 12px;
    cursor: pointer;
    padding: 0 0 8px;
    font-family: inherit;
}
.cw-empty {
    text-align: center;
    color: var(--cw-muted);
    font-size: 12px;
    padding: 24px 12px;
}
.cw-wizard {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cw-recent-cases { margin-top: 8px; }
.cw-track-detail { padding: 0 16px 16px; }
.cw-timeline { margin-top: 8px; }
.cw-tl-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.cw-tl-dot { width: 8px; height: 8px; background: #3b82f6; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.cw-pay-card {
    margin: 12px 0;
    padding: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}
.cw-pay-label { font-size: 12px; color: #475569; margin-bottom: 6px; }
.cw-pay-amount { font-size: 22px; font-weight: 800; color: #1d4ed8; margin-bottom: 10px; }
.cw-pay-btn { margin-top: 4px; }

.cw-rounds { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 180px; overflow-y: auto; }
.cw-round { padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid #e2e8f0; border-right: 3px solid #93c5fd; font-size: 11.5px; }
.cw-round--accepted { border-right-color: #22c55e; }
.cw-round--rejected { border-right-color: #ef4444; }
.cw-round-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; }
.cw-round-badge { font-size: 10px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; }
.cw-round-val { margin-top: 3px; font-weight: 800; color: #1d4ed8; }
.cw-round-terms { margin-top: 3px; color: #64748b; line-height: 1.7; }

/* ── Technician Panel (ویجت کارشناس) ───────────────────── */
.cw-tech-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.cw-tech-login { flex: 1; overflow-y: auto; }
.cw-tech-hint {
    font-size: 10px;
    color: var(--cw-muted);
    text-align: center;
    margin-top: 10px;
    line-height: 1.6;
}
.cw-tech-hint code { background: #f1f5f9; padding: 1px 4px; border-radius: 3px; }
.cw-tech-err {
    color: #dc2626;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
    min-height: 18px;
}
.cw-tech-app {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.cw-tech-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}
.cw-tech-logout-btn {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.cw-tech-list-view { flex: 1; overflow-y: auto; }
.cw-tech-chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 12px 8px;
    overflow: hidden;
}
.cw-tech-chat-view .cw-chat-area {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    margin: 8px 0;
}
.cw-tech-job-info {
    padding: 8px 0;
    border-bottom: 1px solid var(--cw-border);
    font-size: 12px;
}
.cw-tech-start-btn {
    margin-top: 8px;
    width: 100%;
    font-size: 12px;
    padding: 8px;
}
.cw-tech-status-pill {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 700;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 8px;
}
.cw-tech-job-card { border-right: 3px solid #3b82f6; }

/* Shop AI Advisor */
.cw-ai-mount { height: 100%; min-height: 320px; display: flex; flex-direction: column; }
.shop-ai { display: flex; flex-direction: column; height: 100%; font-size: 13px; }
.shop-ai__head { padding: 10px 14px; background: linear-gradient(135deg,#ecfdf5,#f0fdf4); border-bottom: 1px solid var(--cw-border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.shop-ai__head small { font-weight: 400; color: #64748b; font-size: 10px; }
.shop-ai__msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.shop-ai-msg { display: flex; }
.shop-ai-msg--user { justify-content: flex-end; }
.shop-ai-msg--bot { justify-content: flex-start; }
.shop-ai-msg__bubble { max-width: 88%; padding: 10px 12px; border-radius: 14px; line-height: 1.55; }
.shop-ai-msg--user .shop-ai-msg__bubble { background: #1b4332; color: #fff; border-bottom-left-radius: 4px; }
.shop-ai-msg--bot .shop-ai-msg__bubble { background: #f1f5f9; color: #1e293b; border-bottom-right-radius: 4px; }
.shop-ai__typing { padding: 4px 14px; font-size: 11px; color: #94a3b8; }
.shop-ai__suggestions { padding: 0 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.shop-ai-sug { display: block; padding: 8px 10px; background: #fff; border: 1px solid var(--cw-border); border-radius: 10px; text-decoration: none; color: #1b4332; font-size: 12px; }
.shop-ai__chips { padding: 6px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.shop-ai__chips button { border: 1px solid #d1fae5; background: #ecfdf5; color: #166534; border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.shop-ai__input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cw-border); background: #fff; }
.shop-ai__input-row textarea { flex: 1; border: 1px solid var(--cw-border); border-radius: 12px; padding: 8px 10px; resize: none; font-family: inherit; font-size: 13px; }
.shop-ai__input-row button { width: 40px; height: 40px; border: none; border-radius: 50%; background: #1b4332; color: #fff; cursor: pointer; font-size: 16px; }

/* Wholesale B2B AI Advisor */
.ws-ai { display: flex; flex-direction: column; height: 100%; font-size: 13px; }
.ws-ai__head { padding: 10px 14px; background: linear-gradient(135deg,#e0f2fe,#f0f9ff); border-bottom: 1px solid var(--cw-border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #0c4a6e; }
.ws-ai__head small { font-weight: 400; color: #64748b; font-size: 10px; }
.ws-ai__msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ws-ai-msg { display: flex; }
.ws-ai-msg--user { justify-content: flex-end; }
.ws-ai-msg--bot { justify-content: flex-start; }
.ws-ai-msg__bubble { max-width: 88%; padding: 10px 12px; border-radius: 14px; line-height: 1.55; }
.ws-ai-msg--user .ws-ai-msg__bubble { background: #0c4a6e; color: #fff; border-bottom-left-radius: 4px; }
.ws-ai-msg--bot .ws-ai-msg__bubble { background: #f1f5f9; color: #1e293b; border-bottom-right-radius: 4px; }
.ws-ai__typing { padding: 4px 14px; font-size: 11px; color: #94a3b8; }
.ws-ai__chips { padding: 6px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.ws-ai__chips button { border: 1px solid #bae6fd; background: #e0f2fe; color: #0369a1; border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.ws-ai__input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cw-border); background: #fff; }
.ws-ai__input-row textarea { flex: 1; border: 1px solid var(--cw-border); border-radius: 12px; padding: 8px 10px; resize: none; font-family: inherit; font-size: 13px; }
.ws-ai__input-row button { width: 40px; height: 40px; border: none; border-radius: 50%; background: #0c4a6e; color: #fff; cursor: pointer; font-size: 16px; }

/* ══════════════════════════════════════════════════════════════
   ویزارد دومرحله‌ای درخواست خدمت — اعتبارسنجی درجا، قفل ارسال،
   و موقعیت مکانی اختیاری. مشترک بین ویجت گفتگو و مودال پورتال.
   ══════════════════════════════════════════════════════════════ */
.cw-wiz-steps {
    display:      flex;
    gap:          8px;
    list-style:   none;
    margin:       0 0 12px;
    padding:      0;
    font-size:    11px;
    color:        var(--cw-muted, #6b7280);
}
.cw-wiz-steps li {
    display:     flex;
    align-items: center;
    gap:         5px;
    flex:        1;
    padding-top: 7px;
    border-top:  2px solid var(--cw-border);
    transition:  border-color .18s, color .18s;
}
.cw-wiz-steps li span {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           16px;
    height:          16px;
    border-radius:   50%;
    background:      var(--cw-border);
    color:           #fff;
    font-size:       10px;
    font-weight:     700;
}
.cw-wiz-steps li.is-on { border-top-color: var(--cw-primary); color: var(--cw-primary); }
.cw-wiz-steps li.is-on span { background: var(--cw-primary); }
.cw-wiz-steps em { font-style: normal; opacity: .7; }

.cw-wiz-hint {
    margin:     0 0 10px;
    font-size:  11.5px;
    line-height: 1.8;
    color:      var(--cw-muted, #6b7280);
}

.cw-wiz-row { margin-bottom: 10px; }
.cw-wiz-lbl { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; }
.cw-wiz-req { color: #dc2626; margin-inline-start: 3px; }

.cw-wiz-err {
    display:    none;
    margin-top: 4px;
    font-size:  11px;
    color:      #dc2626;
    line-height: 1.6;
}
.cw-wiz-err:not(:empty) { display: block; }

.cw-visitor-input.is-invalid {
    border-color: #dc2626;
    background:   #fef2f2;
}
.cw-visitor-input.is-invalid:focus { border-color: #dc2626; }

.cw-wiz-formerr {
    margin:        10px 0 0;
    padding:       9px 12px;
    border:        1px solid #fecaca;
    border-radius: 8px;
    background:    #fef2f2;
    color:         #b91c1c;
    font-size:     11.5px;
    line-height:   1.7;
}

/* موقعیت مکانی — دکمهٔ اختیاری، نه پرامپت هنگام ارسال */
.cw-geo-btn {
    display:         flex;
    flex-direction:  column;
    align-items:     flex-start;
    gap:             2px;
    width:           100%;
    margin:          4px 0 10px;
    padding:         10px 12px;
    border:          1px dashed var(--cw-border);
    border-radius:   8px;
    background:      transparent;
    font-family:     inherit;
    text-align:      start;
    cursor:          pointer;
    transition:      border-color .15s, background .15s;
}
.cw-geo-btn:hover { border-color: var(--cw-primary); background: rgba(2, 132, 199, .04); }
.cw-geo-btn__icon  { font-size: 15px; }
.cw-geo-btn__label { font-size: 12px; font-weight: 700; color: var(--cw-primary); }
.cw-geo-btn__note  { font-size: 10.5px; color: var(--cw-muted, #6b7280); }
.cw-geo-btn.is-busy { opacity: .7; cursor: progress; }
.cw-geo-btn.is-done { border-style: solid; border-color: #16a34a; background: rgba(22, 163, 74, .06); }
.cw-geo-btn.is-done .cw-geo-btn__label { color: #16a34a; }
.cw-geo-btn.is-skip { border-color: var(--cw-border); }
.cw-geo-btn.is-skip .cw-geo-btn__label { color: var(--cw-muted, #6b7280); }

.cw-btn-plain {
    display:       block;
    width:         100%;
    margin-top:    8px;
    padding:       8px 0;
    border:        0;
    background:    none;
    color:         var(--cw-muted, #6b7280);
    font:          inherit;
    font-size:     11.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor:        pointer;
}
.cw-btn-plain:hover { color: var(--cw-primary); }

.cw-start-btn.is-loading { opacity: .65; cursor: progress; }
.cw-start-btn:disabled,
.cw-btn-secondary:disabled { opacity: .6; cursor: not-allowed; }

.cw-analyze--err { color: #b91c1c; }

/* داخل مودال پورتال خدمات، فرم عرض بیشتری دارد */
.ha-wizard-modal__box .cw-wiz-lbl   { font-size: 12.5px; }
.ha-wizard-modal__box .cw-visitor-input { font-size: 13px; padding: 10px 12px; }
.ha-wizard-modal__box .cw-start-btn { padding: 11px 0; font-size: 14px; }
