/* MyIO Video Builder - Main Styles */

/* Hide the theme's page-title banner on pages that contain the form */
body:has(.mivb-form-container) .contact_banner {
    display: none !important;
}

.mivb-form-container {
    max-width: 800px;
    margin: 30px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Reset select borders globally within form - but not for mi-text-control */
.mivb-form-container select:not(.mi-text-control),
.mivb-form select:not(.mi-text-control) {
    border: none !important;
    box-sizing: border-box;
}

/* Form Steps */
.col-md-12.form {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

/* .form-table.mi-table {
    padding: 30px;
} */

/* Video Preview Step */
.video-preview-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.video-thumbnail-wrapper {
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    background: #f5f5f5;
}

body.page-id-4803 .mivb-form-container{
    margin-top: 0;
    padding-top: 0;
}

.video-preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.video-change-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #ff7396;
    color: white !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 115, 150, 0.25);
}

.video-change-btn:hover {
    background: #ff5a82;
    box-shadow: 0 4px 10px rgba(255, 115, 150, 0.35);
    transform: translateY(-1px);
    color: white;
}

.video-change-btn i {
    font-size: 16px;
}

/* Mobile Responsive for Video Preview */
@media (max-width: 768px) {
    .video-thumbnail-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .video-preview-container {
        gap: 12px;
    }

    .video-thumbnail-wrapper {
        border-radius: 6px;
    }

    .video-change-btn {
        padding: 9px 20px;
        font-size: 13px;
    }

    .video-change-btn i {
        font-size: 14px;
    }
}

/* Simple Language Selector */
.mivb-language-selector {
    margin-bottom: 20px;
}

.mivb-language-selector .filed-label {
    color: #333;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* Let mi-text-control handle all select styling */

.mivb-language-selector select option {
    padding: 10px;
    font-weight: 500;
}

.mivb-language-selector .required-title {
    color: white;
    font-size: 12px;
    margin-top: 8px;
    display: block;
    opacity: 0.9;
}

/* Bride Side or Groom Side Selector */
.bride-side-or-groom-side-selection {
    margin-bottom: 20px;
}

.bride-side-or-groom-side-selection .filed-label {
    color: #333;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* Let mi-text-control handle all select styling */

.bride-side-or-groom-side-selection select option {
    padding: 10px;
    font-weight: 500;
}

.bride-side-or-groom-side-selection .required-title {
    color: white;
    font-size: 12px;
    margin-top: 8px;
    display: block;
    opacity: 0.9;
}

/* Field Wrappers */
.field-wrapper {
    margin-bottom: 25px;
}

.filed-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.filed-label.label-center {
    text-align: center;
}


.prvBtnahref{
    cursor: pointer;
    border-radius: 200px;
    background: #FF7396;
    color: #FFF;
    text-align: center;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 45px;
    display: inline-block;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 10px;
    margin: 5px 5px;
font-size: 14px;
        padding: 12px 20px;


}

/* Form Controls */
.mi-text-control,
.mi-textarea-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 48px;
    outline: none;
}

input.mi-text-control {
    height: 48px;
}

/* Ensure select elements with mi-text-control don't get double borders */
select.mi-text-control {
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    outline: none;
    min-height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
    cursor: pointer;
}

/* Ensure HTML5 date input used for wedding date doesn't overflow on small screens / iOS.
   Keep same box-sizing and prevent the native picker UI from being wider than container. */
input.textfield-wedding-date.mi-text-control,
input[type="date"].mi-text-control {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-right: 16px; /* avoid large right padding used for select arrows */
}

/* iOS/iPhone specific fixes */
select.mi-text-control::-webkit-inner-spin-button,
select.mi-text-control::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select.mi-text-control::-ms-expand {
    display: none;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    select.mi-text-control {
        min-height: 48px;
        font-size: 16px;
        padding: 14px 45px 14px 16px;
    }
    .prvBtnahref{
        width: 100%;
        display: block;
    }
}

.mi-text-control:focus,
.mi-textarea-control:focus {
    outline: none;
    border-color: #ff7396;
    box-shadow: 0 0 0 3px rgba(255, 115, 150, 0.1);
}

/* Select-specific focus override */
select.mi-text-control:focus {
    /* border-color: #ff7396 !important; */
    box-shadow: 0 0 0 3px rgba(255, 115, 150, 0.1);
}

/* Select option styling for better iOS appearance */
select.mi-text-control option {
    padding: 12px;
    font-size: 16px;
    background: #ffffff;
    color: #333;
}

.mi-textarea-control {
    resize: vertical;
    min-height: 100px;
}

/* Counter Values */
.counter-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* Required/Optional Labels */
.required-title {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
}

.optional-title {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
}

/* Event Styles */
.event-block {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #ffffff;
}

/* Event Header Styles */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ff7396;
}

.event-header h4 {
    margin: 0;
    color: #ff7396;
    font-weight: 600;
    font-size: 18px;
}

.delete-event-block {
    background: #ff4757 !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
}

.delete-event-block:hover {
    background: #ff3742 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3) !important;
}

.delete-event-block svg {
    flex-shrink: 0;
}

/* Buttons */
.addFullEventBlock {
    background: #ff7396;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.addFullEventBlocktrash:hover {
    background: #ff5a7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 115, 150, 0.3);
}

.prvBtn,
.nxtBtn {
    background: #ff7396;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prvBtn:hover,
.nxtBtn:hover {
    background: #ff5a7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 115, 150, 0.3);
}

.button_list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

/* Delete functionality */
.delete-field {
    background: #ff4757;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-field:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.delete-tab {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Loading spinner */
.place-order-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.place-order-loader i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Message Styles */
.mivb-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.mivb-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mivb-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form steps visibility */
.form[style*="display: none"] {
    display: none !important;
}

.form:not([style*="display: none"]) {
    display: block !important;
}










/* Responsive Design */
@media (max-width: 768px) {
    .mivb-form-container {
        margin: 15px;
        padding: 20px;
    }

    /* .form-table.mi-table {
        padding: 20px;
    } */

    .button_list {
        flex-direction: column;
        gap: 15px;
    }

    .prvBtn,
    .nxtBtn {
        width: 100%;
        justify-content: center;
    }

    .event-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .delete-event-block {
        width: 100%;
        justify-content: center;
    }
}

/* Focus styles for accessibility */
.mi-text-control:focus,
.mi-textarea-control:focus,
.prvBtn:focus,
.nxtBtn:focus:focus {
    outline: 2px solid #ff7396;
    outline-offset: 2px;
}

/* Disabled button styles */
.prvBtn.disabled,
.prvBtn:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.prvBtn.disabled:hover,
.prvBtn:disabled:hover {
    background: #ccc !important;
    color: #666 !important;
    transform: none !important;
}

/* Form overlay loader */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff7396;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile */
@media (max-width: 768px) {
    .mivb-form-container {
        padding: 15px;
        margin: 10px;
    }

    .mi-text-control,
    .mi-textarea-control {
        font-size: 16px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .mivb-form-container {
        padding: 10px;
        margin: 5px;
    }

    .button_list {
        flex-direction: column-reverse;
    }

    .prvBtn,
    .nxtBtn {
        width: 100%;
        margin: 5px 0;
    }
     .prvBtnahref{
        padding: 10px 20px;
     }
}

/* Print styles */
@media print {
    .button_list,
    #new-field-panel,
    .delete-tab,
    .delete-event-block {
        display: none;
    }

    .mivb-form-container {
        box-shadow: none;
    }

    .col-md-12.form {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .event-header {
        background: white;
        border: 1px solid #ddd;
    }
}

/* ============================================
   SUCCESS MODAL STYLES
   ============================================ */

/* Modal Overlay */

/* Generic modal base, but do NOT set opacity/visibility for song modal */
.mivb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove opacity/visibility for compatibility with display toggling */
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Song modal: always on top, display: none by default, flex when open */
#mivb-song-modal {
    z-index: 2147483647 !important;
    display: none;
}
#mivb-song-modal.mivb-modal-open {
    display: flex !important;
}
#mivb-song-modal .mivb-modal-backdrop {
    z-index: 2147483646 !important;
}
#mivb-song-modal .mivb-modal-content {
    z-index: 2147483647 !important;
}

