/* 상황판 서식 편집기 — 탐색용 스타일 (디자인 시스템 토큰 기반, bd- 접두)
   design_canvas 아트보드 안에서 렌더되므로 각 루트(.bd-root)에서 폰트·색을 재설정 */

.bd-root {
  font-family: var(--font-sans);
  color: var(--fg-body);
  background: var(--bg-app);
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  text-align: left;
}
.bd-root * { box-sizing: border-box; }
.bd-root .ss-num { font-variant-numeric: tabular-nums; }

/* ---- 공용 아이콘 ---- */
.bd-ic { display: inline-flex; flex-shrink: 0; }
.bd-ic svg { display: block; }

/* ---- 공용 버튼 ---- */
.bd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: inherit; font-weight: 700; border: none; border-radius: var(--r-md); padding: 9px 15px; font-size: var(--fs-body-sm); cursor: pointer; transition: all .15s cubic-bezier(.2,.7,.3,1); white-space: nowrap; }
.bd-btn--primary { background: var(--blue-500); color: #fff; box-shadow: var(--shadow-sm); }
.bd-btn--primary:hover { background: var(--blue-600); }
.bd-btn--ghost { background: #fff; color: var(--fg-body); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bd-btn--ghost:hover { background: var(--gray-100); }
.bd-btn--soft { background: var(--blue-50); color: var(--blue-700); }
.bd-btn--soft:hover { background: var(--blue-100); }
.bd-btn--sm { padding: 6px 11px; font-size: var(--fs-caption); border-radius: var(--r-sm); }
.bd-btn--lg { padding: 12px 20px; font-size: var(--fs-body); }

/* ============================ EDITOR TOPBAR (공용) ============================ */
.bd-topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-5); height: 60px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.bd-topbar__back { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; color: var(--fg-secondary); font-weight: 600; font-size: var(--fs-body-sm); cursor: pointer; white-space: nowrap; flex-shrink: 0; padding: 6px 8px; border-radius: var(--r-sm); }
.bd-topbar__back:hover { background: var(--gray-100); color: var(--fg-body); }
.bd-topbar__title { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex-shrink: 0; }
.bd-topbar__title b { font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bd-topbar__title span { font-size: var(--fs-caption); color: var(--fg-secondary); white-space: nowrap; }
.bd-vbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: 0.01em; }
.bd-vbadge--draft { background: var(--caution-bg); color: var(--caution-strong); }
.bd-vbadge--live { background: var(--safe-bg); color: var(--safe-strong); }
.bd-vbadge--review { background: var(--blue-50); color: var(--blue-700); }
.bd-topbar__spacer { flex: 1; }
.bd-topbar__actions { display: flex; align-items: center; gap: 8px; }
.bd-saved { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--fg-secondary); font-weight: 600; }
.bd-saved .bd-ic { color: var(--safe); }

/* ============================ 블록 (공용 렌더) ============================ */
.bd-block { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); position: relative; transition: box-shadow .16s, border-color .16s, transform .16s; }
.bd-block__bar { display: flex; align-items: center; gap: 9px; padding: 11px var(--sp-4) 11px 11px; border-bottom: 1px solid var(--border); }
.bd-block__grip { color: var(--gray-300); cursor: grab; display: inline-flex; padding: 2px; }
.bd-block__grip:hover { color: var(--gray-500); }
.bd-block__kind { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); flex-shrink: 0; }
.bd-block__kind.text { background: var(--accent-coral-bg); color: var(--accent-coral); }
.bd-block__kind.fields { background: var(--blue-50); color: var(--blue-600); }
.bd-block__kind.table { background: var(--safe-bg); color: var(--safe-strong); }
.bd-block__name { font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); letter-spacing: -0.01em; }
.bd-block__kindlab { margin-left: 2px; font-size: 10px; font-weight: 800; letter-spacing: 0.03em; color: var(--gray-500); background: var(--gray-100); padding: 2px 7px; border-radius: var(--r-pill); }
.bd-block__tools { margin-left: auto; display: flex; gap: 3px; }
.bd-blocktool { width: 28px; height: 28px; border-radius: var(--r-sm); border: none; background: transparent; color: var(--gray-400); display: grid; place-items: center; cursor: pointer; transition: all .14s; }
.bd-blocktool:hover { background: var(--gray-100); color: var(--fg-body); }
.bd-block__body { padding: var(--sp-4); }

/* 선택/추가 강조 */
.bd-block.is-selected { border-color: var(--blue-400); box-shadow: 0 0 0 3px var(--blue-100), var(--shadow-md); }
.bd-block.is-new { border-color: var(--caution); box-shadow: 0 0 0 3px var(--caution-bg); }

/* 고정 안내 텍스트 블록 */
.bd-textblock { font-size: var(--fs-body-sm); line-height: 1.65; color: var(--fg-body); white-space: pre-wrap; }
.bd-textblock.is-edit { border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); padding: 11px 13px; background: var(--gray-50); }
.bd-fixedtag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; color: var(--accent-coral); background: var(--accent-coral-bg); padding: 2px 8px; border-radius: var(--r-pill); margin-bottom: 9px; }

