/* === Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif;
  color: #1c1c1f;
  background: #fff;
}
.hidden { display: none !important; }
a { color: #1f6feb; text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  font-family: inherit;
  cursor: pointer;
}

/* === Auth pages (login, signup) === */
body.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 65%, rgba(0,0,0,0.04) 0%, rgba(255,255,255,0) 70%),
    #fafafa;
}
.auth-card {
  width: min(380px, 90vw);
  background: #fff;
  border: 1px solid #e3e3e8;
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.auth-card h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: #6c6c76; margin-bottom: 20px; }
.auth-card label {
  display: block; font-size: 12px; color: #5c5c66;
  font-weight: 600; margin-bottom: 6px; letter-spacing: 0.04em;
}
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d8d8de; border-radius: 8px;
  font-size: 14px; font-family: inherit; color: inherit;
  background: #fafafa; outline: none;
  transition: border-color 0.15s;
}
.auth-card input:focus { border-color: #1f6feb; background: #fff; }
.auth-row { margin-bottom: 14px; }
.auth-card button[type=submit] {
  width: 100%; padding: 11px 12px;
  background: #1c1c1f; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  transition: background 0.15s;
}
.auth-card button[type=submit]:hover { background: #303036; }
.auth-card button[type=submit]:disabled { background: #9c9ca6; cursor: wait; }
.auth-err {
  background: #fdecec; color: #8b1d1d;
  border: 1px solid #f0c7c7; border-radius: 8px;
  padding: 8px 12px; font-size: 12.5px;
  margin-bottom: 12px;
}
.auth-foot {
  margin-top: 16px; font-size: 12px; color: #6c6c76; text-align: center;
}

/* === Dashboard === */
body.dash-page { min-height: 100vh; }
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 13px 24px;
  background: #fff;
  border-bottom: 1px solid #ececf0;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 18px -12px rgba(0,0,0,0.12);
}
.dash-brand { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; }
.dash-nav { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.dash-nav span { color: #6c6c76; }
.dash-nav button {
  padding: 6px 12px; border: 1px solid #d8d8de; border-radius: 6px;
  background: #fff; font-size: 12.5px; color: #1c1c1f;
}
.dash-nav button:hover { background: #f5f5f8; }
.dash-main { max-width: 1100px; margin: 0 auto; padding: 32px 28px; }
.dash-main h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }
.contents-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.content-card {
  display: block;
  background: #fff;
  border: 1px solid #e3e3e8;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.15s;
}
.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  text-decoration: none;
}
.content-thumb {
  aspect-ratio: 9 / 16;
  background: #fff center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.thumb-fallback {
  font-size: 56px; font-weight: 800; color: #b8b8c0;
  letter-spacing: -0.04em;
}
.content-meta { padding: 12px 14px 14px; }
.content-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.1px;
  margin-bottom: 4px;
}
.content-desc {
  font-size: 12px; color: #6c6c76; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pill {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: #e6f1ff; color: #1f6feb;
  padding: 1px 6px; border-radius: 4px;
  vertical-align: 1px;
}
.dash-empty {
  grid-column: 1 / -1;
  padding: 40px 20px; text-align: center;
  background: #fff; border: 1px dashed #d8d8de; border-radius: 12px;
  color: #6c6c76; font-size: 13px; line-height: 1.6;
}
/* === 스토어프론트: 잠긴 캐릭터 카드 === */
.content-card.locked {
  cursor: pointer;
  border-style: dashed;
  border-color: #d8d8de;
  background: #fbfbfc;
}
.content-card.locked:focus-visible {
  outline: 2px solid #1f6feb; outline-offset: 2px;
}
.thumb-wrap { position: relative; }
/* 미구매 썸네일은 흐리게 — 무엇을 사는지는 보이되, 감상은 안 되게. */
.content-card.locked .content-thumb {
  filter: brightness(0.92) grayscale(0.55) blur(2px) !important;
  transform: scale(1.04);
}
.lock-veil {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(20,20,26,0.28));
}
.lock-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}
.content-card.locked .content-title { color: #4a4a55; }
.lock-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
}
.content-price {
  font-size: 13px; font-weight: 700; color: #1a1a1a;
  letter-spacing: -0.2px;
}
.content-price.soon {
  font-size: 11.5px; font-weight: 600; color: #8a8a94;
  letter-spacing: 0;
}
.btn-unlock {
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: #1a1a1a; border-radius: 6px;
  padding: 5px 10px; white-space: nowrap;
}
.content-card.locked:hover .btn-unlock { background: #1f6feb; }

/* === 잠금 해제 안내 시트 === */
body.sheet-open { overflow: hidden; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(20,20,26,0.42);
}
.sheet {
  position: relative;
  width: 100%; max-width: 340px;
  background: #fff; border-radius: 16px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,0.22);
}
.sheet-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #a0a0aa;
  padding: 4px 8px;
}
.sheet-close:hover { color: #1a1a1a; }
.sheet-lock { font-size: 30px; margin-bottom: 12px; }
.sheet-title {
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.sheet-price {
  font-size: 13px; font-weight: 700; color: #1f6feb;
  margin-bottom: 14px;
}
.sheet-price:empty { display: none; }
.sheet-body {
  font-size: 13px; line-height: 1.65; color: #6c6c76;
  margin: 0;
}
.sheet-ack {
  margin-top: 16px; padding: 9px 12px;
  background: #eefaf1; color: #0a7d29;
  border-radius: 8px; font-size: 12.5px; font-weight: 600;
}

/* 관리자 테이블 — 가격 인라인 입력 */
.admin-table .price-input {
  width: 78px; padding: 4px 7px;
  border: 1px solid #dcdce2; border-radius: 6px;
  font: inherit; font-size: 12.5px; text-align: right;
  transition: border-color 0.15s, background 0.4s;
}
.admin-table .price-input:focus { outline: none; border-color: #1f6feb; }
.admin-table .price-input.saved { background: #eefaf1; border-color: #63c383; }

/* figure360 뷰어 전용 스타일 — view-mode/admin-mode body 클래스에만 적용 */
body.view-mode, body.admin-mode {
  position: fixed; inset: 0;
  width: 100%; height: 100%; overflow: hidden; background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', system-ui, sans-serif;
  color: #1a1a1a;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body.view-mode #root, body.admin-mode #root {
  width: 100%; height: 100%; overflow: hidden;
}
#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #ffffff;
}
/* 밝기는 BrightnessSlider 인라인 filter로 제어 — 여기서는 mask만 담당 */
.figure-canvas, .figure-video {
  /* 가장자리 fade — ease-out 느낌으로 다단 stop, 양 축 교차 */
  --fade: 80px;
  --soft: 40px;
  -webkit-mask-image:
    linear-gradient(to right,
      transparent 0,
      rgba(0,0,0,0.55) var(--soft),
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      rgba(0,0,0,0.55) calc(100% - var(--soft)),
      transparent 100%),
    linear-gradient(to bottom,
      transparent 0,
      rgba(0,0,0,0.55) var(--soft),
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      rgba(0,0,0,0.55) calc(100% - var(--soft)),
      transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right,
      transparent 0,
      rgba(0,0,0,0.55) var(--soft),
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      rgba(0,0,0,0.55) calc(100% - var(--soft)),
      transparent 100%),
    linear-gradient(to bottom,
      transparent 0,
      rgba(0,0,0,0.55) var(--soft),
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      rgba(0,0,0,0.55) calc(100% - var(--soft)),
      transparent 100%);
          mask-composite: intersect;
}
.glass {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04);
  color: #1a1a1a;
}
.glass-strong {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.70);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 12px 36px rgba(0, 0, 0, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.05);
}
.glass-btn {
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-user-select: none; user-select: none;
}
.glass-btn:hover { background: rgba(255, 255, 255, 0.32); border-color: rgba(255, 255, 255, 0.75); }
.glass-btn:active { transform: scale(0.96); }
.glass-btn[data-active="true"] {
  background: rgba(30, 30, 30, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
/* === 회전 스크롤바 — 미니멀 (얇은 라인 + 슬림 thumb) === */
.rot-track {
  position: relative;
  height: 36px;             /* 터치 타깃 유지 */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
  overflow: visible;
}
.rot-track::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  top: 50%; height: 1px;
  background: rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  pointer-events: none;
}
.rot-tick {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 1px; background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.rot-tick.major { height: 8px; background: rgba(0, 0, 0, 0.55); }
.rot-tick.minor { display: none; }   /* 미세 눈금 숨김 */
.rot-thumb {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 22px; border-radius: 2px;
  background: #1a1a1a;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
  pointer-events: none;
}
.vert-track {
  position: relative;
  width: 44px;
  border-radius: 22px;
  overflow: hidden;
}
.vert-thumb {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 56px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(40, 40, 40, 0.7); font-weight: 600;
}
.hotspot {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.hotspot[data-edit="false"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.4);
}
.hotspot[data-edit="false"][data-hidden="true"] { background: transparent !important; border: none !important; box-shadow: none !important; }
.hotspot[data-edit="false"][data-hidden="true"]:hover { background: transparent !important; border: none !important; }
.hotspot[data-edit="false"]:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 1);
  border-style: solid;
}
.hotspot[data-edit="true"] {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.4);
  cursor: move;
}
.hotspot-handle {
  position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.7);
  right: -8px; bottom: -8px;
  cursor: nwse-resize;
}
.hotspot-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  animation: pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { opacity: 0; }
}
.greeting {
  pointer-events: none;
  animation: fadeUp 0.6s ease-out both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.speech {
  pointer-events: none;
  animation: speechPop 0.35s ease-out both;
}
@keyframes speechPop {
  from { opacity: 0; transform: translate(-50%, 6px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* === 인트로 오버레이 (로딩 + 안내) === */
.intro-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  animation: introFadeIn 0.5s ease-out both;
  padding: 24px;
}
.intro-overlay[data-leaving="true"] {
  animation: introFadeOut 0.6s ease-in both;
  pointer-events: none;
}
@keyframes introFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes introFadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}
.intro-card {
  max-width: 520px; width: 100%;
  text-align: center;
  animation: introCardRise 0.7s ease-out both;
}
@keyframes introCardRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.intro-title {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700; letter-spacing: -0.02em;
  color: #1a1a1a;
  animation: introTitleFade 1.2s ease-out 0.15s both;
}
.intro-subtitle {
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(60, 60, 60, 0.55);
  margin-bottom: 8px;
  animation: introTitleFade 1.2s ease-out 0.05s both;
}
@keyframes introTitleFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.intro-section {
  margin-top: 22px;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  animation: introTitleFade 1.2s ease-out 0.35s both;
}
.intro-section.legal {
  background: rgba(255, 246, 235, 0.85);
  border-color: rgba(190, 110, 30, 0.18);
  color: #5a3812;
}
.intro-section h4 {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  color: rgba(40, 40, 40, 0.85);
}
.intro-section.legal h4 { color: #8a4a18; }
.intro-section ul { list-style: none; padding: 0; margin: 0; }
.intro-section li {
  font-size: 13px; line-height: 1.55;
  padding: 3px 0 3px 16px;
  position: relative;
  color: rgba(40, 40, 40, 0.85);
}
.intro-section.legal li { color: #5a3812; }
.intro-section li::before {
  content: '·'; position: absolute; left: 4px; top: 1px;
  font-size: 18px; line-height: 1;
}
.intro-progress {
  margin-top: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: introTitleFade 1.2s ease-out 0.5s both;
}
.intro-progress-bar {
  width: 100%; max-width: 320px;
  height: 4px; border-radius: 2px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.intro-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a1a1a, #4a4a4a);
  transition: width 0.18s ease;
}
.intro-progress-label {
  font-size: 12px; color: rgba(40, 40, 40, 0.55);
  letter-spacing: 0.04em;
}
.intro-start-btn {
  margin-top: 6px;
  padding: 12px 32px;
  font-size: 14px; font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.85);
  background: #1a1a1a; color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
  letter-spacing: 0.04em;
}
.intro-start-btn:hover { background: #000; }
.intro-start-btn:active { transform: scale(0.97); }
.intro-start-btn:disabled {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(255, 255, 255, 0.85);
  cursor: wait;
}
#ui-toggle {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top) + 4px));
  right: max(16px, env(safe-area-inset-right));
  z-index: 9999;
  width: clamp(40px, 5.6vw, 52px);
  height: clamp(40px, 5.6vw, 52px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.hint { font-size: 12px; color: rgba(40, 40, 40, 0.6); }
.top-toolbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: calc(max(12px, env(safe-area-inset-right)) + clamp(52px, 8vw, 64px));
  display: flex;
  flex-wrap: wrap;
  gap: clamp(4px, 0.8vw, 8px);
  z-index: 50;
  pointer-events: none;
}
.top-toolbar > * { pointer-events: auto; }
.top-toolbar .spacer { flex: 1 1 auto; }

/* === 관리자 사이드 도크 — 우측 세로, UI 토글 아래 === */
.admin-dock {
  position: fixed;
  top: max(120px, calc(env(safe-area-inset-top) + 110px));
  right: max(14px, env(safe-area-inset-right));
  display: flex; flex-direction: column;
  gap: 8px;
  z-index: 60;
  align-items: flex-end;
  pointer-events: none;
}
.admin-dock > * { pointer-events: auto; }
@media (max-width: 600px) {
  .admin-dock .pill-label { display: inline; }
}
@media (max-width: 600px) {
  .top-toolbar .pill-label { display: none; }
  .hint { display: none; }
}
@media (max-width: 380px) {
  .top-toolbar { top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; }
}

/* === 뷰어 모드: 버튼·스크롤 트랙 배경/테두리 제거 === */
body.view-mode .glass,
body.view-mode .glass-strong,
body.view-mode .glass-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body.view-mode .glass-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
}
body.view-mode .glass-btn[data-active="true"] {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #1a1a1a !important;
}
body.view-mode .vert-track {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body.view-mode .vert-thumb {
  background: rgba(0, 0, 0, 0.42) !important;
  border: none !important;
  box-shadow: none !important;
}
body.view-mode #ui-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body.view-mode #ui-toggle:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

/* ============================================================
   관리자(편집) 뷰어 모드 — 솔리드 컨트롤
   반투명 글래스를 불투명 흰색 카드로 교체해
   ① 흰 배경 위 가독성 확보 ② 버튼 경계 명확화.
   (일반 뷰어 view-mode 에는 영향 없음)
   ============================================================ */
body.admin-mode .glass,
body.admin-mode .glass-strong {
  background: #ffffff !important;
  border: 1px solid #e4e4ea !important;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.06) !important;
  color: #1c1c1f !important;
  -webkit-backdrop-filter: none !important;
          backdrop-filter: none !important;
}
body.admin-mode .glass-btn {
  color: #2a2a30 !important;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease !important;
}
body.admin-mode .glass-btn:hover {
  background: #f3f4f7 !important;
  border-color: #cdd0da !important;
}
body.admin-mode .glass-btn:active { transform: scale(0.97); }
body.admin-mode .glass-btn[data-active="true"] {
  background: #1c1c1f !important;
  border-color: #1c1c1f !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,0.45) !important;
}
/* UI 숨김 토글(원형) */
body.admin-mode #ui-toggle {
  background: #ffffff !important;
  border: 1px solid #e4e4ea !important;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.25) !important;
  color: #2a2a30 !important;
}
body.admin-mode #ui-toggle:hover { background: #f3f4f7 !important; }
/* 하단 회전 스크롤바 — 솔리드 흰 바 (border 대신 box-shadow 링 → 눈금 좌표 영향 없음) */
body.admin-mode .rot-track {
  background: #ffffff !important;
  border: none !important;
  box-shadow: 0 0 0 1px #e4e4ea, 0 10px 28px -10px rgba(0,0,0,0.22) !important;
  border-radius: 999px !important;
}
body.admin-mode .rot-track::before { background: rgba(0,0,0,0.20); }
body.admin-mode .rot-tick.major { background: rgba(0,0,0,0.55); }
body.admin-mode .rot-thumb { background: #1c1c1f; box-shadow: 0 1px 4px rgba(0,0,0,0.30); }
/* 줌·밝기 트랙 — 솔리드 */
body.admin-mode .zoom-track { background: #eceef3 !important; border-color: #d9dce4 !important; }

/* ============================================================
   관리자 페이지 (admin/*.html) 공통 디자인 시스템
   .dash-page 위에서 동작 — 테이블/폼/버튼/ACL 일관 스타일
   ============================================================ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head .page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.page-head .page-sub { font-size: 13px; color: #6c6c76; margin-top: 4px; }

/* 버튼 시스템 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid #d8d8de; background: #fff; color: #1c1c1f;
  cursor: pointer; text-decoration: none;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .1s;
}
.btn:hover { background: #f5f5f8; border-color: #c9ccd6; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #1c1c1f; border-color: #1c1c1f; color: #fff; }
.btn-primary:hover { background: #303036; border-color: #303036; }
.btn-danger { color: #b42318; border-color: #f3c9c4; background: #fff; }
.btn-danger:hover { background: #fdf2f1; border-color: #eab3ad; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; font-weight: 600; }

/* 테이블 카드 */
.table-card {
  background: #fff; border: 1px solid #e6e6ec; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  overflow: hidden;
}
.table-scroll { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.admin-table th, .admin-table td {
  padding: 12px 16px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid #f0f0f4;
}
.admin-table th {
  background: #fafafb; font-weight: 600; color: #6c6c76;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: #fafbfd; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  background: #f4f4f7; padding: 2px 6px; border-radius: 5px; color: #45454e;
}
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-thumb {
  width: 46px; aspect-ratio: 9/16; border-radius: 7px;
  background: #f4f4f7 center / cover no-repeat;
  border: 1px solid #ececf0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #b8b8c0;
}
.admin-table td.thumb-cell { padding: 8px 12px; width: 62px; }
.muted { color: #9c9ca6; }

/* 상태 배지 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid #e6e6ec; color: #6c6c76; background: #fafafb;
}
.badge.on { color: #0a7d29; background: #e9f8ee; border-color: #bde9c9; }
.badge.off { color: #8a8a94; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 폼 카드 */
.form-card {
  background: #fff; border: 1px solid #e6e6ec; border-radius: 14px;
  padding: 20px 22px; margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.form-card > summary {
  cursor: pointer; font-weight: 600; font-size: 14px; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.form-card > summary::-webkit-details-marker { display: none; }
.form-card > summary::before {
  content: '+'; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; background: #1c1c1f; color: #fff;
  font-size: 16px; font-weight: 400; transition: transform .2s;
}
.form-card[open] > summary::before { content: '−'; }
.form-row {
  display: grid; grid-template-columns: 130px 1fr; align-items: center;
  gap: 14px; margin-bottom: 14px;
}
.form-row label { font-size: 12.5px; color: #5c5c66; font-weight: 600; }
.form-row input[type=text], .form-row input[type=number], .form-row textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d8d8de; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: inherit; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row textarea:focus {
  border-color: #1f6feb; box-shadow: 0 0 0 3px rgba(31,111,235,0.12);
}
.form-row textarea { min-height: 64px; resize: vertical; }
.form-row input[type=checkbox] { justify-self: start; width: 18px; height: 18px; accent-color: #1c1c1f; }

/* ACL 2-pane */
.acl-grid { display: grid; grid-template-columns: 1fr 64px 1fr; gap: 16px; align-items: stretch; }
.acl-pane {
  background: #fff; border: 1px solid #e6e6ec; border-radius: 14px;
  padding: 16px; min-height: 320px; display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.acl-pane h3 {
  font-size: 11px; font-weight: 700; color: #8a8a94; margin-bottom: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.acl-pane h3 .count {
  font-size: 11px; color: #6c6c76; background: #f4f4f7;
  padding: 1px 8px; border-radius: 999px; letter-spacing: 0;
}
.acl-pane ul { list-style: none; margin: 0; padding: 0; flex: 1; overflow: auto; max-height: 56vh; }
.acl-pane li {
  padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  transition: background .12s; margin-bottom: 2px;
}
.acl-pane li:hover { background: #f5f8fc; }
.acl-pane li.selected { background: #e7f0ff; box-shadow: inset 0 0 0 1px #b9d3ff; }
.acl-arrows { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.acl-arrows button {
  width: 46px; height: 46px; border-radius: 10px; border: 1px solid #d8d8de;
  background: #fff; font-size: 18px; cursor: pointer; color: #45454e;
  transition: background .14s, border-color .14s;
}
.acl-arrows button:hover:not(:disabled) { background: #f5f5f8; border-color: #1f6feb; color: #1f6feb; }
.acl-arrows button:disabled { opacity: 0.4; cursor: not-allowed; }
.public-toggle {
  background: #fff; border: 1px solid #e6e6ec; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.public-toggle input[type=checkbox] { width: 18px; height: 18px; accent-color: #1c1c1f; }
.public-toggle label { font-size: 14px; font-weight: 600; }
.public-toggle .desc { font-size: 12px; color: #6c6c76; margin-left: auto; }

/* 관리자 홈 카드 */
.admin-home-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.admin-home-card {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid #e6e6ec; border-radius: 16px;
  padding: 24px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform .12s, box-shadow .16s, border-color .16s;
}
.admin-home-card:hover {
  transform: translateY(-2px); border-color: #d3d6e0;
  box-shadow: 0 12px 28px -12px rgba(0,0,0,0.2); text-decoration: none;
}
.admin-home-card .ic { font-size: 30px; margin-bottom: 6px; }
.admin-home-card .t { font-size: 15px; font-weight: 700; }
.admin-home-card .d { font-size: 12.5px; color: #6c6c76; line-height: 1.5; }

@media (max-width: 720px) {
  .dash-main { padding: 22px 16px; }
  .acl-grid { grid-template-columns: 1fr; }
  .acl-arrows { flex-direction: row; }
  .acl-arrows button { transform: rotate(90deg); }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .public-toggle { flex-wrap: wrap; }
  .public-toggle .desc { margin-left: 0; width: 100%; }
}