.mivb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

/* Modal Content */
.mivb-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wifmModalSlideIn 0.3s ease-out;
    z-index: 100000;
    will-change: transform, opacity;
    /* iOS Safari fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

@keyframes wifmModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollable Content Wrapper */
.mivb-modal-scroll-wrapper {
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 180px);
    min-height: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Modal Header - Success Message & ID */
.mivb-modal-header {
    padding: 30px 30px 20px 30px;
    text-align: center;
    background: white;
    border-bottom: 2px solid #f0f0f0;
}

/* Modal Body - Package Details */
.mivb-modal-body {
    padding: 25px 30px 30px 30px;
}

/* Fixed Modal Footer - WhatsApp Button */
.mivb-modal-footer {
    padding: 20px 30px 30px 30px;
    text-align: center;
    background: white;
    border-top: 2px solid #f0f0f0;
    flex-shrink: 0;
}

/* Close Button */
.mivb-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

.mivb-modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

/* Success Icon */
.mivb-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
}

.mivb-success-icon svg {
    width: 100%;
    height: 100%;
}

.mivb-success-circle {
    stroke: #ff7396;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
}

/* Only animate in step 1 */
#mivb-modal-step-1 .mivb-success-circle {
    animation: wifmCircleStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.mivb-success-check {
    stroke: #ff7396;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}

/* Only animate in step 1 */
#mivb-modal-step-1 .mivb-success-check {
    animation: wifmCheckStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* Step 2 - Show checkmark immediately without animation */
#mivb-modal-step-2 .mivb-success-circle {
    stroke-dashoffset: 0;
}

#mivb-modal-step-2 .mivb-success-check {
    stroke-dashoffset: 0;
}

@keyframes wifmCircleStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes wifmCheckStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Modal Title */
.mivb-modal-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px;
    line-height: 1.3;
}

/* Submission ID Section */
.mivb-submission-id {
    background: linear-gradient(135deg, #fff0f4 0%, #ffe8ee 100%);
    border: 2px solid #ff7396;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0 25px;
}

.mivb-id-label {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px;
    font-weight: 500;
}

.mivb-id-value {
    font-size: 32px;
    font-weight: 800;
    color: #ff7396;
    margin: 0;
    letter-spacing: 1px;
    font-family: "Courier New", Courier, monospace;
}

/* Modal Description */
.mivb-modal-description {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 30px;
}

/* WhatsApp Button */
.mivb-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366 !important;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    text-decoration: none;
}

.mivb-whatsapp-btn:hover {
    background: #128C7E !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.mivb-whatsapp-btn:active {
    transform: translateY(0);
}

.mivb-whatsapp-btn svg {
    flex-shrink: 0;
}

/* ============================================
   PACKAGE DETAILS IN MODAL
   ============================================ */

/* Packages Section */
.mivb-packages-section {
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.mivb-packages-title {
    font-size: 19px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px 0;
    text-align: center;
    border-bottom: 3px solid #e91e63;
    display: inline-block;
    padding-bottom: 5px;
    width: 100%;
}

.mivb-select-package-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0 0 14px 0;
    font-weight: 500;
}

.mivb-package-item {
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.1);
    border-color: #e91e63;
    position: relative;
}

.mivb-package-item:last-of-type {
    margin-bottom: 0;
}

/* Selectable Package Styles */
.mivb-package-selectable {
    cursor: pointer;
    border: 2px solid #ddd;
}

.mivb-package-selectable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
}

.mivb-package-selectable.mivb-package-selected {
    border-color: #e91e63;
    background: #fff5f8;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
}

.mivb-package-selectable.mivb-package-premium.mivb-package-selected {
    border-color: #198754;
    background: #f6fff4;
    box-shadow: 0 4px 16px rgba(25, 135, 84, 0.3);
}

/* Selected Badge */
.mivb-package-selected-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: #e91e63;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.4);
}

.mivb-package-premium .mivb-package-selected-badge {
    background: #198754;
}

.mivb-package-selected .mivb-package-selected-badge {
    display: flex;
}

.mivb-package-item.mivb-package-premium {
    /* background: linear-gradient(135deg, #f6fff4 0%, #fff 100%); */
    /* border-color: #198754; */
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
}

.mivb-package-item.mivb-package-premium:hover {
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2);
}

.mivb-package-content {
    text-align: left;
}

.mivb-package-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px 0;
}

.mivb-package-price {
    font-size: 20px;
    font-weight: 700;
    color: #e91e63;
    margin: 0 0 12px 0;
}

.mivb-package-item.mivb-package-premium .mivb-package-price {
    color: #198754;
}

.mivb-package-features {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}

.mivb-package-features li {
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.mivb-package-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #198754;
    font-weight: bold;
    font-size: 14px;
}

.mivb-package-note {
    font-size: 12px;
    color: #999;
    margin: 8px 0 0 0;
    font-style: italic;
}

.mivb-language-note {
    font-size: 12px;
    color: #666;
    background: #fff3cd;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
    margin-bottom: 0;
    text-align: center;
    line-height: 1.4;
}

/* Modal Steps */
.mivb-modal-step {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Summary Section Styles */
.mivb-summary-section {
    padding: 0;
}

.mivb-summary-title {
    font-size: 22px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
    font-family: inherit;
}

.mivb-summary-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.6;
    font-family: inherit;
}

.mivb-summary-content {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    font-family: inherit;
}

.mivb-summary-group {
    margin-bottom: 25px;
}

.mivb-summary-group:last-child {
    margin-bottom: 0;
}

.mivb-summary-group-title {
    font-size: 17px;
    color: #ff7396;
    margin: 0 0 15px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.mivb-summary-content p {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    font-family: inherit;
}

.mivb-summary-content p strong {
    color: #333;
    font-weight: 600;
    font-family: inherit;
}

.mivb-summary-event {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.mivb-summary-event:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mivb-summary-indent {
    padding-left: 20px;
    color: #555 !important;
}

.mivb-summary-note {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    font-family: inherit;
    line-height: 1.5;
}

/* Step 1 Buttons Container */
.mivb-step1-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;
}

/* Edit Details Button */
.mivb-edit-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.mivb-edit-btn svg {
    flex-shrink: 0;
}

.mivb-edit-btn:hover {
    background: #e5e5e5;
    border-color: #ccc;
    color: #333;
}

/* Continue Button */
.mivb-continue-btn {
    background: #ff7396;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
    font-family: inherit;
}

.mivb-continue-btn:hover {
    background: #ff5a7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 115, 150, 0.3);
}

.mivb-continue-btn:active {
    transform: translateY(0);
}

.mivb-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Step 2 Footer: Same layout as Step 1 (side by side buttons) */
#mivb-modal-step-2 .mivb-modal-footer {
    background: white;
    padding: 15px 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-top: 2px solid #f0f0f0;
    flex-shrink: 0;
}

#mivb-modal-step-2 .mivb-modal-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

#mivb-modal-step-2 .mivb-modal-footer .mivb-modal-description {
    width: 100%;
    text-align: center;
    margin: 0 0 5px;
}

