/* 제품 시안 전용. 틀과 부품은 모두 dist/catwin.css에서 오고, 여기에는 시안 페이지의 틀과 한 제품만 쓰는 내용 모양만 둔다. */

/* 시안 페이지 틀 */
.pg-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--cw-space-gutter); height: var(--cw-h-panel-head); padding: 0 var(--cw-space-section); background: var(--cw-bg); border-bottom: var(--cw-hairline) solid var(--cw-line); font-family: var(--cw-font-ui); color: var(--cw-text); }
.pg-bar h1 { font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); white-space: nowrap; }
.pg-bar .spacer { flex: 1; }
.pg-bar a { font-size: var(--cw-fs-small); color: var(--cw-text-muted); white-space: nowrap; }
.pg-stage { padding: var(--cw-space-gutter) var(--cw-space-section) var(--cw-space-section); overflow-x: auto; }
.pg-stage > .app { min-width: 1200px; height: max(760px, calc(100vh - var(--cw-h-panel-head) - var(--cw-space-region))); } /* cw-allow 시안은 1200 이상으로 보여 주고 좁은 창은 메뉴판에서 본다 */
.pg-stage > .app[hidden] { display: none; }

/* 문서 면: 탭 아래를 채운다. 시트는 이 안을 채운다. */
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.doc-tabs { display: flex; align-items: stretch; justify-content: space-between; flex: none; padding: 0 var(--cw-space-panel); background: var(--cw-surface); border-bottom: var(--cw-hairline) solid var(--cw-line); }
.doc-tabs .meta { align-self: center; font-size: var(--cw-fs-small); color: var(--cw-text-muted); }
.doc-pane { position: relative; flex: 1; min-height: 0; }
.doc-pane[hidden] { display: none; }
.doc-page { height: 100%; overflow: auto; padding: var(--cw-space-gutter); }
.doc-page-inner { max-width: var(--cw-w-read); margin: 0 auto; }

/* Reviewer: 판정 열까지 한눈에 들어오도록 원문 시트의 열 폭을 내용에 맞춘다(제품에서는 원본 파일의 열 폭을 따른다) */
#p-reviewer .grid col:nth-child(2) { width: 132px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(3), #p-reviewer .grid col:nth-child(6), #p-reviewer .grid col:nth-child(8) { width: 48px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(4) { width: 92px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(5) { width: 64px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(7), #p-reviewer .grid col:nth-child(9) { width: 72px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(10) { width: 60px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(11) { width: 76px; } /* cw-allow 시트 열 폭 */
#p-reviewer .grid col:nth-child(12), #p-reviewer .grid col:nth-child(13) { width: 48px; } /* cw-allow 시트 열 폭 */

/* Reviewer: 근거 목록과 내 결정 */
.refs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--cw-space-group); }
.refs li { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cw-space-tight); }
.refs small { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.decide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cw-space-item); margin-top: var(--cw-space-item); }
.foot-note { margin-top: var(--cw-space-item); margin-left: calc(var(--cw-space-item) * -1); }

/* Modeler: 작업 대상이 창을 채운다 */
.bench { background: radial-gradient(ellipse at 50% 45%, var(--cw-surface) 0%, var(--cw-bg) 70%); }
.bench svg.scene, .bench svg.leader { position: absolute; inset: 0; width: 100%; height: 100%; }
.bench svg.leader { pointer-events: none; z-index: 1; fill: none; stroke: var(--cw-selection); stroke-width: 1; stroke-dasharray: 4 4; }
.bench .mark { opacity: 0; }
.bench .mark.is-on { opacity: 1; }
.float.is-folded > :not(.panel-head) { display: none; }
.float.is-folded { overflow: hidden; }
.float .tree { padding: var(--cw-space-tight) 0 var(--cw-space-item); }
.float.at-left { display: flex; flex-direction: column; }
.float.at-left .tree { flex: 1; min-height: 0; overflow: auto; }
.prop-body { padding: var(--cw-space-control) var(--cw-space-group) var(--cw-space-group); }
.prop-body .section-label + .kv { margin-top: var(--cw-space-tight); }
.prop-body .kv + .section-label { display: block; margin-top: var(--cw-space-gutter); }
.prop-body .kv .input-wrap { width: 100%; }
.prop-body .btn-row { margin-top: var(--cw-space-group); }
.float.at-status { display: flex; align-items: center; gap: var(--cw-space-group); }
.cmdbar .input { flex: 1; height: 100%; border: 0; background: none; box-shadow: none; padding: 0; }

