:root {
  --poc-primary-50: #eef4ff;
  --poc-primary-500: #356df3;
  --poc-primary-600: #245be7;
  --poc-primary-700: #1748c7;
  --poc-neutral-50: #f6f7f9;
  --poc-neutral-100: #eceff3;
  --poc-neutral-300: #cfd4dc;
  --poc-neutral-600: #586174;
  --poc-neutral-900: #11151d;
  --poc-white: #ffffff;
  --poc-line: #e1e5eb;
  --cpw: 428px;
}

html, body {
  min-height: 100%;
  background: var(--poc-neutral-50);
  color: var(--poc-neutral-900);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

body:not(.embed):not(.thumb) { padding-right: var(--cpw); }

.apphdr {
  height: 64px;
  margin-right: calc(-1 * var(--cpw));
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(225, 229, 235, 0.88);
  backdrop-filter: blur(16px);
}

.apphdr .lg { display: flex; align-items: center; }
.apphdr .lg img { height: 24px; }

.poc-prod-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  margin-left: 24px;
  margin-right: auto;
  padding: 4px;
  border-radius: 10px;
  background: var(--poc-neutral-100);
}

.poc-prod-switch a {
  min-width: 80px;
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--poc-neutral-600);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.poc-prod-switch a.active {
  background: var(--poc-white);
  color: var(--poc-neutral-900);
  box-shadow: 0 1px 4px rgba(17, 21, 29, 0.12);
}

.apphdr .acts { gap: 8px; }

.hbtn {
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.hbtn:not(.ghost) { background: var(--poc-primary-600); }
.hbtn:not(.ghost):hover { background: var(--poc-primary-700); filter: none; }
.hbtn.ghost { background: var(--poc-white); border-color: var(--poc-line); color: #3d4656; }
.hbtn.ghost:hover { background: var(--poc-neutral-50); filter: none; }
.huser { margin-left: 4px; font-size: 13px; }

.cpanel {
  top: 64px;
  width: var(--cpw);
  height: calc(100vh - 64px);
  padding: 24px 24px 120px;
  border-left: 1px solid var(--poc-line);
  box-shadow: -12px 0 40px rgba(17, 21, 29, 0.04);
  font-size: 14px;
  scrollbar-color: var(--poc-neutral-300) transparent;
}

.cpanel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.cpanel .sub {
  margin: 0 0 24px;
  color: var(--poc-neutral-600);
  font-size: 14px;
  line-height: 1.6;
}

.poc-panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--poc-primary-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.poc-panel-label::before {
  width: 24px;
  height: 2px;
  background: currentColor;
  content: "";
}

.poc-tabs {
  position: sticky;
  top: -24px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 -4px 28px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.poc-tab {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--poc-neutral-600);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.poc-tab span {
  display: inline-flex;
  width: 20px;
  height: 20px;
  margin-right: 4px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--poc-neutral-100);
  font-size: 11px;
}

.poc-tab.active { background: var(--poc-primary-50); color: var(--poc-primary-600); }
.poc-tab.active span { background: var(--poc-primary-600); color: var(--poc-white); }
.poc-step[hidden] { display: none !important; }
.cpanel .grp[hidden] { display: none !important; }

.cpanel .grp { margin-bottom: 32px; }
.cpanel .gh { margin-bottom: 12px; font-size: 15px; font-weight: 750; letter-spacing: -0.02em; }
.cpanel .gh2 { margin: 16px 0 8px; font-size: 13px; }
.cpanel .btns2 { gap: 8px; }
.cpanel .btns3 { gap: 4px; padding: 4px; border-radius: 12px; }

.cpanel .opt {
  min-height: 44px;
  padding: 8px 10px;
  border-color: var(--poc-neutral-300);
  border-radius: 10px;
  color: #465062;
  font-size: 14px;
  font-weight: 650;
}

.cpanel .opt:hover { border-color: #9db7f9; background: var(--poc-primary-50); }
.cpanel .opt.active { border-color: var(--poc-primary-600); background: var(--poc-primary-50); color: var(--poc-primary-600); }
.cpanel .btns3 .opt { min-height: 40px; font-size: 13px; }
.cpanel .group-title-row {
  min-height: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cpanel .group-title-row .gh { margin: 0; }

.cpanel .selection-status,
.cpanel .optional-badge {
  min-height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--poc-primary-50);
  color: var(--poc-primary-600);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cpanel .poc-segment {
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--poc-neutral-100);
}

.cpanel .poc-segment .opt {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--poc-neutral-600);
}

.cpanel .poc-segment .opt:hover { border: 0; background: rgba(255, 255, 255, 0.72); }
.cpanel .poc-segment .opt.active {
  border: 0;
  background: var(--poc-white);
  color: var(--poc-neutral-900);
  box-shadow: 0 1px 4px rgba(17, 21, 29, 0.13);
}

.cpanel .sample-panel { margin-top: 12px; }
.cpanel .control-hint {
  margin: 0 0 10px;
  color: var(--poc-neutral-600);
  font-size: 12px;
  line-height: 1.5;
}

.cpanel .samples { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.cpanel .sample-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--poc-white);
  box-shadow: 0 0 0 1px var(--poc-neutral-300);
  cursor: pointer;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.cpanel .sample-card img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: none;
  cursor: inherit;
  transform: none;
}

.cpanel .sample-card img:hover { box-shadow: none; transform: none; }

.cpanel .sample-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px #a9bff7, 0 5px 12px rgba(17, 21, 29, 0.12); }
.cpanel .sample-card.active { box-shadow: 0 0 0 3px var(--poc-primary-500), 0 6px 14px rgba(36, 91, 231, 0.18); }
.cpanel .sample-card:focus-visible { outline: 3px solid rgba(53, 109, 243, 0.26); outline-offset: 3px; }

.cpanel .sample-index {
  position: absolute;
  left: 5px;
  bottom: 5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(17, 21, 29, 0.72);
  color: var(--poc-white);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cpanel .sample-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--poc-white);
  border-radius: 50%;
  background: var(--poc-primary-600);
  color: var(--poc-white);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 150ms ease, transform 150ms ease;
}

