/* OBSCURA OS: OBSCURA Vector.

   One working window, laid out as desktop illustration software is and as
   Roots and PDF Studio are: the bar with the way home, the menus, the
   document's name and its save state; a bar of options for the tool and
   the selection; then the toolbox down the left, the canvas with its
   rulers in the middle, and the panels on the right, with a status line
   across the foot. Only the canvas and the panels scroll.

   The page is an application while <body> carries vx-app, which
   pro-load.js takes off when it shows the lock screen instead. Every
   colour, size, corner and duration is a theme.css token, so the window
   follows the colourway and dark mode the rest of the site does; the
   artboards themselves stay the colour the document gives them. On a
   phone the toolbox runs along the foot, the panels become a sheet over
   the canvas, and every control is at least 44 pixels square. */

.vx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.vx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.vx-probe { position: absolute; left: -10000px; top: 0; width: 10px; height: 10px; overflow: hidden; visibility: hidden; }

/* ------------------------------------------------------------ the frame */

body.vx-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; padding: 0; overflow: hidden; }
body.vx-app .os-footer, body.vx-app .os-topbar, body.vx-app .os-toolnav { display: none !important; }
body.vx-app #ppBadge { left: auto; right: var(--space-1); bottom: 3px; min-height: 22px; padding: 1px var(--space-2); font-size: var(--text-2xs); box-shadow: none; }

.vx {
  --vx-panel: 292px;
  --vx-tools: 48px;
  --vx-hit: 32px;
  --vx-ruler: 20px;
  --vx-paste: color-mix(in srgb, var(--paper-inset) 82%, var(--rule-strong) 18%);
  --vx-sel: var(--accent);
  --vx-guide: color-mix(in srgb, var(--good) 70%, var(--accent) 30%);
  --vx-smart: color-mix(in srgb, var(--danger) 80%, var(--accent) 20%);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
  color: var(--ink);
  font: var(--text-xs)/1.4 var(--font-sans);
}
.vx *, .vx *::before, .vx *::after { box-sizing: border-box; }
.vx button, .vx input, .vx select, .vx textarea { font: inherit; color: inherit; }
/* icons only: the drawing, the overlay and the thumbnails keep SVG's own
   defaults, so a path without a stroke width is drawn as it would be in
   the exported file */
.vx svg:not(:where(.vx-svg, .vx-over, .vx-lthumb svg, .vx-doc-thumb svg)) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vx-grow { flex: 1 1 auto; }
.vx-hint { margin: 0; color: var(--ink-faint); font-size: var(--text-2xs); line-height: 1.45; }
.vx-pad { padding: var(--space-2) var(--space-3); }
.vx > .vx-main { grid-row: 3; }
.vx > .vx-status { grid-row: 4; }
.vx.is-drop .vx-main { outline: 2px dashed var(--accent); outline-offset: -6px; }
.vx[data-open="false"] .vx-hide-start, .vx[data-open="false"] .vx-docname, .vx[data-open="false"] .vx-st-sel, .vx[data-open="false"] .vx-st-pos, .vx[data-open="false"] .vx-st-board, .vx[data-open="false"] .vx-zoom { display: none; }

/* ------------------------------------------------------------ the bar */

