/* cadtomesh — full-screen 3D conversion workspace */

:root {
  --ws-top: 56px;
  --ws-rail: 56px;
  --ws-panel: 340px;
}

html, body { height: 100%; }
body.page-ws { overflow: hidden; background: var(--bg-deep); }

.app {
  display: grid;
  grid-template-rows: var(--ws-top) 1fr;
  height: 100dvh;
}

/* ---------- top bar ---------- */
.ws-top {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-inline: var(--sp-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.ws-top .brand {
  display: inline-flex;
  align-items: center;
  gap: var(--wm-gap-icon);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--teal-700);
}
.ws-top .brand .mark { width: 22px; height: 22px; }
.ws-top .brand .mark svg { width: 22px; height: 22px; display: block; }
.ws-crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--muted-2); letter-spacing: 0.08em; text-transform: uppercase;
}
.ws-crumb .sep { color: var(--faint); }
.ws-crumb .here { color: var(--teal-600); font-weight: 600; }
.ws-h1 {
  margin: 0; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  color: var(--ink); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.ws-top .spacer { flex: 1; }
.engine-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.1em; color: var(--teal-700);
}
.engine-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--green-soft); } 50% { box-shadow: 0 0 0 6px rgba(22,163,74,0.08); } }
.ws-top .btn { padding: 9px 16px; }

/* ---------- body grid ---------- */
.ws-body {
  display: grid;
  grid-template-columns: var(--ws-rail) 1fr var(--ws-panel);
  min-height: 0;
}

/* ---------- left rail ---------- */
.ws-rail {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding-block: var(--sp-3);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 30;
}
.rail-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { background: var(--teal-50); color: var(--teal-700); }
.rail-btn.active { background: var(--teal-100); color: var(--teal-700); border-color: var(--border-strong); }
.rail-btn::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; translate: 0 -50%;
  padding: 6px 10px; border-radius: 8px;
  background: var(--ink-strong); color: #fff;
  font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
  z-index: 60;
}
.rail-btn:hover::after, .rail-btn:focus-visible::after { opacity: 1; }
.rail-spacer { flex: 1; }

/* sample popover */
.rail-pop {
  position: absolute; left: calc(var(--ws-rail) + 8px); top: calc(var(--ws-top) + 52px);
  width: 200px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 55; display: none;
}
.rail-pop.open { display: block; animation: pop var(--dur) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rail-pop h5 {
  margin: 4px 8px 6px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); font-weight: 600;
}
.rail-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font-size: var(--text-sm); font-weight: 500; text-align: left;
}
.rail-pop button:hover { background: var(--teal-50); color: var(--teal-700); }
.rail-pop button svg { width: 16px; height: 16px; color: var(--teal-600); }

/* ---------- viewport ---------- */
.ws-view {
  position: relative; min-width: 0; min-height: 0;
  background: #eef7f4;
  overflow: hidden;
}
.ws-view canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.ws-view.grabbing canvas { cursor: grabbing; }

/* control dock */
.dock {
  position: absolute; top: var(--sp-4); left: 50%; translate: -50% 0;
  display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center;
  column-gap: 4px; row-gap: 6px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 9px 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 20;
}
.dock-group {
  display: flex; flex-direction: column; gap: 6px;
  padding-inline: 10px;
  justify-content: center;
  flex: 0 0 auto;
}
.dock-group + .dock-group { border-left: 1px solid var(--hairline); }
.dock-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.dock-row { display: flex; align-items: center; gap: 6px; }

/* segmented display mode */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; min-height: 34px; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted-2); font-size: var(--text-xs); font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--teal-700); }
.seg button[aria-pressed="true"] { background: var(--teal-600); color: #fff; box-shadow: var(--shadow-sm); }

/* toggle switch */
.switch {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 6px 8px; min-height: 34px; border-radius: 9px;
  color: var(--muted-2); font-size: var(--text-xs); font-weight: 600;
}
.switch .track {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--hairline); position: relative;
  transition: background var(--dur) var(--ease);
  flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: left var(--dur) var(--ease);
}
.switch[aria-pressed="true"] { color: var(--teal-700); }
.switch[aria-pressed="true"] .track { background: var(--teal-500); }
.switch[aria-pressed="true"] .track::after { left: 16px; }