/* 필드 그리드 */
.bd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--gray-100); border: 1px solid var(--gray-100); border-radius: var(--r-md); overflow: hidden; }
.bd-field { background: #fff; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; position: relative; min-height: 64px; }
.bd-field.full { grid-column: span 2; }
.bd-field__lab { font-size: var(--fs-overline); font-weight: 800; color: var(--fg-secondary); letter-spacing: 0.02em; display: flex; align-items: center; gap: 6px; padding-right: 92px; }
.bd-field__val { font-size: var(--fs-body-sm); font-weight: 600; color: var(--fg-primary); }
.bd-field__val.fixed { color: var(--fg-primary); }
.bd-field__ph { font-size: var(--fs-body-sm); color: var(--gray-400); font-style: italic; font-weight: 500; }
.bd-field__input { border: 1.5px solid var(--blue-300); background: var(--blue-50); border-radius: var(--r-sm); padding: 5px 8px; font-size: var(--fs-body-sm); color: var(--fg-primary); font-family: inherit; outline: none; }
.bd-field.is-selected { box-shadow: inset 0 0 0 2px var(--blue-400); z-index: 1; }
.bd-field.is-new { background: var(--caution-bg); box-shadow: inset 0 0 0 2px var(--caution); }
.bd-field.is-new .bd-field__lab { color: var(--caution-strong); }

/* 표 블록 */
.bd-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--gray-200); border-radius: var(--r-md); overflow: hidden; }
.bd-table th, .bd-table td { padding: 9px 12px; text-align: left; font-size: var(--fs-body-sm); border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); }
.bd-table th:last-child, .bd-table td:last-child { border-right: none; }
.bd-table tr:last-child td { border-bottom: none; }
.bd-table thead th { background: var(--gray-50); font-size: var(--fs-overline); font-weight: 800; color: var(--fg-secondary); letter-spacing: 0.02em; position: relative; }
.bd-table thead .bd-th { display: flex; align-items: center; gap: 6px; }
.bd-table td { color: var(--fg-primary); font-weight: 500; }
.bd-table td.empty { color: var(--gray-400); font-style: italic; }
.bd-table .bd-addcol, .bd-table .bd-addrow { color: var(--blue-600); }

/* ---- 권한 칩 (셀별) ---- */
.bd-perm { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; border: none; font-family: inherit; cursor: default; line-height: 1.4; }
.bd-perm--school { background: var(--blue-50); color: var(--blue-700); }
.bd-perm--safe { background: var(--gray-100); color: var(--gray-600); }
.bd-perm.is-toggle { cursor: pointer; transition: all .14s; }
.bd-perm.is-toggle.bd-perm--school:hover { background: var(--blue-100); }
.bd-perm.is-toggle.bd-perm--safe:hover { background: var(--gray-200); }
.bd-perm .bd-ic svg { width: 11px; height: 11px; }
.bd-field__perm { position: absolute; top: 9px; right: 10px; }

/* 셀 유형 배지 */
.bd-typebadge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: var(--r-sm); }
.bd-typebadge--fixed { background: var(--accent-coral-bg); color: var(--accent-coral); }
.bd-typebadge--input { background: var(--safe-bg); color: var(--safe-strong); }

/* ============================ 안 A — 3분할 작업대 ============================ */
.bdA { display: grid; grid-template-columns: 248px 1fr 296px; flex: 1; min-height: 0; }
.bdA__col { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.bdA__palette { background: #fff; border-right: 1px solid var(--border); }
.bdA__canvas { background: var(--bg-app); }
.bdA__props { background: #fff; border-left: 1px solid var(--border); }
.bdA__scroll { overflow: auto; padding: var(--sp-5); flex: 1; }
.bdA__secttl { font-size: var(--fs-overline); font-weight: 800; color: var(--fg-secondary); letter-spacing: 0.04em; margin: 0 0 11px; }

/* 팔레트 항목 */
.bd-palgroup { margin-bottom: var(--sp-5); }
.bd-palitem { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; cursor: grab; transition: all .15s; margin-bottom: 8px; font-family: inherit; }
.bd-palitem:hover { border-color: var(--blue-300); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.bd-palitem__ic { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; }
.bd-palitem__ic.text { background: var(--accent-coral-bg); color: var(--accent-coral); }
.bd-palitem__ic.fields { background: var(--blue-50); color: var(--blue-600); }
.bd-palitem__ic.table { background: var(--safe-bg); color: var(--safe-strong); }
.bd-palitem__t { display: block; font-size: var(--fs-body-sm); font-weight: 700; color: var(--fg-primary); }
.bd-palitem__d { display: block; font-size: var(--fs-caption); color: var(--fg-secondary); margin-top: 2px; line-height: 1.35; }
.bd-palhint { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-caption); color: var(--fg-secondary); line-height: 1.5; background: var(--blue-50); border-radius: var(--r-md); padding: 10px 12px; }
.bd-palhint .bd-ic { color: var(--blue-500); flex-shrink: 0; margin-top: 1px; }

/* 캔버스 내부 블록 스택 */
.bdA-stack { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 640px; margin: 0 auto; }
.bd-canvas-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); color: var(--fg-secondary); font-weight: 700; font-size: var(--fs-body-sm); background: rgba(255,255,255,0.5); cursor: pointer; transition: all .15s; }
.bd-canvas-add:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); }

