/* =========================================================
   MEDIA WORLD V2
   Safe cinematic preview — no unreviewed raw media exposure.
   ========================================================= */

.mwv2-head{
    display:grid;
    grid-template-columns:1fr minmax(300px,.68fr);
    gap:42px;
    align-items:end;
    margin-bottom:20px;
}
.mwv2-head span{
    color:rgb(var(--world-accent)/.88);
    font:700 .43rem/1 monospace;
    letter-spacing:.1em;
}
.mwv2-head h2{
    margin:10px 0 0;
    font-size:clamp(2.2rem,4vw,4.4rem);
    line-height:.92;
    letter-spacing:-.055em;
}
.mwv2-head p{
    margin:0;
    color:var(--ws-muted);
    font-size:.61rem;
    line-height:1.68;
}

.mwv2-safety{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
    margin-bottom:10px;
}
.mwv2-safety-card{
    min-height:104px;
    padding:12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:18px;
    background:
        radial-gradient(circle at 0 0,rgb(var(--world-accent)/.055),transparent 40%),
        rgba(255,255,255,.012);
}
.mwv2-safety-card span{
    display:block;
    color:var(--ws-dim);
    font:650 .34rem/1 monospace;
    letter-spacing:.06em;
}
.mwv2-safety-card strong{
    display:block;
    margin-top:9px;
    color:#fff;
    font-size:1.2rem;
    letter-spacing:-.04em;
}
.mwv2-safety-card small{
    display:block;
    margin-top:4px;
    color:rgba(255,255,255,.30);
    font-size:.4rem;
}

.mwv2-policy{
    margin-bottom:12px;
    padding:11px 13px;
    border:1px solid rgba(255,172,104,.14);
    border-radius:16px;
    color:rgba(255,214,175,.62);
    background:rgba(255,172,104,.025);
    font:650 .39rem/1.55 monospace;
}

.mwv2-toolbar{
    margin-bottom:10px;
    padding:9px;
    display:grid;
    grid-template-columns:minmax(240px,1fr) auto;
    gap:8px;
    align-items:center;
    border:1px solid rgba(255,255,255,.075);
    border-radius:20px;
    background:
        linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.008)),
        rgba(9,20,31,.62);
}
.mwv2-search{
    min-height:42px;
    padding:0 12px;
    display:flex;
    align-items:center;
    gap:9px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:999px;
    background:rgba(255,255,255,.015);
}
.mwv2-search i{
    color:rgb(var(--world-accent)/.72);
    font-style:normal;
}
.mwv2-search input{
    width:100%;
    border:0;
    outline:0;
    color:#fff;
    background:transparent;
    font-size:.54rem;
}
.mwv2-search input::placeholder{color:rgba(255,255,255,.24)}
.mwv2-filters{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.mwv2-filter{
    min-height:34px;
    padding:0 10px;
    border:1px solid rgba(255,255,255,.065);
    border-radius:999px;
    color:rgba(255,255,255,.36);
    background:rgba(255,255,255,.012);
    cursor:pointer;
    font:700 .35rem/1 monospace;
    letter-spacing:.05em;
}
.mwv2-filter:hover,
.mwv2-filter.is-active{
    color:#fff;
    border-color:rgb(var(--world-accent)/.22);
    background:rgb(var(--world-accent)/.045);
}

.mwv2-mosaic{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    grid-auto-flow:dense;
    gap:8px;
}
.mwv2-card{
    --mw-ratio:1 / 1;
    position:relative;
    min-height:250px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.08);
    border-radius:24px;
    background:#07121c;
    cursor:pointer;
    box-shadow:
        0 20px 54px rgba(0,0,0,.12),
        inset 0 1px 0 rgba(255,255,255,.035);
}
.mwv2-card:nth-child(7n+1),
.mwv2-card:nth-child(7n+5){
    grid-column:span 2;
}
.mwv2-card:nth-child(9n+3){
    grid-row:span 2;
}
.mwv2-card img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    filter:brightness(.78) saturate(1.04);
    transition:
        transform .52s var(--ws-ease),
        filter .32s ease;
}
.mwv2-card::before{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
    pointer-events:none;
    background:
        linear-gradient(180deg,rgba(4,10,16,.02) 30%,rgba(4,10,16,.88) 100%),
        radial-gradient(circle at 0 0,rgb(var(--world-accent)/.08),transparent 35%);
}
.mwv2-card:hover img{
    transform:scale(1.03);
    filter:brightness(.88) saturate(1.08);
}
.mwv2-card-copy{
    position:absolute;
    z-index:2;
    left:0;
    right:0;
    bottom:0;
    padding:14px;
}
.mwv2-card-meta{
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
}
.mwv2-card-meta span,
.mwv2-card-meta i{
    padding:5px 7px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:999px;
    color:rgba(255,255,255,.46);
    background:rgba(6,14,21,.44);
    backdrop-filter:blur(8px);
    font:700 .32rem/1 monospace;
    font-style:normal;
    letter-spacing:.05em;
}
.mwv2-card-meta i.is-confidential{
    color:rgba(255,190,132,.76);
    border-color:rgba(255,172,104,.14);
}
.mwv2-card h3{
    margin:10px 0 0;
    color:#fff;
    font-size:.8rem;
    line-height:1.22;
    letter-spacing:-.02em;
}
.mwv2-card p{
    margin:6px 0 0;
    max-width:560px;
    color:rgba(255,255,255,.42);
    font-size:.46rem;
    line-height:1.5;
}
.mwv2-card.is-hidden{display:none}