/* background swatches */
.swatches { display: inline-flex; align-items: center; gap: 5px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid transparent; outline: 1px solid var(--border);
  padding: 0; transition: transform var(--dur-fast) var(--ease), outline-color var(--dur) var(--ease);
}
.swatch:hover { transform: scale(1.15); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--teal-600); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#f87171,#fbbf24,#34d399,#60a5fa,#a78bfa,#f87171); }
.swatch.custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }

/* light slider */
.light-ctl { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-2); }
.light-ctl svg { width: 15px; height: 15px; }
input[type="range"].ws-range {
  -webkit-appearance: none; appearance: none;
  /* 24px box with a 4px painted band: the thumb still rides the content box, but the pointer target grows */
  width: 84px; height: 24px; padding: 10px 0;
  background: linear-gradient(90deg, var(--teal-500) var(--fill,50%), var(--hairline) var(--fill,50%));
  background-clip: content-box; border-radius: 999px;
  outline-offset: 4px; cursor: pointer;
}
input[type="range"].ws-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--teal-600); box-shadow: var(--shadow-sm);
  cursor: grab;
}
input[type="range"].ws-range::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--teal-600); cursor: grab;
}

/* camera select + action buttons */
.ws-select {
  appearance: none;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 12px;
  color: var(--ink); font-size: var(--text-xs); font-weight: 600;
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; min-height: 34px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--ink);
  font-size: var(--text-xs); font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dock-btn svg { width: 14px; height: 14px; }
.dock-btn:hover { background: var(--teal-50); color: var(--teal-700); border-color: var(--border-strong); }
.dock-btn:active { transform: translateY(1px); }

/* file chip + hint chip */
.file-chip {
  position: absolute; left: var(--sp-4); bottom: var(--sp-4);
  display: flex; align-items: center; gap: 12px;
  max-width: min(360px, calc(100% - 32px));
  padding: 12px 16px;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 15;
}
.file-chip .fico {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--teal-50); color: var(--teal-600);
  border: 1px solid var(--border); border-radius: 10px;
}
.file-chip .fico svg { width: 18px; height: 18px; }
.file-chip .fname { font-weight: 600; font-size: var(--text-sm); color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fmeta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-2); }
.file-chip .fmeta .tri { color: var(--teal-600); font-weight: 600; }

.hint-chip {
  position: absolute; right: var(--sp-4); bottom: var(--sp-4);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-2);
  z-index: 15;
}
.hint-chip kbd {
  font-family: inherit; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--teal-700);
}

/* drop overlay */
.drop-overlay {
  position: absolute; inset: 0; z-index: 35;
  display: none; place-items: center;
  background: rgba(240,253,250,0.85); backdrop-filter: blur(4px);
  border: 3px dashed var(--teal-500); border-radius: 4px;
  pointer-events: none;
}
.ws-view.dragging .drop-overlay { display: grid; }
.drop-overlay .inner { text-align: center; color: var(--teal-700); }
.drop-overlay .inner svg { width: 48px; height: 48px; margin-inline: auto; margin-bottom: 12px; }
.drop-overlay .inner h3 { font-size: var(--text-xl); color: var(--teal-700); }
.drop-overlay .inner p { color: var(--muted); font-size: var(--text-sm); }

/* progress overlay */
.progress-overlay {
  position: absolute; inset: 0; z-index: 36;
  display: none; place-items: center;
  background: rgba(240,253,250,0.7); backdrop-filter: blur(6px);
}
.progress-overlay.show { display: grid; }
.progress-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 36px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  text-align: center;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--teal-100); border-top-color: var(--teal-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card .msg { font-weight: 600; color: var(--ink-strong); }
.progress-card .sub { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-2); }

