/* ===== Design tokens ===== */
:root, [data-theme="light"] {
  --bg: #ffffff;
  --surface-0: #ffffff;
  --surface-1: #f5f5f5;
  --surface-2: #ebebeb;
  --surface-3: #e0e0e0;
  --border: #e6e6e6;
  --border-strong: #d4d4d4;
  --text-0: #1e1e1e;
  --text-1: #333333;
  --text-2: #757575;
  --text-3: #b3b3b3;
  --accent: #4E4CDB;
  --accent-2: #3831a6;
  --accent-soft: #edecfc;
  --success: #14ae5c;
  --warn: #f5a623;
  --danger: #f24822;
  --info: #4E4CDB;
  --step-green: #4E4CDB;
  --step-track: #e6e6e6;

  --canvas-bg: #f3f3f3;
  --canvas-dot: rgba(0,0,0,.035);
  --artboard-shadow: 0 2px 10px rgba(0,0,0,.04);
  --topbar-bg: #ffffff;
  --shell-tint: rgba(78,76,219,.05);

  --radius-sm: 3px;
  --radius: 5px;
  --radius-lg: 13px;
  --radius-xl: 13px;

  --shadow-1: 0 0 0 1px rgba(0,0,0,.05);
  --shadow-2: 0 2px 10px rgba(0,0,0,.10), 0 0 0 0.5px rgba(0,0,0,.06);
  --shadow-pop: 0 8px 30px rgba(0,0,0,.16), 0 0 0 0.5px rgba(0,0,0,.08);

  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  /* System numbers use the same Pretendard sans stack (no monospace) — only the user
     text-layer "폰트 변경" option exposes alternate typefaces. */
  --font-mono: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ===== App shell ===== */
.app {
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}
/* Figma-style editor: no top bar — chrome lives in panel corners + floating toolbar */
.app--editor { grid-template-rows: minmax(0, 1fr); }

/* Top bar */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  position: relative;
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; min-width: 0;
}

/* Figma-style logo button (mark + name + caret) */
.logo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: default;
  padding: 4px 7px 4px 5px; border-radius: 6px;
  font-family: inherit; color: var(--text-0); flex-shrink: 0;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #4E4CDB, #8785ec);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: white; flex-shrink: 0;
}
.brand-name { font-size: 13px; font-weight: 600; }
.logo-caret { color: var(--text-3); margin-left: -3px; }

