/* Moart 한국형 1-Screen 썸네일 · 배너 스튜디오 V2 (Light / Dark 완벽 대응) */
#thumbnailWorkspace.is-active.tkv2-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#thumbnailWorkspace.tkv2-active .thumb-page-caption,
#thumbnailWorkspace.tkv2-active #thumbnailNext,
#thumbnailWorkspace.tkv2-active #thumbnailBack,
#thumbnailWorkspace.tkv2-active .thumb-kind-picker,
#thumbnailWorkspace.tkv2-active .thumb-wizard-actions {
  display: none !important;
}

/* 상단 5탭 세그먼트 바 */
.tkv2-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--bg-control, #f1f5f9);
  border: 1px solid var(--border-default, #e2e8f0);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.tkv2-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tkv2-tab:hover {
  color: var(--text-primary, #0f172a);
}

.tkv2-tab.is-active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.28);
}

/* 1-Screen 2열 스튜디오 레이아웃 (좌 60% / 우 40% 스티키) */
.tkv2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.tkv2-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* 1~4단계 스텝 진행 바 */
.tkv2-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tkv2-step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  color: var(--text-secondary, #64748b);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tkv2-step-btn:hover {
  border-color: var(--accent, #4f46e5);
  color: var(--text-primary, #0f172a);
}

.tkv2-step-btn.is-active {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}

.tkv2-step-btn.is-done {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--text-primary, #0f172a);
}

.tkv2-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-control, #f1f5f9);
  color: var(--text-secondary, #475569);
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.tkv2-step-btn.is-active .tkv2-step-num {
  background: #4f46e5;
  color: #ffffff;
}

.tkv2-step-btn.is-done .tkv2-step-num {
  background: #10b981;
  color: #ffffff;
}

.tkv2-step-panel[hidden] {
  display: none !important;
}

.tkv2-step-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tkv2-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.tkv2-step-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tkv2-step-nav__btn--prev {
  border: 1px solid var(--border-default, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
}

.tkv2-step-nav__btn--next {
  border: 0;
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.tkv2-step-nav__btn--next:hover {
  background: #4338ca;
}

@media (max-width: 720px) {
  .tkv2-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#thumbnailWorkspace.tkv2-active #thumbnailPageOne,
#thumbnailWorkspace.tkv2-active #thumbnailPageTwo {
  display: none !important;
}

#thumbnailWorkspace.tkv2-active .thumb-card {
  border-radius: 16px;
  border: 1px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* 내 라이브러리 선택 버튼 */
.tkv2-lib-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent, #4f46e5);
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent, #4f46e5);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.tkv2-lib-btn:hover {
  background: #4f46e5;
  color: #ffffff;
}

/* 우측 스티키 실시간 구도 미리보기 & 결제 사이드바 */
.tkv2-aside {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.tkv2-aside__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tkv2-aside__title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.tkv2-aside__ratio {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent, #4f46e5);
  font-size: 11px;
  font-weight: 800;
}

/* 실시간 프리뷰 프레임 */
.tkv2-stage-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-control, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.tkv2-preview-frame {
  position: relative;
  width: 100%;
  max-width: 310px;
  max-height: 310px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  box-sizing: border-box;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  transition: aspect-ratio 0.2s ease, background 0.25s ease;
}

.tkv2-preview-frame--smartstore { background: linear-gradient(155deg, #eef2ff 0%, #e0e7ff 52%, #dbeafe 100%); color: #0f172a; }
.tkv2-preview-frame--coupang { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); color: #0f172a; }
.tkv2-preview-frame--oliveyoung { background: linear-gradient(155deg, #ecfdf5 0%, #e0f2fe 100%); color: #064e3b; }
.tkv2-preview-frame--editorial { background: linear-gradient(155deg, #faf6f1 0%, #efe6da 100%); color: #2c231e; }
.tkv2-preview-frame--kakao { background: linear-gradient(155deg, #fff7ed 0%, #fef3c7 100%); color: #7c2d12; }
.tkv2-preview-frame--info { background: linear-gradient(155deg, #eff6ff 0%, #e2e8f0 100%); color: #1e293b; }
.tkv2-preview-frame--youtube { background: linear-gradient(135deg, #0f172a 0%, #312e81 100%); color: #ffffff; }

.tkv2-preview-headline {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.tkv2-preview-badge {
  position: absolute;
  left: 14px;
  top: 56px;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.tkv2-preview-img-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 6px 0;
}

.tkv2-preview-img-wrap img {
  max-width: 78%;
  max-height: 165px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.18));
}

.tkv2-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 118px;
  height: 118px;
  border-radius: 14px;
  border: 1.5px dashed rgba(79, 70, 229, 0.35);
  background: rgba(255, 255, 255, 0.55);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

.tkv2-preview-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 700;
}

.tkv2-preview-price {
  padding: 2px 9px;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.tkv2-guardrails {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tkv2-guardrail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-control, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
  color: var(--text-secondary, #334155);
  font-size: 11px;
  font-weight: 700;
}

/* 포인트 요약 & CTA */
.tkv2-point-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--bg-control, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 12.5px;
  color: var(--text-secondary, #475569);
  font-variant-numeric: tabular-nums;
}

.tkv2-point-strip strong {
  color: var(--text-primary, #0f172a);
  font-weight: 800;
}

.tkv2-cta-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.tkv2-cta-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.tkv2-cta-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 내 라이브러리 선택 모달 */
.tkv2-lib-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tkv2-lib-backdrop[hidden] {
  display: none;
}

.tkv2-lib-modal {
  width: min(720px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-default, #e2e8f0);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.tkv2-lib-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tkv2-lib-modal__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.tkv2-lib-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
}

.tkv2-lib-item {
  border: 2px solid var(--border-default, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-control, #f8fafc);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  padding: 0;
}

.tkv2-lib-item:hover {
  border-color: #4f46e5;
}

.tkv2-lib-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 4대 분할 영역 (배너 여백 · 카피 구도) 선택기 */
.tkv2-split-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.tkv2-split-box__head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.tkv2-split-box__head strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.tkv2-split-box__head span {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.tkv2-split-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tkv2-split-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1.5px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-width: 0;
}

#thumbnailWorkspace.tkv2-active .thumb-size-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#thumbnailWorkspace.tkv2-active .thumb-wizard .thumb-card label.thumb-size-card {
  min-height: 70px;
  padding: 8px 9px;
  gap: 3px;
}

@media (max-width: 900px) {
  .tkv2-split-grid,
  #thumbnailWorkspace.tkv2-active .thumb-size-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tkv2-split-card:hover {
  border-color: #6366f1;
}

.tkv2-split-card.is-active {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.tkv2-split-mini {
  display: flex;
  gap: 3px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  padding: 3px;
  box-sizing: border-box;
}

.tkv2-split-mini span {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.tkv2-split-mini .m-copy { background: #e0e7ff; color: #3730a3; }
.tkv2-split-mini .m-prod { background: #fde68a; color: #92400e; }
.tkv2-split-mini .m-center { flex: 1; background: linear-gradient(90deg, #e0e7ff, #fde68a); color: #1e293b; }
.tkv2-split-mini .m-cta { background: #4f46e5; color: #ffffff; }

.tkv2-split-mini--left-copy .m-copy { flex: 6; }
.tkv2-split-mini--left-copy .m-prod { flex: 4; }
.tkv2-split-mini--left-product .m-prod { flex: 4.5; }
.tkv2-split-mini--left-product .m-copy { flex: 5.5; }
.tkv2-split-mini--triple .m-prod { flex: 2; }
.tkv2-split-mini--triple .m-copy { flex: 4.5; }
.tkv2-split-mini--triple .m-cta { flex: 3.5; }

.tkv2-split-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tkv2-split-meta strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.tkv2-split-meta em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
  padding: 2px 6px;
  border-radius: 999px;
}

.tkv2-split-card small {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

/* 우측 실시간 배너 분할 구도 반영 */
.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"],
.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"],
.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
}

.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"] {
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "badge img"
    "head img"
    "foot img";
  text-align: left;
}

.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"] {
  grid-template-columns: 1fr 1.25fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "img badge"
    "img head"
    "img foot";
  text-align: left;
}

.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] {
  grid-template-columns: 0.7fr 1.6fr 0.8fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "img badge foot"
    "img head foot";
  text-align: left;
}

.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"] .tkv2-preview-badge,
.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"] .tkv2-preview-badge,
.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] .tkv2-preview-badge {
  position: static;
  grid-area: badge;
  justify-self: start;
  margin: 0;
}

.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"] .tkv2-preview-headline,
.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"] .tkv2-preview-headline,
.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] .tkv2-preview-headline {
  grid-area: head;
  text-align: left;
  font-size: 13.5px;
}

.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"] .tkv2-preview-img-wrap,
.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"] .tkv2-preview-img-wrap,
.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] .tkv2-preview-img-wrap {
  grid-area: img;
  height: 100%;
  max-height: 120px;
}

.tkv2-preview-frame[data-split-mode="LEFT_COPY_RIGHT_PRODUCT"] .tkv2-preview-footer,
.tkv2-preview-frame[data-split-mode="LEFT_PRODUCT_RIGHT_COPY"] .tkv2-preview-footer,
.tkv2-preview-frame[data-split-mode="TRIPLE_STRIP"] .tkv2-preview-footer {
  grid-area: foot;
  justify-content: flex-start;
}

@media (max-width: 1080px) {
  .tkv2-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tkv2-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .tkv2-split-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 생성바 애니메이션 + 경과시간/남은시간 카드 */
@keyframes tkv2Shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes tkv2PulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

.tkv2-progress-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  margin-bottom: 12px;
}

.tkv2-progress-card.is-done {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 100%);
}

.tkv2-progress-card.is-fail {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fef2f2 0%, #f8fafc 100%);
}

.tkv2-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tkv2-progress-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #0f172a;
}

.tkv2-progress-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4f46e5;
}

.tkv2-progress-card.is-running .tkv2-progress-dot {
  animation: tkv2PulseDot 1.2s ease-in-out infinite;
}

.tkv2-progress-card.is-done .tkv2-progress-dot {
  background: #10b981;
}

.tkv2-progress-card.is-fail .tkv2-progress-dot {
  background: #ef4444;
}

.tkv2-progress-pct {
  padding: 2px 8px;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

.tkv2-progress-card.is-done .tkv2-progress-pct { background: #10b981; }
.tkv2-progress-card.is-fail .tkv2-progress-pct { background: #ef4444; }

.tkv2-progress-times {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tkv2-time-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}

.tkv2-time-pill b { color: #0f172a; font-weight: 800; }
.tkv2-time-pill--remain { border-color: #c7d2fe; color: #3730a3; }
.tkv2-time-pill--remain b { color: #4f46e5; }
.tkv2-time-pill--done { border-color: #a7f3d0; color: #065f46; }

.tkv2-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tkv2-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5 0%, #8b5cf6 50%, #4f46e5 100%);
  background-size: 200% 100%;
  transition: width 0.5s ease;
}

.tkv2-progress-card.is-running .tkv2-progress-fill {
  animation: tkv2Shimmer 1.6s linear infinite;
}

.tkv2-progress-card.is-done .tkv2-progress-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.tkv2-progress-card.is-fail .tkv2-progress-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* 결과 알림 모달 */
.tkv2-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.tkv2-alert-backdrop[hidden] {
  display: none !important;
}

.tkv2-alert-modal {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.tkv2-alert-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.tkv2-alert-modal__badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tkv2-alert-modal__badge.is-ok { background: #dcfce7; color: #15803d; }
.tkv2-alert-modal__badge.is-fail { background: #fee2e2; color: #b91c1c; }

.tkv2-alert-modal__title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
}

.tkv2-alert-modal__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #475569;
}

.tkv2-alert-modal__close {
  margin-left: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 20px;
  line-height: 1;
  color: #475569;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tkv2-alert-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tkv2-alert-modal__preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 0;
}

.tkv2-alert-modal__preview img {
  width: auto;
  max-width: 100%;
  max-height: min(46vh, 400px);
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.tkv2-alert-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tkv2-alert-modal__actions .btn {
  width: auto !important;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}

/* 좌우 동일 높이 정렬 및 이미지 대형화 (입력 화면 + 결과 비교 화면) */
#thumbnailWorkspace.tkv2-active .tkv2-layout {
  align-items: stretch;
}

#thumbnailWorkspace.tkv2-active .tkv2-left {
  display: flex;
  flex-direction: column;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-panel > .thumb-card {
  flex: 1;
  margin-bottom: 0;
}

#thumbnailWorkspace.tkv2-active .tkv2-aside {
  position: static;
  height: 100%;
  box-sizing: border-box;
}

#thumbnailWorkspace.tkv2-active .tkv2-stage-wrap {
  flex: 1;
  min-height: 300px;
  padding: 18px;
}

#thumbnailWorkspace.tkv2-active .tkv2-preview-frame {
  max-width: 100%;
  max-height: 380px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 20px;
  align-items: stretch;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare > .thumb-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-photos {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-photos button {
  flex: 1 1 220px;
  width: 100%;
  height: 100%;
  min-height: 260px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  cursor: zoom-in;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-photos img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  border-radius: 8px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-gallery article {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare .thumb-gallery img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 960px) {
  #thumbnailWorkspace.tkv2-active .thumb-result-compare {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Step 2 배경 그라데이션 · 그래픽 효과 6종 칩 & 실시간 프리뷰 반영 */
.tkv2-fx-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.tkv2-fx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tkv2-fx-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1.5px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tkv2-fx-chip:hover { border-color: #6366f1; }

.tkv2-fx-chip.is-active {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.06);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.tkv2-fx-chip strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.tkv2-fx-chip.is-active strong { color: #4338ca; }

.tkv2-fx-chip small {
  font-size: 10.5px;
  color: var(--text-secondary, #64748b);
  line-height: 1.3;
}

/* 실시간 프리뷰 내 효과 시각화 */
.tkv2-preview-frame[data-fx*="GRADIENT_SCRIM"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(15, 23, 42, 0.24) 0%, rgba(15, 23, 42, 0.06) 55%, transparent 100%);
  pointer-events: none;
}

.tkv2-preview-frame[data-fx*="DIAGONAL_SPLIT"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 54%, rgba(79, 70, 229, 0.14) 54.5%, rgba(79, 70, 229, 0.06) 100%);
  pointer-events: none;
}

.tkv2-preview-frame[data-fx*="DOUBLE_FRAME"] {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), inset 0 0 0 6px rgba(79, 70, 229, 0.18), 0 10px 26px rgba(15, 23, 42, 0.14);
}

.tkv2-preview-frame[data-fx*="GLASS_CARD"] .tkv2-preview-headline {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(4px);
  padding: 5px 8px;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .tkv2-fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 제작 중 블러 이미지 + 스캔 광선 + 타이포그래피 모션 스테이지 */
@keyframes tkv2ScanSweep {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(220%) skewX(-18deg); }
}

@keyframes tkv2BlurBreathe {
  0%, 100% { transform: scale(1.08); filter: blur(18px) saturate(1.15); }
  50% { transform: scale(1.14); filter: blur(12px) saturate(1.3); }
}

@keyframes tkv2Reveal {
  0% { opacity: 0; filter: blur(10px); transform: scale(0.985); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

.tkv2-reveal-img {
  animation: tkv2Reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tkv2-gen-stage {
  position: relative;
  width: 100%;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #0f172a 0%, #312e81 55%, #1e1b4b 100%);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.tkv2-gen-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  animation: tkv2BlurBreathe 4.2s ease-in-out infinite;
  pointer-events: none;
}

.tkv2-gen-bg--aurora {
  background: radial-gradient(circle at 25% 30%, #6366f1 0%, transparent 55%),
              radial-gradient(circle at 75% 70%, #ec4899 0%, transparent 55%);
}

.tkv2-gen-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.62) 0%, rgba(30, 27, 75, 0.48) 100%);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.tkv2-gen-scan {
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.24) 50%, transparent 100%);
  animation: tkv2ScanSweep 2.4s ease-in-out infinite;
  pointer-events: none;
}

.tkv2-gen-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  max-width: 460px;
}

.tkv2-gen-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e0e7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tkv2-gen-pulse {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #38bdf8;
  animation: tkv2PulseDot 1.1s ease-in-out infinite;
}

.tkv2-gen-headline {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.38;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.45);
  word-break: keep-all;
}

.tkv2-gen-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.9);
  word-break: keep-all;
}

.tkv2-gen-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tkv2-gen-step {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(203, 213, 225, 0.78);
}

.tkv2-gen-step.is-active {
  background: #4f46e5;
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.55);
}

.tkv2-gen-step.is-done {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

/* 전체 화면 공간 효율화 · 컴팩트 1-Screen 밀도 최적화 */
#thumbnailWorkspace.is-active.tkv2-active {
  max-width: none;
  width: 100%;
  gap: 10px;
  padding-bottom: 16px;
}

#thumbnailWorkspace.tkv2-active .thumb-heading {
  margin-bottom: 2px;
  gap: 8px;
}

#thumbnailWorkspace.tkv2-active .thumb-heading h1 {
  font-size: 20px;
  margin: 0 0 2px;
  line-height: 1.25;
}

#thumbnailWorkspace.tkv2-active .thumb-heading p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
}

#thumbnailWorkspace.tkv2-active .tkv2-tabs {
  padding: 4px;
  gap: 4px;
  border-radius: 11px;
}

#thumbnailWorkspace.tkv2-active .tkv2-tab {
  padding: 6px 13px;
  font-size: 12.5px;
  border-radius: 8px;
}

#thumbnailWorkspace.tkv2-active .tkv2-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
  gap: 12px;
}

#thumbnailWorkspace.tkv2-active .tkv2-left {
  gap: 10px;
}

#thumbnailWorkspace.tkv2-active .tkv2-stepper {
  gap: 6px;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-btn {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 10px;
  gap: 6px;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-num {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

#thumbnailWorkspace.tkv2-active .thumb-card {
  padding: 13px 15px;
  border-radius: 13px;
  margin-bottom: 0;
}

#thumbnailWorkspace.tkv2-active .thumb-card h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

#thumbnailWorkspace.tkv2-active .thumb-card label {
  margin: 8px 0;
  gap: 5px;
}

#thumbnailWorkspace.tkv2-active .thumb-card input:not([type=checkbox]),
#thumbnailWorkspace.tkv2-active .thumb-card select,
#thumbnailWorkspace.tkv2-active .thumb-card textarea {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

#thumbnailWorkspace.tkv2-active .thumb-wizard .thumb-card textarea {
  min-height: 88px;
}

#thumbnailWorkspace.tkv2-active .thumb-file {
  margin: 8px 0;
  gap: 6px;
}

#thumbnailWorkspace.tkv2-active .thumb-file__control {
  min-height: 68px;
  padding: 10px 12px;
}

#thumbnailWorkspace.tkv2-active .thumb-style-enhancer {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  gap: 7px;
}

#thumbnailWorkspace.tkv2-active .thumb-card button.thumb-style-chip--banner {
  min-height: 68px;
  padding: 8px 10px;
  gap: 2px;
}

#thumbnailWorkspace.tkv2-active .tkv2-fx-box,
#thumbnailWorkspace.tkv2-active .tkv2-split-box {
  margin-top: 10px;
  padding-top: 10px;
}

#thumbnailWorkspace.tkv2-active .tkv2-fx-chip {
  padding: 7px 9px;
}

#thumbnailWorkspace.tkv2-active .tkv2-aside {
  padding: 14px;
  gap: 10px;
  border-radius: 14px;
}

#thumbnailWorkspace.tkv2-active .tkv2-stage-wrap {
  min-height: 220px;
  padding: 12px;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-nav {
  padding-top: 2px;
}

#thumbnailWorkspace.tkv2-active .tkv2-step-nav__btn {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* 결과 비교 화면 컴팩트 밀도 최적화 */
#thumbnailWorkspace.tkv2-active .thumb-result-heading {
  margin: 0 0 10px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-heading h2 {
  font-size: 18px;
  margin: 0 0 2px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-heading p {
  margin: 0;
  font-size: 12.5px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare {
  gap: 12px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-compare h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

#thumbnailWorkspace.tkv2-active .tkv2-progress-card {
  padding: 10px 13px;
  gap: 7px;
  margin-bottom: 10px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-actions {
  margin: 12px 0 0;
  gap: 8px;
}

#thumbnailWorkspace.tkv2-active .thumb-result-actions .btn {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}

/* 확인 모달 취소 / 확인하고 제작 가로 1행 정렬 */
#thumbnailConfirm > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: nowrap;
}

#thumbnailConfirm > div > button,
#thumbnailConfirm > div > a {
  width: auto !important;
  flex: 0 0 auto;
  margin: 0 !important;
  min-width: 110px;
  min-height: 40px;
  white-space: nowrap;
}

.tkv2-face-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 8px 0 0 !important;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(79, 70, 229, 0.05);
  border: 1px solid rgba(79, 70, 229, 0.18);
  cursor: pointer;
  font-size: 12.5px;
}

.tkv2-face-toggle input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
  min-height: 0 !important;
  flex: 0 0 auto;
  accent-color: #4f46e5;
}

.tkv2-face-toggle small {
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

/* Step 4 강조 배지 1행 선택 UI */
.tkv2-badge-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--bg-control, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.tkv2-badge-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tkv2-badge-box__head strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

#thumbnailWorkspace.tkv2-active .tkv2-badge-custom {
  width: 190px !important;
  min-height: 30px !important;
  padding: 4px 9px !important;
  font-size: 12px !important;
  border-radius: 7px;
}

.tkv2-badge-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tkv2-badge-chip {
  padding: 5px 11px;
  min-height: 30px !important;
  border-radius: 999px;
  border: 1px solid var(--border-default, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.tkv2-badge-chip:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.tkv2-badge-chip.is-active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* 확인 모달 초상권 · 얼굴 이용 경고 및 필수 동의 박스 */
.tkv2-face-consent-box {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
}

.tkv2-face-consent-warn {
  margin: 0 0 10px !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  color: #78350f;
}

.tkv2-face-consent-check {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  font-size: 12.5px !important;
  font-weight: 700;
  line-height: 1.45 !important;
  color: #451a03;
  cursor: pointer;
}

.tkv2-face-consent-check input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: #d97706;
}