#mivb-modal-step-2 .mivb-modal-footer .mivb-whatsapp-btn {
    width: 100%;
}

/* Modal Description in Footer */
.mivb-modal-footer .mivb-modal-description {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Prevent body scroll when modal is open */
body.mivb-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    padding-right: 0 !important;
}

/* Ensure smooth scrollbar transition */
html {
    overflow-y: scroll;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .mivb-modal-content {
        width: 95%;
        border-radius: 12px;
        height: 90vh;
        max-height: 90vh;
    }

    .mivb-modal-scroll-wrapper {
        max-height: calc(90vh - 160px);
    }

    .mivb-modal-header {
        padding: 25px 20px 15px 20px;
    }

    .mivb-modal-body {
        padding: 20px 20px 25px 20px;
    }

    .mivb-modal-footer {
        padding: 15px 20px 25px 20px;
    }

    .mivb-modal-title {
        font-size: 20px;
    }

    .mivb-id-value {
        font-size: 26px;
    }

    .mivb-whatsapp-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .mivb-success-icon {
        width: 60px;
        height: 60px;
    }

    .video-thumbnail-wrapper{
        max-width: 70%;
    }

    /* Summary mobile styles */
    .mivb-summary-title {
        font-size: 18px;
    }

    .mivb-summary-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .mivb-summary-content {
        padding: 16px;
    }

    .mivb-summary-group-title {
        font-size: 16px;
    }

    .mivb-summary-content p {
        font-size: 14px;
    }

    .mivb-summary-indent {
        padding-left: 15px;
    }

    .mivb-step1-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .mivb-edit-btn,
    .mivb-continue-btn {
        width: 100%;
    }

    .mivb-continue-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    /* Mobile: WhatsApp first, then Back button - both full width */
    #mivb-modal-step-2 .mivb-modal-footer {
        padding: 20px 20px 25px;
    }

    #mivb-modal-step-2 .mivb-modal-footer .mivb-step1-buttons {
        flex-direction: column;
    }

    #mivb-modal-step-2 .mivb-modal-footer .mivb-edit-btn {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    #mivb-modal-step-2 .mivb-modal-footer .mivb-continue-btn {
        order: 1;
        width: 100%;
    }

    #mivb-modal-step-2 .mivb-modal-footer .mivb-modal-description {
        order: 3;
        margin-top: 10px;
    }

    /* Package details mobile */
    .mivb-packages-section {
        padding: 16px;
    }

    .mivb-packages-title {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .mivb-select-package-text {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .mivb-package-item {
        padding: 14px;
        margin-bottom: 10px;
    }

    .mivb-package-selected-badge {
        width: 26px;
        height: 26px;
        top: 10px;
        right: 10px;
    }

    .mivb-package-selected-badge svg {
        width: 16px;
        height: 16px;
    }

    .mivb-package-name {
        font-size: 15px;
    }

    .mivb-package-price {
        font-size: 18px;
    }

    .mivb-package-features {
        font-size: 12px;
    }

    .mivb-language-note {
        font-size: 11px;
        padding: 8px;
    }

    .mivb-modal-footer .mivb-modal-description {
        font-size: 13px;
        margin-bottom: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .mivb-modal-content {
        height: 75vh;
        max-height: 75vh;
    }

    .mivb-modal-scroll-wrapper {
        max-height: calc(75vh - 140px);
    }

    .mivb-modal-header {
        padding: 20px 16px 12px 16px;
    }

    .mivb-modal-body {
        padding: 16px 16px 20px 16px;
    }

    .mivb-modal-footer {
        padding: 12px 16px 20px 16px;
    }

    /* Step 1 - Summary content padding */
    .mivb-summary-content {
        padding: 12px;
    }

    /* Step 2 - Packages section padding */
    .mivb-packages-section {
        padding: 12px;
    }

    .mivb-packages-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .mivb-select-package-text {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .mivb-package-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    .mivb-package-selected-badge {
        width: 24px;
        height: 24px;
        top: 8px;
        right: 8px;
    }

    .mivb-package-selected-badge svg {
        width: 14px;
        height: 14px;
    }

    .mivb-package-name {
        font-size: 14px;
    }

    .mivb-package-price {
        font-size: 16px;
    }

    .mivb-package-features {
        font-size: 11px;
        line-height: 1.6;
    }

    .mivb-package-features li {
        padding-left: 18px;
        margin-bottom: 4px;
    }

    .mivb-modal-title {
        font-size: 18px;
    }

    .mivb-id-value {
        font-size: 24px;
    }

    .mivb-success-icon {
        width: 50px;
        height: 50px;
    }

    .mivb-whatsapp-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .mivb-modal-footer .mivb-modal-description {
        font-size: 12px;
    }
}

/* Family Name Split Fields - Responsive Layout */
.mivb-family-split {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.mivb-family-prefix {
    flex: 0 0 auto;
    min-width: 140px;
    width: 22%;
}

.mivb-family-names {
    flex: 1 1 auto;
    min-width: 200px;
    position: relative;
}

/* Mobile: Stack vertically when screen is too narrow */
@media (max-width: 768px) {
    .mivb-family-split {
        gap: 15px;
    }

    .mivb-family-prefix {
        width: 100%;
        min-width: 100%;
    }

    .mivb-family-names {
        width: 100%;
        min-width: 100%;
    }
}

/* ============================================
   Video Preview Step (Step 0) Styles
   ============================================ */

.mivb-preview-subtitle {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.mivb-video-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.mivb-preview-canvas-wrapper {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #000;
}

.mivb-preview-canvas {
    position: relative;
    /* Dimensions set by JavaScript for consistent scaling */
    background: #1a1a1a;
    overflow: hidden;
    /* Minimum dimensions for loading state before JS sets actual size */
    min-width: 270px;
    min-height: 480px;
}

/* .mivb-preview-loading — see unified rule near .mivb-video-preview-container below */

.mivb-preview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 115, 150, 0.3);
    border-top-color: #ff7396;
    border-radius: 50%;
    animation: mivb-spin 1s linear infinite;
}

@keyframes mivb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* .mivb-preview-loading p — see unified rule near .mivb-video-preview-container below */

.mivb-preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mivb-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.mivb-play-btn,
.mivb-pause-btn {
    background: #ff7396;
    color: white;
}

.mivb-play-btn:hover,
.mivb-pause-btn:hover {
    background: #ff5a82;
    transform: scale(1.05);
}

.mivb-restart-btn,
.mivb-mute-btn,
.mivb-prev-btn,
.mivb-next-btn {
    background: #f0f0f0;
    color: #666;
}

.mivb-restart-btn:hover,
.mivb-mute-btn:hover,
.mivb-prev-btn:hover,
.mivb-next-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.mivb-slide-indicator {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    min-width: 50px;
    text-align: center;
}

.mivb-preview-play-btn,
.mivb-preview-restart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mivb-preview-play-btn {
    background: #ff7396;
    color: white;
}

.mivb-preview-play-btn:hover {
    background: #ff5a82;
    transform: scale(1.05);
}

.mivb-preview-restart-btn {
    background: #f0f0f0;
    color: #666;
}

.mivb-preview-restart-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* Preview canvas layer styles */
.mivb-preview-layer {
    position: absolute;
    transform-origin: center center;
}

/* Image layer styling handled by inline styles - matches QuickCraft */

.mivb-preview-layer-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Step 0 specific styling */
#mivb-modal-step-0 .mivb-success-circle {
    stroke: #ff7396;
    stroke-dasharray: 157;
    stroke-dashoffset: 0;
}

#mivb-modal-step-0 .mivb-success-check {
    stroke: #ff7396;
    stroke-dasharray: 48;
    stroke-dashoffset: 0;
}

/* Error state for preview */
.mivb-preview-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ff7396;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    padding: 20px;
    text-align: center;
}

