/* 다몽 인테리어 — 단일 스타일시트. 색은 :root 토큰만 쓴다. */
/* 디자인 = 달비(dalbi.co.kr) 검은 판과 같은 값. 검은 바탕 + 크림 글자, 강조 면은 크림, 편집기 안만 선택 색 파랑(피그마 다크).
   글자: Pretendard 하나, 자간 -0.03em, 크기는 짝수 px(최소 12), 여러 줄 1.5 / 한 줄 normal.
   빼 둔 것(다시 넣지 말 것): 그라디언트·글로우·유리판(블러)·떠오르는 호버·부드러운 그림자 카드·알약 배지·등장 애니메이션 — 모이면 'AI가 찍어낸 화면'으로 읽힌다. */
:root {
  --cream: #FFF8EC;
  --bg: #000000;
  --panel: #111110;
  --panel-2: #1B1B19;
  --panel-3: #262624;
  --ink: var(--cream);
  --ink-2: rgba(255, 248, 236, .72);
  --muted: rgba(255, 248, 236, .52);
  --line: rgba(255, 248, 236, .12);
  --line-2: rgba(255, 248, 236, .24);
  --accent: var(--cream);
  --accent-ink: #000000;
  --accent-hover: #FFFFFF;           /* 주 버튼 위에 손을 올렸을 때 면 색 */
  --accent-weak: rgba(255, 248, 236, .10);
  --sel: #4D63FF;                    /* 편집기 선택 색 */
  --sel-weak: rgba(77, 99, 255, .20);
  --sel-hover: #6377FF;              /* 편집기 주 버튼 호버(파랑 조금 밝게) */
  --canvas: #1E1E1C;                 /* 편집기 판 */
  --warn: #FFD84D;
  --danger: #FF6B5B;
  --danger-weak: rgba(255, 107, 91, .14);
  --ok: #5FD38D;
  --radius: 12px;
  --shadow: none;
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, .85);
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 40px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; letter-spacing: -.03em; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
button, input, select, textarea { letter-spacing: inherit; }
::selection { background: var(--cream); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------- 머리 ---------- */
.site-header { display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 28px; background: #000; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-lg); text-decoration: none; line-height: normal; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; padding: 8px 12px; color: var(--muted); font-size: var(--fs-md); line-height: normal; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); font-weight: 700; }

/* ---------- 페이지 ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 40px 28px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.04em; line-height: normal; }
.page-head p { margin: 8px 0 0; color: var(--ink-2); font-size: var(--fs-md); }

/* ---------- 버튼·입력 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; line-height: normal; white-space: nowrap; text-decoration: none; }
.btn:hover { background: rgba(255, 248, 236, .08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-danger { color: var(--danger); border-color: rgba(255, 107, 91, .4); }
.btn-danger:hover { background: var(--danger-weak); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-xs); }
.btn-icon { width: 36px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); line-height: normal; }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); font-size: var(--fs-sm); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { height: 80px; padding: 8px 10px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.hint { font-size: var(--fs-xs); color: var(--muted); margin: 0; line-height: 1.5; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: transparent; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: var(--fs-sm); color: var(--muted); line-height: normal; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
input[type="color"] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); cursor: pointer; }
input[type="range"] { accent-color: var(--accent); }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 10px 16px; cursor: pointer; font-size: var(--fs-md); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; line-height: normal; }
.tabs button.is-on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

/* ---------- 카드 격자 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: var(--line-2); }
.card-thumb { aspect-ratio: 3 / 2; background: var(--panel-2); display: block; width: 100%; object-fit: cover; border-bottom: 1px solid var(--line); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-weight: 700; font-size: var(--fs-md); margin: 0; line-height: normal; }
.card-sub { color: var(--muted); font-size: var(--fs-xs); margin: 0; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
.house-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-sm); }
.house-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; white-space: nowrap; color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.empty { text-align: left; padding: 48px 28px; color: var(--ink-2); background: transparent; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty strong { display: block; color: var(--ink); font-size: var(--fs-lg); margin-bottom: 6px; }
.lib-card .card-thumb { aspect-ratio: 4 / 3; }
.lib-card .badge { display: inline-block; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 모달·알림 ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 460px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.is-wide { width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: var(--fs-lg); line-height: normal; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.modal-msg { margin: 0; line-height: 1.5; white-space: pre-line; }
.toast-box { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast { background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 12px; font-size: var(--fs-sm); box-shadow: var(--shadow-lg); }
.toast.is-error { background: var(--danger); border-color: var(--danger); color: #000; }
.toast.is-ok { background: var(--cream); border-color: var(--cream); color: #000; }

/* ---------- 자재·카탈로그 편집 폼 ---------- */
.form-split { display: grid; grid-template-columns: 1fr 240px; gap: 20px; }
.preview-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; padding: 12px; align-self: start; }
.preview-box canvas, .preview-box img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--cream); display: block; }
.file-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-pick .name { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 편집기 ---------- */
body.is-editor { height: 100vh; overflow: hidden; }
body.is-editor { height: 100dvh; }
/* 가운데 화면이 기본. 왼쪽 목록(is-lib)·오른쪽 속성(is-props)은 필요할 때만 연다 */
.ed { --accent: var(--sel); --accent-ink: #FFFFFF; --accent-hover: var(--sel-hover); --accent-weak: var(--sel-weak); --lw: 0px; --rw: 0px; display: grid; grid-template-rows: 54px minmax(0, 1fr) 30px; grid-template-columns: var(--lw) minmax(0, 1fr) var(--rw); height: 100vh; height: 100dvh; position: relative;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ed input, .ed textarea, .ed select { -webkit-user-select: text; user-select: text; }
.ed.is-lib { --lw: 272px; }
.ed.is-props { --rw: 300px; }
.ed-left { grid-column: 1; grid-row: 2; }
.ed-stage { grid-column: 2; grid-row: 2; }
.ed-right { grid-column: 3; grid-row: 2; }
.ed:not(.is-lib) .ed-left, .ed:not(.is-props) .ed-right { display: none; }
.ed-right-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ed-right-head b { font-size: var(--fs-sm); }
.ed-toggle { border: 1px solid var(--line); background: var(--panel-2); height: 34px; padding: 0 12px; border-radius: 8px; line-height: normal; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ed-toggle svg { width: 16px; height: 16px; flex: none; }
.ed-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* 좁은 화면(아이패드 세로 등): 목록·속성은 화면 위에 덮어 연다 */
@media (max-width: 1000px) {
  .ed.is-lib, .ed.is-props { --lw: 0px; --rw: 0px; }
  .ed-left, .ed-right { position: absolute; top: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow-lg); }   /* 격자 칸(2행) 기준 */
  .ed-left { left: 0; width: min(300px, 80vw); }
  .ed-right { right: 0; width: min(340px, 86vw); }
  .ed-toggle span { display: none; }
}
/* 선택·놓기·그리기 중 떠 있는 동작 막대(손가락으로 누르기 쉽게) */
.ed-float { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 24px); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.ed-float[hidden] { display: none; }
.ed-float .lbl { font-size: var(--fs-sm); font-weight: 600; padding: 0 8px 0 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-float .lbl small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.ed-float .btn { height: 40px; padding: 0 14px; }
.ed-float.is-mode { background: var(--accent); border-color: var(--accent); }
.ed-float.is-mode .lbl { color: var(--accent-ink); }
.ed-float.is-mode .btn { border-color: rgba(255, 255, 255, .5); color: #fff; }
.ed-float.is-mode .btn-primary { background: #fff; color: var(--sel); border-color: #fff; }
/* 손가락(터치) 기기: 누르는 곳을 크게 */
@media (pointer: coarse) {
  .ed-tools button { height: 40px; padding: 0 12px; }
  .ed-toggle { height: 40px; }
  .ed-top .btn-icon { width: 40px; height: 40px; }
  .ed .seg button { height: 40px; }
  .ed .btn-sm { height: 38px; padding: 0 12px; }
  .lib-item .edit { opacity: 1; width: 32px; height: 32px; }
  .lib-tabs button { height: 46px; }
  .room-list button { padding: 12px; }
  .ed .input, .ed .select { height: 42px; font-size: 16px; }   /* 16px 미만이면 아이패드가 입력할 때 화면을 확대한다 */
}
.ed button, .ed .btn, .ed-pane canvas { touch-action: manipulation; }
#plan2d, #view3dPane canvas { touch-action: none; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.ed-top .back { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); padding: 6px 8px; border-radius: 8px; }
.ed-top .back:hover { color: var(--ink); }
.ed-title { font-weight: 700; font-size: var(--fs-md); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-sep { width: 1px; height: 24px; background: var(--line); }
.ed-tools { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.ed-tools button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; line-height: normal; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ed-tools button:hover { background: var(--panel-3); color: var(--ink); }
.ed-tools button.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ed-tools svg { width: 16px; height: 16px; flex: none; }
.ed-spacer { flex: 1; }
.ed-save { font-size: var(--fs-xs); color: var(--muted); min-width: 70px; text-align: right; }
.ed-save.is-dirty { color: var(--warn); }
.ed-save.is-error { color: var(--danger); }

.ed-left, .ed-right { background: var(--panel); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); }
.ed-right { border-left: 1px solid var(--line); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lib-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }   /* 7개 → 두 줄 */
.lib-tabs button { border: 0; background: none; height: 38px; cursor: pointer; font-size: var(--fs-sm); color: var(--muted); border-bottom: 2px solid transparent; }
.lib-tabs button.is-on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.lib-head { display: flex; gap: 6px; padding: 10px; }
.lib-head .input { height: 32px; }
.lib-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 8px; align-content: start; }
.lib-item { display: flex; flex-direction: column; position: relative; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); cursor: grab; user-select: none; }
.lib-item:hover { border-color: var(--accent); }
.lib-item:active { cursor: grabbing; }
.lib-item img, .lib-item canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; flex: none; object-fit: cover; background: var(--panel-2); pointer-events: none; }
.lib-item .nm { flex: none; font-size: var(--fs-xs); padding: 6px 7px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item .edit { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); cursor: pointer; opacity: 0; display: flex; align-items: center; justify-content: center; }
.lib-item:hover .edit { opacity: 1; }
.lib-item .edit svg { width: 14px; height: 14px; }
.lib-tip { padding: 10px 12px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); line-height: 1.5; }

.ed-stage { position: relative; display: grid; grid-template-columns: 1fr; min-width: 0; min-height: 0; background: var(--canvas); }
.ed-stage.is-split { grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.ed-pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas); }
.ed-pane canvas { display: block; }
.ed-pane.is-hidden { display: none; }
#plan2d { width: 100%; height: 100%; touch-action: none; }
.pane-badge { position: absolute; top: 10px; left: 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; line-height: normal; pointer-events: none; }
.pane-tools { position: absolute; right: 10px; top: 10px; left: 56px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; pointer-events: none; }
.pane-tools > * { pointer-events: auto; }
.pane-tools .btn:not(.btn-primary) { background: var(--panel-2); }
.pane-tools .btn:not(.btn-primary):hover { background: var(--panel-3); }
.pane-tools .btn.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.drop-hint { position: absolute; inset: 0; pointer-events: none; outline: 3px dashed var(--sel); outline-offset: -8px; display: none; }
.ed-pane.is-drop .drop-hint { display: block; }

.ed-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--panel); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.ed-bottom kbd { font-family: inherit; font-size: 12px; line-height: normal; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel-2); color: var(--ink-2); }
.ed-bottom .coord { margin-left: auto; font-variant-numeric: tabular-nums; }

