/* Page Guide — interactive product demo
   - .pg-demo-page : 가맹점(쇼핑) 화면 테마 (네비와 분리)
   - .pg-demo-nav  : 실제 확장 프로그램 네비 테마(#0f172a / #0b5fff) */

.pg-demo-section {
  padding: 2.5rem 0 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.pg-demo-wrap {
  padding: 0 1.25rem;
}

.pg-demo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: min(70vh, 640px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14);
}

/* —— 목업 페이지: 따뜻한 쇼핑 테마 (네비 슬레이트/블루와 구분) —— */
.pg-demo-page {
  --pg-page-bg: #fff8f1;
  --pg-page-surface: #ffffff;
  --pg-page-sidebar: #ffe8d6;
  --pg-page-border: #f0d2b8;
  --pg-page-text: #3b2415;
  --pg-page-muted: #8a5a3a;
  --pg-page-accent: #d97706;
  --pg-page-accent-strong: #b45309;
  --pg-page-chrome: #f3e0cc;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--pg-page-bg);
  color: var(--pg-page-text);
  font-family: "Noto Sans KR", sans-serif;
}

.pg-demo-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--pg-page-chrome);
  border-bottom: 1px solid var(--pg-page-border);
  flex-shrink: 0;
}

.pg-demo-dots {
  display: flex;
  gap: 0.35rem;
}

.pg-demo-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}

.pg-demo-dots span:nth-child(2) {
  background: #febc2e;
}

.pg-demo-dots span:nth-child(3) {
  background: #28c840;
}

.pg-demo-url {
  flex: 1;
  font-size: 0.72rem;
  color: var(--pg-page-muted);
  background: #fff;
  border: 1px solid var(--pg-page-border);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-demo-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--pg-page-bg);
}

