/* JetPACS Free Viewer: every rule is scoped under .fv, the element the viewer mounts into (js/main.js),
   so the viewer can sit inside another page. The host page sizes .fv; the standalone index.html fills the window.
   A few rules reset styles a host page commonly gives the same class names (.btn, .badge, svg). */
@font-face { font-family: "Space Grotesk Variable"; font-style: normal; font-display: swap; font-weight: 300 700; src: url(fonts/space-grotesk-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); }
.fv{
  color-scheme: dark;
  --bg: #070B14; --panel: #0C1322; --panel-2: #111A2E; --line: #1E2A44; --line-strong: #8193A8; --bracket: #3B4A66;
  --text: #E8EEF7; --muted: #9AA8BF; --faint: #8193A8;
  --brand: #22D3EE; --brand-hover: #67E8F9; --brand-tint: rgb(34 211 238 / .12);
  --warn: #FBBF24; --ok: #4ADE80; --err: #F87171; --focus: #67E8F9;
  --velocity: linear-gradient(90deg, #0E7490 0%, #22D3EE 60%, #67E8F9 100%);
  --overlay-text: #f3d36b;
  --font-display: "Space Grotesk Variable", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --dur: 120ms;
}
.fv, .fv *{ box-sizing: border-box; }
.fv svg{ max-width: none; }
.fv .sprite{ position: absolute; width: 0; height: 0; overflow: hidden; }
.fv button, .fv input, .fv select{ border-radius: 0; font: inherit; color: inherit; }
.fv{ position: relative; background: var(--bg); color: var(--text); font: 13px/1.45 var(--font-body); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; overflow: hidden; }
.fv{ display: flex; flex-direction: column; }
.fv :focus-visible{ outline: 2px solid var(--focus); outline-offset: 1px; }
.fv [hidden]{ display: none !important; }
.fv .i{ width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fv .muted{ color: var(--muted); }

/* ---------------------------------------------------------------- header */
.fv header.top{ flex: none; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); min-width: 0; }
.fv header .mark{ width: 42px; height: 42px; flex: none; margin-right: -4px; }
.fv header .name{ font: 600 24px/1 var(--font-display); letter-spacing: -.015em; margin: 0 4px 0 0; white-space: nowrap; }
.fv header .name b{ color: var(--brand); font-weight: 600; }
.fv header .edition{ padding: 4px 9px; border: 1px solid var(--brand); color: var(--brand); background: var(--brand-tint); font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
/* the way to JetPACS: mount() sets the address of every a.contact-link */
.fv header .upsell{ color: var(--muted); font-size: 13px; white-space: nowrap; text-decoration: none; }
.fv header .upsell b{ color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fv header .upsell:hover b{ color: var(--brand-hover); }
@media (max-width: 1240px) { .fv header .upsell .more{ display: none; } }
@media (max-width: 1100px) { .fv header .upsell .q{ display: none; } }
@media (max-width: 560px) { .fv header .upsell{ display: none; } .fv header .mark{ width: 34px; height: 34px; } .fv header .name{ font-size: 20px; } }
@media (max-width: 420px) { .fv header .edition{ display: none; } }
.fv .spacer{ flex: 1; min-width: 0; }
.fv .btn{ display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; height: 30px; min-height: 0; border-radius: 0; font: inherit; text-decoration: none; padding: 0 10px; background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer; white-space: nowrap; transition: color var(--dur), background-color var(--dur), border-color var(--dur); }
.fv .btn:hover{ color: var(--text); background: var(--panel-2); }
.fv .btn .i{ width: 16px; height: 16px; }
.fv .btn.primary{ background: var(--brand); border-color: var(--brand); color: #04111A; font-weight: 600; }
.fv .btn.primary:hover{ background: var(--brand-hover); border-color: var(--brand-hover); color: #04111A; }
.fv .badge{ border-radius: 0; background: none; display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; color: var(--ok); }
.fv .badge::before{ content: ""; width: 6px; height: 6px; background: currentColor; flex: none; }
@media (max-width: 1500px) { .fv header .badge{ display: none; } }
@media (max-width: 720px) { .fv header .btn .lbl{ display: none; } }

/* ------------------------------------------------------------- landing */
/* the empty space carries the speed lines of the mark (favicon.svg) */
.fv #landing{ flex: 1; display: grid; place-items: center; padding: 24px 16px; overflow: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400' fill='none' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M70 54h96M56 68h60' stroke='%2322D3EE' stroke-opacity='0.16'/%3E%3Cpath d='M352 34h62M338 48h38' stroke='%2367E8F9' stroke-opacity='0.12'/%3E%3Cpath d='M214 150h128M200 164h79' stroke='%2322D3EE' stroke-opacity='0.1'/%3E%3Cpath d='M458 196h84M444 210h52' stroke='%2367E8F9' stroke-opacity='0.14'/%3E%3Cpath d='M54 262h74M40 276h46' stroke='%2322D3EE' stroke-opacity='0.12'/%3E%3Cpath d='M282 304h108M268 318h67' stroke='%2367E8F9' stroke-opacity='0.1'/%3E%3Cpath d='M520 330h56M506 344h35' stroke='%2322D3EE' stroke-opacity='0.12'/%3E%3Cpath d='M150 372h60M136 386h37' stroke='%2367E8F9' stroke-opacity='0.08'/%3E%3C/svg%3E") 0 0 / 600px 400px repeat; }
.fv .drop{ position: relative; width: min(720px, 100%); padding: 34px 40px 28px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.fv .drop::before{ content: ""; position: absolute; inset: 10px; pointer-events: none; --bc: var(--bracket);
  background: linear-gradient(var(--bc), var(--bc)) top left / 18px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) top left / 1.5px 18px no-repeat,
    linear-gradient(var(--bc), var(--bc)) top right / 18px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) top right / 1.5px 18px no-repeat,
    linear-gradient(var(--bc), var(--bc)) bottom left / 18px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) bottom left / 1.5px 18px no-repeat,
    linear-gradient(var(--bc), var(--bc)) bottom right / 18px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) bottom right / 1.5px 18px no-repeat; }
.fv.dragover .drop::before{ --bc: var(--brand); }
.fv.dragover .drop{ border-color: var(--brand); background: linear-gradient(var(--brand-tint), var(--brand-tint)), var(--panel); }
.fv .drop .big{ width: 44px; height: 44px; color: var(--brand); stroke-width: 1.25; }
.fv .drop h2{ margin: 14px 0 6px; font: 600 26px/1.15 var(--font-display); letter-spacing: -.02em; }
.fv .drop h2::before{ content: ""; display: block; width: 48px; height: 2px; margin: 0 auto 16px; background: var(--velocity); }
.fv .drop p{ margin: 0 auto; max-width: 520px; color: var(--muted); }
/* the promise that matters most to a visitor: set apart in the green of "nothing uploaded" */
.fv .drop p.private{ display: flex; align-items: center; justify-content: center; gap: 10px; width: fit-content; max-width: 100%; margin-top: 14px; padding: 7px 13px; background: rgb(74 222 128 / .08); border: 1px solid rgb(74 222 128 / .35); color: var(--text); font-size: 12.5px; text-align: left; }
.fv .drop p.private .i{ width: 16px; height: 16px; color: var(--ok); }
.fv .drop p.private b{ color: var(--ok); font-weight: 600; }
.fv .drop .actions{ display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 18px; }
.fv .drop .actions .btn{ height: 38px; padding: 0 16px; font-size: 13.5px; }
.fv .facts{ display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font: 500 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.fv .facts span{ display: inline-flex; align-items: center; gap: 6px; }
.fv .landing-col{ display: grid; gap: 18px; width: min(820px, 100%); }
.fv .landing-col .drop{ width: 100%; }
/* the JetPACS Viewer: a quiet panel under the drop box */
.fv .pro{ display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px 32px; padding: 30px 34px; background: linear-gradient(135deg, rgb(34 211 238 / .07), transparent 55%), var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--brand); }
.fv .pro .kicker{ font: 600 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.fv .pro h3{ margin: 6px 0 8px; font: 600 27px/1.2 var(--font-display); letter-spacing: -.02em; }
.fv .pro p{ margin: 0 0 18px; color: var(--muted); font-size: 15.5px; }
.fv .pro ul{ display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.fv .pro li{ display: flex; align-items: flex-start; gap: 12px; color: var(--text); font-size: 15px; line-height: 1.45; }
.fv .pro li b{ font-weight: 600; }
.fv .pro li .i{ width: 20px; height: 20px; margin-top: 1px; color: var(--brand); }
.fv .pro li span{ color: var(--muted); }
.fv .pro .btn{ height: 48px; padding: 0 24px; font-size: 15.5px; text-decoration: none; }
.fv .pro .btn .i{ width: 18px; height: 18px; }
.fv .pro-actions{ display: grid; gap: 10px; }
.fv .pro-actions .btn{ justify-content: center; }
@media (max-width: 640px) { .fv .pro{ grid-template-columns: 1fr; padding: 22px 20px; } .fv .pro h3{ font-size: 22px; } .fv .pro .btn{ justify-self: start; } }
.fv .facts .i{ width: 14px; height: 14px; color: var(--brand); }
.fv .progress{ margin: 26px auto 0; width: min(560px, 100%); text-align: left; }
.fv .progress .bar{ height: 10px; background: var(--line); overflow: hidden; }
.fv .progress .bar i{ display: block; height: 100%; width: 0; background: var(--velocity); transition: width 90ms linear; }
.fv .progress .txt{ margin-top: 12px; display: flex; justify-content: space-between; gap: 16px; color: var(--text); font: 500 15px/1.4 var(--font-body); font-variant-numeric: tabular-nums; }
.fv .progress .txt #progress-count{ color: var(--brand); font: 600 15px/1.4 var(--font-mono); }
.fv .notice{ margin-top: 14px; color: var(--warn); font-size: 12.5px; }
.fv .notice.err{ color: var(--err); }

/* ------------------------------------------------------------ main grid */
.fv #fv-main{ flex: 1; display: grid; min-height: 0; grid-template-columns: 280px minmax(0, 1fr); grid-template-areas: "browser panel"; }
.fv #fv-main[data-browser="hidden"]{ grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel"; }
.fv #fv-main[data-browser="hidden"] #browser{ display: none; }

/* -------------------------------------------- study browser: the blades */
.fv #browser{ grid-area: browser; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border-right: 1px solid var(--line); }
.fv .browser-head{ flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.fv .browser-head h2{ margin: 0; font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.fv #browser-count{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; padding-left: 6px; }
.fv .ib{ display: grid; place-items: center; width: 30px; height: 30px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; flex: none; }
.fv .ib:hover{ color: var(--text); border-color: var(--line); }
.fv .ib .i{ width: 17px; height: 17px; }
.fv .blades{ flex: 1; min-height: 0; overflow: auto; scrollbar-color: var(--line) transparent; }
.fv .blade{ border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.fv .blade.current{ border-left-color: var(--brand); }
.fv .blade-head{ display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; padding: 8px 10px 8px 7px; background: transparent; border: 0; color: var(--text); text-align: left; cursor: pointer; transition: background-color var(--dur); user-select: none; }
.fv .blade-row{ display: flex; align-items: center; }
.fv .blade-row .blade-head{ flex: 1; min-width: 0; padding-right: 4px; }
.fv .blade-row:hover{ background: var(--panel-2); }
.fv .blade-row:hover .blade-head{ background: transparent; }
.fv .blade-close{ width: 26px; height: 26px; margin-right: 6px; color: var(--faint); }
.fv .blade-close .i{ width: 15px; height: 15px; }
.fv .blade-close:hover, .fv .blade-close:focus-visible{ color: var(--err); border-color: var(--line); background: var(--bg); }
.fv .blade-head:hover{ background: var(--panel-2); }
.fv .blade-head .chev{ width: 14px; height: 14px; color: var(--faint); transition: transform var(--dur); }
.fv .blade[aria-expanded="true"] .chev{ transform: rotate(90deg); }
.fv .blade-head .folder{ width: 18px; height: 18px; color: var(--muted); }
.fv .blade.current .blade-head .folder{ color: var(--brand); }
.fv .blade-title{ min-width: 0; }
.fv .blade-title .t{ display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv .blade-title .s{ display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv .blade-meta{ display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px; max-width: 90px; }
.fv .blade-meta .count{ width: 100%; text-align: right; color: var(--faint); font: 500 10px/1.3 var(--font-mono); white-space: nowrap; }
.fv .pill{ display: inline-block; background: var(--panel-2); color: var(--brand); padding: 0 6px; font: 600 10px/1.6 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.fv .blade-body{ display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; padding: 2px 10px 10px 10px; }
.fv .blade[aria-expanded="false"] .blade-body{ display: none; }
.fv .thumb{ position: relative; display: flex; flex-direction: column; gap: 3px; padding: 3px; background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer; text-align: left; min-width: 0; transition: border-color var(--dur), background-color var(--dur); }
.fv .thumb:hover{ border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.fv .thumb.shown{ border-color: var(--bracket); }
.fv .thumb.current{ border-color: var(--brand); }
.fv .thumb[aria-disabled="true"]{ cursor: default; opacity: .6; }
.fv .thumb .img{ position: relative; display: grid; place-items: center; aspect-ratio: 1; background: #000; overflow: hidden; }
.fv .thumb canvas{ max-width: 100%; max-height: 100%; display: block; }
.fv .thumb .img .i{ width: 22px; height: 22px; color: var(--bracket); }
.fv .thumb .img.wait::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(34 211 238 / .07) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.fv .thumb .cap{ font: 500 10.5px/1.25 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv .thumb .cap b{ font: 600 10px/1 var(--font-mono); color: var(--brand); margin-right: 4px; }
.fv .thumb .n{ position: absolute; top: 5px; right: 5px; padding: 0 4px; background: rgb(7 11 20 / .8); color: var(--text); font: 600 10px/16px var(--font-mono); }
.fv .thumb.dragging{ opacity: .5; }

/* --------------------------------------------------------------- toolbar */
.fv #viewport-panel{ grid-area: panel; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; container-type: inline-size; }
.fv #toolbar{ flex: none; display: flex; align-items: stretch; padding: 4px 6px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.fv .tool-group{ display: flex; align-items: stretch; gap: 2px; padding: 0 6px; }
.fv .tool-group + .tool-group{ border-left: 1px solid var(--line); }
.fv .tool-group.end{ margin-left: auto; border-left: 0; }
.fv #toolbar .tb{ position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 48px; height: 48px; padding: 4px 6px; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; transition: color var(--dur), background-color var(--dur), border-color var(--dur); }
.fv #toolbar .tb:hover:not(:disabled){ color: var(--text); background: var(--panel-2); }
.fv #toolbar .tb:disabled{ opacity: .35; cursor: default; }
.fv #toolbar .label{ display: inline-flex; align-items: center; font: 500 10.5px/1 var(--font-body); white-space: nowrap; }
.fv #toolbar .caret{ width: 11px; height: 11px; margin-left: 1px; }
.fv #toolbar .tb[aria-pressed="true"]{ color: var(--brand); background: var(--brand-tint); }
/* the active mouse tool wears the viewfinder brackets, so it is never mistaken for a toggle */
.fv #toolbar .tb[data-tool][aria-pressed="true"]::before{ content: ""; position: absolute; inset: 2px; pointer-events: none; --bc: var(--brand);
  background: linear-gradient(var(--bc), var(--bc)) top left / 7px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) top left / 1.5px 7px no-repeat,
    linear-gradient(var(--bc), var(--bc)) top right / 7px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) top right / 1.5px 7px no-repeat,
    linear-gradient(var(--bc), var(--bc)) bottom left / 7px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) bottom left / 1.5px 7px no-repeat,
    linear-gradient(var(--bc), var(--bc)) bottom right / 7px 1.5px no-repeat, linear-gradient(var(--bc), var(--bc)) bottom right / 1.5px 7px no-repeat; }
.fv #toolbar .tb[aria-expanded="true"]{ color: var(--text); background: var(--panel-2); border-color: var(--line); }
.fv .cine-opts{ display: flex; align-items: center; padding: 0 2px; }
.fv .cine-opts{ gap: 6px; }
.fv .cine-opts span{ color: var(--muted); font: 500 11px/1 var(--font-mono); }
.fv .cine-opts #cinefps{ height: 24px; width: 48px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: 500 11px/1 var(--font-mono); padding: 0 4px; }
@container (max-width: 1180px) {
  .fv #toolbar .label{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fv #toolbar .tb{ min-width: 34px; height: 38px; padding: 4px 5px; }
  .fv #toolbar .tool-group{ padding: 0 3px; }
}
@container (max-width: 860px) { .fv .cine-opts{ display: none; } }
.fv .menu-host{ position: relative; display: flex; }
.fv .menu{ position: fixed; z-index: 20; padding: 4px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 0 0 1px var(--line), 0 24px 48px -12px rgb(0 0 0 / .6); }
.fv #preset-menu{ min-width: 250px; }
.fv .menu .radio{ display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; background: transparent; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.fv .menu .radio:hover, .fv .menu .radio:focus-visible{ background: var(--panel-2); outline: none; }
.fv .menu .radio[aria-checked="true"]{ color: var(--brand); }
.fv .menu .radio[aria-checked="true"] .chk::before{ content: ""; display: block; width: 6px; height: 6px; margin: auto; background: var(--brand); }
.fv .menu .values{ font: 500 11px/1 var(--font-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.fv .layout-presets{ display: grid; grid-template-columns: repeat(5, auto); gap: 4px; }
.fv .layout-presets button{ display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 10px 6px; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; }
.fv .layout-presets button:hover, .fv .layout-presets button:focus-visible{ background: var(--panel-2); color: var(--text); outline: none; }
.fv .layout-presets button[aria-checked="true"]{ color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.fv .layout-swatch{ display: grid; gap: 2px; width: 40px; height: 30px; }
.fv .layout-swatch i{ display: block; border: 1.5px solid currentColor; }
.fv .layout-name{ font: 600 10.5px/1 var(--font-mono); }

/* ----------------------------------------------------------------- stage */
.fv .stage{ position: relative; flex: 1; display: flex; min-height: 0; }
/* the viewport grid: one Cornerstone stack viewport per cell, 1-px gutters, the active one framed */
.fv .grid{ position: relative; flex: 1; min-width: 0; display: grid; gap: 1px; background: var(--line); overflow: hidden; }
.fv .vp{ position: relative; min-width: 0; min-height: 0; background: #000; overflow: hidden; }
.fv .vp.active::after{ content: ''; position: absolute; inset: 0; border: 1px solid var(--brand); pointer-events: none; z-index: 2; }
.fv .vp.drop-target::after{ content: ''; position: absolute; inset: 0; outline: 2px dashed var(--brand); outline-offset: -2px; pointer-events: none; z-index: 2; }
.fv .vp-element{ position: absolute; inset: 0; touch-action: none; }
.fv .vp.empty .vp-element{ visibility: hidden; }
/* tool cursors: the brand colour on a dark halo, readable on any image; !important beats the inline cursor Cornerstone sets */
.fv .grid[data-tool="WindowLevel"] .vp-element, .fv .grid[data-tool="WindowLevel"] .vp-element *{ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%2304111A' stroke-width='4'%3E%3Cpath d='M16 2.5v4 M16 25.5v4 M2.5 16h4 M25.5 16h4 M6.5 6.5l2.8 2.8 M22.7 22.7l2.8 2.8 M6.5 25.5l2.8-2.8 M22.7 9.3l2.8-2.8'/%3E%3Ccircle cx='16' cy='16' r='7'/%3E%3C/g%3E%3Cg stroke='%2322D3EE' stroke-width='1.75'%3E%3Cpath d='M16 2.5v4 M16 25.5v4 M2.5 16h4 M25.5 16h4 M6.5 6.5l2.8 2.8 M22.7 22.7l2.8 2.8 M6.5 25.5l2.8-2.8 M22.7 9.3l2.8-2.8'/%3E%3Ccircle cx='16' cy='16' r='7'/%3E%3C/g%3E%3Cpath d='M16 9a7 7 0 0 1 0 14z' fill='%2322D3EE'/%3E%3C/svg%3E") 16 16, crosshair !important; }
.fv .grid[data-tool="Pan"] .vp-element, .fv .grid[data-tool="Pan"] .vp-element *{ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%2304111A' stroke-width='4'%3E%3Cpath d='M16 3.5v25 M3.5 16h25 M12 7.5l4-4 4 4 M12 24.5l4 4 4-4 M7.5 12l-4 4 4 4 M24.5 12l4 4-4 4'/%3E%3C/g%3E%3Cg stroke='%2322D3EE' stroke-width='1.75'%3E%3Cpath d='M16 3.5v25 M3.5 16h25 M12 7.5l4-4 4 4 M12 24.5l4 4 4-4 M7.5 12l-4 4 4 4 M24.5 12l4 4-4 4'/%3E%3C/g%3E%3C/svg%3E") 16 16, move !important; }
.fv .grid[data-tool="Zoom"] .vp-element, .fv .grid[data-tool="Zoom"] .vp-element *{ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%2304111A' stroke-width='4'%3E%3Cpath d='M13 9v8 M9 13h8 M19.5 19.5l8.5 8.5'/%3E%3Ccircle cx='13' cy='13' r='9'/%3E%3C/g%3E%3Cg stroke='%2322D3EE' stroke-width='1.75'%3E%3Cpath d='M13 9v8 M9 13h8 M19.5 19.5l8.5 8.5'/%3E%3Ccircle cx='13' cy='13' r='9'/%3E%3C/g%3E%3C/svg%3E") 13 13, zoom-in !important; }
.fv .grid[data-tool="StackScroll"] .vp-element, .fv .grid[data-tool="StackScroll"] .vp-element *{ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%2304111A' stroke-width='4'%3E%3Cpath d='M9 12.5h14 M9 16h14 M9 19.5h14 M16 2.5v6 M12.5 5.5l3.5-3.5 3.5 3.5 M16 23.5v6 M12.5 26.5l3.5 3.5 3.5-3.5'/%3E%3C/g%3E%3Cg stroke='%2322D3EE' stroke-width='1.75'%3E%3Cpath d='M9 12.5h14 M9 16h14 M9 19.5h14 M16 2.5v6 M12.5 5.5l3.5-3.5 3.5 3.5 M16 23.5v6 M12.5 26.5l3.5 3.5 3.5-3.5'/%3E%3C/g%3E%3C/svg%3E") 16 16, ns-resize !important; }
.fv .vp-overlay{ position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; color: var(--overlay-text); font: 11.5px/1.35 var(--font-mono); text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 1px #000; }
.fv .vp-overlay .c{ position: absolute; white-space: pre; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
.fv .vp-overlay .tl{ top: 6px; left: 8px; } .fv .vp-overlay .tr{ top: 6px; right: 8px; text-align: right; }
.fv .vp-overlay .bl{ bottom: 6px; left: 8px; } .fv .vp-overlay .br{ bottom: 6px; right: 8px; text-align: right; }
.fv .vp-overlay .mk{ position: absolute; font: 600 13px/1 var(--font-mono); color: var(--brand-hover); }
.fv .vp-overlay .mk.l{ left: 8px; top: 50%; transform: translateY(-50%); } .fv .vp-overlay .mk.r{ right: 8px; top: 50%; transform: translateY(-50%); }
.fv .vp-overlay .mk.t{ top: 8px; left: 50%; transform: translateX(-50%); } .fv .vp-overlay .mk.b{ bottom: 8px; left: 50%; transform: translateX(-50%); }
.fv .vp-overlay .msg{ position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; color: var(--muted); font: 12px/1.4 var(--font-body); text-shadow: none; text-align: center; }
.fv .vp-overlay .msg:empty{ display: none; }
/* the player of a multi-frame image, over the bottom of the image */
.fv .vp-overlay .clip{ position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); width: min(540px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: rgb(6 10 18 / .78); border: 1px solid var(--line); pointer-events: auto; text-shadow: none; opacity: .9; transition: opacity var(--dur); }
.fv .vp-overlay .clip:hover{ opacity: 1; }
/* position in the series, along the right edge: the thumb is the image on screen */
.fv .vp-overlay .sbar{ --n: 2; --f: 0; --h: max(14px, calc(100% / var(--n))); position: absolute; right: 4px; top: 64px; bottom: 64px; width: 12px; pointer-events: auto; cursor: pointer; touch-action: none; }
.fv .vp-overlay .sbar[hidden]{ display: none; }
.fv .vp-overlay .sbar::before{ content: ''; position: absolute; left: 5px; width: 2px; top: 0; bottom: 0; background: rgb(255 255 255 / .16); }
.fv .vp-overlay .sbar i{ position: absolute; left: 3px; width: 6px; height: var(--h); top: calc((100% - var(--h)) * var(--f)); background: var(--brand); opacity: .85; transition: width var(--dur), left var(--dur); }
.fv .vp-overlay .sbar:hover i, .fv .vp-overlay .sbar.drag i{ left: 1px; width: 10px; opacity: 1; }
.fv .vp.has-sbar .vp-overlay .mk.r{ right: 22px; }
.fv .vp-overlay .clip[hidden]{ display: none; }
.fv .clip-play{ display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; background: var(--brand); border: 0; color: #04111A; cursor: pointer; }
.fv .clip-play:hover{ background: var(--brand-hover); }
.fv .clip-play .i{ width: 16px; height: 16px; fill: currentColor; }
.fv .clip-seek{ flex: 1; min-width: 0; accent-color: var(--brand); cursor: pointer; }
.fv .clip-rate{ display: flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font: 500 11px/1 var(--font-mono); }
.fv .clip-fps{ width: 46px; height: 24px; padding: 0 4px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: 500 11.5px/1 var(--font-mono); }
.fv .clip-fps:focus{ outline: none; border-color: var(--brand); }
.fv .clip-pos{ flex: none; min-width: 64px; text-align: right; color: var(--text); font: 500 11.5px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.fv .vp-overlay.small{ font-size: 10px; }
.fv .vp-overlay.small .tl, .fv .vp-overlay.small .tr{ display: none; }
.fv .tagpanel{ position: absolute; right: 0; top: 0; bottom: 0; width: min(640px, 70%); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); z-index: 4; }
.fv .tagpanel-head{ flex: none; display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.fv .tagpanel-head strong{ font: 600 14px/1.2 var(--font-display); white-space: nowrap; }
.fv .tagpanel-head input{ flex: 1; min-width: 0; height: 28px; background: var(--panel-2); border: 1px solid var(--line); padding: 0 8px; color: var(--text); }
.fv .tagpanel-head input:focus{ outline: none; border-color: var(--brand); }
.fv .tagpanel .scroll{ flex: 1; overflow: auto; }
.fv #tagtable{ width: 100%; border-collapse: collapse; font: 11.5px/1.4 var(--font-mono); }
.fv #tagtable td, .fv #tagtable th{ padding: 2px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fv #tagtable th{ position: sticky; top: 0; background: var(--panel); color: var(--brand); }
.fv #tagtable td:nth-child(1){ white-space: nowrap; color: var(--muted); } .fv #tagtable td:nth-child(2){ color: var(--faint); }
.fv #tagtable td:last-child{ word-break: break-all; }
.fv #tagtable tr.item td{ color: var(--brand); font-weight: 600; }
.fv #statusbar{ flex: none; display: flex; gap: 18px; padding: 5px 12px; background: var(--panel); border-top: 1px solid var(--line); color: var(--faint); font: 500 11px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.fv #statusbar span{ overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fv #status-right{ margin-left: auto; flex: none; color: var(--warn); }

/* ------------------------------------------------------- dialogs */
.fv kbd{ display: inline-block; min-width: 20px; padding: 1px 5px; font: 600 10.5px/1.5 var(--font-mono); text-align: center; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; }
.fv dialog{ width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 0 0 1px var(--line), 0 24px 48px -12px rgb(0 0 0 / .6); }
.fv dialog::backdrop{ background: rgb(7 11 20 / .7); }
.fv .dialog-head{ display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.fv .dialog-head h2{ margin: 0; font: 600 16px/1.2 var(--font-display); }
.fv .dialog-head h2::before{ content: ""; display: block; width: 40px; height: 2px; margin-bottom: 8px; background: var(--velocity); }
.fv .dialog-body{ display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; padding: 18px; }
.fv .dialog-body h3{ margin: 0 0 8px; font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.fv .dialog-body dl{ display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; align-items: center; }
.fv .dialog-body dt{ white-space: nowrap; color: var(--muted); }
.fv .dialog-body dd{ margin: 0; }
/* phones: the studies slide over the images (closed at start, closed again after a pick) */
@media (max-width: 760px) {
  .fv .tagpanel{ width: 100%; }
  .fv #fv-main, .fv #fv-main[data-browser]{ position: relative; grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel"; }
  .fv #fv-main[data-browser="vertical"] #browser{ position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); box-shadow: 0 0 0 1px var(--line), 24px 0 48px -12px rgb(0 0 0 / .7); }
}
@media (prefers-reduced-motion: reduce) { .fv, .fv *{ transition-duration: .01ms !important; animation-duration: .01ms !important; } }