.cpanel .sample-card.active .sample-check { opacity: 1; transform: scale(1); }

.cpanel .overlay-card {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--poc-line);
  border-radius: 14px;
  background: #fafbfc;
}

.cpanel .overlay-card-head {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cpanel .overlay-title { color: var(--poc-neutral-900); font-size: 14px; font-weight: 800; }
.cpanel .overlay-card-head p { margin: 4px 0 0; color: var(--poc-neutral-600); font-size: 11px; line-height: 1.5; }
.cpanel .optional-badge { min-height: 22px; background: var(--poc-neutral-100); color: var(--poc-neutral-600); }
.cpanel .poc-segment.compact .opt { min-height: 36px; font-size: 13px; }
.cpanel .overlay-fields { margin-top: 16px; }
.cpanel .field-label { margin: 12px 0 7px; display: block; color: var(--poc-neutral-600); font-size: 12px; font-weight: 750; }
.cpanel .overlay-fields .field-label:first-child { margin-top: 0; }
.cpanel .overlay-fields select { margin-top: 0; }

.cpanel .range-grid {
  margin-top: 16px;
  padding-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border-top: 1px solid var(--poc-line);
}

.cpanel .range-grid .rng { margin: 0; }
.cpanel .range-grid .rng > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cpanel .range-grid output { color: var(--poc-primary-600); font-size: 11px; font-weight: 800; }

.cpanel input[type="text"],
.cpanel select {
  min-height: 44px;
  padding: 0 12px;
  border-color: var(--poc-neutral-300);
  border-radius: 10px;
  font-size: 14px;
}

.cpanel .swatches { gap: 8px; }
.cpanel .swatches button,
.cpanel .cpick { width: 32px; height: 32px; }
.cpanel .rng { margin-top: 16px; font-size: 13px; }
.cpanel input[type="range"] { min-height: 28px; }
.cpanel input[type="file"] { font-size: 13px; }
.cpanel input[type="file"]::file-selector-button { min-height: 36px; font-size: 13px; }

.poc-wizard-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: var(--cpw);
  min-height: 88px;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--poc-line);
  backdrop-filter: blur(16px);
}

