.tech-support-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
    cursor: pointer;
    z-index: 1090;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.tech-support-fab.is-open {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.tech-support-fab .d-none {
    display: none !important;
}

.tech-support-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    width: 380px;
    max-height: min(75vh, 720px);
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 1090;
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.tech-support-panel.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.tech-support-panel form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.tech-support-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.tech-support-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.tech-support-panel-close {
    background: transparent;
    border: 0;
    color: #6c757d;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tech-support-panel-close:hover {
    background: #e9ecef;
    color: #212529;
}

.tech-support-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

.tech-support-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .tech-support-panel {
        right: 12px;
        left: 12px;
        bottom: 80px;
        width: auto;
    }
}

.tech-support-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.45);
}

.tech-support-fab:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.4);
    outline-offset: 2px;
}

#tech-support-attachments:empty {
    padding: 0;
}

.tech-support-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.tech-support-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 12px;
    min-height: 34px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    color: #212529;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tech-support-quick-action i {
    font-size: 14px;
    color: #0d6efd;
    transition: color 0.15s ease;
}

.tech-support-quick-action:hover:not(:disabled) {
    background: #fff;
    border-color: #86b7fe;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
    transform: translateY(-1px);
}

.tech-support-quick-action:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.12);
}

.tech-support-quick-action:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);
    outline-offset: 2px;
}

.tech-support-quick-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tech-support-recording-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px 8px 6px 16px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1120;
    user-select: none;
    cursor: grab;
    touch-action: none;
}

.tech-support-recording-bar.is-active {
    display: flex;
}

.tech-support-recording-bar:active {
    cursor: grabbing;
}

.tech-support-recording-bar .recording-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    flex-shrink: 0;
    animation: tech-support-recording-pulse 1.5s ease-in-out infinite;
}

.tech-support-recording-bar #tech-support-recording-bar-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 48px;
    color: #212529;
}

.tech-support-recording-bar .recording-stop-btn {
    border-radius: 999px;
    padding: 4px 14px;
    font-weight: 500;
}

.tech-support-recording-bar .recording-cancel-btn {
    background: transparent;
    border: 0;
    color: #6c757d;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tech-support-recording-bar .recording-cancel-btn:hover {
    background: #f1f3f5;
    color: #212529;
}

@keyframes tech-support-recording-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.tech-support-type-switch {
    padding-left: 0;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.tech-support-type-switch .form-check-input {
    margin: 0;
    float: none;
}

@media (max-width: 576px) {
    .tech-support-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

#tech-support-image-edit-modal { z-index: 1110; }
.tech-support-editor-backdrop { z-index: 1100 !important; }

.tech-support-widget {
    width: 100%;
    height: 100%;
}

.tech-support-widget-body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.tech-support-widget-body .tech-support-widget {
    height: 100vh;
}

.tech-support-widget-body #tech-support-panel {
    position: static;
    width: 100%;
    max-height: none;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    display: flex;
}

#tech-support-widget[hidden] { display: none !important; }
#tech-support-widget.is-open { display: block; }
#tech-support-widget.is-open .tech-support-panel {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.select2-container.js-tech-support-select2.select2-container--open {
    z-index: 1100;
}

.select2-container--open .select2-dropdown.js-tech-support-select2-dropdown {
    z-index: 1100;
}

.ts-media-tile {
    position: relative;
    display: block;
    width: 168px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.ts-media-tile .ts-media-tile-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ts-media-tile .ts-media-tile-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    z-index: 2;
}

.ts-media-tile .ts-media-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.ts-media-tile.is-video .ts-media-tile-overlay {
    opacity: 0.9;
}

.ts-media-tile:hover .ts-media-tile-overlay,
.ts-media-tile:focus-visible .ts-media-tile-overlay {
    opacity: 1;
}

.ts-media-tile .ts-media-tile-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
}

.ts-media-tile .ts-media-tile-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ts-media-tile:hover .ts-media-tile-controls,
.ts-media-tile:focus-within .ts-media-tile-controls {
    opacity: 1;
}