/* ---------- right conversion panel ---------- */
.ws-panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 30;
}
.panel-head { padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.panel-head h2 { font-size: var(--text-xl); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.src-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; padding: 4px 9px; border-radius: 6px;
  background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--border);
  text-transform: uppercase;
}
.panel-search { position: relative; margin-top: var(--sp-3); }
.panel-search svg {
  position: absolute; left: 12px; top: 50%; translate: 0 -50%;
  width: 16px; height: 16px; color: var(--muted-2); pointer-events: none;
}
.panel-search input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font-size: var(--text-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.panel-search input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); }

.panel-scroll { flex: 1; overflow-y: auto; padding: 0 var(--sp-5) var(--sp-4); min-height: 0; }
.fmt-group { margin-top: var(--sp-4); }
.fmt-group:first-child { margin-top: var(--sp-2); }
.fmt-group h4 {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
  margin-bottom: 8px;
}
.fmt-list { display: flex; flex-direction: column; gap: 6px; }
.fmt-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); text-align: left;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.fmt-option:hover:not(:disabled) { border-color: var(--border-strong); background: var(--teal-50); }
.fmt-option .fi {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--teal-600); background: var(--teal-50);
  border: 1px solid var(--border); border-radius: 9px;
}
.fmt-option .fi svg { width: 16px; height: 16px; }
.fmt-option .ft { flex: 1; min-width: 0; }
.fmt-option .ft .n { font-weight: 600; font-size: var(--text-sm); color: var(--ink-strong); }
.fmt-option .ft .d { font-size: var(--text-xs); color: var(--muted-2); }
.fmt-option .radio {
  width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--border-strong); position: relative;
  transition: border-color var(--dur) var(--ease);
}
.fmt-option[aria-pressed="true"] {
  border-color: var(--teal-500); background: var(--teal-50);
  box-shadow: 0 0 0 1px var(--teal-500), var(--shadow-sm);
}
.fmt-option[aria-pressed="true"] .radio { border-color: var(--teal-600); }
.fmt-option[aria-pressed="true"] .radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--teal-600);
}
.fmt-option:disabled { opacity: 0.5; cursor: not-allowed; }
.fmt-option:disabled .fi { color: var(--muted-2); background: var(--surface-2); }
.fmt-empty { padding: 16px; text-align: center; color: var(--muted-2); font-size: var(--text-sm); display: none; }

/* tessellation quality (CAD only) */
.quality-box { margin-top: var(--sp-4); padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: none; }
.quality-box.show { display: block; }
.quality-box .qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.quality-box .qhead label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.quality-box .qhead .qval { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--teal-700); font-weight: 600; }
.quality-box select { width: 100%; }
.quality-box p { margin-top: 8px; font-size: var(--text-xs); color: var(--muted-2); }