.mivb-preview-error svg {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.mivb-preview-error p {
    margin: 0;
    font-size: 14px;
    color: #ccc;
}

/* Mobile responsive for preview */
@media (max-width: 480px) {
    .mivb-preview-canvas-wrapper {
        max-width: 280px;
    }

    .mivb-preview-play-btn,
    .mivb-preview-restart-btn {
        width: 44px;
        height: 44px;
    }
}



/* ====================================
   Step 5: Video Preview Step Styles
   ==================================== */

/* =========================================================================
   IMMERSIVE MODE — hides WP chrome when preview is active
   ========================================================================= */

body.mivb-immersive {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

/* Hide ALL WordPress header, footer, sidebar, admin bar, breadcrumbs */
body.mivb-immersive header,
body.mivb-immersive footer,
body.mivb-immersive .site-header,
body.mivb-immersive .site-footer,
body.mivb-immersive .site-navigation,
body.mivb-immersive .main-navigation,
body.mivb-immersive .entry-header,
body.mivb-immersive .entry-footer,
body.mivb-immersive .widget-area,
body.mivb-immersive .sidebar,
body.mivb-immersive .breadcrumb,
body.mivb-immersive .breadcrumbs,
body.mivb-immersive .woocommerce-breadcrumb,
body.mivb-immersive #wpadminbar,
body.mivb-immersive .ast-above-header,
body.mivb-immersive .ast-below-header,
body.mivb-immersive .ast-header-break-point .ast-mobile-header-wrap,
body.mivb-immersive .ast-header-break-point .main-header-bar,
body.mivb-immersive #masthead,
body.mivb-immersive .site-branding,
body.mivb-immersive .elementor-location-header,
body.mivb-immersive .elementor-location-footer,
body.mivb-immersive .page-header,
body.mivb-immersive nav.woocommerce-MyAccount-navigation,
body.mivb-immersive .storefront-breadcrumb,
body.mivb-immersive .colophon {
    display: none !important;
}

/* Make the form fill the entire viewport */
body.mivb-immersive #mivb-multi-step-form,
body.mivb-immersive .mivb-multi-step-form,
body.mivb-immersive .woocommerce,
body.mivb-immersive .site-content,
body.mivb-immersive .content-area,
body.mivb-immersive .site-main,
body.mivb-immersive .entry-content,
body.mivb-immersive main,
body.mivb-immersive #main,
body.mivb-immersive #content,
body.mivb-immersive #primary,
body.mivb-immersive .ast-container,
body.mivb-immersive article {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* form-5 fills the viewport in immersive mode */
body.mivb-immersive #form-5 {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999;
    background: #f8f8fa;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================================
   PREVIEW STEP — immersive full-viewport layout
   ========================================================================= */

.mivb-preview-step {
    padding: 0;
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
}

/* In immersive mode, preview step becomes a full-viewport flex column */
body.mivb-immersive .mivb-preview-step {
    display: flex;
    flex-direction: column;
    height: 100%;  /* fills the fixed-positioned parent (#form-5) which is already 100% viewport */
    padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
    background: #f8f8fa;
    overflow: hidden;
}

/* ---- Header Bar: logo + back button ---- */
.mivb-preview-header-bar {
    display: none; /* only shown in immersive mode */
}

body.mivb-immersive .mivb-preview-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 10;
}

.mivb-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #555;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.mivb-header-back:hover {
    background: #eee;
    color: #333;
}

.mivb-header-logo {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.mivb-header-logo img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.mivb-header-spacer {
    width: 36px;
    flex-shrink: 0;
}

/* TOP section: pills + slide dots */
.mivb-preview-top {
    flex: 0 0 auto;
    padding: 8px 12px;
    text-align: center;
}

/* CENTER section: canvas takes all remaining vertical space */
.mivb-preview-center {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    padding: 6px 12px 10px;
}

/* BOTTOM section: sticky bar */
.mivb-preview-bottom {
    flex: 0 0 auto;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    background: #fff;
    border-top: 1px solid #eee;
}

/* Single-row layout: controls left, actions right */
.mivb-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

/* Action buttons group: back + download side by side */
.mivb-bottom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Bottom back button — filled pill style */
.mivb-bottom-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    border-radius: 22px;
    border: none;
    background: #f0f0f0;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.mivb-bottom-back i {
    font-size: 12px;
}

.mivb-bottom-back:hover {
    background: #e4e4e4;
    color: #333;
    transform: translateY(-1px);
}

.mivb-preview-header {
    margin-bottom: 0;
}

.mivb-success-icon-inline {
    margin-bottom: 15px;
}

.mivb-success-icon-inline svg {
    animation: mivb-checkmark 0.8s ease-in-out;
}

@keyframes mivb-checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.mivb-preview-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.mivb-preview-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px 0;
}

.mivb-submission-id {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.mivb-submission-id strong {
    color: #ff7396;
}

/* Video Preview Container */
/* Container centers the canvas and controls */
.mivb-video-preview-container {
    margin: 0 auto;
    max-width: 300px;
    width: 100%;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* In immersive mode, allow the container to fill available space */
body.mivb-immersive .mivb-video-preview-container {
    max-width: none;
}

/* In immersive mode, canvas must never exceed available height */
body.mivb-immersive .mivb-preview-canvas {
    max-height: calc(100% - 20px);
    border-radius: 0;
    box-shadow: none;
}

/* Normal mode canvas - fixed dimensions for 9:16 ratio */
/* Width: 270px, Height: 270 / (9/16) = 480px */
.mivb-video-preview-container:not(.debug-side-by-side) .mivb-preview-canvas {
    width: 270px;
    height: 480px;
}

.mivb-preview-canvas {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

.mivb-preview-canvas[data-canvas] {
    overflow: hidden;
    display: block;
}

/* Layers start invisible — GSAP initializeLayerStates reveals them.
   Prevents the "flash of un-animated content" on first render. */
.preview-layer {
    opacity: 0;
    visibility: hidden;
}

.mivb-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    border-radius: 12px;
}

.mivb-preview-loading p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Playback Controls */
.mivb-preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.mivb-control-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mivb-play-btn,
.mivb-pause-btn {
    background: linear-gradient(135deg, #ff7396 0%, #ff5a82 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 115, 150, 0.4);
}

.mivb-play-btn:hover,
.mivb-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 115, 150, 0.5);
}

.mivb-restart-btn,
.mivb-mute-btn {
    background: #f0f0f0;
    color: #666;
}

.mivb-restart-btn:hover,
.mivb-mute-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

/* Preview Info */
.mivb-preview-info {
    margin: 25px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #ff7396;
}

.mivb-preview-info p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

/* Back button now in header bar — hide standalone back button */
.mivb-update-content-btn {
    display: none;
}

/* Add to Cart / Download Button */
.mivb-add-to-cart-btn {
    background: linear-gradient(135deg, #ff7396 0%, #ff5a82 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(255, 115, 150, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

.mivb-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #ff5a82 0%, #ff4a72 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 115, 150, 0.35);
}

/* (Change Song Button removed — now accessed via Make Changes popup) */

/* Audio and FPS Controls Row */
.mivb-controls-row {
    display: none !important; /* Hidden - Change Song now in preview-controls */
}

/* Audio Section - Change Song Button - Now inline with playback controls */
.mivb-audio-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* FPS Selection Section */
/* Hidden in HTML preview mode - only needed for server-side video rendering */
.mivb-fps-section {
    display: none !important;
}

/* FPS section visible only when server render is active */
.mivb-server-render-active .mivb-fps-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mivb-fps-section:hover {
    border-color: #ff7396;
}

.mivb-fps-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.mivb-fps-select {
    padding: 6px 30px 6px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
}

.mivb-fps-select:hover,
.mivb-fps-select:focus {
    border-color: #ff7396;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 115, 150, 0.1);
}

.mivb-current-song-label {
    display: none !important;
}

.mivb-new-submission-btn {
    background: linear-gradient(135deg, #ff7396 0%, #ff5a82 100%) !important;
    color: white !important;
    padding: 12px 25px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
}

.mivb-new-submission-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 115, 150, 0.4);
}

/* Canvas Layer Styles for Step 5 */
#mivb-preview-canvas .preview-layer {
    position: absolute;
    transform-origin: center center;
    will-change: transform, opacity; /* GPU acceleration hint */
    backface-visibility: hidden; /* Prevent flickering */
}

