/* Digital Gemology Studio (published as /assets/studio/studio.css; the source is shared/studio/studio.css).
   The dialog is a piece of the black stage in either theme, like the simulator's Share. */
.dgs{--fg:#fff;--bg:#000;--muted:#A3A3A3;--line:rgba(255,255,255,.14);--track:rgba(255,255,255,.08);color-scheme:dark;
  width:min(980px,calc(100% - 24px));max-height:calc(100svh - 24px);padding:0;border:1px solid rgba(255,255,255,.14);
  border-radius:var(--r-panel,24px);background:#0B0B0B;color:#fff;box-shadow:0 24px 80px rgba(0,0,0,.6);overflow:auto;overscroll-behavior:contain}
.dgs::backdrop{background:rgba(0,0,0,.62);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.dgs-in{padding:16px 18px 18px;display:flex;flex-direction:column;gap:12px}
.dgs-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dgs-h{font-size:1.125rem;font-weight:600;letter-spacing:-.01em;margin:0 0 0 2px}
.dgs-x{flex:none;width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:#fff;display:grid;place-items:center;cursor:pointer;transition:background .2s}
.dgs-x:hover{background:rgba(255,255,255,.16)}
.dgs-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.dgs-x:focus-visible,.dgs-seg button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.dgs-body{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:start}
/* the frame in its own format, letterboxed on a lighter ground so its shape reads at a glance */
.dgs-fig{margin:0;position:sticky;top:0}
.dgs-frame{position:relative;height:min(68svh,620px);border-radius:var(--r-inner,14px);overflow:hidden;background:#161616;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.dgs-frame canvas,.dgs-frame img,.dgs-frame video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.dgs-frame [hidden]{display:none}
.dgs-cap{font-size:.75rem;color:var(--muted);margin:8px 2px 0;text-align:center}
.dgs-ctl{display:flex;flex-direction:column;gap:14px;min-width:0}
.dgs-g[hidden]{display:none}
.dgs-l{font-size:.8125rem;font-weight:600;margin:0 0 7px 2px}
.dgs-seg{display:flex;gap:2px;padding:3px;border-radius:var(--r-pill,999px);background:var(--track)}
.dgs-seg button{flex:1 1 auto;font:inherit;font-size:.8125rem;font-weight:500;border:0;background:none;color:var(--muted);border-radius:var(--r-pill,999px);
  min-height:34px;padding:0 8px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums;transition:color .2s,background .2s}
.dgs-seg button:hover{color:#fff}
.dgs-seg button[aria-checked="true"]{background:#fff;color:#000;font-weight:600}
.dgs-seg button:disabled{cursor:default}
.dgs-seg button:disabled:not([aria-checked="true"]){opacity:.45}
.dgs-n{font-size:.75rem;color:var(--muted);line-height:1.45;margin:6px 2px 0;min-height:1.45em}
.dgs-sw{display:flex;align-items:center;justify-content:space-between;gap:14px;cursor:pointer}
.dgs-sw>span{font-size:.8125rem;font-weight:600}
.dgs-sw small{display:block;font-size:.75rem;font-weight:400;color:var(--muted);line-height:1.45;margin-top:3px}
.dgs-sw input{position:absolute;opacity:0;width:1px;height:1px}
.dgs-sw i{flex:none;position:relative;width:44px;height:26px;border-radius:999px;background:rgba(255,255,255,.16);transition:background .2s}
.dgs-sw i::after{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .25s cubic-bezier(.3,1.4,.5,1)}
.dgs-sw input:checked+i{background:#fff}
.dgs-sw input:checked+i::after{transform:translateX(18px);background:#000}
.dgs-sw input:focus-visible+i{outline:2px solid #fff;outline-offset:3px}
.dgs-sw input:disabled+i{opacity:.45}
.dgs-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:2px}
.dgs-acts .btn{flex:1 1 auto;justify-content:center;font-size:.875rem;padding:10px 16px;min-height:42px}
.dgs-acts .btn[hidden]{display:none}
.dgs-prog[hidden]{display:none}
.dgs-bar{height:3px;border-radius:2px;background:rgba(255,255,255,.12);overflow:hidden}
.dgs-bar i{display:block;height:100%;width:0;background:#fff;transition:width .25s}
.dgs-note{font-size:.8125rem;color:var(--muted);line-height:1.45;margin:0 2px;min-height:2.9em}
@media (max-width:760px){
  .dgs-in{padding:14px 14px 16px}
  .dgs-body{grid-template-columns:1fr;gap:14px}
  .dgs-fig{position:static}
  .dgs-frame{height:min(44svh,440px)}
}
@media (prefers-reduced-motion:reduce){.dgs-sw i::after,.dgs-seg button{transition:none}}
/* the simulator's stage: room for a third pill beside PDF report and Share */
.sim-stage:has(#sim-studio:not([hidden])) .sim-hud-tl{right:372px}
@media (max-width:720px){.sim-stage:has(#sim-studio:not([hidden])) .sim-hud-tl{right:168px}}
/* the Studio button on the other tools (and Brightness & Tilt's): their own small button, with the camera */
.dgs-open svg,.bt-studio svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.dgs-open[hidden]{display:none}
/* a pill on a tool's stage: the Cut Performance Wheel's stone, the Hearts & Arrows Scope's views */
.dgs-pill{display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:0 15px 0 12px;font:inherit;font-size:.8125rem;font-weight:560;
  color:#fff;background:rgba(0,0,0,.55);border:1px solid rgba(255,255,255,.18);border-radius:var(--r-pill,999px);cursor:pointer}
.dgs-pill:hover{background:rgba(38,38,38,.75)}
.dgs-pill:focus-visible{outline:2px solid #fff;outline-offset:2px}
/* the wheel: top right of the stone's stage, across from 3D / Light map */
.cw-studio{position:absolute;right:14px;top:14px;z-index:2}
@media (max-width:480px){.cw-studio{right:10px;top:10px}}
/* the scope: from 700px top right of the views and out of the flow, so the bench keeps the height it is fitted to;
   small, so it clears the stone where the views fill the width. Below, where the panel scrolls, a row under the key */
.ha-views{position:relative}
.ha-studio{grid-column:1/-1;justify-self:center;min-height:34px;padding:0 12px 0 10px;font-size:.75rem}
@media (min-width:700px){.ha-studio{position:absolute;right:0;top:0;z-index:2;grid-column:auto}}   /* auto: placed on the whole views, not their grid area */
