.mgb-hotspot-download {
    --mgb-border: #dbe3ef;
    --mgb-muted: #64748b;
    width: min(1100px, calc(100vw - 32px));
    max-width: min(1100px, calc(100vw - 32px));
    margin: 28px auto 40px;
    color: #172033;
    font-size: 15px;
    letter-spacing: 0;
}

.mgb-hotspot-download,
.mgb-hotspot-download * {
    box-sizing: border-box;
}

.mgb-hotspot-download__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--mgb-border);
}

.mgb-hotspot-download__title {
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: 0;
}

.mgb-hotspot-download__back-to-post {
    color: #1d4ed8;
    text-decoration: none;
}

.mgb-hotspot-download__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 22px;
    align-items: start;
}

.mgb-hotspot-download__main,
.mgb-hotspot-download__side {
    min-width: 0;
}

.mgb-hotspot-download__action,
.mgb-hotspot-download__details-panel {
    border: 1px solid var(--mgb-border);
    border-radius: 6px;
    background: #fff;
}

.mgb-hotspot-download__action {
    min-height: 250px;
    padding: 22px;
    text-align: center;
}

.mgb-hotspot-download__panel-heading,
.mgb-hotspot-download__backups-title {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: 0;
}

.mgb-hotspot-download__action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.mgb-hotspot-download__btn,
.mgb-hotspot-download__server-btn,
.mgb-hotspot-download__backup-btn,
.mgb-hotspot-download__login-btn,
.mgb-hotspot-download__retry-btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #1d4ed8;
    border-radius: var(--mgb-download-radius, 6px);
    background: var(--mgb-download-bg, #1d4ed8);
    color: var(--mgb-download-color, #fff);
    font: inherit;
    font-size: var(--mgb-download-font, 15px);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
}

.mgb-hotspot-download__server-btn,
.mgb-hotspot-download__retry-btn {
    background: #fff;
    color: #1d4ed8;
}

.mgb-hotspot-download__btn.is-disabled,
.mgb-hotspot-download button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mgb-hotspot-download__action-state,
.mgb-hotspot-download__unlocked-content {
    margin-top: 18px;
}

.mgb-hotspot-download__label,
.mgb-hotspot-download__server-note,
.mgb-hotspot-download__notice {
    margin: 8px 0;
    color: var(--mgb-muted);
}

.mgb-hotspot-download__bar {
    width: min(420px, 100%);
    height: 6px;
    margin: 10px auto 0;
    overflow: hidden;
    border-radius: 3px;
    background: #e2e8f0;
}

.mgb-hotspot-download__progress {
    width: 0;
    height: 100%;
    background: #0f766e;
    transition: width 0.2s linear;
}

.mgb-hotspot-download__details-panel {
    padding: 16px;
}

.mgb-hotspot-download__details-list {
    margin: 0;
}

.mgb-hotspot-download__detail-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.mgb-hotspot-download__detail-row:last-child {
    border-bottom: 0;
}

.mgb-hotspot-download__detail-row dt {
    color: var(--mgb-muted);
}

.mgb-hotspot-download__detail-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.mgb-hotspot-download__secret {
    margin: 14px auto 0;
    color: #334155;
    white-space: pre-wrap;
}

.mgb-hotspot-download__backups {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--mgb-border);
}

.mgb-hotspot-download__backups-list {
    display: grid;
    gap: 10px;
}

.mgb-hotspot-download__backup-item {
    display: grid;
    gap: 5px;
    justify-items: center;
}

.mgb-hotspot-download__backup-note {
    max-width: 100%;
    color: var(--mgb-muted);
    overflow-wrap: anywhere;
}

.mgb-hotspot-download .mgb-ad-slot {
    display: grid;
    grid-template-rows: 18px minmax(250px, auto);
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 286px;
    margin-top: 24px;
    padding: 10px 0;
    border-block: 1px solid var(--mgb-border);
}

.mgb-hotspot-download__ad-label {
    color: #64748b;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    text-transform: uppercase;
}

.mgb-hotspot-download__ad-content {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mgb-hotspot-download__ad-content > * {
    max-width: 100%;
}

.mgb-hotspot-download__stream-frame {
    display: none;
    width: 0;
    height: 0;
    border: 0;
}

.mgb-hotspot-download__streaming {
    min-height: 24px;
}

/*
 * The Download Center page only loads this stylesheet, so the hidden state
 * must be defined here. Without it the download button stays visible while
 * the countdown is still running and the visitor sees a dead link.
 *
 * The descendant selector is required: the theme sets
 * `.mgb-hotspot-download__btn { display: inline-flex !important }` and loads
 * after this file, so a single-class rule would lose the cascade.
 */
.mgb-hotspot-download .mgb-is-hidden {
    display: none !important;
}

.mgb-download-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: mgb-toast-in 0.3s ease-out;
}