/* Designer: 대안 비교 */
.canvas { flex: 1; min-height: 0; overflow: auto; padding: var(--cw-space-gutter); }
.canvas-inner { display: flex; flex-direction: column; gap: var(--cw-space-gutter); }
.block { padding: var(--cw-space-panel); background: var(--cw-surface); border-radius: var(--cw-radius-container); }
.block.flush { padding-inline: 0; }
.block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--cw-space-group); margin-bottom: var(--cw-space-group); }
.block.flush .block-head { padding-inline: var(--cw-space-panel); }
.block-head h4 { font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); }
.block-head p { margin-top: var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.legend { display: flex; gap: var(--cw-space-group); align-items: center; font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--cw-space-tight); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; } /* cw-allow 범례 점은 그래프 점과 같은 크기 */
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--cw-font-ui); font-size: var(--cw-fs-caption); fill: var(--cw-text-muted); }
.block .table th:first-child, .block .table td:first-child { padding-left: var(--cw-space-panel); }
.block .table th:last-child, .block .table td:last-child { padding-right: var(--cw-space-panel); }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cw-space-group); margin-top: var(--cw-space-gutter); }
.metric strong { display: block; font-size: var(--cw-fs-heading); line-height: var(--cw-lh-heading); font-weight: var(--cw-fw-strong); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.metric small { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.panel-pad .field + .section-label, .panel-pad .kv + .section-label { display: block; margin-top: var(--cw-space-gutter); }

/* Engineer 작업실: 자료 창이 뜨는 자리 */
.pg-empty-stage { position: absolute; inset: 0; }

/* Plugins: 바깥 틀은 호스트 프로그램의 것이다. 우리 토큰을 쓰지 않고 호스트 값을 흉내 낸다. */
#p-plugins { --host-bg: #0E0F11; --host-chrome: #2B2D30; --host-chrome-2: #323438; --host-line: #3E4146; --host-text: #C3C8CF; --host-tool: #5B6068; --host-draw: #C9CDD3; --host-grid: #3A3D42; --host-note: #8E949C; } /* cw-allow 호스트 프로그램의 색 */
[data-theme="light"] #p-plugins { --host-bg: #FAFAFA; --host-chrome: #E4E5E7; --host-chrome-2: #D9DADD; --host-line: #C4C6CA; --host-text: #33363B; --host-tool: #8E949C; --host-draw: #2E3136; --host-grid: #D3D5D9; --host-note: #5B6068; } /* cw-allow 밝은 호스트: 호스트 테마를 따른다(메뉴판 5.7) */
.host-title { display: flex; align-items: center; gap: var(--cw-space-item); flex: none; height: 30px; padding: 0 var(--cw-space-control); background: var(--host-chrome); border-bottom: 1px solid var(--host-line); color: var(--host-text); font-size: 12px; } /* cw-allow 호스트 틀 */
.host-title .spacer { flex: 1; }
.host-ribbon { flex: none; background: var(--host-chrome-2); border-bottom: 1px solid var(--host-line); color: var(--host-text); font-size: 12px; } /* cw-allow 호스트 틀 */
.host-tabs { display: flex; gap: 2px; height: 26px; padding: 0 var(--cw-space-item); align-items: flex-end; }
.host-tabs span { padding: 4px 12px; border-radius: 3px 3px 0 0; } /* cw-allow 호스트 틀 */
.host-tabs span.on { background: var(--host-chrome); }
.host-tools { display: flex; align-items: center; gap: var(--cw-space-group); height: 56px; padding: 0 var(--cw-space-control); background: var(--host-chrome); }
.host-tool { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--host-text); background: none; border: 0; font-family: inherit; } /* cw-allow 호스트 틀 */
.host-tool i { display: block; width: 24px; height: 24px; border: 1px solid var(--host-tool); border-radius: 2px; }
.host-tool.ours { padding: 4px 8px; border-radius: 3px; background: color-mix(in srgb, var(--host-text) 8%, transparent); cursor: default; } /* cw-allow 호스트 리본 규격 */
.host-tool.ours[aria-pressed="false"] { background: none; }
.host-tool.ours .product-tile { width: 24px; height: 24px; }
.host-tool.ours .product-tile svg { width: 16px; height: 16px; }
.host-work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; } /* cw-allow 호스트 안 패널의 기준 폭 */
.host-work.is-closed { grid-template-columns: minmax(0, 1fr); }
.host-work.is-closed .plugin { display: none; }
.host-canvas { position: relative; overflow: hidden; background: var(--host-bg); }
.host-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.host-canvas [data-part] { fill: transparent; cursor: pointer; }
.host-status { display: flex; align-items: center; gap: var(--cw-space-group); flex: none; height: 24px; padding: 0 var(--cw-space-control); background: var(--host-chrome); border-top: 1px solid var(--host-line); color: var(--host-text); font-size: 11px; } /* cw-allow 호스트 틀 */
.host-status .spacer { flex: 1; }
.plugin .panel-body { flex: 1; min-height: 0; overflow: auto; }
.plugin [role="tabpanel"] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.plugin [role="tabpanel"][hidden] { display: none; }

/* Learn: 본문 안의 그림, 순서 목록, 쪽 넘기기 */
.crumb { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.reader-body > h1 { margin-top: var(--cw-space-item); font-size: var(--cw-fs-heading); line-height: var(--cw-lh-heading); font-weight: var(--cw-fw-strong); letter-spacing: -.02em; }
.reader-body > .meta { margin-top: var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.steps { margin-inline: 0; margin-bottom: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: var(--cw-space-control); }
.steps li { display: grid; grid-template-columns: var(--cw-space-section) minmax(0, 1fr); counter-increment: step; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--cw-font-code); font-size: var(--cw-fs-code); color: var(--cw-text-muted); }
.figure { margin-inline: 0; margin-bottom: 0; padding: var(--cw-space-panel); background: var(--cw-surface); border-radius: var(--cw-radius-container); }
.figure svg { display: block; width: 100%; height: auto; }
.figure svg text { font-family: var(--cw-font-ui); font-size: var(--cw-fs-caption); fill: var(--cw-text-muted); }
.figure figcaption { margin-top: var(--cw-space-item); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.code-cap { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.code-block .c { color: var(--cw-text-muted); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cw-space-group); }
.reader-body > .pager { margin-top: var(--cw-space-region); }
.pager a { display: flex; flex-direction: column; gap: var(--cw-space-tight); padding: var(--cw-space-control) var(--cw-space-group); border: var(--cw-border) solid var(--cw-line-strong); border-radius: var(--cw-radius-control); color: var(--cw-text); text-decoration: none; }
.pager a:hover { background: var(--cw-hover); }
.pager a:last-child { text-align: right; }
.pager small { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.reader-toc .section-label { display: block; margin-top: var(--cw-space-section); }
.reader-toc .section-label:first-child { margin-top: 0; }
.reader-nav .list-group { padding-inline: var(--cw-space-panel); }
