/* 앱 공통 틀 (2026-10-18 개편) — 모든 페이지 CSS 뒤에 불러와요.
   방향: 방송 앱. 어두운 잉크색 바탕 + 테마 포인트 색 하나 + 'ON AIR' 빨강은 지금 방송 중일 때만.
   원칙: 글자 15px 이상 · 누르는 것은 44px 이상 · 자주 쓰는 곳은 위 탭/아래 탭에서 한 번에. */
:root {
  --page: #0D0C12;
  --bg: #0D0C12;
  --card: #17151F;
  --raise: #201D2A;
  --line: #2D2938;
  --text: #F4F2F9;
  --muted: #B0AABF;
  --faint: #7E7890;
  --live: #FF4D6A;
  --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --tap: 44px;
  --top-h: 60px;
  --tab-h: 64px;
}
html, body { background: var(--page); }
body { font-family: "Pretendard Variable", "Pretendard", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
main { max-width: 1120px; padding: 0 20px 48px; }
h1 { letter-spacing: -.02em; }
small, .muted, .small { font-size: max(13px, .85em); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ───────── 위 막대 ───────── */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tb-in { max-width: 1120px; margin: 0 auto; height: var(--top-h); padding: 0 20px; display: flex; align-items: center; gap: 14px; }
.tb-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.tb-logo .mark { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 0; }
.onair-pill { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--live); padding: 3px 9px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; }
.onair-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: onair 1.4s ease-in-out infinite; }
@keyframes onair { 50% { opacity: .25; } }
.tb-tabs { display: flex; gap: 2px; margin-left: 12px; }
.tb-tabs a { position: relative; padding: 0 14px; height: var(--top-h); display: inline-flex; align-items: center; font-size: 15.5px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; }
.tb-tabs a:hover { color: var(--text); }
.tb-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-left: 4px; vertical-align: 6px; font-style: normal; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-login { min-height: 38px !important; padding: 8px 16px !important; }