.prop { padding: 16px; border-bottom: 1px solid var(--line); }
.prop h3 { margin: 0 0 12px; font-size: var(--fs-sm); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prop h3 .kind { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.prop .field { margin-bottom: 10px; }
.prop .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prop .stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.prop .stat b { display: block; font-size: var(--fs-lg); }
.prop .stat span { font-size: var(--fs-xs); color: var(--muted); }
.mat-pick { display: flex; gap: 8px; align-items: center; }
.mat-pick .sw { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); flex: none; background: var(--panel-2) center / cover; }
.mat-pick .select { flex: 1; }
.prop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.side-tag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sel); color: #fff; font-size: 12px; font-weight: 700; margin-right: 4px; line-height: normal; }
.side-tag.b { background: var(--warn); color: #000; }
.room-list { display: flex; flex-direction: column; gap: 4px; }
.room-list button { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: var(--fs-sm); text-align: left; }
.room-list button:hover { border-color: var(--accent); }
.room-list span { color: var(--muted); font-size: var(--fs-xs); }

@media (max-width: 1280px) {
  .ed.is-lib { --lw: 240px; }
  .ed-tools button span { display: none; }
}
/* 세로 화면: 2D+3D는 위아래로 */
@media (orientation: portrait) {
  .ed-stage.is-split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .site-nav a { padding: 8px 8px; font-size: var(--fs-sm); }
  .brand span { display: none; }
  .page { padding: 20px 16px 48px; }
  .form-split { grid-template-columns: 1fr; }
}

/* ---------- 평면도 자동 인식 ---------- */
.detect-view { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; display: flex; justify-content: center; padding: 6px; margin-bottom: 10px; }
.detect-canvas { display: block; max-width: 100%; height: auto; }
.detect-info { margin-bottom: 12px; font-weight: 600; color: var(--ink-2); }
.detect .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detect .field label .kind { font-weight: 400; color: var(--muted); }
.detect-check { display: flex; gap: 6px; align-items: center; margin: 8px 0; }

/* ---------- 3D 둘러보기 ---------- */
.walk-hint { display: none; position: absolute; left: 50%; top: 58px; transform: translateX(-50%); background: rgba(0, 0, 0, .78); color: var(--cream); font-size: var(--fs-xs); padding: 8px 12px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
.walk-hint kbd { font-family: inherit; font-size: 12px; border: 1px solid rgba(255, 248, 236, .35); border-radius: 4px; padding: 0 4px; }
.ed-pane.is-walk .walk-hint { display: block; }
.ed-pane.is-walk canvas { cursor: grab; }

/* ---------- 문·창문(속성 패널) ---------- */
.opening-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 0; margin-bottom: 8px; background: var(--panel-2); }
.opening-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.opening-head .btn { height: 24px; color: var(--danger); }
.warn-text { color: var(--danger); font-weight: 500; font-size: 12px; }

/* 사진 렌더 */
.photo { display: flex; flex-direction: column; gap: 10px; }
/* 미리보기 높이 = 화면 높이에서 창 머리·옵션·버튼(약 380px)을 뺀 만큼 — 낮은 화면에서도 창 안이 스크롤되지 않게 */
.photo-view { background: var(--canvas); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 160px; max-height: min(62vh, calc(100vh - 380px)); }
.photo-canvas { display: block; max-width: 100%; max-height: min(62vh, calc(100vh - 380px)); width: auto; height: auto; }
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.photo-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.photo-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.photo-status { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.photo-idle { width: 100%; min-height: 240px; display: flex; align-items: center; justify-content: center; }
.photo-opts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.photo-opts .field { margin: 0; }
.photo-seg button { height: 40px; padding: 0 16px; }   /* 아이패드 손가락 크기 */
.modal:has(.photo) { width: min(1120px, 100%); }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.login-card img { width: 40px; height: 40px; margin-bottom: 16px; }
.login-card h1 { margin: 0 0 4px; font-size: 32px; font-weight: 700; line-height: 1.5; letter-spacing: -.04em; }
.login-card .soft { font-weight: 200; }
.login-card .hint { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: 16px; }
.login-card .input, .login-card .btn { height: 48px; font-size: 16px; }
.login-card .btn { margin-top: 8px; }
.login-err { color: var(--danger); margin: 0; font-size: var(--fs-sm); }
.site-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-user form { margin: 0; }
.site-user-name { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
/* 회원 관리 */
.admin-card { padding: 0; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-off td { color: var(--muted); }
.admin-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-empty { text-align: center !important; color: var(--muted); padding: 32px !important; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: var(--fs-xs); line-height: normal; color: var(--muted); border: 1px solid var(--line-2); }
.pill.is-on { background: var(--cream); color: #000; border-color: var(--cream); font-weight: 600; }
@media (max-width: 760px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-table td { display: flex; justify-content: space-between; border: 0; padding: 6px 14px; }
  .admin-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); }
  .admin-acts { justify-content: flex-start; }
  .site-user-name { display: none; }
}

/* 좁은 머리 막대: 글자 줄바꿈 없이, 버튼은 줄지 않고 집 이름만 줄어든다(…) */
.ed-top .back, .ed .seg button, .ed-save { white-space: nowrap; }
.ed-top > * { flex-shrink: 0; }
.ed-top > .ed-title { flex-shrink: 1; min-width: 0; }
@media (max-width: 860px) {
  .ed-top { gap: 4px; }
  .ed-top .ed-sep { display: none; }
  .ed .seg button { padding: 0 8px; }
}
@media (max-width: 1000px) {
  .ed-top { gap: 6px; padding: 0 8px; }
  .ed-top .back { font-size: 0; padding: 6px 10px; }
  .ed-top .back::before { content: '←'; font-size: 18px; }
  .ed-title { max-width: 120px; }
  .ed .seg button { padding: 0 10px; }
  .ed-save { min-width: 0; }
}

.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: inline; } .only-mouse { display: none; } }
@media (pointer: coarse) {
  .btn-sm { min-height: 36px; padding: 0 12px; }
  .site-nav a { padding: 10px 12px; }
}

/* ---------- 사진 다듬기(벽지·바닥재 무늬 / 제품 겉모습) ---------- */
.modal.is-photo-tool { width: min(980px, 100%); }
.pt { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.pt-canvas { display: block; max-width: 100%; height: auto; border-radius: 10px; touch-action: none; cursor: crosshair; background: var(--canvas); }
.pt-preview { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); display: block; background: var(--panel-2); }
.pt-info { margin: 8px 0 12px; min-height: 3em; }
.pt-right .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-faces { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.pt-face { display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
@media (max-width: 860px) { .pt { grid-template-columns: 1fr; } }

/* 공통 / 내 것 */
.own-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 700; line-height: normal; background: var(--cream); color: #000; margin-right: auto; }
.lib-own { position: absolute; top: 5px; left: 5px; height: 20px; padding: 0 6px; background: var(--cream); color: #000; }
.ro-note { grid-column: 1 / -1; background: var(--cream); color: #000; border-radius: 12px; padding: 10px 14px; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }
.owner-hint { margin-top: 10px; }

/* 메모(벽·방·배치·문창) — 노란 쪽지 = 달비 원색 sun, 글자는 검정 */
.memo-input { height: 120px; padding: 10px 12px; line-height: 1.5; font-size: var(--fs-sm); }
.ed-float .memo-peek { flex-basis: 100%; max-width: 420px; margin: 0 auto 2px; border: 0; border-radius: 8px; background: var(--warn); color: #000; text-align: left;
  padding: 8px 12px; font-size: var(--fs-sm); line-height: 1.5; cursor: pointer; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.memo-list { display: flex; flex-direction: column; gap: 6px; }
.memo-list button { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.memo-list button:hover { border-color: var(--line-2); }
.memo-list b { font-size: var(--fs-xs); line-height: normal; }
.memo-list span { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 견적·물량표 */
.q-opts { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 12px; }
.q-opt { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.q-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quote h3 { font-size: var(--fs-md); margin: 18px 0 6px; }
.q-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.q-table th, .q-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.q-table th { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.q-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-table tfoot td { font-weight: 700; border-bottom: 0; }
.q-none { color: var(--muted); }
@media (max-width: 700px) { .q-top { grid-template-columns: 1fr 1fr; } }
/* 사진 보관함 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: pointer; aspect-ratio: 3 / 2; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-big { display: block; max-width: 100%; max-height: 66vh; margin: 0 auto; border-radius: 8px; }
.lib-tab { position: absolute; top: 30px; left: 5px; height: 20px; padding: 0 6px; }