/* Vertical divider used in both header zones */
.topbar-divider {
  width: 1px; height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

/* File-name block (Figma "제목 없음 / 초안") */
.file-block {
  display: inline-flex; align-items: center;
  min-width: 0;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  background: transparent; border: 0; font-family: inherit; text-align: left;
  transition: background .12s;
}
.file-block:hover, .file-block.is-open { background: var(--surface-1); }

/* Account dropdown (opened from file name) */
.file-block-wrap { position: relative; }
.acct-backdrop { position: fixed; inset: 0; z-index: 200; }
.acct-menu {
  position: absolute;
  top: calc(100% + 8px); left: 0;
  z-index: 201;
  width: 268px;
  background: #1f1f22;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0,0,0,.42);
  padding: 6px;
  color: #fff;
  animation: acctPop .14s ease-out;
}
@keyframes acctPop { from { opacity: 0; transform: translateY(-4px); } }
.acct-head { padding: 11px 12px 12px; }
.acct-name-row { display: flex; align-items: center; gap: 8px; }
.acct-name { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.acct-role {
  font-size: 10.5px; font-weight: 600;
  padding: 1.5px 8px; border-radius: 99px;
  background: rgba(78,76,219,.22); color: #b3b1f2;
}
.acct-role.is-user { background: rgba(124,92,255,.24); color: #b6a4ff; }
.acct-team { font-size: 12px; color: rgba(255,255,255,.66); margin-top: 6px; }
.acct-email { font-size: 12px; color: rgba(255,255,255,.46); margin-top: 2px; }
.acct-sep { height: 1px; background: rgba(255,255,255,.09); margin: 5px 0; }
.acct-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0;
  color: rgba(255,255,255,.92);
  font-family: inherit; font-size: 13px;
  padding: 9px 10px; border-radius: 8px;
  cursor: pointer;
}
.acct-item:hover { background: rgba(255,255,255,.08); }
.acct-item svg { color: rgba(255,255,255,.7); flex-shrink: 0; }
.file-name-row { display: flex; align-items: center; gap: 4px; }
.file-name {
  font-size: 12.5px; font-weight: 600; color: var(--text-0);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-caret { color: var(--text-3); }
.file-status { font-size: 10.5px; color: var(--text-2); font-weight: 400; }

/* Right cluster — collaborator avatar + present */
.avatar-btn {
  display: inline-flex; align-items: center; gap: 3px;
  background: transparent; border: 0; cursor: pointer;
  padding: 2px 4px 2px 2px; border-radius: 99px; flex-shrink: 0;
}
.avatar-btn:hover { background: var(--surface-1); }
.avatar-btn .avatar-dot {
  width: 24px; height: 24px; border-radius: 99px;
  background: linear-gradient(135deg, #ff8a5b, #ff5470);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
}
.avatar-btn > svg { color: var(--text-3); }

.present-btn {
  display: inline-flex; align-items: center; gap: 3px;
  height: 30px; padding: 0 8px;
  background: transparent; border: 0; border-radius: 6px;
  cursor: pointer; color: var(--text-1); flex-shrink: 0;
}
.present-btn:hover { background: var(--surface-1); color: var(--text-0); }
.present-btn .play-ic { color: var(--text-1); }
.present-btn .caret { color: var(--text-3); }

.mode-switch {
  display: flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid transparent;
  padding: 3px;
  border-radius: 8px;
}
.mode-switch button {
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.mode-switch button:hover:not(.is-active) { background: rgba(0,0,0,.04); }
.mode-switch button.is-active {
  background: var(--surface-0);
  color: var(--text-0);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04);
}

.topbar-right {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}
.platform-select {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  color: var(--text-1);
  cursor: pointer;
  white-space: nowrap;
}
.platform-dot { width: 8px; height: 8px; border-radius: 99px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text-0); }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
  font-weight: 500;
}
.btn.primary:hover { background: var(--accent-2); color: white; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { font-size: 11px; height: 24px; padding: 0 7px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255,84,112,.08); }

/* Inspector delete (layer / group) buttons — neutral gray, darken on hover */
.panel.right .btn.ghost.danger { color: #757575; }
.panel.right .btn.ghost.danger:hover { color: #1e1e1e; background: #f3f3f3; }

/* Layer-item visibility / lock buttons darken on hover */
.layer-item .vis:hover,
.layer-item .lock:hover { color: #1e1e1e !important; }

/* Left-panel section-header (add) buttons hover background */
.panel.left .panel-title .btn.ghost:hover { background: #f3f3f3; }

/* ===== Admin workspace ===== */
.workspace {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  height: 100%;
  min-height: 0;
}
.panel {
  background: var(--surface-0);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel.left { border-right: 1px solid var(--border); overflow-y: auto; overscroll-behavior: contain; }
.panel.right { border-left: 1px solid var(--border); overflow: hidden; }
/* 짧은 모니터에서 레이어 목록이 0으로 찌부되지 않도록 최소 높이 확보 — 부족분은 패널 자체 스크롤 */
.panel.left .panel-section.scroll { min-height: 120px; }
/* 우측 인스펙터: 헤더(탭 + 제목 + 위치) 고정, [크기]부터 본문만 스크롤 */
.panel.right .ri-head { flex: 0 0 auto; }
.panel.right .ri-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.panel.right .ri-head .panel-section:last-child { border-bottom: 1px solid var(--border); }
/* 인스펙터 패널 스크롤바 — Figma 스타일: 투명 트랙 + 얇은 회색 알약 thumb */
.panel.left::-webkit-scrollbar, .panel.right .ri-body::-webkit-scrollbar { width: 11px; background: transparent; }
.panel.left::-webkit-scrollbar-track, .panel.right .ri-body::-webkit-scrollbar-track { background: transparent; }
.panel.left::-webkit-scrollbar-thumb, .panel.right .ri-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.22); border-radius: 99px;
  border: 3px solid transparent; background-clip: padding-box;
  min-height: 32px;
}
.panel.left::-webkit-scrollbar-thumb:hover, .panel.right .ri-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.38); background-clip: padding-box; border: 3px solid transparent;
}
.panel.left::-webkit-scrollbar-thumb:active, .panel.right .ri-body::-webkit-scrollbar-thumb:active {
  background: rgba(0,0,0,.5); background-clip: padding-box; border: 3px solid transparent;
}
.panel.left, .panel.right .ri-body { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.24) transparent; }

/* Left panel action strip — 가이드 저장 + 개인화(브랜드 가이드) */
.panel-actions {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-save { justify-content: center; font-weight: 700; padding: 7px 12px; }
.panel-logo { height: 50px; padding: 0 10px; }
.right-col-actions { display: flex; align-items: center; gap: 6px; }
.brand-icon-btn {
  border: 1px solid var(--border) !important;
  background: var(--surface-1) !important;
  color: var(--text-1) !important;
  flex-shrink: 0;
}
.brand-icon-btn:hover { background: var(--surface-2) !important; border-color: var(--border-strong) !important; }
.btn.dark { background: #111111; color: #fff; border-color: #111111; }
.btn.dark:hover { background: #2a2a2a; border-color: #2a2a2a; }
/* Keep the top-bar action buttons (브랜드 아이콘 + 저장하기) the same height */
.topbar-right .btn { height: 30px; }
.topbar-right .btn.icon-only { width: 34px; }

/* Canvas column wrapper — holds the floating mode switch + canvas */
.canvas-col {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}
.canvas-col > .canvas-wrap,
.canvas-col > .canvas-wrap-empty { flex: 1; min-height: 0; }

/* Mode switch floats where the toolbar used to sit (top-center) */
.float-mode-switch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex; align-items: center; gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.float-mode-switch .tool-btn {
  gap: 6px; padding: 0 12px;
  font-size: 12.5px; font-weight: 500;
}

/* Right column wrapper — Bannerly logo header + inspector */
.right-col {
  display: flex; flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-0);
}
.right-col-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 50px;
  padding: 0 10px 0 7px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.right-col-header .brand { gap: 0; min-width: 0; }
.right-col > .panel.right {
  flex: 1; min-height: 0;
  border-left: 0;
}

.panel-section {
  border-bottom: 1px solid var(--border);
  padding: 14px 12px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.panel-section.scroll {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.panel-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-0);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title button { color: var(--text-2); }
/* Inspector section titles: keep on one line and give breathing room above fields (matches reference) */
.panel.right .panel-title { white-space: nowrap; margin-bottom: 9px; }

/* Category list */
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-1);
  position: relative;
}
.cat-item:hover { background: #F3F3F3; }
.cat-item.is-drop-cat { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.guide-ctx {
  position: fixed; z-index: 400; width: max-content; min-width: 96px;
  background: #2b2b2e; border: 1px solid rgba(255,255,255,.08); border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); padding: 5px;
  display: flex; flex-direction: column; gap: 1px;
}
.guide-ctx button {
  display: flex; align-items: center; gap: 9px;
  border: 0; background: transparent; border-radius: 6px;
  font-size: 11px; font-weight: 500; color: rgba(255,255,255,.9); padding: 0 11px; height: 26px; cursor: pointer; text-align: left;
}
.guide-ctx button svg { display: none; }
.guide-ctx .ctx-sep { height: 1px; background: rgba(255,255,255,.12); margin: 4px 0; }
.guide-ctx button:hover { background: var(--accent); color: #fff; }
.guide-ctx button svg { color: currentColor; flex-shrink: 0; }
.guide-ctx button.danger { color: rgba(255,255,255,.9); }
.guide-ctx button.danger:hover { background: var(--accent); color: #fff; }
.guide-item:hover { background: #F3F3F3; }
.cat-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-2);
}
.cat-item .swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}
.cat-color-backdrop { position: fixed; inset: 0; z-index: 220; }
.cat-color-pop {
  position: absolute; z-index: 221; top: calc(100% + 6px); left: -4px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 8px; width: max-content;
  background: var(--surface-0); border: 1px solid var(--border-strong);
  border-radius: 9px; box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.cat-color-opt {
  width: 18px; height: 18px; border-radius: 5px; padding: 0; cursor: pointer;
  border: 1px solid rgba(0,0,0,.12);
  display: grid; place-items: center;
  transition: transform .1s;
}
.cat-color-opt:hover { transform: scale(1.12); }
.cat-color-opt.is-active { outline: 2px solid var(--accent); outline-offset: 1px; }
.cat-color-custom {
  width: 18px; height: 18px; border-radius: 5px; cursor: pointer;
  border: 1px dashed rgba(0,0,0,.3); position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.cat-color-custom input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0; padding: 0;
}
.cat-item .cat-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-item .count {
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cat-item .cat-del,
.guide-item .guide-del {
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
}
/* Show on hover OR when item is active/selected */
.cat-item:hover .cat-del,
.cat-item.is-active .cat-del,
.guide-item:hover .guide-del,
.guide-item.is-active .guide-del {
  opacity: 1;
}
.cat-item .cat-del:hover,
.guide-item .guide-del:hover {
  color: #111111;
  background: #fcfcfc;
}

/* Layers */
.layer-list { display: flex; flex-direction: column; gap: 6px; }
.layer-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  position: relative;
  gap: 6px;
  padding: 0 8px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-1);
  user-select: none;
}
.layer-item:hover { background: var(--surface-1); }
.layer-item.is-selected {
  background: #eef2ff;
  color: var(--text-0);
}
.layer-item .icon { color: var(--text-3); }
.layer-item .grip,
.layer-item .icon { display: inline-flex; align-items: center; justify-content: center; }
.layer-item.is-selected .icon { color: var(--accent-2); }
.layer-item .grip { color: var(--text-3); cursor: grab; }
.layer-item .vis { color: var(--text-3); }
.layer-item .vis.is-hidden { opacity: .4; }
/* lock/vis 아이콘: 기본 숨김, 호버·선택·활성(잠금/숨김) 시 노출 */
.layer-item .lock, .layer-item .vis { opacity: 0; transition: opacity .12s; }
.layer-item:hover .lock, .layer-item:hover .vis,
.layer-item.is-selected .lock, .layer-item.is-selected .vis,
.layer-item .lock.on, .layer-item .vis.on { opacity: 1; }
.layer-item.is-dragging { opacity: .4; }
.layer-item.drop-above::before,
.layer-item.drop-below::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: var(--accent); border-radius: 2px; z-index: 3; pointer-events: none;
}
.layer-item.drop-above::before { top: -4px; }
.layer-item.drop-below::after { bottom: -4px; }
.layer-item[draggable="true"] { cursor: grab; }
.layer-item[draggable="true"]:active { cursor: grabbing; }
/* 그룹 안으로 드롭(중첩) 하이라이트 */
.layer-item.drop-into {
  box-shadow: inset 0 0 0 1.5px var(--accent);
  background: var(--accent-soft, #eef2ff);
  border-radius: 5px;
}

/* ===== Canvas ===== */
.canvas-wrap {
  background: var(--canvas-bg);
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.canvas-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}
.canvas-scroll.is-panning, .canvas-scroll.is-panning * { cursor: grab !important; }
.canvas-scroll.is-panning:active, .canvas-scroll.is-panning:active * { cursor: grabbing !important; }
.canvas-scroll.is-creating, .canvas-scroll.is-creating * { cursor: crosshair !important; }
.canvas-stage {
  min-width: 100%;
  min-height: 100%;
  display: flex; align-items: safe center; justify-content: safe center;
  padding: 60px 40px;
  box-sizing: border-box;
}
.canvas-bar {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%) scale(1.2);
  transform-origin: bottom center;
  display: flex; align-items: center; gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  z-index: 5;
}
.tb-group { display: flex; align-items: center; gap: 2px; }
.tb-grid-group { position: relative; }
.tb-caret-btn {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 28px; padding: 0; margin-left: -2px;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 4px;
}
.tb-caret-btn:hover, .tb-caret-btn.is-open { color: #1e1e1e; background: #f3f3f3; }
.tb-menu-backdrop { position: fixed; inset: 0; z-index: 60; }
.tb-split-menu {
  position: absolute; z-index: 61; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: #1f1f22; border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  padding: 6px; width: max-content; min-width: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  display: flex; flex-direction: column; gap: 1px;
}
.tb-split-head { font-size: 11px; font-weight: 600; letter-spacing: .03em; color: rgba(255,255,255,.4); padding: 4px 8px 5px; }
.tb-split-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 4px; border: 0; border-radius: 6px; background: transparent;
  color: rgba(255,255,255,.88); font-size: 9px; font-weight: 500;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.tb-split-opt:hover { background: var(--accent); color: #fff; }
.tb-split-check { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.tb-split-ic { display: inline-flex; color: currentColor; }
.tb-split-label { flex: 1; }
.canvas-bar .divider {
  width: 1px; height: 20px; background: var(--border); margin: 0 4px;
}
.canvas-bar .tb-sep { margin: 0 6px; }
.tool-btn {
  background: transparent;
  border: 0;
  color: #333333;
  height: 32px; min-width: 32px;
  padding: 0 5px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  cursor: pointer;
}
.tool-btn:hover { background: #f3f3f3; color: #1e1e1e; }
.tool-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.tool-btn.is-active { background: var(--accent); color: #fff; }
/* Force hardcoded-dark icon strokes (Image/Logo/Square…) to white when the tool is active */
.tool-btn.is-active svg, .tool-btn.is-active svg * { stroke: #fff !important; }
.tb-caret { color: var(--text-3); margin-left: 1px; }
.tool-btn.is-active .tb-caret { color: rgba(255,255,255,.85); }

/* Dark tooltip (Figma-style) for toolbar buttons — shown BELOW the bar */
.tool-btn { position: relative; }
/* Figma-style tooltip: label (white) + shortcut key (dim), shown above the bar */
.tb-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 9px;
  background: #2b2b2b; color: #fff;
  font-size: 10px; font-weight: 500; line-height: 1; white-space: nowrap;
  padding: 6px 8px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 60;
}
.tb-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #2b2b2b;
}
.tb-tip { gap: 7px; }
.tb-tip-key { color: rgba(255,255,255,.5); font-weight: 500; }
.tool-btn:hover .tb-tip { opacity: 1; transition-delay: .3s; }

.canvas-meta {
  position: absolute;
  top: 10px; right: 14px;
  display: flex; gap: 6px; align-items: center;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
}
.kbd-hint {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 99px;
  box-shadow: var(--shadow-1);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}
.kbd-hint .kbd-sep { color: var(--text-3); margin: 0 4px; }

/* Banner artboard */
.artboard-name {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 7px;
  max-width: 100%;
  color: #b3b3b3; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: auto; cursor: text;
}
.artboard-name-input {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 6px;
  color: var(--accent); font-size: 11px; font-weight: 600; font-family: inherit;
  background: var(--surface-0); border: 1px solid var(--accent); border-radius: 4px;
  padding: 1px 5px; outline: none; box-sizing: border-box;
  white-space: nowrap; overflow: hidden;
}
.artboard-name-dim { color: #b3b3b3; font-weight: 500; }
.artboard-name-measure {
  position: absolute; visibility: hidden; pointer-events: none;
  left: -9999px; top: 0; white-space: pre;
  font-size: 11px; font-weight: 600; font-family: inherit;
}
.artboard-size {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 3px 8px; border-radius: 3px;
  pointer-events: none; z-index: 1;
}
.artboard {
  position: relative;
  background: white;
  box-shadow: var(--artboard-shadow);
}
.artboard-frame { position: relative; }

/* Layer in canvas */
.layer-node {
  position: absolute;
  cursor: move;
}
.layer-node.is-selected {
  outline: 1.5px solid #4e4cdb;
  outline-offset: 0;
}
.layer-node .handle, .draft-box .handle, .group-box .handle {
  position: absolute;
  width: 8px; height: 8px;
  background: white;
  border: 1.5px solid #4E4CDB;
  border-radius: 1px;
  pointer-events: auto;
}
.handle.nw { top: -4px; left: -4px; cursor: nwse-resize; }
.handle.ne { top: -4px; right: -4px; cursor: nesw-resize; }
.handle.sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.handle.se { bottom: -4px; right: -4px; cursor: nwse-resize; }

/* Corner-radius handle for shapes */
.radius-handle {
  position: absolute;
  width: 10px; height: 10px;
  background: white;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
}

.layer-node.is-locked { cursor: not-allowed; }

/* Smart guide */
.smart-guide {
  position: absolute;
  background: #E3714A;
  z-index: 999;
  pointer-events: none;
}
.smart-guide.h { height: 1px; left: 0; right: 0; }
.smart-guide.v { width: 1px; top: 0; bottom: 0; }

/* Pixel badge tooltips on selected layer */
.px-badge {
  position: absolute;
  background: var(--accent);
  color: white;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.px-badge-pos {
  top: 0; left: 0;
}
.px-badge-size {
  bottom: 0; left: 50%;
  background: #4e4cdb;
  color: white;
  bottom: auto; top: 100%;
}

/* Edge distance lines (during drag) */
.dist-line {
  position: absolute;
  background: var(--accent);
  pointer-events: none;
  z-index: 1002;
}
.dist-line.vert {
  background: repeating-linear-gradient(
    to bottom,
    var(--accent) 0 3px,
    transparent 3px 6px
  );
}
.dist-line.horiz {
  background: repeating-linear-gradient(
    to right,
    var(--accent) 0 3px,
    transparent 3px 6px
  );
}
.dist-line .dist-label {
  position: absolute;
  top: 50%; left: 50%;
  background: #DF5537;
  color: white;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  z-index: 1001;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ===== Right inspector ===== */
.row {
  display: flex; align-items: center; gap: 6px;
}
.row.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.row.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; }
.label {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid transparent;
  color: var(--text-0);
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 5px;
  outline: none;
}
.input, .select { height: 24px; padding-top: 0; padding-bottom: 0; }
.select { color-scheme: dark; }
.input:hover, .select:hover, .textarea:hover { border-color: #E5E5E5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  background: var(--surface-0);
}
.input[type="number"] { -moz-appearance: textfield; }
.input::-webkit-outer-spin-button,
.input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input.with-prefix {
  padding-left: 26px;
  padding-top: 0; padding-bottom: 0;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-0);
  border-radius: 5px;
}
.input-wrap { position: relative; }
.size-field .size-input { padding-right: 24px; }
.size-caret {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: auto; height: auto; padding: 0;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
}
.size-caret:hover { color: var(--text-1); }
.dsel-sep { height: 1px; background: rgba(255,255,255,.08); margin: 3px 0; }
.input-prefix {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
  font-weight: 500;
}
.input-suffix {
  position: absolute;
  right: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}
.input.with-suffix { padding-right: 22px; }

/* Segmented NumField — 접두 아이콘이 자체 칸을 갖는 형태(구분선 없음). 포커스 테두리는 래퍼가 담당 */
.input-wrap.seg {
  display: flex; align-items: stretch;
  height: 24px;
  background: var(--surface-1);
  border: 1px solid transparent;
  border-radius: 5px;
  overflow: hidden;
}
.input-wrap.seg:hover { border-color: #E5E5E5; }
.input-wrap.seg:focus-within { border-color: var(--accent); background: var(--surface-0); }
.input-wrap.seg .input-prefix {
  position: static; transform: none;
  flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-weight: 500; font-size: 12px;
  pointer-events: none;
}
.input-wrap.seg .input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  background: transparent; border: 0; border-radius: 0;
  padding: 0 8px 0 2px;
}
.input-wrap.seg .input-suffix {
  position: static; transform: none;
  flex: 0 0 auto;
  display: flex; align-items: center;
  padding-right: 8px; padding-left: 2px;
  color: var(--text-3); font-size: 12px; pointer-events: none;
}

.swatch-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 4px 8px 4px 4px;
  border-radius: 5px;
  width: 100%;
  cursor: pointer;
}
.swatch-btn .sw {
  width: 18px; height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.1);
}
.swatch-btn .hex {
  font-size: 11.5px;
  color: var(--text-1);
  font-family: var(--font-mono);
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 4px;
  color: var(--text-2);
}

/* segment */
.seg {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: none;
  border-radius: 5px;
  padding: 0;
}
.seg button {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  display: flex; align-items: center; justify-content: center;
}
.seg button:hover:not(.is-active) { background: rgba(0,0,0,.04); }
.align-seg { min-width: 0; }
.align-seg button { padding: 0 2px; min-width: 0; }
.align-seg button:hover { color: var(--text-0); }
.align-seg-div { width: 1px; height: 26px; align-self: center; background: #ffffff; margin: 0 2px; flex-shrink: 0; }
.seg button.is-active {
  background: #ffffff;
  color: var(--text-0);
  border-color: #E0E0E0;
}

/* tabs */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}
/* 우측 인스펙터 탭 바는 스크롤에서 제외하고 상단 고정 */
.panel.right .tabs {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-0);
}
.tabs button {
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
}
.tabs button:hover:not(.is-active) { background: rgba(0,0,0,.04); }
.tabs button.is-active {
  background: #f3f3f3;
  color: var(--text-0);
  font-weight: 600;
}

/* Zoom control in the inspector tabs row */
.zoom-ctl { margin-left: auto; display: flex; align-items: center; gap: 1px; position: relative; padding: 0 2px 0 6px; border: 1px solid transparent; border-radius: 6px; transition: background .12s, border-color .12s; }
.zoom-ctl:hover { background: #f3f3f3; }
.zoom-ctl:focus-within { background: var(--surface-0); border-color: var(--accent); }
.zoom-input {
  width: 30px; border: 0; background: transparent; outline: none;
  font-size: 12px; color: var(--text-1); font-family: var(--font-sans); text-align: right; cursor: text;
}
.zoom-pct { font-size: 12px; color: var(--text-3); }
.zoom-caret {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 22px; border: 0; background: transparent; color: var(--text-1); cursor: pointer; border-radius: 4px;
}
.zoom-caret:hover { color: #1e1e1e; }
.zoom-backdrop { position: fixed; inset: 0; z-index: 120; }
.zoom-menu {
  position: absolute; z-index: 121; top: calc(100% + 4px); right: 0;
  background: #1f1f22; border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4); padding: 6px; min-width: 120px;
  display: flex; flex-direction: column; gap: 1px;
  max-height: 260px; overflow-y: auto; scrollbar-width: none;
}
.zoom-menu::-webkit-scrollbar { width: 0; height: 0; display: none; }
.zoom-menu .zoom-opt {
  border: 0; background: transparent !important; text-align: left !important; cursor: pointer;
  font-size: 13px; color: #fff !important; font-weight: 500; padding: 8px 14px; border-radius: 7px; font-variant-numeric: tabular-nums;
}
.zoom-menu .zoom-opt:hover { background: var(--accent) !important; color: #fff !important; }
.zoom-menu .zoom-opt.is-active { background: var(--accent) !important; color: #fff !important; font-weight: 600; }

/* Empty state */
.empty {
  color: var(--text-3);
  font-size: 11.5px;
  text-align: center;
  padding: 20px 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--surface-1);
}

/* Panel empty states (for sidebar sections) */
.panel-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 22px 14px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-0);
}
.panel-empty.subtle {
  padding: 14px 12px;
  background: transparent;
  border-style: dashed;
}
.panel-empty.tall { margin: 20% 16px; padding: 28px 16px; }
.panel-empty-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  margin-bottom: 2px;
}
.panel-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
}
.panel-empty-body {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.55;
}
.panel-empty-body b { color: var(--text-0); font-weight: 600; }
.inline-add-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; vertical-align: middle; line-height: 0;
  border-radius: 5px; background: var(--surface-1); color: var(--text-1);
  border: 1px solid var(--border);
  transition: background .12s, border-color .12s;
}
.inline-add-chip svg { display: block; }
.inline-add-chip:hover { background: #f3f3f3; border-color: var(--border-strong); }

/* Canvas empty state */
.canvas-wrap-empty {
  display: grid;
  place-items: center;
  position: relative;
}
.canvas-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px;
  padding: 30px 36px;
  max-width: 360px;
  text-align: center;
}
.canvas-empty-art {
  margin-bottom: 6px;
  opacity: 0.85;
}
.canvas-empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.canvas-empty-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}
.canvas-empty-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-2);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: var(--accent-soft);
  border-radius: 99px;
  font-weight: 500;
}

/* Pulse dot — used both standalone and inside .hint-pulse */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(78,76,219,.7);
  animation: pulseDot 1.6s ease-out infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0   rgba(78,76,219,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(78,76,219,0); }
  100% { box-shadow: 0 0 0 0   rgba(78,76,219,0); }
}

