/* ============ 편집기 화면(크롬) ============ */
:root{
  --brand:#2f5d57; --brand2:#244a45; --gold:#bd9a4f;
  --bg:#eef0ee; --panel:#ffffff; --line:#dfe2df; --ink:#23302d; --mute:#7d847f;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Malgun Gothic","맑은 고딕","Apple SD Gothic Neo",sans-serif;
  display:flex; flex-direction:column; overflow:hidden;
}

/* ---- 상단바 ---- */
#topbar{ flex:none; height:54px; background:#fff; border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px; padding:0 16px; }
.brandmark{ font-weight:800; font-size:15px; color:var(--brand); }
.brandmark span{ font-weight:600; font-size:11px; color:var(--mute); margin-left:6px; }
.tb-spacer{ flex:1; }
.tb-group{ display:flex; align-items:center; gap:7px; }
.savestate{ font-size:11.5px; color:var(--brand); margin-right:4px; }
.savestate.dirty{ color:var(--gold); }
.savestate.off{ color:#b3402f; }

/* ---- 로그인 오버레이 ---- */
#loginOv{ position:fixed; inset:0; z-index:9999; background:rgba(36,46,42,.55);
  backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; }
.login-card{ width:320px; background:#fff; border-radius:16px; padding:26px 24px;
  box-shadow:0 20px 60px -20px rgba(0,0,0,.5); text-align:center; }
.login-title{ font-size:18px; font-weight:800; color:var(--brand); }
.login-sub{ font-size:12px; color:var(--mute); margin:8px 0 16px; line-height:1.5; }
.login-card input{ width:100%; font-size:14px; padding:11px 13px; border:1px solid var(--line);
  border-radius:9px; margin-bottom:11px; font-family:inherit; }
.login-card input:focus{ outline:none; border-color:var(--brand); }
.login-card .btn.primary{ width:100%; padding:11px; font-size:14px; }
.login-msg{ font-size:11.5px; color:#b3402f; margin-top:11px; min-height:16px; }
.zoom{ font-size:11.5px; color:var(--mute); display:flex; align-items:center; gap:5px; }
.zoom select{ font-size:12px; padding:3px 5px; border:1px solid var(--line); border-radius:6px; background:#fff; }

.btn{ font-family:inherit; font-size:12.5px; border:1px solid var(--line); background:#fff; color:var(--ink);
  padding:7px 12px; border-radius:8px; cursor:pointer; transition:.12s; white-space:nowrap; }
.btn:hover{ border-color:var(--brand); }
.btn.primary{ background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.btn.primary:hover{ background:var(--brand2); }
.btn.ghost:hover{ background:#f3f6f4; }
.btn.tiny{ padding:5px 9px; font-size:11.5px; border-radius:7px; }
.btn.danger{ color:#b3402f; } .btn.danger:hover{ border-color:#b3402f; background:#fbeeec; }

/* ---- 본문 3단 ---- */
#main{ flex:1; display:flex; min-height:0; }
#sidebar{ flex:none; width:230px; background:var(--panel); border-right:1px solid var(--line);
  display:flex; flex-direction:column; min-height:0; }
.side-head,.pal-head{ font-size:11px; font-weight:800; letter-spacing:.5px; color:var(--mute);
  padding:12px 14px 7px; text-transform:uppercase; }
#list{ flex:1; overflow:auto; padding:0 8px 8px; }
.grp{ font-size:11.5px; font-weight:800; color:var(--brand); margin:10px 6px 3px; }
.item{ display:flex; align-items:center; gap:7px; padding:7px 9px; border-radius:8px; cursor:pointer;
  font-size:12.5px; color:var(--ink); }
.item:hover{ background:#f1f5f3; }
.item.active{ background:var(--brand); color:#fff; }
.item .v{ font-size:10px; opacity:.7; }
.item.active .v{ opacity:.9; }
.item .dot{ width:6px; height:6px; border-radius:50%; background:var(--gold); margin-left:auto; visibility:hidden; }
.item.edited .dot{ visibility:visible; }
.side-foot{ flex:none; padding:10px; border-top:1px solid var(--line); display:flex; gap:6px; }

/* ---- 가운데 무대 ---- */
#stageWrap{ flex:1; overflow:auto; background:#e4e7e4; padding:26px; display:flex; justify-content:center; }
#stage{ transform-origin:top center; }
.wsroot{ background:#fff; box-shadow:0 10px 34px -14px rgba(0,0,0,.45); }
.wsroot .page{ outline:none; }
/* 선택/편집 표시 */
.wsroot .page > *{ position:relative; }
.wsroot .page > *.sel{ outline:2px solid var(--gold); outline-offset:2px; border-radius:8px; }
.wsroot .page [contenteditable]:focus{ }

/* ---- 우측 팔레트 ---- */
#palette{ flex:none; width:236px; background:var(--panel); border-left:1px solid var(--line);
  display:flex; flex-direction:column; overflow:auto; }
.blocktools{ padding:6px 12px 12px; border-bottom:1px solid var(--line); }
.bt-name{ font-size:12px; color:var(--ink); margin-bottom:8px; min-height:17px; }
.bt-name b{ color:var(--brand); }
.bt-btns{ display:flex; gap:6px; }
.bt-colors{ margin-top:11px; padding-top:10px; border-top:1px dashed var(--line); }
.cc-row{ display:flex; align-items:center; gap:6px; margin-bottom:7px; }
.cc-lab{ font-size:11px; color:var(--mute); width:26px; flex:none; }
.sw{ display:flex; gap:4px; flex-wrap:wrap; flex:1; }
.swatch{ width:16px; height:16px; border-radius:5px; border:1px solid rgba(0,0,0,.15);
  cursor:pointer; padding:0; }
.swatch:hover{ transform:scale(1.18); border-color:var(--brand); }
.cc-cust{ font-size:13px; cursor:pointer; position:relative; width:20px; height:18px; flex:none;
  display:flex; align-items:center; justify-content:center; }
.cc-cust input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
#clearColor{ width:100%; margin-top:3px; }
.cc-hint{ font-size:10px; color:var(--mute); line-height:1.5; margin-top:8px; }
.cc-hint b{ color:var(--brand); }
.components{ padding:8px 12px; display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.comp{ font-size:11.5px; text-align:center; border:1px solid var(--line); border-radius:9px;
  background:#fff; padding:10px 6px; cursor:pointer; transition:.12s; line-height:1.35; }
.comp:hover{ border-color:var(--brand); background:#f3f6f4; }
.comp .ci{ display:block; font-size:17px; margin-bottom:3px; }
.pal-hint{ font-size:10.5px; color:var(--mute); padding:4px 14px 16px; line-height:1.5; }

/* ---- 하단 안내 ---- */
#hintbar{ flex:none; background:#fff8e9; border-top:1px solid #ecdcb4; color:#7a5f1f;
  font-size:11px; padding:7px 16px; text-align:center; }

/* ============ 인쇄(PDF 저장) ============ */
@media print{
  @page{ size:A4; margin:0; }
  #topbar,#sidebar,#palette,#hintbar{ display:none !important; }
  #main{ display:block !important; }
  #stageWrap{ overflow:visible !important; padding:0 !important; margin:0 !important; background:#fff !important; display:block !important; }
  #stage{ transform:none !important; }
  .wsroot{ box-shadow:none !important; }
  .wsroot .page{ box-shadow:none !important; margin:0 !important; }
  .wsroot .page > *.sel{ outline:none !important; }
}
