:root {
    --bg-deep: #070a0f;
    --bg: #0b1018;
    --surface: rgba(18, 25, 36, .86);
    --surface-solid: #121923;
    --surface-raised: #182230;
    --line: rgba(196, 210, 226, .13);
    --line-bright: rgba(196, 210, 226, .25);
    --text: #f2f5f7;
    --muted: #99a7b8;
    --silver: #cbd4dd;
    --ice: #78c5e8;
    --ice-bright: #a6e2fb;
    --gold: #d6aa55;
    --green: #4fd18b;
    --yellow: #f2c14e;
    --red: #ff6577;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

html { font-size: 16px; min-height: 100%; }
* { box-sizing: border-box; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 18%, rgba(39, 91, 122, .23), transparent 32rem),
        radial-gradient(circle at 85% 8%, rgba(75, 103, 126, .16), transparent 34rem),
        linear-gradient(145deg, #070a0f 0%, #0b1119 48%, #080b10 100%);
    font-family: Inter, system-ui, sans-serif;
    overflow-x: hidden;
}

.page-noise {
    position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.app-shell { width: min(1380px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(7, 10, 15, .78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(130%);
}
.site-header .navbar { min-height: 78px; padding: .6rem 0; }
.viking-brand { display: flex; align-items: center; gap: .78rem; color: white; }
.brand-emblem {
    width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden;
    border: 1px solid rgba(220, 230, 238, .25); border-radius: 14px;
    background: linear-gradient(145deg, #29313a, #10151c);
    box-shadow: inset 0 1px rgba(255,255,255,.18), 0 8px 22px rgba(0,0,0,.38);
}
.brand-emblem img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.08) saturate(.65); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font: 700 1.05rem Cinzel, serif; letter-spacing: .12em; }
.brand-text small { margin-top: .3rem; color: var(--muted); font-size: .7rem; letter-spacing: .17em; text-transform: uppercase; }
.navbar-nav { gap: .25rem; }
.nav-link { color: #b8c2cd !important; font-weight: 600; padding: .7rem .9rem !important; border-radius: 10px; }
.nav-link:hover { color: white !important; background: rgba(255,255,255,.055); }
.progress-nav-link { color: var(--ice-bright) !important; background: rgba(91, 181, 221, .1); border: 1px solid rgba(91,181,221,.16); }
.progress-nav-link svg, .logout-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-right: .35rem; }
.nav-user { color: var(--muted); font-size: .85rem; padding: .5rem .6rem; }
.logout-button { border: 0; background: transparent; color: var(--muted); padding: .65rem; border-radius: 10px; }
.logout-button:hover { color: white; background: rgba(255,255,255,.06); }
.logout-button svg { margin: 0; }
.page-content { min-height: calc(100vh - 150px); padding-top: 42px; padding-bottom: 70px; }

.search-hero {
    position: relative; isolation: isolate; overflow: hidden;
    min-height: 0; display: grid; place-items: center;
    padding: 30px 32px 26px; border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(120deg, rgba(18, 26, 38, .96), rgba(11, 17, 26, .89)),
        radial-gradient(circle at center, rgba(100, 183, 219, .12), transparent 50%);
    box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.04);
}
.search-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .25;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(10px); z-index: -1; }
.hero-glow-one { width: 430px; height: 430px; left: -210px; top: -240px; background: rgba(58, 155, 198, .2); }
.hero-glow-two { width: 330px; height: 330px; right: -130px; bottom: -220px; background: rgba(214, 170, 85, .1); }
.search-hero-content { width: min(900px, 100%); text-align: center; }
.eyebrow { color: var(--ice); font-size: .72rem; font-weight: 700; letter-spacing: .24em; }
.media-search-form { display: flex; flex-direction: column; align-items: center; }
.media-search-form > .eyebrow { margin-bottom: 14px; }
.search-scope { display: inline-flex; padding: 5px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,7,12,.5); }
.scope-button { cursor: pointer; padding: .62rem 1.05rem; color: var(--muted); border-radius: 9px; font-size: .84rem; font-weight: 700; transition: .2s ease; }
.btn-check:checked + .scope-button { color: white; background: linear-gradient(145deg, #26384a, #1a2a39); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 4px 14px rgba(0,0,0,.25); }
.search-box-wrap { position: relative; display: flex; width: 100%; max-width: 850px; }
.media-search-input {
    width: 100%; height: 68px; border: 1px solid var(--line-bright); border-radius: 17px;
    padding: 0 172px 0 57px; color: white; outline: 0;
    background: rgba(5, 9, 14, .83); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 16px 45px rgba(0,0,0,.25);
    transition: border-color .2s, box-shadow .2s;
}
.media-search-input:focus { border-color: rgba(116, 202, 239, .7); box-shadow: 0 0 0 4px rgba(85, 181, 222, .12), 0 18px 50px rgba(0,0,0,.3); }
.search-leading-icon { position: absolute; z-index: 2; left: 20px; top: 22px; width: 24px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.clear-search-button { position: absolute; right: 126px; top: 18px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; opacity: 0; pointer-events: none; }
.clear-search-button.is-visible { opacity: 1; pointer-events: auto; }
.clear-search-button:hover { color: white; background: rgba(255,255,255,.08); }
.clear-search-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-submit-button { position: absolute; right: 7px; top: 7px; height: 54px; min-width: 112px; border: 0; border-radius: 12px; color: #071018; font-weight: 800; background: linear-gradient(135deg, #b9e8fa, #6cbddd); box-shadow: 0 9px 25px rgba(60,156,197,.25); }
.search-submit-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.search-submit-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-help-link { margin-top: 15px; border: 0; color: var(--muted); background: transparent; font-size: .84rem; }
.search-help-link span { color: var(--ice); margin-left: .25rem; }
.search-help-link:hover span { text-decoration: underline; }

.results-section { margin-top: 44px; }
.results-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
.results-heading-row h2 { margin: 8px 0 0; font: 700 clamp(1.45rem, 3vw, 2.05rem) Cinzel, serif; }
.results-legend { display: flex; gap: 16px; color: var(--muted); font-size: .75rem; }
.results-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-good { background: var(--green); } .legend-warning { background: var(--yellow); } .legend-danger { background: var(--red); }
.result-list { display: grid; gap: 10px; }
.media-result-card {
    position: relative; display: grid; grid-template-columns: 60px 54px minmax(0, 1fr) auto; align-items: center; gap: 16px;
    min-height: 92px; padding: 14px 20px 14px 12px; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius-md);
    background: linear-gradient(110deg, rgba(22,30,42,.92), rgba(14,21,31,.9));
    box-shadow: 0 9px 30px rgba(0,0,0,.16); transition: border-color .2s, transform .2s, background .3s;
}
.media-result-card:hover { transform: translateY(-2px); border-color: rgba(136,177,205,.25); }
.result-download-column { display: grid; place-items: center; }
.download-button { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(126,199,231,.28); border-radius: 13px; color: var(--ice-bright); background: rgba(68,145,179,.12); }
.download-button:hover { color: #071018; background: var(--ice-bright); box-shadow: 0 8px 24px rgba(99,195,235,.22); }
.download-button:disabled { opacity: .6; }
.download-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.download-button.is-loading svg { animation: pulse-download .7s infinite alternate; }
@keyframes pulse-download { to { transform: translateY(3px); opacity: .4; } }
.result-type-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; }
.result-type-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.type-tv { color: #91d7f2; background: rgba(61,150,191,.12); border: 1px solid rgba(91,181,221,.17); }
.type-movie { color: #dbbd7a; background: rgba(190,144,63,.11); border: 1px solid rgba(214,170,85,.16); }
.result-main { min-width: 0; }
.result-main h3 { margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 650; }
.result-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .76rem; }
.media-kind { color: #c7d1dc; }
.meta-divider { width: 3px; height: 3px; border-radius: 50%; background: #526172; }
.result-size { min-width: 90px; padding: .46rem .7rem; text-align: center; border: 1px solid; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.size-good { color: #7ee5a9; border-color: rgba(79,209,139,.25); background: rgba(79,209,139,.1); }
.size-warning { color: #f6d375; border-color: rgba(242,193,78,.27); background: rgba(242,193,78,.1); }
.size-danger { color: #ff8a98; border-color: rgba(255,101,119,.28); background: rgba(255,101,119,.11); }
.size-unknown { color: var(--muted); border-color: var(--line); background: rgba(255,255,255,.03); }
.queue-result-form { display: none; }
.media-result-card.queue-success { animation: successFlash 2.6s ease; }
.media-result-card.queue-duplicate { animation: duplicateFlash 2.6s ease; }
@keyframes successFlash { 15%, 55% { border-color: rgba(79,209,139,.85); background: rgba(25,92,59,.72); } }
@keyframes duplicateFlash { 15%, 55% { border-color: rgba(255,101,119,.9); background: rgba(104,28,40,.72); transform: translateX(0); } 22%, 34% { transform: translateX(-5px); } 28%, 40% { transform: translateX(5px); } }

.empty-state, .search-message { margin-top: 36px; padding: 46px 24px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.empty-state-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: var(--ice); border: 1px solid rgba(120,197,232,.25); background: rgba(120,197,232,.08); font: 700 1.4rem Cinzel, serif; }
.empty-state h2 { font-family: Cinzel, serif; }
.empty-state p, .search-message span { color: var(--muted); }
.search-message { display: flex; flex-direction: column; gap: 6px; border-color: rgba(255,101,119,.25); }

.viking-modal { position: relative; padding: 38px; overflow: hidden; color: var(--text); border: 1px solid var(--line-bright); border-radius: 24px; background: linear-gradient(145deg, #17212e, #0d131c); box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 12px; right: 15px; z-index: 2; border: 0; color: var(--muted); background: transparent; font-size: 1.6rem; }
.modal-rune { position: absolute; right: 20px; top: 10px; color: rgba(130,202,231,.06); font: 700 10rem Cinzel, serif; line-height: 1; }
.viking-modal h2 { margin: 10px 0; font-family: Cinzel, serif; }
.viking-modal p { color: var(--muted); }
.search-example-list { display: grid; gap: 10px; margin: 24px 0; }
.search-example { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: 12px; color: white; background: rgba(255,255,255,.025); }
.search-example:hover { border-color: rgba(120,197,232,.4); background: rgba(120,197,232,.06); }
.search-example code { color: var(--ice-bright); font-size: .9rem; }
.search-example span { color: var(--muted); font-size: .74rem; }
.modal-tip { padding: 13px 15px; color: #c6d1dc; border-left: 3px solid var(--gold); background: rgba(214,170,85,.07); font-size: .8rem; }
.viking-toast-container { top: 88px; z-index: 2100; }
.viking-toast { width: min(460px, calc(100vw - 32px)); color: white; border: 1px solid var(--line-bright); border-radius: 14px; background: #17212d; box-shadow: 0 18px 55px rgba(0,0,0,.45); overflow: hidden; }
.viking-toast .toast-body { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; }
.viking-toast .toast-body > div:nth-child(2) { min-width: 0; flex: 1 1 auto; }
.toast-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-weight: 900; }
.toast-success .toast-icon { color: #092818; background: var(--green); }
.toast-error .toast-icon { color: #350910; background: var(--red); }
#queueToastTitle, #queueToastMessage { display: block; overflow: hidden; text-overflow: ellipsis; }
#queueToastTitle { white-space: nowrap; }
#queueToastMessage { margin-top: 2px; color: #adbac7; font-size: .78rem; white-space: nowrap; }
.site-footer { border-top: 1px solid var(--line); color: #687687; font-size: .72rem; }
.site-footer .app-shell { min-height: 70px; display: flex; justify-content: center; align-items: center; gap: 13px; text-align: center; }
.footer-rune { color: #48576a; }

@media (max-width: 767.98px) {
    .app-shell { width: min(100% - 24px, 1380px); }
    .site-header .navbar { min-height: 68px; }
    .brand-emblem { width: 44px; height: 44px; }
    .navbar-collapse { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #0c121a; }
    .nav-user { display: none; }
    .page-content { padding-top: 18px; }
    .search-hero { min-height: auto; padding: 24px 16px 22px; border-radius: 22px; }
    .search-scope { width: 100%; }
    .scope-button { flex: 1; padding: .6rem .35rem; font-size: .75rem; }
    .media-search-input { height: 62px; padding-right: 60px; padding-left: 48px; }
    .search-submit-button { position: static; width: 100%; height: 52px; margin-top: 10px; }
    .search-box-wrap { flex-wrap: wrap; }
    .clear-search-button { right: 12px; top: 15px; }
    .results-heading-row { align-items: start; flex-direction: column; }
    .results-legend { flex-wrap: wrap; }
    .media-result-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
    .result-download-column { grid-row: 1 / span 2; }
    .download-button { width: 42px; height: 42px; }
    .result-type-icon { display: none; }
    .result-main h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .result-size { grid-column: 3; grid-row: 1 / span 2; min-width: 76px; font-size: .69rem; }
    .viking-toast { width: calc(100vw - 30px); }
    .viking-toast-container { top: 76px; left: 0; right: 0 !important; }
    .site-footer .app-shell { flex-direction: column; gap: 3px; padding: 16px 0; }
    .footer-rune { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* Viking Media Search: progress page */
.progress-page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.progress-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: .9rem;
}

    .progress-page-header h1 {
        margin: .15rem 0 .2rem;
        font-size: clamp(1.8rem, 3vw, 2.75rem);
        letter-spacing: -.04em;
    }

    .progress-page-header p {
        margin: 0;
        color: rgba(232, 238, 247, .62);
    }

.progress-header-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 0 0 auto;
}

.progress-alert {
    border-radius: 14px;
}

.system-ribbon {
    display: flex;
    align-items: center;
    gap: .55rem 1.2rem;
    flex-wrap: wrap;
    min-height: 42px;
    padding: .5rem .8rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(8, 14, 24, .72);
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    backdrop-filter: blur(14px);
}

    .system-ribbon.has-warning {
        border-color: rgba(255, 180, 62, .4);
    }

.system-ribbon-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: rgba(235, 241, 250, .74);
    font-size: .82rem;
    white-space: nowrap;
}

.status-dot {
    width: .52rem;
    height: .52rem;
    border-radius: 50%;
    background: #6f7b8d;
    box-shadow: 0 0 0 4px rgba(111, 123, 141, .08);
}

.system-ribbon-item.is-good .status-dot {
    background: #52d69a;
    box-shadow: 0 0 0 4px rgba(82, 214, 154, .1), 0 0 14px rgba(82, 214, 154, .35);
}

.system-ribbon-item.is-bad .status-dot {
    background: #ff6b72;
    box-shadow: 0 0 0 4px rgba(255, 107, 114, .1), 0 0 14px rgba(255, 107, 114, .3);
}

.system-storage-warning {
    margin-left: auto;
    border: 0;
    border-radius: 999px;
    padding: .25rem .65rem;
    background: rgba(255, 176, 48, .14);
    color: #ffd488;
    font-size: .78rem;
    font-weight: 700;
}

.download-feed {
    display: grid;
    gap: .7rem;
}

.download-card {
    --phase-color: 81, 145, 255;
    position: relative;
    min-height: 104px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: linear-gradient(90deg, rgba(var(--phase-color), .13) 0, rgba(var(--phase-color), .04) 42%, rgba(7, 12, 21, .92) 76%), rgba(8, 14, 24, .9);
    box-shadow: 0 16px 36px rgba(0,0,0,.22);
    isolation: isolate;
    transition: opacity .8s ease, filter .8s ease, border-color .3s ease, transform .3s ease;
}

    .download-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 3px;
        background: rgb(var(--phase-color));
        box-shadow: 0 0 18px rgba(var(--phase-color), .8);
        z-index: 3;
    }

.download-card-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) minmax(180px, auto);
    align-items: center;
    gap: 1rem;
    min-height: 104px;
    padding: .9rem 1rem .9rem 1.15rem;
}

.download-media-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: rgba(var(--phase-color), .12);
    border: 1px solid rgba(var(--phase-color), .23);
}

    .download-media-icon svg,
    .motion-media svg {
        width: 30px;
        height: 30px;
        fill: none;
        stroke: rgb(var(--phase-color));
        stroke-width: 2.4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.download-main-copy {
    min-width: 0;
}

.download-title-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

    .download-title-row h2 {
        min-width: 0;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: clamp(1rem, 1.7vw, 1.22rem);
        font-weight: 750;
        color: #f4f7fb;
    }

.download-owner {
    flex: 0 0 auto;
    padding: .16rem .48rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    color: rgba(231, 237, 246, .7);
    font-size: .68rem;
    font-weight: 700;
}

.download-meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: .32rem;
    color: rgba(226, 233, 243, .56);
    font-size: .75rem;
}

    .download-meta span + span::before {
        content: "�";
        margin-right: .65rem;
        opacity: .45;
    }

.download-status-area {
    display: grid;
    grid-template-columns: 22px auto;
    align-items: center;
    justify-content: end;
    gap: .5rem;
    min-width: 180px;
}

.download-status-icon {
    position: relative;
    width: 22px;
    height: 22px;
}

    .download-status-icon span,
    .download-status-icon::before,
    .download-status-icon::after {
        position: absolute;
        content: "";
        border-radius: 50%;
    }

    .download-status-icon span {
        inset: 6px;
        background: rgb(var(--phase-color));
        box-shadow: 0 0 12px rgba(var(--phase-color), .7);
    }

    .download-status-icon::before {
        inset: 2px;
        border: 1px solid rgba(var(--phase-color), .55);
        animation: viking-status-pulse 2.4s ease-out infinite;
    }

.download-status-text {
    color: rgb(var(--phase-color));
    font-size: .87rem;
    font-weight: 800;
    white-space: nowrap;
}

.download-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
    margin-top: .25rem;
}

.download-problem {
    margin-top: .45rem;
    color: #ff9da3;
    font-size: .75rem;
}

    .download-problem.is-warning {
        color: #ffd078;
    }

    .download-problem summary {
        cursor: pointer;
        font-weight: 700;
    }

    .download-problem p {
        margin: .35rem 0 0;
        max-width: 760px;
        color: rgba(238, 241, 247, .72);
    }

.download-card-motion {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .16;
}

.motion-cloud,
.motion-media,
.motion-library {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.motion-cloud {
    left: 7%;
    width: 58px;
}

    .motion-cloud svg {
        fill: none;
        stroke: rgba(var(--phase-color), .8);
        stroke-width: 2;
    }

.motion-track {
    position: absolute;
    left: 13%;
    right: 10%;
    top: 50%;
    height: 1px;
    overflow: hidden;
    background: linear-gradient(90deg, transparent, rgba(var(--phase-color), .65), transparent);
}

.motion-media {
    left: 18%;
}

.motion-library {
    right: 5%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(var(--phase-color), .8);
    border-radius: 12px;
    color: rgb(var(--phase-color));
    font-weight: 900;
}

.download-card.is-copying::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--actual-progress);
    background: linear-gradient(90deg, rgba(var(--phase-color), .06), rgba(var(--phase-color), .2));
    border-right: 1px solid rgba(var(--phase-color), .7);
    transition: width 1s ease;
    z-index: 0;
}

.download-card.is-copying .motion-media {
    left: clamp(14%, var(--actual-progress), 86%);
    transition: left 1s ease;
}

.download-card.is-downloading .motion-track::after,
.download-card.is-processing .motion-track::after,
.download-card.is-preparing .motion-track::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(var(--phase-color), .9), transparent);
    animation: viking-track-sweep 2.8s ease-in-out infinite;
}

.download-card.is-downloading .motion-media {
    animation: viking-gentle-drift 3.4s ease-in-out infinite;
}

.download-card.is-processing .download-media-icon svg {
    animation: viking-slow-turn 5s linear infinite;
}

.download-card.is-preparing .motion-library {
    animation: viking-library-breathe 2.6s ease-in-out infinite;
}

.download-card.is-queued {
    --phase-color: 110, 147, 203;
}

.download-card.is-downloading {
    --phase-color: 73, 161, 255;
}

.download-card.is-processing {
    --phase-color: 168, 117, 255;
}

.download-card.is-preparing,
.download-card.is-copying {
    --phase-color: 242, 179, 73;
}

.download-card.is-waiting {
    --phase-color: 255, 165, 67;
}

.download-card.is-complete {
    --phase-color: 75, 213, 144;
}

.download-card.is-failed {
    --phase-color: 255, 95, 104;
}

.download-card.is-canceled {
    --phase-color: 132, 143, 158;
}

.download-card.is-resting {
    opacity: .48;
    filter: saturate(.65);
}

    .download-card.is-resting .download-status-area {
        opacity: 1;
        filter: saturate(1.35);
    }

    .download-card.is-resting .download-status-text,
    .download-card.is-resting .download-status-icon {
        opacity: 1;
    }

    .download-card.is-resting .download-title-row,
    .download-card.is-resting .download-meta,
    .download-card.is-resting .download-media-icon,
    .download-card.is-resting .download-card-motion,
    .download-card.is-resting .download-problem,
    .download-card.is-resting .download-actions {
        opacity: .5;
    }

.download-card.just-arrived {
    opacity: 1;
    filter: none;
    animation: viking-arrival-glow 1.15s ease-out 2;
}

    .download-card.just-arrived .motion-media {
        animation: viking-arrival-run 2.5s cubic-bezier(.2,.8,.2,1) 1;
    }

    .download-card.just-arrived .motion-library {
        animation: viking-arrival-stamp .8s ease-out 1.8s 1 both;
    }

.progress-empty-state {
    display: grid;
    place-items: center;
    min-height: 340px;
    padding: 2.5rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    text-align: center;
    background: rgba(8, 14, 24, .72);
}

    .progress-empty-state h2 {
        margin: 1rem 0 .35rem;
    }

    .progress-empty-state p {
        margin: 0 0 1rem;
        color: rgba(233, 238, 247, .6);
    }

.empty-orbit {
    position: relative;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
}

    .empty-orbit span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ebb24f;
        box-shadow: 0 0 18px rgba(235,178,79,.7);
        animation: viking-empty-orbit 5s linear infinite;
    }

.diagnostics-modal {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    background: linear-gradient(145deg, #111a29, #080d16);
    color: #eef3f8;
    box-shadow: 0 28px 90px rgba(0,0,0,.55);
}

    .diagnostics-modal .modal-header {
        border-bottom-color: rgba(255,255,255,.08);
    }

.storage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 1rem;
}

.storage-card {
    padding: .95rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
}

    .storage-card.is-low {
        border-color: rgba(255, 171, 55, .48);
        background: rgba(255, 171, 55, .07);
    }

    .storage-card.is-unavailable {
        border-color: rgba(255, 100, 108, .4);
    }

.storage-card-header,
.storage-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

    .storage-card-header span,
    .storage-card-footer {
        color: rgba(235,241,248,.58);
        font-size: .74rem;
    }

    .storage-card-header strong {
        display: block;
        margin-top: .1rem;
        color: #f6f8fb;
        font-size: 1.05rem;
    }

.storage-percent {
    color: #a8b6c9;
    font-size: .78rem;
}

.storage-meter {
    height: 7px;
    margin: .8rem 0 .65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

    .storage-meter span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #55d49a, #73aaff);
    }

.storage-card.is-low .storage-meter span {
    background: linear-gradient(90deg, #f1b74f, #ff735f);
}

.storage-card-footer code {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(235,241,248,.56);
}

.storage-error {
    margin-top: .55rem;
    color: #ff9ca3;
    font-size: .72rem;
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
}

.diagnostic-tile {
    padding: .75rem;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 13px;
    background: rgba(255,255,255,.025);
}

    .diagnostic-tile span {
        display: block;
        margin-bottom: .18rem;
        color: rgba(235,241,248,.5);
        font-size: .7rem;
    }

    .diagnostic-tile strong {
        font-size: .84rem;
    }

.diagnostics-message,
.diagnostics-error {
    margin-top: .8rem;
    padding: .7rem .8rem;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    color: rgba(235,241,248,.7);
    font-size: .78rem;
}

.diagnostics-error {
    border: 1px solid rgba(255, 95, 104, .28);
    color: #ffafb4;
}

@keyframes viking-status-pulse {
    0% {
        transform: scale(.65);
        opacity: .8;
    }

    80%, 100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes viking-track-sweep {
    0% {
        transform: translateX(-120%);
    }

    70%, 100% {
        transform: translateX(420%);
    }
}

@keyframes viking-gentle-drift {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(-54%) translateX(12px);
    }
}

@keyframes viking-slow-turn {
    to {
        transform: rotate(360deg);
    }
}

@keyframes viking-library-breathe {
    0%, 100% {
        box-shadow: 0 0 0 rgba(var(--phase-color), 0);
    }

    50% {
        box-shadow: 0 0 22px rgba(var(--phase-color), .45);
    }
}

@keyframes viking-arrival-glow {
    0% {
        box-shadow: 0 16px 36px rgba(0,0,0,.22);
    }

    50% {
        box-shadow: 0 0 42px rgba(var(--phase-color), .42);
    }

    100% {
        box-shadow: 0 16px 36px rgba(0,0,0,.22);
    }
}

@keyframes viking-arrival-run {
    0% {
        left: 12%;
        transform: translateY(-50%) rotate(0);
    }

    72% {
        left: 86%;
        transform: translateY(-50%) rotate(540deg);
    }

    100% {
        left: 86%;
        transform: translateY(-50%) rotate(540deg) scale(.1);
        opacity: 0;
    }
}

@keyframes viking-arrival-stamp {
    0% {
        transform: translateY(-50%) scale(.7);
        opacity: .35;
    }

    65% {
        transform: translateY(-50%) scale(1.18);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 28px rgba(var(--phase-color), .55);
    }
}

@keyframes viking-empty-orbit {
    from {
        transform: translate(-50%, -50%) rotate(0deg) translateX(31px);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) translateX(31px);
    }
}

@media (max-width: 760px) {
    .progress-page-shell {
        width: min(100% - 1rem, 1180px);
        padding-top: .75rem;
    }

    .progress-page-header {
        align-items: flex-start;
        gap: .8rem;
    }

        .progress-page-header p {
            display: none;
        }

    .progress-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .system-ribbon {
        gap: .5rem;
    }

    .system-ribbon-item {
        width: 100%;
    }

    .system-storage-warning {
        margin-left: 0;
    }

    .download-card-content {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: .7rem;
        padding: .8rem;
    }

    .download-media-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

        .download-media-icon svg {
            width: 25px;
            height: 25px;
        }

    .download-status-area {
        grid-column: 2;
        justify-content: start;
        grid-template-columns: 18px auto;
        min-width: 0;
        margin-top: .25rem;
    }

    .download-actions {
        justify-content: flex-start;
    }

    .download-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .25rem;
    }

        .download-title-row h2 {
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

    .download-meta span:last-child {
        width: 100%;
    }

        .download-meta span:last-child::before {
            display: none;
        }

    .download-card-motion {
        opacity: .1;
    }

    .storage-grid,
    .diagnostics-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .download-card *,
    .download-card::before,
    .download-card::after,
    .empty-orbit span {
        animation: none !important;
        transition: none !important;
    }
}


/* Viking Media Search: final progress-page polish */
.progress-header-actions .btn-viking {
    color: #071018;
    border: 1px solid rgba(166, 226, 251, .72);
    background: linear-gradient(135deg, #c9effd, #78c5e8);
    box-shadow: 0 8px 22px rgba(72, 169, 211, .24);
    font-weight: 800;
}
.progress-header-actions .btn-viking:hover,
.progress-header-actions .btn-viking:focus {
    color: #03090e;
    border-color: #d9f5ff;
    background: linear-gradient(135deg, #e0f7ff, #91d7f2);
    box-shadow: 0 10px 28px rgba(72, 169, 211, .34);
    transform: translateY(-1px);
}
.download-card-motion {
    inset: 22% 13% 12% 13%;
    opacity: .29;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.motion-cloud { left: 1%; }
.motion-track { left: 9%; right: 9%; }
.motion-media { left: 14%; }
.motion-library { right: 1%; }
.download-card.is-downloading .download-card-motion { opacity: .38; }
.download-card.is-copying .download-card-motion { opacity: .44; }
.download-card.is-resting {
    opacity: .72;
    filter: saturate(.78);
}
.download-card.is-resting .download-title-row,
.download-card.is-resting .download-meta,
.download-card.is-resting .download-media-icon,
.download-card.is-resting .download-card-motion,
.download-card.is-resting .download-problem,
.download-card.is-resting .download-actions {
    opacity: .72;
}
.download-card.just-arrived { opacity: 1; filter: none; }
@media (max-width: 760px) {
    .download-card-motion {
        inset: 28% 4% 8% 16%;
        opacity: .14;
    }
}

/* Progress-card animation lane and encoding-safe metadata separator */
.download-meta span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 .65rem 2px 0;
    border-radius: 50%;
    background: currentColor;
    opacity: .45;
    vertical-align: middle;
}

.download-card-motion {
    inset: auto 14.5rem .55rem 11rem;
    height: 34px;
    opacity: .34;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.motion-cloud,
.motion-media,
.motion-library {
    top: 50%;
}

.motion-cloud {
    left: 0;
    width: 44px;
}

.motion-track {
    left: 8%;
    right: 8%;
    top: 50%;
}

.motion-media {
    left: 14%;
}

.motion-library {
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.download-card.is-downloading .download-card-motion {
    opacity: .48;
}

.download-card.is-copying .download-card-motion {
    opacity: .56;
}

@media (max-width: 900px) {
    .download-card-motion {
        inset: auto 1rem .45rem 9.5rem;
        height: 30px;
        opacity: .22;
    }
}

@media (max-width: 760px) {
    .download-card-motion {
        display: none;
    }
}

/* Compact two-line progress cards */
.download-card {
    min-height: 78px;
}

.download-card-content {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 78px;
    gap: .85rem;
    padding: .72rem .95rem .72rem 1.05rem;
}

.download-media-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

    .download-media-icon svg {
        width: 25px;
        height: 25px;
    }

.download-main-copy {
    min-width: 0;
}

.download-compact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title status"
        "meta actions";
    align-items: center;
    gap: .28rem .9rem;
    min-width: 0;
}

.download-line-one {
    grid-area: title;
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

    .download-line-one h2 {
        min-width: 0;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #f4f7fb;
        font-size: clamp(.95rem, 1.5vw, 1.12rem);
        font-weight: 750;
    }

.download-kind-pill {
    flex: 0 0 auto;
    min-width: 3.3rem;
    padding: .16rem .46rem;
    border: 1px solid rgba(var(--phase-color), .28);
    border-radius: 999px;
    background: rgba(var(--phase-color), .11);
    color: rgb(var(--phase-color));
    font-size: .67rem;
    font-weight: 850;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.download-line-two {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    color: rgba(226, 233, 243, .58);
    font-size: .74rem;
}

    .download-line-two span:first-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.download-year {
    flex: 0 0 auto;
    color: rgba(226, 233, 243, .42);
}

.download-status-area {
    grid-area: status;
    display: inline-grid;
    grid-template-columns: 18px auto;
    align-items: center;
    justify-content: end;
    gap: .42rem;
    min-width: 0;
}

.download-status-icon {
    width: 18px;
    height: 18px;
}

    .download-status-icon span {
        inset: 5px;
    }

.download-status-text {
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgb(var(--phase-color));
    font-size: .8rem;
    font-weight: 850;
    white-space: nowrap;
}

.download-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    margin-top: 0;
}

    .download-actions .btn {
        padding: .22rem .52rem;
        font-size: .72rem;
        line-height: 1.25;
    }

.download-problem {
    margin-top: .35rem;
}

.download-card-motion {
    inset: auto 13rem .35rem 7rem;
    height: 24px;
    opacity: .2;
}

@media (max-width: 760px) {
    .download-feed {
        gap: .48rem;
    }

    .download-card {
        min-height: 66px;
        border-radius: 14px;
    }

    .download-card-content {
        grid-template-columns: 34px minmax(0, 1fr);
        min-height: 66px;
        gap: .55rem;
        padding: .55rem .62rem .55rem .72rem;
    }

    .download-media-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

        .download-media-icon svg {
            width: 20px;
            height: 20px;
        }

    .download-compact-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title status"
            "meta actions";
        gap: .18rem .48rem;
    }

    .download-line-one {
        gap: .38rem;
    }

        .download-line-one h2 {
            font-size: .86rem;
        }

    .download-kind-pill {
        min-width: 2.55rem;
        padding: .11rem .32rem;
        font-size: .58rem;
        letter-spacing: .02em;
    }

    .download-line-two {
        font-size: .66rem;
    }

    .download-year {
        display: none;
    }

    .download-status-area {
        grid-template-columns: 12px auto;
        gap: .25rem;
    }

    .download-status-icon {
        width: 12px;
        height: 12px;
    }

        .download-status-icon span {
            inset: 4px;
        }

        .download-status-icon::before {
            inset: 1px;
        }

    .download-status-text {
        max-width: 7.8rem;
        font-size: .66rem;
    }

    .download-actions {
        gap: .25rem;
    }

        .download-actions .btn {
            padding: .14rem .34rem;
            font-size: .62rem;
        }

    .download-card-motion {
        display: none;
    }

    .download-problem {
        font-size: .68rem;
    }
}

@media (max-width: 430px) {
    .download-compact-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title status"
            "meta actions";
    }

    .download-status-text {
        max-width: 5.9rem;
    }

    .download-line-two span:first-child {
        max-width: 100%;
    }

    .download-actions .btn {
        padding-inline: .28rem;
    }
}

/* Admin logs */
.admin-log-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.admin-log-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-log-header h1 {
    margin: .2rem 0 .25rem;
    font: 700 clamp(1.7rem, 3vw, 2.4rem) Cinzel, serif;
}

.admin-log-header p {
    margin: 0;
    color: var(--muted);
}

.admin-log-mode {
    display: inline-flex;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(3, 7, 12, .55);
}

.admin-log-mode a {
    padding: .52rem .9rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}

.admin-log-mode a.is-active {
    color: #071018;
    background: linear-gradient(135deg, #c9effd, #78c5e8);
}

.admin-log-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px auto;
    gap: .8rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: .95rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 14, 24, .72);
}

.admin-log-filter .form-label {
    color: rgba(235, 241, 248, .7);
    font-size: .76rem;
    font-weight: 750;
}

.admin-log-filter .form-control {
    color: var(--text);
    border-color: var(--line-bright);
    background: rgba(5, 9, 14, .85);
}

.admin-log-filter-actions {
    display: flex;
    gap: .45rem;
}

.admin-log-list {
    display: grid;
    gap: .65rem;
}

.admin-log-entry {
    display: grid;
    grid-template-columns: 185px minmax(0, 1fr);
    gap: .85rem;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(110deg, rgba(22, 30, 42, .92), rgba(14, 21, 31, .9));
}

.admin-log-time {
    color: var(--ice-bright);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-log-message {
    color: #f4f7fb;
    font-weight: 700;
}

.admin-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .72rem;
}

.admin-log-meta span {
    padding: .12rem .45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .025);
}

.admin-log-entry pre {
    margin: .65rem 0 0;
    padding: .75rem;
    max-height: 260px;
    overflow: auto;
    color: #cfe2ee;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, .28);
    font-size: .74rem;
    white-space: pre-wrap;
}

.admin-log-empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 14, 24, .72);
}

@media (max-width: 760px) {
    .admin-log-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-log-filter {
        grid-template-columns: 1fr;
    }

    .admin-log-filter-actions {
        justify-content: stretch;
    }

    .admin-log-filter-actions .btn {
        flex: 1;
    }

    .admin-log-entry {
        grid-template-columns: 1fr;
    }
}

.login {
    color: black;
}

/* Progress page: stage overview (replaces voyage motion cards) */
.download-card-motion,
.download-card.is-copying::after {
    display: none !important;
}

.download-card {
    --progress: 0%;
    min-height: 0;
}

.download-card-content {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    gap: .95rem;
    min-height: 0;
    padding: 1rem 1.05rem 1rem 1.1rem;
}

.download-main-copy {
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.download-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
    min-width: 0;
}

.download-title-block {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.download-title-block h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f4f7fb;
    font-size: clamp(.98rem, 1.5vw, 1.14rem);
    font-weight: 750;
}

.download-status-area {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex: 0 0 auto;
    min-width: 0;
}

.download-status-text {
    color: rgb(var(--phase-color));
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.download-percent {
    min-width: 2.6rem;
    color: rgba(232, 238, 247, .72);
    font-size: .78rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.download-progress-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(3, 8, 14, .55);
}

.download-progress-fill {
    width: var(--progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(var(--phase-color), .55), rgb(var(--phase-color)));
    box-shadow: 0 0 16px rgba(var(--phase-color), .35);
    transition: width .7s ease;
}

.download-card.is-downloading .download-progress-fill,
.download-card.is-processing .download-progress-fill,
.download-card.is-preparing .download-progress-fill,
.download-card.is-copying .download-progress-fill {
    background-size: 140% 100%;
    animation: viking-progress-sheen 2.4s linear infinite;
}

.download-stages {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-stages li {
    display: grid;
    justify-items: center;
    gap: .28rem;
    min-width: 0;
    color: rgba(226, 233, 243, .38);
    font-size: .68rem;
    font-weight: 700;
}

.download-stages .stage-dot {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
}

.download-stages .stage-label {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-stages li.is-done {
    color: rgba(226, 233, 243, .7);
}

.download-stages li.is-done .stage-dot {
    background: rgba(var(--phase-color), .55);
}

.download-stages li.is-current {
    color: rgb(var(--phase-color));
}

.download-stages li.is-current .stage-dot {
    background: rgb(var(--phase-color));
    box-shadow: 0 0 12px rgba(var(--phase-color), .55);
}

.download-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-width: 0;
}

.download-meta-line {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    color: rgba(226, 233, 243, .55);
    font-size: .74rem;
}

.download-meta-line > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-actions {
    display: flex;
    gap: .4rem;
    margin: 0;
}

.download-note {
    color: rgba(226, 233, 243, .7);
    font-size: .74rem;
}

.download-note.is-danger {
    color: #ff9da3;
}

.progress-empty-state .empty-orbit {
    display: none;
}

@keyframes viking-progress-sheen {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.18); }
    100% { filter: brightness(1); }
}

@media (max-width: 760px) {
    .download-card-content {
        grid-template-columns: 34px minmax(0, 1fr);
        padding: .75rem .7rem .8rem .75rem;
    }

    .download-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: .35rem;
    }

    .download-status-area {
        justify-content: space-between;
    }

    .download-stages {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem .35rem;
    }

    .download-bottom-row {
        flex-direction: column;
        align-items: stretch;
    }

    .download-actions {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .download-progress-fill,
    .download-card.is-downloading .download-progress-fill,
    .download-card.is-processing .download-progress-fill,
    .download-card.is-preparing .download-progress-fill,
    .download-card.is-copying .download-progress-fill {
        animation: none !important;
        transition: none !important;
    }
}