.vx-top { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); min-width: 0; padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--rule); background: var(--paper-raised); }
.vx-id { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.vx-home { display: inline-flex; align-items: center; justify-content: center; width: var(--vx-hit); height: var(--vx-hit); border-radius: var(--radius-md); color: var(--ink-soft); }
.vx-home:hover { background: var(--paper-inset); color: var(--ink); }
.vx-brand { margin: 0 var(--space-2) 0 0; font-size: var(--text-sm); font-weight: 650; white-space: nowrap; }
.vx-menubar { display: flex; align-items: center; gap: 2px; min-width: 0; }
.vx-menu { position: relative; }
.vx-menu > summary { list-style: none; display: flex; align-items: center; min-height: var(--vx-hit); padding: 0 var(--space-2); border-radius: var(--radius-sm); cursor: default; user-select: none; }
.vx-menu > summary::-webkit-details-marker { display: none; }
.vx-menu > summary:hover, .vx-menu[open] > summary { background: var(--paper-inset); }
.vx-menu > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vx-drop { position: absolute; z-index: 60; top: calc(100% + 2px); left: 0; display: flex; flex-direction: column; min-width: 280px; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; padding: var(--space-1); border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: 0 0 0 1px var(--rule), var(--elev-2, 0 12px 32px rgb(0 0 0 / 0.18)); }
.vx-menu[open] > .vx-drop, .vx-ctx { animation: os-menu-in var(--dur-3) var(--ease-standard); }
.vx-drop button, .vx-drop a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-5); min-height: var(--vx-hit); padding: 6px var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.vx-drop button:hover, .vx-drop button:focus-visible, .vx-drop a:hover, .vx-drop a:focus-visible { background: var(--paper-inset); outline: none; }
.vx-drop button:disabled { opacity: 0.45; cursor: default; background: none; }
.vx-drop button[aria-checked="true"]::before { content: ""; position: absolute; left: var(--space-1); width: 6px; height: 10px; margin-top: 2px; border: solid var(--accent-strong); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.vx-drop button[role="menuitemcheckbox"] { position: relative; padding-left: var(--space-5); }
.vx-drop kbd { font: var(--text-2xs) var(--font-mono); color: var(--ink-faint); }
/* A phone has no keyboard to press them with: the menus keep the words. */
@media (hover: none) and (pointer: coarse) { .vx-drop kbd { display: none; } }
.vx-drop hr { width: 100%; border: 0; border-top: 1px solid var(--rule); margin: var(--space-1) 0; }
.vx-ctx { position: fixed; top: 0; left: 0; z-index: 80; min-width: 220px; }
.vx-docname { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; line-height: 1.25; }
.vx-name { max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vx-saved { font-size: var(--text-2xs); color: var(--ink-faint); white-space: nowrap; }
.vx-saved[data-save-state="failed"] { color: var(--danger); }
.vx .vx-ib { display: inline-flex; align-items: center; justify-content: center; width: var(--vx-hit); height: var(--vx-hit); padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); cursor: pointer; flex: none; }
.vx .vx-ib:hover:not(:disabled) { background: var(--paper-inset); color: var(--ink); }
.vx-ib:disabled { opacity: 0.35; cursor: default; }
.vx-ib:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx .vx-ib[aria-pressed="true"], .vx .vx-ib.is-on { background: var(--accent-soft); color: var(--accent-strong); }
.vx .vx-ib-sm { width: 26px; height: 26px; }
.vx .vx-ib-sm svg { width: 16px; height: 16px; }
.vx .vx-lrow .vx-ib[aria-pressed] { background: transparent; color: var(--ink-faint); }
.vx .vx-lrow .vx-ib[aria-pressed]:hover { background: var(--paper-inset); color: var(--ink); }
.vx-dialog .vx-seg { justify-self: start; align-self: start; }
.vx .vx-lrow .vx-ib[data-lact="eye"][aria-pressed="false"], .vx .vx-lrow .vx-ib[data-lact="lock"][aria-pressed="true"] { color: var(--ink); }
.vx-save { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--vx-hit); padding: 0 var(--space-3); }
.vx-save svg { width: 16px; height: 16px; }
.vx .vx-panel-btn, .vx .vx-panel-close { display: none; }
.vx .btn { min-height: 34px; }
.vx .vx-btn-sm { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.vx .vx-btn-sm svg { width: 15px; height: 15px; }
.vx .btn-danger { background: var(--danger); border-color: var(--danger); color: var(--paper-raised); }

/* ------------------------------------------------------------ the options bar */

.vx-ctl { display: flex; align-items: center; gap: var(--space-2); min-height: 38px; padding: 3px var(--space-3); border-bottom: 1px solid var(--rule); background: var(--paper-inset); color: var(--ink-soft); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.vx-ctl::-webkit-scrollbar { display: none; }
.vx-ctl:empty { display: none; }
.vx-ctl-name { flex: none; font-weight: 650; color: var(--ink); min-width: 120px; }
.vx-ctl-sep { flex: none; width: 1px; height: 20px; background: var(--rule-strong); margin: 0 var(--space-1); }
.vx-ctl-txt { flex: none; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.vx-icons { display: inline-flex; gap: 2px; }
.vx-lab { color: var(--ink-faint); font-size: var(--text-2xs); white-space: nowrap; }

/* ------------------------------------------------------------ fields */

.vx input[type="text"], .vx input:not([type]), .vx input[type="search"], .vx input[type="number"], .vx select, .vx textarea:not(.vx-textedit) {
  min-height: 28px; padding: 3px var(--space-2); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.vx input[type="number"] { font-variant-numeric: tabular-nums; }
.vx input:focus-visible, .vx select:focus-visible, .vx textarea:not(.vx-textedit):focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
.vx input:disabled { opacity: 0.5; }
.vx-f { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); min-width: 0; }
.vx-f > span:first-child { color: var(--ink-faint); font-size: var(--text-2xs); white-space: nowrap; }
.vx-f > input, .vx-f > select { width: 100%; min-width: 0; }
.vx-f-wide { grid-template-columns: 64px minmax(0, 1fr); }
.vx-f-inline { display: inline-grid; }
.vx-f-inline input[type="number"] { width: 72px; }
.vx-f-inline input[type="range"] { width: 120px; accent-color: var(--accent-strong); }
.vx-f-num { grid-template-columns: auto auto; gap: 2px; }
.vx-f-num input[type="number"] { width: 64px; }
.vx-unit { color: var(--ink-faint); font-size: var(--text-2xs); }
.vx-field { display: grid; gap: var(--space-1); min-width: 0; color: var(--ink-soft); }
.vx-field > :is(input, select) { width: 100%; min-width: 0; }
.vx-field > span:first-child { font-size: var(--text-2xs); font-weight: 600; color: var(--ink-soft); }
.vx-check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 28px; color: var(--ink); cursor: pointer; }
.vx-check input { accent-color: var(--accent-strong); }
.vx-check-tight { min-height: 0; }
.vx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); align-items: center; }
.vx-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: center; }
.vx-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: end; }
.vx-row-c { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.vx-btnrow { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.vx-form-grid { display: grid; gap: var(--space-3); }
.vx-form-grid .btn { justify-self: start; }
.vx-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.vx-seg button { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 28px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.vx-seg button:hover { color: var(--ink); background: var(--paper-inset); }
.vx-seg button[aria-selected="true"], .vx-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.vx-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.vx-seg-sm button { min-height: 26px; padding: 0 var(--space-2); }
.vx-seg-sm svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ the working area */

.vx-main { position: relative; min-height: 0; display: flex; flex-direction: column; }
.vx-boot { margin: auto; color: var(--ink-faint); }
.vx-work { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: var(--vx-tools) minmax(0, 1fr) var(--vx-panel); grid-template-rows: minmax(0, 1fr); }
.vx-work[hidden], .vx-start[hidden], .vx-boot[hidden] { display: none; }

/* the toolbox */
.vx-tools { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2) 0; overflow-y: auto; scrollbar-width: none; border-right: 1px solid var(--rule); background: var(--paper-raised); }
.vx-tools::-webkit-scrollbar { display: none; }
.vx-tools [data-tool] { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 34px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color var(--dur-2) var(--ease-standard), color var(--dur-2) var(--ease-standard); }
.vx-tools [data-tool]:hover { background: var(--paper-inset); color: var(--ink); }
.vx-tools [data-tool]:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.vx-tools [data-tool][aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-border); }
.vx-tools svg { width: 20px; height: 20px; }
.vx-tools-gap { flex: none; width: 24px; height: 1px; margin: var(--space-1) 0; background: var(--rule); }
.vx-colours { position: relative; flex: none; width: 40px; height: 52px; margin-top: var(--space-3); }
.vx-tools-more { display: none; }
.vx-csw { position: absolute; width: 24px; height: 24px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; background-color: var(--paper); }
.vx-csw:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-csw-fill { left: 2px; top: 2px; z-index: 2; box-shadow: 0 0 0 2px var(--paper-raised); }
.vx-csw-stroke { left: 12px; top: 12px; z-index: 1; }
.vx-csw-stroke::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule-strong); background: var(--paper-raised); border-radius: var(--radius-sm); }
.vx-colours.stroke-front .vx-csw-stroke { z-index: 3; box-shadow: 0 0 0 2px var(--paper-raised); }
.vx-cmini { position: absolute; width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--ink-faint); cursor: pointer; }
.vx-cmini svg { width: 13px; height: 13px; }
.vx-cmini-swap { right: -6px; top: -2px; }
.vx-cmini-def { left: 0; bottom: 0; }
.vx-cmini-def::before, .vx-cmini-def::after { content: ""; position: absolute; width: 9px; height: 9px; border: 1px solid var(--ink-soft); }
.vx-cmini-def::before { left: 0; top: 0; background: var(--paper-raised); z-index: 1; }
.vx-cmini-def::after { left: 4px; top: 4px; background: var(--ink); }
.vx-cmini:focus-visible { outline: 2px solid var(--focus); }

