/* Sticker Workbench — a cutting mat, a sheet of die-cut stickers, and a toolbox. */

:root {
  --mat: #17302a;
  --mat-deep: #10231f;
  --mat-line: rgba(214, 236, 226, 0.05);
  --mat-line-major: rgba(214, 236, 226, 0.1);
  --panel: #0d1b18;
  --panel-raised: #142622;
  --edge: rgba(214, 236, 226, 0.1);
  --edge-strong: rgba(214, 236, 226, 0.2);
  --ink: #e6efe9;
  --muted: #8ea69d;
  --paper: #f4ead5;
  --paper-shade: #c9bfa8;
  --accent: #3a76f0;
  --accent-hi: #5b8ff5;
  --guide: #3ee0d0;
  --amber: #ffce54;
  --ok: #5ad19a;
  --over: #ff6b5f;
  --radius: 10px;
  --font-ui: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--mat-deep);
  color: var(--ink);
  font: 14px/1.45 var(--font-ui);
  font-optical-sizing: auto;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
kbd {
  font: 11px var(--font-mono);
  padding: 1px 5px;
  border: 1px solid var(--edge-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-raised);
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--edge);
  position: relative;
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; transform: rotate(-6deg); filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.brand h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pack-stats {
  margin-left: auto;
  font: 12px var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}
.pack-stats b { color: var(--ink); font-weight: 500; }
.pack-stats .over { color: var(--over); }

.top-actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--edge-strong);
  background: var(--panel-raised);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: rgba(214,236,226,.4); background: #1b302b; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .tile-main:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-sub { font: 11px var(--font-mono); opacity: .75; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn.active { border-color: var(--guide); color: var(--guide); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

.link-btn {
  background: none;
  border: 0;
  padding: 2px 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--over); }

/* ------------------------------------------------------------------ layout */

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 320px;
  height: calc(100vh - 68px);
}

/* ------------------------------------------------------------------ tray */

.tray {
  background: var(--panel);
  border-right: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tray-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 6px;
}
.eyebrow {
  font: 500 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}

