/* ============================================================
   StoreVisuals — UI stylesheet (dark editor theme)
   ============================================================ */

:root {
  /* StoreVisuals brand: paper surfaces, ink type, one coral accent — same as the site */
  --bg: #f7f5f0;               /* paper — oklch(0.97 0.007 85) */
  --panel: #ffffff;
  --panel-2: #f1efe8;
  --panel-3: #e7e4dc;
  --border: rgba(25, 21, 16, 0.1);
  --border-strong: rgba(25, 21, 16, 0.18);
  --text: #191510;             /* ink */
  --text-dim: #67635d;
  --text-faint: #8f8a81;
  --accent: #fb6c2b;           /* coral — oklch(0.70 0.19 42) */
  --accent-2: #ee5e23;         /* coral stroke — oklch(0.66 0.19 40) */
  --accent-soft: #ff935a;      /* highlight — oklch(0.78 0.16 45) */
  --accent-grad: #fb6c2b;      /* brand rule: flat coral, never a gradient */
  --cta-text: #1d0d07;
  --danger: #f87171;
  --success: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 24px 64px rgba(40, 30, 20, 0.22);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', var(--font);
}

/* brand mark — two overlapping device frames at ±11° (back ink/paper, front coral) */
.brand-mark { position: relative; display: inline-block; }
.brand-mark i { position: absolute; border: 2.5px solid var(--text); border-radius: 6px; }
.brand-mark i:first-child { left: 0; transform: rotate(-11deg); }
.brand-mark i:last-child { right: 0; border-color: var(--accent-2); transform: rotate(11deg); }
.brand-mark-lg { width: 52px; height: 44px; }
.brand-mark-lg i { top: 3px; width: 33px; height: 36px; border-width: 4px; border-radius: 9px; }
.brand-mark-sm { width: 22px; height: 19px; }
.brand-mark-sm i { top: 1px; width: 14px; height: 15px; border-width: 2px; border-radius: 4px; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--font); color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: var(--font); }

.hidden { display: none !important; }
.hidden-input { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ============ scrollbars ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(25,21,16,0.16); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(25,21,16,0.28); background-clip: content-box; border: 2px solid transparent; }

/* ============================================================
   WELCOME
   ============================================================ */
.welcome {
  position: fixed; inset: 0;
  overflow-y: auto;
  z-index: 50;
  background: var(--bg);
}