#mivb-preview-canvas .preview-layer-text {
    /* Canvas-based text rendering - matches QuickCraft exactly */
    pointer-events: none;
}

#mivb-preview-canvas .preview-layer-text canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: auto;
}

/* Image styling handled by inline styles to match QuickCraft exactly */
#mivb-preview-canvas .preview-layer-image img {
    pointer-events: none;
}

/* GPU acceleration for canvas */
#mivb-preview-canvas {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Error state */
.mivb-preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #ff5a5a;
    padding: 40px 20px;
    text-align: center;
}

.mivb-preview-error p {
    margin: 0;
    color: #999;
    font-size: 14px;
}

/* Step 5 Mobile Responsive */
@media (max-width: 768px) {
    .mivb-preview-step {
        padding: 10px 8px 16px;
    }

    body.mivb-immersive .mivb-preview-step {
        padding: 0;
    }

    .mivb-preview-title {
        font-size: 22px;
    }

    .mivb-preview-subtitle {
        font-size: 14px;
    }

    .mivb-video-preview-container {
        max-width: 290px;
        margin: 8px auto;
    }

    body.mivb-immersive .mivb-video-preview-container {
        max-width: none;
        margin: 0 auto;
    }

    /* Mobile canvas - smaller size: 280x498 */
    .mivb-video-preview-container:not(.debug-side-by-side) .mivb-preview-canvas {
        width: 280px;
        height: 498px;
        border-radius: 8px;
    }

    .mivb-control-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .mivb-bottom-back {
        padding: 9px 16px;
        font-size: 13px;
    }

    .mivb-preview-controls {
        gap: 6px;
    }

    .mivb-preview-info {
        margin: 20px 0;
        padding: 12px 15px;
    }

    .mivb-success-icon-inline svg {
        width: 50px;
        height: 50px;
    }

    .mivb-add-to-cart-btn {
        padding: 9px 16px;
        font-size: 13px;
    }

    .mivb-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .mivb-audio-section {
        justify-content: center;
    }

    .mivb-fps-section {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .mivb-preview-step {
        padding: 8px 6px 12px;
    }

    body.mivb-immersive .mivb-preview-step {
        padding: 0;
    }

    .mivb-preview-title {
        font-size: 18px;
    }

    .mivb-preview-subtitle {
        font-size: 13px;
    }

    .mivb-submission-id {
        font-size: 12px;
    }

    .mivb-video-preview-container {
        max-width: 260px;
    }

    body.mivb-immersive .mivb-video-preview-container {
        max-width: none;
    }

    /* Small mobile canvas - 250x444 */
    .mivb-video-preview-container:not(.debug-side-by-side) .mivb-preview-canvas {
        width: 250px;
        height: 444px;
    }

    .mivb-control-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .mivb-bottom-back {
        padding: 8px 12px;
        font-size: 12px;
    }

    .mivb-bottom-actions {
        gap: 6px;
    }

    .mivb-preview-info p {
        font-size: 13px;
    }

    .mivb-new-submission-btn {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }

    .mivb-success-icon-inline svg {
        width: 44px;
        height: 44px;
    }

    .mivb-add-to-cart-btn {
        font-size: 12px;
        padding: 7px 12px;
    }

    .mivb-preview-top {
        padding: 6px 8px;
    }

    .mivb-preview-bottom {
        padding: 6px 10px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
    }

    .mivb-header-back {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .mivb-header-spacer {
        width: 32px;
    }

    .mivb-header-logo img {
        height: 20px;
    }

    body.mivb-immersive .mivb-preview-header-bar {
        padding: 8px 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .mivb-control-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .mivb-control-btn:active {
        transform: scale(0.95);
    }

    .mivb-header-back:active,
    .mivb-bottom-back:active {
        transform: scale(0.92);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    #mivb-preview-canvas .preview-layer {
        transition: none !important;
        animation: none !important;
    }

    .mivb-success-icon-inline svg {
        animation: none;
    }
}

/* GPU Acceleration for smooth animations */
#mivb-preview-canvas {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

#mivb-preview-canvas .preview-layer {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Image GPU optimization only - sizing via inline styles */
#mivb-preview-canvas .preview-layer-image img {
    pointer-events: none;
}

/* Note: Removed contain: layout style as it interferes with text rendering */



/* Audio Change Button */
.mivb-audio-btn {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%) !important;
}

.mivb-audio-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    transform: scale(1.1);
}