.pg-demo-side {
  width: 22%;
  min-width: 108px;
  padding: 1rem 0.75rem;
  background: var(--pg-page-sidebar);
  border-right: 1px solid var(--pg-page-border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pg-demo-side-item {
  font-size: 0.72rem;
  color: var(--pg-page-muted);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
}

.pg-demo-side-item.is-active {
  background: rgba(217, 119, 6, 0.16);
  color: var(--pg-page-accent-strong);
  font-weight: 700;
}

.pg-demo-main {
  flex: 1;
  padding: 1.1rem 1.2rem 1.3rem;
  position: relative;
  min-width: 0;
}

.pg-demo-heading {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  color: var(--pg-page-text);
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.pg-demo-sub {
  font-size: 0.75rem;
  color: var(--pg-page-muted);
  margin-bottom: 0.95rem;
}

.pg-demo-card {
  background: var(--pg-page-surface);
  border: 1px solid var(--pg-page-border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.06);
}

.pg-demo-field label {
  display: block;
  font-size: 0.68rem;
  color: var(--pg-page-muted);
  margin-bottom: 0.28rem;
  font-weight: 600;
}

.pg-demo-input,
.pg-demo-select {
  width: 100%;
  border: 1px solid var(--pg-page-border);
  background: #fffaf4;
  color: var(--pg-page-text);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
}

.pg-demo-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-top: 0.2rem;
}

.pg-demo-btn {
  border: 1px solid var(--pg-page-border);
  background: #fff;
  color: var(--pg-page-text);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.pg-demo-btn-primary {
  background: var(--pg-page-accent);
  border-color: var(--pg-page-accent);
  color: #fff;
}

.pg-demo-target.is-ghost {
  outline: 2px dashed rgba(11, 95, 255, 0.65);
  outline-offset: 3px;
  background: rgba(11, 95, 255, 0.1);
}

.pg-demo-target.is-selected,
.pg-demo-email.is-selected {
  outline: 2px solid #0b5fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.28);
}

.pg-demo-record-hint {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0b5fff;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  white-space: nowrap;
}

.pg-demo-record-hint.is-visible {
  opacity: 1;
}

/* —— 확장 팝업 (켜기용) —— */
.pg-demo-popup {
  position: absolute;
  top: 2.35rem;
  right: 0.8rem;
  width: min(230px, 42%);
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 0.85rem 0.9rem;
  z-index: 20;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: "Noto Sans KR", sans-serif;
}

.pg-demo-popup.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pg-demo-popup-title {
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.pg-demo-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pg-demo-popup-label {
  font-size: 0.72rem;
  font-weight: 700;
}

.pg-demo-popup-sub {
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.pg-demo-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  position: relative;
  flex-shrink: 0;
}

.pg-demo-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.pg-demo-switch.is-on {
  background: #0b5fff;
}

.pg-demo-switch.is-on::after {
  transform: translateX(16px);
}

/* —— 실제 확장 네비 (고정 다크 슬레이트) —— */
.pg-demo-nav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(280px, 52%);
  z-index: 18;
  color: #e2e8f0;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, top 0.25s ease,
    left 0.25s ease, right 0.25s ease, bottom 0.25s ease;
}

.pg-demo-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 개체선택 중에도 FAB는 우측 상단 유지 (하단 에디터 독과 겹치지 않음) */
.pg-demo-nav.is-picking {
  width: min(260px, 48%);
}

.pg-demo-nav.is-collapsed .pg-demo-nav-fab {
  display: flex;
}

.pg-demo-nav.is-collapsed .pg-demo-nav-main,
.pg-demo-nav.is-collapsed .pg-demo-nav-progress,
.pg-demo-nav.is-collapsed .pg-demo-nav-dock {
  display: none;
}

.pg-demo-nav:not(.is-collapsed) .pg-demo-nav-fab {
  display: none;
}

.pg-demo-nav-fab {
  display: none;
  position: relative;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 6px 6px 6px 10px;
  border: none;
  border-radius: 14px;
  background: #0b5fff;
  color: #fff;
  box-shadow: 0 12px 32px rgba(11, 95, 255, 0.35);
  box-sizing: border-box;
}

.pg-demo-nav-fab-drag {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
}

.pg-demo-nav-fab-hint {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
}

.pg-demo-nav-fab-prev {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-demo-nav-fab-step {
  flex-shrink: 0;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.pg-demo-nav-fab-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-demo-nav-fab-btn-stop {
  width: auto;
  min-width: 54px;
  padding: 0 8px;
  background: #dc2626;
  font-size: 10px;
}

.pg-demo-nav-main {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.pg-demo-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #111827;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.pg-demo-nav-head-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.pg-demo-nav-head-actions {
  display: inline-flex;
  gap: 4px;
}

.pg-demo-nav-icon {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pg-demo-nav-body {
  padding: 12px;
}

.pg-demo-nav-set-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.pg-demo-nav-set-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.pg-demo-nav-back {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.pg-demo-nav-set-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-demo-nav-page-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.pg-demo-nav-page-block {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.pg-demo-nav-page-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(11, 95, 255, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.pg-demo-nav-page-name {
  font-size: 12px;
  font-weight: 700;
  color: #eff6ff;
}

.pg-demo-nav-page-meta {
  font-size: 11px;
  color: #bfdbfe;
}

.pg-demo-nav-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.pg-demo-nav-step-num {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0b5fff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-demo-nav-step-title {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-demo-nav-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
}

.pg-demo-nav-progress[hidden],
.pg-demo-nav-dock[hidden] {
  display: none !important;
}

.pg-demo-nav-progress-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #0b5fff;
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-demo-nav-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.pg-demo-nav-progress-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.pg-demo-nav-dock {
  margin-top: 8px;
  padding: 10px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
}

.pg-demo-nav-actions {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 8px;
}

.pg-demo-nav-actions [data-demo="btnPick"],
.pg-demo-nav-actions [data-demo="btnClose"] {
  grid-column: 1 / -1;
}

.pg-demo-nav-actions [data-demo="btnPreview"] {
  grid-column: 1;
}

.pg-demo-nav-actions [data-demo="btnFinish"] {
  grid-column: 2;
}

.pg-demo-nav-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pg-demo-nav-btn.is-pick {
  background: #b91c1c;
  border-color: transparent;
  color: #fff;
}

.pg-demo-nav-btn.is-pick.is-active {
  background: #16a34a;
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.35);
}

.pg-demo-nav-btn.is-primary {
  background: #0b5fff;
  border-color: transparent;
  color: #fff;
}

.pg-demo-nav-btn.is-ghost {
  color: #94a3b8;
}

.pg-demo-nav-btn.is-active:not(.is-pick) {
  box-shadow: 0 0 0 2px rgba(77, 141, 255, 0.45);
}

/* —— 말주머니 에디터 (Pay now 버튼 위쪽, 버튼을 가리지 않음) —— */
.pg-demo-live-bubble {
  position: absolute;
  left: auto;
  right: 6%;
  top: 30%;
  width: min(240px, 42%);
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 0.7rem;
  z-index: 16;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  color: #f8fafc;
}

.pg-demo-live-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pg-demo-bubble-type {
  min-height: 2.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #f8fafc;
  background: #1e293b;
  white-space: pre-wrap;
}

.pg-demo-bubble-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0.55rem;
}

.pg-demo-bubble-actions .pg-demo-nav-btn {
  min-height: 30px;
  font-size: 11px;
}

.pg-demo-editor-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 15;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  color: #e2e8f0;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.pg-demo-editor-dock.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pg-demo-dock-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.pg-demo-dock-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.pg-demo-dock-field--wide {
  grid-column: 1 / -1;
}

.pg-demo-dock-field .pg-demo-input,
.pg-demo-dock-field .pg-demo-select {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fafc;
}

.pg-demo-guide-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
}

.pg-demo-speech {
  position: absolute;
  max-width: 200px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  --pg-arrow-x: 50%;
  --pg-arrow-y: 50%;
}

.pg-demo-speech.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 기본: 아래쪽 꼬리 (타겟이 말주머니 아래) */
.pg-demo-speech::before {
  content: "";
  position: absolute;
  left: var(--pg-arrow-x);
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #0f172a;
  transform: translateX(-50%) rotate(45deg);
}

.pg-demo-speech[data-side="left"]::before {
  left: auto;
  right: -5px;
  bottom: auto;
  top: var(--pg-arrow-y);
  transform: translateY(-50%) rotate(45deg);
}

.pg-demo-speech[data-side="right"]::before {
  left: -5px;
  right: auto;
  bottom: auto;
  top: var(--pg-arrow-y);
  transform: translateY(-50%) rotate(45deg);
}

.pg-demo-speech[data-anchor="save"],
.pg-demo-speech[data-anchor="email"] {
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
}

.pg-demo-footer-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.72rem;
  z-index: 10;
  transform: translateY(110%);
  transition: transform 0.28s ease;
}

.pg-demo-footer-bar.is-visible {
  transform: translateY(0);
}

.pg-demo-footer-nav {
  display: flex;
  gap: 0.55rem;
  font-weight: 700;
  opacity: 0.9;
}

.pg-demo-toast {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 22;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-demo-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pg-demo-export-note {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 3.4rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--pg-page-text);
  background: #fff;
  border: 1px solid var(--pg-page-border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  z-index: 21;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pg-demo-export-note.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pg-demo-export-dialog {
  position: absolute;
  inset: 0;
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pg-demo-export-dialog.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pg-demo-export-card {
  width: min(300px, 86%);
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.pg-demo-export-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.pg-demo-export-hint {
  font-size: 0.7rem;
  line-height: 1.45;
  color: #94a3b8;
  margin-bottom: 0.85rem;
}

.pg-demo-export-formats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.pg-demo-export-fmt {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #111827;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.pg-demo-export-fmt.is-selected,
.pg-demo-export-fmt.is-pdf.is-selected,
.pg-demo-export-fmt.is-video.is-selected {
  border-color: #0b5fff;
  box-shadow: 0 0 0 2px rgba(11, 95, 255, 0.35);
  background: rgba(11, 95, 255, 0.18);
}

.pg-demo-export-pdf-opts,
.pg-demo-export-video-opts {
  margin-top: 0.65rem;
  font-size: 0.68rem;
  color: #93c5fd;
  text-align: center;
}

.pg-demo-video-player {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(440px, 92%);
  z-index: 24;
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.pg-demo-video-player.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pg-demo-video-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: #111827;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
}

.pg-demo-video-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(11, 95, 255, 0.25);
  color: #93c5fd;
  font-size: 0.6rem;
}

.pg-demo-video-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #fff8f1;
  overflow: hidden;
}

.pg-demo-video-mini {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.65rem 0.7rem;
}

.pg-demo-video-mini-bar {
  height: 8px;
  width: 42%;
  border-radius: 4px;
  background: #f0d2b8;
  margin-bottom: 0.55rem;
}

.pg-demo-video-mini-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #f0d2b8;
  border-radius: 10px;
  padding: 0.55rem;
}

.pg-demo-video-mini-field {
  height: 10px;
  border-radius: 4px;
  background: #ffe8d6;
  margin-bottom: 0.4rem;
}

.pg-demo-video-mini-field.short {
  width: 58%;
}

.pg-demo-video-mini-actions {
  position: relative;
  margin-top: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 92%;
}

.pg-demo-video-mini-btn {
  display: inline-flex;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: #d97706;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
}

.pg-demo-video-mini-btn.is-pulse {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.25);
  animation: pg-demo-video-pulse 1s ease-in-out infinite;
}

/* 말주머니 = 버튼 바로 위, 꼬리는 버튼 중앙을 가리킴 */
.pg-demo-video-mini-bubble {
  position: relative;
  left: 0;
  right: auto;
  bottom: auto;
  max-width: 100%;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.52rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pg-demo-video-mini-bubble.is-on {
  opacity: 1;
  transform: translateY(0);
}

.pg-demo-video-mini-bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: #0f172a;
  transform: rotate(45deg);
}

.pg-demo-video-scrim {
  display: none;
}

.pg-demo-video-player.is-playing .pg-demo-video-scrim {
  display: block;
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.18));
  pointer-events: none;
}

.pg-demo-video-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem 0.55rem;
  background: #0b1220;
  color: #e2e8f0;
}

.pg-demo-video-play {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b5fff;
  color: #fff;
  font-size: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-demo-video-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.pg-demo-video-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #0b5fff;
  border-radius: inherit;
  transition: width 0.55s ease;
}

.pg-demo-video-time {
  font-size: 0.58rem;
  color: #94a3b8;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

@keyframes pg-demo-video-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.22);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(11, 95, 255, 0.12);
  }
}

/* —— PDF 뷰어 미리보기 —— */
.pg-demo-pdf-viewer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(420px, 90%);
  z-index: 25;
  background: #334155;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.pg-demo-pdf-viewer.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pg-demo-pdf-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 700;
}