/* 속성 패널 */
.bd-prop__empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--fg-secondary); }
.bd-prop__empty .bd-ic { color: var(--gray-300); margin-bottom: 10px; }
.bd-prop__empty p { font-size: var(--fs-body-sm); line-height: 1.55; margin: 0; }
.bd-prop__head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.bd-prop__head .k { font-size: var(--fs-overline); font-weight: 800; color: var(--blue-600); letter-spacing: 0.03em; }
.bd-prop__head h4 { margin: 4px 0 0; font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); }
.bd-prop__sect { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--gray-100); }
.bd-prop__lab { font-size: var(--fs-caption); font-weight: 800; color: var(--fg-secondary); margin-bottom: 8px; display: block; }
.bd-prop__inp { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: var(--fs-body-sm); font-family: inherit; color: var(--fg-primary); outline: none; transition: all .14s; }
.bd-prop__inp:focus { border-color: var(--blue-500); box-shadow: var(--focus-ring); }
textarea.bd-prop__inp { resize: vertical; min-height: 62px; line-height: 1.5; }

/* 세그먼트 선택 (유형/권한) */
.bd-seg { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: var(--r-md); }
.bd-seg button { flex: 1; border: none; background: transparent; font-family: inherit; font-weight: 700; font-size: var(--fs-caption); color: var(--fg-secondary); padding: 8px 6px; border-radius: var(--r-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: all .14s; }
.bd-seg button.active { background: #fff; box-shadow: var(--shadow-sm); color: var(--fg-primary); }
.bd-seg button.active.school { color: var(--blue-700); }
.bd-seg button.active.safe { color: var(--gray-700); }
.bd-seg button.active.input { color: var(--safe-strong); }
.bd-seg button.active.fixed { color: var(--accent-coral); }
.bd-seg .bd-ic svg { width: 13px; height: 13px; }
.bd-prop__hint { font-size: var(--fs-caption); color: var(--fg-secondary); line-height: 1.5; margin-top: 9px; }
.bd-prop__hint b { color: var(--fg-body); }

/* ============================ 안 B — 인라인 캔버스 (Docs식) ============================ */
.bdB { flex: 1; overflow: auto; background: var(--bg-sunken); }
.bdB__doc { max-width: 720px; margin: var(--sp-8) auto var(--sp-16); background: transparent; }
.bdB__sheet { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: var(--sp-8) var(--sp-8) var(--sp-6); }
.bdB__doctitle { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; color: var(--fg-primary); margin: 0; }
.bdB__docsub { font-size: var(--fs-body-sm); color: var(--fg-secondary); margin: 6px 0 0; }
.bdB__rule { height: 1px; background: var(--border); margin: var(--sp-5) 0 var(--sp-4); }

/* 인라인 블록 (문서 흐름) */
.bdB-block { position: relative; padding: 6px 0; }
.bdB-block__label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-overline); font-weight: 800; color: var(--fg-secondary); letter-spacing: 0.03em; margin-bottom: 8px; }
.bdB-text { font-size: var(--fs-body-sm); line-height: 1.7; color: var(--fg-body); padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid transparent; }
.bdB-text:hover { background: var(--gray-50); border-color: var(--border); }
.bdB-text.is-active { background: #fff; border-color: var(--blue-300); box-shadow: var(--focus-ring); }

/* 인서터 (+ between blocks) */
.bdB-insert { position: relative; height: 14px; display: flex; align-items: center; justify-content: center; }
.bdB-insert::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--blue-200); opacity: 0; transition: opacity .15s; }
.bdB-insert:hover::before { opacity: 1; }
.bdB-insert__btn { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: var(--r-pill); border: 1px solid var(--blue-200); background: #fff; color: var(--blue-600); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: all .15s; box-shadow: var(--shadow-sm); }
.bdB-insert:hover .bdB-insert__btn { opacity: 1; }
.bdB-insert.show .bdB-insert__btn { opacity: 1; }
.bdB-insert__btn:hover { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }

/* 인서터 메뉴 (열린 상태 예시) */
.bdB-insertmenu { position: relative; z-index: 2; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: flex; gap: 6px; margin: 4px auto; width: max-content; }
.bdB-insertmenu button { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; width: 92px; padding: 11px 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer; font-family: inherit; transition: all .14s; }
.bdB-insertmenu button:hover { background: var(--gray-50); border-color: var(--border); }
.bdB-insertmenu .ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; }
.bdB-insertmenu .ic.text { background: var(--accent-coral-bg); color: var(--accent-coral); }
.bdB-insertmenu .ic.fields { background: var(--blue-50); color: var(--blue-600); }
.bdB-insertmenu .ic.table { background: var(--safe-bg); color: var(--safe-strong); }
.bdB-insertmenu .t { font-size: var(--fs-caption); font-weight: 700; color: var(--fg-primary); }