/* panel footer / CTA */
.panel-foot { padding: var(--sp-4) var(--sp-5) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface); }
.convert-btn { width: 100%; padding: 15px 20px; font-size: var(--text-base); border-radius: 12px; }
.convert-btn svg { width: 18px; height: 18px; }
.convert-btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.panel-note {
  margin-top: 12px; text-align: center;
  font-size: var(--text-xs); color: var(--muted-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.panel-note svg { width: 13px; height: 13px; color: var(--green); }

/* desktop-app suggestion, shown after a download */
.app-hint {
  margin-top: 12px; padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left;
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-left: 3px dashed var(--teal-400);
  border-radius: var(--radius);
}
.app-hint[hidden] { display: none; }
.app-hint .ah-ico { width: 26px; height: 26px; flex: none; color: var(--teal-700); }
.app-hint .ah-ico svg { width: 26px; height: 26px; display: block; }
.app-hint .ah-body { flex: 1 1 0; min-width: 0; }
.app-hint .ah-body strong { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ink-strong); }
.app-hint .ah-body span { display: block; margin-top: 2px; font-size: var(--text-xs); line-height: 1.45; color: var(--muted); }
.app-hint .ah-act { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.app-hint .ah-go {
  display: inline-grid; place-items: center; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-pill); background: var(--teal-700); color: #fff;
  font-size: var(--text-xs); font-weight: 600;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.app-hint .ah-go:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }
.app-hint .ah-go:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.app-hint .ah-x {
  margin-left: auto; min-height: 36px; padding: 0 8px;
  border: 0; background: none; cursor: pointer;
  font-size: var(--text-xs); color: var(--muted-2);
}
.app-hint .ah-x:hover { color: var(--ink); }
.app-hint .ah-x:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0;
  display: flex; align-items: center; gap: 10px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--ink-strong); color: #fff;
  border-radius: 12px; box-shadow: var(--shadow-xl);
  font-size: var(--text-sm); font-weight: 500;
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), translate var(--dur) var(--ease);
}
.toast.show { opacity: 1; translate: -50% -6px; }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; }
.toast.success svg { color: var(--teal-300); }
.toast.error { background: var(--danger); }
.toast.error svg { color: #fff; }

/* ---------- shortcuts overlay ---------- */
.keys-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: none; place-items: center;
  background: var(--scrim); backdrop-filter: blur(4px);
}
.keys-overlay.show { display: grid; }
.keys-card {
  width: min(420px, calc(100vw - 32px));
  padding: var(--sp-5);
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-xl);
}
.keys-card h3 { font-size: var(--text-lg); margin-bottom: var(--sp-4); display: flex; justify-content: space-between; align-items: center; }
.keys-card h3 button { border: 0; background: var(--surface-2); border-radius: 8px; width: 28px; height: 28px; color: var(--muted-2); font-size: 16px; }
.keys-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.keys-card li { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); color: var(--muted); }
.keys-card kbd {
  font-family: var(--font-mono); font-size: var(--text-xs);
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--teal-700);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --ws-panel: 300px; }
  .dock-group { padding-inline: 9px; }
}
@media (max-width: 900px) {
  .ws-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .ws-rail { display: none; }
  .ws-panel {
    border-left: 0; border-top: 1px solid var(--border);
    max-height: 46dvh;
  }
  .panel-head { padding: var(--sp-3) var(--sp-4) var(--sp-2); }
  .panel-head h2 { font-size: var(--text-lg); }
  .panel-search { display: none; }
  .panel-scroll { padding: 0 var(--sp-4) var(--sp-3); }
  .fmt-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .fmt-option { padding: 9px 10px; }
  .fmt-option .ft .d { display: none; }
  .panel-foot { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .app-hint .ah-go, .app-hint .ah-x { min-height: 44px; }
  .hint-chip { display: none; }
  .dock { top: auto; bottom: 78px; left: 50%; translate: -50% 0; max-width: calc(100% - 24px); padding: 8px 6px; }
  .dock-group { padding-inline: 8px; }
  .file-chip { bottom: 12px; left: 12px; padding: 9px 12px; }
  .file-chip .fico { width: 30px; height: 30px; }
  .ws-crumb, .ws-h1 { display: none; }
  .rail-pop { left: 12px; top: calc(var(--ws-top) + 8px); }
}
@media (max-width: 560px) {
  .ws-top .btn span { display: none; }
  .ws-top .btn { padding: 9px 11px; }
  .engine-badge .txt { display: none; }
  .fmt-list { grid-template-columns: 1fr 1fr; }
  .file-chip .fmeta { font-size: 10px; }
}
/* narrow windows are mouse-driven, so the 44px dock targets key off the input device */
@media (pointer: coarse) {
  .seg button, .switch, .dock-btn { min-height: 44px; }
  .swatch { width: 40px; height: 40px; }
  .dock-row { gap: 10px; }
  input[type="range"].ws-range { height: 32px; padding-block: 14px; }
}