/* a paint, shown: none is a slash, mixed a question */
.vx .vx-sw { position: relative; display: inline-block; width: 30px; height: 22px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background-color: var(--paper); cursor: pointer; flex: none; }
.vx .vx-sw-sm { width: 26px; height: 20px; }
.vx .vx-sw-ring::after { content: ""; position: absolute; inset: 5px 7px; border-radius: var(--radius-sm); background: var(--paper-raised); box-shadow: 0 0 0 1px var(--rule-strong); }
.vx .vx-sw:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-sw.is-none::before, .vx-csw.is-none::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1.5px; background: var(--danger); transform: rotate(45deg); }
.vx-csw.is-none { background: var(--paper-raised); }
.vx-sw.is-mixed::before, .vx-csw.is-mixed::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-faint); font-size: var(--text-2xs); font-weight: 700; }

/* the stage: rulers along two sides, the canvas in the corner they make */
.vx-stage { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--vx-ruler) minmax(0, 1fr); grid-template-rows: var(--vx-ruler) minmax(0, 1fr); background: var(--vx-paste); }
.vx-stage.no-rulers { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }
.vx-stage.no-rulers .vx-ruler, .vx-stage.no-rulers .vx-corner { display: none; }
.vx-corner { grid-column: 1; grid-row: 1; display: grid; place-items: center; padding: 0; border: 0; border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: var(--paper-raised); color: var(--ink-faint); font-size: var(--text-2xs); cursor: pointer; overflow: hidden; }
.vx-corner:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vx-ruler { display: block; background: var(--paper-raised); touch-action: none; }
.vx-ruler-h { grid-column: 2; grid-row: 1; width: 100%; height: var(--vx-ruler); cursor: ns-resize; }
.vx-ruler-v { grid-column: 1; grid-row: 2; width: var(--vx-ruler); height: 100%; cursor: ew-resize; }
.vx-canvas { grid-column: 2; grid-row: 2; position: relative; min-width: 0; min-height: 0; overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.vx-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.vx-svg, .vx-over { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.vx .vx-svg, .vx .vx-over { width: 100%; height: 100%; }
.vx-over { pointer-events: none; }
.vx-board-shadow { fill: none; stroke: var(--rule-strong); stroke-width: calc(var(--icon-stroke) / 1.5); vector-effect: non-scaling-stroke; }
.vx-check-a { fill: var(--paper-raised); }
.vx-check-b { fill: var(--paper-inset); }
.vx-grid-line { stroke: color-mix(in srgb, var(--accent) 22%, transparent); }
.vx-svg.is-outline #vxContent * { fill: none !important; stroke: var(--ink) !important; stroke-width: calc(var(--icon-stroke) / 1.5) !important; vector-effect: non-scaling-stroke; marker-start: none !important; marker-end: none !important; opacity: 1 !important; }
.vx-svg.is-outline #vxContent text, .vx-svg.is-outline #vxContent tspan { fill: var(--ink) !important; stroke: none !important; }

/* what is drawn over the drawing, in screen pixels */
.vx-over .vx-o-sel { fill: none; stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-hover { fill: none; stroke: var(--vx-sel); stroke-width: 1.5; }
.vx-over .vx-o-box { fill: none; stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-handle { fill: var(--paper-raised); stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-anchor { fill: var(--paper-raised); stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-anchor.is-on { fill: var(--vx-sel); }
.vx-over .vx-o-anchor.is-shape { fill: var(--vx-sel); stroke: none; opacity: 0.7; }
.vx-over .vx-o-hline { stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-hdot { fill: var(--vx-sel); stroke: var(--paper-raised); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-rubber { fill: none; stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 4 3; }
.vx-over .vx-o-marquee { fill: color-mix(in srgb, var(--vx-sel) 8%, transparent); stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 3 3; }
.vx-over .vx-o-guide { stroke: var(--vx-guide); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-guide.is-hot { stroke-width: var(--icon-stroke); }
.vx-over .vx-o-smart { fill: none; stroke: var(--vx-smart); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-label { fill: var(--vx-smart); font: 600 var(--text-2xs) var(--font-sans); }
.vx-over .vx-o-group { fill: none; stroke: var(--ink-faint); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 5 4; }
.vx-over .vx-o-board { fill: var(--ink-soft); font: var(--text-2xs) var(--font-sans); }
.vx-over .vx-o-artboard { fill: none; stroke: var(--ink-faint); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 4 3; }
.vx-over .vx-o-artboard.is-on { stroke: var(--vx-sel); stroke-dasharray: none; }
.vx-over .vx-o-gline { stroke: var(--paper-raised); stroke-width: calc(var(--icon-stroke) * 2); }
.vx-over .vx-o-gline + .vx-o-gline, .vx-over .vx-o-gline { filter: drop-shadow(0 0 1px rgb(0 0 0 / 0.6)); }
.vx-over .vx-o-gstop { stroke: var(--paper-raised); stroke-width: calc(var(--icon-stroke) / 1.5); filter: drop-shadow(0 0 1px rgb(0 0 0 / 0.6)); }
.vx-over .vx-o-gend { fill: var(--paper-raised); stroke: var(--vx-sel); stroke-width: var(--icon-stroke); }
.vx-over .vx-o-region { fill: none; stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 2 3; opacity: 0.6; }
.vx-over .vx-o-region.is-on { fill: color-mix(in srgb, var(--vx-sel) 22%, transparent); stroke-dasharray: none; opacity: 1; }
.vx-over .vx-o-region.is-out { fill: color-mix(in srgb, var(--danger) 22%, transparent); stroke: var(--danger); stroke-dasharray: none; opacity: 1; }
.vx-over .vx-o-corner { fill: var(--paper-raised); stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-wline { stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-wline.is-hover { stroke-dasharray: 3 2; }
.vx-over .vx-o-wpt { fill: var(--paper-raised); stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-cut { fill: var(--paper-raised); stroke: var(--danger); stroke-width: var(--icon-stroke); }
.vx-over .vx-o-knife { fill: none; stroke: var(--danger); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-erase { fill: none; stroke: var(--danger); stroke-linecap: round; stroke-linejoin: round; opacity: 0.25; }
.vx-over .vx-o-brush { fill: none; stroke: var(--ink); stroke-width: calc(var(--icon-stroke) / 1.5); }
.vx-over .vx-o-tile { fill: none; stroke: var(--vx-sel); stroke-width: calc(var(--icon-stroke) / 1.5); stroke-dasharray: 6 4; }
.vx-over .vx-o-readout rect { fill: var(--ink); opacity: 0.88; }
.vx-over .vx-o-readout text { fill: var(--paper-raised); font: var(--text-2xs) var(--font-mono); }

/* text typed in place */
.vx-textedit { position: absolute; left: 0; top: 0; z-index: 5; margin: 0; padding: 0; border: 0; outline: 1px dashed var(--vx-sel); outline-offset: 2px; background: transparent; overflow: visible; overflow-wrap: anywhere; transform-origin: 0 0; caret-color: var(--vx-sel); cursor: text; }
.vx-textedit:focus { outline: 1px dashed var(--vx-sel); }
.vx-textedit::selection, .vx-textedit *::selection { background: color-mix(in srgb, var(--vx-sel) 30%, transparent); }
.vx-textedit[hidden] { display: none; }

/* ------------------------------------------------------------ panels */

.vx-panels { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--rule); background: var(--paper-raised); }
.vx-ptabs { display: flex; align-items: stretch; gap: 0; padding: 0 var(--space-1); border-bottom: 1px solid var(--rule); }
.vx-ptabs [data-panel] { flex: 1 1 auto; min-height: 36px; padding: 0 var(--space-1); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.vx-ptabs [data-panel]:hover { color: var(--ink); }
.vx-ptabs [data-panel][aria-selected="true"] { border-bottom-color: var(--accent-strong); color: var(--ink); font-weight: 600; }
.vx-ptabs [data-panel]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vx-pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.vx-sec { border-bottom: 1px solid var(--rule); }
.vx-sec > summary { display: flex; align-items: center; min-height: 34px; padding: 0 var(--space-3); list-style: none; cursor: pointer; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); user-select: none; }
.vx-sec > summary::-webkit-details-marker { display: none; }
.vx-sec > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid var(--ink-faint); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform var(--dur-2) var(--ease-standard); }
.vx-sec:not([open]) > summary::after { transform: rotate(-45deg); }
.vx-sec > summary:hover { color: var(--ink); }
.vx-sec > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vx-sec-in { display: grid; gap: var(--space-2); padding: 0 var(--space-3) var(--space-3); }
.vx-p-title { margin: 0; font-weight: 600; }
.vx-xf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.vx-ref { display: grid; grid-template-columns: repeat(3, 14px); grid-template-rows: repeat(3, 14px); gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.vx-ref button { width: 14px; height: 14px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.vx-ref button::before { content: ""; width: 6px; height: 6px; border: 1px solid var(--ink-faint); background: var(--paper-raised); }
.vx-ref button[aria-checked="true"]::before { background: var(--accent-strong); border-color: var(--accent-strong); }
.vx-ref button:focus-visible { outline: 2px solid var(--focus); }
.vx-dialog .vx-ref { justify-self: start; width: max-content; grid-template-columns: repeat(3, 22px); grid-template-rows: repeat(3, 22px); }
.vx-dialog .vx-ref button { width: 22px; height: 22px; }
.vx-ap-row { display: grid; grid-template-columns: 44px auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.vx-ap-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.vx-more { display: grid; gap: var(--space-2); }
.vx-more > summary { cursor: pointer; color: var(--accent-strong); padding: var(--space-1) 0; }
.vx-more[open] { gap: var(--space-2); }
.vx-more > :not(summary) { margin-top: var(--space-2); }
.vx-pf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1); }
.vx-pf-b { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: var(--space-1) 0; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-soft); cursor: pointer; font-size: var(--text-2xs); }
.vx-pf-b:hover:not(:disabled) { border-color: var(--accent-border); color: var(--ink); }
.vx-pf-b:disabled { opacity: 0.45; cursor: default; }
.vx-pf-b:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-pf-b svg { width: 22px; height: 22px; }

/* effects, overrides, features and the Assets panel */
.vx-fx { display: grid; gap: var(--space-1); padding: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper); }
.vx-fx-head { display: flex; align-items: center; gap: var(--space-2); }
.vx-fx-head .vx-check { margin-right: auto; font-weight: 600; }
.vx-ov { display: grid; gap: 2px; }
.vx-ov-row { display: flex; align-items: center; gap: var(--space-2); min-height: 30px; padding-left: var(--space-1); border-left: 2px solid transparent; }
.vx-ov-row.is-changed { border-left-color: var(--accent-strong); }
.vx-ov-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx .vx-ov-text { flex: 0 1 46%; min-width: 0; }
.vx-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--space-2); }
.vx-asws { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.vx-asw { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; }
.vx-asw:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-asw.is-del span { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--paper-raised) 70%, transparent); color: var(--danger); }
.vx .vx-asw.is-del svg { width: 14px; height: 14px; }
.vx-lib-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); height: 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); overflow: hidden; }
/* Recolour: each colour, its new one, and how often it is used. */
.vx-rc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-1) var(--space-3); max-height: 34vh; overflow-y: auto; margin-bottom: var(--space-2); }
.vx-rc-row { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; }
.vx-rc-old { flex: none; width: 28px; height: 24px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); }
.vx-rc-arrow { color: var(--ink-faint); }
.vx-rc-new { flex: none; width: 40px; height: 28px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; }
.vx-rc-hex { font: var(--text-2xs) var(--font-mono); font-variant-numeric: tabular-nums; }
.vx-rc-n { margin-left: auto; color: var(--ink-faint); font-size: var(--text-2xs); white-space: nowrap; }
/* Fills and strokes: one row each, top first, the main two plain. */
.vx-stk { display: grid; gap: var(--space-1); }
.vx-stk-row { display: grid; gap: var(--space-1); padding: var(--space-1) var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper); }
.vx-stk-row.is-main { background: transparent; border-style: dashed; }
.vx-stk-row.is-off .vx-stk-name, .vx-stk-row.is-off .vx-sw { opacity: 0.45; }
.vx-stk-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.vx-stk-eye { flex: none; width: 26px; }
.vx-stk-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-stk-btns { display: inline-flex; gap: 2px; flex: none; }
.vx-stk-foot { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.vx-stk-foot > .vx-f-num { flex: none; }
.vx-stk-foot input[type="number"] { width: 52px; }
.vx-stk-blend { flex: 1 1 auto; min-width: 0; }
.vx-stk-blend select { width: 100%; min-width: 0; }
.vx-patlist { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.vx-patlist li { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; }
.vx-patsw { flex: none; width: 30px; height: 30px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); }
.vx-pk-pats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.vx-pk-pat { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 2px var(--space-2) 2px 2px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; }
.vx-pk-pat span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-pk-pat.is-on { border-color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-strong); }
.vx-pk-patsw { flex: none; width: 30px; height: 30px; border-radius: var(--radius-sm); }
.vx-glist, .vx-symlist { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.vx-glist li, .vx-symlist li { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; }
.vx .vx-gname { flex: 1 1 auto; min-width: 0; }
.vx-gcount { min-width: 2ch; color: var(--ink-faint); font-size: var(--text-2xs); font-variant-numeric: tabular-nums; text-align: right; }
.vx-symthumb { width: 30px; height: 30px; }
.vx-symname { display: grid; flex: 1 1 auto; min-width: 0; }
.vx-symname b, .vx-symname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-symname span { color: var(--ink-faint); font-size: var(--text-2xs); }
.vx-pk-globals { padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule); }
.vx-pk-sw.is-global { border-radius: 50%; }

/* layers */
.vx-ltools { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--rule); }
.vx-ltools .btn { margin-right: auto; }
.vx-layers { position: relative; margin: 0; padding: var(--space-1) 0; list-style: none; }
.vx-lrow { display: flex; align-items: center; gap: 2px; min-height: 30px; padding: 0 var(--space-2) 0 calc(var(--space-1) + var(--lvl, 0) * 14px); border-left: 3px solid transparent; }
.vx-lrow:hover { background: var(--paper-inset); }
.vx-lrow.is-layer { font-weight: 600; background: color-mix(in srgb, var(--paper-inset) 55%, transparent); border-top: 1px solid var(--rule); }
.vx-lrow.is-layer.is-active { border-left-color: var(--accent-strong); }
.vx-lrow.is-sel { background: var(--accent-soft); color: var(--accent-strong); }
.vx-lrow.is-hidden .vx-lname, .vx-lrow.is-hidden .vx-lthumb { opacity: 0.45; }
.vx-lrow.is-drag { opacity: 0.4; }
.vx-lname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding: 4px 0; }
.vx-lthumb { flex: none; display: inline-flex; width: 22px; height: 22px; margin: 0 2px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper-raised); overflow: hidden; }
.vx-lrow.is-layer .vx-lthumb { display: none; }
.vx .vx-lthumb svg { width: 100%; height: 100%; }
.vx-twist-gap { flex: none; width: 26px; }
.vx-lgrip { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 26px; color: var(--ink-faint); cursor: grab; touch-action: none; }
.vx-lgrip:hover { color: var(--ink); }
.vx-lrename { flex: 1 1 auto; min-width: 0; }
.vx-ldrop { position: absolute; z-index: 3; height: 2px; background: var(--accent-strong); pointer-events: none; }
.vx-ldrop.is-into { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 2px var(--accent-strong); }
.vx-pbody { position: relative; }