/* 셀 플로팅 툴바 (셀 클릭 시) */
.bdB-celltb { position: absolute; z-index: 6; background: var(--navy-900); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; display: flex; align-items: center; gap: 3px; }
.bdB-celltb::after { content: ""; position: absolute; bottom: -5px; left: 22px; width: 10px; height: 10px; background: var(--navy-900); transform: rotate(45deg); }
.bdB-celltb__grp { display: flex; align-items: center; gap: 2px; }
.bdB-celltb__sep { width: 1px; height: 20px; background: rgba(255,255,255,0.18); margin: 0 4px; }
.bdB-celltb button { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: rgba(255,255,255,0.72); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 6px 9px; border-radius: var(--r-sm); cursor: pointer; transition: all .13s; white-space: nowrap; }
.bdB-celltb button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.bdB-celltb button.active { background: var(--blue-500); color: #fff; }
.bdB-celltb button.active.coral { background: var(--accent-coral); }
.bdB-celltb button.active.green { background: var(--safe); }
.bdB-celltb .bd-ic svg { width: 14px; height: 14px; }

/* 인라인 필드/표 컨테이너 */
.bdB-fieldwrap, .bdB-tablewrap { padding: 4px 0; }

/* ============================ 안 C — 분할 미리보기 ============================ */
.bdC { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
.bdC__edit { background: #fff; border-right: 1px solid var(--border); overflow: auto; }
.bdC__preview { background: var(--bg-app); overflow: auto; }
.bdC__panehead { display: flex; align-items: center; gap: 9px; padding: 13px var(--sp-5); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(255,255,255,0.92); backdrop-filter: blur(6px); z-index: 2; }
.bdC__preview .bdC__panehead { background: rgba(246,248,251,0.92); }
.bdC__panehead h4 { margin: 0; font-size: var(--fs-body-sm); font-weight: 800; color: var(--fg-primary); }
.bdC__panehead .sub { font-size: var(--fs-caption); color: var(--fg-secondary); margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bdC__panehead .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--safe); }
.bdC__editbody { padding: var(--sp-5); display: flex; flex-direction: column; gap: 10px; }
.bdC__previewbody { padding: var(--sp-5); }

/* 아웃라인 행 (편집 측) */
.bd-outline { display: flex; flex-direction: column; gap: 9px; }
.bd-outline__block { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.bd-outline__bhead { display: flex; align-items: center; gap: 8px; padding: 9px 11px; background: var(--gray-50); border-bottom: 1px solid var(--border); }
.bd-outline__bhead .nm { font-size: var(--fs-body-sm); font-weight: 800; color: var(--fg-primary); }
.bd-outline__rows { padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.bd-orow { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--border); }
.bd-orow.is-new { border-color: var(--caution); background: var(--caution-bg); }
.bd-orow__grip { color: var(--gray-300); display: inline-flex; cursor: grab; }
.bd-orow__nm { font-size: var(--fs-body-sm); font-weight: 700; color: var(--fg-primary); min-width: 0; flex: 1; }
.bd-orow__controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bd-minisel { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-caption); font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: #fff; color: var(--fg-secondary); cursor: pointer; font-family: inherit; transition: all .14s; }
.bd-minisel:hover { border-color: var(--border-strong); }
.bd-minisel.school { background: var(--blue-50); color: var(--blue-700); border-color: transparent; }
.bd-minisel.fixed { background: var(--accent-coral-bg); color: var(--accent-coral); border-color: transparent; }
.bd-minisel .bd-ic svg { width: 12px; height: 12px; }
.bd-outline__add { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; color: var(--blue-600); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 6px 8px; cursor: pointer; border-radius: var(--r-sm); }
.bd-outline__add:hover { background: var(--blue-50); }

/* 미리보기 측 — 학교 시점 상황판 */
.bd-pvcard { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: var(--sp-4); overflow: hidden; }
.bd-pvcard__head { display: flex; align-items: center; gap: 9px; padding: 12px var(--sp-4); border-bottom: 1px solid var(--border); }
.bd-pvcard__head .hic { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.bd-pvcard__head h5 { margin: 0; font-size: var(--fs-body-sm); font-weight: 800; color: var(--fg-primary); white-space: nowrap; }
.bd-pvcard__body { padding: var(--sp-4); }
.bd-pvnote { display: flex; gap: 9px; align-items: flex-start; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--r-md); padding: 11px 13px; font-size: var(--fs-caption); line-height: 1.55; color: var(--blue-800); margin-bottom: var(--sp-4); }
.bd-pvnote .bd-ic { color: var(--blue-500); flex-shrink: 0; margin-top: 1px; }

/* ============================ 흐름 — 서식 관리 탭 ============================ */
.bd-flow { flex: 1; overflow: auto; }
.bd-flow__wrap { max-width: 920px; margin: 0 auto; padding: var(--sp-8) var(--sp-6) var(--sp-12); }
.bd-flow__head .ov { font-size: var(--fs-overline); font-weight: 800; letter-spacing: 0.06em; color: var(--blue-600); }
.bd-flow__head h1 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; color: var(--fg-primary); margin: 8px 0 5px; }
.bd-flow__head p { margin: 0; font-size: var(--fs-body-sm); color: var(--fg-secondary); }
.bd-flow__toolbar { display: flex; align-items: center; gap: 10px; margin: var(--sp-6) 0 var(--sp-5); }
.bd-flow__tabs { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: var(--r-md); }
.bd-flow__tabs button { border: none; background: transparent; font-family: inherit; font-weight: 700; font-size: var(--fs-body-sm); color: var(--fg-secondary); padding: 8px 15px; border-radius: var(--r-sm); cursor: pointer; }
.bd-flow__tabs button.active { background: #fff; box-shadow: var(--shadow-sm); color: var(--fg-primary); }

/* 서식 카드 (영역별) */
.bd-tmpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.bd-tmpl { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--sp-4) var(--sp-5); transition: all .16s; }
.bd-tmpl:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--blue-200); }
.bd-tmpl.draft { border-style: dashed; }
.bd-tmpl__top { display: flex; align-items: center; gap: 11px; }
.bd-tmpl__ic { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); flex-shrink: 0; }
.bd-tmpl__ic.muted { background: var(--gray-100); color: var(--gray-400); }
.bd-tmpl__nm { font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-tmpl__meta { font-size: var(--fs-caption); color: var(--fg-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-tmpl__stat { margin-left: auto; flex-shrink: 0; }
.bd-tmpl__foot { display: flex; align-items: center; gap: 8px; margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--gray-100); }
.bd-tmpl__use { font-size: var(--fs-caption); color: var(--fg-secondary); font-weight: 600; }
.bd-tmpl__use b { color: var(--blue-700); }
.bd-tmpl__act { margin-left: auto; display: flex; gap: 6px; }

/* 버전 타임라인 */
.bd-vtl { display: flex; flex-direction: column; }
.bd-vtl__item { display: flex; gap: 13px; padding: 12px 0; position: relative; }
.bd-vtl__item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: -12px; width: 2px; background: var(--gray-200); }
.bd-vtl__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; z-index: 1; font-weight: 800; font-size: var(--fs-caption); }
.bd-vtl__dot.live { background: var(--safe); color: #fff; }
.bd-vtl__dot.old { background: var(--gray-100); color: var(--gray-500); }
.bd-vtl__dot.draft { background: var(--caution-bg); color: var(--caution-strong); border: 2px dashed var(--caution); }
.bd-vtl__b { flex: 1; }
.bd-vtl__t { display: flex; align-items: center; gap: 9px; }
.bd-vtl__t b { font-size: var(--fs-body-sm); font-weight: 800; color: var(--fg-primary); }
.bd-vtl__sum { font-size: var(--fs-caption); color: var(--fg-secondary); margin-top: 3px; line-height: 1.5; }
.bd-vtl__at { margin-left: auto; font-size: var(--fs-caption); color: var(--fg-secondary); white-space: nowrap; }

/* ============================ 흐름 — 발행 검토 (diff) ============================ */
.bd-publish { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-5); }
.bd-diff { display: flex; flex-direction: column; gap: 8px; }
.bd-diffrow { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--border); background: #fff; }
.bd-diffrow__tag { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-sm); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.bd-diffrow.add { border-color: var(--safe); background: var(--safe-bg); }
.bd-diffrow.add .bd-diffrow__tag { background: var(--safe); color: #fff; }
.bd-diffrow.edit { border-color: var(--caution); background: var(--caution-bg); }
.bd-diffrow.edit .bd-diffrow__tag { background: var(--caution); color: #fff; }
.bd-diffrow.perm { border-color: var(--blue-300); background: var(--blue-50); }
.bd-diffrow.perm .bd-diffrow__tag { background: var(--blue-500); color: #fff; }
.bd-diffrow__b { min-width: 0; }
.bd-diffrow__t { font-size: var(--fs-body-sm); font-weight: 700; color: var(--fg-primary); }
.bd-diffrow__d { font-size: var(--fs-caption); color: var(--fg-secondary); margin-top: 2px; line-height: 1.5; }
.bd-migbox { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--sp-5); align-self: start; position: sticky; top: var(--sp-5); }
.bd-migbox h4 { margin: 0 0 6px; font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bd-migbox p { font-size: var(--fs-caption); color: var(--fg-secondary); line-height: 1.6; margin: 0 0 var(--sp-4); }
.bd-migstat { display: flex; flex-direction: column; gap: 9px; margin-bottom: var(--sp-5); }
.bd-migstat__row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-body-sm); }
.bd-migstat__ic { width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; }
.bd-migstat__ic.keep { background: var(--safe-bg); color: var(--safe-strong); }
.bd-migstat__ic.add { background: var(--blue-50); color: var(--blue-600); }
.bd-migstat__ic.school { background: var(--caution-bg); color: var(--caution-strong); }
.bd-migstat__row b { color: var(--fg-primary); font-weight: 800; }
.bd-migstat__row span { color: var(--fg-secondary); }

/* 발행 스텝 인디케이터 */
.bd-steps { display: flex; align-items: center; gap: 0; margin: var(--sp-5) 0 var(--sp-6); }
.bd-step { display: flex; align-items: center; gap: 9px; }
.bd-step__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-caption); font-weight: 800; flex-shrink: 0; }
.bd-step.done .bd-step__n { background: var(--safe); color: #fff; }
.bd-step.active .bd-step__n { background: var(--blue-500); color: #fff; box-shadow: 0 0 0 4px var(--blue-100); }
.bd-step.todo .bd-step__n { background: var(--gray-100); color: var(--gray-500); }
.bd-step__t { font-size: var(--fs-body-sm); font-weight: 700; }
.bd-step.active .bd-step__t { color: var(--blue-700); }
.bd-step.done .bd-step__t { color: var(--fg-body); }
.bd-step.todo .bd-step__t { color: var(--gray-400); }
.bd-step__line { width: 44px; height: 2px; background: var(--gray-200); margin: 0 14px; }
.bd-step.done + .bd-step__line, .bd-step__line.done { background: var(--safe); }

/* ============================ 흐름 — 학교 마이그레이션 뷰 ============================ */
.bd-mig { max-width: 680px; margin: 0 auto; }
.bd-migbanner { display: flex; align-items: center; gap: 13px; background: linear-gradient(120deg, var(--blue-50), var(--bg-brand-soft)); border: 1px solid var(--blue-200); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); }
.bd-migbanner__ic { width: 42px; height: 42px; border-radius: var(--r-md); background: var(--blue-500); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.bd-migbanner__t b { display: block; font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); }
.bd-migbanner__t span { font-size: var(--fs-caption); color: var(--blue-800); }
.bd-migbanner__v { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-caption); font-weight: 800; color: var(--blue-700); }
.bd-migbanner__v .old { color: var(--gray-400); text-decoration: line-through; }
.bd-changesum { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px var(--sp-4); margin-bottom: var(--sp-5); }
.bd-changesum__ttl { font-size: var(--fs-caption); font-weight: 800; color: var(--fg-secondary); margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.bd-changesum li { font-size: var(--fs-body-sm); color: var(--fg-body); line-height: 1.7; }
.bd-changesum li b { color: var(--blue-700); }
.bd-changesum ul { margin: 0; padding-left: 18px; }

/* 마이그레이션 강조 (학교 시점) — 디자인 시스템의 changed 펄스 차용 */
.bd-field.mig-new, .bd-pv-mig { position: relative; background: var(--caution-bg); box-shadow: inset 0 0 0 2px var(--caution); padding-top: 22px; }
.bd-mig-flag { position: absolute; top: 3px; left: 10px; font-size: 10px; font-weight: 800; color: #fff; background: var(--caution-strong); padding: 2px 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 4px; }
.bd-mig-flag .bd-ic svg { width: 10px; height: 10px; }

/* 빈 칸 (학교가 채울 자리) */
.bd-emptyslot { font-size: var(--fs-body-sm); color: var(--gray-400); font-style: italic; }

/* 인트로 패널 */
.bd-intro { padding: var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-5); height: 100%; overflow: auto; }
.bd-intro__ov { font-size: var(--fs-overline); font-weight: 800; letter-spacing: 0.06em; color: var(--blue-600); }
.bd-intro h1 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; color: var(--fg-primary); margin: 6px 0 0; }
.bd-intro__lead { font-size: var(--fs-body); line-height: 1.65; color: var(--fg-body); margin: 0; }
.bd-intro__lead b { color: var(--blue-700); }
.bd-concept { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bd-conceptcard { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); background: #fff; }
.bd-conceptcard h4 { margin: 0 0 6px; font-size: var(--fs-body-sm); font-weight: 800; color: var(--fg-primary); display: flex; align-items: center; gap: 8px; }
.bd-conceptcard h4 .bd-ic { color: var(--blue-600); }
.bd-conceptcard p { margin: 0; font-size: var(--fs-caption); line-height: 1.6; color: var(--fg-secondary); }
.bd-intro__list { display: flex; flex-direction: column; gap: 10px; }
.bd-intro__li { display: flex; gap: 11px; align-items: flex-start; font-size: var(--fs-body-sm); line-height: 1.6; }
.bd-intro__li .n { width: 22px; height: 22px; border-radius: 50%; background: var(--blue-500); color: #fff; font-size: var(--fs-caption); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.bd-intro__li b { color: var(--fg-primary); }
.bd-divider { height: 1px; background: var(--border); }
.bd-key { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-caption); font-weight: 700; color: var(--fg-secondary); background: var(--gray-100); padding: 4px 9px; border-radius: var(--r-sm); }

/* ============================================================
   동작 편집기 (안 B 기반) — ed- 접두
   ============================================================ */
.ed-scroll { flex: 1; overflow: auto; background: var(--bg-sunken); }
.ed-doc { max-width: 740px; margin: var(--sp-8) auto var(--sp-16); }
.ed-sheet { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: var(--sp-8) var(--sp-8) var(--sp-6); }

/* 인라인 편집 입력 — 평소엔 텍스트처럼, hover/focus 시 드러남 */
.ed-iedit { font-family: inherit; color: inherit; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); outline: none; width: 100%; padding: 3px 6px; transition: background .13s, border-color .13s, box-shadow .13s; resize: none; overflow: hidden; }
.ed-iedit:hover { background: var(--gray-50); border-color: var(--border); }
.ed-iedit:focus { background: #fff; border-color: var(--blue-400); box-shadow: var(--focus-ring); }
.ed-iedit::placeholder { color: var(--gray-400); }

.ed-title { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; color: var(--fg-primary); padding: 4px 8px; margin: -4px -8px 0; }
.ed-docsub { font-size: var(--fs-body-sm); color: var(--fg-secondary); margin: 6px 0 0; }
.ed-rule { height: 1px; background: var(--border); margin: var(--sp-5) 0 var(--sp-2); }

/* 블록 */
.ed-block { position: relative; padding: 8px 0; border-radius: var(--r-md); }
.ed-block__label { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ed-block__label .ed-kindtag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-overline); font-weight: 800; letter-spacing: 0.03em; color: var(--fg-secondary); flex-shrink: 0; white-space: nowrap; }
.ed-block__label .ed-kindtag.text { color: var(--accent-coral); }
.ed-block__label .ed-kindtag.fields { color: var(--blue-600); }
.ed-block__label .ed-kindtag.table { color: var(--safe-strong); }
.ed-block__title { font-size: var(--fs-body); font-weight: 800; color: var(--fg-primary); letter-spacing: -0.01em; flex: 1; min-width: 0; }
.ed-block__actions { display: flex; gap: 2px; opacity: 0; transition: opacity .14s; }
.ed-block:hover .ed-block__actions { opacity: 1; }
.ed-block__btn { width: 26px; height: 26px; border-radius: var(--r-sm); border: none; background: transparent; color: var(--gray-400); display: grid; place-items: center; cursor: pointer; transition: all .13s; }
.ed-block__btn:hover { background: var(--gray-100); color: var(--fg-body); }
.ed-block__btn.danger:hover { background: var(--danger-bg); color: var(--danger-strong); }