.mivb-audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Audio Upload Status */
.mivb-audio-status {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.mivb-audio-status-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Position the controls container for status positioning */
.mivb-preview-controls {
    position: relative;
}

@media (max-width: 480px) {
    .mivb-audio-status {
        font-size: 11px;
        padding: 5px 10px;
        bottom: -25px;
    }
}


/* Audio Selection Section */
.mivb-audio-selection {
    margin-top: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.mivb-audio-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mivb-audio-title i {
    color: #9333ea;
}

.mivb-audio-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.mivb-toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.mivb-toggle-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #ff7396;
}

.mivb-toggle-label {
    font-size: 14px;
    color: #555;
}

.mivb-custom-song-options {
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.mivb-upload-section {
    margin-bottom: 15px;
}

.mivb-upload-label,
.mivb-start-time-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.mivb-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mivb-file-input {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
}

.mivb-upload-status {
    font-size: 13px;
    padding: 4px 8px;
}

.mivb-upload-status.mivb-uploading {
    color: #6c757d;
}

.mivb-upload-status.mivb-success {
    color: #28a745;
}

.mivb-upload-status.mivb-error {
    color: #dc3545;
}

.mivb-current-song {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    font-style: italic;
}

.mivb-start-time-section {
    margin-bottom: 10px;
}

.mivb-start-time-input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.mivb-help-text {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* ==========================================
   Audio Player with Draggable Timeline
   ========================================== */
.mivb-audio-player {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.mivb-audio-player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mivb-audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #4a90a4;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.mivb-audio-play-btn:hover {
    background: #3a7a94;
    transform: scale(1.05);
}

.mivb-audio-play-btn:active {
    transform: scale(0.95);
}

.mivb-audio-play-btn i {
    font-size: 12px;
    margin-left: 2px;
}

.mivb-audio-play-btn.playing i {
    margin-left: 0;
}

.mivb-audio-time {
    font-size: 13px;
    color: #666;
    font-family: monospace;
}

.mivb-audio-timeline-container {
    position: relative;
}

.mivb-audio-timeline {
    position: relative;
    height: 50px;
    background: linear-gradient(to bottom, #e9ecef, #dee2e6);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

.mivb-audio-waveform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 1px;
    padding: 8px 0;
    box-sizing: border-box;
}

.mivb-waveform-bar {
    flex: 1;
    max-width: 4px;
    min-width: 2px;
    background: #adb5bd;
    border-radius: 2px;
    transition: background 0.1s;
}

.mivb-waveform-bar.active {
    background: #4a90a4;
}

.mivb-audio-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #dc3545;
    z-index: 3;
    pointer-events: none;
    display: none;
}

.mivb-audio-selection-window {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(74, 144, 164, 0.25);
    border: 2px solid #4a90a4;
    border-radius: 4px;
    cursor: grab;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    touch-action: none;
}

.mivb-audio-selection-window:active {
    cursor: grabbing;
}

.mivb-selection-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 24px;
    background: #4a90a4;
    border-radius: 3px;
    pointer-events: none;
}

.mivb-selection-handle-left {
    left: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.mivb-selection-handle-right {
    right: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.mivb-selection-label {
    font-size: 10px;
    color: #4a90a4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.8;
}

.mivb-audio-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: #888;
    font-family: monospace;
}

.mivb-audio-player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.mivb-audio-player-footer .mivb-help-text {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mivb-start-time-display {
    font-size: 13px;
    color: #495057;
}

.mivb-start-time-display strong {
    color: #4a90a4;
    font-family: monospace;
}

/* Audio player loading state */
.mivb-audio-player.loading .mivb-audio-timeline {
    position: relative;
}

.mivb-audio-player.loading .mivb-audio-timeline::after {
    content: "Loading audio...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #888;
}

@media (max-width: 480px) {
    .mivb-audio-toggle {
        flex-direction: column;
        gap: 12px;
    }

    .mivb-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mivb-file-input {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================
   Song Change Modal Styles
   ========================================== */

/* Modal overlay */
.mivb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mivb-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.mivb-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    animation: wifmModalSlideIn 0.25s ease-out;
}

@keyframes wifmModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mivb-modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #ff7396 0%, #ff5277 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mivb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mivb-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
}

.mivb-modal-close:hover {
    opacity: 1;
}

.mivb-modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.mivb-modal-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.mivb-modal-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.mivb-modal-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.mivb-modal-btn-secondary:hover {
    background: #dee2e6;
}

.mivb-modal-btn-primary {
    background: linear-gradient(135deg, #ff7396 0%, #ff5277 100%);
    color: #fff;
}

.mivb-modal-btn-primary:hover {
    background: linear-gradient(135deg, #ff5277 0%, #ff3366 100%);
    transform: translateY(-1px);
}

/* Body class when modal is open */
body.mivb-modal-open {
    overflow: hidden;
}

/* Audio Toggle in Modal */
.mivb-modal-body .mivb-audio-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.mivb-modal-body .mivb-toggle-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.mivb-modal-body .mivb-toggle-option:hover {
    background: #fff0f3;
}

.mivb-modal-body .mivb-toggle-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #ff7396;
}

.mivb-modal-body .mivb-toggle-option input[type="radio"]:checked + .mivb-toggle-label {
    color: #ff7396;
    font-weight: 500;
}

.mivb-modal-body .mivb-toggle-option:has(input:checked) {
    border-color: #ff7396;
    background: #fff0f3;
}

/* Custom Song Options in Modal */
.mivb-modal-body .mivb-custom-song-options {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mivb-modal-body .mivb-upload-section {
    margin-bottom: 16px;
}

.mivb-modal-body .mivb-upload-label,
.mivb-modal-body .mivb-start-time-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.mivb-modal-body .mivb-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mivb-modal-body .mivb-file-input {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.mivb-modal-body .mivb-upload-status {
    font-size: 12px;
    white-space: nowrap;
}

.mivb-modal-body .mivb-upload-status.mivb-uploading {
    color: #0d6efd;
}

.mivb-modal-body .mivb-upload-status.mivb-success {
    color: #28a745;
}

.mivb-modal-body .mivb-upload-status.mivb-error {
    color: #dc3545;
}

.mivb-modal-body .mivb-current-song {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.mivb-modal-body .mivb-start-time-section {
    margin-top: 12px;
}

.mivb-modal-body .mivb-start-time-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.mivb-modal-body .mivb-help-text {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* ============================================
   SONG MODAL SPECIFIC STYLES
   Override the base modal styles for simple display behavior
   ============================================ */
#mivb-song-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none; /* Use display instead of visibility/opacity */
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

#mivb-song-modal.mivb-modal-open {
    display: flex;
}

#mivb-song-modal .mivb-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

#mivb-song-modal .mivb-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wifmSongModalSlideIn 0.25s ease-out;
    z-index: 1000000;
    overflow: hidden;
}

@keyframes wifmSongModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#mivb-song-modal .mivb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: none;
    background: linear-gradient(135deg, #ff7396 0%, #ff5277 100%);
}

#mivb-song-modal .mivb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

#mivb-song-modal .mivb-modal-header h3 i {
    color: #fff;
}

#mivb-song-modal .mivb-modal-close {
    position: static;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0.8;
}

#mivb-song-modal .mivb-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    opacity: 1;
}

#mivb-song-modal .mivb-modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0; /* Required for flexbox scrolling */
}

#mivb-song-modal .mivb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

#mivb-song-modal .mivb-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

#mivb-song-modal .mivb-modal-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

#mivb-song-modal .mivb-modal-btn-secondary:hover {
    background: #e0e0e0;
}

#mivb-song-modal .mivb-modal-btn-primary {
    background: linear-gradient(135deg, #ff7396 0%, #ff5177 100%);
    color: white;
}

#mivb-song-modal .mivb-modal-btn-primary:hover {
    background: linear-gradient(135deg, #ff5177 0%, #ff3366 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 115, 150, 0.4);
}

/* Disabled state for Apply button during upload */
#mivb-song-modal .mivb-modal-btn.mivb-btn-disabled,
#mivb-song-modal .mivb-modal-btn-primary:disabled {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

/* Prevent body scroll when modal is open */
body.mivb-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Audio Player in Song Modal
   ========================================================================== */
#mivb-song-modal .mivb-audio-player {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

#mivb-song-modal .mivb-audio-player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

#mivb-song-modal .mivb-audio-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #ff7396;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

#mivb-song-modal .mivb-audio-play-btn:hover {
    background: #ff5177;
    transform: scale(1.05);
}

#mivb-song-modal .mivb-audio-play-btn i {
    font-size: 14px;
    margin-left: 2px;
}

#mivb-song-modal .mivb-audio-play-btn.playing i {
    margin-left: 0;
}

#mivb-song-modal .mivb-audio-time {
    font-size: 14px;
    color: #555;
    font-family: 'SF Mono', Consolas, monospace;
    font-weight: 500;
}

#mivb-song-modal .mivb-audio-timeline-container {
    position: relative;
    width: 100%;
}

#mivb-song-modal .mivb-audio-timeline {
    position: relative;
    height: 56px;
    background: linear-gradient(to bottom, #f5f5f5, #eee);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    border: 1px solid #ddd;
}

#mivb-song-modal .mivb-audio-waveform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 1px;
    padding: 10px 0;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-waveform-bar {
    flex: 1;
    max-width: 4px;
    min-width: 2px;
    background: #ccc;
    border-radius: 2px;
    transition: background 0.15s;
    flex-shrink: 1;
}

#mivb-song-modal .mivb-waveform-bar.active {
    background: #ff7396;
}

#mivb-song-modal .mivb-audio-selection-window {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 115, 150, 0.2);
    border: 2px solid #ff7396;
    border-radius: 6px;
    cursor: grab;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    touch-action: none;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-audio-selection-window:active {
    cursor: grabbing;
}

#mivb-song-modal .mivb-selection-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 28px;
    background: #ff7396;
    border-radius: 3px;
    pointer-events: none;
}

