
:root {
    	--cm-text-color: #C4C4C4;
	--cm-base-color: #666;
	--cm-point-color: #212529;

		--cm-base-color-bb: #c0c0c0;	
	--cm-base-color-b: #8e8e8e;
	--cm-base-color-d:  #484848;
	--cm-base-color-dd:  #000000;
	--cm-point-color-bb: #7b7f83;	
	--cm-point-color-b: #494d51;
	--cm-point-color-d:  #03070b;
	--cm-point-color-dd:  #000000;
	--cm-point-color-v:  #31373d;
	--cm-point-color-t:  rgba(33, 37, 41, 0.22);
  --cm-point-color-r: #222129;
  --cm-point-color-r-t: rgba(34, 33, 41, 0.22);
  --cm-base-color-t:  rgba(102, 102, 102, 0.22);
	--cm-text-color-t:  rgba(196, 196, 196, 0.22);
	--cm-base-color-auto: #ffffff;
	--cm-text-color-auto: #000000;
	--cm-point-color-auto: #ffffff;
	--cm-base-color-auto-t: #ffffff26;
	--cm-text-color-auto-t: #00000026;
	--cm-point-color-auto-t: #ffffff26;
  --cm-point-color-auto-tt: #ffffff60;

    --cm-default-font: var(--cm-e-font), var(--cm-j-font), 'Freesentation5';
  --cm-title-font: var(--cm-e-font), var(--cm-j-font), 'Freesentation5';

  --cm-j-font: 'Kosugi Maru';
  --cm-e-font:   'Raleway';
  --cm-ani: 0.6s;
  --cm-radius: ;
  --cm-padding: ;
  --cm-form-basecolor: #fbfbfb;
  --cm-form-basecolor-t: #fbfbfb75;
  --cm-form-textcolor: #1d1d1d;
}

header#header {
  left: 0;
  width: 0px;
  z-index: 99;
  pointer-events: none;
}
header ~ section#body {
  margin: 0;
}
.custommenu-wrapper {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}
#custommenu {
  left: 25px;
  font-size: 13px;
  --cmp-cell: 100px;
margin-bottom: 30px;}
.custommenu-compact-btn {
  left: 20px;
}

.cm-phone {
  --cmp-main: #212529;                  /* 메인: 스마트폰 몸체 · 앱 아이콘 · 글씨 */
  --cmp-sub: #C4C4C4;                    /* 서브: 폴더 · 독 · 테두리 */
  --cmp-light: #f8f9fa;                /* 화면 · 아이콘 그림 */
  --cmp-sub-t: rgba(196, 196, 196, 0.45);
  --cmp-sub-tt: rgba(196, 196, 196, 0.22);
  --cmp-bezel: var(--cmp-main);
  --cmp-cols: 2;
  --cmp-icon: 50px;
  --cmp-cell: 76px;
  --cmp-radius: 40px;

  /* 툴팁 등 공용 요소도 같은 색으로 */
  --cm-base-color: #f8f9fa;
  --cm-text-color: #212529;
  --cm-point-color: #212529;
  --cm-point-color-auto: #f8f9fa;
}

/* ───────── 스마트폰 본체 ───────── */
.cm-phone #custommenu {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: calc(var(--cmp-cols) * (var(--cmp-cell) + 8px) + 28px);
  min-height: 460px;
  max-height: calc(100vh - 30px);
  transition: min-height 0.45s cubic-bezier(.4, 0, .2, 1);
  padding: 0;
  border: 10px solid var(--cmp-bezel);
  border-radius: var(--cmp-radius);
  background:
    radial-gradient(120% 60% at 0% 0%, var(--cmp-sub-t), transparent 60%),
    radial-gradient(100% 50% at 100% 100%, var(--cmp-sub-tt), transparent 60%),
    var(--cmp-light);
  background-clip: padding-box;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 22px 44px -18px rgba(0, 0, 0, 0.5);
  color: var(--cmp-main);
  font-family: var(--cm-default-font);
  overflow: visible;
}

/* 상태바 */
.cm-phone .cmp-status {
  position: relative;
  flex: none;
  cursor: pointer;
  height: 42px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--cmp-main);
}
.cm-phone .cmp-island {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 40px;
  height: 14px;
  margin: 0 0 0 -20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--cmp-bezel);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: width 0.3s, margin 0.3s;
}
.cm-phone .cmp-island svg {
  width: 8px;
  height: 5px;
  fill: none;
  stroke: var(--cmp-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  transition: transform 0.4s;
}
.cm-phone .cmp-status:hover .cmp-island {
  width: 52px;
  margin-left: -26px;
}
.cm-phone #custommenu.cmp-folded .cmp-island svg {
  transform: rotate(180deg);
}