.ed-textbody { font-size: var(--fs-body-sm); line-height: 1.7; color: var(--fg-body); }
.ed-textbody .ed-iedit { line-height: 1.7; }
.ed-fixednote { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; color: var(--accent-coral); background: var(--accent-coral-bg); padding: 2px 8px; border-radius: var(--r-pill); margin-bottom: 8px; }

/* 인서터 */
.ed-insert { position: relative; height: 16px; display: flex; align-items: center; justify-content: center; }
.ed-insert::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--blue-200); opacity: 0; transition: opacity .15s; }
.ed-insert:hover::before { opacity: 1; }
.ed-insert__btn { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--blue-200); background: #fff; color: var(--blue-600); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: all .15s; box-shadow: var(--shadow-sm); }
.ed-insert:hover .ed-insert__btn, .ed-insert.open .ed-insert__btn { opacity: 1; }
.ed-insert.open .ed-insert__btn { background: var(--blue-500); color: #fff; border-color: var(--blue-500); transform: rotate(45deg); }
.ed-insert__btn:hover { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
.ed-insertmenu { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: flex; gap: 6px; margin: 6px auto; width: max-content; }
.ed-insertmenu button { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; padding: 11px 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer; font-family: inherit; transition: all .13s; }
.ed-insertmenu button:hover { background: var(--gray-50); border-color: var(--border); }
.ed-insertmenu .ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; }
.ed-insertmenu .ic.text { background: var(--accent-coral-bg); color: var(--accent-coral); }
.ed-insertmenu .ic.fields { background: var(--blue-50); color: var(--blue-600); }
.ed-insertmenu .ic.table { background: var(--safe-bg); color: var(--safe-strong); }
.ed-insertmenu .t { font-size: var(--fs-caption); font-weight: 700; color: var(--fg-primary); }

/* 필드 셀 (편집) */
.ed-fieldcell { position: relative; background: #fff; padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-height: 66px; transition: box-shadow .13s; }
.ed-fieldcell:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.ed-fieldcell.sel { box-shadow: inset 0 0 0 2px var(--blue-400); z-index: 2; }
.ed-fieldcell__top { display: flex; align-items: center; gap: 6px; }
.ed-fieldcell__lab { font-size: var(--fs-overline); font-weight: 800; color: var(--fg-secondary); letter-spacing: 0.02em; flex: 1; min-width: 0; }
.ed-fieldcell__lab .ed-iedit { font-size: var(--fs-overline); font-weight: 800; letter-spacing: 0.02em; }
.ed-fieldcell__val { font-size: var(--fs-body-sm); font-weight: 600; color: var(--fg-primary); }
.ed-fieldcell__ph { font-size: var(--fs-body-sm); color: var(--gray-400); font-style: italic; font-weight: 500; padding: 3px 6px; }
.ed-addcell { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--gray-50); color: var(--blue-600); font-weight: 700; font-size: var(--fs-caption); cursor: pointer; min-height: 66px; transition: background .13s; white-space: nowrap; }
.ed-addcell:hover { background: var(--blue-50); }

/* 셀 플로팅 툴바 (편집) — bdB-celltb 재사용 + 위치 */
.ed-celltb { position: absolute; z-index: 8; bottom: calc(100% + 8px); left: 8px; background: var(--navy-900); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; display: flex; align-items: center; gap: 3px; }
.ed-celltb::after { content: ""; position: absolute; bottom: -5px; left: 22px; width: 10px; height: 10px; background: var(--navy-900); transform: rotate(45deg); }
.ed-celltb.right { left: auto; right: 8px; }
.ed-celltb.right::after { left: auto; right: 22px; }
.ed-celltb__grp { display: flex; align-items: center; gap: 2px; }
.ed-celltb__sep { width: 1px; height: 20px; background: rgba(255,255,255,0.18); margin: 0 4px; }
.ed-celltb button { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: rgba(255,255,255,0.72); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 6px 9px; border-radius: var(--r-sm); cursor: pointer; transition: all .12s; white-space: nowrap; }
.ed-celltb button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.ed-celltb button.on { background: var(--blue-500); color: #fff; }
.ed-celltb button.on.coral { background: var(--accent-coral); }
.ed-celltb button.on.green { background: var(--safe); }
.ed-celltb button.danger:hover { background: var(--danger); color: #fff; }
.ed-celltb .bd-ic svg { width: 14px; height: 14px; }

/* 편집 표 */
.ed-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--gray-200); border-radius: var(--r-md); overflow: hidden; }
.ed-table th, .ed-table td { border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); padding: 0; vertical-align: middle; }
.ed-table th:last-child, .ed-table td:last-child { border-right: none; }
.ed-table tbody tr:last-child td { border-bottom: none; }
.ed-table thead th { background: var(--gray-50); }
.ed-th { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.ed-th .ed-iedit { font-size: var(--fs-overline); font-weight: 800; letter-spacing: 0.02em; color: var(--fg-secondary); }
.ed-td .ed-iedit { font-size: var(--fs-body-sm); color: var(--fg-primary); padding: 8px 10px; border-radius: 0; }
.ed-td .ed-iedit:hover { background: var(--blue-50); border-color: transparent; }
.ed-rowdel { width: 26px; text-align: center; }
.ed-rowdel button { width: 22px; height: 22px; border: none; background: transparent; color: var(--gray-300); border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center; }
.ed-rowdel button:hover { background: var(--danger-bg); color: var(--danger-strong); }
.ed-tableadd { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.ed-tableadd button { display: inline-flex; align-items: center; gap: 5px; border: 1px dashed var(--border-strong); background: #fff; color: var(--blue-600); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 6px 11px; border-radius: var(--r-sm); cursor: pointer; transition: all .13s; white-space: nowrap; }
.ed-tableadd button:hover { border-color: var(--blue-400); background: var(--blue-50); }
.ed-rowaddperm { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: var(--fs-caption); font-weight: 700; color: var(--fg-secondary); white-space: nowrap; }
.ed-rowaddperm .bd-ic { color: var(--gray-400); }
.ed-tablenote { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: var(--fs-caption); color: var(--fg-secondary); line-height: 1.4; }
.ed-tablenote .bd-ic { color: var(--blue-400); flex-shrink: 0; }

/* 학교 운영 표 — 셀 입력 + 행 추가 */
.sch-table td.sch-open { padding: 4px; background: rgba(42,99,224,0.04); }
.sch-input { width: 100%; border: 1.5px solid var(--blue-200); background: var(--blue-50); border-radius: var(--r-sm); padding: 6px 9px; font-family: inherit; font-size: var(--fs-body-sm); color: var(--fg-primary); outline: none; transition: border-color .13s, box-shadow .13s; }
.sch-input::placeholder { color: var(--blue-300); }
.sch-input:focus { border-color: var(--blue-500); box-shadow: var(--focus-ring); }
.sch-table .sch-del { width: 34px; text-align: center; }
.sch-table .sch-del button { width: 24px; height: 24px; border: none; background: transparent; color: var(--gray-300); border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center; }
.sch-table .sch-del button:hover { background: var(--danger-bg); color: var(--danger-strong); }
.sch-addrow { padding: 0 !important; }
.sch-addrow button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: none; background: var(--blue-50); color: var(--blue-700); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 9px; cursor: pointer; transition: background .13s; white-space: nowrap; }
.sch-addrow button:hover { background: var(--blue-100); }

/* 빈 블록 추가 (문서 끝) */
.ed-endadd { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); color: var(--fg-secondary); font-weight: 700; font-size: var(--fs-body-sm); background: transparent; cursor: pointer; width: 100%; transition: all .14s; margin-top: 8px; white-space: nowrap; }
.ed-endadd:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); }

