/* ==========================================================================
   THE MEDIA VIEWER + THE FILE TILE + BUSY BUTTONS (I105 r3, 25 Oct 2026)
   Loaded once by Views/Shared/_UiMount.cshtml. Plain values, no theme
   tokens: these show above the store (her theme), the ValoraFi core and
   the popups alike, so they must not depend on any one of them.
   Palette: navy #132a4a, gold #e4b450, soft greys, white cards.
   ========================================================================== */

/* ── The tile (_MediaThumb) ─────────────────────────────────────────────── */
.mv-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.mv-tile {
    position: relative; flex: 0 0 auto;
    width: 120px; height: 120px; min-width: 120px;
    padding: 0; margin: 0; border: 1px solid #e3e6ec; border-radius: 12px;
    background: #f4f5f8; overflow: hidden; cursor: zoom-in;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font: inherit; color: #132a4a; text-align: center;
    transition: box-shadow .15s ease, transform .15s ease;
}
.mv-tile:hover { box-shadow: 0 6px 18px -8px rgba(19,42,74,.45); transform: translateY(-1px); }
.mv-tile:focus-visible { outline: 3px solid rgba(228,180,80,.7); outline-offset: 2px; }
.mv-tile > img, .mv-tile > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mv-tile .mv-play {
    position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(19,42,74,.72); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.mv-tile .mv-play svg { margin-left: 2px; }
.mv-tile .mv-len {
    position: absolute; z-index: 1; right: 6px; bottom: 6px;
    padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff;
    font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.mv-tile.mv-k-pdf, .mv-tile.mv-k-doc { cursor: pointer; background: #fff; padding: 10px 8px; gap: 6px; }
.mv-tile .mv-ic {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 6px; border-radius: 10px;
    font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #fff; background: #132a4a;
}
.mv-tile .mv-ic.pdf { background: #b3261e; }
.mv-tile .mv-nm {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 12px; font-weight: 600; line-height: 1.25; word-break: break-word; max-width: 100%;
}
.mv-tile .mv-sz { font-size: 11px; color: #6b7280; }
.mv-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    min-height: 36px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid #e3e6ec; background: #fff; color: #132a4a;
    font-size: 13px; font-weight: 600; text-decoration: none; overflow: hidden;
}
.mv-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-chip:hover { border-color: #e4b450; color: #132a4a; }

/* ── The viewer overlay ─────────────────────────────────────────────────── */
html.mv-open-html, html.mv-open-html body { overflow: hidden; }
.mv-ov {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; flex-direction: column;
    background: rgba(10,16,28,.94); color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.mv-ov[hidden] { display: none; }
.mv-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 10px 16px; min-height: 60px;
    padding-top: max(10px, env(safe-area-inset-top));
}
.mv-n { flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.mv-name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.mv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
    color: #fff; font: 600 13px/1 inherit; text-decoration: none; cursor: pointer;
}
.mv-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.mv-btn[hidden] { display: none; }
.mv-x { padding: 0; width: 44px; background: #fff; color: #132a4a; border-color: #fff; }
.mv-x:hover { background: #e4b450; color: #132a4a; }
.mv-stage {
    position: relative; flex: 1 1 auto; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 0 64px 16px; overflow: hidden;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.mv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.mv-stage.zoomed { display: block; overflow: auto; padding: 0; -webkit-overflow-scrolling: touch; }
.mv-stage.zoomed img { cursor: grab; margin: auto; display: block; }
.mv-stage video { max-width: 100%; max-height: 100%; background: #000; border-radius: 8px; }
.mv-stage iframe { width: min(100%, 980px); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.mv-file {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    width: min(100%, 360px); padding: 28px 22px; border-radius: 16px;
    background: #fff; color: #132a4a; text-align: center;
}
.mv-file-ic {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; height: 64px; padding: 0 10px; border-radius: 14px;
    background: #132a4a; color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .04em;
}
.mv-file-n { font-weight: 700; font-size: 15px; word-break: break-word; }
.mv-file-s { font-size: 12px; color: #6b7280; }
.mv-file-m { font-size: 13px; color: #4b5563; }
.mv-file-b {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
    border-radius: 12px; background: #132a4a; color: #fff; font-weight: 700; text-decoration: none;
}
.mv-file-b:hover { background: #1d3d68; color: #fff; }
.mv-arr {
    position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
}
.mv-arr:hover { background: rgba(255,255,255,.28); }
.mv-arr.prev { left: 10px; } .mv-arr.next { right: 10px; }
.mv-arr[hidden] { display: none; }
@media (max-width: 640px) {
    .mv-bar { padding-left: 12px; gap: 6px; }
    .mv-btn span { display: none; }            /* icons only on a phone */
    .mv-btn { padding: 0; width: 44px; }
    .mv-stage { padding: 0 0 12px; }
    .mv-stage iframe { width: 100%; border-radius: 0; }
    .mv-arr { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; background: rgba(0,0,0,.5); }
}

/* ── Busy buttons (busy-buttons.js) ─────────────────────────────────────── */
.vf-busy { position: relative; cursor: progress !important; opacity: .85; pointer-events: none; }
.vf-busy .vf-spin, .vf-spin {
    display: inline-block; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.15em;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: vfSpin .7s linear infinite;
}
@keyframes vfSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vf-spin { animation-duration: 2s; } }