.tray-list {
  list-style: none;
  margin: 0;
  padding: 4px 10px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.tile {
  position: relative;
  margin-bottom: 6px;
  border-radius: var(--radius);
}
.tile.entering { animation: tile-in .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes tile-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.tile.dragging { opacity: .4; }
.tile.drop-before::before, .tile.drop-after::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px;
  height: 2px;
  background: var(--guide);
  border-radius: 2px;
}
.tile.drop-before::before { top: -4px; }
.tile.drop-after::after { bottom: -4px; }

.tile-main {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.tile-main:hover { background: var(--panel-raised); }
.tile.selected .tile-main { background: var(--panel-raised); border-color: var(--edge-strong); }

.tile-thumb {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 9px;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
  overflow: hidden;
  transition: transform .2s;
}
.tile-main:hover .tile-thumb { transform: rotate(-3deg); }
.tile.selected .tile-thumb { border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 3px 8px rgba(0,0,0,.5); }
.tile-thumb canvas { width: 100%; height: 100%; display: block; }
.tile-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(58,118,240,.25);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.tile.busy .tile-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tile-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tile-num { font: 500 10.5px var(--font-mono); color: var(--muted); }
.tile-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-status { font: 11px var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-status.ok { color: var(--ok); }
.tile-status.over { color: var(--over); }
.tile-status.stale { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1px; }

.tile-remove, .tile-dup {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.tile-dup { right: 28px; font-size: 13px; }
.tile:hover .tile-remove, .tile-remove:focus-visible,
.tile:hover .tile-dup, .tile-dup:focus-visible { opacity: 1; }
.tile-dup:hover { color: var(--guide); background: rgba(62,224,208,.12); }
.tile-remove:hover { color: var(--over); background: rgba(255,107,95,.12); }

.tray-add {
  margin: 0 10px 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px dashed var(--edge-strong);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.tray-add:hover { color: var(--ink); border-color: var(--guide); }
.tray-add .plus {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-raised);
  font-size: 18px;
}

.checker {
  background-color: #e9e4d8;
  background-image:
    linear-gradient(45deg, #d6d0c2 25%, transparent 25%, transparent 75%, #d6d0c2 75%),
    linear-gradient(45deg, #d6d0c2 25%, transparent 25%, transparent 75%, #d6d0c2 75%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

/* ------------------------------------------------------------------ stage */

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-major) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.stage::after {
  /* faint vignette so the work area reads as lit from above */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(5, 12, 10, .45));
}

.stage-canvas-host { position: relative; min-height: 0; overflow: hidden; }
.stage-canvas { position: absolute; inset: 0; display: block; outline: none; touch-action: none; cursor: grab; }
.stage-canvas.grabbing { cursor: grabbing; }

/* Floating toolbars above (all stickers) and below (this sticker) the canvas. */
.stage-top, .dock {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 10px 14px 0;
}
/* The dock keeps a fixed height so switching between the sticker and text
   bars (or between stickers) doesn't resize the canvas. */
.dock { padding: 8px 14px 12px; min-height: 104px; align-items: flex-start; }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--edge-strong);
  background: rgba(13, 27, 24, .9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
}
.bar-group { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bar-tag {
  font: 500 10.5px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--guide);
}
.bar-label { font-size: 12.5px; color: var(--muted); }
.bar output { font: 11.5px var(--font-mono); color: var(--ink); min-width: 40px; }
.bar input[type='range'] { width: 104px; }
.bar input[type='range'].range-sm { width: 72px; }
.bar .check { margin: 0; font-size: 12.5px; }
select.bar-select { width: auto; max-width: 190px; padding: 4px 8px; font-size: 12.5px; }
.num-xs { width: 56px !important; padding: 3px 6px !important; }
.caret { font-size: 9px; opacity: .7; }
.mono { font: 11.5px var(--font-mono); }
.crop-label { color: var(--muted); }
.crop-label.own { color: var(--guide); }
.badge {
  font: 500 10.5px var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
}
.badge.warn { background: rgba(255,206,84,.12); color: var(--amber); }

.icon-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--edge-strong);
  background: var(--panel-raised);
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1;
}
.icon-btn:hover { border-color: var(--guide); }
.icon-btn.danger:hover { border-color: var(--over); color: var(--over); }
.icon-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.split { gap: 0; }
.split .btn:first-child:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; padding-left: 8px; padding-right: 9px; }

.text-entry textarea {
  width: 200px;
  height: 30px;
  padding: 5px 9px;
  font-size: 13px;
  resize: none;
}
.bar .text-input { width: 190px; margin: 0; padding: 4px 8px; }

/* Popovers opened from the bars. */
.pop {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 280px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--edge-strong);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.pop h4 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
  font: 500 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.pop .btn-row:last-child { margin-bottom: 0; }
.pop > select { margin-bottom: 4px; }
.crop-badge { text-transform: none; letter-spacing: 0; color: var(--muted); }
.crop-badge.own { color: var(--guide); }

.keys { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 12.5px; }
.keys dt { color: var(--ink); white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1;
}
.empty-card {
  max-width: 420px;
  text-align: center;
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.empty-card h2 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 26px 0 8px; line-height: 1.05; }
.empty-card p { color: var(--muted); margin: 0 0 20px; }
.empty-card .fine { font-size: 12px; margin-top: 14px; }

.empty-sticker {
  position: relative;
  width: 210px;
  height: 120px;
  margin: 0 auto;
}
.empty-sticker span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  border: 4px solid var(--paper);
  font: 600 13px var(--font-mono);
  color: var(--paper);
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
  animation: float 5s ease-in-out infinite;
}
.empty-sticker span:nth-child(1) { left: 0; top: 30px; background: #e0574a; transform: rotate(-12deg); }
.empty-sticker span:nth-child(2) { left: 52px; top: 4px; background: #3a76f0; transform: rotate(5deg); animation-delay: -1.2s; }
.empty-sticker span:nth-child(3) { left: 100px; top: 36px; background: #e8a33a; transform: rotate(-4deg); animation-delay: -2.5s; }
.empty-sticker span:nth-child(4) { left: 144px; top: 10px; background: #2b9b78; transform: rotate(11deg); animation-delay: -3.6s; }
@keyframes float { 50% { translate: 0 -6px; } }

/* ------------------------------------------------------------------ inspector */

.inspector {
  background: var(--panel);
  border-left: 1px solid var(--edge);
  overflow-y: auto;
  min-height: 0;
}

.panel { padding: 16px 18px; border-bottom: 1px solid var(--edge); }
.panel h3 {
  margin: 0 0 10px;
  font: 500 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.panel-title { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel-title h3 {
  font: 700 17px var(--font-ui);
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip {
  flex: none;
  font: 500 10.5px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(62,224,208,.12);
  color: var(--guide);
}
.meta { margin: 4px 0 0; color: var(--muted); font: 11.5px/1.5 var(--font-mono); }
.sub-head {
  margin: 16px 0 4px;
  font: 500 10.5px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.field { display: block; margin: 10px 0; }
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.field-label output { font: 11.5px var(--font-mono); color: var(--ink); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.field-pair .check { grid-column: 1 / -1; }

select, input[type='number'] {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--edge-strong);
  background: var(--panel-raised);
}
input[type='number'] { font-family: var(--font-mono); font-size: 12.5px; }
select:focus-visible, input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.num-sm { width: 70px !important; padding: 4px 8px !important; }
.unit { font: 11.5px var(--font-mono); color: var(--muted); }

input[type='range'] { width: 100%; accent-color: var(--accent); margin: 2px 0; }
input[type='color'] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--edge-strong);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
input[type='checkbox'] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

.check { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; cursor: pointer; }
.check-inline { display: flex; align-items: center; gap: 8px; }
.check-inline .check { flex: 1; }

.guide-list { list-style: none; margin: 8px 0 0; padding: 0; }
.guide-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font: 12px var(--font-mono);
  color: var(--muted);
}
.guide-list label { display: flex; align-items: center; gap: 6px; flex: 1; }
.guide-axis { color: var(--guide); width: 12px; text-align: center; }

.note { font-size: 12px; margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; }
.note.warn { background: rgba(255,206,84,.1); color: var(--amber); border: 1px solid rgba(255,206,84,.25); }

.signal-notes { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.signal-notes summary { cursor: pointer; color: var(--ink); }
.signal-notes ul { padding-left: 18px; margin: 8px 0 0; }
.signal-notes li { margin: 4px 0; }
.signal-notes b { color: var(--ink); }

.preview {
  position: relative;
  aspect-ratio: 1;
  margin: 12px 0 10px;
  border-radius: var(--radius);
  border: 4px solid var(--paper);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.preview canvas, .preview img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.preview.unrendered canvas { opacity: .55; }
.preview.stale img { opacity: .6; }
.result-size { font: 600 15px var(--font-mono); }
.result-size.ok { color: var(--ok); }
.result-size.over { color: var(--over); }
.result-size.stale { opacity: .55; }

/* ------------------------------------------------------------------ text layers */

.text-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.text-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--panel-raised);
  cursor: pointer;
  text-align: left;
}
.text-layer:hover { border-color: var(--edge-strong); }
.text-layer.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.text-layer .glyph {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-weight: 800;
  font-size: 13px;
  -webkit-text-stroke: 1px #111;
}
.text-layer .snippet { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.text-layer .snippet.empty { color: var(--muted); font-style: italic; }

textarea, .text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--edge-strong);
  background: var(--panel-raised);
  color: var(--ink);
  font: 14px/1.35 var(--font-ui);
  resize: vertical;
}
.text-input { margin-top: 2px; font-size: 13px; }
textarea:focus-visible, .text-input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }

.color-row { display: flex; gap: 16px; margin: 10px 0 2px; }
.color-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }

.seg { display: inline-flex; border: 1px solid var(--edge-strong); border-radius: 999px; overflow: hidden; }
.seg button {
  padding: 4px 10px;
  border: 0;
  background: var(--panel-raised);
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--edge); }
.seg button:hover:not(.active) { background: #1b302b; }
.seg button.active { background: var(--accent); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; }

/* ------------------------------------------------------------------ overlays */

.drop-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 22, 19, .72);
  backdrop-filter: blur(3px);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.drop-overlay div {
  padding: 40px 56px;
  border: 3px dashed var(--guide);
  border-radius: 24px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  transform: scale(.96);
  transition: transform .2s;
}
body.dropping .drop-overlay { opacity: 1; }
body.dropping .drop-overlay div { transform: scale(1) rotate(-1deg); }

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
}
.toast {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: #1d2a26;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2);
  transition: opacity .5s, transform .5s;
}
.toast.error { background: var(--over); color: #fff; }
.toast.leaving { opacity: 0; transform: translateX(20px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------------ narrow screens */

@media (max-width: 1000px) {
  body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .tagline { white-space: normal; }
  .pack-stats { order: 3; margin-left: 0; width: 100%; }
  .layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .tray { min-width: 0; border-right: 0; border-bottom: 1px solid var(--edge); }
  .tray-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .tile { flex: none; width: 200px; }
  .stage { height: min(92vh, 820px); }
  .dock { min-height: 0; }
  .inspector { border-left: 0; }
  .preview { max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