/* 미리보기 모드 토글 (topbar) */
.ed-modeswitch { display: flex; gap: 0; background: var(--gray-100); border-radius: var(--r-pill); padding: 4px; }
.ed-modeswitch button { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--fg-secondary); font-family: inherit; font-weight: 700; font-size: var(--fs-caption); padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer; transition: all .14s; }
.ed-modeswitch button.active { background: #fff; box-shadow: var(--shadow-sm); color: var(--blue-700); }
.ed-modeswitch button.active.school { color: var(--safe-strong); }
.ed-modeswitch .bd-ic svg { width: 14px; height: 14px; }

/* 학교 미리보기 (편집기 내부) */
.ed-pvwrap { max-width: 740px; margin: var(--sp-8) auto var(--sp-16); }
.ed-pvbanner { display: flex; align-items: center; gap: 10px; background: var(--safe-bg); border: 1px solid var(--safe); border-radius: var(--r-md); padding: 11px 14px; font-size: var(--fs-body-sm); font-weight: 600; color: var(--safe-strong); margin-bottom: var(--sp-4); }
.ed-pvbanner .bd-ic { flex-shrink: 0; }

/* 토스트 */
.ed-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-size: var(--fs-body-sm); font-weight: 600; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 9px; z-index: 200; }
.ed-toast .bd-ic { color: var(--safe); }

/* 서식 발행 검토 모달 (메인 앱) */
.ed-reviewscrim { position: fixed; inset: 0; z-index: 120; background: rgba(17,38,68,0.42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: var(--sp-6); }
.ed-reviewcard { width: 100%; max-width: 860px; max-height: 88vh; overflow: auto; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-xl); }
.ed-reviewcard__head { display: flex; align-items: center; gap: 10px; padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.ed-reviewcard__head h3 { margin: 0; font-size: var(--fs-h3); font-weight: 800; color: var(--fg-primary); display: flex; align-items: center; gap: 9px; }
.ed-reviewcard__head .bd-blocktool { margin-left: auto; }
.ed-reviewcard__body { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-5); padding: var(--sp-6); align-items: start; }
@media (max-width: 720px) { .ed-reviewcard__body { grid-template-columns: 1fr; } }
