/* =========================================================================
   카드뉴스 메이커 — UI 스타일
   ========================================================================= */
:root {
  --bg: #EFF1F5;
  --panel: #FFFFFF;
  --ink: #14151A;
  --ink-2: #3D414B;
  --muted: #767C8A;
  --line: #E6E8EE;
  --line-2: #D6D9E2;
  --brand: #6D5EF8;
  --brand-2: #FF4D8D;
  --brand-soft: #F0EEFF;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 21, 26, .04), 0 8px 28px rgba(20, 21, 26, .06);
  --shadow-lg: 0 18px 50px rgba(20, 21, 26, .14), 0 2px 6px rgba(20, 21, 26, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  letter-spacing: -0.01em;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(20, 21, 26, .07);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(140deg, #7B6BFF, #FF4D8D);
  box-shadow: 0 6px 16px rgba(109, 94, 248, .35);
}
.brand-txt h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
.brand-txt p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 12px; }
.save-state {
  font-size: 11.5px; color: #A0A5B2; padding: 4px 8px; border-radius: 20px;
  transition: .25s;
}
.save-state.on { color: #1EA672; background: #E9F9F1; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 17px;
  font-size: 13.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6D5EF8, #8B5CF6 45%, #FF4D8D);
  box-shadow: 0 6px 18px rgba(109, 94, 248, .32);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(109, 94, 248, .4); }
.btn-primary:active { transform: translateY(0) scale(.99); }
.btn-primary:disabled { opacity: .6; cursor: wait; }

/* ---------------- layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 424px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 24px 60px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  position: sticky; top: 78px;
  max-height: calc(100vh - 100px);
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 4px;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: #D3D7E0; border-radius: 8px; }

.block {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(20, 21, 26, .04);
}
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.block h2 {
  margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 8px;
}
.step {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}
.count-pill {
  font-size: 11.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 20px; padding: 3px 9px;
}

/* ---------------- source ---------------- */
.source {
  width: 100%; height: 168px; resize: vertical;
  border: 1px solid var(--line); border-radius: 12px;
  background: #FAFBFD; padding: 13px 14px;
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
  outline: none; transition: border-color .15s, background .15s;
}
.source:focus { border-color: #B9B0FF; background: #fff; box-shadow: 0 0 0 4px rgba(109, 94, 248, .09); }
.source::placeholder { color: #A9AEBB; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.char { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chips { display: flex; align-items: center; gap: 5px; }
.chips-label { font-size: 11px; color: #A9AEBB; }
.chips button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 20px; padding: 4px 9px; font-size: 11.5px; font-weight: 600;
  transition: .15s;
}
.chips button:hover { border-color: #C9C2FF; color: var(--brand); background: var(--brand-soft); }

.btn-generate {
  width: 100%; margin-top: 13px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: 13px; padding: 15px 16px;
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -0.02em;
  background: linear-gradient(120deg, #6D5EF8, #9B5CF6 50%, #FF4D8D);
  box-shadow: 0 10px 26px rgba(109, 94, 248, .33);
  transition: transform .15s, box-shadow .15s, filter .2s;
}
.btn-generate:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(109, 94, 248, .42); }
.btn-generate:active { transform: translateY(0) scale(.995); }
.btn-generate.busy .g-icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-icon { font-size: 16px; }

.hint { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.6; color: #9198A6; }
.hint b { color: var(--ink-2); font-weight: 700; }

/* ---------------- url 불러오기 ---------------- */
.url-row { display: flex; gap: 7px; }
.url-input {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: #FAFBFD; padding: 12px 13px;
  font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.url-input::placeholder { color: #A9AEBB; }
.url-input:focus { border-color: #B9B0FF; background: #fff; box-shadow: 0 0 0 4px rgba(109, 94, 248, .09); }
.btn-fetch {
  flex: 0 0 auto;
  border: 0; border-radius: 12px; padding: 0 16px;
  font-size: 13.5px; font-weight: 800; letter-spacing: -0.02em; color: #fff;
  background: linear-gradient(135deg, #6D5EF8, #8B5CF6 55%, #FF4D8D);
  box-shadow: 0 6px 16px rgba(109, 94, 248, .28);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn-fetch:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(109, 94, 248, .36); }
.btn-fetch:active { transform: translateY(0) scale(.99); }
.btn-fetch:disabled { opacity: .7; cursor: wait; transform: none; }
.btn-fetch.busy::after {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 6px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  vertical-align: -1px; animation: spin .8s linear infinite;
}

.fetch-note {
  margin: 9px 2px 0; font-size: 11.5px; line-height: 1.6; color: #7C8391;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
}
.fetch-note b { color: var(--ink-2); font-weight: 700; }
.fetch-note.good { color: #12805C; }
.fetch-note.bad { color: #C2410C; }
.fetch-note.loading::before {
  content: ""; width: 11px; height: 11px; margin-right: 6px;
  border: 2px solid #CFC9FF; border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite;
}

.fetch-note.warn { color: #9A5B12; }

/* ---------------- PDF 업로드 ---------------- */
.pdf-drop {
  margin-top: 11px; padding: 11px 12px;
  border: 1.5px dashed #D8D2FF; border-radius: 13px;
  background: #FBFAFF;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pdf-drop.drag {
  border-color: var(--brand); background: #F4F1FF;
  box-shadow: 0 0 0 4px rgba(109, 94, 248, .09);
}
.pdf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pdf-pick {
  flex: 0 0 auto;
  border: 1px solid #DED8FF; border-radius: 10px;
  background: #fff; color: #4B3FD1;
  padding: 7px 12px; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(109, 94, 248, .10);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.pdf-pick:hover { transform: translateY(-1px); background: #F7F5FF; box-shadow: 0 6px 14px rgba(109, 94, 248, .16); }
.pdf-pick:disabled { opacity: .6; cursor: wait; transform: none; }
.pdf-or { font-size: 11.5px; color: #9198A6; }
.pdf-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.55; color: #9198A6; }
.pdf-hint b { color: var(--ink-2); font-weight: 700; }
.pdf-state {
  margin-top: 8px; padding: 7px 10px; border-radius: 9px;
  background: #F1EFFF; color: #4B3FD1;
  font-size: 11.5px; font-weight: 700; line-height: 1.55;
}
.pdf-state.loading::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border: 2px solid #CFC9FF; border-top-color: var(--brand); border-radius: 50%;
  vertical-align: -1px; animation: spin .8s linear infinite;
}
.pdf-state.good { background: #E9F8F1; color: #12805C; }
.pdf-state.bad { background: #FFF1E9; color: #C2410C; }

.fetch-guide {
  margin-top: 9px; padding: 10px 12px;
  border: 1px solid #FFD9C2; background: #FFF7F1; border-radius: 11px;
}
.fetch-guide p { margin: 0; font-size: 12px; line-height: 1.6; color: #8A4B22; }
.link-btn {
  margin-top: 7px; border: 0; background: none; padding: 0;
  font-size: 12px; font-weight: 800; color: var(--brand); text-decoration: underline;
}

.manual {
  margin-top: 13px; border-top: 1px dashed var(--line-2); padding-top: 11px;
}
.manual > summary {
  list-style: none; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: #8A90A0;
  display: flex; align-items: center; gap: 6px;
}
.manual > summary::-webkit-details-marker { display: none; }
.manual > summary::before { content: "▸"; font-size: 10px; color: #B4B9C6; transition: transform .15s; }
.manual[open] > summary::before { transform: rotate(90deg); }
.manual > summary:hover { color: var(--brand); }
.manual-body { margin-top: 10px; }

/* ---------------- fields ---------------- */
.field { margin-top: 15px; }
.field:first-of-type { margin-top: 0; }
.lbl {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px;
}
.lbl-note { font-size: 10.5px; font-weight: 500; color: #A2A8B5; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: #F3F4F8; border-radius: 12px; padding: 4px;
}
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-5 { grid-template-columns: repeat(5, 1fr); }
.seg button {
  border: 0; background: transparent; border-radius: 9px;
  padding: 9px 6px; font-size: 12px; font-weight: 700; color: #767C8A;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: .16s;
}
.seg-4 button { flex-direction: row; }
.seg-5 button { flex-direction: row; padding: 9px 2px; font-size: 11.5px; }
.seg button b { font-size: 12px; font-weight: 800; }
.seg button span { font-size: 10px; font-weight: 500; opacity: .75; }
.seg button:hover { color: var(--ink); }
.seg button.on {
  background: #fff; color: var(--brand);
  box-shadow: 0 1px 3px rgba(20, 21, 26, .1), 0 0 0 1px rgba(109, 94, 248, .12) inset;
}

.input-prefix {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 11px; background: #FAFBFD;
  padding: 0 12px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-prefix:focus-within { border-color: #B9B0FF; background: #fff; box-shadow: 0 0 0 4px rgba(109, 94, 248, .09); }
.input-prefix span { color: var(--brand); font-weight: 800; font-size: 14px; }
.input-prefix input {
  flex: 1; border: 0; background: transparent; outline: none;
  padding: 11px 4px; font-size: 14px; font-weight: 600; color: var(--ink);
}

/* ---------------- theme grid ---------------- */
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.theme-card {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 5px 5px 6px; text-align: left; transition: .16s;
  display: flex; flex-direction: column; gap: 5px;
}
.theme-card:hover { border-color: #CFC8FF; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 21, 26, .07); }
.theme-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(109, 94, 248, .18); }

.mini {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4;
  border-radius: 5px; overflow: hidden;
  background: var(--m-bg);
  padding: 12% 10%;
}
.mini .m-badge {
  position: absolute; left: 10%; top: 9%; width: 30%; height: 5.5%;
  border-radius: 2px; background: var(--m-ac); opacity: .95;
}
.mini .m-t1, .mini .m-t2 { display: block; background: var(--m-fg); border-radius: 2px; opacity: .92; }
.mini .m-t1 { height: 9%; width: 88%; margin-top: 30%; }
.mini .m-t2 { height: 9%; width: 60%; margin-top: 7%; }
.mini .m-line { display: block; height: 3.5%; width: 46%; margin-top: 12%; background: var(--m-fg); opacity: .35; border-radius: 2px; }
.mini .m-stat { position: absolute; left: 10%; bottom: 12%; width: 34%; height: 12%; border-radius: 2px; background: var(--m-ac); opacity: .9; }
[data-theme="minimal"] .m-badge { border-radius: 0; }
[data-theme="pastel"] .m-badge { border-radius: 20px; }
[data-theme="news"] .m-badge { width: 36%; }

.theme-meta { display: flex; flex-direction: column; gap: 0; padding: 0 1px; }
.theme-meta strong { font-size: 10px; font-weight: 800; color: var(--ink); letter-spacing: -0.04em; line-height: 1.3; }
.theme-meta em { display: none; }

/* ---------------- editor ---------------- */
.editor { display: flex; flex-direction: column; gap: 7px; }
.ed-empty { margin: 0; font-size: 12.5px; color: var(--muted); }

.card-item {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  overflow: hidden; transition: border-color .15s;
}
.card-item[open] { border-color: #D9D3FF; box-shadow: 0 4px 14px rgba(109, 94, 248, .07); }
.card-item summary {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; cursor: pointer; list-style: none;
  font-size: 12.5px; user-select: none;
}
.card-item summary::-webkit-details-marker { display: none; }
.card-item summary:hover { background: #FAFBFD; }
.ci-no {
  font-size: 10.5px; font-weight: 800; color: #9AA0AE;
  font-variant-numeric: tabular-nums; min-width: 16px;
}
.ci-type {
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px;
  background: #F1F2F6; color: #6B7280; white-space: nowrap;
}
.ci-type.t-cover { background: #EDEBFF; color: #6D5EF8; }
.ci-type.t-content { background: #E9F6FF; color: #0E86C8; }
.ci-type.t-summary { background: #EAF7EF; color: #1E9E5A; }
.ci-type.t-cta { background: #FFEDF4; color: #D6336C; }
.ci-title {
  flex: 1; min-width: 0; font-weight: 600; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-chev { color: #B6BBC7; transition: transform .2s; font-size: 12px; }
.card-item[open] .ci-chev { transform: rotate(180deg); }

.ci-body { padding: 4px 12px 13px; display: flex; flex-direction: column; gap: 9px; border-top: 1px solid #F1F2F6; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { font-size: 10.5px; font-weight: 700; color: #8A909E; }
.fld input, .fld textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: #FAFBFD; padding: 8px 10px; font-size: 12.5px; line-height: 1.55;
  color: var(--ink); outline: none; resize: vertical;
  transition: border-color .15s, background .15s;
}
.fld input:focus, .fld textarea:focus { border-color: #B9B0FF; background: #fff; box-shadow: 0 0 0 3px rgba(109, 94, 248, .08); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 카드 사진 */
.ci-photo {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px;
  background: #FAFBFD;
}
.ci-photo-thumb {
  width: 54px; height: 40px; border-radius: 7px; overflow: hidden;
  background: #EEF0F5; display: grid; place-items: center; flex: 0 0 auto;
}
.ci-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-photo-thumb span { font-size: 9.5px; color: #A2A8B5; }
.ci-photo-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.ci-photo-btns button {
  border: 1px solid var(--line); background: #fff; color: #6B7280;
  border-radius: 8px; padding: 6px 10px; font-size: 11.5px; font-weight: 700;
  transition: .15s;
}
.ci-photo-btns button:hover { border-color: #CFC8FF; color: var(--brand); background: var(--brand-soft); }
.ci-photo-btns button.danger:hover { border-color: #FFC9D6; color: #D6336C; background: #FFF0F4; }

.ci-actions { display: flex; gap: 5px; padding-top: 2px; }
.ci-actions button {
  border: 1px solid var(--line); background: #fff; color: #6B7280;
  border-radius: 8px; padding: 6px 9px; font-size: 11.5px; font-weight: 700;
  transition: .15s;
}
.ci-actions button:hover:not(:disabled) { border-color: #CFC8FF; color: var(--brand); background: var(--brand-soft); }
.ci-actions button:disabled { opacity: .35; cursor: default; }
.ci-actions button.danger:hover { border-color: #FFC9D6; color: #D6336C; background: #FFF0F4; }
.ci-actions button.accent { margin-left: auto; border-color: #CFC8FF; color: var(--brand); background: var(--brand-soft); }

.panel-foot { padding: 2px 6px 10px; }
.panel-foot p { margin: 0; font-size: 10.5px; color: #A2A8B5; text-align: center; line-height: 1.6; }

/* ---------------- stage ---------------- */
.stage { min-width: 0; }
.stage-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 2px 4px 14px; gap: 12px;
}
.stage-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.stage-head p {
  margin: 3px 0 0; font-size: 11.5px; color: var(--muted);
  transition: color .3s;
}
.stage-head p.flash { color: var(--brand); font-weight: 700; }
.stage-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.stage-note { font-size: 11px; color: #A2A8B5; white-space: nowrap; }

/* 격자 / 넘겨 보기 전환 */
.view-toggle {
  display: inline-flex; gap: 3px; padding: 3px;
  background: #F3F4F8; border-radius: 11px;
}
.view-toggle button {
  border: 0; background: transparent; border-radius: 8px;
  padding: 7px 12px; font-size: 11.5px; font-weight: 700; color: #767C8A;
  display: inline-flex; align-items: center; gap: 5px; transition: .15s;
}
.view-toggle button span {
  font-size: 10px; font-weight: 800; color: #A2A8B5; font-variant-numeric: tabular-nums;
}
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.on {
  background: #fff; color: var(--brand);
  box-shadow: 0 1px 3px rgba(20, 21, 26, .1), 0 0 0 1px rgba(109, 94, 248, .12) inset;
}
.view-toggle button.on span { color: var(--brand); }

/* 넘겨 보기 (인스타 피드처럼 한 장씩) */
.preview-grid.slide-mode { display: flex; flex-direction: column; gap: 16px; }
.slide-box {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; gap: 10px;
}
.snav {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 22px; font-weight: 700;
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: .15s; padding: 0 0 3px;
}
.snav:hover:not(:disabled) { border-color: #CFC8FF; color: var(--brand); transform: translateY(-1px); }
.snav:disabled { opacity: .3; cursor: default; box-shadow: none; }
.slide-frame {
  position: relative; margin: 0; border-radius: 16px; overflow: hidden;
  background: #fff; cursor: zoom-in;
  box-shadow: 0 2px 4px rgba(20, 21, 26, .07), 0 20px 46px rgba(20, 21, 26, .14);
  display: flex; justify-content: center;
}
.slide-frame canvas { display: block; width: 100%; max-width: 540px; height: auto; }
.slide-badge {
  position: absolute; left: 12px; top: 12px;
  background: rgba(15, 16, 22, .62); color: #fff; border-radius: 8px;
  padding: 5px 9px; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.slide-badge b { font-weight: 800; }
.slide-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 54px; }
.slide-dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.slide-dots .dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: #D2D6E0; transition: .15s;
}
.slide-dots .dot.on { background: var(--brand); width: 22px; border-radius: 5px; }
.slide-info { font-size: 11.5px; color: var(--muted); }

/* 한눈에 보는 페이지 요약 */
.page-summary {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 14px 16px 16px; box-shadow: var(--shadow);
}
.page-summary.off .ps-list { display: none; }
.ps-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 800; color: var(--ink-2); margin-bottom: 10px;
}
.ps-head button {
  border: 1px solid var(--line); background: #fff; color: #6B7280;
  border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700;
}
.ps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ps-list li {
  display: grid; grid-template-columns: 24px 46px minmax(0, 1fr);
  gap: 2px 8px; align-items: baseline; cursor: pointer;
  padding: 7px 8px; border-radius: 9px; transition: background .15s;
}
.ps-list li:hover { background: #F7F8FC; }
.ps-list li b { font-size: 11px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.ps-list li em { font-size: 10px; font-style: normal; font-weight: 700; color: #8A909E; }
.ps-t { font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-l { grid-column: 3; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 720px) {
  .stage-side { align-items: flex-start; }
  .preview-grid.slide-mode .slide-bar { padding: 0 4px; }
  .slide-box { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 6px; }
  .snav { width: 34px; height: 34px; font-size: 18px; }
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 26px 22px;
}

.shot { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.shot-frame {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 4px rgba(20, 21, 26, .06), 0 14px 30px rgba(20, 21, 26, .10);
  cursor: zoom-in;
  transition: transform .2s, box-shadow .2s;
}
.shot:hover .shot-frame { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(20, 21, 26, .07), 0 22px 44px rgba(20, 21, 26, .16); }
.shot canvas { display: block; width: 100%; height: auto; }

.shot-tools {
  position: absolute; right: 10px; top: 10px; display: flex; gap: 6px;
  opacity: 0; transform: translateY(-4px); transition: .18s;
}
.shot:hover .shot-tools { opacity: 1; transform: none; }
.mini-btn {
  border: 0; border-radius: 8px; padding: 6px 9px;
  font-size: 11px; font-weight: 800; color: #fff;
  background: rgba(15, 16, 22, .58);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: .15s;
}
.mini-btn:hover { background: rgba(15, 16, 22, .78); }
.mini-btn.solid { background: rgba(109, 94, 248, .92); }
.mini-btn.solid:hover { background: #5b4cf0; }

.shot figcaption {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--muted); padding: 0 3px;
}
.cap-i { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cap-t { font-weight: 600; color: var(--ink-2); }
.cap-s { margin-left: auto; font-size: 10.5px; color: #AEB3BE; }

.empty {
  grid-column: 1 / -1;
  background: #fff; border: 1px dashed #D5D9E3; border-radius: 18px;
  padding: 60px 24px; text-align: center; color: var(--muted);
}
.empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .7; }
.empty p { margin: 0; font-size: 13px; line-height: 1.8; }
.empty b { color: var(--brand); }

/* ---------------- zoom ---------------- */
.zoom-modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 13, 18, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; place-items: center; padding: 26px;
}
.zoom-modal.on { display: grid; }
.zoom-inner {
  background: #14151A; border-radius: 18px; padding: 12px;
  box-shadow: var(--shadow-lg); max-height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.zoom-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4px; }
.zoom-head span { color: #C9CDD8; font-size: 12px; font-weight: 600; }
.zoom-head button {
  border: 0; background: rgba(255, 255, 255, .1); color: #fff;
  width: 26px; height: 26px; border-radius: 8px; font-size: 12px;
}
#zoomCanvas {
  display: block; max-width: min(76vw, 560px); max-height: 78vh;
  width: auto; height: auto; border-radius: 10px;
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #14151A; color: #fff; font-size: 13px; font-weight: 600;
  padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 버전 표시 · 업데이트 배너 ---------------- */
.ver-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 5px 4px 4px;
  background: #F5F6FA; border: 1px solid var(--line); border-radius: 20px;
}
.ver-chip {
  display: inline-flex; align-items: center;
  padding: 4px 9px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.btn-ghost {
  border: 0; background: transparent; color: var(--brand);
  font-size: 11.5px; font-weight: 800; letter-spacing: -0.01em;
  padding: 5px 7px; border-radius: 12px;
  transition: background .15s, color .15s, opacity .15s;
}
.btn-ghost:hover { background: var(--brand-soft); }
.btn-ghost:disabled { opacity: .55; cursor: progress; }

.update-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  background: linear-gradient(96deg, #4F46E5 0%, #6D5EF8 48%, #8B5CF6 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 70, 229, .22);
  animation: ub-drop .28s ease-out;
}
.update-banner[hidden] { display: none; }
@keyframes ub-drop { from { transform: translateY(-100%); opacity: .2; } }
.ub-icon { font-size: 16px; line-height: 1; flex: none; }
.ub-text { margin: 0; min-width: 0; font-size: 13px; line-height: 1.45; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ub-text b { font-weight: 800; letter-spacing: -0.02em; }
.ub-text span { font-size: 12px; color: rgba(255, 255, 255, .82); }
.ub-apply {
  margin-left: auto; flex: none;
  border: 0; border-radius: 10px; padding: 8px 14px;
  background: #fff; color: #4F46E5;
  font-size: 12.5px; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(20, 21, 26, .14);
  transition: transform .15s, box-shadow .15s;
}
.ub-apply:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(20, 21, 26, .2); }
.ub-close {
  flex: none; border: 0; border-radius: 8px;
  width: 26px; height: 26px; padding: 0;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 11px;
  transition: background .15s;
}
.ub-close:hover { background: rgba(255, 255, 255, .3); }

@media (max-width: 720px) {
  .update-banner { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .ub-text { flex: 1 1 100%; }
  .ub-apply { margin-left: 26px; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
  .panel { position: static; max-height: none; overflow: visible; }
  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 14px; }
  .topbar { padding: 10px 16px; }
  .brand-txt p { display: none; }
  .btn-primary { padding: 10px 13px; font-size: 12.5px; }
  .save-state { display: none; }
}
@media (max-width: 860px) {
  .ver-group { padding: 3px; gap: 2px; }
  .ver-chip { padding: 3px 7px; font-size: 11px; }
  .btn-ghost { padding: 4px 5px; font-size: 11px; }
}
@media (max-width: 560px) {
  .preview-grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .shot figcaption { font-size: 10.5px; }
  .cap-s { display: none; }
  .stage-note { display: none; }
}