/* 접히는 화면 */
.cm-phone .cmp-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 92px);
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(.4, 0, .2, 1), opacity 0.3s;
}
.cm-phone #custommenu.cmp-folded {
  min-height: 0;
}
.cm-phone #custommenu.cmp-folded .cmp-screen {
  max-height: 0;
  opacity: 0;
}
.cm-phone .cmp-sys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cm-phone .cmp-sys svg {
  height: 9px;
  width: auto;
  fill: currentColor;
}
.cm-phone .cmp-battery {
  position: relative;
  width: 19px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 3px;
  box-sizing: border-box;
  padding: 1px;
}
.cm-phone .cmp-battery::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 1.5px;
  height: 3px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
}
.cm-phone .cmp-battery span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
}

/* 앱 아이콘 칸 */
.cm-phone .cmp-apps {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(var(--cmp-cols), var(--cmp-cell));
  justify-content: center;
  align-content: start;
  gap: 14px 8px;
  padding: 12px 4px 14px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cm-phone .cmp-apps::-webkit-scrollbar { display: none; }

/* 홈 표시줄 */
.cm-phone .cmp-home {
  flex: none;
  cursor: pointer;
  width: 92px;
  height: 4px;
  margin: 8px auto 8px;
  border-radius: 999px;
  background: var(--cmp-main);
  opacity: 0.55;
}

/* ───────── 앱 아이콘 ───────── */
.cm-phone .custommenu-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: var(--cmp-cell);
  padding: 2px 0;
  margin: 0;
  color: var(--cmp-main);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.cm-phone .custommenu-item:hover {
  color: var(--cmp-main);
  transform: translateY(-3px);
}
.cm-phone .custommenu-item.disabled {
  pointer-events: none;
  opacity: 0.45;
}
.cm-phone .custommenu-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--cmp-icon);
  height: var(--cmp-icon);
  border-radius: calc(var(--cmp-icon) * 0.28);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 55%),
    var(--cmp-main);
  color: var(--cmp-light);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: box-shadow 0.25s ease, opacity 0.25s ease;
}
.cm-phone .custommenu-item:hover .custommenu-icon {
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.cm-phone .custommenu-icon i,
.cm-phone .custommenu-icon .material-icons {
  font-size: calc(var(--cmp-icon) * 0.42);
  line-height: 1;
}
.cm-phone .custommenu-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 마우스 오버용 아이콘이 지정된 경우 */
.cm-phone .cmp-ico-hover { display: none; }
.cm-phone .custommenu-item:hover .cmp-ico-default { display: none; }
.cm-phone .custommenu-item:hover .cmp-ico-hover { display: contents; }
.cm-phone .cmp-ico-default { display: contents; }

.cm-phone .custommenu-name {
  display: block;
  width: 100%;
  padding: 0 2px;
  box-sizing: border-box;
  text-align: center;
  font-size: 0.86em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-phone .cmp-apps .custommenu-divider {
  grid-column: 1 / -1;
  justify-self: center;
  width: 70%;
  height: 0;
  border: 0;
  border-top: 1px solid var(--cmp-sub);
}

/* 폴더 아이콘: 안에 든 메뉴를 작게 미리보기 */
.cm-phone .cmp-folder-icon {
  background: var(--cmp-sub-t);
  box-shadow: inset 0 0 0 1px var(--cmp-sub), 0 4px 10px -4px rgba(0, 0, 0, 0.2);
}
.cm-phone .cmp-mini {
  position: absolute;
  inset: 16%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10%;
}
.cm-phone .cmp-mini-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28%;
  background: var(--cmp-main);
  color: var(--cmp-light);
  overflow: hidden;
}
.cm-phone .cmp-mini-cell i,
.cm-phone .cmp-mini-cell .material-icons {
  font-size: calc(var(--cmp-icon) * 0.15);
}
.cm-phone .cmp-mini-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cm-phone .cmp-folder.open .custommenu-icon {
  opacity: 0.45;
}

/* ───────── 아래 독: 메뉴 설정 · 로그인 · 관리자 등 ───────── */
.cm-phone .cmp-dock {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  margin: 0 10px;
  padding: 8px 4px 6px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--cmp-light) 55%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  box-shadow: inset 0 0 0 1px var(--cmp-sub);
}
.cm-phone .cmp-dock:empty { display: none; }
.cm-phone .cmp-dock .custommenu-item {
  width: 46px;
  gap: 3px;
  padding: 0;
}
.cm-phone .cmp-dock .custommenu-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--cmp-sub-t);
  color: var(--cmp-main);
  box-shadow: none;
}
.cm-phone .cmp-dock .custommenu-icon i {
  font-size: 13px;
}
.cm-phone .cmp-dock .custommenu-item:hover .custommenu-icon {
  background: var(--cmp-main);
  color: var(--cmp-light);
  box-shadow: none;
}
.cm-phone .cmp-dock .custommenu-name {
  font-size: 9.5px;
  letter-spacing: -0.02em;
  opacity: 0.85;
}

