/**
 * Support tickets UI — scoped to wizard; uses wizard theme CSS variables.
 */

/* -------------------------------------------------------------------------- */
/* Sidebar Help nav — unread pill (matches primary accent, readable on dark) */
/* -------------------------------------------------------------------------- */
.pvc-wizard-wrapper .nav-item.pvc-nav-has-badge,
.wizard-modal-overlay .nav-item.pvc-nav-has-badge {
    position: relative;
}

.pvc-wizard-wrapper .nav-item[data-tab="help"] .pvc-nav-unread-badge,
.wizard-modal-overlay .nav-item[data-tab="help"] .pvc-nav-unread-badge {
    display: none;
    position: absolute;
    top: 8px;
    right: 12px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 4px var(--pvc-primary-shadow, rgba(249, 115, 22, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
    z-index: 2;
}

.pvc-wizard-wrapper .nav-item[data-tab="help"].active .pvc-nav-unread-badge,
.wizard-modal-overlay .nav-item[data-tab="help"].active .pvc-nav-unread-badge {
    top: 8px;
    right: 12px;
}

/* -------------------------------------------------------------------------- */
/* Create a Help Ticket accordion — title row + inline badge                    */
/* Contact Support form — full width, no inner scroll                          */
.pvc-wizard-wrapper .help-item-wrapper--contact-form.is-open .help-item-dropdown,
.wizard-modal-overlay .help-item-wrapper--contact-form.is-open .help-item-dropdown,
.pvc-wizard-wrapper .help-item-wrapper--contact-form.active .help-item-dropdown,
.wizard-modal-overlay .help-item-wrapper--contact-form.active .help-item-dropdown {
    max-height: min(70vh, 560px);
}

.pvc-wizard-wrapper .help-item-wrapper--contact-form .help-item-content--contact-form,
.wizard-modal-overlay .help-item-wrapper--contact-form .help-item-content--contact-form {
    max-height: none;
    overflow: visible;
}

.pvc-wizard-wrapper .help-item-content--contact-form .pvc-help-contact-form,
.wizard-modal-overlay .help-item-content--contact-form .pvc-help-contact-form {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: none;
    width: 100%;
}

.pvc-wizard-wrapper .pvc-help-contact-label,
.wizard-modal-overlay .pvc-help-contact-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pvc-text, #1f2937);
}

.pvc-wizard-wrapper .pvc-help-contact-input,
.pvc-wizard-wrapper .pvc-help-contact-textarea,
.wizard-modal-overlay .pvc-help-contact-input,
.wizard-modal-overlay .pvc-help-contact-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--pvc-border, #d1d5db);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--pvc-surface, #fff);
    color: var(--pvc-text, #111827);
}

.pvc-wizard-wrapper .pvc-help-contact-textarea,
.wizard-modal-overlay .pvc-help-contact-textarea {
    resize: vertical;
    min-height: 88px;
    max-height: 160px;
}

.pvc-wizard-wrapper .pvc-help-contact-actions,
.wizard-modal-overlay .pvc-help-contact-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.pvc-wizard-wrapper .pvc-help-contact-submit,
.wizard-modal-overlay .pvc-help-contact-submit {
    appearance: none;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: #ffffff;
}

.pvc-wizard-wrapper .pvc-help-contact-submit:disabled,
.wizard-modal-overlay .pvc-help-contact-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.pvc-wizard-wrapper .pvc-help-contact-status,
.wizard-modal-overlay .pvc-help-contact-status {
    font-size: 13px;
    color: var(--pvc-muted, #6b7280);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-help-contact-label {
    color: #e5e7eb;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-help-contact-input,
.wizard-modal-overlay[data-theme="dark"] .pvc-help-contact-textarea {
    background: #121a24;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f4f6;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-help-contact-status {
    color: #9ca3af;
}
/* -------------------------------------------------------------------------- */
.pvc-wizard-wrapper .help-item-title-with-badge,
.wizard-modal-overlay .help-item-title-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #333;
}

.pvc-wizard-wrapper .help-item-title-text,
.wizard-modal-overlay .help-item-title-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pvc-wizard-wrapper .help-item-title-text i.fas,
.wizard-modal-overlay .help-item-title-text i.fas {
    color: var(--pvc-primary, #2a5f86);
    flex-shrink: 0;
}

.pvc-wizard-wrapper .pvc-support-contact-badge,
.wizard-modal-overlay .pvc-support-contact-badge {
    display: none;
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 3px var(--pvc-primary-shadow, rgba(249, 115, 22, 0.35));
}

.wizard-modal-overlay[data-theme="dark"] .help-item-title-with-badge {
    color: #ffffff !important;
}

.wizard-modal-overlay[data-theme="dark"] .help-item-title-text i.fas {
    color: #fb923c !important;
}

/* Taller content for ticket thread */
.pvc-wizard-wrapper .help-item-wrapper--support.is-open .help-item-dropdown--support,
.wizard-modal-overlay .help-item-wrapper--support.is-open .help-item-dropdown--support,
.pvc-wizard-wrapper .help-item-wrapper--support.active .help-item-dropdown--support,
.wizard-modal-overlay .help-item-wrapper--support.active .help-item-dropdown--support {
    max-height: min(72vh, 680px);
}

/* Thread open: dropdown does not scroll — thread body owns the single scrollbar */
.pvc-wizard-wrapper .help-item-dropdown--support.pvc-support-thread-open,
.wizard-modal-overlay .help-item-dropdown--support.pvc-support-thread-open {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pvc-wizard-wrapper .help-item-dropdown--support.pvc-support-thread-open .pvc-support-intro,
.wizard-modal-overlay .help-item-dropdown--support.pvc-support-thread-open .pvc-support-intro {
    display: none !important;
}

.pvc-wizard-wrapper .help-item-dropdown--support.pvc-support-thread-open .help-item-content--support,
.wizard-modal-overlay .help-item-dropdown--support.pvc-support-thread-open .help-item-content--support {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 12px;
    padding-bottom: 12px;
}

.pvc-wizard-wrapper .help-item-dropdown--support.pvc-support-thread-open .pvc-support-app,
.wizard-modal-overlay .help-item-dropdown--support.pvc-support-thread-open .pvc-support-app {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pvc-wizard-wrapper .help-item-content--support,
.wizard-modal-overlay .help-item-content--support {
    padding-top: 20px;
    padding-bottom: 20px;
}

.pvc-wizard-wrapper .pvc-support-intro,
.wizard-modal-overlay .pvc-support-intro {
    margin: 0 0 20px 0 !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
    color: var(--text-secondary, #4b5563) !important;
}

.pvc-wizard-wrapper .pvc-support-intro strong,
.wizard-modal-overlay .pvc-support-intro strong {
    color: var(--text-primary, #1f2937);
    font-weight: 600;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-intro {
    color: var(--text-secondary, #a0a0a0) !important;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-intro strong {
    color: #f3f4f6 !important;
}

/* -------------------------------------------------------------------------- */
/* In-panel support app                                                       */
/* -------------------------------------------------------------------------- */
.pvc-wizard-wrapper .pvc-support-app,
.wizard-modal-overlay .pvc-support-app {
    margin-top: 4px;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary, #1f2937);
}

.pvc-wizard-wrapper .pvc-support-view,
.wizard-modal-overlay .pvc-support-view {
    width: 100%;
}

.pvc-wizard-wrapper .pvc-support-toolbar,
.wizard-modal-overlay .pvc-support-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 8px;
    margin-bottom: 0;
    padding-top: 0;
}

.pvc-wizard-wrapper .pvc-support-btn-new-ticket,
.wizard-modal-overlay .pvc-support-btn-new-ticket {
    width: auto;
    padding: 9px 16px;
    font-size: 0.875rem;
    gap: 6px;
    border-radius: var(--radius-sm, 8px);
}

.pvc-wizard-wrapper .pvc-support-btn-new-ticket i,
.wizard-modal-overlay .pvc-support-btn-new-ticket i {
    font-size: 0.75rem;
}

.pvc-wizard-wrapper .pvc-support-list-heading,
.wizard-modal-overlay .pvc-support-list-heading {
    margin: 0 0 12px;
    padding-bottom: 10px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary, #1f2937);
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
}

.pvc-wizard-wrapper .pvc-support-list-divider,
.wizard-modal-overlay .pvc-support-list-divider {
    display: block;
    border: 0;
    height: 0;
    margin: 16px 0 4px;
    border-top: 1px solid var(--border-primary, #e5e7eb);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-list-divider {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-list-heading {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.pvc-wizard-wrapper .pvc-support-btn,
.wizard-modal-overlay .pvc-support-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    padding: 10px 18px;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pvc-wizard-wrapper .pvc-support-btn-primary,
.wizard-modal-overlay .pvc-support-btn-primary {
    background: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: #ffffff;
    border-color: var(--pvc-primary, var(--pvc-primary, #f97316));
    box-shadow: 0 2px 8px var(--pvc-primary-shadow, rgba(249, 115, 22, 0.35));
}

.pvc-wizard-wrapper .pvc-support-btn-primary:hover,
.wizard-modal-overlay .pvc-support-btn-primary:hover {
    background: var(--pvc-primary-hover, var(--pvc-primary-hover, #ea580c));
    border-color: var(--pvc-primary-hover, var(--pvc-primary-hover, #ea580c));
}

.pvc-wizard-wrapper .pvc-support-btn-primary:disabled,
.wizard-modal-overlay .pvc-support-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.pvc-wizard-wrapper .pvc-support-btn-link,
.wizard-modal-overlay .pvc-support-btn-link {
    background: transparent;
    border: none;
    color: var(--pvc-primary, var(--pvc-primary, #f97316));
    padding: 6px 0;
    margin: 0 0 14px 0;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: none;
}

.pvc-wizard-wrapper .pvc-support-btn-back,
.wizard-modal-overlay .pvc-support-btn-back {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 10px 0;
    margin-bottom: 18px;
}

.pvc-wizard-wrapper .pvc-support-btn-reply,
.wizard-modal-overlay .pvc-support-btn-reply {
    padding: 13px 24px;
    font-size: 1rem;
    min-width: 160px;
}

.pvc-wizard-wrapper .pvc-support-btn-link:hover,
.wizard-modal-overlay .pvc-support-btn-link:hover {
    color: var(--pvc-primary-hover, var(--pvc-primary-hover, #ea580c));
    text-decoration: underline;
}

.pvc-wizard-wrapper .pvc-support-label,
.wizard-modal-overlay .pvc-support-label {
    display: block;
    margin: 0 0 14px 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    line-height: 1.4;
}

.pvc-wizard-wrapper .pvc-support-label-text,
.wizard-modal-overlay .pvc-support-label-text {
    display: block;
    margin-bottom: 0;
}

.pvc-wizard-wrapper .pvc-support-input,
.pvc-wizard-wrapper .pvc-support-textarea,
.wizard-modal-overlay .pvc-support-input,
.wizard-modal-overlay .pvc-support-textarea {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 11px 14px;
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    box-sizing: border-box;
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text-primary, #1f2937);
    background: var(--bg-input, #ffffff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pvc-wizard-wrapper .pvc-support-input:focus,
.pvc-wizard-wrapper .pvc-support-textarea:focus,
.wizard-modal-overlay .pvc-support-input:focus,
.wizard-modal-overlay .pvc-support-textarea:focus {
    outline: none;
    border-color: var(--pvc-primary, var(--pvc-primary, #f97316));
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.pvc-wizard-wrapper .pvc-support-textarea,
.wizard-modal-overlay .pvc-support-textarea {
    min-height: 100px;
    resize: vertical;
}

.pvc-wizard-wrapper .pvc-support-hint,
.pvc-wizard-wrapper .pvc-support-loading,
.pvc-wizard-wrapper .pvc-support-empty,
.pvc-wizard-wrapper .pvc-support-error,
.wizard-modal-overlay .pvc-support-hint,
.wizard-modal-overlay .pvc-support-loading,
.wizard-modal-overlay .pvc-support-empty,
.wizard-modal-overlay .pvc-support-error {
    font-size: 0.9375rem;
    color: var(--text-secondary, #4b5563);
    margin: 12px 0 0;
    line-height: 1.55;
}

.pvc-wizard-wrapper .pvc-support-error,
.wizard-modal-overlay .pvc-support-error {
    color: var(--pvc-danger-hover, #dc3545);
}

/* Ticket list */
.pvc-wizard-wrapper .pvc-support-ticket-ul,
.wizard-modal-overlay .pvc-support-ticket-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pvc-wizard-wrapper .pvc-support-ticket-item,
.wizard-modal-overlay .pvc-support-ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 16px 18px;
    border: 1px solid rgba(249, 115, 22, 0.22);
    border-left: 4px solid var(--pvc-primary, var(--pvc-primary, #f97316));
    border-radius: var(--radius-md, 12px);
    background: var(--bg-card, #ffffff);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    font-family: inherit;
}

.pvc-wizard-wrapper .pvc-support-ticket-item--unread,
.wizard-modal-overlay .pvc-support-ticket-item--unread {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.1) 0%, var(--bg-card, #ffffff) 48%);
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.pvc-wizard-wrapper .pvc-support-ticket-item:hover,
.wizard-modal-overlay .pvc-support-ticket-item:hover {
    border-color: var(--pvc-primary, var(--pvc-primary, #f97316));
    background: var(--bg-card, #ffffff);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.16);
    transform: translateY(-1px);
}

.pvc-wizard-wrapper .pvc-support-ticket-item--unread:hover,
.wizard-modal-overlay .pvc-support-ticket-item--unread:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.14) 0%, var(--bg-card, #ffffff) 52%);
}

.pvc-wizard-wrapper .pvc-support-ticket-item:hover .pvc-support-ticket-chevron,
.wizard-modal-overlay .pvc-support-ticket-item:hover .pvc-support-ticket-chevron {
    color: var(--pvc-primary, var(--pvc-primary, #f97316));
    transform: translateX(2px);
}

.pvc-wizard-wrapper .pvc-support-ticket-body,
.wizard-modal-overlay .pvc-support-ticket-body {
    flex: 1;
    min-width: 0;
}

.pvc-wizard-wrapper .pvc-support-ticket-chevron,
.wizard-modal-overlay .pvc-support-ticket-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.14);
    color: var(--pvc-primary, var(--pvc-primary, #f97316));
    transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.pvc-wizard-wrapper .pvc-support-ticket-chevron i,
.wizard-modal-overlay .pvc-support-ticket-chevron i {
    font-size: 0.75rem;
}

.pvc-wizard-wrapper .pvc-support-ticket-item:hover .pvc-support-ticket-chevron,
.wizard-modal-overlay .pvc-support-ticket-item:hover .pvc-support-ticket-chevron {
    background: rgba(249, 115, 22, 0.14);
}

.pvc-wizard-wrapper .pvc-support-ticket-subject,
.wizard-modal-overlay .pvc-support-ticket-subject {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-primary, #1f2937);
    line-height: 1.35;
}

.pvc-wizard-wrapper .pvc-support-ticket-meta,
.wizard-modal-overlay .pvc-support-ticket-meta {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #4b5563);
    margin-top: 6px;
    line-height: 1.4;
}

.pvc-wizard-wrapper .pvc-support-item-badge,
.wizard-modal-overlay .pvc-support-item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Thread */
.pvc-wizard-wrapper .pvc-support-thread-subject,
.wizard-modal-overlay .pvc-support-thread-subject {
    margin: 4px 0 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    line-height: 1.35;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pvc-wizard-wrapper .pvc-support-thread-status,
.wizard-modal-overlay .pvc-support-thread-status {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    margin: 0 0 14px;
    padding: 4px 10px;
    display: inline-block;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 999px;
    border: 1px solid var(--border-primary, #e5e7eb);
}

.pvc-wizard-wrapper .pvc-support-messages,
.wizard-modal-overlay .pvc-support-messages {
    margin: 0 0 8px;
    padding: 12px 4px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Thread view: one scroll region + pinned reply composer */
.pvc-wizard-wrapper .pvc-support-view[data-view="thread"],
.wizard-modal-overlay .pvc-support-view[data-view="thread"] {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: none;
}

.pvc-wizard-wrapper .pvc-support-thread-scroll,
.wizard-modal-overlay .pvc-support-thread-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #64748b transparent;
    padding-right: 6px;
}

.pvc-wizard-wrapper .pvc-support-thread-scroll::-webkit-scrollbar,
.wizard-modal-overlay .pvc-support-thread-scroll::-webkit-scrollbar {
    width: 14px;
}

.pvc-wizard-wrapper .pvc-support-thread-scroll::-webkit-scrollbar-track,
.wizard-modal-overlay .pvc-support-thread-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.pvc-wizard-wrapper .pvc-support-thread-scroll::-webkit-scrollbar-thumb,
.wizard-modal-overlay .pvc-support-thread-scroll::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: padding-box;
    min-height: 40px;
}

.pvc-wizard-wrapper .pvc-support-thread-scroll::-webkit-scrollbar-thumb:hover,
.wizard-modal-overlay .pvc-support-thread-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
    border: 3px solid transparent;
}

.pvc-wizard-wrapper .pvc-support-reply-composer,
.wizard-modal-overlay .pvc-support-reply-composer {
    position: relative;
    flex-shrink: 0;
    margin-top: 0;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-primary, #e5e7eb);
    background: transparent;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-reply-composer {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}

.pvc-wizard-wrapper .pvc-support-reply-composer .pvc-support-reply-input,
.wizard-modal-overlay .pvc-support-reply-composer .pvc-support-reply-input {
    margin: 0 0 10px;
    display: block;
    width: 100%;
}

.pvc-wizard-wrapper .pvc-support-reply-actions,
.wizard-modal-overlay .pvc-support-reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pvc-wizard-wrapper .pvc-support-emoji-wrap,
.wizard-modal-overlay .pvc-support-emoji-wrap {
    position: relative;
    flex-shrink: 0;
}

.pvc-wizard-wrapper .pvc-support-emoji-btn,
.wizard-modal-overlay .pvc-support-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-card, #ffffff);
    color: var(--text-secondary, #4b5563);
    font-size: 1.15rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pvc-wizard-wrapper .pvc-support-emoji-btn:hover,
.wizard-modal-overlay .pvc-support-emoji-btn:hover {
    border-color: var(--pvc-primary, var(--pvc-primary, #f97316));
    color: var(--pvc-primary, var(--pvc-primary, #f97316));
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-emoji-btn {
    background: #0c1520;
    border-color: rgba(255, 255, 255, 0.12);
    color: #a0a0a0;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-emoji-btn:hover {
    border-color: #fb923c;
    color: #fb923c;
}

.pvc-wizard-wrapper .pvc-support-emoji-picker,
.wizard-modal-overlay .pvc-support-emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: min(280px, 72vw);
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.pvc-wizard-wrapper .pvc-support-emoji-picker[hidden],
.wizard-modal-overlay .pvc-support-emoji-picker[hidden] {
    display: none !important;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-emoji-picker {
    background: #0c1520;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.pvc-wizard-wrapper .pvc-support-emoji-item,
.wizard-modal-overlay .pvc-support-emoji-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.pvc-wizard-wrapper .pvc-support-emoji-item:hover,
.wizard-modal-overlay .pvc-support-emoji-item:hover {
    background: rgba(249, 115, 22, 0.14);
}

.pvc-wizard-wrapper .pvc-support-reply-composer .pvc-support-btn-reply,
.wizard-modal-overlay .pvc-support-reply-composer .pvc-support-btn-reply {
    width: auto;
    min-width: 0;
    margin-left: auto;
    padding: 10px 18px;
    font-size: 0.9375rem;
}

.pvc-wizard-wrapper .pvc-support-bubble,
.wizard-modal-overlay .pvc-support-bubble {
    max-width: 88%;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary, #1f2937);
    border: 1px solid var(--border-primary, #e5e7eb);
}

.pvc-wizard-wrapper .pvc-support-bubble.is-user,
.wizard-modal-overlay .pvc-support-bubble.is-user {
    margin-left: auto;
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.28);
}

.pvc-wizard-wrapper .pvc-support-bubble.is-staff,
.wizard-modal-overlay .pvc-support-bubble.is-staff {
    margin-right: auto;
    background: var(--bg-card, #ffffff);
    border-color: var(--border-primary, #e5e7eb);
}

.pvc-wizard-wrapper .pvc-support-bubble-meta,
.wizard-modal-overlay .pvc-support-bubble-meta {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0.01em;
}

.pvc-wizard-wrapper .pvc-support-bubble-body,
.wizard-modal-overlay .pvc-support-bubble-body {
    word-break: break-word;
}

.pvc-wizard-wrapper .pvc-support-bubble-body p,
.wizard-modal-overlay .pvc-support-bubble-body p {
    margin: 0 0 8px;
}

.pvc-wizard-wrapper .pvc-support-bubble-body p:last-child,
.wizard-modal-overlay .pvc-support-bubble-body p:last-child {
    margin-bottom: 0;
}

/* Dark mode */
.wizard-modal-overlay[data-theme="dark"] .pvc-support-label,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-thread-subject,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-subject,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-app {
    color: #ffffff;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-input,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-textarea {
    background: var(--bg-input, #1a1a1a);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-input::placeholder,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-textarea::placeholder {
    color: #6b7280;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-item {
    background: #0c1520;
    border-color: rgba(59, 130, 246, 0.35);
    border-left-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-item--unread {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18) 0%, #0c1520 50%);
    border-color: rgba(59, 130, 246, 0.5);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-item:hover {
    background: #121a24;
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-item--unread:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.24) 0%, #121a24 52%);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-chevron {
    background: rgba(249, 115, 22, 0.28);
    color: #fb923c;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-item:hover .pvc-support-ticket-chevron {
    background: rgba(249, 115, 22, 0.4);
    color: #fb923c;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-ticket-meta,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-hint,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-loading,
.wizard-modal-overlay[data-theme="dark"] .pvc-support-empty {
    color: #a0a0a0;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-thread-status {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #c0c0c0;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-bubble {
    color: #f3f4f6;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-bubble.is-user {
    background: rgba(249, 115, 22, 0.22);
    border-color: rgba(59, 130, 246, 0.4);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-bubble.is-staff {
    background: #121a24;
    border-color: rgba(255, 255, 255, 0.1);
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-bubble-meta {
    color: #9ca3af;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-btn-link {
    color: #fb923c;
}

.wizard-modal-overlay[data-theme="dark"] .pvc-support-btn-link:hover {
    color: #fdba74;
}

@media (max-width: 640px) {
    .pvc-wizard-wrapper .help-item-wrapper--support.is-open .help-item-dropdown--support,
    .wizard-modal-overlay .help-item-wrapper--support.is-open .help-item-dropdown--support,
    .pvc-wizard-wrapper .help-item-wrapper--support.active .help-item-dropdown--support,
    .wizard-modal-overlay .help-item-wrapper--support.active .help-item-dropdown--support {
        max-height: min(65vh, 560px);
    }

    .pvc-wizard-wrapper .pvc-support-bubble,
    .wizard-modal-overlay .pvc-support-bubble {
        max-width: 95%;
    }

    .pvc-wizard-wrapper .pvc-support-reply-composer,
    .wizard-modal-overlay .pvc-support-reply-composer {
        padding-top: 10px;
        padding-bottom: 2px;
    }

    .pvc-wizard-wrapper .pvc-support-thread-scroll::-webkit-scrollbar,
    .wizard-modal-overlay .pvc-support-thread-scroll::-webkit-scrollbar {
        width: 16px;
    }
}