/* 내 메뉴 */
.me-menu { position: relative; }
.me-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-width: var(--tap); min-height: var(--tap); justify-content: center; border-radius: 50%; }
.me-menu > summary::-webkit-details-marker { display: none; }
.mm-more { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.mm-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 270px; padding: 8px; border-radius: var(--r-md); background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.5) !important; display: grid; z-index: 60; }
.mm-pop a { padding: 11px 12px; border-radius: var(--r-sm); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.mm-pop a:hover { background: var(--raise); }
.mm-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.mm-me { gap: 10px !important; }
.mm-me span { display: flex; flex-direction: column; line-height: 1.3; }
.mm-me small { color: var(--muted); }
.mm-pop .cnt { font-style: normal; font-size: 12px; font-weight: 800; background: var(--live); color: #fff; padding: 0 7px; border-radius: 999px; margin-left: auto; }
.mm-pop .dot { margin-left: auto; vertical-align: 0; }
.mm-theme { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: 15px; }
.mm-theme .theme-pick { background: var(--raise); border: 0; }
.mm-out { color: var(--muted); }

/* 아래 탭 (휴대폰) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tb-tabs { display: none; }
  .tb-login { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on svg { color: var(--accent); }
  .tabbar a.live svg { color: var(--live); }
  .tabbar .dot { position: absolute; top: 9px; left: calc(50% + 8px); margin: 0; }
  .tabbar .av { --s: 24px; }
  .tabbar a.on .av { outline: 2px solid var(--accent); outline-offset: 1px; }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  main { padding: 0 16px 32px; }
  .tb-in { padding: 0 16px; }
}

/* 아래 */
footer { max-width: 1120px; margin: 0 auto; padding: 28px 20px 36px; font-size: 13px; color: var(--faint); line-height: 1.9; border-top: 1px solid var(--line); text-align: left; }
footer .ft-links { display: block; margin-bottom: 4px; font-size: 14px; }
footer .link { color: var(--muted); }

/* ───────── 공통 부품 ───────── */
.btn { min-height: var(--tap); padding: 11px 20px; border-radius: 12px; font-size: 15.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #120F1A; border: 0; cursor: pointer; transform: none !important; }
.btn:hover { filter: brightness(1.08); }
.btn.small { min-height: 38px; padding: 8px 16px; font-size: 14.5px; border-radius: 10px; }
.btn.ghost { background: var(--raise); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 8%, var(--raise)); filter: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { color: var(--accent); }
input, select, textarea { font: inherit; font-size: 16px; }   /* 휴대폰에서 글자 칸을 누르면 화면이 확대되지 않게 16px */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 22px; }
.panel > h2 { font-size: 18px; }
.flash { font-size: 15px; border-radius: var(--r-sm); }

/* 프사 (모든 페이지에서 써요) */
.av { --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; background: color-mix(in srgb, var(--accent) 24%, var(--card)); vertical-align: middle; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av b { font-size: calc(var(--s) * .42); color: var(--text); font-weight: 700; }

/* 예전 위 메뉴 흔적 지우기 */
header.nav { display: none; }
.hero { padding-top: 40px; }

/* ───────── DJ 대시보드 머리·메뉴 ───────── */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 0 12px; }
.dash-head h1 { margin: 0; font-size: 24px; font-weight: 800; }
.dash-actions { display: flex; align-items: center; gap: 10px; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--muted); padding: 6px 12px !important;
  border-radius: 999px !important; background: var(--card) !important; border: 1px solid var(--line) !important; }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-badge.on { color: #fff !important; background: color-mix(in srgb, var(--live) 22%, var(--card)) !important; border-color: color-mix(in srgb, var(--live) 55%, transparent) !important; }
.live-badge.on::before { background: var(--live); animation: onair 1.4s ease-in-out infinite !important; }
.dgroups { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 10px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.dgroups::-webkit-scrollbar { display: none; }
.dgroups a { flex: 1 0 auto; text-align: center; padding: 10px 16px; min-height: 42px; border-radius: 10px; font-size: 15.5px; font-weight: 700; color: var(--muted); white-space: nowrap; position: relative; }
.dgroups a:hover { color: var(--text); }
.dgroups a.on { background: var(--raise); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent) !important; }
.dgroups .dot { position: absolute; top: 9px; margin-left: 2px; }
.subnav.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; border: 0 !important; margin: 0 0 22px !important; padding: 2px 0 !important; background: none !important; }
.subnav.chips::-webkit-scrollbar { display: none; }
.subnav.chips a { flex: 0 0 auto; padding: 8px 15px !important; min-height: 38px; display: inline-flex; align-items: center; border-radius: 999px !important; border: 1px solid var(--line) !important;
  font-size: 14.5px; font-weight: 600; color: var(--muted); margin: 0 !important; background: none; }
.subnav.chips a.active { background: color-mix(in srgb, var(--accent) 18%, transparent) !important; border-color: color-mix(in srgb, var(--accent) 60%, transparent) !important; color: var(--text); }
.subnav.chips .dot { vertical-align: 2px; }
.dgroups + .panel, .dgroups ~ section:first-of-type { margin-top: 18px; }
@media (max-width: 760px) { .dash-head h1 { font-size: 21px; } .dgroups a { padding: 9px 12px; font-size: 15px; } }
.live-badge.on::before { background: var(--live) !important; opacity: 1 !important; }

/* 장식용 영어 대문자 라벨은 숨겨요 (제목만으로 충분해요) */
.g-eyebrow, .eyebrow, .w-eyebrow, .dash-eyebrow { display: none !important; }

/* 연결 문제 알림: 한 줄로 작게 (모바일에서 화면을 덜 차지하게) */
.problem { padding: 10px 14px !important; gap: 8px 12px !important; font-size: 14.5px; line-height: 1.5; }
.problem span { flex: 1 1 240px !important; }
.problem .btn { min-height: 34px; padding: 6px 14px; font-size: 14px; }

/* 멤버십 가격 줄바꿈 */
.sp-price { flex-wrap: wrap; }
.sp-price b { white-space: nowrap; }

/* 갤러리: 버튼을 누르면 바로 사진 고르기 */
.g-pick { cursor: pointer; }
.g-new .g-drop { min-height: 0; border: 0; }
.post-img { cursor: pointer; user-select: none; -webkit-user-select: none; }
.heart-pop { position: absolute; left: 50%; top: 50%; font-size: 96px; color: #FF5C8A; transform: translate(-50%, -50%) scale(.4); opacity: 0; pointer-events: none; }
.heart-pop.go { animation: heartpop .7s ease-out; }
@keyframes heartpop { 30% { opacity: .95; transform: translate(-50%, -50%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
.post-media { position: relative; }
@media (max-width: 760px) { .tb-right .tb-login { display: none; } }
.side .songs-panel .songs { max-height: 264px; }
[id] { scroll-margin-top: calc(var(--top-h) + 12px); }
@media (max-width: 1040px) { .studio > aside.side { order: 2; } .studio > .world-col { order: 3; position: static; } }
/* 스튜디오: 채팅 | 오른쪽 칸(신청곡 · 세계관 소식 · 부자 순위 · 봇 전원 …) 두 칸으로 */
.studio { grid-template-columns: minmax(0, 1fr) 340px !important; }
.side .world-panel .world { max-height: 264px; overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1040px) { .studio { grid-template-columns: 1fr !important; } }
@media (min-width: 1041px) { .studio > .chat-panel { position: sticky; top: calc(var(--top-h) + 12px); } }   /* 오른쪽 칸을 내려도 채팅은 그대로 보여요 */
/* 위 막대 아이콘: 쪽지 · 알림 */
.tb-ico { position: relative; width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); }
.tb-ico:hover, .tb-ico.on { color: var(--text); background: var(--raise); }
.tb-cnt { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--live); color: #fff;
  font-style: normal; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
@media (max-width: 760px) { .tb-right { gap: 2px; } }

/* 위 막대·바닥 글을 그 페이지 본문 폭과 맞춰요 (로고와 본문의 왼쪽 끝이 같은 줄에 오게) */
body:has(.studio-wrap) .tb-in, body:has(.studio-wrap) footer { max-width: 1520px; }
body:has(.custom-layout) .tb-in, body:has(.custom-layout) footer { max-width: 1240px; }
.mm-pop form.mm-out-f { margin: 0; }
.mm-pop button.mm-out { width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: var(--r-sm); font: inherit; font-size: 15px; cursor: pointer; }
.mm-pop button.mm-out:hover { background: var(--raise); }
.tb-dj { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--raise); color: var(--text); white-space: nowrap; }
@media (max-width: 720px) { .tb-dj { display: none; } }
.logout-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.logout-row form { margin: 0; }