/* Hint pulse — applied to the next-action button in the demo */
.hint-pulse {
  position: relative;
  animation: hintGlow 1.6s ease-out infinite;
}
.hint-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: hintRing 1.6s ease-out infinite;
}
@keyframes hintGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78,76,219,0); }
  50%      { box-shadow: 0 0 0 4px rgba(78,76,219,.18); }
}
@keyframes hintRing {
  0%   { opacity: 0.9; transform: scale(0.96); }
  100% { opacity: 0;   transform: scale(1.12); }
}

/* Sample preview (right inspector) */
.sample-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: white;
}
.sample-preview.sample-empty {
  background: #9ba1aa;
  display: grid;
  place-items: center;
  color: #ffffff;
}
.sample-empty-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.sample-empty-text {
  font-size: 11px;
  color: #ffffff;
  font-weight: 500;
}
.sample-badge {
  position: absolute;
  top: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px;
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(22,163,74,.92);
  color: white;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}

/* Icon-only buttons keep aspect square */
.btn.icon-only {
  padding: 4px;
  aspect-ratio: 1;
  justify-content: center;
}

/* Guide list item — delete button (visible on hover OR when selected) */
.guide-item { position: relative; }
.guide-item .guide-del { flex-shrink: 0; }

/* Confirm dialog */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(14, 15, 18, 0.55);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 9999;
  animation: confirmFadeIn .14s ease-out;
}
.confirm-dialog {
  position: relative;
  width: min(420px, 92vw);
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  animation: confirmPopIn .18s cubic-bezier(.2,.8,.2,1);
}
.confirm-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.confirm-close {
  flex-shrink: 0;
  margin: -2px -4px -2px 0;
}
.confirm-main {
  padding: 20px;
}
.confirm-icon {
  width: 40px; height: 40px;
  border-radius: 99px;
  background: rgba(225, 29, 72, 0.12);
  color: var(--danger);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.confirm-body { min-width: 0; }
.confirm-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
}
.confirm-message {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.confirm-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.confirm-actions .btn { padding: 7px 14px; font-size: 12.5px; font-weight: 600; }
.confirm-actions .confirm-danger {
  background: #4E4CDB;
  color: white;
  border-color: #4E4CDB;
}
.confirm-actions .confirm-danger:hover {
  background: #3831a6;
  border-color: #3831a6;
}

@keyframes confirmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes confirmPopIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ===== User flow ===== */
.user-shell {
  display: flex; flex-direction: column;
  height: 100%;
  min-width: 0;
  background: var(--bg);
}
.user-stepper {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 99px;
  background: var(--surface-1);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.step.is-active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.step.is-done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #0a1f14;
}
.step.is-active { color: var(--text-0); }
.step.is-done { color: var(--text-1); }
.step-bar {
  width: 36px; height: 1px;
  background: var(--border);
}
.step-bar.is-done { background: var(--success); }

.user-main {
  flex: 1; min-height: 0; min-width: 0;
  display: flex;
  overflow: hidden;
  position: relative;
}
.user-pane {
  flex: 1; min-height: 0; min-width: 0;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  padding: 32px 32px 100px;
}
.user-pane > * {
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
}
.user-pane.center {
  justify-content: center;
}
.user-pane.center > * {
  margin: auto;
}
.user-actionbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 40%);
  padding: 28px 32px 20px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.user-actionbar-inner {
  max-width: 1200px;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

/* Template gallery */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
}
.tpl-card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all .14s;
}
.tpl-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.tpl-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78,76,219,.18);
}
.tpl-thumb {
  width: 100%; aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}
