/* colon-grid 문서 사이트 자체의 껍데기 — 키트(admin.css)와 섞지 않는다 */
body { background: #f8fafc; color: #0f172a; }
.site-top {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 12px 24px; background: #fff; border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; z-index: 50;
}
.site-brand { font-weight: 800; letter-spacing: -.3px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.site-logo { width: 22px; height: 22px; border-radius: 6px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
    padding: 6px 12px; border-radius: 8px; font-size: 13px; color: #475569; text-decoration: none;
}
.site-nav a:hover { background: #f1f5f9; }
.site-nav a.on { background: #0f172a; color: #fff; font-weight: 600; }
.site-ver { margin-left: auto; font-size: 12px; color: #94a3b8; }
.site-main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.site-head h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.site-lead { color: #475569; font-size: 14px; margin-bottom: 20px; line-height: 1.7; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.card h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.card p, .card li { font-size: 13.5px; color: #334155; line-height: 1.75; }
.card ul { list-style: disc; padding-left: 20px; }
.card ol { list-style: decimal; padding-left: 20px; }
pre {
    background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px;
    overflow-x: auto; font-size: 12.5px; line-height: 1.65; margin: 10px 0;
}
pre .k { color: #7dd3fc; }
pre .c { color: #94a3b8; }   /* 코드 안 주석(도움말 카드 등) */
code.inline { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }
table.doc { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.doc th, table.doc td { border: 1px solid #e2e8f0; padding: 8px 10px; font-size: 13px; text-align: left; vertical-align: top; }
table.doc th { background: #f8fafc; font-weight: 700; white-space: nowrap; }
.warn { border-left: 3px solid #f59e0b; background: #fffbeb; padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 10px 0; }
.warn strong { color: #b45309; }
.grid-tip { font-size: 12.5px; color: #64748b; margin-bottom: 12px; }

/* 옵션 실험실 */
.pg-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.pg-panel { position: sticky; top: 70px; }
.pg-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.pg-opt:first-of-type { border-top: 0; }
.pg-toggle { border: 1px solid #cbd5e1; background: #fff; color: #64748b; border-radius: 999px; padding: 3px 12px; font-size: 11px; font-weight: 700; cursor: pointer; }
.pg-toggle.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.pg-pick { display: inline-flex; gap: 4px; }
.pg-chip { border: 1px solid #cbd5e1; background: #fff; color: #64748b; border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.pg-chip.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.pg-view { min-width: 0; }
#pgCode { max-height: 320px; overflow: auto; }
@media (max-width: 900px) { .pg-wrap { grid-template-columns: 1fr; } .pg-panel { position: static; } }

/* ============================================================
   사이드바 셸 — ADMIN_PAGE_RULE §2.8 (키트 사이트가 규격을 직접 쓴다)
   ============================================================ */
:root { --sb-w: 232px; --sb-bg: #0f172a; --sb-fg: #cbd5e1; --sb-accent: #38bdf8; }

/* ⚠️ 셸은 **자체 스크롤만** 쓴다. min-height 로 두면 body 기본 여백(8px)이나 자식의
   100vh 가 더해져 뷰포트를 넘고, 바깥에 스크롤바가 생긴다 — 안쪽 스크롤과 두 겹이 된다.
   높이를 못박고 overflow 를 잠근다(임베드 모드는 body.is-embed 라 해당 없음). */
body:not(.is-embed) { margin: 0; overflow: hidden; }
.sb-shell { display: flex; height: 100vh; overflow: hidden; }

/* ⑥ 셸을 뷰포트 높이로 고정하고 nav 만 스크롤 — 로고·푸터는 항상 보인다 */
.sb {
    width: var(--sb-w); flex: 0 0 var(--sb-w);
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; min-height: 0;
    background: var(--sb-bg); color: var(--sb-fg);
    transition: margin-left .18s ease;
}
.sb-shell.is-collapsed .sb { margin-left: calc(var(--sb-w) * -1); }

.sb-logo {
    flex: 0 0 auto; display: block; padding: 18px 16px 14px;
    font-size: 16px; letter-spacing: .02em; color: #64748b; text-decoration: none;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.sb-logo b { color: #fff; font-weight: 800; }

/* ⑦ 컨트롤 바 — nav 스크롤 밖, 버튼 우측 정렬 */
.sb-ctl {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 2px;
    padding: 6px 8px; border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.sb-ctl-sep { width: 1px; height: 14px; background: rgba(148, 163, 184, .3); margin: 0 4px; }
.sb-ctl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: 0; border-radius: 6px;
    background: transparent; color: #94a3b8; cursor: pointer;
}
.sb-ctl-btn:hover { background: rgba(148, 163, 184, .16); color: #fff; }
.sb-ctl-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* nav 만 스크롤. ⑦ 하단 여유 — 맨 아래 메뉴가 뷰포트 끝에 붙지 않게 */
.sb-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 0 48px; }

.sb-group { margin-bottom: 2px; }
/* 0뎁스 그룹 헤더 — 글씨 크기는 1뎁스와 같다(작은 대문자 라벨 X) */
.sb-g-head {
    display: flex; align-items: center; width: 100%;
    padding: 8px 14px; border: 0; background: transparent;
    color: #94a3b8; font: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: left;
}
.sb-g-head:hover { color: #fff; }
/* ⑦ 꺽쇠는 행 **우측 끝**. 라벨 왼쪽에 두면 리프와 라벨 시작선이 어긋난다 */
.sb-caret {
    margin-left: auto; width: 13px; height: 13px; flex: 0 0 13px;
    fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
    transform: rotate(90deg); transition: transform .15s ease;
}
.sb-group.is-closed .sb-caret { transform: rotate(0deg); }
.sb-group.is-closed .sb-g-body { display: none; }
/* 닫힌 그룹 안에 지금 화면이 있으면 머리 글씨를 활성 톤으로(0025 — 그룹은 기본 닫힘, 자동 펼침 안 함) */
.sb-group.is-closed.has-cur .sb-g-head { color: #fff; }

/* 1뎁스 = 리프 메뉴. 같은 뎁스는 좌측 패딩이 같아 라벨 시작선이 일치해야 한다 */
.sb-g-body a {
    display: block; padding: 7px 14px 7px 26px;
    color: var(--sb-fg); font-size: 13px; text-decoration: none;
    border-left: 3px solid transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* 넘칠 때만 말줄임 */
}
.sb-g-body a:hover { background: rgba(148, 163, 184, .12); color: #fff; }
/* ⑧ 활성 = 좌측 액센트 인셋 바 + 굵게 + 밝은 라벨 */
.sb-g-body a.is-active {
    background: rgba(56, 189, 248, .12); color: #fff; font-weight: 700;
    border-left-color: var(--sb-accent);
}

/* 즐겨찾기 모음(키트 cgrid-favmenu, v4.24.0) — 그룹 머리·리프와 같은 모양. 사이드바 마크업이 사이트 것이라 색은 여기서 맞춘다 */
.cg-fav { border-bottom-color: rgba(148, 163, 184, .18); }
.cg-fav > .cg-fav-head { padding: 8px 14px 4px; color: #94a3b8; font-size: 13px; font-weight: 700; opacity: 1; }
/* v4.25.0 — 머리 = 접기 단추. 그룹 머리(.sb-g-head)와 같은 호버·닫힌 채 지금 화면 = 활성 톤 */
.cg-fav > .cg-fav-head:hover, .cg-fav.is-closed.has-cur > .cg-fav-head { color: #fff; }
.cg-fav.is-closed > .cg-fav-head { padding-bottom: 8px; }
.cg-fav-link {
    display: block; padding: 7px 14px 7px 26px;
    color: var(--sb-fg); font-size: 13px; text-decoration: none;
    border-left: 3px solid transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cg-fav-link:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.cg-fav-link.cg-fav-cur { background: rgba(56, 189, 248, .12); color: #fff; font-weight: 700; border-left-color: var(--sb-accent); box-shadow: none; }

.sb-foot {
    flex: 0 0 auto; padding: 10px 16px; font-size: 11px; color: #64748b;
    border-top: 1px solid rgba(148, 163, 184, .18);
}

/* ⑤ 접기 핸들 — 사이드바 형제. 펼침=경계에 붙고 오른쪽 보더 없음 / 접힘=화면 왼쪽 끝 */
.sb-handle {
    position: fixed; top: 50%; left: var(--sb-w); transform: translate(-100%, -50%);
    z-index: 60; width: 24px; height: 56px; padding: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--sb-bg); color: #fff;
    border: 1px solid rgba(148, 163, 184, .28); border-right: 0;
    border-radius: 8px 0 0 8px;
    transition: left .18s ease;
}
.sb-shell.is-collapsed .sb-handle {
    left: 0; transform: translate(0, -50%);
    border: 1px solid var(--border, #d1d5db); border-left: 0;
    border-radius: 0 8px 8px 0; background: #fff; color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.sb-handle svg {
    width: 16px; height: 16px; fill: none; stroke: currentColor;
    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
/* 방향 전환은 글자 교체가 아니라 뒤집기 */
.sb-shell.is-collapsed .sb-handle svg { transform: scaleX(-1); }

.sb-main { flex: 1 1 auto; min-width: 0; max-width: 1400px; padding: 24px 28px 64px; }

/* 커스텀 툴팁 — 네이티브 title 금지(지연·스타일 제어 불가). 길이와 무관하게 항상 */
.sb-tip {
    position: fixed; z-index: 90; display: none; pointer-events: none;
    padding: 5px 9px; border-radius: 6px; white-space: nowrap;
    background: #0f172a; color: #fff; font-size: 12px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}
.sb-tip.is-on { display: block; }

/* 모바일 셸(아래 탭 줄 · 오른쪽 서랍 · 안전 영역)은 키트가 한다 — cgrid.css 모바일 셸 + cgrid-shell.js (v4.16.0, §2.19) */
@media (max-width: 768px) {
    .sb-main { padding: 16px; }
}

/* 선언 사전 (§1.7 — 레지스트리에서 생성) */
.ref-bar { display: flex; align-items: center; gap: 12px; }
.ref-q { flex: 1 1 auto; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.ref-q:focus { outline: none; border-color: #0f172a; box-shadow: 0 0 0 3px rgba(15, 23, 42, .1); }
.ref-count { flex: 0 0 auto; font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.ref-n { font-size: 12px; font-weight: 600; color: #64748b; }
.ref-files { white-space: nowrap; font-size: 11px; color: #94a3b8; }
.ref-internal { background: #f8fafc; }
.ref-internal h2 { color: #64748b; }

/* 옵션 실험실 — 레지스트리에서 생성 */
.pg-sec { margin-bottom: 14px; }
.pg-sec h3 { font-size: 13px; font-weight: 800; margin: 0 0 6px; color: #0f172a; }
.pg-sec h3 span { font-size: 11px; font-weight: 600; color: #94a3b8; }
.pg-sec-off { opacity: .75; }
.pg-hint { font-size: 12px; color: #64748b; margin: 0; }
.pg-opt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; font-size: 12px; }
.pg-chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.pg-opt code { font-size: 11px; color: #0f172a; }
.pg-opt input[type="text"], .pg-opt select { font-size: 11px; padding: 2px 6px; border: 1px solid #cbd5e1; border-radius: 5px; max-width: 190px; }
.pg-opt-na { opacity: .5; }
.pg-na, .pg-note { font-size: 11px; color: #94a3b8; }
.pg-scope { font-size: 10px; font-weight: 700; color: #0369a1; background: #e0f2fe; padding: 1px 6px; border-radius: 999px; }

/* 임베드(탭 안) 모드 — 크롬 없이 본문만 */
body.is-embed { background: #fff; }
.embed-main { max-width: 1400px; padding: 20px 24px 56px; }

/* 소개 페이지 '도움말 글 항목형' 살아 있는 예시(v4.19.0) — 사이트 안내 상자 모양(키트는 상자 안쪽만 그린다) */
.site-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; margin: 8px 0; border: 1px solid #dbe4f3; border-radius: 10px; background: #f6f9fe; font-size: 13px; color: #475569; }
/* 날짜·시간 선택기 데모(/demo/picker, v4.22.0) */
.pk-note { font-weight: 400; color: #94a3b8; }
.pk-acts { margin-top: 14px; flex-wrap: wrap; }
.pk-late:not(:empty) { margin-top: 12px; }
.pk-out { margin-top: 12px; min-height: 3.2em; white-space: pre-wrap; }
/* 모달 폼 데모(/demo/form, v4.23.0) — 미리보기 사진 크기만(사이트 전용) */
.ux-photo { width: 160px; height: 107px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }

/* /demo/fav-menu 모형 사이드바(사이트 전용 — 실제 사이드바와 같은 톤) */
.fm-demo { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.fm-sb { width: 232px; flex: 0 0 232px; background: var(--sb-bg); color: var(--sb-fg); border-radius: 10px; overflow: hidden; }
.fm-logo { padding: 14px 16px; color: #94a3b8; font-size: 13px; border-bottom: 1px solid rgba(148, 163, 184, .18); }
.fm-logo b { color: #fff; }
.fm-ctl { padding: 6px 12px; font-size: 11px; color: #64748b; text-align: right; border-bottom: 1px solid rgba(148, 163, 184, .12); }
.fm-nav { padding: 8px 0 16px; }
.fm-head { display: block; width: 100%; text-align: left; padding: 8px 14px; color: #94a3b8; font: inherit; font-size: 13px; font-weight: 700; background: transparent; border: 0; cursor: pointer; }
.fm-group .fm-body { display: none; }
.fm-group.is-open .fm-body { display: block; }
.fm-link { display: block; padding: 7px 14px 7px 26px; color: var(--sb-fg); font-size: 13px; text-decoration: none; border-left: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-link.fm-top { padding-left: 14px; font-weight: 700; }
.fm-link:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.fm-link.is-active, .fm-link.cg-fav-cur { background: rgba(56, 189, 248, .12); color: #fff; font-weight: 700; border-left-color: var(--sb-accent); box-shadow: none; }
.fm-link small { color: #64748b; font-weight: 400; }
.fm-sb .cg-fav > .cg-fav-head { padding: 8px 14px 4px; color: #94a3b8; font-size: 13px; opacity: 1; }
.fm-sb .cg-fav > .cg-fav-head:hover, .fm-sb .cg-fav.is-closed.has-cur > .cg-fav-head { color: #fff; }
.fm-sb .cg-fav.is-closed > .cg-fav-head { padding-bottom: 8px; }
.fm-sb .cg-fav-link { padding-left: 26px; font-weight: 400; }
.fm-sb .cg-fav-link.cg-fav-cur { font-weight: 700; }
.fm-side { flex: 1 1 320px; min-width: 0; }
.fm-acts { flex-wrap: wrap; margin-bottom: 10px; }
.fm-chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* 로딩 스켈레톤 데모(/demo/loading, v4.25.0) — 사이트 전용 모양 */
.ld-ctl { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ld-ctl-item { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.ld-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; min-height: 96px; }
.ld-card { border: 1px solid #e6eaf0; border-radius: 10px; padding: 16px; min-height: 96px; box-sizing: border-box; background: #fff; }
.ld-card-l { font-size: 12px; color: #64748b; font-weight: 600; }
.ld-card-v { font-size: 22px; font-weight: 800; color: #0f172a; margin: 6px 0 4px; }
.ld-card-s { font-size: 12px; color: #94a3b8; }
.ld-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ld-chart { min-height: 220px; display: flex; flex-direction: column; }
.ld-bars { display: flex; gap: 18px; align-items: flex-end; height: 220px; padding: 8px 4px 0; }
.ld-bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.ld-bar-fill { display: block; width: 70%; background: #38bdf8; border-radius: 6px 6px 0 0; min-height: 4px; }
.ld-bar-v { font-size: 12px; font-weight: 700; color: #0f172a; order: -1; }
.ld-bar-l { font-size: 12px; color: #64748b; }
.ld-frag { min-height: 160px; }
.ld-feed { margin: 0; padding: 0; list-style: none; }
.ld-feed li { padding: 8px 0; border-bottom: 1px solid #eef1f5; font-size: 13px; }
.ld-due { color: #94a3b8; font-size: 12px; margin-left: 4px; }
.ld-opts { margin-top: 10px; border: 1px solid #e6eaf0; border-radius: 8px; max-height: 220px; overflow: auto; min-height: 150px; background: #fff; }
.ld-opt { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.fm-ctl-btn { margin-left: 6px; border: 1px solid rgba(148, 163, 184, .35); background: transparent; color: #cbd5e1; font-size: 11px; border-radius: 4px; padding: 2px 6px; cursor: pointer; }
.fm-ctl-btn:hover { color: #fff; border-color: #fff; }