.welcome-bg {
  position: fixed; inset: -20%;
  background:
    radial-gradient(40% 50% at 18% 15%, rgba(251, 108, 43, 0.1), transparent 70%),
    radial-gradient(35% 45% at 85% 25%, rgba(255, 147, 90, 0.07), transparent 70%),
    radial-gradient(45% 55% at 55% 90%, rgba(238, 94, 35, 0.05), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: drift 24s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

.welcome-inner {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 7vh 32px 60px;
}

.welcome-brand { text-align: center; margin-bottom: 44px; }
.welcome-brand .brand-mark-lg { margin-bottom: 18px; }
.welcome-brand h1 { font-family: var(--display); font-size: 42px; font-weight: 700; letter-spacing: -0.025em; }
.welcome-brand h1 span { color: var(--accent); }
.tagline { color: var(--text-dim); margin-top: 12px; font-size: 16px; max-width: 560px; margin-inline: auto; line-height: 1.5; }

.welcome-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 52px;
}

.wcard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.wcard:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--panel-2); }
.wcard-icon { font-size: 26px; margin-bottom: 14px; }
.wcard-blank .wcard-icon { color: #a5b4fc; }
.wcard-title { font-family: var(--display); font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.wcard-sub { color: var(--text-faint); font-size: 13px; }
.wcard-template { border-color: rgba(251, 108, 43, 0.35); }
.wcard-template:hover { border-color: rgba(251, 108, 43, 0.6); }

.welcome-recent h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.welcome-recent .muted { color: var(--text-faint); font-weight: 400; font-size: 13px; }

.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.recent-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.recent-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.recent-thumb { height: 130px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.recent-thumb-empty { font-size: 30px; opacity: 0.4; }
.recent-meta { padding: 10px 12px; }
.recent-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sub { color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
.recent-del {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px;
  opacity: 0; transition: opacity 0.15s;
}
.recent-card:hover .recent-del { opacity: 1; }
.recent-del:hover { background: var(--danger); }

.welcome-foot { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 56px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(25, 21, 16, 0.35); backdrop-filter: blur(6px); }
.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  max-height: min(82vh, 900px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-wide { width: min(1060px, calc(100vw - 48px)); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}
.modal-foot-btns { display: flex; gap: 10px; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

/* template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: max-content;
  gap: 16px;
  padding: 20px 22px 26px;
  overflow-y: auto;
  min-height: 0;
}
.template-card { min-height: 250px; }
.template-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
  padding-bottom: 14px;
}
.template-card:hover { border-color: rgba(251, 108, 43, 0.55); transform: translateY(-2px); }
.template-preview {
  height: 190px;
  background: #edeae3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}
.template-preview img { height: 100%; width: 100%; object-fit: contain; }
.tpl-loading { color: var(--text-faint); font-size: 12.5px; }
.template-name { font-weight: 700; font-size: 14.5px; padding: 0 14px; }
.template-desc { color: var(--text-faint); font-size: 12.5px; padding: 3px 14px 0; }

/* ============================================================
   TOPBAR
   ============================================================ */
.editor { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-center { display: flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }

.logo-btn { font-size: 20px; width: 34px; height: 34px; border-radius: 9px; }
.logo-btn:hover { background: var(--panel-3); }

.project-name {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px; font-weight: 600;
  padding: 6px 10px;
  width: 220px;
  transition: border-color 0.15s, background 0.15s;
}
.project-name:hover { background: var(--panel-2); }
.project-name:focus { outline: none; border-color: var(--accent); background: var(--panel-2); }

.autosave-dot { color: var(--text-faint); font-size: 9px; transition: color 0.3s; }
.autosave-dot.saved { color: var(--success); }

.tool-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 16px;
}
.tool-btn svg { width: 17px; height: 17px; }
.tool-btn:hover { background: var(--panel-3); color: var(--text); }
.tool-btn.disabled { opacity: 0.35; pointer-events: none; }

.sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 6px; }

.zoom-group { display: flex; align-items: center; background: var(--panel-2); border-radius: 9px; padding: 2px; }
.zoom-label { font-size: 12px; color: var(--text-dim); min-width: 48px; text-align: center; padding: 5px 4px; border-radius: 7px; }
.zoom-label:hover { background: var(--panel-3); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--panel-2); border-color: var(--border); color: var(--text-dim); }
.btn.ghost:hover { background: var(--panel-3); color: var(--text); border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent);
  color: var(--cta-text);
  box-shadow: 0 4px 18px rgba(251, 108, 43, 0.3);
}
.btn.primary:hover { background: var(--accent-soft); }

/* ============================================================
   EDITOR LAYOUT
   ============================================================ */
.editor-main { display: flex; flex: 1; min-height: 0; }

/* ---------- slides rail ---------- */
.slides-rail {
  width: 150px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint);
}
.rail-count { background: var(--panel-3); border-radius: 20px; padding: 1px 8px; font-size: 11px; }

.slides-list { flex: 1; overflow-y: auto; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 10px; }

.slide-item {
  position: relative;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s;
}
.slide-item:hover { border-color: rgba(251, 108, 43, 0.4); }
.slide-item.active { border-color: var(--accent); }
.slide-item.dragging { opacity: 0.4; }
.slide-item.dragover { border-color: var(--accent-2); }

.slide-thumb {
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  aspect-ratio: 9 / 19.5;
  display: flex; align-items: center; justify-content: center;
}
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.slide-label {
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.slide-label > span:first-child {
  background: rgba(0, 0, 0, 0.6);
  color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px;
  backdrop-filter: blur(4px);
}
.slide-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.slide-item:hover .slide-actions { opacity: 1; }

.mini-btn {
  min-width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #ddd; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 0 4px;
}
.mini-btn:hover { background: var(--accent); color: #fff; }
.mini-btn.danger:hover { background: var(--danger); }

.add-slide {
  margin: 8px 12px 12px;
  padding: 9px;
  border-radius: 9px;
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.add-slide:hover { border-color: var(--accent); color: var(--text); background: rgba(251, 108, 43, 0.08); }

/* ---------- stage ---------- */
.stage-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(251, 108, 43, 0.06), transparent 60%),
    #efece5;
  overflow: hidden;
}
.stage-wrap.dropping::after {
  content: 'Drop screenshot here';
  position: absolute; inset: 12px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: var(--accent);
  background: rgba(251, 108, 43, 0.08);
  pointer-events: none;
  z-index: 5;
}
#stage { display: block; position: absolute; inset: 0; touch-action: none; }

.canvas-size-chip {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(247, 245, 240, 0.9);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.stage-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  color: var(--text-faint); font-size: 12px;
  pointer-events: none;
}

.text-editor {
  position: absolute;
  z-index: 10;
  background: rgba(10, 10, 16, 0.25);
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  padding: 8px;
  resize: none;
  overflow: hidden;
  outline: none;
  backdrop-filter: blur(1px);
}

/* ---------- inspector ---------- */
.inspector {
  width: 292px;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
}

.inspector-tabs {
  display: flex;
  padding: 10px 12px 0;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.itab {
  flex: 1;
  padding: 8px 4px 10px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.itab:hover { color: var(--text-dim); }
.itab.active { color: var(--text); border-bottom-color: var(--accent); }

.inspector-body { flex: 1; overflow-y: auto; padding: 14px 14px 40px; }

.isec { margin-bottom: 20px; }
.isec-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.isec-subtitle { font-size: 11.5px; font-weight: 600; color: var(--text-faint); margin: 12px 0 8px; }
.isec-divider { height: 1px; background: var(--border); margin: 14px 0; }

.irow { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.irow-label { width: 76px; flex-shrink: 0; font-size: 12px; color: var(--text-dim); }
.irow-control { flex: 1; min-width: 0; }

.hint-text { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; margin-top: 8px; }

/* sliders */
.slider-wrap { display: flex; align-items: center; gap: 8px; }
.slider-wrap input[type='range'] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--panel-3);
  outline: none;
}
.slider-wrap input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}
.slider-wrap input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider-val { font-size: 11px; color: var(--text-faint); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* color input */
.color-wrap { display: flex; align-items: center; gap: 8px; }
.color-wrap input[type='color'] {
  width: 30px; height: 30px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: none; cursor: pointer; padding: 2px;
}
.color-wrap input[type='color']::-webkit-color-swatch-wrapper { padding: 2px; }
.color-wrap input[type='color']::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-text {
  flex: 1; width: 70px;
  background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 12px;
  padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}
.color-text:focus { outline: none; border-color: var(--accent); }

/* select */
.iselect {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 12.5px;
  padding: 7px 8px;
  cursor: pointer;
}
.iselect:focus { outline: none; border-color: var(--accent); }

/* segmented */
.segmented {
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.segmented.wide { width: 100%; }
.seg {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  border-radius: 7px;
  white-space: nowrap;
}
.seg:hover { color: var(--text); }
.seg.active { background: #ffffff; color: var(--text); box-shadow: 0 1px 4px rgba(25,21,16,0.14); }

/* switch */
.switch {
  width: 38px; height: 22px;
  background: #d8d4cb;
  border-radius: 20px;
  position: relative;
  transition: background 0.18s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(25, 21, 16, 0.3);
  transition: transform 0.18s;
}
.switch.on { background: var(--accent); }
.switch.on .knob { transform: translateX(16px); }

/* swatches */
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin: 4px 0 10px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid rgba(25, 21, 16, 0.15);
  transition: transform 0.1s;
}
.swatch:hover { transform: scale(1.14); }

/* gradient presets */
.grad-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.grad-chip {
  aspect-ratio: 1.35;
  border-radius: 8px;
  border: 1px solid rgba(25, 21, 16, 0.15);
  transition: transform 0.1s;
}
.grad-chip:hover { transform: scale(1.1); }
.grad-stop { display: flex; align-items: center; gap: 6px; }

/* big buttons */
.big-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px; font-weight: 600;
  background: var(--accent);
  color: var(--cta-text);
  margin-bottom: 8px;
}
.big-btn.subtle { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); }
.big-btn.subtle:hover { background: var(--panel-3); color: var(--text); border-color: var(--border-strong); }
.big-btn.half { width: calc(50% - 4px); }
.z-btns { display: flex; gap: 8px; }

/* element head */
.el-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 16px;
}
.el-type { font-weight: 700; font-size: 13px; }
.el-head-actions { display: flex; gap: 6px; }
.el-head-actions .mini-btn { background: var(--panel-3); color: var(--text-dim); }

/* text input */
.text-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-size: 13px;
  padding: 9px 10px;
  resize: vertical;
  margin-bottom: 10px;
  line-height: 1.4;
}
.text-input:focus { outline: none; border-color: var(--accent); }

/* screenshot grid */
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shot-tile {
  aspect-ratio: 9 / 16;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--panel-2);
  position: relative;
  transition: border-color 0.12s, transform 0.12s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-faint); font-size: 11px; font-weight: 600;
}
.shot-tile span { font-size: 18px; }
.shot-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.shot-tile.active { border-color: var(--accent); }
.shot-tile.upload:hover { border-color: var(--accent); color: var(--text); }