#mivb-song-modal .mivb-selection-handle-left {
    left: -1px;
}

#mivb-song-modal .mivb-selection-handle-right {
    right: -1px;
}

#mivb-song-modal .mivb-selection-label {
    font-size: 11px;
    color: #ff5177;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    pointer-events: none;
}

#mivb-song-modal .mivb-audio-playhead {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #e53935;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(229, 57, 53, 0.5);
}

#mivb-song-modal .mivb-audio-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #777;
    font-family: 'SF Mono', Consolas, monospace;
}

#mivb-song-modal .mivb-audio-player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

#mivb-song-modal .mivb-audio-player-footer .mivb-help-text {
    margin: 0;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

#mivb-song-modal .mivb-start-time-display {
    font-size: 14px;
    color: #444;
}

#mivb-song-modal .mivb-start-time-display strong {
    color: #ff7396;
    font-family: 'SF Mono', Consolas, monospace;
}

/* Audio player loading state */
#mivb-song-modal .mivb-audio-player.loading .mivb-audio-timeline::after {
    content: "Loading audio...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: #999;
}

/* Entrance animation — draw attention when audio player appears */
@keyframes mivbPlayerSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mivb-song-modal .mivb-audio-player {
    animation: mivbPlayerSlideIn 0.35s ease-out;
}

/* ==========================================================================
   Song Modal — Upload & Audio Player Mobile Fixes
   ========================================================================== */

/* Ensure modal body and all children respect container width */
#mivb-song-modal .mivb-modal-body {
    overflow-x: hidden;
}

#mivb-song-modal .mivb-custom-song-options {
    overflow: hidden;
    box-sizing: border-box;
}

/* Upload section — prevent file input from blowing out modal width */
#mivb-song-modal .mivb-upload-section {
    overflow: hidden;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-upload-row {
    flex-wrap: wrap;
}

#mivb-song-modal .mivb-file-input {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Audio library dropdown */
#mivb-song-modal .mivb-library-section {
    margin-bottom: 4px;
}

#mivb-song-modal .mivb-library-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#mivb-song-modal .mivb-library-select {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: #fff;
    cursor: pointer;
    appearance: auto;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-library-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

#mivb-song-modal .mivb-library-loading {
    color: #8b5cf6;
    font-size: 16px;
}

/* OR divider between library and upload */
#mivb-song-modal .mivb-or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

#mivb-song-modal .mivb-or-divider::before,
#mivb-song-modal .mivb-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

#mivb-song-modal .mivb-or-divider span {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Audio player — prevent timeline overflow */
#mivb-song-modal .mivb-audio-player {
    overflow: hidden;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-audio-timeline-container {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

#mivb-song-modal .mivb-audio-timeline {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#mivb-song-modal .mivb-audio-waveform {
    overflow: hidden;
    box-sizing: border-box;
}

/* ---- Mobile: ≤ 480px ---- */
@media (max-width: 480px) {
    /* Position modal near top so it has maximum room to grow downward */
    #mivb-song-modal {
        align-items: flex-start;
        padding-top: 3vh;
    }

    #mivb-song-modal .mivb-modal-content {
        width: 95%;
        max-width: none;
        max-height: 94vh;
        border-radius: 12px;
    }

    #mivb-song-modal .mivb-modal-header {
        padding: 12px 16px;
    }

    #mivb-song-modal .mivb-modal-header h3 {
        font-size: 16px;
        gap: 8px;
    }

    #mivb-song-modal .mivb-modal-body {
        padding: 14px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mivb-song-modal .mivb-modal-footer {
        padding: 12px 16px;
        gap: 8px;
    }

    #mivb-song-modal .mivb-modal-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    /* Toggle options — compact on mobile */
    #mivb-song-modal .mivb-toggle-option {
        padding: 10px 12px;
    }

    #mivb-song-modal .mivb-modal-body .mivb-audio-toggle {
        gap: 8px;
        margin-bottom: 12px;
    }

    /* Upload section — stack vertically on mobile */
    #mivb-song-modal .mivb-custom-song-options {
        padding: 12px;
        margin-top: 12px;
    }

    #mivb-song-modal .mivb-upload-section {
        margin-bottom: 10px;
    }

    #mivb-song-modal .mivb-upload-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    #mivb-song-modal .mivb-file-input {
        width: 100%;
        min-width: 0;
        font-size: 12px;
        padding: 8px;
    }

    #mivb-song-modal .mivb-upload-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* Library dropdown — compact on mobile */
    #mivb-song-modal .mivb-library-select {
        font-size: 12px;
        padding: 8px;
    }

    #mivb-song-modal .mivb-or-divider {
        margin: 8px 0;
    }

    #mivb-song-modal .mivb-or-divider span {
        font-size: 11px;
    }

    /* Audio player — compact layout to fit in viewport */
    #mivb-song-modal .mivb-audio-player {
        padding: 10px;
        margin-top: 10px;
    }

    #mivb-song-modal .mivb-audio-player-header {
        gap: 10px;
        margin-bottom: 8px;
    }

    #mivb-song-modal .mivb-audio-play-btn {
        width: 34px;
        height: 34px;
    }

    #mivb-song-modal .mivb-audio-play-btn i {
        font-size: 12px;
    }

    #mivb-song-modal .mivb-audio-time {
        font-size: 12px;
    }

    #mivb-song-modal .mivb-audio-timeline {
        height: 44px;
    }

    #mivb-song-modal .mivb-selection-label {
        font-size: 9px;
        letter-spacing: 0;
    }

    /* Footer — inline on mobile, tight spacing */
    #mivb-song-modal .mivb-audio-player-footer {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        margin-top: 6px;
        padding-top: 6px;
    }

    #mivb-song-modal .mivb-audio-player-footer .mivb-help-text {
        font-size: 10px;
    }

    #mivb-song-modal .mivb-start-time-display {
        font-size: 12px;
    }

    #mivb-song-modal .mivb-audio-timeline-labels {
        font-size: 10px;
        margin-top: 3px;
    }
}

/* ---- Small mobile: ≤ 360px ---- */
@media (max-width: 360px) {
    #mivb-song-modal {
        padding-top: 2vh;
    }

    #mivb-song-modal .mivb-modal-content {
        width: 98%;
        max-height: 96vh;
    }

    #mivb-song-modal .mivb-modal-header {
        padding: 10px 12px;
    }

    #mivb-song-modal .mivb-modal-header h3 {
        font-size: 14px;
    }

    #mivb-song-modal .mivb-modal-body {
        padding: 10px 12px;
    }

    #mivb-song-modal .mivb-modal-footer {
        padding: 10px 12px;
    }

    #mivb-song-modal .mivb-toggle-option {
        padding: 8px 10px;
    }

    #mivb-song-modal .mivb-audio-player {
        padding: 8px;
        margin-top: 8px;
    }

    #mivb-song-modal .mivb-audio-player-header {
        margin-bottom: 6px;
    }

    #mivb-song-modal .mivb-audio-play-btn {
        width: 30px;
        height: 30px;
    }

    #mivb-song-modal .mivb-audio-timeline {
        height: 40px;
    }

    #mivb-song-modal .mivb-selection-label {
        display: none;
    }

    #mivb-song-modal .mivb-custom-song-options {
        padding: 10px;
        margin-top: 10px;
    }

    #mivb-song-modal .mivb-audio-player-footer .mivb-help-text {
        display: none; /* Hide drag hint on very small screens to save space */
    }
}

/* =========================================================================
   PREVIEW PILLS — Pill bar, Slide nav, Font overlay, Size, Loader
   ========================================================================= */

/* ---- Pill Bar ---- */

