* {
    box-sizing: border-box;
}

:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #697386;
    --line: #e4e9f2;
    --primary: #2f6fed;
    --primary-dark: #1f56c7;
    --shadow: 0 18px 45px rgba(30, 53, 92, .10);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, .10), transparent 30%),
        #f4f7fb;
}

a {
    color: inherit;
}

.hero {
    padding: 42px 24px 34px;
    color: white;
    background:
        linear-gradient(135deg, rgba(24, 38, 70, .97), rgba(47, 111, 237, .92)),
        #1e2a44;
}

.hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 28px;
    width: min(1440px, 100%);
    margin: auto;
}

.eyebrow,
.section-kicker {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.eyebrow {
    color: rgba(255,255,255,.70);
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1;
    letter-spacing: -.04em;
}

.hero p {
    margin: 14px 0 0;
    color: rgba(255,255,255,.78);
    font-size: 17px;
}

.hero-actions {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.source-select label {
    display: block;
    margin-bottom: 7px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 700;
}

.source-select select {
    min-width: 220px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px;
    color: white;
    background: rgba(255,255,255,.12);
}

.button,
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    text-decoration: none;
    font-weight: 750;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.button:hover,
.download-button:hover {
    transform: translateY(-1px);
}

.button-light {
    padding: 12px 16px;
    color: #17305f;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.container {
    width: min(1440px, calc(100% - 32px));
    margin: 26px auto 70px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a,
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.folder-description,
.notice {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow);
}

.folder-description {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 0 0 30px;
    padding: 22px 24px;
    line-height: 1.7;
}

.description-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: white;
    background: var(--primary);
    font-weight: 900;
}

.notice {
    padding: 20px;
}

.notice.error {
    color: #991b1b;
    background: #fff1f2;
}

section {
    margin-top: 38px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.section-kicker {
    color: var(--primary);
}

h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -.03em;
}

.count-badge {
    min-width: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: #eaf1ff;
    text-align: center;
    font-weight: 800;
}

.folder-grid,
.media-grid,
.video-grid {
    display: grid;
    gap: 20px;
}

.folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.media-grid {
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.video-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.folder-card,
.media-card,
.video-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(30, 53, 92, .07);
    overflow: hidden;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 18px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.folder-card:hover {
    transform: translateY(-3px);
    border-color: #bfd0f6;
    box-shadow: var(--shadow);
}

.folder-icon {
    font-size: 34px;
}

.folder-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.folder-arrow {
    color: var(--primary);
    font-size: 22px;
}

.image-button {
    position: relative;
    display: block;
    width: 100%;
    height: 235px;
    padding: 0;
    border: 0;
    cursor: zoom-in;
    background: #101828;
    overflow: hidden;
}

.image-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.image-button:hover img {
    transform: scale(1.035);
}

.zoom-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    color: white;
    background: rgba(15, 23, 42, .74);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.video-frame {
    padding: 10px;
    background: #111827;
}

.video-launch {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, #111827, #26334d);
    cursor: pointer;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(47,111,237,.28), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,0));
}

.video-play-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    padding-left: 5px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    background: rgba(47,111,237,.92);
    box-shadow: 0 16px 36px rgba(0,0,0,.30);
    font-size: 30px;
    transition: transform .18s ease, background .18s ease;
}

.video-launch:hover .video-play-icon {
    transform: scale(1.08);
    background: var(--primary-dark);
}

.video-launch-label {
    position: absolute;
    left: 14px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.72);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.video-frame video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background: #000;
}

.media-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 15px 16px 17px;
}

.media-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.media-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta small {
    color: var(--muted);
}

.download-button {
    flex: 0 0 auto;
    padding: 9px 12px;
    color: white;
    background: var(--primary);
    font-size: 13px;
}

.download-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 18px rgba(47, 111, 237, .22);
}