.ts-media-tile .ts-media-tile-action {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ts-media-tile .ts-media-tile-action:hover {
    background: rgba(0, 0, 0, 0.85);
}

.ts-media-tile.is-file {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ts-media-tile.is-file .ts-media-tile-file-icon {
    font-size: 28px;
    color: #475569;
}

.ts-media-tile.is-file .ts-media-tile-file-name {
    font-size: 11px;
    text-align: center;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

#tech-support-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ts-media-tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
}

.tech-support-fab.tech-support-fab--capturing {
    display: none !important;
}

.tech-support-recording-bar-mic {
    background: transparent;
    border: 0;
    color: #495057;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tech-support-recording-bar-mic:hover {
    background: #f1f3f5;
    color: #212529;
}

.tech-support-recording-bar-mic:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.tech-support-recording-bar-mic .tech-support-mic-icon-off,
.tech-support-recording-bar--mic-on .tech-support-recording-bar-mic .tech-support-mic-icon-off {
    display: none;
}

.tech-support-recording-bar--mic-off .tech-support-recording-bar-mic .tech-support-mic-icon-on {
    display: none;
}

.tech-support-recording-bar--mic-off .tech-support-recording-bar-mic .tech-support-mic-icon-off {
    display: inline-block;
}

.tech-support-recording-bar--mic-off .tech-support-recording-bar-mic {
    color: #dc3545;
}

.tech-support-recording-bar-hint {
    font-size: 12px;
    color: #dc3545;
    max-width: 220px;
    line-height: 1.2;
}

.tech-support-recording-bar-hint[hidden] {
    display: none;
}

.ts-replay-tile {
    cursor: pointer;
    position: relative;
}

.ts-replay-tile:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.ts-replay-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ts-replay-modal {
    position: relative;
    width: var(--ts-replay-modal-width, 90vw);
    height: var(--ts-replay-modal-height, 85vh);
    max-width: 90vw;
    max-height: 85vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.ts-replay-modal-host {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.ts-replay-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-replay-modal-close:hover,
.ts-replay-modal-close:focus-visible {
    background: rgba(0, 0, 0, 0.9);
    outline: none;
}

body.ts-replay-modal-open {
    overflow: hidden;
}

#tech-support-toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

#tech-support-toast-container > * {
    pointer-events: auto;
}

.tech-support-success-toast {
    min-width: 320px;
    max-width: 420px;
    background: #fff;
    border-left: 3px solid #198754;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: tech-support-toast-slide-in 250ms ease-out;
    transition: opacity 250ms ease, transform 250ms ease;
}

.tech-support-success-toast.is-leaving {
    opacity: 0;
    transform: translateY(-20px);
}

.tech-support-success-toast-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
}

.tech-support-success-toast-icon {
    color: #198754;
    font-size: 1.1rem;
}

.tech-support-success-toast-title {
    flex-grow: 1;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.tech-support-success-toast-ticket-id {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.tech-support-success-toast-close {
    background: transparent;
    border: 0;
    padding: 0.15rem 0.4rem;
    color: #6b7280;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.tech-support-success-toast-close:hover,
.tech-support-success-toast-close:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    color: #111827;
    outline: none;
}

.tech-support-success-toast-body {
    padding: 0 0.75rem 0.75rem 0.75rem;
}

.tech-support-success-toast-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #0d6efd;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tech-support-success-toast-link:hover,
.tech-support-success-toast-link:focus-visible {
    color: #0a58ca;
    text-decoration-thickness: 2px;
}

.tech-support-success-toast-link-icon {
    font-size: 0.8rem;
}

@keyframes tech-support-toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tech-support-submit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10;
    padding: 1.25rem;
    overflow-y: auto;
    animation: tech-support-submit-overlay-fade 200ms ease-out;
}

.tech-support-submit-overlay[hidden] {
    display: none;
}

.tech-support-submit-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 100%;
}

.tech-support-submit-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #e7f1ff;
    color: #0d6efd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: tech-support-submit-pulse 1.4s ease-in-out infinite;
}

.tech-support-submit-title {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
}

.tech-support-submit-progress-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tech-support-submit-progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.tech-support-submit-files-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tech-support-submit-files-wrap[hidden] {
    display: none;
}

.tech-support-submit-files-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 600;
}

.tech-support-submit-files {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
}

.tech-support-submit-files-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
}

.tech-support-submit-files-item-icon {
    color: #6b7280;
    width: 16px;
    text-align: center;
}

.tech-support-submit-files-item-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
}

.tech-support-submit-files-item-size {
    color: #6b7280;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.tech-support-submit-files-item-status {
    width: 18px;
    text-align: center;
    color: #9ca3af;
}

.tech-support-submit-files-item.is-done {
    background: #e8f5ed;
}

.tech-support-submit-files-item.is-done .tech-support-submit-files-item-status {
    color: #198754;
}

.tech-support-submit-files-item.is-done .tech-support-submit-files-item-icon {
    color: #198754;
}

.tech-support-submit-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 100%;
    margin-top: auto;
}

.tech-support-submit-warning i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

@keyframes tech-support-submit-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes tech-support-submit-overlay-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (pointer: coarse) and (hover: none) {
    #tech-support-fab,
    #tech-support-widget,
    #tech-support-recording-bar {
        display: none !important;
    }
}
