/* PoreStore interface: the View operations (SEM, X-ray, 3D visualization, ParaView render, slicer) and their run pages. */

/* launchers */
.ui-viewers-crumb-b{border:0;background:none;padding:0;font:inherit;cursor:pointer}
.ui-viewers-stack{display:flex;flex-direction:column;gap:16px}
.ui-viewers-check{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.ui-viewers-check .ui-cb{margin-top:2px;flex:none}
.ui-viewers-check>span{display:flex;flex-direction:column;gap:3px;min-width:0}
.ui-viewers-check-l{font:500 14px/1.3 var(--sans);color:var(--ink)}
.ui-viewers-check .ui-help{font-size:13px;color:var(--ink3)}
.ui-viewers-check .ui-err{font-size:13.5px;color:var(--bad)}
.ui-viewers-hours input{max-width:160px}
.ui-viewers-balance{text-align:right;line-height:1.5}
.ui-viewers-balance .ui-mono{color:var(--ink);font-size:14px}
.ui-viewers-active{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:4px 0 16px}
.ui-viewers-active p{margin:0;color:var(--ink2)}
.ui-viewers-warn{border-radius:var(--r-card);background:var(--warn-soft);padding:14px 16px;font-size:14px}
.ui-viewers-warn b{display:block;font-weight:600;color:var(--ink)}
.ui-viewers-warn p{margin:4px 0 8px;color:var(--ink2)}
.ui-viewers-warn .ui-link{color:var(--warn);font-weight:500}
.ui-viewers-legend{margin-bottom:8px!important}
.ui-viewers-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
.ui-viewers-tier{position:relative;display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid var(--line2);border-radius:var(--r-card);background:var(--surface);cursor:pointer}
.ui-viewers-tier:hover{border-color:var(--ink3)}
.ui-viewers-tier input{position:absolute;opacity:0;pointer-events:none}
.ui-viewers-tier:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.ui-viewers-tier:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.ui-viewers-tier-n{font:600 14.5px/1.3 var(--sans);color:var(--ink)}
.ui-viewers-tier-d{font-size:13px;color:var(--ink2)}
.ui-viewers-tier-c{margin-top:4px;font:500 13.5px/1 var(--mono);color:var(--accent)}
.ui-hist a.ui-viewers-hist{grid-template-columns:minmax(0,1fr) auto}
.ui-viewers-ellip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ui-viewers-all{display:inline-block;margin-top:10px;font-size:13.5px}

/* run pages */
.ui-viewers-meta{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.ui-viewers-main{min-width:0;display:flex;flex-direction:column;gap:16px}
.ui-viewers-panelhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}

/* live session state (3D render, ParaView) */
.ui-viewers-session{display:flex;flex-direction:column;gap:14px}
.ui-viewers-wait{display:flex;align-items:center;gap:14px}
.ui-viewers-wait b{display:block;font-weight:600;font-size:14.5px}
.ui-viewers-wait p{margin:2px 0 0}
.ui-viewers-ready{border-radius:var(--r-card);background:var(--ok-soft);padding:12px 14px}
.ui-viewers-ready .ui-st{color:var(--ok);font-size:13.5px}
.ui-viewers-ready p{margin:6px 0 0;color:var(--ink2);font-size:14px}
.ui-viewers-session-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.ui-viewers-addr{display:flex;flex-direction:column;gap:6px}
.ui-viewers-addr-row{display:flex;align-items:center;gap:8px}
.ui-viewers-addr code{flex:1;min-width:0;padding:8px 11px;border-radius:var(--pill);background:var(--surface);border:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}
.ui-viewers-addr .ui-note{margin:0}
.ui-viewers-ended{margin:0}
.ui-viewers-spin{width:22px;height:22px;flex:none;border-radius:50%;border:2px solid var(--line2);border-top-color:var(--accent);animation:ui-viewers-rot .8s linear infinite}
.ui-viewers-spin-sm{width:14px;height:14px}
@keyframes ui-viewers-rot{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.ui-viewers-spin{animation-duration:2.4s}}

/* slicer */
.ui-viewers-frame{height:70vh;min-height:480px;border-radius:var(--r-card);overflow:hidden;background:var(--viz)}
.ui-viewers-frame iframe{width:100%;height:100%;border:0;display:block}
.ui-viewers-tip{margin:6px 0 12px}

/* SEM and X-ray three-view viewer */

.ui-viewers-err{margin-bottom:10px}
/* The shared orthogonal component owns full-width layout and native voxel proportions. */
.ui-viewers-planes{--ui-viewers-h:max(320px,100svh - 300px);display:grid;grid-template-areas:"xy yz" "xz .";align-items:start;gap:12px;transition:opacity .15s}
.ui-viewers-busy{opacity:.6}
.ui-viewers-cell{min-width:0;margin:0;display:flex;flex-direction:column;gap:6px}
.ui-viewers-xy{grid-area:xy}
.ui-viewers-yz{grid-area:yz}
.ui-viewers-xz{grid-area:xz}
.ui-viewers-plane{position:relative;overflow:hidden;border-radius:var(--r-sm);background:var(--viz);min-width:0}
/* The colour bar under each view: its colour map's gradient, then the lowest and highest values it spans. */
.ui-viewers-cbar{display:grid;grid-template-columns:1fr auto;gap:3px 8px;font:12.5px/1.2 var(--mono);color:var(--ink2);font-variant-numeric:tabular-nums}
.ui-viewers-ramp{grid-column:1/-1;height:8px;border-radius:calc(4px*var(--rf))}
.ui-viewers-click{cursor:crosshair}
.ui-viewers-img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;image-rendering:pixelated}
.ui-viewers-img-rot{position:absolute;max-width:none;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-90deg);object-fit:fill;image-rendering:pixelated}
.ui-viewers-load{position:absolute;inset:0;display:grid;place-items:center}
.ui-viewers-load .ui-viewers-spin{border-color:color-mix(in srgb,var(--viz-ink) 25%,transparent);border-top-color:var(--viz-ink)}
.ui-viewers-xh{position:absolute;inset:0;pointer-events:none;mix-blend-mode:difference}
.ui-viewers-xh-v{position:absolute;top:0;bottom:0;width:1px;background:var(--viz-ink)}
.ui-viewers-xh-h{position:absolute;left:0;right:0;height:1px;background:var(--viz-ink)}
.ui-viewers-tag{position:absolute;left:6px;bottom:6px;pointer-events:none;padding:2px 6px;border-radius:calc(4px*var(--rf));background:color-mix(in srgb,var(--viz) 70%,transparent);color:var(--viz-ink);font:500 11.5px/1.3 var(--mono)}
.ui-viewers-swatch{display:inline-block;width:16px;height:16px;border-radius:calc(4px*var(--rf));border:1px solid var(--line2);vertical-align:middle}
.ui-viewers-bar label{display:inline-flex;align-items:center;gap:6px}
.ui-viewers-toggle{color:var(--ink3)}
.ui-viewers-toggle[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent-soft);color:var(--accent)}

@media (max-width:560px){
  .ui-viewers-bar .ui-sp{display:none}
  .ui-viewers-frame{height:60vh;min-height:360px}
  .ui-estimate-row .ui-viewers-balance{font-size:13px}
}
.ui-viewers-sfv .ui-viewers-hint{margin:10px 0 0}
.ui-viewers-fetch{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:13.5px;color:var(--ink3)}