dialog {
    width: min(1180px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 18px;
    border: 0;
    border-radius: 18px;
    color: white;
    background: #0f172a;
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

dialog::backdrop {
    background: rgba(2, 6, 23, .82);
    backdrop-filter: blur(6px);
}

dialog img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    margin: auto;
    object-fit: contain;
}

dialog p {
    margin: 12px 46px 0 0;
    color: rgba(255,255,255,.76);
}

.dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: rgba(255,255,255,.14);
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 760px) {
    .hero {
        padding: 30px 18px 26px;
    }

    .hero-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .source-select select,
    .button-light {
        width: 100%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-button {
        height: 190px;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 20px, 1440px);
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    .image-button {
        height: 230px;
    }

    .media-info {
        align-items: stretch;
        flex-direction: column;
    }

    .download-button {
        width: 100%;
    }
}

.file-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}.share-button{display:inline-grid;place-items:center;flex:0 0 auto;width:40px;height:40px;padding:0;border:1px solid #c8d5ef;border-radius:11px;color:var(--primary);background:#f4f7ff;cursor:pointer;transition:transform .15s ease,background .15s ease,border-color .15s ease,box-shadow .15s ease}.share-button:hover{transform:translateY(-1px);border-color:#9eb7ea;background:#eaf1ff;box-shadow:0 8px 18px rgba(47,111,237,.16)}.share-button:focus-visible{outline:3px solid rgba(47,111,237,.25);outline-offset:2px}.share-button svg{display:block}.auth-page,.share-page{display:grid;place-items:center;min-height:100vh;padding:24px}.auth-card,.share-card{width:min(720px,100%);padding:30px;border:1px solid var(--line);border-radius:22px;background:white;box-shadow:var(--shadow)}.auth-card{max-width:460px}.auth-card form,.share-dialog form{display:grid;gap:10px;margin-top:22px}.auth-card input,.share-dialog input{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:11px;font:inherit}.auth-icon{font-size:42px}.auth-error{margin-top:14px;padding:12px 14px;border-radius:10px;color:#991b1b;background:#fee2e2}.button-primary{display:inline-flex;justify-content:center;align-items:center;padding:12px 16px;border:0;border-radius:11px;color:white;background:var(--primary);font:inherit;font-weight:800;text-decoration:none;cursor:pointer}.share-dialog{max-width:620px;color:var(--text);background:white}.share-dialog p{margin-right:0;color:var(--muted)}.share-result-row{display:flex;gap:10px;margin-top:8px}#shareResult{margin-top:22px}.eyebrow-dark{color:var(--primary);font-size:12px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}.share-image,.share-video{display:block;width:100%;max-height:70vh;margin:24px 0;border-radius:16px;object-fit:contain;background:#0f172a}.share-download{width:100%}@media(max-width:600px){.share-result-row{flex-direction:column}.file-actions{justify-content:stretch}.file-actions .download-button{flex:1}.file-actions .share-button{flex:0 0 40px}}


.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-launch:has(.video-poster) .video-placeholder {
    background: linear-gradient(rgba(15, 23, 42, .18), rgba(15, 23, 42, .42));
}


.panorama-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 15, 31, .58), transparent 58%);
    pointer-events: none;
}

.panorama-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(47, 111, 237, .92);
    font-size: 12px;
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}

.panorama-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 23, 42, .62);
    font-size: 28px;
    font-weight: 900;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(6px);
}

.panorama-dialog {
    width: min(1280px, calc(100% - 24px));
    height: min(820px, calc(100vh - 24px));
    padding: 14px;
    overflow: hidden;
}

.panorama-viewer {
    width: 100%;
    height: calc(100% - 42px);
    min-height: 420px;
    border-radius: 14px;
    overflow: hidden;
    background: #050a14;
}

.panorama-title {
    margin: 10px 48px 0 4px;
}

.panorama-dialog .pnlm-container {
    border-radius: 14px;
}

@media (max-width: 700px) {
    .panorama-dialog {
        width: calc(100% - 10px);
        height: calc(100vh - 10px);
        padding: 8px;
    }

    .panorama-viewer {
        min-height: 320px;
        height: calc(100% - 38px);
    }
}