.mgb-download-toast--error {
    background: #ef4444;
}

.mgb-download-toast--success {
    background: #10b981;
}

.mgb-download-toast--info {
    background: #2563eb;
}

@keyframes mgb-toast-in {

    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mgb-hotspot-download__invalid-container {
    padding: 20px;
    text-align: center;
}

.mgb-hotspot-download__invalid-message {
    color: #ef4444;
    font-weight: 600;
    margin-bottom: 16px;
    display: block;
}

.mgb-hotspot-download__action-btn {
    margin: 0 auto;
}

.mgb-hotspot-download__waiting-text {
    margin-top: 12px;
    font-size: 14px;
    color: var(--mgb-muted);
    font-style: italic;
}

@media (max-width: 760px) {

    .mgb-hotspot-download {
        width: min(100%, calc(100vw - 20px));
        max-width: min(100%, calc(100vw - 20px));
        margin-top: 18px;
    }

    .mgb-hotspot-download__header,
    .mgb-hotspot-download__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .mgb-hotspot-download__title {
        font-size: 22px;
    }

    .mgb-hotspot-download__action {
        min-height: 230px;
        padding: 18px 14px;
    }

    .mgb-hotspot-download__btn,
    .mgb-hotspot-download__server-btn,
    .mgb-hotspot-download__backup-btn,
    .mgb-hotspot-download__login-btn,
    .mgb-hotspot-download__retry-btn {
        width: 100%;
    }

    .mgb-hotspot-download .mgb-ad-slot {
        grid-template-rows: 18px minmax(250px, auto);
        min-height: 286px;
    }

    .mgb-hotspot-download__ad-content {
        min-height: 250px;
    }
}

/* ===== Streaming spinner =====
   Restored: the legacy plugin stylesheet (assets/block-model-gallery.css) was
   removed and nothing replaced these rules, so .lds-ellipsis rendered as four
   unstyled divs with no size, colour or animation. */
.lds-ellipsis {
    box-sizing: border-box;
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lds-ellipsis div {
    box-sizing: border-box;
    position: absolute;
    top: 33.33333px;
    width: 13.33333px;
    height: 13.33333px;
    border-radius: 0;
    background: currentcolor;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {

    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes lds-ellipsis2 {

    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(24px, 0);
    }
}

@keyframes lds-ellipsis3 {

    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

/* Compact variant used inside the download panel's streaming state. */
.mgb-hotspot-download__streaming .lds-ellipsis {
    width: 48px;
    height: 24px;
    flex: 0 0 48px;
}

.mgb-hotspot-download__streaming .lds-ellipsis div {
    top: 8px;
    width: 8px;
    height: 8px;
}

.mgb-hotspot-download__streaming .lds-ellipsis div:nth-child(1) {
    left: 4px;
    animation: mgb-ellipsis1 0.6s infinite;
}

.mgb-hotspot-download__streaming .lds-ellipsis div:nth-child(2) {
    left: 4px;
    animation: mgb-ellipsis2 0.6s infinite;
}

.mgb-hotspot-download__streaming .lds-ellipsis div:nth-child(3) {
    left: 19px;
    animation: mgb-ellipsis2 0.6s infinite;
}

.mgb-hotspot-download__streaming .lds-ellipsis div:nth-child(4) {
    left: 34px;
    animation: mgb-ellipsis3 0.6s infinite;
}

@keyframes mgb-ellipsis1 {

    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes mgb-ellipsis2 {

    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(15px, 0);
    }
}

@keyframes mgb-ellipsis3 {

    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

/* ===== State blocks that lost their layout with the legacy stylesheet ===== */
.mgb-hotspot-download__countdown {
    display: grid;
    gap: 6px;
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
}

.mgb-hotspot-download__login-required {
    display: grid;
    gap: 10px;
    width: 100%;
}

.mgb-hotspot-download__notice.is-login-required {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mgb-hotspot-download__action-state > :not(.mgb-is-hidden) {
    width: 100%;
}

/* Long panel titles must wrap instead of overflowing the panel. */
.mgb-hotspot-download__panel-title {
    overflow-wrap: anywhere;
}