/* artboards */
.vx-boards { margin: 0; padding: var(--space-1) 0; list-style: none; border-bottom: 1px solid var(--rule); }
.vx-bpick { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-2); width: 100%; min-height: 34px; padding: var(--space-1) var(--space-3); border: 0; background: none; text-align: left; cursor: pointer; }
.vx-bpick:hover { background: var(--paper-inset); }
.vx-brow.is-sel .vx-bpick { background: var(--accent-soft); color: var(--accent-strong); }
.vx-bpick b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-bpick span:last-child { color: var(--ink-faint); font-size: var(--text-2xs); font-variant-numeric: tabular-nums; }
.vx-bnum { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.vx-bpick:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* history */
.vx-history { margin: 0; padding: var(--space-1) 0; list-style: none; counter-reset: h; }
.vx-hrow { display: block; width: 100%; min-height: 30px; padding: 5px var(--space-3); border: 0; border-left: 3px solid transparent; background: none; text-align: left; cursor: pointer; }
.vx-hrow:hover { background: var(--paper-inset); }
.vx-hrow.is-now { border-left-color: var(--accent-strong); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.vx-hrow.is-future { color: var(--ink-faint); }
.vx-hrow:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ------------------------------------------------------------ the colour picker */

.vx-picker { position: fixed; z-index: 90; width: 264px; display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--paper-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 24px 56px -24px rgb(0 0 0 / 0.5); font: var(--text-xs)/1.4 var(--font-sans); animation: os-menu-in var(--dur-3) var(--ease-standard); }
.vx-picker * { box-sizing: border-box; }
.vx-picker svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; }
.vx-picker button, .vx-picker input, .vx-picker select { font: inherit; color: inherit; }
.vx-picker .vx-seg { background: var(--paper); }
.vx-pk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.vx-picker .vx-ib { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); cursor: pointer; }
.vx-picker .vx-ib:hover:not(:disabled) { background: var(--paper-inset); color: var(--ink); }
.vx-picker .vx-ib:disabled { opacity: 0.35; }
.vx-pk-sv { display: block; width: 100%; height: 132px; border-radius: var(--radius-sm); cursor: crosshair; touch-action: none; }
.vx-pk-hue, .vx-pk-alpha { display: block; width: 100%; height: 14px; border-radius: var(--radius-sm); cursor: ew-resize; touch-action: none; }
.vx-pk-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.vx-picker input[type="text"], .vx-picker input[type="number"], .vx-picker select { min-height: 26px; padding: 2px var(--space-1); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.vx-picker input:focus-visible, .vx-picker select:focus-visible, .vx-picker button:focus-visible, .vx-picker canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-f-hex input { width: 84px; font-family: var(--font-mono); text-transform: uppercase; }
.vx-picker .vx-f-inline input[type="number"] { width: 54px; }
.vx-f-ch { grid-template-columns: auto auto; gap: 3px; }
.vx-picker .vx-f-ch input[type="number"] { width: 44px; }
.vx-pk-sws { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.vx-pk-sw { aspect-ratio: 1; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; }
.vx-pk-add { display: grid; place-items: center; background: var(--paper); color: var(--ink-faint); }
.vx-pk-grad { display: grid; gap: var(--space-2); }
.vx-pk-bar { position: relative; height: 22px; margin: 0 7px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--rule-strong); cursor: copy; touch-action: none; }
.vx-pk-stop { position: absolute; top: 15px; width: 14px; height: 14px; margin-left: -7px; padding: 0; border: 2px solid var(--paper-raised); border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--ink-faint); cursor: grab; }
.vx-pk-stop.is-on { box-shadow: 0 0 0 2px var(--accent-strong); }