.mwv2-empty{
    grid-column:1/-1;
    min-height:180px;
    display:grid;
    place-items:center;
    border:1px dashed rgba(255,255,255,.075);
    border-radius:24px;
    color:var(--ws-dim);
    font-size:.5rem;
}

.mwv2-pipeline{
    margin-top:12px;
    padding:16px;
    border:1px solid rgba(255,255,255,.075);
    border-radius:24px;
    background:
        linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.008)),
        rgba(9,20,31,.62);
}
.mwv2-pipeline-head{
    display:grid;
    grid-template-columns:1fr minmax(260px,.62fr);
    gap:30px;
    align-items:end;
    margin-bottom:12px;
}
.mwv2-pipeline-head span{
    color:rgb(var(--world-accent)/.72);
    font:700 .39rem/1 monospace;
    letter-spacing:.075em;
}
.mwv2-pipeline-head h3{
    margin:9px 0 0;
    color:#fff;
    font-size:1.5rem;
    letter-spacing:-.04em;
}
.mwv2-pipeline-head p{
    margin:0;
    color:rgba(255,255,255,.40);
    font-size:.52rem;
    line-height:1.55;
}
.mwv2-channel-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:7px;
}
.mwv2-channel{
    min-height:118px;
    padding:12px;
    border:1px solid rgba(255,255,255,.06);
    border-radius:17px;
    background:rgba(255,255,255,.01);
}
.mwv2-channel span{
    color:rgb(var(--world-accent)/.62);
    font:700 .35rem/1 monospace;
    letter-spacing:.06em;
}
.mwv2-channel strong{
    display:block;
    margin-top:14px;
    color:#fff;
    font-size:.65rem;
}
.mwv2-channel small{
    display:block;
    margin-top:6px;
    color:rgba(255,255,255,.30);
    font-size:.4rem;
    line-height:1.4;
}

.mwv2-viewer{
    position:fixed;
    inset:0;
    z-index:99500;
    display:grid;
    place-items:center;
    padding:16px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:.2s ease;
}
.mwv2-viewer.is-open{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}
.mwv2-viewer-backdrop{
    position:absolute;
    inset:0;
    border:0;
    background:
        radial-gradient(circle at 15% 15%,rgba(91,234,255,.05),transparent 28%),
        radial-gradient(circle at 85% 15%,rgba(173,140,255,.05),transparent 30%),
        rgba(2,7,11,.84);
    backdrop-filter:blur(30px) saturate(145%);
}
.mwv2-viewer-panel{
    position:relative;
    z-index:2;
    width:min(1320px,100%);
    max-height:calc(100vh - 32px);
    overflow:auto;
    border:1px solid rgba(255,255,255,.10);
    border-radius:30px;
    background:
        linear-gradient(145deg,rgba(255,255,255,.05),rgba(255,255,255,.01)),
        rgba(8,18,28,.98);
    box-shadow:0 54px 180px rgba(0,0,0,.52);
}
.mwv2-viewer-head{
    padding:15px 17px;
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:center;
    border-bottom:1px solid rgba(255,255,255,.07);
}
.mwv2-viewer-head span{
    color:rgb(var(--world-accent)/.72);
    font:700 .38rem/1 monospace;
    letter-spacing:.07em;
}
.mwv2-viewer-head h3{
    margin:7px 0 0;
    color:#fff;
    font-size:1.05rem;
}
.mwv2-viewer-head button{
    width:42px;
    height:42px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:50%;
    color:#fff;
    background:rgba(255,255,255,.015);
    cursor:pointer;
    font-size:1.15rem;
}
.mwv2-viewer-grid{
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);
    gap:0;
}
.mwv2-viewer-media{
    min-height:620px;
    display:grid;
    place-items:center;
    overflow:auto;
    background:#061019;
}
.mwv2-viewer-media img{
    max-width:100%;
    max-height:76vh;
    display:block;
    object-fit:contain;
}
.mwv2-viewer-meta{
    padding:18px;
    border-left:1px solid rgba(255,255,255,.06);
}
.mwv2-viewer-meta p{
    color:rgba(255,255,255,.48);
    font-size:.55rem;
    line-height:1.65;
}
.mwv2-viewer-facts{
    margin-top:14px;
    display:grid;
    gap:7px;
}
.mwv2-viewer-fact{
    padding:10px;
    border:1px solid rgba(255,255,255,.055);
    border-radius:13px;
    background:rgba(255,255,255,.01);
}
.mwv2-viewer-fact span{
    display:block;
    color:var(--ws-dim);
    font:650 .34rem/1 monospace;
}
.mwv2-viewer-fact strong{
    display:block;
    margin-top:7px;
    color:rgba(255,255,255,.72);
    font-size:.5rem;
    line-height:1.35;
}