.asset-chip {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 10px;
  font-size: 11.5px; color: var(--text-dim);
  margin: 8px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* insert grid */
.insert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.insert-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px 8px 13px;
  transition: border-color 0.13s, transform 0.13s, background 0.13s;
}
.insert-tile:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-3); }
.insert-icon { font-size: 20px; font-weight: 700; }
.insert-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }

/* layers */
.layers-list { display: flex; flex-direction: column; gap: 5px; }
.layer-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--panel-2);
  cursor: pointer;
}
.layer-item:hover { background: var(--panel-3); }
.layer-item.active { border-color: var(--accent); }
.layer-icon { width: 18px; text-align: center; font-size: 13px; }
.layer-name { flex: 1; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-item .mini-btn { background: transparent; color: var(--text-dim); font-size: 12px; }
.layer-item .mini-btn:hover { background: var(--panel-3); color: var(--text); }

/* ============================================================
   EXPORT MODAL
   ============================================================ */
.export-sec-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 16px 0 8px;
}
.export-sec-title:first-child { margin-top: 2px; }

.export-group { margin-bottom: 14px; }
.export-group-title { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: var(--text-dim); }

.export-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.export-row:hover { background: var(--panel-2); }
.export-row.checked { border-color: var(--accent); background: rgba(251, 108, 43, 0.07); }
.export-row input[type='checkbox'] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.export-row-label { display: flex; flex-direction: column; gap: 1px; }
.export-row-label strong { font-size: 13px; font-weight: 600; }
.export-row-label small { font-size: 11.5px; color: var(--text-faint); }