/* ------------------------------------------------------------ the start screen */

.vx-start { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.vx-start-in { max-width: 1120px; margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-8); }
.vx-start h2 { margin: 0 0 var(--space-2); font: 700 var(--text-2xl)/1.15 var(--font-display); }
.vx-lede { max-width: 64ch; margin: 0 0 var(--space-5); color: var(--ink-soft); font-size: var(--text-md); line-height: 1.6; }
.vx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.vx-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-raised); }
.vx-card h3 { margin: 0; font-size: var(--text-sm); font-weight: 650; }
.vx-card p { margin: 0 0 auto; color: var(--ink-soft); font-size: var(--text-xs); line-height: 1.55; }
.vx-card > .btn { align-self: flex-start; margin-top: var(--space-3); }
.vx-sub { margin: var(--space-6) 0 var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--rule); font-size: var(--text-sm); font-weight: 650; }
.vx-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.vx-docs li { position: relative; display: flex; }
.vx-doc-open { flex: 1 1 auto; display: grid; grid-template-rows: auto auto; gap: var(--space-2); min-width: 0; padding: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); text-align: left; cursor: pointer; }
.vx-doc-open:hover { border-color: var(--accent-border); }
.vx-doc-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vx-doc-thumb { display: flex; align-items: center; justify-content: center; height: 132px; border-radius: var(--radius-sm); background: var(--vx-paste); overflow: hidden; }
.vx .vx-doc-thumb svg { width: auto; height: auto; max-width: 92%; max-height: 116px; box-shadow: 0 0 0 1px var(--rule-strong); }
.vx-doc-text { display: grid; gap: 2px; min-width: 0; }
.vx-doc-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-doc-text span { color: var(--ink-faint); font-size: var(--text-2xs); font-variant-numeric: tabular-nums; }
.vx-docs .vx-ib { position: absolute; right: var(--space-2); bottom: var(--space-2); }
.vx-empty-line { color: var(--ink-faint); padding: var(--space-2) 0; }

