/* MiStudio v0.71 viewport round (November 2026): wire ink, the pick control, the box's two directions,
   the view cube + triad widget, the Save split button, tool-panel "all" fields. Loaded after ui.css. */

/* ---- line ink by display mode: ONE place. Over shaded faces (Shaded / Edges) lines are dark ink in both
   themes (--edge, --mesh-edge, --feat-edge in studio.html / ui.css). In WIRE mode there is no face behind
   them, only the viewport: the ink follows the theme (dark on the light viewport, LIGHT on the dark one).
   --wire-ink = CAD edges, --wire-mesh = element edges (a step quieter, so the CAD outline still leads). */
:root{--wire-ink:#2c2c30;--wire-mesh:#5d616b}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--wire-ink:#e6e8ee;--wire-mesh:#9ea3ae}}
:root[data-theme="dark"]{--wire-ink:#e6e8ee;--wire-mesh:#9ea3ae}

/* ---- the pick control: Select [Replace v] [Box v] ---------------------------------------------- */
.pickctl{display:inline-flex;align-items:center;gap:2px;background:var(--chip);border-radius:8px;padding:2px;flex:none}
.pickctl .btn{height:24px;border-radius:6px;padding:0 8px}
.pickctl .pc-sel{font-weight:600}
.pickctl .pc-m{gap:5px;padding:0 6px 0 7px;background:var(--panel);box-shadow:0 1px 2px rgba(0,0,0,.12);color:var(--ink)}
.pickctl .pc-m:hover{background:var(--panel);filter:brightness(1.06)}
.pickctl .pc-m.tint{color:var(--tool)}                       /* a sticky mode other than Replace: say so in color too */
.pickctl .pc-m.on{color:var(--acc);box-shadow:0 0 0 1.5px color-mix(in srgb,var(--acc) 55%,transparent)}   /* a left drag picks */
.pickctl #bBox[data-shape]::after,.pickctl #bSelP[data-combine]::after{content:none!important}
.pc-i{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.btn .pc-i{width:15px;height:15px;stroke-width:1.4}
.pc-i .f{fill:color-mix(in srgb,currentColor 38%,transparent)}.pc-i .d{stroke-dasharray:2 1.6}
.pc-v{width:0;height:0;border:3.5px solid transparent;border-top:4.5px solid currentColor;border-bottom:0;opacity:.6;margin-left:1px;flex:none}
@media (max-width:1100px){.pickctl .btn svg.pc-i{display:block}}
.pc-menu{min-width:270px;max-width:340px;padding:8px}
.pc-menu .pc-row{display:flex;align-items:center;gap:10px;padding:6px 8px;white-space:normal;cursor:default}
.pc-menu .pc-row .t{flex:1;min-width:0;display:flex;flex-direction:column}
.pc-menu .pc-row small,.pc-menu .pc-drag small,.pc-dirs small{color:var(--mute);margin:0;font-size:11.5px;display:block}
.pc-menu .pc-row.cur{background:var(--acc-soft)}.pc-menu .pc-row.cur b{color:var(--acc)}
.pc-menu .pc-row.cur::after{content:"✓";color:var(--acc);font-weight:700;flex:none}
.pc-menu kbd,.pc-drag kbd{font:11px system-ui,sans-serif;color:var(--mute);border:1px solid var(--line2);border-radius:5px;padding:1px 5px;white-space:nowrap;flex:none}
.pc-dirs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:2px 8px 6px 33px}
.pc-dirs>div{display:flex;flex-direction:column;gap:2px;padding:6px 7px;border-radius:8px;background:var(--panel2);border:1px solid var(--line)}
.pc-dirs b{font-size:12px;font-weight:600}
.pc-dir{width:92px;height:46px;fill:none;stroke-width:1.5}
.pc-dir .o{stroke:var(--box-win);fill:color-mix(in srgb,var(--box-win) 10%,transparent)}
.pc-dir.cross .o{stroke:var(--box-cross);fill:color-mix(in srgb,var(--box-cross) 10%,transparent);stroke-dasharray:5 4}
.pc-dir .hit{fill:var(--box-win);stroke:none}.pc-dir.cross .hit{fill:var(--box-cross)}
.pc-dir .miss{fill:none;stroke:var(--faint)}
.pc-dir .a{stroke:var(--mute);stroke-linecap:round;stroke-linejoin:round}
.pc-drag{margin:6px 8px 2px;padding:7px 0 0;border-top:1px solid var(--line);align-items:flex-start}
.pc-drag input{margin-top:3px}

/* the box says which of its two directions it is, while it is dragged */
#boxRect::after{content:"Window · inside";position:absolute;left:-1.5px;top:-21px;padding:1px 7px;border-radius:6px 6px 6px 0;
 background:var(--box-win);color:#fff;font:600 11px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;white-space:nowrap;letter-spacing:.01em}
#boxRect{background:color-mix(in srgb,var(--box-win) 10%,transparent)}
#boxRect.cross{border-width:1.5px;background:color-mix(in srgb,var(--box-cross) 12%,transparent)}
#boxRect.cross::after{content:"Crossing · touching";background:var(--box-cross);left:auto;right:-1.5px;border-radius:6px 6px 0 6px}

/* ---- view cube + triad: one widget, lower left by default, moved by its grip -------------------- */
#vcube{top:auto;right:auto;left:8px;width:150px;height:auto;display:flex;flex-direction:column;align-items:center;gap:2px;z-index:3;user-select:none;touch-action:none}
#vcube canvas{width:140px;height:140px;display:block;border-radius:12px}
#vcube.drag{z-index:6}#vcube.drag canvas{background:color-mix(in srgb,var(--panel) 55%,transparent);box-shadow:var(--shadow)}
.vc-row{display:flex;align-items:center;justify-content:center;gap:4px;width:100%}
#vcube .vc-b{position:static;flex:none}
.vc-slot{display:inline-flex;margin-left:2px}
.vp-tog.in{position:static;height:24px;padding:0 8px 0 5px}
.vc-grip{position:absolute;left:2px;top:2px;width:20px;height:20px;border:0;border-radius:6px;background:transparent;color:var(--faint);padding:4px;cursor:grab;touch-action:none;
 opacity:.55;transition:opacity 120ms ease,background-color 120ms ease}
.vc-grip svg{width:12px;height:12px;display:block;fill:currentColor}
#vcube:hover .vc-grip,.vc-grip:focus-visible{opacity:1;color:var(--mute);background:var(--chip)}
#vcube.drag .vc-grip{cursor:grabbing;opacity:1;color:var(--acc);background:var(--acc-soft)}
#triad{display:none}

/* ---- Save: a split button -------------------------------------------------------------------------- */
.split{display:inline-flex;align-items:center;flex:none}
.split>.btn:first-child{border-radius:7px 0 0 7px;padding-right:6px}
.split-v{width:18px;padding:0;justify-content:center;border-radius:0 7px 7px 0}
.btn.split-v svg{width:10px;height:10px;stroke-width:1.5;display:block}
.split:hover>.btn{background:var(--hover)}.split>.btn:hover{background:var(--line2)}

/* ---- tool panels: an "all" field, the Keywords tab's first line, Reset display ---------------------- */
.pk.all .pk-f{border:1.5px solid var(--tool);background:var(--tool-soft);color:var(--ink);cursor:default}
.pk.all .pk-f span{font-weight:600}
.pk.all .btn:disabled,.pk.all .fld:disabled{opacity:.35}
.tp-prev .r.w{color:var(--warn)}
.kw-lead{margin:0 10px 8px;padding:6px 9px;border-radius:8px;background:var(--chip);color:var(--ink);font-size:12px;line-height:1.4}
.kw-lead:empty{display:none}
#segView button#bResetDisp{display:inline-flex;align-items:center;gap:5px}
@media (prefers-reduced-motion:reduce){.vc-grip{transition:none}}
