/* 다크 피날레의 같은 무대 안에 놓는다. 흰 편집 카드만 독립적으로 스크롤한다.
   무대의 overflow:clip은 입력 초점이 숨겨진 3D 영역까지 스크롤하는 것을 막는다. */
.playground { scroll-margin-top: 76px; color: #EFF4FF; }
.playground-finale { position: absolute; inset: 0; z-index: 6; padding: max(220px, calc(28vh + 24px)) 24px 24px; overflow-y: auto; pointer-events: none; background: linear-gradient(to bottom, transparent 0, transparent 180px, rgba(11,16,48,.72) 260px, rgba(11,16,48,.97) 440px); }
.pg-fan { display: none; }
.pg-wrap { max-width: 760px; margin: auto; }
.ps { text-align: left; }
.ps-form, .ps-details { padding: 18px; }
.ps h3 { font-size: 1.15rem; line-height: 1.4; margin: 0 0 10px; word-break: keep-all; }
.ps-sub { font-size: 1rem; line-height: 1.6; color: #47536A; margin-bottom: 14px; }
.ps-label { display: block; font-size: .875rem; line-height: 1.5; font-weight: 650; margin: 12px 0; }
.ps :is(textarea, input:not([type=file])) { display: block; width: 100%; font: inherit; font-size: 1rem; line-height: 1.6; padding: 10px 12px; border: 1px solid #BDCBE5; border-radius: 8px; color: #181B1F; background: #FCFDFF; margin-top: 6px; }
.ps textarea { resize: vertical; min-height: 90px; }
.ps textarea::placeholder { color: #68758B; }
.ps-meta { font-size: .8125rem; line-height: 1.6; color: #526079; margin: 8px 0; overflow-wrap: anywhere; }
.ps-boundary { font-size: .875rem; line-height: 1.6; color: #47536A; margin: 12px 0; }
.ps-actions, .ps-attachment, .ps-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-actions { margin-top: 12px; }
.ps-header { justify-content: space-between; padding: 10px 16px; }
.ps-link { appearance: none; font: inherit; font-size: .875rem; color: #26418C; text-decoration: underline; text-underline-offset: 3px; background: transparent; border: 0; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.ps-attachment { padding: 6px 10px; background: #EAF0FF; border: 1px solid #CBD7EF; border-radius: 8px; font-size: .875rem; overflow-wrap: anywhere; }
.ps-attachment span { min-width: 0; flex: 1; }
.ps-canvas { padding: 18px; background: radial-gradient(#CAD5EA 1px, transparent 1px) 0 0 / 20px 20px, #F4F7FE; border-block: 1px solid #E2E7F1; }
.ps-canvas h3 { padding: 15px; border: 1px solid #6F8CCC; border-radius: 9px; background: white; overflow-wrap: anywhere; }
.ps-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 14px; }
.ps-source { appearance: none; font: inherit; font-size: .875rem; line-height: 1.5; min-height: 52px; padding: 10px 14px; border: 1px solid #CBD7EF; border-radius: 8px; background: #fff; color: #26418C; cursor: pointer; overflow-wrap: anywhere; }
.ps details { margin-bottom: 16px; }
.ps summary { cursor: pointer; font-size: 1rem; min-height: 44px; padding-block: 10px; font-weight: 650; }
.ps pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 1rem; line-height: 1.6; background: #F5F7FC; padding: 12px; margin-top: 8px; }
.ps h4 { font-size: .875rem; margin-top: 12px; overflow-wrap: anywhere; }
.ps-pending { padding: 12px 0; font-size: .875rem; color: #526079; }
.ps-status { padding: 0 18px 14px; font-size: .875rem; line-height: 1.6; color: #526079; }
.ps [data-message]:not(:empty) { margin-top: 8px; color: #26418C; }
.ps [data-save][data-error=true] { color: #96351F; }
.ps-back { display: flex; margin: 0 auto 10px; }
@media (max-width: 420px) { .ps-sources { grid-template-columns: 1fr; } .ps-actions .pg-button { flex: 1 1 140px; } }
.pg-heading { text-align: center; margin-bottom: 16px; }
.playground h2 { font-size: clamp(25px, 3.2vw, 36px); font-weight: 800; letter-spacing: -.045em; line-height: 1.25; margin: 0 0 12px; word-break: keep-all; overflow-wrap: anywhere; }
.playground h2 span { color: #AEC6FF; }
.pg-intro { font-size: 13px; color: #D0DCF4; max-width: 650px; margin-inline: auto; line-height: 1.7; word-break: keep-all; }
.pg-workbench { max-width: 600px; max-height: clamp(210px, calc(100dvh - 450px), 380px); margin-inline: auto; border: 1px solid #C9D2E7; border-radius: 16px; background: #fff; color: #181B1F; color-scheme: light; box-shadow: 0 14px 50px #0003; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.pg-bar { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #E2E7F1; }
.pg-project { font-size: 16px; font-weight: 750; }
.pg-tag { font-size: 12px; border: 1px solid #CDD7ED; border-radius: 6px; padding: 3px 7px; color: #26418C; margin-right: 8px; }
.pg-save { color: #526079; font-size: 13px; max-width: 520px; }
.pg-save[data-error='true'] { color: #9A351F; }
.pg-body { display: block; }
.pg-canvas { min-width: 0; background: radial-gradient(#C9D5ED 1px, transparent 1px) 0 0 / 22px 22px, #F4F7FE; padding: 16px; }
.pg-canvas-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; color: #526079; font-size: 13px; }
.pg-source { padding: 16px 18px; border: 1px solid #DCE3EF; border-radius: 12px; background: #FFFFFFCF; margin-top: 18px; font-size: 14px; color: #526079; }
.pg-source summary { cursor: pointer; color: #353F51; font-weight: 650; min-height: 24px; }
.pg-source p { padding-top: 12px; line-height: 1.75; white-space: pre-line; }
.pg-graph { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; padding: 24px 0; min-height: 132px; align-content: center; }
.pg-graph > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pg-node { position: relative; z-index: 1; min-width: 0; appearance: none; text-align: left; padding: 15px; border: 1px solid #C5D0E5; background: white; border-radius: 12px; box-shadow: 0 4px 10px #15265009; color: #181B1F; cursor: pointer; font-family: inherit; }
.pg-node[aria-pressed='true'] { border-color: #2C4BC4; box-shadow: 0 0 0 2px #2C4BC425, 0 6px 14px #1526500D; }
.pg-node[data-included='false'] { border-style: dashed; background: #F0F2F7; }
.pg-node-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12px; color: #526079; margin-bottom: 7px; }
.pg-node strong { display: block; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.pg-node-state { color: #26418C; font-size: 12px; }
.pg-node[data-included='false'] .pg-node-state { color: #626974; }
.pg-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pg-button { font: inherit; font-size: 14px; font-weight: 650; padding: 10px 14px; min-height: 44px; border: 1px solid #CAD4E8; border-radius: 9px; background: #fff; color: #26418C; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.pg-button:hover:not(:disabled) { background: #EAF0FD; border-color: #7A91CF; }
.pg-button:disabled { color: #707886; cursor: not-allowed; background: #F3F4F7; }
.playground :is(button, input, textarea, summary, a):focus-visible { outline: 3px solid #5579E5; outline-offset: 4px; }
.pg-button-primary { color: white; background: #2C4BC4; border-color: #2C4BC4; }
.pg-button-primary:hover:not(:disabled) { background: #26418C; color: white; }
.pg-editor { padding: 18px; border-top: 1px solid #E2E7F1; min-width: 0; }
.pg-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pg-editor h3 { font-size: 16px; }
.pg-field { display: block; font-size: 14px; color: #464C54; font-weight: 600; margin: 14px 0; }
.pg-field input, .pg-field textarea { display: block; width: 100%; margin-top: 7px; font: inherit; font-size: 16px; font-weight: 400; line-height: 1.55; color: #181B1F; padding: 10px 12px; background: #FBFCFF; border: 1px solid #CAD4E8; border-radius: 8px; }
.pg-field textarea { min-height: 112px; resize: vertical; }
.pg-check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; margin: 18px 0 8px; color: #26418C; }
.pg-check input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: #2C4BC4; }
.pg-hint { font-size: 13px; color: #626D80; line-height: 1.6; }
.pg-origin { margin: 14px 0 18px; padding-left: 10px; border-left: 2px solid #CBD7F2; font-size: 13px; color: #626D80; overflow-wrap: anywhere; }
.pg-footer { border-top: 1px solid #E2E7F1; padding: 10px 16px; }
.pg-more > summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-size: 13px; color: #626D80; }
.pg-legacy { border-top: 1px solid #E2E7F1; padding-top: 14px; margin-top: 14px; }
.pg-legacy .pg-button { margin-top: 8px; }
.pg-preview summary { display: flex; align-items: center; gap: 10px; justify-content: space-between; cursor: pointer; font-size: 16px; font-weight: 700; min-height: 44px; }
.pg-preview summary::after { content: '+'; font-size: 22px; font-weight: 400; }
.pg-preview[open] summary::after { content: '−'; }
.pg-export { margin-top: 12px; border-top: 1px solid #E2E7F1; padding-top: 12px; }
.pg-export textarea { min-height: 120px; height: 120px; font-size: 13px; }
.pg-preview textarea { display: block; resize: vertical; width: 100%; min-height: 250px; margin: 14px 0; padding: 16px; border: 1px solid #D2DAEC; background: #F4F7FC; border-radius: 10px; font: 15px/1.75 var(--font); color: #25354D; }
.pg-disclaimer { margin: 6px 0 0; font-size: 12px; color: #B9C7E2; word-break: keep-all; }
.pg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pg-status { min-height: 23px; margin-top: 10px; font-size: 14px; color: #26418C; }
.pg-status:empty { min-height: 0; margin: 0; }
.pg-reset { margin-top: 18px; font-size: 13px; color: #626D80; }
.pg-reset summary { cursor: pointer; min-height: 36px; padding: 5px 0; }
.pg-reset .pg-button { margin-top: 8px; }
.pg-fallback { margin: 24px 0; padding: 20px; background: #fff; color: #181B1F; border: 1px solid #CBD7F2; border-radius: 12px; }
.playground [hidden] { display: none !important; }
@media (max-width: 720px) {
  .pg-node { padding: 12px; }
  .pg-node-top { flex-wrap: wrap; }
  .pg-actions .pg-button { flex: 1 1 auto; }
}
@media (max-width: 480px) {
  /* 글자와 터치 영역을 축소하지 않고 흐름 방향을 세로로 바꾼다. */
  .pg-graph { grid-template-columns: 1fr; gap: 20px; padding-block: 18px; }
  .pg-node { padding: 10px 14px; }
  .pg-node-top { margin-bottom: 3px; }
  .pg-canvas-head { flex-wrap: wrap; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.playground) { scroll-behavior: auto; }
}
.scrolly-flat .playground-finale { position: relative; inset: auto; padding: 16px 0 24px; overflow: visible; background: transparent; }
.scrolly-flat .pg-fan { display: block; width: min(300px, 100%); height: 120px; margin: 0 auto 24px; }
.scrolly-flat .pg-workbench { max-height: 440px; }

/* 작업 상태는 예제 장면과 같은 모델에서 표시하며 사용자 편집 초안과 섞지 않는다. */
.wm-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; }
.wm-bar strong { font-size: 16px; }
.wm-bar > span { font-size: 12px; color: #526079; }
.wm-scenes { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
.wm-scenes button { font: inherit; font-size: 14px; min-height: 40px; padding: 7px 10px; border: 1px solid #D5DDED; border-radius: 8px; background: white; color: #47536A; cursor: pointer; }
.wm-scenes button[aria-pressed='true'] { background: #EAF0FF; color: #26418C; border-color: #6E8CDF; }
.wm-canvas { padding: 14px 16px; background: radial-gradient(#CAD5EA 1px, transparent 1px) 0 0 / 20px 20px, #F4F7FE; border-block: 1px solid #E2E7F1; }
.wm-label { font-size: 12px; line-height: 1.5; color: #53627D; }
.wm-graph { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin: 16px 0; }
.wm-node { position: relative; padding: 12px; border: 1px solid #C5D0E5; border-radius: 10px; font: inherit; background: white; color: #181B1F; text-align: left; min-width: 0; cursor: pointer; }
.wm-node:not(:last-child)::after { content: '→'; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: #869ABF; }
.wm-node strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.wm-node span { display: block; margin-top: 8px; font-size: 14px; color: #637085; }
.wm-node[aria-pressed='true'] { outline: 2px solid #5579E5; outline-offset: 2px; }
.wm-node[data-status='working'] span { color: #2451C5; }
.wm-node[data-status='blocked'] span, .wm-node[data-status='stale'] span { color: #90520F; }
.wm-node[data-status='review'] span { color: #166151; }
.wm-detail { padding: 14px 16px; }
.wm-detail h3 { font-size: 16px; }
.wm-detail p { margin: 8px 0 0; font-size: 14px; line-height: 1.65; color: #47536A; }
.wm-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 12px; color: #526079; }
.wm-versions span { padding: 3px 7px; border: 1px solid #D5DDED; border-radius: 5px; }
.wm-detail .wm-warning { color: #90520F; }
.wm-diff { padding: 6px 10px; margin-top: 8px; background: #F1F6FE; border-left: 2px solid #5579E5; }
.wm-diff p:last-child { color: #166151; }
.wm-footer { border-top: 1px solid #E2E7F1; padding: 12px 16px; }
.wm-footer p { font-size: 12px; line-height: 1.6; color: #637085; margin-bottom: 10px; }
.wm-back { display: block; margin: 0 auto 10px; }
@media (max-width: 420px) {
  .wm-graph { gap: 12px; grid-template-columns: 1fr; }
  .wm-node { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .wm-node span { margin: 0; flex-shrink: 0; }
  .wm-node:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -18px; transform: none; }
}
