/* Metalogy Spatial Editor — PLY TOOLS '평면도 · 박스 모델' 화면 (v2.1.0-beta1). 틀 · 카드 · 기록은 assets/tools/tools.css 를 같이 쓴다. */

/* 두 칸: 왼쪽(입력 · 확인 · 감지 · 실행 · 기록) 고정 폭, 오른쪽(평면도 · 내보내기) 나머지 */
.plan-grid { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 18px; align-items: start; }
.plan-grid .tool-col > .card:last-child { flex: initial; }
.plan-main { position: sticky; top: 16px; }
@media (max-width: 1080px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-main { position: static; }
}

.plan .file-tag.t-gs { background: #7ee7c7; }
.plan .file-tag.t-pc { background: #ffb38a; }
.plan .file-item .file-main { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.plan .file-text { flex: 1; min-width: 0; }
.plan .file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan .file-meta { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.plan-drops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-drops .dropzone { padding: 14px 10px; min-height: 92px; align-content: center; }
.plan-drops .dropzone .dim { font-size: 11px; line-height: 1.5; }
.plan-drops .dropzone.has-file { border-style: solid; border-color: #2fd3a855; }
/* v2.3.35 3DGS 칸의 두 줄 안내(여러 파일 맵은 폴더째)를 모두 보인다 — tools.css 의 compact 는 마지막 줄을 숨김 */
.plan-drops .dropzone.compact .dim:last-child { display: block; }
.plan-in-actions { margin-top: 8px; }
.opt { margin-left: 4px; font-size: 11px; font-weight: 600; color: #ffb38a; }
@media (max-width: 420px) { .plan-drops { grid-template-columns: 1fr; } }

/* ① 확인 */
.side-view { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0b1015; }
.side-view canvas { display: block; width: 100%; height: 120px; cursor: pointer; }
.side-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 10px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.side-legend .sw { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.side-legend .sw.floor { background: #ffb38a; }
.side-legend .sw.ceil { background: #7cc7ff; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 12.5px; }
.facts:empty { display: none; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: #e6edf3; font-variant-numeric: tabular-nums; }
.facts dd.warn { color: #ffd479; }
.hint.inline { margin: 0; }

/* ② 감지 */
.det-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.det-grid .switch-row { margin-top: 8px; }
#sens .seg-btn { font-size: 12px; }

/* ③ 미리보기 */
.plan-card .card-head { flex-wrap: wrap; }
.pv-tabs { min-width: 180px; }
.plan-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.plan-toolbar .tools-seg { flex: 0 1 auto; min-width: min(460px, 100%); }
.plan-toolbar .tools-seg .seg-btn { padding: 0 12px; }
.plan-toolbar.is-off, .layer-row.is-off { opacity: .4; pointer-events: none; }
.layer-row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.layer-row label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.layer-row input { accent-color: var(--accent); }
.plan-stage { position: relative; height: clamp(380px, 62vh, 720px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b1015; }
.plan-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.plan-stage canvas[hidden] { display: none; }
#plan-canvas { cursor: grab; }
#plan-canvas[data-tool="measure"], #plan-canvas[data-tool="calibrate"], #plan-canvas[data-tool="wall"], #plan-canvas[data-tool="opening"] { cursor: crosshair; }
.plan-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.7; pointer-events: none; }
.plan-empty[hidden] { display: none; }
.plan-hint { position: absolute; left: 12px; right: 12px; top: 10px; padding: 7px 12px; border-radius: 9px; background: #0b1015d9; border: 1px solid #ffffff1f; color: #dfe7ee; font-size: 12px; line-height: 1.5; pointer-events: none; }
.plan-hint[hidden] { display: none; }
.view3d-opts { position: absolute; right: 10px; top: 10px; display: flex; gap: 10px; padding: 6px 10px; border-radius: 9px; background: #0b1015d9; border: 1px solid #ffffff1f; font-size: 12px; color: #dfe7ee; }
.view3d-opts[hidden] { display: none; }
.view3d-opts label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.view3d-opts input { accent-color: var(--accent); }
.calib-pop { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 8px; width: min(300px, calc(100% - 24px)); padding: 12px 14px; border-radius: 12px; background: #121a21f2; border: 1px solid #2fd3a855; box-shadow: 0 12px 40px #0008; font-size: 12.5px; }
.calib-pop[hidden] { display: none; }
.calib-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); }
.calib-row strong { color: #ff8ea0; font-variant-numeric: tabular-nums; }
.calib-row .field { width: 120px; }
.calib-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* 고른 것 칸 */
.inspector { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff04; min-height: 64px; }
.ins-empty { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.ins-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13.5px; }
.ins-head .dim { font-size: 12px; }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 14px; }
.ins-field { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); }
.ins-input { display: flex; align-items: center; gap: 6px; }
.ins-input .field { flex: 1; min-width: 0; height: 30px; font-size: 12.5px; }
.ins-input em { font-style: normal; font-size: 11px; color: var(--dim); }
.ins-read { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); }
.ins-read strong { font-size: 13px; color: #e6edf3; font-variant-numeric: tabular-nums; }
.inspector .row-actions { margin-top: 10px; }

/* ④ 내보내기 */
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.fmt { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .25s, background .25s; }
.fmt:hover { border-color: #ffffff33; }
.fmt:has(input:checked) { border-color: #2fd3a877; background: #2fd3a80d; }
.fmt input { margin-top: 2px; accent-color: var(--accent); }
.fmt span { display: grid; gap: 2px; }
.fmt strong { font-size: 13px; }
.fmt em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.fmt.is-disabled { opacity: .45; cursor: not-allowed; }
#ex-origin { flex-wrap: wrap; }
#ex-origin .seg-btn { height: auto; min-height: 32px; padding: 6px 10px; line-height: 1.35; white-space: normal; }
.ex-run { margin-top: 16px; }

/* 진행 막대: 끝을 모를 때 흐르는 줄 */
.bar span.is-indeterminate { width: 40% !important; animation: plan-flow 1.2s ease-in-out infinite; }
@keyframes plan-flow { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .bar span.is-indeterminate { animation: none; width: 100% !important; opacity: .6; } }

/* 가리킨 요소의 크기 (평면도 위) */
.plan-tip { position: absolute; z-index: 2; max-width: 250px; padding: 5px 9px; border-radius: 8px; background: #121a21ee; border: 1px solid #ffffff26; color: #e6edf3; font-size: 11.5px; line-height: 1.45; font-variant-numeric: tabular-nums; pointer-events: none; white-space: normal; }
.plan-tip[hidden] { display: none; }

/* 학습 데이터 — 참고 평면도 목록 */
.ln-refs { margin: 4px 0 10px; font-size: 12px; color: var(--muted, #8a8f98); }
.ln-refs summary { cursor: pointer; }
.ln-refs ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.ln-refs a { color: inherit; text-decoration: underline; }

/* 학습 데이터 칸 — 켜기 · 끄기만 (beta6) + 자세히 보기 창 */
.ln-row { display: flex; align-items: center; gap: 14px; }
.ln-row .ln-master { flex: 1 1 auto; margin: 0; }
.ln-state { display: inline-block; min-width: 34px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: center; color: #8a8f98; background: #ffffff12; }
.ln-state.is-on { color: #06231b; background: var(--accent, #2fd3a8); }
.ln-modal { width: min(720px, calc(100vw - 32px)); }
.ln-modal .modal-head h2 { display: inline-flex; align-items: center; gap: 4px; }
.ln-modal .facts { margin-bottom: 8px; }
.ln-modal .ln-subs.is-off { opacity: .45; pointer-events: none; }
.ln-modal .row-actions { margin-top: 12px; flex-wrap: wrap; }
