/* 메뉴 위젯 모양 — 메뉴 서체(@font-face).
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* 폰트 CSS(구글 폰트 + Galmuri 번들)는 예전에 여기 @import 두 줄로 받았다.
   @import 는 이 파일을 다 내려받아 파싱해야 발견돼 로딩이 3홉으로 직렬화되므로
   index.php 가 link 태그로 먼저 내보내도록 옮겼다(preconnect 도 같이).
   Galmuri 는 7/9/11/14 를 npm 번들 하나로 통일한 것이라, 사이트의 다른 스킨
   (character_display·myroom·playlist)이 쓰는 같은 URL 과 합쳐져 한 번만 내려받는다. */
@font-face {
  font-family: 'HakgyoansimDunggeunmisoTTF-R';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimDunggeunmisoTTF-R.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'HakgyoansimDunggeunmisoTTF-B';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimDunggeunmisoTTF-B.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'KCCImkwontaek';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2202@1.0/KCCImkwontaek.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Handletter';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/naverfont_05@1.0/Handletter.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'BookkMyungjo-Bd';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/BookkMyungjo-Bd.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'BookkMyungjo-Lt';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/BookkMyungjo-Lt.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Chosunilbo_myungjo';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/Chosunilbo_myungjo.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'ChosunKm';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunKm.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'ChosunSm';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.1/ChosunSm.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
/* [CUSTOM(takemd)] 2026-09-30 Freesentation 세 벌은 코어 css/vendor/korean-fonts 의 축소본을 먼저, 그 파일이 없는 코어면 CDN 원본으로.
   같은 가족을 게시판 스킨(bbs_katalk)·메인(main_adv)·재생목록도 정의하는데 문서에서 뒤에 걸린 정의가 이긴다 —
   이 CSS 가 본문 끝쪽이라 여기가 CDN 원본이면 다른 곳을 다 축소본으로 바꿔도 원본 246KB 를 받았다(헤드리스 Chrome 실측). 주소를 다 같게 */
@font-face {
	font-family: 'Freesentation9';
	src: url('/css/vendor/korean-fonts/Freesentation-9Black-kr.woff2?v=20261001') format('woff2'),
		url('https://fastly.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-9Black.woff2') format('woff2');
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Freesentation5';
	src: url('/css/vendor/korean-fonts/Freesentation-5Medium-kr.woff2?v=20261001') format('woff2'),
		url('https://cdn.jsdelivr.net/gh/fontbee/font@main/Freesentation/Freesentation-5Medium.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Freesentation3';
	src: url('/css/vendor/korean-fonts/Freesentation-3Light-kr.woff2?v=20261001') format('woff2'),
		url('https://cdn.jsdelivr.net/gh/fontbee/font@main/Freesentation/Freesentation-3Light.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}
@font-face {
  font-family: 'GumiRomanceTTF';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2410-1@1.0/GumiRomanceTTF.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'TTLaundryGothicB';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2403-2@1.0/TTLaundryGothicB.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'RiaSans-ExtraBold';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2410-1@1.0/RiaSans-ExtraBold.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'MarinesBold';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2502-1@1.0/MarinesBold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
    font-family: 'KCCHyerim-Regular';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2411-3@1.0/KCCHyerim-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
	font-family: 'GmarketSansBold';
	src: url('../fonts/GmarketSansBold.subset.woff2') format('woff2'),
	     url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
	font-display: swap;
	font-weight: normal;
	font-style: normal;
}
@font-face {
	font-family: 'GmarketSansMedium';
	/* [CUSTOM(takemd)] 로컬 서브셋(한글 전체+ASCII, 596→340KB). CDN woff 는 폴백. 주소는 css/ 기준 ../fonts/(2026-11-19 — css/ 로 옮기며 ./fonts/ 로 남아 404 뒤 CDN 으로 가던 것) */
	src: url('../fonts/GmarketSansMedium.subset.woff2') format('woff2'),
	     url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
	font-display: swap;
	font-weight: normal;
	font-style: normal;
}

#cm_wrapper {
  opacity: 0;
}

.custommenu-wrapper {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none;
  display: flex;
}

.custommenu-wrapper.cm-mobile-open {
  pointer-events: none;
}

.custommenu-wrapper.viewing {
  pointer-events: none;
}

.custommenu {
  position: relative;
  display: flex;
  z-index: 1001;
  transition-duration: var(--cm-ani);
  align-items: center;
  opacity: 0;
  pointer-events: none;
}

.custommenu-wrapper.viewing .custommenu {
  opacity: 1;
  pointer-events: auto;
}

#custommenu {
  --cm-menu-font: var(--cm-default-font);
  --cm-sub-font: var(--cm-default-font);
  --cm-menu-font-size: inherit;
  --cm-sub-font-size: inherit;
  --cm-menu-font-color: var(--cm-text-color);
  --cm-sub-font-color: var(--cm-text-color);
  --cm-menu-hover-color: var(--cm-point-text, var(--cm-point-color));
  --cm-sub-hover-color: var(--cm-point-text, var(--cm-point-color));
  --cm-menu-letter-spacing: 0;
  --cm-sub-letter-spacing: 0;
  --cm-menu-line-height: normal;
  --cm-sub-line-height: normal;
  --cm-divider-color: var(--cm-text-color-t);
  --cm-sub-bg-color: var(--cm-base-color);
  --cm-sub-border-radius: var(--cm-radius);
}

#custommenu .custommenu-main > .custommenu-name {
  font-family: var(--cm-menu-font);
  font-size: var(--cm-menu-font-size);
  color: var(--cm-menu-font-color);
  letter-spacing: var(--cm-menu-letter-spacing);
  line-height: var(--cm-menu-line-height);
}

#custommenu .custommenu-sub > .custommenu-name {
  font-family: var(--cm-sub-font);
  font-size: var(--cm-sub-font-size);
  color: var(--cm-sub-font-color);
  letter-spacing: var(--cm-sub-letter-spacing);
  line-height: var(--cm-sub-line-height);
}
/* ==== src/css/02-items.css ==== */
/* 메뉴 위젯 모양 — 항목 — 마우스 오버 색·구분선·단추 글자 크기·모바일 아이콘.
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* 마우스 오버 색은 설정 패널 항목이므로 트랜스폼 모드와 무관하게 적용한다.
   기본값이 var(--cm-point-color) 라 스킨이 칠하던 색과 같아서 결과는 그대로고,
   관리자가 값을 바꾸면 그때부터 실제로 반영된다.
   아래 translateY 연출은 트랜스폼 모드 고유 동작이라 옮기지 않는다. */
