:root {
  color-scheme: dark;
  --bg: #08080a;
  --panel: #101013;
  --panel-2: #151519;
  --panel-3: #1b1b20;
  --line: #26262c;
  --line-soft: #1e1e24;
  --text: #f4f1ea;
  --muted: #9b978e;
  --dim: #6d6a64;
  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, .14);
  --accent-2: #ffb02e;
  --ok: #4ecf8b;
  --warn: #ffb02e;
  --danger: #ff5c5c;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

svg { display: block; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

.topbar {
  flex: 0 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #111114 0%, #0c0c0f 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 30px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(255, 77, 46, .55));
  flex: 0 0 auto;
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-text strong {
  font-size: 17px;
  letter-spacing: -.01em;
}
.brand-text span {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.engine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .03);
}
.engine[data-state="loading"] .engine-dot { background: var(--accent-2); animation: pulse 1.2s ease-in-out infinite; }
.engine[data-state="ready"] .engine-dot { background: var(--ok); box-shadow: 0 0 8px rgba(78, 207, 139, .7); }
.engine[data-state="error"] { color: var(--danger); border-color: rgba(255, 92, 92, .35); }
.engine[data-state="error"] .engine-dot { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .08s ease, opacity .15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--panel-3); border-color: #34343c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: default; transform: none; }
.btn:disabled:hover { background: var(--panel-2); border-color: var(--line); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #140702;
  font-weight: 650;
  box-shadow: 0 0 20px rgba(255, 77, 46, .22);
}
.btn-primary:hover { background: #ff6045; border-color: #ff6045; }

.btn-ghost { background: transparent; }
.btn-ghost.is-active {
  background: var(--accent-soft);
  border-color: rgba(255, 77, 46, .5);
  color: #ffb7a7;
}
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }

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

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line-soft);
  background: var(--panel);
}

.dropzone {
  margin: 14px 14px 10px;
  padding: 18px 14px;
  border: 1.5px dashed #36363f;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  color: var(--muted);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  user-select: none;
}
.dropzone svg { width: 22px; height: 22px; margin-bottom: 3px; color: var(--accent); }
.dropzone span { color: var(--text); font-weight: 550; font-size: 13.5px; }
.dropzone small { font-size: 11.5px; color: var(--dim); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over {
  border-color: var(--accent);
  background: rgba(255, 77, 46, .06);
  outline: none;
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.library-head .count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0;
}

.photo-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: #33333b transparent;
}
.photo-list::-webkit-scrollbar { width: 8px; }
.photo-list::-webkit-scrollbar-thumb { background: #2c2c34; border-radius: 99px; }

.photo-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.photo-item:hover { background: rgba(255, 255, 255, .035); }
.photo-item.is-active {
  background: rgba(255, 77, 46, .09);
  border-color: rgba(255, 77, 46, .32);
}

.thumb {
  position: relative;
  width: 58px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 7px;
  overflow: hidden;
  background: #1d1d22;
  border: 1px solid rgba(255, 255, 255, .06);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb .thumb-state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: #17171c;
}
.photo-item.is-loading .thumb img { display: none; }
.photo-item.is-loading .thumb .thumb-state { display: flex; }
.photo-item.has-error .thumb .thumb-state { display: flex; color: var(--danger); background: rgba(255, 92, 92, .08); }

.meta { min-width: 0; flex: 1 1 auto; }
.meta .name {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta .sub {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta .sub .ok { color: var(--muted); }
.meta .sub .warn { color: var(--warn); }
.meta .sub .bad { color: var(--danger); }

.photo-item .remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
}
.photo-item:hover .remove, .photo-item:focus-within .remove { opacity: 1; }
.photo-item .remove:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

.sidebar-bottom {
  flex: 0 0 auto;
  border-top: 1px solid var(--line-soft);
}

.sidebar-foot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 16px 8px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
}
.sidebar-foot svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--muted); }

.oss-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 77, 46, .35);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 77, 46, .13), rgba(255, 77, 46, .03));
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.oss-link:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 77, 46, .2), rgba(255, 77, 46, .06));
}
.oss-link:active { transform: translateY(1px); }
.oss-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.oss-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent); }
.oss-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.oss-text strong { font-size: 12.5px; font-weight: 650; letter-spacing: .01em; }
.oss-text small {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oss-arrow { width: 14px; height: 14px; flex: 0 0 auto; margin-left: auto; color: var(--accent-2); }

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

.stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(255, 77, 46, .055), transparent 70%),
    var(--bg);
}

.empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  gap: 4px;
}
.empty-art {
  position: relative;
  width: 190px;
  height: 110px;
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 18px;
}
.empty-art svg { position: relative; width: 150px; height: 80px; z-index: 1; filter: drop-shadow(0 0 26px rgba(255, 77, 46, .55)); }
.empty-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(closest-side, rgba(255, 77, 46, .17), transparent 72%);
  filter: blur(8px);
}
.empty h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.02em;
  font-weight: 650;
}
.empty p {
  margin: 6px 0 20px;
  max-width: 430px;
  color: var(--muted);
  font-size: 14px;
}
.empty-note {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--dim);
  text-transform: uppercase;
}

.empty.is-over {
  outline: 2px dashed rgba(255, 77, 46, .5);
  outline-offset: -22px;
  border-radius: 18px;
}

/* ---------- editor ---------- */

.editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(16, 16, 19, .75);
  backdrop-filter: blur(10px);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  gap: 2px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  padding: 6px 12px;
  border-radius: 7px;
  transition: background .14s ease, color .14s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.toolbar-cover {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.toolbar-cover .select { height: 32px; }

.canvas-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 22px;
  scrollbar-width: thin;
  scrollbar-color: #33333b transparent;
}
.canvas-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.canvas-scroll::-webkit-scrollbar-thumb { background: #2c2c34; border-radius: 99px; }

.canvas-box {
  position: relative;
  display: inline-block;
  line-height: 0;
  margin: auto;
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .055);
  background: #000;
}
.canvas-box canvas {
  display: block;
  width: auto;
  height: auto;
  border-radius: 6px;
}
.canvas-box.adding canvas { cursor: crosshair; }

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 6px;
  overflow: hidden;
}
.overlay.is-hidden { display: none; }
.canvas-box.adding .marker { pointer-events: none; }

.marker {
  position: absolute;
  pointer-events: auto;
  border-radius: 44% / 46%;
  border: 2px solid rgba(255, 77, 46, .92);
  background: rgba(255, 77, 46, .10);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .35),
    0 0 22px rgba(255, 77, 46, .30),
    inset 0 0 0 1px rgba(0, 0, 0, .22);
  padding: 0;
  touch-action: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.marker:hover {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .4),
    0 0 30px rgba(255, 77, 46, .55),
    inset 0 0 0 1px rgba(0, 0, 0, .25);
  background: rgba(255, 77, 46, .16);
}
.marker.is-off {
  border: 2px dashed rgba(255, 255, 255, .48);
  background: rgba(0, 0, 0, .05);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.marker.is-off:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .75);
}

.marker .marker-num {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-38%, -38%);
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #180702;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.marker.is-off .marker-num {
  background: #3a3a43;
  color: #c9c6be;
}
.marker.is-manual .marker-num { border-radius: 6px; }

.add-dot {
  position: absolute;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(255, 77, 46, .9);
  pointer-events: none;
  animation: dotin .15s ease-out;
}
@keyframes dotin { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.canvas-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 8, 10, .82);
  color: var(--muted);
  font-size: 13px;
  border-radius: 6px;
  z-index: 5;
  line-height: 1.4;
}
.canvas-loading.is-on { display: flex; }

.canvas-scroll.is-zoomed { cursor: grab; }
.canvas-scroll.is-panning { cursor: grabbing; }

/* vertical zoom rail */
.zoom-rail {
  position: absolute;
  right: 14px;
  top: 46%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 16, 19, .84);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  user-select: none;
}
.zoom-cap {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
}
.zoom-track {
  position: relative;
  width: 22px;
  height: 150px;
  cursor: pointer;
  touch-action: none;
}
.zoom-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #35353d;
}
.zoom-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(255, 77, 46, .2);
  transition: box-shadow .12s ease;
}
.zoom-track:hover .zoom-thumb,
.zoom-track:focus-visible .zoom-thumb {
  box-shadow: 0 0 0 4px rgba(255, 77, 46, .32);
}
.zoom-track:focus-visible { outline: none; }
.zoom-rail output {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  cursor: pointer;
}
.zoom-rail output:hover { color: var(--text); }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- status + settings ---------- */

.statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 9px;
  min-height: 30px;
}
.hint {
  font-size: 11.5px;
  color: var(--dim);
  max-width: 62ch;
}
.hint.is-hot { color: var(--accent-2); }

.summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.summary .sum-warn { color: var(--warn); }
.summary .sum-zero { color: var(--dim); }
.summary .linkbtn {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-family: var(--sans);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.summary .linkbtn:hover { color: #ffd08a; }

.settings {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
.setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.setting > span { min-width: 48px; }
.setting output {
  width: 42px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 98px;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 77, 46, .55), #35353d);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--text);
  border: 0;
  box-shadow: 0 0 0 3px rgba(255, 77, 46, .18);
}
input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: #35353d;
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.select {
  height: 30px;
  padding: 0 27px 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background-color: var(--panel-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239b978e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
  color: var(--text);
  font-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.select:hover { border-color: #34343c; }
.select:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* ---------- progress + toasts ---------- */

.progress {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(22, 22, 27, .95);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  font-size: 12.5px;
  color: var(--text);
  z-index: 50;
  backdrop-filter: blur(8px);
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #1a1a1f;
  border: 1px solid #303038;
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
  animation: toastin .18s ease-out;
}
.toast.out { opacity: 0; transform: translateY(4px); transition: .25s ease; }
.toast button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 0;
}
@keyframes toastin {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */

@media (max-width: 800px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 42dvh;
  }
  .dropzone { margin: 10px 12px 6px; padding: 12px; }
  .photo-item .remove { opacity: .55; }
  .stage { min-height: 58dvh; }
  .canvas-scroll { padding: 12px; }
  .settings { gap: 14px; }
  .brand-text span { display: none; }
  .engine { display: none; }
}

@media (max-width: 560px) {
  .toolbar { gap: 8px; padding: 8px 10px; }
  .toolbar-actions { gap: 6px; }
  .btn { height: 34px; padding: 0 10px; font-size: 12.5px; }
  .btn svg { width: 15px; height: 15px; }
  .setting > span { min-width: 44px; }
  input[type="range"] { width: 84px; }
  .statusbar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hint { font-size: 11px; }
}

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