.mi-btn,
.mi-btn:link,
.mi-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    background-color: #A1BF34;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
}

.mi-btn:hover,
.mi-btn:focus {
    background-color: #38D0F2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    outline: none;
}

.mi-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.mi-btn-secondary {
    background: #0f172a;
}

.mi-btn-secondary:hover,
.mi-btn-secondary:focus {
    background: #38D0F2;
}

.mi-btn-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    color: currentColor;
}

.mi-download-wrapper {
    margin-top: 10px;
    margin-bottom: 24px;
}

.mi-material-preview-card {
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 20px;
    display: grid;
    gap: 18px;
}

.mi-material-preview-card__top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mi-material-preview-card__badge {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 16px;
    background: linear-gradient(135deg, #A1BF34, #38D0F2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(56, 208, 242, 0.2);
}

.mi-material-preview-card__title {
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
    word-break: break-word;
}

.mi-material-preview-card__submeta {
    color: #64748b;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.mi-material-empty-state {
    width: 100%;
    max-width: 720px;
    border: 1px solid rgba(239, 68, 68, 0.16);
    background: #fff8f8;
    color: #7f1d1d;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.mi-material-empty-state__icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 18px;
    font-weight: 800;
}

.mi-material-empty-state__content strong {
    display: block;
    margin-bottom: 4px;
    color: #7f1d1d;
}

.mi-material-empty-state__content p {
    margin: 0 0 8px;
}

.mi-material-empty-state__link {
    color: #b91c1c;
    font-weight: 700;
    text-decoration: underline;
}

.mi-modal[hidden] {
    display: none !important;
}

.mi-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.mi-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(2px);
}

.mi-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(1100px, 100%);
    max-height: min(90vh, 1000px);
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mi-modal__dialog--small {
    width: min(560px, 100%);
}

.mi-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
}

.mi-modal__close:hover,
.mi-modal__close:focus {
    background: rgba(15, 23, 42, 0.14);
    outline: none;
}

.mi-modal__header {
    padding: 24px 56px 16px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.mi-modal__header h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.25;
    word-break: break-word;
}

.mi-modal__header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.mi-modal__body {
    padding: 20px;
    overflow: auto;
}

.mi-modal__body--center {
    padding: 32px 24px;
    text-align: center;
}

.mi-document-viewer {
    width: 100%;
    height: min(78vh, 900px);
    min-height: 420px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.mi-document-viewer__frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.mi-preview-note {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
}

.mi-unsupported-preview {
    text-align: center;
    padding: 24px;
    display: grid;
    gap: 14px;
    justify-items: center;
}

.mi-unsupported-preview__icon {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    background: linear-gradient(135deg, #A1BF34, #38D0F2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
}

.mi-unsupported-preview h4 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
}

.mi-unsupported-preview p {
    margin: 0;
    max-width: 700px;
    color: #475569;
    line-height: 1.7;
}

.mi-lock-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 8px;
}

.mi-membership-actions {
    display: grid;
    gap: 14px;
    justify-items: center;
    margin-top: 16px;
}

.mi-login-link {
    color: #0f172a;
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .mi-btn,
    .mi-btn:link,
    .mi-btn:visited {
        width: 100%;
        font-size: 14px;
        padding: 14px 18px;
    }

    .mi-material-preview-card {
        padding: 16px;
        border-radius: 16px;
    }

    .mi-material-preview-card__top {
        align-items: flex-start;
    }

    .mi-material-preview-card__badge {
        width: 56px;
        height: 56px;
        min-width: 56px;
        font-size: 15px;
        border-radius: 14px;
    }

    .mi-material-preview-card__title {
        font-size: 17px;
    }

    .mi-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .mi-modal__dialog,
    .mi-modal__dialog--small {
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }

    .mi-modal__header {
        padding: 18px 52px 14px 18px;
    }

    .mi-modal__header h3 {
        font-size: 18px;
    }

    .mi-modal__body {
        padding: 14px;
    }

    .mi-document-viewer {
        height: 72vh;
        min-height: 340px;
    }

    .mi-material-empty-state {
        flex-direction: column;
    }
}