#custommenu .custommenu-main:hover {
  color: var(--cm-menu-hover-color);
}

#custommenu .custommenu-sub:hover {
  color: var(--cm-sub-hover-color);
}

#custommenu.cm-transform-enabled .custommenu-main:hover {
  transform: translateY(-3px);
}

#custommenu.cm-transform-enabled .custommenu-sub:hover {
  transform: translateY(-3px);
}

#custommenu .custommenu-item {
  transition: color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

#custommenu.cm-transform-enabled.cm-bg-shadow,
#custommenu.cm-bg-shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

#custommenu.cm-transform-enabled.cm-bg-blur,
#custommenu.cm-bg-blur {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#custommenu .custommenu-item.custommenu-sub {
  background: var(--cm-sub-bg-color);
  border-radius: var(--cm-sub-border-radius);
}

#custommenu.cm-sub-shadow .custommenu-item.custommenu-sub {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

#custommenu.cm-sub-blur .custommenu-item.custommenu-sub {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* '구분선 없음'은 트랜스폼 모드와 무관하게 지켜져야 한다.
   아래 cm-transform-enabled 규칙만 있던 시절엔 트랜스폼 모드가 꺼진 기본 설치에서
   이 선택이 아무 데도 안 걸렸는데, 예전엔 모바일에서 구분선을 통째로 display:none
   하고 있어서 티가 안 났을 뿐이다. 이제 모바일에서도 구분선을 보여주므로
   끄기를 선택한 관리자에게 구분선이 되살아나는 문제가 생긴다. */
#custommenu[data-divider-style="none"] .custommenu-divider {
  display: none;
}

#custommenu[data-divider-style="none"] .custommenu-divider {
  display: none;
}

#custommenu[data-divider-style="line"] .custommenu-divider {
  border-color: var(--cm-divider-color);
}

#custommenu.cm-transform-enabled[data-divider-style="dot"] .custommenu-divider {
  width: 4px;
  height: 4px;
  border: 0;
  background: var(--cm-divider-color);
  border-radius: 50%;
}

#custommenu.cm-transform-enabled[data-divider-style="space"] .custommenu-divider {
  border: 0;
  background: transparent;
  width: 16px;
  height: 16px;
}

#custommenu.cm-transform-enabled[data-sub-default-state="expanded"] .custommenu-item.custommenu-sub {
  display: flex !important;
}

.custommenu-wrapper.cm-icon-direction-column:not(.cm-iconic) .custommenu-item {
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.custommenu-wrapper.cm-icon-direction-column:not(.cm-iconic) .custommenu-name {
  width: auto;
  text-align: center;
  padding: 6px 0 0;
}

.custommenu-wrapper.cm-hide-text-menu .custommenu-main > .custommenu-name,
.custommenu-wrapper.cm-hide-text-submenu .custommenu-sub > .custommenu-name,
.custommenu-wrapper.cm-hide-text-all .custommenu-name,
.custommenu-wrapper.cm-hide-text-buttons .custommenu-item[data-cm-btn="1"] .custommenu-name {
  display: none;
}

/* btn_font_size는 transform 모드 전용 옵션 — 비-transform 모드에서는 .custommenu 룰의 font-size가
   상속되도록 풀어둠 (전엔 무조건 14px이 박혀서 login/logout/admin 버튼 글자만 14px로 고정됨) */
#custommenu.cm-transform-enabled .custommenu-item[data-cm-btn="1"] .custommenu-name {
  font-size: var(--cm-btn-font-size);
}