.poc-nav-button {
  min-height: 48px;
  border: 1px solid var(--poc-line);
  border-radius: 10px;
  background: var(--poc-white);
  color: #3d4656;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}

.poc-nav-button.primary { border-color: var(--poc-primary-600); background: var(--poc-primary-600); color: var(--poc-white); }
.poc-nav-button.primary:hover { background: var(--poc-primary-700); }
.poc-nav-button:disabled { opacity: 0.36; cursor: default; }

.sheet {
  width: auto;
  max-width: none;
  margin: 24px;
  overflow: hidden;
  border: 1px solid var(--poc-line);
  border-radius: 16px;
  background: var(--poc-white);
  box-shadow: 0 8px 32px rgba(17, 21, 29, 0.05);
}

.sheet .head { display: none; }
.sheet .main { padding: 0; }

.poc-canvasbar {
  min-height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--poc-line);
  background: var(--poc-white);
}

.poc-canvas-title strong { display: block; font-size: 14px; }
.poc-canvas-title span { display: block; margin-top: 2px; color: var(--poc-neutral-600); font-size: 12px; }

.poc-view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--poc-neutral-100);
}

.poc-view-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--poc-neutral-600);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.poc-view-tabs button.active { background: var(--poc-white); color: var(--poc-neutral-900); box-shadow: 0 1px 4px rgba(17, 21, 29, 0.12); }