.tpl-name {
  font-size: 13px; font-weight: 500; color: var(--text-0);
  display: flex; align-items: center; justify-content: space-between;
}
.tpl-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Upload */
.dropzone {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-0);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  padding: 24px;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(78,76,219,.04);
}
.dropzone .ico {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-1);
}

/* Processing */
.processing {
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  max-width: 420px;
  width: 100%;
}
.proc-card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  width: 100%;
}
.proc-step {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-1);
}
.proc-step .dot {
  width: 18px; height: 18px;
  border-radius: 99px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
}
.proc-step.is-done .dot {
  background: var(--success); border-color: var(--success); color: #0a1f14;
}
.proc-step.is-active .dot {
  border-color: var(--accent);
  position: relative;
}
.proc-step.is-active .dot::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 99px;
  background: conic-gradient(var(--accent) 0 60%, transparent 60% 100%);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc-step .ms { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 11px; }

.before-after {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.before-after .layer {
  position: absolute; inset: 0;
}
.ba-slider {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: white;
  cursor: ew-resize;
  z-index: 3;
}
.ba-slider::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 28px; height: 28px;
  border-radius: 99px;
  background: white;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.ba-label {
  position: absolute;
  top: 8px;
  background: rgba(0,0,0,.6);
  color: white;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Result */
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  align-items: start;
}
@media (max-width: 900px) {
  .result-grid { grid-template-columns: 1fr; }
}
.result-card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.adjust-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
}
input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 2px solid var(--surface-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ===== User Sub-navigation + Banner List + Detail ===== */
.user-subnav {
  display: flex; align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-0);
  gap: 12px;
  min-height: 52px;
}
.user-subnav.is-list {
  justify-content: space-between;
}