.pg-demo-pdf-pages {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.58rem;
}

.pg-demo-pdf-sheet {
  margin: 0.55rem 0.6rem 0.65rem;
  padding: 0.7rem 0.75rem 0.75rem;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color: #1e293b;
}

.pg-demo-pdf-doc-title {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.pg-demo-pdf-meta {
  font-size: 0.55rem;
  color: #64748b;
  margin-bottom: 0.55rem;
}

.pg-demo-pdf-shot {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff8f1;
}

.pg-demo-pdf-shot-field {
  height: 8px;
  border-radius: 3px;
  background: #ffe8d6;
  margin-bottom: 0.3rem;
}

.pg-demo-pdf-shot-field.short {
  width: 55%;
}

.pg-demo-pdf-shot-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.pg-demo-pdf-shot-btn {
  display: inline-flex;
  padding: 0.22rem 0.45rem;
  border-radius: 5px;
  font-size: 0.5rem;
  font-weight: 800;
}

.pg-demo-pdf-shot-btn.ghost {
  background: #fff;
  border: 1px solid #f0d2b8;
  color: #8a5a3a;
}

.pg-demo-pdf-shot-btn.primary {
  background: #d97706;
  color: #fff;
}

.pg-demo-pdf-shot-btn.primary.is-marked {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
}

.pg-demo-pdf-shot-tip {
  margin-top: 0.45rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.48rem;
  line-height: 1.35;
  max-width: 88%;
}

.pg-demo-pdf-step {
  margin-top: 0.5rem;
  font-size: 0.58rem;
  color: #334155;
  font-weight: 600;
}

.pg-demo-select.is-highlight {
  border-color: #0b5fff;
  box-shadow: 0 0 0 2px rgba(11, 95, 255, 0.28);
}

.pg-demo-live-bubble.is-bounce,
.pg-demo-speech.is-bounce {
  animation: pg-demo-bubble-bounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pg-demo-bubble-bounce {
  0% {
    transform: translateY(-10px) scale(0.86);
    opacity: 0;
  }
  60% {
    transform: translateY(-4px) scale(1.04);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.pg-demo-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translate(-2px, -2px);
  transition: opacity 0.15s ease;
}

.pg-demo-cursor.is-visible {
  opacity: 1;
}

.pg-demo-cursor.is-moving {
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.pg-demo-cursor svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.pg-demo-cursor.is-pressing svg {
  transform: scale(0.86);
}

.pg-demo-cursor-ring {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(11, 95, 255, 0.55);
  opacity: 0;
  transform: scale(0.4);
}

.pg-demo-cursor-ring.is-clicking {
  animation: pg-demo-click-ring 0.35s ease-out;
}

@keyframes pg-demo-click-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

.pg-demo-segment-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
  justify-content: center;
}

.pg-demo-segment-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.pg-demo-segment-btn:hover {
  background: var(--btn-hover-bg);
  color: var(--text);
}

.pg-demo-segment-btn.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pg-demo-segment-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
}

.pg-demo-segment-label {
  position: relative;
  z-index: 1;
}

@media (max-width: 720px) {
  .pg-demo-side {
    display: none;
  }

  .pg-demo-stage {
    aspect-ratio: 4 / 5;
    max-height: none;
  }

  .pg-demo-nav {
    width: min(250px, 78%);
  }

  .pg-demo-dock-fields {
    grid-template-columns: 1fr;
  }

  .pg-demo-export-formats {
    grid-template-columns: 1fr;
  }

  .pg-demo-video-player {
    width: min(360px, 94%);
  }

  .pg-demo-pdf-viewer {
    width: min(340px, 92%);
  }
}