@media(max-width:1100px){
    .mwv2-head{grid-template-columns:1fr;gap:14px}
    .mwv2-safety{grid-template-columns:repeat(2,minmax(0,1fr))}
    .mwv2-mosaic{grid-template-columns:repeat(3,minmax(0,1fr))}
    .mwv2-channel-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:820px){
    .mwv2-toolbar{grid-template-columns:1fr}
    .mwv2-filters{justify-content:flex-start}
    .mwv2-mosaic{grid-template-columns:repeat(2,minmax(0,1fr))}
    .mwv2-card:nth-child(n){grid-column:span 1;grid-row:span 1}
    .mwv2-viewer-grid{grid-template-columns:1fr}
    .mwv2-viewer-meta{border-left:0;border-top:1px solid rgba(255,255,255,.06)}
    .mwv2-viewer-media{min-height:420px}
}
@media(max-width:560px){
    .mwv2-safety{grid-template-columns:1fr}
    .mwv2-mosaic{grid-template-columns:1fr}
    .mwv2-channel-grid{grid-template-columns:1fr}
    .mwv2-pipeline-head{grid-template-columns:1fr}
    .mwv2-card{min-height:270px}
    .mwv2-viewer-panel{border-radius:22px}
}

/* V2.1 — Cinematic Media Library door */
.mwv2-library-door{
    margin-top:12px;
    min-height:100px;
    padding:15px 16px;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    gap:8px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.075);
    border-radius:22px;
    color:#fff;
    background:
        radial-gradient(circle at 0 0,rgba(255,114,183,.10),transparent 38%),
        radial-gradient(circle at 100% 100%,rgba(91,234,255,.07),transparent 40%),
        linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.008)),
        rgba(255,255,255,.01);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
    font-size:.72rem;
    font-weight:760;
}
.mwv2-library-door small{
    color:rgba(255,255,255,.34);
    font:650 .34rem/1.4 monospace;
    letter-spacing:.05em;
}
.mwv2-library-door:hover{
    border-color:rgba(255,114,183,.24);
    background:
        radial-gradient(circle at 0 0,rgba(255,114,183,.14),transparent 40%),
        radial-gradient(circle at 100% 100%,rgba(91,234,255,.09),transparent 42%),
        rgba(255,255,255,.014);
}

/* =========================================================
   V13 — MEDIA OPERATING LAYER
   Search counts, pipeline stages, native viewer.
   ========================================================= */

.mwv2-toolbar{
    border-radius:24px;
}

.mwv2-filter{
    min-height:36px;
}

.mwv2-filter b{
    margin-left:6px;
    padding:4px 6px;
    border:1px solid rgba(255,255,255,.06);
    border-radius:999px;
    color:rgba(255,255,255,.30);
    background:rgba(255,255,255,.014);
    font:700 .30rem/1 monospace;
}

.mwv2-filter.is-active b{
    color:rgb(var(--world-accent)/.78);
    border-color:rgb(var(--world-accent)/.16);
    background:rgb(var(--world-accent)/.03);
}

.mwv2-result-meta{
    margin:0 3px 10px;
    min-height:18px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    color:rgba(255,255,255,.28);
    font:600 .37rem/1 monospace;
    letter-spacing:.055em;
}

.mwv2-card{
    border-radius:28px;
    isolation:isolate;
}