.mivb-pill-bar {
    display: inline-flex;
    justify-content: center;
    gap: 0;
    margin: 0 auto 6px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.mivb-pill {
    flex: 0 0 auto;
    padding: 9px 12px;
    background: #fff;
    border: none;
    border-right: 1px solid #eee;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.mivb-pill:last-child {
    border-right: none;
}

.mivb-pill:hover {
    background: #fff0f3;
    color: #e74c7a;
}

.mivb-pill.active {
    background: #ff7396;
    color: white;
}

/* Music pill highlight when custom song is active */
.mivb-pill.custom-song-active {
    background: #fff0f3;
    color: #e74c7a;
}

.mivb-pill i {
    font-size: 13px;
}

/* Reset pill — distinct warm-orange style, doesn't grow */
.mivb-pill.mivb-pill-reset {
    background: #fff8f0;
    color: #e67e22;
    flex: 0 0 auto;
    padding: 9px 12px;
    border-right: none;
    border-left: 1px solid #fde0c0;
}

.mivb-pill.mivb-pill-reset:hover {
    background: #ffe0b2;
    color: #d35400;
}

/* ---- Slide Nav (dots + counter) ---- */

.mivb-slide-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 2px 0 0;
}

.mivb-slide-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.mivb-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    line-height: 1;
}

.mivb-dot:hover {
    background: #ffcdd9;
    color: #e74c7a;
}

.mivb-dot.active {
    background: #ff7396;
    color: white;
    box-shadow: 0 1px 6px rgba(255, 115, 150, 0.35);
}

.mivb-slide-counter {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

/* ---- Size Control — range slider ---- */

.mivb-size-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.mivb-size-label {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 56px;
    text-align: center;
}

.mivb-size-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #ffb3c6, #ff7396, #e74c7a);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.mivb-size-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid #ff7396;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.mivb-size-range::-webkit-slider-thumb:hover {
    border-color: #e74c7a;
    box-shadow: 0 2px 8px rgba(231, 76, 122, 0.3);
}

.mivb-size-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid #ff7396;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.mivb-size-range-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 11px;
    color: #999;
}

/* ---- Applying Overlay — matches preview-loading visual ---- */

.mivb-applying-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    border-radius: 12px;
    pointer-events: none;
}

.mivb-applying-overlay p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* =========================================================================
   BOTTOM SHEETS — Font & Size (slide up, canvas stays visible)
   ========================================================================= */

.mivb-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647;
    display: none;
    pointer-events: none;
}

.mivb-bottom-sheet.mivb-sheet-open {
    display: block !important;
    pointer-events: auto;
}

/* Light semi-transparent backdrop — lets canvas show through */
.mivb-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mivb-sheet-open .mivb-sheet-backdrop {
    opacity: 1;
}

/* Panel slides up from bottom */
.mivb-sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 40vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mivb-sheet-open .mivb-sheet-panel {
    transform: translateY(0);
}

/* Drag handle — visual cue that sheet is draggable/dismissible */
.mivb-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    flex-shrink: 0;
}

.mivb-sheet-handle span {
    width: 36px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
}

/* Sheet header: title left, action buttons right */
.mivb-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 8px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.mivb-sheet-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mivb-sheet-header h3 i {
    font-size: 14px;
    color: #ff7396;
}

.mivb-sheet-actions {
    display: flex;
    gap: 8px;
}

.mivb-sheet-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.mivb-sheet-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.mivb-sheet-btn-cancel:hover {
    background: #e4e4e4;
    color: #333;
}

.mivb-sheet-btn-apply {
    background: linear-gradient(135deg, #ff7396 0%, #ff5a82 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 115, 150, 0.25);
}

.mivb-sheet-btn-apply:hover {
    background: linear-gradient(135deg, #ff5a82 0%, #ff4a72 100%);
    box-shadow: 0 3px 12px rgba(255, 115, 150, 0.35);
}

/* Sheet body — scrollable content area */
.mivb-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* ---- Font Bottom Sheet specifics ---- */

.mivb-font-sheet-panel {
    max-height: 35vh;
}

.mivb-font-sheet-body {
    padding: 0;
}

.mivb-font-dropdown {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mivb-fd-group {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.7px;
    padding: 10px 16px 4px;
    background: #fafafa;
    border-top: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mivb-fd-group:first-child {
    border-top: none;
}

.mivb-fd-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
    font-family: inherit;
}

.mivb-fd-item:hover,
.mivb-fd-item:active {
    background: #fff0f3;
    color: #e74c7a;
}

.mivb-fd-item.selected {
    background: #ff7396;
    color: #fff;
}

/* ---- Size Bottom Sheet specifics ---- */

.mivb-size-sheet-panel {
    max-height: 35vh;
}

.mivb-size-sheet-panel .mivb-sheet-body {
    padding: 12px 24px 16px;
}

.mivb-size-hint {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 12px 0 0;
    line-height: 1.4;
}

/* ---- Desktop: Convert bottom sheets to centered cards ---- */
@media (min-width: 769px) {
    .mivb-sheet-panel {
        left: 50%;
        right: auto;
        transform: translate(-50%, 100%);
        max-width: 400px;
        width: 100%;
        border-radius: 16px;
        bottom: 20px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    }

    .mivb-sheet-open .mivb-sheet-panel {
        transform: translate(-50%, 0);
    }

    .mivb-font-sheet-panel {
        max-height: 35vh;
    }

    .mivb-size-sheet-panel {
        max-height: 28vh;
        max-width: 360px;
    }

    /* Hide drag handle on desktop — sheets close via cancel/backdrop */
    .mivb-sheet-handle {
        display: none;
    }
}

/* ---- Change Video Modal — product grid ---- */

#mivb-video-modal {
    z-index: 2147483647 !important;
    display: none;
}

#mivb-video-modal.mivb-modal-open {
    display: flex !important;
}

#mivb-video-modal > .mivb-modal-backdrop {
    z-index: 2147483646 !important;
}

.mivb-video-modal-content {
    z-index: 2147483647 !important;
    width: 90%;
    max-width: 540px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mivb-video-products-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: #888;
}

.mivb-video-products-loading p {
    margin: 0;
    font-size: 14px;
}

.mivb-video-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px;
}

.mivb-video-card {
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid #eee;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
}

.mivb-video-card:hover {
    border-color: #ffb3c6;
    box-shadow: 0 2px 12px rgba(255, 115, 150, 0.2);
    transform: translateY(-2px);
}

.mivb-video-card.active {
    border-color: #ff7396;
    box-shadow: 0 2px 12px rgba(255, 115, 150, 0.35);
}

.mivb-video-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #f5f5f5;
}

.mivb-video-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mivb-video-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ff7396;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mivb-video-card-name {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================================
   PREVIEW PILLS — Mobile
   ========================================================================= */

@media (max-width: 480px) {
    .mivb-pill {
        font-size: 11px;
        padding: 9px 8px;
        gap: 3px;
    }

    .mivb-pill i {
        font-size: 12px;
    }

    .mivb-pill.mivb-pill-reset {
        padding: 9px 10px;
    }

    .mivb-dot {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .mivb-slide-counter {
        font-size: 11px;
    }

    .mivb-size-label {
        font-size: 18px;
    }

    .mivb-fd-item {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Bottom sheets on mobile — keep canvas visible */
    .mivb-font-sheet-panel {
        max-height: 40vh;
    }

    .mivb-size-sheet-panel {
        max-height: 35vh;
    }

    .mivb-video-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .mivb-video-products-grid {
        gap: 8px;
    }

    .mivb-video-card-name {
        font-size: 11px;
        padding: 6px 8px;
    }

    /* Control button + layout overrides moved to main step-5 480px block */
}