/* Title section in Step 2 */
.title-section {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}
.title-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: all .12s;
}
.title-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78,76,219,.12);
}
.title-input-wrap.is-error {
  border-color: var(--danger);
}
.title-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.title-input::placeholder { color: var(--text-3); font-weight: 400; }

.title-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.suggestion-chip {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.suggestion-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}
.subnav-tabs {
  display: flex; gap: 2px;
}
.subnav-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.subnav-tabs button:hover { background: var(--surface-1); color: var(--text-1); }
.subnav-tabs button.is-active {
  background: var(--surface-2);
  color: var(--text-0);
}

/* Banner list controls */
.banner-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-tabs {
  display: flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px;
}
.filter-tabs button {
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-tabs button:hover:not(.is-active) { background: rgba(0,0,0,.04); }
.filter-tabs button.is-active {
  background: var(--surface-0);
  color: var(--text-0);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04);
}
.filter-tabs .count {
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  padding: 0 5px;
  border-radius: 99px;
  min-width: 16px;
  text-align: center;
}
.filter-tabs button.is-active .count {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  height: 30px;
}
.search-wrap:hover { border-color: var(--border-strong); }
.search-wrap:focus-within { border-color: var(--accent); background: var(--surface-0); }
.search-input {
  border: 0; background: transparent; outline: none;
  font-size: 12.5px;
  color: var(--text-0);
  width: 200px;
}
.search-input::placeholder { color: var(--text-3); }

/* Banner grid */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.banner-card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all .14s;
  display: flex; flex-direction: column;
}
.banner-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.banner-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.banner-card-status {
  position: absolute;
  top: 8px; left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 2;
}
.banner-card-actions {
  position: absolute;
  bottom: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .14s;
  z-index: 2;
}
.banner-card:hover .banner-card-actions { opacity: 1; }
.banner-card-actions button {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
  display: grid; place-items: center;
  cursor: pointer;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.banner-card-actions button:hover { background: white; }

.banner-card-body {
  padding: 12px 14px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.banner-card-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banner-card-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.banner-card-meta .dot { opacity: .5; }

.banner-empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-0);
}
.banner-empty-ic {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--surface-1);
  display: grid; place-items: center;
  margin-bottom: 12px;
}

/* Banner detail */
.banner-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  width: 100%;
}
@media (max-width: 860px) {
  .banner-detail { grid-template-columns: 1fr; }
}
.banner-detail-main {
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
.banner-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.banner-status-chip {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
}
.banner-detail-preview {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
}

.banner-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.detail-stat {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.detail-stat-l {
  font-size: 10.5px;
  color: var(--text-3);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.detail-stat-v {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

/* Version timeline */
.banner-detail-side {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  align-self: flex-start;
  max-height: calc(100vh - 200px);
}
.version-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.version-list {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.version-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  position: relative;
  cursor: pointer;
}
.version-item:hover { background: var(--surface-1); }
.version-item.is-current {
  background: var(--accent-soft);
}
.version-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-2);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.version-rail {
  display: flex; flex-direction: column;
  align-items: center;
  padding-top: 4px;
}
.version-item.is-current .version-tag {
  background: var(--accent);
  color: white;
}
.version-item.is-auto .version-tag {
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 500;
}
.version-dot {
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--border-strong);
  flex-shrink: 0;
  z-index: 2;
  outline: 3px solid var(--surface-0);
}
.version-item.is-current .version-dot {
  background: var(--accent);
}
.version-item.is-auto .version-dot {
  background: var(--surface-3);
  outline-color: var(--surface-0);
}
.version-line {
  width: 1px; flex: 1;
  background: var(--border);
  margin-top: 2px;
  min-height: 12px;
}
.version-body { min-width: 0; }
.version-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
  min-width: 0;
}
.version-label {
  font-size: 12px;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.version-item.is-auto .version-label { color: var(--text-2); }
.version-meta {
  font-size: 10.5px;
  color: var(--text-3);
  display: flex; gap: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.version-meta .dot { opacity: .6; }
.version-actions {
  display: flex; gap: 4px;
  margin-top: 6px;
}
.version-current {
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(78,76,219,.08);
}
.version-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface-1);
}
.ph-product {
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(0,0,0,.18), transparent 60%),
    radial-gradient(circle at 35% 40%, rgba(255,255,255,.5), transparent 50%);
  display: grid; place-items: center;
  color: rgba(0,0,0,.35);
  font-size: 11px;
  font-weight: 600;
}

/* ===== Login ===== */
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
  background: var(--bg);
}
@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

.login-visual {
  position: relative;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.12), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.08), transparent 50%),
    linear-gradient(135deg, #2f2da8 0%, #4E4CDB 55%, #8785ec 100%);
  color: white;
  overflow: hidden;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}
.login-visual-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex; flex-direction: column;
  padding: 56px;
  box-sizing: border-box;
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.login-stat-n {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
}
.login-stat-l {
  font-size: 11.5px;
  color: rgba(255,255,255,.7);
  margin-top: 2px;
}

.login-features {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 28px;
}
.login-feature {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.92);
}
.login-feature-ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
}

/* Form pane */
.login-form-pane {
  position: relative;
  display: flex; flex-direction: column;
  padding: 56px;
  overflow-y: auto;
  background: var(--bg);
}
.login-form-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
}
.login-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.login-input {
  width: 100%;
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 10px 12px;
  font-size: 13.5px;
  border-radius: 8px;
  outline: none;
  transition: all .12s;
  box-sizing: border-box;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78,76,219,.15);
}
.login-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 11.5px;
}
.login-link:hover { text-decoration: underline; }