.export-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip-btn {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
}
.chip-btn:hover { border-color: var(--accent); color: var(--text); }

.export-summary { font-size: 12.5px; color: var(--text-dim); }

.export-progress { padding: 14px 22px 18px; border-top: 1px solid var(--border); }
.progress-track { height: 6px; background: var(--panel-3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 3px; transition: width 0.2s; }
.progress-label { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* ============================================================
   PLATFORM PREVIEW
   ============================================================ */
.preview-strip {
  display: flex;
  gap: 22px;
  padding: 22px;
  overflow-x: auto;
  align-items: flex-end;
  justify-content: safe center;
  min-height: 300px;
}
.preview-item { flex: 0 0 auto; text-align: center; }
.preview-canvas-holder {
  height: 420px;
  display: flex; align-items: center; justify-content: center;
  background: #edeae3;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 120px;
}
.preview-canvas-holder img { height: 420px; display: block; }
.preview-item .plabel { font-size: 12.5px; font-weight: 700; margin-top: 10px; }
.preview-item .psub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.preview-note {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
}

.preview-strip.overview { min-height: 0; align-items: flex-start; padding-top: 8px; }
.preview-canvas-holder.small { height: 230px; cursor: pointer; transition: border-color 0.13s, transform 0.13s; }
.preview-canvas-holder.small:hover { border-color: var(--accent); transform: translateY(-2px); }
.preview-canvas-holder.small img { height: 230px; }
.overview-item { flex: 0 0 auto; text-align: center; }
.overview-title {
  padding: 14px 22px 0;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* layout toggle (single vs side-by-side editing) */
#layout-toggle .layout-btn.active { background: var(--panel-3); color: var(--text); }

/* ============ edit-history panel ============ */
.topbar-center { position: relative; }
.history-panel {
  position: absolute;
  top: 42px; left: 50%; transform: translateX(-50%);
  width: 270px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  padding: 8px;
}
.history-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 6px 10px 8px;
}
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
}
.history-item:hover { background: var(--panel-3); }
.history-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-time { color: var(--text-faint); font-size: 11px; flex-shrink: 0; }
.history-empty { padding: 10px; color: var(--text-faint); font-size: 12.5px; }
.history-foot { padding: 8px 10px 4px; color: var(--text-faint); font-size: 11px; line-height: 1.4; border-top: 1px solid var(--border); margin-top: 6px; }

/* custom export size inputs */
.custom-size-inputs { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.num-input {
  width: 62px;
  background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 12px;
  padding: 6px 7px;
  font-variant-numeric: tabular-nums;
}
.num-input:focus { outline: none; border-color: var(--accent); }
.x-sep { color: var(--text-faint); font-size: 12px; }

/* ============================================================
   TOASTS
   ============================================================ */
#toast-holder {
  position: fixed;
  bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(40, 30, 20, 0.25);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(52, 211, 153, 0.5); }
.toast-error { border-color: rgba(248, 113, 113, 0.6); }
.toast-warn { border-color: rgba(251, 191, 36, 0.55); }

/* ============================================================
   RESPONSIVE GUARDS
   ============================================================ */
@media (max-width: 1100px) {
  .welcome-actions { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
  .template-grid { grid-template-columns: 1fr; }
}

/* welcome card glyphs — brand chrome carries no emoji */
.wcard-icon { color: var(--text-dim); }
.wcard-icon-coral { color: var(--accent); }
.wcard-blank .wcard-icon { color: var(--accent-soft); }

/* welcome wordmark links back to the marketing site */
.welcome-home-link { display: block; color: inherit; text-decoration: none; transition: opacity 0.15s; }
.welcome-home-link:hover { opacity: 0.8; }