/* ------------------------------------------------------------ dialogs */

.vx-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--paper-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 30px 70px -30px rgb(0 0 0 / 0.55); font: var(--text-xs)/1.45 var(--font-sans); }
.vx-dialog.is-wide { width: min(720px, calc(100vw - 32px)); }
.vx-dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.vx-dialog[open] { animation: os-menu-in var(--dur-3) var(--ease-standard); }
.vx-dform { display: grid; gap: var(--space-3); padding: var(--space-5); }
.vx-dform h2 { margin: 0; font: 600 var(--text-xl)/1.2 var(--font-display); }
.vx-dbody { display: grid; gap: var(--space-3); min-width: 0; }
.vx-dbody p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.vx-dsay { margin: 0; color: var(--danger); }
.vx-dsay:empty { display: none; }
.vx-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.vx-exopts { display: grid; gap: var(--space-1); }
.vx-exopts[hidden] { display: none; }
.vx-keys { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.vx-keys dt { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--ink); white-space: nowrap; }
.vx-keys dd { margin: 0; color: var(--ink-soft); }
.vx-keys .vx-keys-h { margin-top: var(--space-3); font: 700 var(--text-2xs) var(--font-sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }

/* A dialog's group of choices (Average, Clean up), the counts beside
   them, the measure tool's line and figures, and a sum a field could not
   work out. */
.vx-fs { display: grid; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; border: 0; }
.vx-fs legend { margin-bottom: var(--space-1); padding: 0; color: var(--ink-soft); font-size: var(--text-2xs); font-weight: 600; }
.vx-count { color: var(--ink-soft); font-family: var(--font-mono); font-size: var(--text-2xs); font-variant-numeric: tabular-nums; }
.vx-hint-in { color: var(--ink-faint); }
.vx-over .vx-o-measure { stroke: var(--vx-smart); stroke-width: var(--icon-stroke); }
.vx-measure b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.vx input[data-num] { font-variant-numeric: tabular-nums; }
.vx input[aria-invalid="true"] { border-color: var(--danger); }
/* Outline view: a picture is its frame with a cross, as Illustrator
   shows it. */
.vx-svg.is-outline #vxContent image { display: none; }

/* ------------------------------------------------------------ status */

.vx-status { display: flex; align-items: center; gap: var(--space-3); min-height: 30px; padding: 0 150px 0 var(--space-3); border-top: 1px solid var(--rule); background: var(--paper-raised); color: var(--ink-soft); font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; }
.vx-status > #vxSay { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vx-status [data-kind="warn"], .vx-dialog .vx-hint[data-kind="warn"] { color: var(--warn); }
.vx-st-pos, .vx-st-sel { font-variant-numeric: tabular-nums; }
.vx-st-pos { min-width: 150px; color: var(--ink-faint); }
.vx-st-board select { min-height: 24px; max-width: 160px; padding: 0 var(--space-1); font-size: var(--text-2xs); }
.vx-zoom { display: inline-flex; align-items: center; gap: 2px; }
.vx-zoom .vx-ib { width: 24px; height: 24px; }
.vx-zoom .vx-ib svg { width: 15px; height: 15px; }
.vx .vx-zoom-val { min-width: 52px; min-height: 24px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-soft); cursor: pointer; font-variant-numeric: tabular-nums; }
.vx-zoom-val:hover { background: var(--paper-inset); }