.login-check {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  margin: 16px 0;
  user-select: none;
}
.login-check input { display: none; }
.check-box {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  background: var(--surface-0);
}
.login-check input:checked + .check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.login-check .check-box svg { display: block; }

.login-submit {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .12s;
}
.login-submit:hover { background: var(--accent-2); }
.login-submit:disabled { opacity: .7; cursor: wait; }

.login-spinner {
  width: 14px; height: 14px;
  border-radius: 99px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  animation: spin .8s linear infinite;
}

.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
  color: var(--text-3);
  font-size: 11.5px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-sso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 10px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.sso-btn:hover { background: var(--surface-1); border-color: var(--border-strong); }

.login-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: var(--text-3);
  padding-top: 32px;
}

/* Org picker */
.org-picker {
  display: flex; flex-direction: column; gap: 6px;
}
.org-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-0);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.org-card:hover { border-color: var(--border-strong); }
.org-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.org-dot {
  width: 24px; height: 24px;
  border-radius: 99px;
  position: relative;
  flex-shrink: 0;
}
.org-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 99px;
  background: white;
  opacity: .6;
}

/* Checkered transparency */
.checker {
  background-image:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #f6f6f6;
}

/* Pill / tag */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2);
  color: var(--text-1);
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid var(--border);
}
.tag.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.tag.success { background: rgba(43,212,125,.1); color: var(--success); border-color: transparent; }
.tag.info { background: rgba(78,168,255,.1); color: var(--info); border-color: transparent; }
.tpl-cat-filters .tag { font-size: 12px; padding: 1.5px 7px; gap: 5px; }

/* Tooltip caret */
.caret { display: inline-block; opacity: .6; }

/* Banner content rendering */
.bn-text {
  white-space: pre-wrap;
  font-family: var(--font-sans);
  user-select: none;
}
.bn-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.bn-logo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-radius: 4px;
}

/* Toast */
.toasts {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text-0);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 8px;
  animation: slideUp .25s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideUp {
  from { transform: translateY(8px); opacity: 0; }
}

/* ===== Brand guide button (topbar) ===== */
.brand-guide-btn {
  border: 0 !important;
  background: #111111 !important;
  color: #ffffff !important;
}
.brand-guide-btn:hover { background: #2a2a2a !important; }

/* ===== Color field with alpha (admin ColorField) ===== */
.cf-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-1);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0 6px 0 7px;
  transition: background .12s, border-color .12s;
}
.cf-row .cf-alpha { align-self: stretch; border-left-color: #ffffff; }
.cf-row:hover {
  border-color: #E5E5E5;
}
.cf-row:focus-within {
  border-color: var(--accent);
  background: var(--surface-0);
}
.cf-swatch {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid transparent; cursor: pointer; overflow: hidden;
}
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 6px;
}
.cf-swatch {
  width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid transparent; cursor: pointer; overflow: hidden;
}
.cf-swatch.bordered { border-color: var(--border-strong); }
.cf-hex {
  flex: 1; min-width: 0;
  border: 0; background: transparent; padding: 0;
  font-family: var(--font-sans); font-size: 12px; color: var(--text-0);
  outline: none;
}
.cf-hex::placeholder { color: var(--text-3); }
.cf-alpha {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
  padding-left: 8px; border-left: 1px solid var(--border);
}
.cf-alpha input {
  width: 30px; border: 0; background: transparent; padding: 0;
  font-family: var(--font-sans); font-size: 12px; color: var(--text-0);
  text-align: right; outline: none;
  -moz-appearance: textfield;
}
.cf-alpha input::-webkit-outer-spin-button,
.cf-alpha input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cf-alpha span { font-size: 12px; color: var(--text-3); }