body:not(.thumb) .sheet .stage {
  min-height: calc(100vh - 154px);
  padding: 32px 56px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 40px;
  align-items: center;
  justify-content: center;
  background-color: #f7f8fa;
  background-image: radial-gradient(#d9dee7 1px, transparent 1px);
  background-size: 20px 20px;
}

body:not(.thumb) .sheet .stage > .col:nth-child(1),
body:not(.thumb) .sheet .stage > .col:nth-child(2),
body:not(.thumb) .sheet .stage > .col:nth-child(5) { display: none !important; }

body:not(.thumb) .sheet .vshape {
  min-width: 0;
  height: auto !important;
  padding: 24px 16px 16px;
  border: 1px solid var(--poc-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(17, 21, 29, 0.06);
}

body:not(.thumb) .sheet .vshape > svg {
  width: auto;
  max-width: 100%;
  height: clamp(480px, calc(100vh - 240px), 720px) !important;
  margin-top: 32px;
}

body:not(.thumb) .sheet .vshape .label-tag {
  top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--poc-neutral-900);
  font-size: 12px;
}

body.poc-front-only .sheet .stage,
body.poc-back-only .sheet .stage { grid-template-columns: minmax(280px, 520px); }
body.poc-front-only #vshapeBack,
body.poc-back-only #vshapeFront { display: none !important; }

.notice {
  margin: 0 !important;
  padding: 0;
  border-top: 1px solid var(--poc-line);
  background: var(--poc-white);
}

.poc-notice-details summary {
  min-height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #444d5d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.poc-notice-details summary::-webkit-details-marker { display: none; }
.poc-notice-details summary::after { color: var(--poc-neutral-600); content: "+"; font-size: 20px; font-weight: 400; }
.poc-notice-details[open] summary::after { content: "−"; }
.poc-notice-content { padding: 0 20px 20px; }
.poc-notice-content .pill { display: none; }
.poc-notice-content h4 { display: block; margin: 0 0 8px; font-size: 13px; }
.poc-notice-content .meta { float: none; display: block; margin: 0 0 8px; }

/* 데스크톱 풀페이지 작업영역: 외부 문서 스크롤 없이 캔버스와 설정 패널만 각각 동작 */
@media (min-width: 941px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .apphdr {
    position: relative;
    top: auto;
    flex: 0 0 64px;
  }

  .sheet {
    width: 100%;
    height: calc(100vh - 64px);
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet .main {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .poc-canvasbar {
    flex: 0 0 64px;
  }

  body:not(.thumb) .sheet .stage {
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  body:not(.thumb) .sheet .vshape {
    max-height: 100%;
    overflow: hidden;
  }

  body:not(.thumb) .sheet .vshape > svg {
    height: min(64vh, 680px) !important;
    max-height: calc(100vh - 264px);
  }

  .notice {
    flex: 0 0 auto;
  }
}

@media (max-width: 1180px) {
  :root { --cpw: 388px; }
  .cpanel { width: var(--cpw); }
  .sheet { margin: 24px; }
  body:not(.thumb) .sheet .stage { padding: 24px; gap: 16px; }
  body:not(.thumb) .sheet .vshape > svg { height: clamp(440px, calc(100vh - 240px), 620px) !important; }
}

@media (max-width: 940px) {
  :root { --cpw: 0px; }
  body:not(.embed):not(.thumb) { padding: 0; }
  .apphdr { margin-right: 0; }
  .sheet { margin: 16px; }
  body:not(.thumb) .sheet .stage { min-height: 600px; }
  body:not(.thumb) .sheet .vshape > svg { height: 520px; }
  .cpanel {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 32px 24px 112px;
    overflow: visible !important;
    border-top: 8px solid var(--poc-neutral-100);
    border-left: 0;
    box-shadow: none;
  }
  .poc-tabs { top: 64px; }
  .poc-wizard-nav { width: 100%; }
}

@media (max-width: 760px) {
  .apphdr { height: 60px; padding: 0 16px; }
  .apphdr .lg img { height: 21px; }
  .poc-prod-switch { height: 36px; margin-left: 12px; padding: 2px; }
  .poc-prod-switch a { min-width: 64px; height: 32px; padding: 0 8px; font-size: 12px; }
  .hamburger { margin-left: auto; }
  .apphdr .acts { top: 60px; padding: 12px 16px; }
  .sheet { margin: 8px; border-radius: 12px; }
  .poc-canvasbar { min-height: 56px; padding: 0 12px; }
  .poc-canvas-title span { display: none; }
  .poc-view-tabs button { padding: 0 8px; }
  body:not(.thumb) .sheet .stage {
    min-height: 0 !important;
    padding: 16px 8px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  body:not(.thumb) .sheet .vshape { padding: 20px 4px 8px; border-radius: 10px; }
  body:not(.thumb) .sheet .vshape > svg { width: 100% !important; height: auto !important; max-height: 480px; margin-top: 24px; }
  body.poc-front-only .sheet .stage,
  body.poc-back-only .sheet .stage { grid-template-columns: minmax(0, 1fr) !important; }
  .cpanel { padding: 24px 16px 112px; }
  .cpanel h2 { font-size: 22px; }
  .poc-tabs { top: 60px; margin-bottom: 24px; }
  .poc-tab { font-size: 12px; }
  .poc-tab span { display: none; }
  .cpanel .samples { grid-template-columns: repeat(5, 1fr); }
  .poc-wizard-nav { min-height: 80px; padding: 12px 16px; grid-template-columns: 88px 1fr; }
  .notice ul { font-size: 12px; }
}

@media (max-width: 380px) {
  .poc-prod-switch a { min-width: 56px; padding: 0 6px; }
  .poc-view-tabs button { font-size: 11px; }
  .cpanel .samples { grid-template-columns: repeat(4, 1fr); }
}