/* ───────── 폴더 창 ───────── */
.cm-phone .cmp-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.cm-phone .cmp-dim {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cmp-radius) - 10px);
  background: rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cm-phone .cmp-layer.cmp-active .cmp-dim {
  opacity: 1;
  pointer-events: auto;
}
.cm-phone .cmp-popup {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  padding: 10px 8px 12px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--cmp-light) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 0 0 1px var(--cmp-sub),
    0 14px 30px -12px rgba(0, 0, 0, 0.4);
  visibility: hidden;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(.3, 1.35, .5, 1), visibility 0s linear 0.32s;
  pointer-events: none;
}
.cm-phone .cmp-popup.cmp-open {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(.3, 1.35, .5, 1), visibility 0s;
  pointer-events: auto;
}
.cm-phone .cmp-popup.cmp-side-right { transform-origin: 0 var(--cmp-tail, 50%); }
.cm-phone .cmp-popup.cmp-side-left  { transform-origin: 100% var(--cmp-tail, 50%); }
.cm-phone .cmp-popup.cmp-side-below { transform-origin: var(--cmp-tail, 50%) 0; }

/* 말풍선 꼬리 (폴더 쪽을 가리킴) */
.cm-phone .cmp-popup::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: color-mix(in srgb, var(--cmp-light) 80%, transparent);
  box-shadow: inset 1px 1px 0 var(--cmp-sub);
  border-radius: 3px 0 0 0;
}
.cm-phone .cmp-popup.cmp-side-right::before { left: -7px;  top: calc(var(--cmp-tail, 50%) - 7px); transform: rotate(-45deg); }
.cm-phone .cmp-popup.cmp-side-left::before  { right: -7px; top: calc(var(--cmp-tail, 50%) - 7px); transform: rotate(135deg); }
.cm-phone .cmp-popup.cmp-side-below::before { top: -7px;   left: calc(var(--cmp-tail, 50%) - 7px); transform: rotate(45deg); }

.cm-phone .cmp-popup-title {
  margin: 0 4px 8px;
  text-align: center;
  font-family: var(--cm-title-font);
  font-size: 12px;
  color: var(--cmp-main);
  opacity: 0.85;
  white-space: nowrap;
}
.cm-phone .cmp-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, 68px);
  gap: 12px 4px;
  justify-items: center;
}
.cm-phone .cmp-popup.cmp-one-col .cmp-popup-grid {
  grid-template-columns: 68px;
}
.cm-phone .cmp-popup .custommenu-item {
  width: 68px;
}

/* ───────── 숨김 버튼 · 모바일 ───────── */
.cm-phone .custommenu-hide-btn {
  background: var(--cmp-main);
  color: var(--cmp-light);
}
.custommenu-compact-btn {
  background: #212529;
  color: #f8f9fa;
}
@media all and (max-width: 1000px) {
  .cm-phone #custommenu {
    position: fixed;
    top: 50%;
    left: 12px;
    right: auto;
    max-height: calc(100vh - 80px);
    transform: translate(-130%, -50%);
    transition: transform 0.4s cubic-bezier(.3, 1.1, .5, 1);
  }
  .cm-phone #custommenu.active {
    transform: translate(0, -50%);
  }
  /* 모바일에서는 접기 기능 없이 항상 펼침 */
  .cm-phone #custommenu.cmp-folded { min-height: 460px; }
  .cm-phone #custommenu.cmp-folded .cmp-screen { max-height: none; opacity: 1; }
  .cm-phone .cmp-island svg { display: none; }
  .cm-phone .cmp-status, .cm-phone .cmp-home, .cm-phone .cmp-island { cursor: default; }
}

/* 움직임 줄이기 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  .cm-phone .cmp-popup,
  .cm-phone .custommenu-item,
  .cm-phone #custommenu,
  .cm-phone .cmp-screen {
    transition: none !important;
  }
}