/* Color format dropdown (Hex / RGB / CSS / HSL / HSB) */
.cf-fmt { position: relative; flex-shrink: 0; }
.cf-fmt-btn {
  display: inline-flex; align-items: center; gap: 1px;
  height: 22px; padding: 0 3px 0 6px;
  border: 0; border-radius: 5px; background: transparent;
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--text-1);
  cursor: pointer; white-space: nowrap;
}
.cf-fmt-btn:hover { background: #f3f3f3; color: #1e1e1e; }
.cf-fmt-btn:hover svg { color: #1e1e1e; }
.cf-fmt-btn svg { color: var(--text-3); margin-left: -1px; }
.cf-fmt-backdrop { position: fixed; inset: 0; z-index: 60; }
.cf-fmt-menu {
  position: absolute; top: calc(100% + 6px); left: -6px; z-index: 61;
  min-width: 122px; padding: 6px;
  background: #1f1f22; border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  box-shadow: 0 14px 36px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 1px;
}
.cf-fmt-opt {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px 6px 4px;
  border: 0; border-radius: 6px; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
  cursor: pointer; text-align: left;
}
.cf-fmt-opt:hover { background: var(--accent); color: #fff; }
.cf-fmt-opt.is-active { background: transparent; }
.cf-fmt-check { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Dark dropdown (shared select-box UI) */
.dsel {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--surface-1); border: 1px solid transparent; border-radius: 5px;
  height: 24px; padding: 0 8px; font-size: 12px; color: var(--text-0); font-family: inherit;
  cursor: pointer; text-align: left;
}
.dsel:hover { background: var(--surface-2); }
.dsel-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsel-caret { color: var(--text-3); flex-shrink: 0; display: inline-flex; align-items: center; }
.dsel-backdrop { position: fixed; inset: 0; z-index: 210; }
.dsel-menu {
  position: fixed; z-index: 211;
  background: #1f1f22; border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  padding: 6px; box-shadow: 0 2px 14px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 1px; max-height: 280px; overflow-y: auto;
}
.dsel-menu.size-menu { scrollbar-width: none; }
.dsel-menu.size-menu::-webkit-scrollbar { width: 0; height: 0; display: none; }
.dsel-opt {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 14px 6px 4px; border: 0; border-radius: 6px; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.dsel-opt:hover { background: var(--accent); color: #fff; }
.dsel-opt.is-active { background: transparent; }
.dsel-check { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Multi-component value fields (RGB / HSL / HSB) */
.cf-triple { display: flex; gap: 4px; flex: 1; min-width: 0; }
.cf-triple-row {
  display: flex; margin-top: 4px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 8px;
}
.cf-triple-cell {
  display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0;
  padding-right: 6px;
}
.cf-triple-cell + .cf-triple-cell { border-left: 1px solid var(--border); padding-left: 8px; }
.cf-triple-cell span { font-size: 9.5px; font-weight: 700; color: var(--text-3); }
.cf-triple-cell input {
  width: 100%; min-width: 0; border: 0; background: transparent; padding: 0;
  font-family: var(--font-sans); font-size: 12px; color: var(--text-0); outline: none;
  -moz-appearance: textfield;
}
.cf-triple-cell input::-webkit-outer-spin-button,
.cf-triple-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* No-fill (배경 없음) option button */
.cf-none-btn {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: 5px;
  background: #fff; padding: 0; cursor: pointer;
  display: grid; place-items: center; overflow: hidden;
}
.cf-none-btn:hover { border-color: var(--text-3); }
.cf-none-btn.is-active { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* Multi-selection */
.layer-node.is-multi { outline-color: var(--accent); }
.multi-hint {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 8px; padding: 9px 10px;
  background: var(--accent-soft); border: 1px solid rgba(78,76,219,.22);
  border-radius: 8px; font-size: 11.5px; line-height: 1.45; color: var(--text-1);
}
.multi-hint svg { flex-shrink: 0; margin-top: 1px; }
.multi-hint .kbd {
  display: inline-block; padding: 0 4px; border-radius: 4px;
  background: var(--surface-0); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 10px;
}
.multi-list { display: flex; flex-direction: column; gap: 2px; }
.multi-list-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 5px; background: var(--surface-1);
  font-size: 12px; color: var(--text-1);
}
.multi-list-item .icon { color: var(--text-3); display: inline-flex; }
.multi-list-item .multi-pos {
  margin-left: auto; font-family: var(--font-mono);
  font-size: 10.5px; color: var(--text-3);
}

/* Color field line: field box + external eye (배경 없음) toggle */
.cf-line { display: flex; align-items: center; gap: 8px; }
.cf-line .cf-row { flex: 1; min-width: 0; }
.cf-swatch { padding: 0; background: none; }
.cf-eye {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 6px;
  color: var(--text-2); cursor: pointer;
}
.cf-eye:hover { background: #f3f3f3; color: #1e1e1e; }
.cf-eye.is-off { color: var(--text-3); }

/* Color picker popup (Figma-style) */
.cp-backdrop { position: fixed; inset: 0; z-index: 200; }
.cp-popup {
  position: fixed; z-index: 201; width: 246px;
  background: var(--surface-0);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,.32);
  overflow: visible;
  max-height: calc(100vh - 16px); overflow-y: auto;
  font-size: 12px; color: var(--text-1);
}
.cp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--text-0);
}
.cp-x { border: 0; background: transparent; padding: 2px; border-radius: 4px; cursor: pointer; color: var(--text-2); display: inline-flex; }
.cp-x:hover { background: var(--surface-2); color: var(--text-0); }
.cp-sv {
  position: relative; width: auto; height: 200px; cursor: crosshair;
  margin: 14px 14px 0; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.cp-sv-thumb {
  position: absolute; width: 16px; height: 16px; border-radius: 99px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 1px 4px rgba(0,0,0,.45);
  transform: translate(-50%, -50%); pointer-events: none;
}
.cp-controls { display: flex; align-items: center; gap: 12px; padding: 16px 14px 0; }
.cp-eyedrop {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center; padding: 0;
  border: 0; background: transparent; overflow: visible;
  border-radius: 6px;
  color: var(--text-1); cursor: pointer;
}
.cp-eyedrop:hover { background: #f3f3f3; }
.cp-eyedrop:hover { color: var(--text-0); }
.cp-tracks { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cp-hue {
  position: relative; height: 14px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.cp-alpha { position: relative; height: 14px; border-radius: 99px; cursor: pointer; }
.cp-alpha-fill { position: absolute; inset: 0; border-radius: 99px; }
.cp-track-thumb {
  position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 99px;
  border: 2.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.22), 0 1px 4px rgba(0,0,0,.4);
  transform: translate(-50%, -50%); pointer-events: none;
}
.cp-fields { display: flex; align-items: center; gap: 8px; padding: 16px 14px 14px; }
.cp-fmt-pill { flex-shrink: 0; }
.cp-fmt-pill .cf-fmt-btn {
  border: 1px solid transparent; background: var(--surface-1);
  height: 26px; border-radius: 5px; padding: 0 6px 0 9px;
}
.cp-fmt-pill .cf-fmt-btn:hover { background: var(--surface-2); }
.cp-fmt-pill .cf-fmt-menu { top: auto; bottom: calc(100% + 6px); left: 0; }
.cp-valuebox {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 8px;
  background: var(--surface-1); border: 1px solid transparent; border-radius: 5px;
  transition: background .12s, border-color .12s;
}
.cp-valuebox:hover { border-color: #E5E5E5; }
.cp-valuebox:focus-within { border-color: var(--accent); background: var(--surface-0); }

/* Fill-type toggle (단색 / 그라데이션) */
.cp-filltype { display: flex; gap: 2px; margin: 12px 12px 0; padding: 2px; background: var(--surface-2); border-radius: 7px; }
.cp-filltype button {
  flex: 1; border: 0; background: transparent; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2); padding: 5px 0; cursor: pointer;
}
.cp-filltype button.is-active { background: #fff; color: var(--text-0); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Gradient editor */
.cp-grad { padding: 0 12px 12px; }
.cp-grad-typerow { margin-bottom: 10px; }
.cp-grad-bar { position: relative; height: 16px; border-radius: 5px; margin-bottom: 14px; }
.cp-grad-bar-fill { position: absolute; inset: 0; border-radius: 5px; }
.cp-grad-stopdot {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 99px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.35);
  transform: translate(-50%, -50%); cursor: grab;
}
.cp-grad-stopdot.is-active { box-shadow: 0 0 0 2px var(--accent), 0 1px 3px rgba(0,0,0,.35); }
.cp-grad-stops-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.cp-grad-stops-head button { width: 20px; height: 20px; border: 0; background: transparent; border-radius: 5px; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.cp-grad-stops-head button:hover { background: var(--surface-2); color: var(--text-0); }
.cp-grad-stoprow {
  display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px;
  border-radius: 5px; cursor: pointer;
}
.cp-grad-stoprow.is-active { background: var(--surface-1); outline: 1px solid var(--accent); }
.cp-grad-stoprow:hover:not(.is-active) { background: var(--surface-1); }
.cp-grad-pos { width: 30px; border: 0; background: transparent; font-size: 11px; color: var(--text-0); font-family: var(--font-sans); outline: none; text-align: right; }
.cp-grad-aval { width: 26px; border: 0; background: transparent; font-size: 11px; color: var(--text-0); font-family: var(--font-sans); outline: none; text-align: right; }
.cp-grad-pct { font-size: 11px; color: var(--text-3); }
.cp-grad-sw { width: 16px; height: 16px; border-radius: 3px; overflow: hidden; flex-shrink: 0; border: 1px solid transparent; }
.cp-grad-sw.bordered { border-color: var(--border-strong); }
.cp-grad-sw > span { display: block; width: 100%; height: 100%; }
.cp-grad-hex { flex: 1; min-width: 0; font-size: 11px; color: var(--text-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-grad-del { width: 20px; height: 20px; border: 0; background: transparent; border-radius: 5px; color: var(--text-3); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.cp-grad-del:hover:not(:disabled) { background: var(--surface-2); color: #1e1e1e; }
.cp-grad-del:disabled { opacity: .3; cursor: default; }
/* RGB/HSL value box: numbers only, centered, room for 3 digits; slim alpha field */
.cp-valuebox .cf-triple-cell { padding-right: 4px; justify-content: center; }
.cp-valuebox .cf-triple-cell + .cf-triple-cell { padding-left: 6px; }
.cp-valuebox .cf-triple-cell input { text-align: center; min-width: 26px; }
.cp-valuebox .cf-alpha { padding-left: 6px; }
.cp-valuebox .cf-alpha input { width: 24px; }

/* User color picker alpha */
.user-color-pick { position: relative; }
.user-color-input .cf-alpha { padding-left: 8px; }

/* ===== Brand color chips (shared color pickers) ===== */
.brand-chips {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap;
}
.brand-chips.compact { margin-top: 6px; padding-top: 6px; }
.brand-chips-label {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-3); text-transform: uppercase;
}
.brand-chips-row { display: flex; gap: 5px; flex-wrap: wrap; }
.brand-chip {
  width: 20px; height: 20px; border-radius: 6px; padding: 0; cursor: pointer;
  border: 1px solid rgba(0,0,0,.12);
  display: grid; place-items: center;
  transition: transform .1s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-chip:hover { transform: scale(1.12); }
.brand-chip.is-active { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Hex value as a dropdown trigger */
.cf-hex-btn {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; text-align: left;
}
.cf-hex-btn .cf-hex-val {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-sans); color: var(--text-0);
}
.cf-hex-btn .cf-hex-val.is-placeholder { color: var(--text-3); }
.cf-hex-btn > svg { color: var(--text-3); flex-shrink: 0; }
.cf-hex-input {
  border: 0; background: transparent; padding: 0; margin: 0;
  outline: none; width: 100%; cursor: text;
}
.cf-hex-input::placeholder { color: var(--text-3); }
.mono { font-family: var(--font-mono); }

/* Brand color dropdown (image-3 style) */
.bcm-backdrop { position: fixed; inset: 0; z-index: 240; }
.bcm-menu {
  position: fixed; z-index: 241;
  background: var(--surface-0); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 4px;
  max-height: 300px; overflow-y: auto; min-width: 208px;
}
.bcm-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 9px; border: 0; border-radius: 7px; background: transparent;
  font-family: inherit; font-size: 12.5px; color: var(--text-0);
  cursor: pointer; text-align: left; white-space: nowrap;
}
.bcm-opt:hover { background: var(--surface-1); }
.bcm-opt.is-active { background: var(--surface-1); }
.bcm-sw {
  width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid transparent;
}
.bcm-sw.bordered { border-color: rgba(0,0,0,.16); }
.bcm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bcm-val { color: var(--text-3); font-size: 11px; flex-shrink: 0; }

/* ===== Brand guide manager (modal) ===== */
.brand-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,12,18,.42);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  animation: fadeIn .14s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.brand-modal {
  width: min(720px, 92vw);
  max-height: 86vh;
  background: var(--surface-0);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-pop), 0 30px 80px rgba(10,12,18,.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: popIn .16s cubic-bezier(.2,.8,.3,1);
}
@keyframes popIn { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.brand-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-modal-ic {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
}
.brand-modal-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-modal-sub {
  font-size: 11.5px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.brand-tabs {
  display: flex; gap: 2px;
  margin: 14px 18px 0;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px;
}
.brand-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  background: transparent; border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.brand-tabs button:hover:not(.is-active) { background: rgba(0,0,0,.04); color: var(--text-1); }
.brand-tabs button.is-active {
  background: var(--surface-0);
  color: var(--text-0);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04);
}
.brand-tabs .count {
  font-size: 10px; background: var(--surface-2); color: var(--text-2);
  padding: 1px 6px; border-radius: 99px; font-weight: 600;
}
.brand-tabs button.is-active .count { background: var(--accent-soft); color: var(--accent-2); }
.brand-modal-body {
  padding: 18px; overflow-y: auto; min-height: 0;
}
.brand-hint {
  font-size: 11.5px; color: var(--text-2); line-height: 1.55;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}
.brand-hint b { color: var(--text-0); font-weight: 600; }
.brand-color-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.brand-color-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px;
}
.brand-color-swatch {
  position: relative; width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12); cursor: pointer; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.brand-color-swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.brand-color-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.input.sm { padding: 5px 8px; font-size: 11.5px; }
.input.mono { font-family: var(--font-mono); }
.brand-color-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--border-strong);
  background: transparent; color: var(--text-2);
  border-radius: 9px; min-height: 60px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.brand-color-add:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }

.brand-size-list { display: flex; flex-direction: column; gap: 8px; }
.brand-size-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-0);
}
.brand-size-card .input-wrap { flex: 1; }
.brand-size-x { color: var(--text-3); font-weight: 600; flex-shrink: 0; }
.brand-size-list .brand-color-add { margin-top: 2px; }

.brand-logo-tab { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.brand-logo-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px;
}
.brand-logo-chip {
  padding: 14px 22px; border-radius: 8px;
  font-size: 20px; font-weight: 800; letter-spacing: -0.01em;
}
.brand-logo-preview-dim { font-size: 10.5px; color: var(--text-3); text-align: center; }
.brand-logo-controls { display: flex; flex-direction: column; }

.brand-grid-tab { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.brand-grid-preview {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  aspect-ratio: 16/9; display: grid; place-items: stretch; overflow: hidden;
}
.brand-grid-art { display: flex; width: 100%; height: 100%; }
.brand-grid-col { flex: 1; background: var(--accent-soft); border-radius: 2px; }
.brand-grid-controls { display: flex; flex-direction: column; }
.brand-modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ===== Progress bar stepper (image-style: green checks + connectors) ===== */
.pbar-stepper {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; padding: 22px 18px;
}
.pstep {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.pstep-circle {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  background: var(--surface-0);
  border: 2px solid var(--border-strong);
  color: var(--text-3);
  transition: background .2s, border-color .2s, color .2s;
}
.pstep-label {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
  transition: color .2s;
}
.pstep.is-active .pstep-circle {
  background: var(--step-green); border-color: var(--step-green); color: #fff;
}
.pstep.is-active .pstep-label { color: var(--text-1); font-weight: 500; }
.pstep.is-done .pstep-circle {
  background: var(--step-green); border-color: var(--step-green); color: #fff;
}
.pstep.is-done .pstep-label { color: var(--text-1); font-weight: 500; }
.pbar-line {
  flex: 0 1 200px; min-width: 48px; height: 4px; border-radius: 2px;
  background: var(--step-track);
  margin: 0 10px; margin-top: 10px;
}
.pbar-line.is-done { background: var(--step-green); }
.pbar-line.is-half { background: linear-gradient(to right, var(--step-green) 45%, var(--step-track) 45%); }

/* ===== User editor (step 2 — mirrors admin tool) ===== */
.user-main-editor { flex-direction: column; }
.user-editor {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.user-editor-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-0);
  flex-shrink: 0;
}
.user-editor-titlewrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-editor-body {
  flex: 1; min-height: 0; min-width: 0;
  display: grid; grid-template-columns: 232px 1fr 300px;
}
.user-layer-panel, .user-inspector {
  overflow: hidden; display: flex; flex-direction: column;
}
.user-inspector { overflow-y: auto; }

.user-layer-item {
  cursor: pointer;
  display: flex !important;
  gap: 8px;
  align-items: center !important;
  height: auto !important;
  padding: 8px 9px !important;
}
.user-layer-item .icon { flex-shrink: 0; }
.user-layer-name {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-layer-item.is-selected .user-layer-name { color: var(--text-0); }
.user-layer-item .perm-tag { flex-shrink: 0; margin-left: auto; }

/* User color picker — hex input + native pick + brand chips */
.user-color-field { display: flex; flex-direction: column; gap: 6px; }
.user-color-input { display: flex; align-items: center; gap: 6px; }
.user-color-pick {
  position: relative; width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid transparent; cursor: pointer; overflow: hidden;
  box-shadow: none;
}
.user-color-pick.bordered { border-color: var(--border-strong); }
.user-color-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.perm-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 99px;
  white-space: nowrap; letter-spacing: -0.01em;
}
.perm-tag.editable { color: var(--success); background: rgba(22,163,74,.12); }
.perm-tag.color-only { color: var(--accent-2); background: var(--accent-soft); }
.perm-tag.locked { color: var(--text-3); background: var(--surface-2); }

.user-perm-legend {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 10.5px; color: var(--text-2);
}
.user-perm-legend > div { display: flex; align-items: center; gap: 6px; }
.user-perm-legend .perm-tag { flex-shrink: 0; }

.user-canvas-wrap { min-height: 0; }

.user-img-slot {
  position: absolute; inset: 0;
  border: 2px dashed rgba(0,0,0,.22); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: rgba(0,0,0,.45); cursor: pointer; background: rgba(0,0,0,.02);
  text-align: center; padding: 8px;
}
.user-img-slot:hover { border-color: var(--accent); background: var(--accent-soft); }
.user-img-slot-name { font-size: 18px; font-weight: 600; }
.user-img-slot-hint { font-size: 13px; opacity: .8; }

.user-lock-pin {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 5px;
  background: rgba(20,22,32,.7); color: #fff;
  display: grid; place-items: center;
  transform-origin: top right; pointer-events: none;
}
.layer-node.is-locked.is-selected { outline-color: var(--accent); }

.user-locked-note {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11.5px; color: var(--text-2); line-height: 1.55;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.user-locked-note b { color: var(--text-1); font-weight: 600; }
.micro-note { font-size: 10.5px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }
.micro-note b { color: var(--text-2); font-weight: 600; }
.user-fixed-text {
  margin-top: 8px; padding: 8px 10px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; color: var(--text-2); line-height: 1.5;
  white-space: pre-wrap;
}

/* Inline rename input (category / guide / layer lists) */
.rename-input {
  font: inherit;
  font-size: 12px;
  color: var(--text-0);
  background: var(--surface-0);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  min-width: 0;
}

/* Save success toast */
.save-toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  background: #1e1e1e; color: #fff;
  padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  z-index: 10000;
  animation: saveToastIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes saveToastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