/* ------------------------------------------------------------ shorter */

/* A short window: the toolbox in two columns, as Illustrator's goes, so
   every tool and the colour squares show without scrolling. */
@media (max-height: 1000px) and (min-width: 761px) {
  .vx { --vx-tools: 84px; }
  .vx-tools { display: grid; grid-template-columns: repeat(2, 36px); justify-content: center; align-content: start; gap: 2px; }
  .vx-tools-gap { grid-column: 1 / -1; justify-self: center; width: 60px; }
  .vx-colours { grid-column: 1 / -1; justify-self: center; }
}

/* ------------------------------------------------------------ narrower */

@media (max-width: 1280px) {
  .vx { --vx-panel: 264px; }
  .vx-ctl-wide { display: none; }
  .vx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .vx-docname { display: none; }
  .vx-st-pos { display: none; }
}
/* A phone: the menus scroll under the name, the toolbox runs along the
   foot of the canvas, the panels are a sheet over it brought up by the
   bar's button, and everything a finger presses is 44 pixels. */
@media (max-width: 760px) {
  .vx { --vx-ruler: 0px; }
  .vx-top { padding: var(--space-1); }
  .vx-menubar { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .vx-menubar::-webkit-scrollbar { display: none; }
  .vx-drop { position: fixed; top: auto; left: var(--space-2); right: var(--space-2); min-width: 0; max-height: 60vh; overflow-y: auto; }
  .vx-openin, #vxUndo, #vxRedo { display: none; }
  .vx-save span { display: none; }
  .vx .vx-panel-btn, .vx .vx-panel-close { display: inline-flex; }
  .vx-ctl { min-height: 44px; }
  .vx-ctl-name { min-width: 0; }
  .vx-work { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .vx-stage { grid-row: 1; grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }
  .vx-ruler, .vx-corner { display: none; }
  .vx-tools { grid-row: 2; flex-direction: row; justify-content: flex-start; gap: 2px; padding: 2px var(--space-1); overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--rule); }
  .vx-tools [data-tool] { width: 44px; height: 44px; }
  /* the strip scrolls: a button at its end, always in view, says so and
     goes on to the tools out of sight */
  .vx-tools-more { position: sticky; right: 0; z-index: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--paper-raised); color: var(--ink-soft); cursor: pointer; }
  .vx-tools-more svg { width: 20px; height: 20px; }
  .vx-tools-more.is-end svg { transform: scaleX(-1); }
  .vx-tools-more[hidden] { display: none; }
  .vx-tools-gap { width: 1px; height: 24px; margin: 0 var(--space-1); }
  .vx-colours { margin: 0 0 0 var(--space-2); width: 52px; height: 44px; }
  .vx-csw-fill { top: 4px; left: 4px; }
  .vx-csw-stroke { top: 14px; left: 16px; }
  .vx-cmini-swap, .vx-cmini-def { display: none; }
  .vx-panels { position: absolute; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 72%; visibility: hidden; border-left: 0; border-top: 1px solid var(--rule); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -12px 36px rgb(0 0 0 / 0.3); }
  .vx-main.show-panels .vx-panels { visibility: visible; }
  .vx-ptabs [data-panel] { min-height: 44px; }
  .vx-cards { grid-template-columns: minmax(0, 1fr); }
  .vx-start-in { padding: var(--space-4) var(--space-3) var(--space-7); }
  .vx-status { padding-right: var(--space-2); }
  .vx-st-sel, .vx-st-board { display: none; }
  .vx-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vx-picker { width: min(300px, calc(100vw - 16px)); }
  /* The badge sits in the status bar, as Write's does, not above it over
     the start screen's cards or the tools. */
  body.vx-app #ppBadge { left: auto; right: var(--space-2); bottom: 2px; min-height: 44px; }
  .vx-status { min-height: 48px; padding-right: 64px; }
}
@media (pointer: coarse) {
  .vx { --vx-hit: 44px; }
  .vx-menu > summary { justify-content: center; }
  .vx-menu > summary, .vx-seg button, .vx .btn, .vx .vx-btn-sm, .vx-save, .vx .vx-zoom .vx-ib, .vx .vx-zoom-val, .vx-check, .vx-drop button, .vx-drop a, .vx-ptabs [data-panel], .vx-hrow, .vx-bpick, .vx-lrow, .vx-pf-b, .vx .vx-ib-sm, .vx-lgrip, .vx-sec > summary { min-height: 44px; min-width: 44px; }
  .vx .vx-ib-sm { width: 44px; height: 44px; }
  .vx .vx-sw { width: 44px; height: 32px; }
  .vx input[type="text"], .vx input:not([type]), .vx input[type="search"], .vx input[type="number"], .vx select { min-height: 44px; }
  .vx-check input { width: 22px; height: 22px; }
  .vx-status { min-height: 44px; }
  .vx-ref { grid-template-columns: repeat(3, 26px); grid-template-rows: repeat(3, 26px); }
  .vx-asws { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .vx-asw { min-height: 44px; }
  .vx-feats { grid-template-columns: minmax(0, 1fr); }
  .vx-ov-row, .vx-glist li, .vx-symlist li, .vx-patlist li, .vx-pk-pat { min-height: 44px; }
  .vx-stk-eye { width: 44px; }
  .vx .vx-stk-row .vx-sw { height: 44px; }
  .vx-rc-new { width: 52px; height: 44px; }
  .vx-rc-row { min-height: 44px; }
  .vx-stk-foot { flex-wrap: wrap; }
  .vx-ref button { width: 26px; height: 26px; }
  .vx-dialog .vx-ref { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
  .vx-dialog .vx-ref button { width: 44px; height: 44px; }
}