.custommenu-logo-item .custommenu-name {
  display: none;
}

.custommenu-logo-item .custommenu-logo-image {
  display: block;
  width: var(--cm-logo-width);
  height: var(--cm-logo-height);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.custommenu-drag-handle,
.custommenu-resize-handle {
  display: none;
}

.custommenu.admin-draggable .custommenu-drag-handle {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  background: var(--cm-point-color);
  color: var(--cm-point-color-auto);
  cursor: move;
  z-index: 1002;
  user-select: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.custommenu.admin-draggable:hover .custommenu-drag-handle,
.custommenu.admin-draggable.is-editing .custommenu-drag-handle {
  opacity: 1;
}

.custommenu.admin-draggable .custommenu-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--cm-point-color);
  cursor: se-resize;
  z-index: 1002;
  opacity: 0;
  transition: opacity 0.2s;
  display: block;
}

.custommenu.admin-draggable .custommenu-resize-handle::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--cm-point-color-auto);
  border-bottom: 1px solid var(--cm-point-color-auto);
}

.custommenu.admin-draggable:hover .custommenu-resize-handle,
.custommenu.admin-draggable.is-editing .custommenu-resize-handle {
  opacity: 0.9;
}

.custommenu-folder-wrapper {
  display: contents;
}

.custommenu-item {
  display: flex;
  justify-content: space-between;
  color: var(--cm-text-color);
  align-items: center;
  transition-duration: var(--cm-ani);
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
}

.custommenu-item:hover {
  color: var(--cm-point-text, var(--cm-point-color));
}
.custommenu-main .custommenu-name * {
  font-family: var(--cm-title-font);
}
.custommenu-name {
  font-family: var(--cm-default-font);
}

.custommenu-name-one {
  display: contents;
}
.custommenu-name-two {
  display: none;
}

.custommenu-item.disabled {
  pointer-events: none;
}
.custommenu-item.disabled .custommenu-icon,
.custommenu-item.disabled .custommenu-name {
  opacity: 0.5;
}

.custommenu-icon {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  display: inline-flex;
  flex-shrink: 0;
}