.mwv2-card::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
    pointer-events:none;
    opacity:0;
    border-radius:inherit;
    background:
        radial-gradient(
            260px circle at var(--mx,50%) var(--my,50%),
            rgb(var(--world-accent)/.14),
            transparent 60%
        );
    transition:opacity .2s ease;
}

.mwv2-card:hover::after,
.mwv2-card:focus-visible::after{
    opacity:1;
}

.mwv2-card:focus-visible{
    outline:none;
    border-color:rgb(var(--world-accent)/.34);
    box-shadow:
        0 0 0 3px rgb(var(--world-accent)/.055),
        0 24px 60px rgba(0,0,0,.18);
}

.mwv2-stage-grid{
    margin:0 0 12px;
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:6px;
}

.mwv2-stage{
    position:relative;
    min-height:108px;
    padding:12px;
    border:1px solid rgba(255,255,255,.065);
    border-radius:18px;
    background:
        radial-gradient(circle at 0 0,rgba(255,114,183,.055),transparent 40%),
        rgba(255,255,255,.01);
}

.mwv2-stage:not(:last-child)::after{
    content:"›";
    position:absolute;
    right:-7px;
    top:50%;
    z-index:2;
    width:14px;
    height:24px;
    display:grid;
    place-items:center;
    transform:translateY(-50%);
    color:rgba(255,255,255,.22);
    font-size:.9rem;
}

.mwv2-stage span{
    color:rgba(255,255,255,.30);
    font:700 .33rem/1 monospace;
    letter-spacing:.07em;
}

.mwv2-stage strong{
    display:block;
    margin-top:13px;
    color:#fff;
    font-size:.61rem;
    letter-spacing:-.01em;
}

.mwv2-stage small{
    display:block;
    margin-top:6px;
    color:rgba(255,255,255,.34);
    font-size:.39rem;
    line-height:1.4;
}

.mwv2-channel{
    border-radius:20px;
    transition:
        transform .2s var(--ws-ease),
        border-color .2s ease,
        background .2s ease;
}

.mwv2-channel:hover{
    transform:translateY(-2px);
    border-color:rgb(var(--world-accent)/.18);
}

.mwv2-channel[data-state="ARCHITECTURE READY"] span{
    color:rgba(184,255,104,.70);
}

.mwv2-channel[data-state="NOT ACTIVE"] span{
    color:rgba(255,172,104,.62);
}

.mwv2-viewer-panel{
    border-radius:34px;
}

.mwv2-viewer-head{
    position:sticky;
    top:0;
    z-index:4;
    background:rgba(8,18,28,.91);
    backdrop-filter:blur(20px) saturate(160%);
}

.mwv2-viewer-actions{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.mwv2-viewer-resolution{
    min-width:100px;
    color:rgba(255,255,255,.30);
    font:650 .36rem/1 monospace;
    letter-spacing:.055em;
    text-align:right;
}

.mwv2-viewer-actions button{
    min-width:38px;
    height:38px;
    padding:0 10px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:999px;
    color:#fff;
    background:rgba(255,255,255,.015);
    cursor:pointer;
    font:700 .42rem/1 monospace;
}

.mwv2-viewer-actions button:hover{
    border-color:rgb(var(--world-accent)/.26);
    background:rgb(var(--world-accent)/.045);
}

.mwv2-viewer-media{
    max-height:76vh;
    min-height:520px;
    align-items:start;
    justify-items:center;
    overscroll-behavior:contain;
    scrollbar-gutter:stable both-edges;
}

.mwv2-viewer-media.is-native{
    justify-items:start;
    cursor:grab;
}

.mwv2-viewer-media.is-dragging{
    cursor:grabbing;
    user-select:none;
}

.mwv2-viewer-media img{
    width:auto;
    max-width:100%;
    max-height:76vh;
    height:auto;
    image-rendering:auto;
    transition:width .18s cubic-bezier(.2,.75,.2,1);
}

.mwv2-viewer-fact.is-warning{
    border-color:rgba(255,172,104,.13);
    background:rgba(255,172,104,.025);
}

.mwv2-viewer-fact.is-safe{
    border-color:rgba(184,255,104,.12);
    background:rgba(184,255,104,.02);
}

@media(max-width:1100px){
    .mwv2-stage-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

    .mwv2-stage:nth-child(3)::after{
        display:none;
    }
}

@media(max-width:640px){
    .mwv2-stage-grid{
        grid-template-columns:1fr 1fr;
    }

    .mwv2-stage::after{
        display:none!important;
    }

    .mwv2-viewer-actions{
        max-width:220px;
    }

    .mwv2-viewer-resolution{
        width:100%;
        text-align:left;
    }
}
