.webmz-ticket-account,
.webmz-ticket-account *,
.webmz-ticket-admin-box,
.webmz-ticket-admin-box * {
    box-sizing: border-box;
}

.webmz-ticket-account {
    display: grid;
    gap: 24px;
    color: var(--webmz-color-text-dark, #111827);
}

.webmz-ticket-account__head {
    padding: 24px;
    border-radius: 20px;
    background: #f9fafb;
}

.webmz-ticket-account__head h2,
.webmz-ticket-form h3,
.webmz-ticket-single__header h3 {
    margin: 0 0 8px;
    color: var(--webmz-color-text-dark, #111827);
}

.webmz-ticket-account__head p {
    margin: 0;
    color: var(--webmz-color-text-gray, #6b7280);
}

.webmz-ticket-form {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid #eef0f4;
    border-radius: 20px;
    background: #fff;
}

.webmz-ticket-form__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.webmz-ticket-form label {
    display: grid;
    gap: 7px;
    margin: 0;
    color: var(--webmz-color-text-dark, #111827);
    font-weight: 700;
}

.webmz-ticket-form input,
.webmz-ticket-form select,
.webmz-ticket-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: var(--webmz-color-text-dark, #111827);
    font: inherit;
    font-weight: 400;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.webmz-ticket-form textarea {
    min-height: 130px;
    resize: vertical;
}

.webmz-ticket-form input:focus,
.webmz-ticket-form select:focus,
.webmz-ticket-form textarea:focus {
    border-color: var(--webmz-color-primary, #0878f9);
    box-shadow: 0 0 0 3px rgba(8, 120, 249, .12);
}

.webmz-ticket-submit,
.webmz-ticket-form .button {
    justify-self: start;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    background: var(--webmz-color-primary, #0878f9);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.webmz-ticket-submit.is-loading {
    opacity: .7;
    cursor: progress;
}

.webmz-ticket-form__message {
    display: none;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.webmz-ticket-form__message:not(:empty) {
    display: block;
}

.webmz-ticket-form__message.is-success {
    background: #ecfdf5;
    color: #047857;
}

.webmz-ticket-form__message.is-error,
.webmz-ticket-notice--error {
    background: #fef2f2;
    color: #b91c1c;
}

.webmz-ticket-list {
    display: grid;
    gap: 10px;
}

.webmz-ticket-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}

.webmz-ticket-list-item:hover {
    transform: translateY(-2px);
    border-color: var(--webmz-color-primary, #0878f9);
    text-decoration: none;
}

.webmz-ticket-list-item.is-unread {
    background: var(--webmz-color-primary-light, #eff6ff);
}

.webmz-ticket-list-item__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 800;
}

.webmz-ticket-list-item__meta,
.webmz-ticket-single__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--webmz-color-text-gray, #6b7280);
    font-size: 13px;
}

.webmz-ticket-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--webmz-color-primary, #0878f9);
}

.webmz-ticket-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 800;
}

.webmz-ticket-status--answered {
    background: #ecfdf5;
    color: #047857;
}

.webmz-ticket-status--user,
.webmz-admin-ticket-unread {
    background: #fff7ed;
    color: #c2410c;
}

.webmz-ticket-status--closed {
    background: #f3f4f6;
    color: #6b7280;
}

.webmz-ticket-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--webmz-color-primary, #0878f9);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.webmz-ticket-single {
    display: grid;
    gap: 18px;
}

.webmz-ticket-back {
    justify-self: start;
    color: var(--webmz-color-primary, #0878f9);
    text-decoration: none;
    font-weight: 800;
}

.webmz-ticket-single__header {
    padding: 20px;
    border-radius: 18px;
    background: #f9fafb;
}

.webmz-ticket-messages {
    display: grid;
    gap: 14px;
    max-height: 620px;
    overflow: auto;
    padding: 6px;
}

.webmz-ticket-message {
    width: min(720px, 92%);
    padding: 16px;
    border-radius: 18px;
    background: #f9fafb;
}

.webmz-ticket-message--user {
    justify-self: start;
}

.webmz-ticket-message--staff {
    justify-self: end;
    background: var(--webmz-color-primary-light, #eff6ff);
}

.webmz-ticket-message__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--webmz-color-text-gray, #6b7280);
    font-size: 12px;
}

.webmz-ticket-message__head strong {
    color: var(--webmz-color-text-dark, #111827);
    font-size: 14px;
}

.webmz-ticket-message__head span {
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--webmz-color-primary, #0878f9);
    color: #fff;
}

.webmz-ticket-message__body p:last-child {
    margin-bottom: 0;
}

.webmz-ticket-notice,
.webmz-ticket-empty {
    padding: 16px;
    border-radius: 14px;
    background: #f9fafb;
    color: var(--webmz-color-text-gray, #6b7280);
}

.webmz-ticket-notice--warning,
.webmz-ticket-notice--info {
    background: #fff7ed;
    color: #c2410c;
}

.webmz-ticket-admin-box .webmz-ticket-messages {
    max-height: 520px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.webmz-ticket-admin-reply {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.webmz-ticket-admin-reply__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.webmz-ticket-admin-reply__message.is-success {
    color: #047857;
}

.webmz-ticket-admin-reply__message.is-error {
    color: #b91c1c;
}

.webmz-admin-ticket-unread {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

.webmz-ticket-upload {
    display: grid;
    gap: 10px;
}

.webmz-ticket-upload__label {
    font-weight: 700;
    color: var(--webmz-color-text-dark, #111827);
}

.webmz-ticket-upload__dropzone {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 22px 16px;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    color: var(--webmz-color-text-gray, #6b7280);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
    text-align: center;
}

.webmz-ticket-upload__dropzone:hover,
.webmz-ticket-upload__dropzone:focus,
.webmz-ticket-upload__dropzone.is-dragover {
    border-color: var(--webmz-color-primary, #0878f9);
    background: var(--webmz-color-primary-light, #eff6ff);
    color: var(--webmz-color-primary, #0878f9);
    outline: none;
}

.webmz-ticket-upload__dropzone-icon {
    display: inline-flex;
    color: inherit;
}

.webmz-ticket-upload__dropzone-text {
    font-weight: 800;
    color: var(--webmz-color-text-dark, #111827);
}

.webmz-ticket-upload__hint {
    font-size: 12px;
}

.webmz-ticket-upload__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.webmz-ticket-upload__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.webmz-ticket-upload__item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.webmz-ticket-upload__item-remove {
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    background: #fef2f2;
    color: #b91c1c;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.webmz-ticket-attachments {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.webmz-ticket-attachments__title {
    font-size: 12px;
    color: var(--webmz-color-text-gray, #6b7280);
}

.webmz-ticket-attachments__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.webmz-ticket-attachments__item {
    margin: 0;
}

.webmz-ticket-attachments__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}

.webmz-ticket-attachments__link:hover {
    border-color: var(--webmz-color-primary, #0878f9);
    background: var(--webmz-color-primary-light, #eff6ff);
    text-decoration: none;
}

.webmz-ticket-attachments__thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f3f4f6;
    color: var(--webmz-color-primary, #0878f9);
    flex-shrink: 0;
    overflow: hidden;
}

.webmz-ticket-attachments__thumb--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webmz-ticket-attachments__meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.webmz-ticket-attachments__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.webmz-ticket-attachments__size {
    font-size: 11px;
    color: var(--webmz-color-text-gray, #6b7280);
}

.webmz-ticket-admin-box .webmz-ticket-attachments__link {
    background: #f9fafb;
}

@media (max-width: 767px) {
    .webmz-ticket-form__grid {
        grid-template-columns: 1fr;
    }

    .webmz-ticket-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .webmz-ticket-message {
        width: 100%;
    }
}