.custommenu-wrapper.cm-show-image .custommenu-icon:not(#cm-no-such-element) { width: var(--cm-img-width); height: var(--cm-img-height); }

.custommenu-icon i,
.custommenu-icon .material-icons {
  text-align: center;
}

.custommenu-img {
  width: 100%;
  height: 100%;
}
.custommenu-icon .custommenu-img-default {
  width: 100%;
  height: 100%;
}
.custommenu-item:hover .custommenu-img-default {
  display: none;
}
.custommenu-icon .custommenu-img-active {
  display: none;
  width: 100%;
  height: 100%;
}
.custommenu-item:hover .custommenu-img-active {
  display: block;
}
/* 모바일 아이콘(2026-11-12) — 평소엔 숨기고, 폰 서랍(아래 max-width:1000px 구간)에서만 이것으로 바꿔 보인다 */
.custommenu-icon .custommenu-img-mobile {
  display: none;
  width: 100%;
  height: 100%;
}
.custommenu-name {
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  line-height: normal;
  flex: 1;
  padding: 0px 10px;
}

.custommenu-folder::before {
  font-family: 'Font Awesome 5 Free'; 
  content: '\f13a';
  font-weight: 900;
  font-size: 12px;
  position: absolute;
  right: 0;
}

.custommenu-folder.open::before,
.custommenu-folder.active::before {
  content: '\f139'; 
}

.custommenu-item.custommenu-sub {
  display: none;
}
.custommenu-item.custommenu-sub.open {
  display: flex;
}
/* ==== src/css/03-states.css ==== */
/* 메뉴 위젯 모양 — 숨김·모바일 공통·접근성·동작 줄이기.
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* 숨김 */
.custommenu-wrapper.custommenu-hide .custommenu {
  opacity: 0;
  pointer-events: none;
}
.custommenu-wrapper.custommenu-hide .custommenu-popup-wrapper {
  opacity: 0;
  pointer-events: none;
}

.custommenu-hide .custommenu.custommenu-subwindow {
  opacity: 0;
  pointer-events: none;
}

.custommenu-hide .custommenu.view {
  opacity: 1;
  pointer-events: auto;
}

.custommenu-hide .custommenu.custommenu-subwindow.view {
  opacity: 1;
  pointer-events: auto;
}

/* 키보드로 들어오면 보인다 — 숨김 모드에서 투명한 항목에 Tab 초점이 들어가 어디 있는지 안 보였다(2026-11-20 접근성 점검).
   .view(눌러서 꺼냄)와 같은 모습이고, 위 숨김 규칙과 명시도가 같아 이 순서로 이긴다 */
.custommenu-hide .custommenu:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.custommenu-hide-btn {
  position: fixed;
  width: 30px;
  height: 70px;
  right: 20px;
  bottom: -20px;
  border-radius: 20px 20px 0px 0px;
  background: var(--cm-point-color);
  color: var(--cm-point-color-auto);
  opacity: 0;
  pointer-events: none;
  transition-duration: 0.3s;
  transition-property: opacity, bottom;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.custommenu-hide-btn:hover {
  opacity: 1;
  bottom: 0px;
}

.custommenu-hide .custommenu-hide-btn {
  pointer-events: auto;
  cursor: grab;
}
.custommenu-hide-btn:active {
  cursor: grabbing;
  opacity: 1;
  bottom: 0px;
}
.custommenu-item-sub {
  font-size: 0.9em;
}
/* 모바일 */

.custommenu-compact-btn {
  width: 30px;
  height: 30px;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 12px;
  color: var(--cm-point-color-auto);
  background: var(--cm-point-color);
  opacity: 0;
  pointer-events:none;
  cursor: pointer;
  z-index: 9999;
}

.custommenu-mobile-overlay {
  display: none;
}

/* ── 접근성 ─────────────────────────────────────────────────────────────────
   포커스 표시. 이 위젯에는 :focus 규칙이 아예 없어서 키보드로 이동해도 지금 어디에
   있는지 알 수가 없었고, 레일의 overflow:hidden 이 브라우저 기본 링크를 잘라먹기까지 했다.
   :focus-visible 이라 마우스 클릭에는 안 뜨고 키보드 이동에만 뜬다.
   outline-offset 을 음수로 줘서 잘리는 스킨에서도 테두리가 안쪽에 그려지게 한다. */
.custommenu-wrapper :focus-visible,
.custommenu-compact-btn:focus-visible {
  outline: 2px solid var(--cm-point-color, #4c8dff);
  outline-offset: -2px;
  border-radius: 2px;
}
/* 포인트색이 배경과 비슷해도 보이도록 바깥에 대비되는 그림자를 한 겹 더 둔다. */
.custommenu-wrapper .custommenu-item:focus-visible,
.custommenu-compact-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--cm-base-color, #000), 0 0 0 4px var(--cm-point-color, #4c8dff);
}
/* 키보드 조작 대상이라는 걸 커서로도 알리기 */
.custommenu-wrapper [role="button"] {
  cursor: pointer;
}
/* 권한 부족으로 잠긴 항목 */
.custommenu-wrapper [aria-disabled="true"] {
  cursor: default;
}

/* 모션 최소화 설정을 켠 사용자에게는 전환·애니메이션을 끈다.
   메뉴 애니메이션 속도(--cm-ani)는 관리자가 최대 몇 초까지 올릴 수 있어서
   전정기관이 예민한 사용자에겐 특히 문제가 된다. */
@media (prefers-reduced-motion: reduce) {
  .custommenu-wrapper,
  .custommenu-wrapper *,
  .custommenu-compact-btn {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
/* ==== src/css/04-breakpoint.css ==== */
/* 메뉴 위젯 모양 — 반응형 분기점(cm-breakpoint — PHP·JS 가 여기서 읽는다)·PC 햄버거·폰 서랍.
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* ┌──────────────────────────────────────────────────────────────────────────┐
   │ 반응형 분기점 — 이 조각(합치면 css/custommenu.css)이 단일 출처다.             │
   │                                                                          │
   │ 미디어쿼리는 CSS 변수를 못 읽어서 숫자가 리터럴로 들어갈 수밖에 없다.      │
   │ 그래서 숫자를 여기 두고 나머지가 전부 여기서 파생되게 했다:               │
   │   · JS  — 숫자를 안 들고, 아래 미디어쿼리가 켜주는 --cm-mobile 을 읽는다  │
   │           (cmIsMobileViewport). 미디어쿼리 자체의 판정이라 어긋날 수 없다.│
   │   · PHP — 이 파일을 읽어 아래 max-width 값을 그대로 쓴다                  │
   │           (lib/util.php: custommenu_mobile_max_width).                   │
   │                                                                          │
   │ 데스크톱 쪽은 min-width 대신 `not all and (max-width: …)` 로 쓴다.        │
   │ +1 짝꿍 숫자를 따로 관리하지 않아도 되는 정확한 여집합이라, 파일 안에     │
   │ 같은 숫자 하나만 반복된다.                                               │
   │                                                                          │
   │ 바꿀 때: 이 파일에서 아래 세 줄의 숫자를 같이 바꾸면 끝.                  │
   │ PHP 가 읽어가는 줄은 cm-breakpoint 주석이 붙은 줄 하나다 — 그 표식을      │
   │ 지우거나 옮기면 PHP 는 폴백값(1000)으로 조용히 떨어진다.                  │
   └──────────────────────────────────────────────────────────────────────────┘ */
:root {
  --cm-mobile: 0;
  /* 레일이 뷰포트 위아래로 남길 여백. max-height 계산에 쓴다. */
  --cm-rail-viewport-inset: 16px;
}
/* cm-breakpoint */
@media all and (max-width: 1000px) { :root { --cm-mobile: 1; } }

/* PC 화면에서는 메뉴 숨김 상태일 때만 햄버거 토글 보임.
   메뉴가 보이는 상태에선 햄버거 불필요 → 숨김. */
@media not all and (max-width: 1000px) {
  #toolbar-custommenu-toggle,
  .custommenu-compact-btn {
    display: none;
  }

  /* 좌/우 스티치에서 100% 폭으로 저장된 경우 과도하게 넓어지는 현상 방지.
     데스크톱 레일 전용 — 셀렉터가 ID+속성 2개(1,2,0)라 모바일 드로어의 180px 를
     명시도로 이겨버린다. 안 묶으면 폰에서 드로어가 92vw 까지 벌어져서, 바깥을 눌러
     닫을 여백이 8vw(320px 화면에서 26px)밖에 안 남는다. */
  #custommenu[data-stich="left"][data-width="100%"],
  #custommenu[data-stich="right"][data-width="100%"] {
    width: min(360px, 92vw);
    max-width: min(360px, 92vw);
  }
  /* 숨김 상태는 custommenu.js 가 <html data-cm-hide> 로 비춰 준다 — body:has(.custommenu-wrapper.custommenu-hide)
     로 직접 보면 body 가 :has() 기준이 되어, 문서 어디서든 글자·클래스·인라인 style 이 바뀔 때마다
     크롬이 body 아래 전체 스타일을 다시 계산했다(TRPG 방 2,600개 요소에서 한 번에 60ms 대).
     :root[…] body 로 쓴 건 옛 셀렉터와 명시도(1,2,1)·(0,3,1)를 똑같이 맞추려는 것. */
  :root[data-cm-hide] body #toolbar-custommenu-toggle,
  :root[data-cm-hide] body .custommenu-compact-btn {
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
  }

  /* 세로 레일이 화면보다 길어지는 경우(짧은 창, 노트북 가로, 항목이 많은 메뉴) 대응.
     wrapper 가 align-items:center 로 레일을 세로 가운데 두는데, 레일이 뷰포트보다
     길면 위아래로 동시에 삐져나가고 스킨의 overflow:hidden 때문에 스크롤도 막혀서
     첫 항목과 마지막 항목에 아예 닿을 수 없었다.
     명시도를 (0,3,0)으로 올려 스킨 규칙을 이긴다 — 미디어쿼리는 명시도를 안 올려주고
     스킨은 `.cm-<skin> .custommenu`(0,2,0)로 잡기 때문.

     [data-menu-direction="column"] 한정인 이유: 가로 메뉴는 넘치는 축이 세로가 아니라
     가로다. 거기에 이 블록을 걸면 max-height 는 아무 일도 안 하면서 스크롤 컨테이너만
     만들어져, 폭을 넘긴 항목이 잘린 채 가로 스크롤도 안 되어 닿을 수 없게 된다.
     .admin-draggable 제외 이유는 바로 아래 규칙 참고. */
  .custommenu-wrapper .custommenu[data-menu-direction="column"]:not(.custommenu-subwindow):not(.admin-draggable) {
    max-height: calc(100vh - var(--cm-rail-viewport-inset) * 2);
    max-height: calc(100dvh - var(--cm-rail-viewport-inset) * 2);
    /* 가로는 그대로 잘라낸다 — iconic 처럼 hover 시 라벨이 밀려나오는 스킨이
       세로 스크롤 때문에 가로로 새는 걸 막는다. */
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    /* 다 들어가면 가운데, 넘치면 위쪽 정렬.
       폴백을 center 가 아니라 flex-start 로 둔다: safe 를 모르는 구형에서 center 로
       떨어지면 넘친 만큼이 시작점 바깥으로 밀려 스크롤로도 닿지 못한다 — 이 블록이
       고치려던 바로 그 증상이다. 위쪽 정렬은 모양만 달라지고 항목은 다 닿는다. */
    justify-content: flex-start;
    justify-content: safe center;
    /* 좁은 아이콘 레일(30~40px)에 스크롤바가 뜨면 아이콘을 가려서 숨긴다.
       휠·트랙패드·터치·키보드 스크롤은 그대로 동작. */
    scrollbar-width: none;
  }
  .custommenu-wrapper .custommenu[data-menu-direction="column"]:not(.custommenu-subwindow):not(.admin-draggable)::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  /* 관리자 드래그/크기조절 중에는 레일을 스크롤 컨테이너로 만들지 않는다.
     드래그 손잡이(top/left:-8px)와 크기조절 손잡이(right/bottom:-7px)는 메뉴 박스
     바깥으로 튀어나온 자식이라, 스크롤 컨테이너가 되는 순간 잘려 나가고 스크롤에
     딸려 움직여서 잡을 수가 없다. 편집 중에는 세로 클램프가 없어도 문제되지 않는다. */
  .custommenu-wrapper .custommenu.admin-draggable {
    overflow: visible;
    max-height: none;
  }
}


@media all and (max-width: 1000px) {
  /* 모바일 아이콘이 있는 항목은 서랍에서 그것만 — 기본·오버 아이콘은 숨긴다(오버 규칙 .custommenu-item:hover … 와 같은 특이도, 뒤라 이긴다) */
  .custommenu-icon.has-mobile-icon > :not(.custommenu-img-mobile) { display: none; }
  .custommenu-icon.has-mobile-icon > .custommenu-img-mobile { display: block; }
  /* 햄버거: 44x44 (touch target 최소 권장) + 좌상단 safe-area 인셋 (노치 폰) */
  .custommenu-compact-btn {
    opacity: 1;
    pointer-events: auto;
    width: 44px;
    height: 44px;
    font-size: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: calc(16px + env(safe-area-inset-left, 0px));
  }
  /* 메뉴 열려있는 동안 햄버거 숨김 (페이드아웃). 열림 상태도 <html data-cm-mobile-open> 로 본다(위 숨김과 같은 이유). */
  :root[data-cm-mobile-open] body .custommenu-compact-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
  }
  .custommenu-wrapper {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }
  /* 오버레이: cm-mobile-open일 때 화면 전체 덮어 메뉴 바깥 클릭 시 닫기 + 페이드 인 */
  .custommenu-mobile-overlay {
    opacity: 0;
    transition: opacity .2s ease;
  }
  .custommenu-wrapper.cm-mobile-open .custommenu-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    pointer-events: auto;
    cursor: pointer;
    opacity: 1;
  }
  /* 셀렉터에 .custommenu-wrapper 를 붙여 명시도를 (0,2,0)으로 올린다. 스킨 CSS가
     `.cm-iconic .custommenu` 같은 2클래스 셀렉터로 width/overflow 를 잡는데,
     미디어쿼리는 명시도를 더해주지 않아서 그냥 `.custommenu`(0,1,0)로는 스킨한테 진다.
     동점이면 나중에 로드되는 쪽이 이기고 css/*.css 가 custommenu.css.php 뒤에
     실리므로(index.php의 link 순서), 명시도만 맞추면 !important 없이 이긴다.
     :not(.custommenu-subwindow) — 서브창도 .custommenu 클래스를 달고 있어서 제외. */
  .custommenu-wrapper .custommenu:not(.custommenu-subwindow) {
    width: 180px;
    min-width: 180px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh; /* iOS Safari URL bar 동적 높이 대응 */
    left: 0;
    transform: translateX(-105%);
    /* 닫힌 서랍은 visibility 로도 숨긴다 — 화면 밖으로 밀기만 하면 폰에서 Tab 초점이 안 보이는 항목들에 들어갔다(2026-11-20 접근성 점검).
       숨김은 미끄러져 나간 뒤(.25s 뒤)에 걸려서 닫히는 움직임은 그대로다. */
    visibility: hidden;
    transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear .25s;
    right: unset;
    top: unset;
    margin: auto 0;
    background: var(--cm-base-color);
    border: 0px;
    flex-direction: column;
    padding: env(safe-area-inset-top, 0px) 10px env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    /* 가로는 잘라내되 세로는 반드시 스크롤. 스킨의 `overflow: hidden` 이 이걸 덮으면
       화면이 짧을 때 항목이 잘린 채 스크롤도 안 돼서 아예 닿을 수 없게 된다. */
    overflow-x: hidden;
    overflow-y: auto;
    /* 넘칠 때 flex 가 줄어들 수 있게 — min-height:auto 면 스크롤이 안 생긴다. */
    min-height: 0;
    /* 항목이 다 들어가면 세로 가운데, 넘치면 위쪽 정렬.
       그냥 center 면 넘친 만큼이 시작점 바깥으로 밀려나 스크롤로도 닿지 못한다.
       safe 를 모르는 구형 브라우저는 앞줄 center 로 폴백. */
    justify-content: center;
    justify-content: safe center;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 1001;
  }
  .custommenu-wrapper .custommenu.active,
  .custommenu-wrapper.cm-mobile-open .custommenu {
    transform: translateX(0);
    visibility: visible;
    transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
  }
  .custommenu-folder-wrapper {
    width: 100%;
  }
  /* 모바일에서 메뉴 항목 터치 타겟 충분히 키움 (Apple HIG 44px 권장).
     스킨의 `.cm-<skin> .custommenu .custommenu-item`(0,3,0)와 명시도를 맞춘다. */
  .custommenu-wrapper .custommenu .custommenu-item {
    min-height: 44px;
    padding: 10px 12px;
    flex: 0 0 auto;
    flex-direction: row;
    height: auto;
    border: 0px;
    width: 100%;
    color: var(--cm-text-color);
    background: transparent;
    background-image: none;
    left: 0;
    position: relative;
  }

  .custommenu .custommenu-item .custommenu-name {
    display: flex;
    /* 서브텍스트가 이름 옆이 아니라 아래로 떨어지게 */
    flex-wrap: wrap;
    align-items: center;
    opacity: 1;
    font-size: 13px;
    background: transparent;
    background-image: none;
    -webkit-text-stroke: 0px;
  }
  /* 모바일: hide_text 옵션 무력화 (모든 텍스트 강제 표시) */
  .custommenu-wrapper.cm-hide-text-menu .custommenu-main > .custommenu-name,
  .custommenu-wrapper.cm-hide-text-submenu .custommenu-sub > .custommenu-name,
  .custommenu-wrapper.cm-hide-text-all .custommenu-name,
  .custommenu-wrapper.cm-hide-text-buttons .custommenu-item[data-cm-btn="1"] .custommenu-name {
    display: flex;
  }
  /* 모바일: 커스텀 메뉴 이미지 비표시 (FA/material 아이콘만 유지, 로고 img는 제외) */
  .custommenu .custommenu-item:not(.custommenu-logo-item) .custommenu-icon img:not(.custommenu-img-mobile) {   /* 모바일 아이콘 그림은 이 서랍에서 보이려고 넣은 것(2026-11-12) */
    display: none !important;
  }
  /* 아이콘/로고 크기는 관리자 자유 입력이라 상한이 없어서, 큰 값을 넣으면 드로어(180px)를
     그대로 넘어간다. max-* 는 width 쪽 !important 와 상관없이 우선하므로 여기서 가둔다.
     로고 img 는 이 컨테이너 기준 max-width:100% 라 같이 묶인다. */
  .custommenu-wrapper .custommenu-icon {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* 텍스트 전용 스킨은 아이콘을 안 쓰는 게 정체성이다. 그 display:none 규칙이
     스킨 CSS 안에 있어서 데스크톱 전용으로 묶이는 바람에 드로어에서 아이콘이
     되살아난다 — 여기서 다시 꺼준다. */
  .custommenu-wrapper.cm-text .custommenu-icon,
  .custommenu-wrapper.cm-textborder .custommenu-icon {
    display: none;
  }
  /* 태블릿·모바일에서도 구분선 유지. 드로어는 항상 세로 목록이라 가로선으로 눕힌다
     — 데스크톱이 가로 메뉴로 설정돼 있으면 css.php 가 세로선(border-right)으로 그리므로
     여기서 되돌려야 한다.
     align-self:stretch 는 필수. 메뉴 컨테이너가 align-items:center 라서 width:auto 인
     구분선은 폭이 0으로 줄어 안 보인다.
     dot/space 변형은 transform 모드에서 !important 로 크기를 잡으므로 그대로 살려둔다
     (여기 선언에 !important 를 안 붙이는 이유). */
  .custommenu-wrapper .custommenu-divider {
    display: block;
    flex: 0 0 auto;
    align-self: stretch;
    width: auto;
    height: 0;
    margin: 6px 12px;
    border-right: 0;
    border-bottom: var(--cm-divider-border-width, 1px) var(--cm-menu-border-style, solid) var(--cm-divider-color, var(--cm-text-color-t));
  }
  /* 마지막 항목 뒤에 남는 구분선은 드로어에서 허공에 줄만 긋는다.
     PC 레일에서는 아래쪽 버튼과의 경계로 쓰이므로 거기서는 그대로 둔다.
     (index.php 가 렌더할 때 표시해 둔다 — 뒤에 실제 항목이 없는 구분선) */
  .custommenu-wrapper .custommenu-divider.cm-divider-trailing {
    display: none;
  }

  .custommenu-subwindow {
    display: none !important
  }
  header ~ section#body {
    padding-left: 0px !important;
    padding-right: 0px !important;
    margin-left: 0px !important;
    margin-right: 0px !important;
  }

} 
/* ==== src/css/05-tooltip.css ==== */
/* 메뉴 위젯 모양 — 툴팁·서브텍스트.
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* 툴팁과 서브텍스트 */
.custommenu-item-tooltip.active {
  display: block;
}
.custommenu-item-tooltip {
  position: absolute;
  background: var(--cm-base-color);
  color: var(--cm-text-color);
  border: 1px solid var(--cm-text-color);
  border-radius: 5px;
  padding: 6px 10px;
  max-width: 200px;
  width: auto;
  white-space: nowrap;
  left: 50%;
  margin-left: 10px;
  z-index: 10;
  display: none;
  animation: tooltipAni 0.5s;
  font-family: var(--cm-default-font);
}

@keyframes tooltipAni {
  0%{
    opacity: 0;
    translate: 0px 20px;
  }
  100% {
    opacity: 1;
    translate: 0px 0px;
  }
}

.custommenu-item-tooltip::before {
  content: "";
  position: absolute;
  top: calc(100% - 2px);
  left: 3px;
  border-width: 0px 10px 10px 15px;
  border-style: solid;
  border-color: var(--cm-base-color) transparent transparent var(--cm-base-color);
}

.custommenu-item-tooltip::after {
  content: "";
  position: absolute;
  top: calc(100% - 0px);
  left: 2px;
  border-width: 0px 10px 10px 15px;
  border-style: solid;
  border-color: var(--cm-text-color) transparent transparent var(--cm-text-color);
  z-index: -1;
}

/* 세로 레일에선 툴팁을 항목 옆에 붙인다(위로 띄우면 윗 항목을 덮는다).
   꼬리는 아래가 아니라 옆을 향해야 하므로 다시 그린다. */
.custommenu-item-tooltip.cm-tip-side {
  margin-left: 0;
  animation: tooltipSideAni 0.35s;
}
.custommenu-item-tooltip.cm-tip-side::before,
.custommenu-item-tooltip.cm-tip-side::after {
  top: 50%;
  border-width: 7px;
  border-style: solid;
}
/* 오른쪽에 뜬 경우 — 꼬리는 왼쪽을 가리킨다 */
.custommenu-item-tooltip.cm-tip-side::before {
  left: -13px;
  margin-top: -7px;
  border-color: transparent var(--cm-text-color) transparent transparent;
}
.custommenu-item-tooltip.cm-tip-side::after {
  left: -12px;
  margin-top: -7px;
  border-color: transparent var(--cm-base-color) transparent transparent;
  z-index: 1;
}
/* 오른쪽 공간이 모자라 왼쪽으로 넘어간 경우 — 꼬리도 반대로 */
.custommenu-item-tooltip.cm-tip-side-flip::before {
  left: auto;
  right: -13px;
  border-color: transparent transparent transparent var(--cm-text-color);
}
.custommenu-item-tooltip.cm-tip-side-flip::after {
  left: auto;
  right: -12px;
  border-color: transparent transparent transparent var(--cm-base-color);
}

@keyframes tooltipSideAni {
  0%   { opacity: 0; translate: -6px 0; }
  100% { opacity: 1; translate: 0 0; }
}

/* 서브텍스트 — 메뉴 이름 아래 붙는 작은 설명 줄.
   .custommenu-name 안에 들어 있어서 텍스트 숨김 옵션(cm-hide-text-*)에 같이 딸려간다.
   name-one 이 display:contents 라 이름 텍스트는 부모에 그대로 흐르므로,
   여기서 block 을 주면 자연스럽게 이름 다음 줄로 떨어진다. */
.custommenu-name-sub {
  display: block;
  /* .custommenu-name 이 flex 로 깔리는 곳(모바일 드로어)에서도 제 줄을 차지하도록.
     block 문맥에서는 어차피 100% 라 영향이 없다. */
  flex: 0 0 100%;
  width: 100%;
  /* 메뉴 글자 크기를 따라가되 10px 밑으로는 안 내려가게 */
  font-size: 0.72em;
  font-size: max(10px, 0.72em);
  line-height: 1.35;
  opacity: 0.65;
  font-weight: normal;
  letter-spacing: 0;
  word-break: keep-all;
}
.custommenu-item:hover .custommenu-name-sub,
.custommenu-item:focus-visible .custommenu-name-sub {
  opacity: 0.9;
}

.custommenu-popup-wrapper {
  /* 툴팁이 담기는 층. z-index 가 auto 면 스태킹 컨텍스트를 안 만들어서 안쪽 툴팁(z:10)이
     .custommenu(z:1001) 와 같은 층에서 겨루다 레일 뒤로 깔린다 — 세로 레일에선 툴팁이
     항상 레일 옆에 뜨므로 사실상 계속 가려져 있었다. 레일·드래그 핸들(1002) 위로 올린다.
     pointer-events:none 이라 위로 올려도 클릭을 가로채지 않는다. */
  z-index: 1003;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 모바일 주소창이 접혔다 펴질 때 100vh 는 화면 아래로 넘친다 */
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
}

.custommenu-item-tooltip-text {
  display: block;
}
.upside_down.custommenu-item-tooltip{
  transform: rotateX(180deg);
}
.upside_down .custommenu-item-tooltip-text {
  transform: rotateX(-180deg);
}
/* ==== src/css/06-subwindow.css ==== */
/* 메뉴 위젯 모양 — 서브 창.
   custommenu.css 를 원래 순서대로 나눴다(2026-11-19). tools/build_joined.sh 가 src/css/ 조각을 이 순서로 css/custommenu.css 하나로 합치고 index.php·settings_modal.php 가 싣는다 — 순서가 곧 우선순위라 바꾸지 말 것 */
/* 서브 창 */
.custommenu-subwindow {
  display: none;
  position: absolute;
}

.custommenu-subwindow.active {
  display: flex;
  opacity: 1;
  pointer-events: visible;
}

.custommenu_header_d {
  display: none;
}
/* 조각 지문 sha1:1b358f148a0b9a438aca1ae5227b5858a12fa5e6 — tools/build_joined.sh 가 적는다. 이 파일은 직접 고치지 않는다 */
