/* XEX — 한 장짜리 스타일.
 * 구조는 짧은 영상 플랫폼의 관례(왼쪽 사이드바 · 세로 스냅 피드 · 오른쪽 반응 기둥 · 아래 탭)를 따르고,
 * 색·로고는 XEX 고유의 보라(#7C4DFF)와 민트(#00E0B8)다.
 *
 * 폭 기준: ~767 모바일 / 768~1023 좁은 PC(사이드바 아이콘만) / 1024~ 넓은 PC. */

:root {
  --accent: #7c4dff;
  --accent-hover: #6a3cf0;
  --accent-2: #00e0b8;
  --like: #ff3b6b;
  --radius: 8px;
  --sb-w: 240px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --bg: #000;
  --bg-2: #121212;
  --bg-3: #1f1f1f;
  --bg-hover: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --text-2: rgba(255,255,255,.62);
  --text-3: rgba(255,255,255,.42);
  --chip: rgba(255,255,255,.08);
  --chip-on: #fff;
  --chip-on-text: #000;
  --rail-btn: rgba(255,255,255,.12);
  --rail-dot: #2a2a2a;
  --skel: rgba(255,255,255,.08);
  --shadow: 0 8px 32px rgba(0,0,0,.6);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fff;
  --bg-2: #f8f8f8;
  --bg-3: #f1f1f2;
  --bg-hover: rgba(22,24,35,.06);
  --line: rgba(22,24,35,.12);
  --text: rgba(22,24,35,1);
  --text-2: rgba(22,24,35,.65);
  --text-3: rgba(22,24,35,.45);
  --chip: rgba(22,24,35,.06);
  --chip-on: rgba(22,24,35,1);
  --chip-on-text: #fff;
  --rail-btn: rgba(22,24,35,.06);
  --rail-dot: #f1f1f2;
  --skel: rgba(22,24,35,.07);
  --shadow: 0 8px 32px rgba(0,0,0,.14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; flex: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─────────────────── 공용 부품 ─────────────────── */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius); font-weight: 600; font-size: 15px; white-space: nowrap; transition: background .15s; -webkit-user-select: none; user-select: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--chip); color: var(--text-3); cursor: default; }
.btn-ghost { background: var(--chip); color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); filter: brightness(1.2); }
.btn-line { border: 1px solid var(--line); color: var(--text); }
.btn-line:hover { background: var(--bg-hover); }
.btn-danger { background: #e5344a; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 6px; }
.btn-lg { height: 48px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.icon-btn:hover { background: var(--bg-hover); }

.avatar { display: block; border-radius: 50%; object-fit: cover; background: var(--bg-3); flex: none; }
.avatar.ph { display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, #9b6bff, #5b3df5); }

.chips { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--chip); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; white-space: nowrap; }
.chip:hover { filter: brightness(1.3); }
.chip.on { background: var(--chip-on); color: var(--chip-on-text); }

.tabs { display: flex; border-bottom: 1px solid var(--line); position: relative; }
.tab { flex: none; min-width: 120px; height: 44px; padding: 0 16px; font-weight: 600; font-size: 17px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative; }
.tab svg { width: 18px; height: 18px; }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
.tab:hover { color: var(--text); }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 80px 20px; color: var(--text-2); }
.empty svg { width: 72px; height: 72px; color: var(--text-3); }
.empty h3 { margin: 6px 0 0; font-size: 22px; color: var(--text); }
.empty p { margin: 0; font-size: 15px; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: var(--skel); border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.verified { width: 14px; height: 14px; color: var(--accent-2); vertical-align: -2px; }
.muted { color: var(--text-2); }
.hashtag { font-weight: 600; color: var(--text); }
.hashtag:hover { text-decoration: underline; }

/* 토스트 — 가운데 위 */
#toasts { position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.toast { background: rgba(84,84,84,.92); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow); animation: toast-in .2s var(--ease); max-width: 90vw; text-align: center; }
[data-theme="light"] .toast { background: rgba(22,24,35,.85); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ─────────────────── 뼈대 ─────────────────── */

.app { min-height: 100%; }
.view { min-height: 100vh; margin-left: var(--sb-w); outline: none; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; z-index: 20; background: var(--bg); }
.sidebar::-webkit-scrollbar { display: none; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; height: 36px; margin-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 32px; height: 32px; }
.brand-word { font-size: 25px; font-weight: 900; letter-spacing: -.5px; font-family: "Arial Black", var(--font); }
.sb-collapse { color: var(--text-3); display: grid; place-items: center; }
.sb-collapse svg { width: 20px; height: 20px; }
.sb-search { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 20px; background: var(--chip); color: var(--text-3); font-size: 15px; }
.sb-search svg { width: 20px; height: 20px; }
.sb-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.sb-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: 6px; font-size: 18px; font-weight: 600; width: 100%; text-align: left; position: relative; }
.sb-item svg { width: 28px; height: 28px; }
.sb-item svg.f { display: none; }
.sb-item:hover { background: var(--bg-hover); }
.sb-item.on { color: var(--accent); }
.sb-item.on svg.o { display: none; }
.sb-item.on svg.f { display: block; }
.sb-item .badge { position: absolute; left: 30px; top: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--like); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sb-back .back-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.sb-back .back-dot svg { width: 16px; height: 16px; }
.sb-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.sb-login { padding: 12px 4px 4px; }
.sb-following { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.sb-following h4 { margin: 0 8px 8px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.sb-acc { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.sb-acc:hover { background: var(--bg-hover); }
.sb-acc b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-acc small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-acc > div { min-width: 0; }
.sb-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sb-foot summary { list-style: none; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; }
.sb-foot summary::-webkit-details-marker { display: none; }
.sb-foot details a { display: block; font-size: 13px; color: var(--text-3); padding: 3px 0 0 8px; }
.sb-foot details a:hover { text-decoration: underline; }
.sb-foot .copy { color: var(--text-3); font-size: 12px; font-weight: 600; }

/* 좁은 PC — 아이콘만 */
.app.sb-mini { --sb-w: 72px; }
.app.sb-mini .sidebar { padding: 20px 8px; align-items: center; }
.app.sb-mini .brand-word, .app.sb-mini .sb-item span:not(.back-dot):not(.badge), .app.sb-mini .sb-search span, .app.sb-mini .sb-login, .app.sb-mini .sb-following, .app.sb-mini .sb-foot, .app.sb-mini .sb-collapse { display: none; }
.app.sb-mini .sb-head { padding: 0; justify-content: center; }
.app.sb-mini .sb-search { width: 44px; padding: 0; justify-content: center; }
.app.sb-mini .sb-item { width: 48px; justify-content: center; padding: 0; }
.app.sb-mini .sb-sep { width: 32px; }
.app.sb-mini .sb-item .badge { left: 26px; }
@media (max-width: 1023px) and (min-width: 768px) {
  .app { --sb-w: 72px; }
  .sidebar { padding: 20px 8px; align-items: center; }
  .brand-word, .sb-item span:not(.back-dot):not(.badge), .sb-search span, .sb-login, .sb-following, .sb-foot, .sb-collapse { display: none; }
  .sb-head { padding: 0; justify-content: center; }
  .sb-search { width: 44px; padding: 0; justify-content: center; }
  .sb-item { width: 48px; justify-content: center; padding: 0; }
  .sb-sep { width: 32px; }
}

/* 검색 패널 — 사이드바가 아이콘으로 접히고 그 옆에서 열린다 */
.search-panel { position: fixed; left: 72px; top: 0; bottom: 0; width: 380px; background: var(--bg); border-right: 1px solid var(--line); border-left: 1px solid var(--line); z-index: 30; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); animation: slide-in .2s var(--ease); }
@keyframes slide-in { from { transform: translateX(-12px); opacity: 0; } }
.sp-head { display: flex; justify-content: space-between; align-items: center; }
.sp-head h3 { margin: 0; font-size: 22px; }
.sp-form { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--chip); border: 1px solid transparent; }
.sp-form:focus-within { border-color: var(--line); }
.sp-form svg { width: 20px; height: 20px; color: var(--text-3); }
.sp-form input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; min-width: 0; }
.sp-body { overflow-y: auto; flex: 1; }
.sp-sec h5 { margin: 12px 0 6px; font-size: 14px; color: var(--text-2); display: flex; justify-content: space-between; }
.sp-sec h5 button { color: var(--text-2); font-size: 13px; font-weight: 400; }
.sp-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 6px; width: 100%; text-align: left; font-size: 16px; }
.sp-row:hover { background: var(--bg-hover); }
.sp-row .ic { width: 20px; height: 20px; color: var(--text-3); }
.sp-row .x { margin-left: auto; color: var(--text-3); width: 16px; height: 16px; }
.sp-row .dot-hot { width: 8px; height: 8px; border-radius: 50%; background: var(--like); margin: 0 6px; flex: none; }
.sp-row b { font-weight: 600; }
.sp-row small { display: block; color: var(--text-2); font-size: 13px; }

/* 오른쪽 위 — 로그인 / 업로드·알림·내 사진 */
.top-actions { position: fixed; top: 20px; right: 24px; z-index: 25; display: flex; align-items: center; gap: 8px; }
.top-actions .pill { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 24px; background: rgba(37,37,37,.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
[data-theme="light"] .top-actions .pill { background: rgba(255,255,255,.8); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.top-actions .pill .icon-btn { width: 36px; height: 36px; position: relative; }
.top-actions .pill .icon-btn svg { width: 22px; height: 22px; }
.top-actions .ta-up { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.top-actions .ta-up:hover { background: var(--bg-hover); }
.top-actions .ta-up svg { width: 18px; height: 18px; }
.top-actions .dot { position: absolute; right: 2px; top: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--like); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.view.no-top-actions ~ .top-actions, .app.hide-top-actions .top-actions { display: none; }

/* ─────────────────── 모바일 뼈대 ─────────────────── */

.m-top, .m-bottom { display: none; }
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer-back { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.drawer-panel { position: absolute; inset: 0 auto 0 0; width: min(86vw, 340px); background: var(--bg); overflow-y: auto; padding: 12px 16px 24px; animation: drawer-in .22s var(--ease); }
[data-theme="dark"] .drawer-panel { background: #121212; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
.drawer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.drawer-nav a { display: flex; align-items: center; gap: 16px; padding: 12px 4px; font-size: 20px; font-weight: 700; }
.drawer-nav a svg { width: 30px; height: 30px; }
.drawer-nav a.on { color: var(--accent); }
.drawer-auth { padding: 16px 0; border-bottom: 1px solid var(--line); }
.drawer-links h5 { margin: 16px 0 6px; color: var(--text-3); font-size: 14px; font-weight: 500; }
.drawer-links a { display: block; padding: 6px 0; font-size: 16px; }
.drawer-links .copy { color: var(--text-3); font-size: 13px; }

@media (max-width: 767px) {
  .sidebar, .top-actions, .search-panel { display: none !important; }
  .view { margin-left: 0; min-height: 100dvh; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .m-bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .app.feed-mode .m-bottom { background: #000; border-top-color: #000; color: #fff; --bg: #000; }
  .m-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--text-2); position: relative; }
  .app.feed-mode .m-bottom a { color: rgba(255,255,255,.7); }
  .m-bottom a svg { width: 26px; height: 26px; }
  .m-bottom a svg.f { display: none; }
  .m-bottom a.on { color: var(--text); }
  .app.feed-mode .m-bottom a.on { color: #fff; }
  .m-bottom a.on svg.o { display: none; }
  .m-bottom a.on svg.f { display: block; }
  .m-bottom .dot { position: absolute; top: 6px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--like); }
  .plus-pill { width: 46px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #fff; color: #000; box-shadow: -3px 0 0 var(--accent-2), 3px 0 0 var(--accent); }
  [data-theme="light"] .app:not(.feed-mode) .plus-pill { background: #161823; color: #fff; }
  .plus-pill svg { width: 20px !important; height: 20px !important; }

  .m-top { display: none; position: fixed; left: 0; right: 0; top: 0; z-index: 40; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0; align-items: center; justify-content: space-between; color: #fff; background: linear-gradient(rgba(0,0,0,.45), transparent); pointer-events: none; }
  .app.feed-mode .m-top { display: flex; }
  .m-top > * { pointer-events: auto; }
  .m-top .icon-btn svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
  .m-tabs { display: flex; align-items: center; gap: 18px; font-size: 17px; font-weight: 600; }
  .m-tabs a { color: rgba(255,255,255,.7); position: relative; padding: 6px 0; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
  .m-tabs a.on { color: #fff; }
  .m-tabs a.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 26px; height: 3px; margin-left: -13px; background: #fff; border-radius: 2px; }
  .m-tabs .m-live svg { width: 24px; height: 24px; }
}

/* ─────────────────── 피드 ─────────────────── */

.feed { height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }
.feed-item { height: 100vh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: 16px 0; gap: 16px; position: relative; }
.card { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - var(--sb-w) - 200px); border-radius: 16px; overflow: hidden; background: #111; flex: none; }
.card.wide { aspect-ratio: auto; width: min(calc(100vw - var(--sb-w) - 200px), 720px); }
.card video, .card .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.card .poster { object-fit: cover; filter: blur(0); }
.card .bg-blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(30px) brightness(.5); }
.card .tap { position: absolute; inset: 0; z-index: 1; }
.card .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; z-index: 1; }
.card .top-ctl { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; z-index: 3; opacity: 0; transition: opacity .2s; }
.card:hover .top-ctl, .card.show-ctl .top-ctl { opacity: 1; }
.card .ctl { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); }
.card .ctl:hover { background: rgba(0,0,0,.45); }
.card .vol { display: flex; align-items: center; gap: 4px; }
.card .vol input { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; }
.card .vol:hover input { width: 72px; opacity: 1; }
.card .big-play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; color: rgba(255,255,255,.8); z-index: 2; pointer-events: none; filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.card .meta { position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 2; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); pointer-events: none; }
.card .meta a, .card .meta button { pointer-events: auto; }
.card .meta .who { font-weight: 700; font-size: 16px; display: inline-flex; gap: 6px; align-items: baseline; }
.card .meta .who small { font-weight: 400; font-size: 13px; opacity: .8; }
.card .meta .cap { font-size: 15px; margin-top: 4px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; white-space: pre-line; }
.card .meta .cap.open { -webkit-line-clamp: unset; max-height: 40vh; overflow-y: auto; }
.card .meta .cap .hashtag { color: #fff; }
.card .meta .more-cap { font-weight: 700; font-size: 14px; margin-top: 2px; }
.card .meta .snd { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 8px; opacity: .92; max-width: 70%; }
.card .meta .snd svg { width: 14px; height: 14px; }
.card .meta .snd span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; z-index: 3; display: flex; align-items: flex-end; cursor: pointer; }
.card .prog i { display: block; height: 2px; width: 100%; background: rgba(255,255,255,.25); position: relative; transition: height .1s; }
.card .prog i b { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; width: 0; }
.card .prog:hover i { height: 4px; }
.card .time { position: absolute; left: 12px; bottom: 22px; font-size: 13px; color: #fff; z-index: 3; opacity: 0; transition: opacity .2s; font-variant-numeric: tabular-nums; }
.card .prog:hover ~ .time, .card.seeking .time { opacity: 1; }
.card.seeking .meta { opacity: 0; }
.heart-pop { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: var(--like); z-index: 4; pointer-events: none; animation: heart-pop .8s var(--ease) forwards; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3)); }
@keyframes heart-pop { 0% { transform: scale(.4) rotate(var(--r,0deg)); opacity: 0; } 15% { transform: scale(1.2) rotate(var(--r,0deg)); opacity: 1; } 30% { transform: scale(1) rotate(var(--r,0deg)); } 80% { opacity: 1; } 100% { transform: scale(1) translateY(-60px) rotate(var(--r,0deg)); opacity: 0; } }

.rail { display: flex; flex-direction: column; align-items: center; gap: 14px; align-self: flex-end; padding-bottom: 8px; z-index: 5; }
.rail .who { position: relative; margin-bottom: 10px; }
.rail .who .avatar { width: 48px; height: 48px; border: 1px solid var(--line); }
.rail .who .plus { position: absolute; left: 50%; bottom: -10px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; transition: transform .2s; }
.rail .who .plus svg { width: 14px; height: 14px; }
.rail .who .plus.done { background: #fff; color: var(--accent); }
.rail .act { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.rail .act .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--rail-btn); color: var(--text); transition: transform .15s; }
.rail .act:active .ic { transform: scale(.9); }
.rail .act .ic svg { width: 26px; height: 26px; }
.rail .act.on-like .ic { color: var(--like); }
.rail .act.on-save .ic { color: #fcc419; }
.rail .act.on-like .ic svg { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.3); } }
.rail .disc { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle, #333 30%, #111 32%, #222 60%, #0b0b0b 62%); display: grid; place-items: center; animation: spin 5s linear infinite; animation-play-state: paused; margin-top: 4px; }
.rail .disc.spin { animation-play-state: running; }
.rail .disc img, .rail .disc .avatar { width: 24px; height: 24px; }

.feed-nav { position: fixed; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 16px; z-index: 10; }
.feed-nav button { width: 48px; height: 48px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.feed-nav button:hover { filter: brightness(1.4); }
.feed-nav button:disabled { opacity: .3; cursor: default; }

.feed-hint { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.7); display: grid; place-items: center; text-align: center; color: #fff; }
.feed-hint .in { display: grid; justify-items: center; gap: 20px; max-width: 420px; padding: 20px; }
.feed-hint svg.m { width: 120px; height: 120px; }
.feed-hint p { font-size: 20px; font-weight: 600; margin: 0; }

/* 댓글 판이 열리면 영상은 남은 폭의 가운데로, 위아래 화살표는 판에 가려지니 감춘다 */
.app.comments-open .feed-item { padding-right: 420px; }
.app.comments-open .card { max-width: calc(100vw - var(--sb-w) - 420px - 100px); }
.app.comments-open .feed-nav { display: none; }

.feed-end { height: 40vh; display: grid; place-items: center; color: var(--text-2); scroll-snap-align: end; }

@media (max-width: 767px) {
  .feed { height: calc(100dvh - 56px - env(safe-area-inset-bottom)); }
  .feed-item { height: calc(100dvh - 56px - env(safe-area-inset-bottom)); padding: 0; gap: 0; }
  .card, .card.wide { height: 100%; width: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; }
  .card video { object-fit: contain; }
  .card.fill video { object-fit: cover; }
  .card .top-ctl { display: none; }
  .card .meta { right: 80px; bottom: 16px; }
  .card .prog { height: 12px; }
  .rail { position: absolute; right: 8px; bottom: 16px; gap: 16px; color: #fff; --text: #fff; --text-2: #fff; }
  .rail .act { text-shadow: 0 1px 2px rgba(0,0,0,.5); }
  .rail .act .ic { background: none; width: 44px; height: 40px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
  .rail .act .ic svg { width: 36px; height: 36px; }
  .rail .who .avatar { border: 1.5px solid #fff; }
  .feed-nav { display: none; }
  .app.comments-open .feed-item { padding-left: 0; justify-content: center; }
}

/* ─────────────────── 모달·시트 ─────────────────── */

.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(100%, 480px); max-height: calc(100vh - 40px); overflow: auto; background: var(--bg-2); border-radius: 12px; box-shadow: var(--shadow); animation: pop .2s var(--ease); }
[data-theme="light"] .modal { background: #fff; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 24px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-body { padding: 8px 24px 24px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); }
.modal-x { position: absolute; right: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }

@media (max-width: 767px) {
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal-wrap.center { place-items: center; padding: 20px; }
  .modal-wrap:not(.center) .modal { width: 100%; max-height: 92dvh; border-radius: 12px 12px 0 0; animation: sheet-up .25s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

.menu-pop { position: fixed; z-index: 110; min-width: 220px; background: var(--bg-2); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 0; animation: pop .15s var(--ease); border: 1px solid var(--line); }
[data-theme="light"] .menu-pop { background: #fff; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; font-size: 15px; font-weight: 600; text-align: left; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--bg-hover); }
.menu-pop svg { width: 20px; height: 20px; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-pop .danger { color: #ff4d62; }
.menu-pop .switch { margin-left: auto; }

.switch { width: 44px; height: 24px; border-radius: 12px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--accent-2); }
.switch.on::after { transform: translateX(20px); }

/* 로그인 */
.login { text-align: center; padding: 40px 32px 0; }
.login h2 { font-size: 32px; margin: 0 0 8px; }
.login p.sub { color: var(--text-2); margin: 0 0 28px; font-size: 15px; }
/* 구글 단추는 iframe 이다. 부모가 color-scheme: dark 면 iframe 바탕이 흰 네모로 칠해진다 */
.login .gbtn-host { display: flex; justify-content: center; min-height: 44px; margin-bottom: 12px; color-scheme: light; }
.login .gbtn-fallback { display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; justify-content: center; }
.login .gbtn-fallback svg { width: 22px; height: 22px; }
.login .note { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 24px 0 0; }
.login .note a { color: var(--text-2); font-weight: 600; }
.login-foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 18px; text-align: center; font-size: 15px; color: var(--text-2); }
.login-foot b { color: var(--accent); }
.consent { display: grid; gap: 4px; text-align: left; margin: 12px 0 20px; }
.consent label { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.consent label:hover { background: var(--bg-hover); }
.consent label.all { background: var(--chip); font-weight: 700; margin-bottom: 6px; }
.consent input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.consent a { margin-left: auto; color: var(--text-3); font-size: 13px; text-decoration: underline; }
.consent .req { color: var(--accent); font-weight: 700; margin-right: 4px; }
.g-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--chip); text-align: left; }
.g-profile .avatar { width: 44px; height: 44px; }
.g-profile small { color: var(--text-2); display: block; }

/* 공유 */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; padding: 8px 0 16px; }
.share-grid button { display: grid; justify-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.share-grid .ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-grid .ic svg { width: 26px; height: 26px; }
.share-link { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 8px; padding: 4px 4px 4px 12px; }
.share-link input { flex: 1; background: none; border: 0; outline: 0; color: var(--text-2); font-size: 14px; min-width: 0; }

/* 신고 */
.report-list { display: grid; }
.report-list label { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.report-list input { accent-color: var(--accent); width: 18px; height: 18px; }

/* 폼 */
.field { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > span { font-weight: 600; font-size: 15px; }
.field .inp { width: 100%; height: 40px; padding: 0 12px; border-radius: 6px; background: var(--chip); border: 1px solid transparent; outline: 0; font-size: 15px; }
.field textarea.inp { height: 96px; padding: 10px 12px; resize: vertical; }
.field .inp:focus { border-color: var(--text-3); }
.field .hint { font-size: 13px; color: var(--text-3); }
.field .err { font-size: 13px; color: #ff4d62; }
.field .pre { display: flex; align-items: center; background: var(--chip); border-radius: 6px; padding-left: 12px; color: var(--text-3); }
.field .pre .inp { background: none; padding-left: 2px; }
@media (min-width: 768px) {
  .field.row { grid-template-columns: 140px 1fr; align-items: start; }
  .field.row > span { padding-top: 8px; }
}
.photo-edit { position: relative; width: 96px; height: 96px; cursor: pointer; }
.photo-edit .avatar { width: 96px; height: 96px; }
.photo-edit .cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; }
.photo-edit .cam svg { width: 16px; height: 16px; }

/* ─────────────────── 댓글 ─────────────────── */

.cm-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; z-index: 35; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: panel-in .25s var(--ease); }
[data-theme="dark"] .cm-panel { background: #121212; }
@keyframes panel-in { from { transform: translateX(100%); } }
.cm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; }
.cm-head h3 { margin: 0; font-size: 18px; }
.cm-head h3 span { color: var(--text-2); font-weight: 500; margin-left: 4px; }
.cm-list { flex: 1; overflow-y: auto; padding: 4px 20px 16px; overscroll-behavior: contain; }
.cm { display: flex; gap: 12px; padding: 10px 0; }
.cm .avatar { width: 40px; height: 40px; }
.cm.reply .avatar { width: 28px; height: 28px; }
.cm .body { flex: 1; min-width: 0; }
.cm .name { font-size: 14px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.cm .name .by { font-size: 12px; color: var(--accent); background: rgba(124,77,255,.14); padding: 0 6px; border-radius: 3px; font-weight: 600; }
.cm .txt { font-size: 16px; margin: 3px 0 4px; word-break: break-word; white-space: pre-wrap; }
.cm .sub { display: flex; gap: 16px; font-size: 14px; color: var(--text-3); align-items: center; }
.cm .sub button { color: var(--text-3); font-weight: 600; }
.cm .sub button:hover { color: var(--text-2); }
.cm .like { display: grid; justify-items: center; align-content: start; gap: 2px; color: var(--text-3); font-size: 13px; padding-top: 18px; width: 32px; }
.cm .like svg { width: 20px; height: 20px; }
.cm .like.on { color: var(--like); }
.cm .replies { margin-top: 4px; }
.cm .more-replies { font-size: 14px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.cm .more-replies::before { content: ""; width: 28px; height: 1px; background: var(--line); }
.cm-compose { border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.cm-compose .replying { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 0 4px 8px; }
.cm-compose form { display: flex; align-items: flex-end; gap: 8px; }
.cm-compose .box { flex: 1; display: flex; align-items: center; background: var(--chip); border-radius: 8px; padding: 0 8px 0 14px; min-height: 44px; }
.cm-compose textarea { flex: 1; background: none; border: 0; outline: 0; resize: none; font-size: 15px; padding: 11px 0; max-height: 96px; line-height: 1.4; }
.cm-compose .cnt { font-size: 12px; color: var(--text-3); padding: 0 4px; }
.cm-compose .post { font-weight: 700; color: var(--accent); padding: 0 8px; height: 44px; }
.cm-compose .post:disabled { color: var(--text-3); cursor: default; }
.cm-login { width: 100%; height: 44px; border-radius: 8px; background: rgba(124,77,255,.14); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cm-off { text-align: center; color: var(--text-3); padding: 12px; font-size: 14px; }

@media (max-width: 767px) {
  .cm-panel { top: auto; left: 0; width: 100%; height: 72dvh; border-left: 0; border-radius: 12px 12px 0 0; animation: sheet-up .25s var(--ease); z-index: 95; }
  .cm-panel .cm-head { justify-content: center; position: relative; padding: 14px; }
  .cm-panel .cm-head h3 { font-size: 15px; }
  .cm-panel .cm-head .icon-btn { position: absolute; right: 6px; top: 4px; }
  .cm-sheet-back { position: fixed; inset: 0; z-index: 94; background: rgba(0,0,0,.2); }
  .cm .txt { font-size: 15px; }
}

/* ─────────────────── 탐색·그리드 ─────────────────── */

.page { padding: 24px 32px 48px; max-width: 1640px; }
.page-top { position: sticky; top: 0; z-index: 8; background: var(--bg); padding: 20px 0 16px; margin-top: -24px; display: flex; align-items: center; gap: 12px; padding-right: 340px; }
.chips-wrap { position: relative; flex: 1; min-width: 0; }
.chips-wrap .arr { position: absolute; top: 0; height: 32px; width: 48px; display: grid; place-items: center; z-index: 1; }
.chips-wrap .arr.l { left: 0; background: linear-gradient(90deg, var(--bg) 50%, transparent); justify-content: start; }
.chips-wrap .arr.r { right: 0; background: linear-gradient(-90deg, var(--bg) 50%, transparent); justify-content: end; }
.chips-wrap .arr svg { width: 20px; height: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px 16px; }
.tile { display: grid; gap: 8px; min-width: 0; }
.tile .th { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--bg-3); display: block; }
.tile.tall .th { aspect-ratio: 9 / 16; }
.tile .th img, .tile .th video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .th video { opacity: 0; transition: opacity .2s; }
.tile .th video.ready { opacity: 1; }
.tile .th .stat { position: absolute; left: 10px; bottom: 8px; display: flex; align-items: center; gap: 4px; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.6); z-index: 1; }
.tile .th .stat svg { width: 16px; height: 16px; }
.tile .th .badge { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; display: flex; gap: 4px; align-items: center; z-index: 1; }
.tile .th .badge svg { width: 12px; height: 12px; }
.tile .th::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, rgba(0,0,0,.35)); pointer-events: none; }
.tile .who { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.tile .who .avatar { width: 20px; height: 20px; }
.tile .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.tile .row .who { font-weight: 500; }
.tile.skel-tile .th { animation: pulse 1.4s ease-in-out infinite; background: var(--skel); }
.sentinel { height: 1px; }

@media (max-width: 767px) {
  .page { padding: 0 12px 24px; }
  .page-top { padding: 4px 0 12px; margin-top: 0; padding-right: 0; top: 56px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px 8px; }
  .tile .th { aspect-ratio: 3 / 4; }
}

/* 모바일 쪽 머리 — 제목 가운데 */
.m-head { display: none; }
@media (max-width: 767px) {
  .m-head { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 4px; position: sticky; top: 0; z-index: 9; background: var(--bg); border-bottom: 1px solid var(--line); }
  .m-head h1 { font-size: 17px; margin: 0; font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-head .icon-btn { flex: none; }
  .m-head .spacer { width: 40px; }
}

/* 팔로잉(로그아웃·팔로우 없음) — 추천 계정 카드 */
.creators { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 16px; max-width: 760px; margin: 20px auto; padding: 0 16px; }
.creator { position: relative; aspect-ratio: 226 / 302; border-radius: 8px; overflow: hidden; background: var(--bg-3); display: block; }
.creator video, .creator img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.creator .in { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; display: grid; justify-items: center; gap: 4px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); text-align: center; }
.creator .avatar { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.2); }
.creator b { font-size: 17px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator small { font-size: 14px; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator .btn { width: 100%; margin-top: 8px; }
@media (max-width: 767px) {
  .creators { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 8px; margin-top: 64px; }
}

/* ─────────────────── 프로필 ─────────────────── */

.profile { padding: 32px 32px 48px 32px; max-width: 1640px; }
.pf-head { display: flex; gap: 28px; align-items: flex-start; padding-right: 320px; }
.pf-head .avatar { width: 168px; height: 168px; font-size: 64px; }
.pf-info { min-width: 0; display: grid; gap: 12px; padding-top: 8px; }
.pf-names { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pf-names h1 { margin: 0; font-size: 26px; font-weight: 800; word-break: break-all; }
.pf-names h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-2); }
.pf-stats { display: flex; gap: 20px; font-size: 16px; }
.pf-stats button, .pf-stats span { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text-2); }
.pf-stats strong { color: var(--text); font-size: 17px; }
.pf-stats button:hover strong { text-decoration: underline; }
.pf-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-btns .btn { min-width: 108px; }
.pf-btns .icon-btn { width: 40px; height: 40px; border-radius: 8px; background: var(--chip); }
.pf-btns .icon-btn svg { width: 20px; height: 20px; }
.pf-bio { font-size: 15px; white-space: pre-wrap; word-break: break-word; margin: 0; }
.pf-tabs-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 28px; border-bottom: 1px solid var(--line); gap: 12px; }
.pf-tabs-row .tabs { border-bottom: 0; }
.seg { display: flex; background: var(--chip); border-radius: 8px; padding: 3px; margin-bottom: 8px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--bg-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
[data-theme="light"] .seg button.on { background: #fff; }
.pf-grid { margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }
.pf-grid .tile .th { aspect-ratio: 3 / 4; }

@media (max-width: 767px) {
  .profile { padding: 0 0 24px; }
  .pf-head { flex-direction: column; align-items: center; padding: 16px 16px 0; gap: 12px; text-align: center; }
  .pf-head .avatar { width: 96px; height: 96px; font-size: 40px; }
  .pf-info { justify-items: center; padding-top: 0; }
  .pf-names { flex-direction: column; align-items: center; gap: 2px; }
  .pf-names h1 { font-size: 20px; }
  .pf-names h2 { font-size: 15px; }
  .pf-stats { gap: 0; }
  .pf-stats > * { flex-direction: column; align-items: center; gap: 0; padding: 0 18px; position: relative; font-size: 13px; }
  .pf-stats > * + *::before { content: ""; position: absolute; left: 0; top: 8px; height: 14px; width: 1px; background: var(--line); }
  .pf-btns .btn { min-width: 140px; }
  .pf-tabs-row { margin-top: 16px; flex-direction: column; align-items: stretch; }
  .pf-tabs-row .tabs { justify-content: space-around; }
  .pf-tabs-row .tab { min-width: 0; flex: 1; font-size: 15px; }
  .pf-tabs-row .seg { align-self: center; margin: 8px 0; }
  .pf-grid { margin-top: 2px; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .pf-grid .tile .th { border-radius: 0; }
  .pf-grid .tile .cap { display: none; }
}

/* 팔로워 목록 */
.ulist { display: grid; }
.urow { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.urow .avatar { width: 48px; height: 48px; }
.urow .t { flex: 1; min-width: 0; }
.urow .t b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .t small { display: block; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .btn { min-width: 96px; }

/* ─────────────────── 영상 상세 (PC) ─────────────────── */

.detail { position: fixed; inset: 0; z-index: 50; display: flex; background: var(--bg); }
.dt-stage { flex: 1; position: relative; overflow: hidden; background: #000; display: grid; place-items: center; }
.dt-stage .bg-blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.35); }
.dt-stage video { position: relative; height: 100%; max-width: 100%; object-fit: contain; }
.dt-stage .tap { position: absolute; inset: 0; z-index: 1; }
.dt-stage .ctl { position: absolute; z-index: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(84,84,84,.5); color: #fff; }
.dt-stage .ctl:hover { background: rgba(84,84,84,.8); }
.dt-close { left: 20px; top: 20px; }
.dt-more { right: 20px; top: 20px; }
.dt-up { right: 20px; top: calc(50% - 52px); }
.dt-down { right: 20px; top: calc(50% + 12px); }
.dt-vol { right: 20px; bottom: 20px; }
.dt-search { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: min(50%, 480px); height: 44px; z-index: 3; display: flex; align-items: center; background: rgba(84,84,84,.5); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 0 6px 0 16px; color: #fff; }
.dt-search input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font-size: 16px; min-width: 0; }
.dt-search input::placeholder { color: rgba(255,255,255,.6); }
.dt-search button { width: 36px; height: 36px; display: grid; place-items: center; color: rgba(255,255,255,.7); border-left: 1px solid rgba(255,255,255,.2); padding-left: 6px; }
.dt-stage .big-play { position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; color: rgba(255,255,255,.85); z-index: 2; pointer-events: none; }
.dt-stage .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 3; display: flex; align-items: flex-end; cursor: pointer; }
.dt-stage .prog i { display: block; height: 3px; width: 100%; background: rgba(255,255,255,.25); position: relative; }
.dt-stage .prog i b { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; }
.dt-stage .prog:hover i { height: 5px; }
.dt-stage .time { position: absolute; left: 20px; bottom: 22px; z-index: 3; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }

.dt-side { width: 544px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); min-height: 0; }
.dt-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.dt-top { padding: 24px 20px 0; }
.dt-card { background: var(--bg-3); border-radius: 12px; padding: 16px; }
[data-theme="dark"] .dt-card { background: rgba(255,255,255,.06); }
.dt-author { display: flex; align-items: center; gap: 12px; }
.dt-author .avatar { width: 40px; height: 40px; }
.dt-author .t { flex: 1; min-width: 0; }
.dt-author b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-author small { color: var(--text-2); font-size: 14px; }
.dt-cap { margin: 12px 0 0; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.dt-snd { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 14px; }
.dt-snd svg { width: 16px; height: 16px; }
.dt-acts { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px 12px; gap: 8px; }
.dt-acts .l { display: flex; gap: 20px; }
.dt-acts .l button { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.dt-acts .l .ic { width: 32px; height: 32px; border-radius: 50%; background: var(--rail-btn); display: grid; place-items: center; color: var(--text); }
.dt-acts .l .ic svg { width: 18px; height: 18px; }
.dt-acts .l .on-like .ic { color: var(--like); }
.dt-acts .l .on-save .ic { color: #fcc419; }
.dt-acts .r { display: flex; gap: 6px; }
.dt-acts .r button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.dt-acts .r svg { width: 15px; height: 15px; }
.dt-link { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--chip); margin: 0 4px; }
.dt-link span { flex: 1; padding: 0 12px; font-size: 14px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dt-link button { height: 36px; padding: 0 14px; font-weight: 700; font-size: 14px; }
.dt-link button:hover { background: var(--bg-hover); }
.dt-tabs { position: sticky; top: 0; background: var(--bg); z-index: 2; margin-top: 16px; }
.dt-tabs .tab { flex: 1; font-size: 15px; }
.dt-side .cm-list { overflow: visible; padding: 8px 24px; }
.dt-side .grid { padding: 16px 20px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dt-side .tile .th { aspect-ratio: 3 / 4; }
.dt-side .tile.now .th { outline: 3px solid var(--accent); outline-offset: -3px; }
.dt-side .tile.now .th::before { content: "지금 재생 중"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.5); font-size: 13px; font-weight: 700; z-index: 2; }
@media (max-width: 1100px) { .dt-side { width: 420px; } }

/* ─────────────────── 업로드 ─────────────────── */

.upload { padding: 24px 32px 48px; max-width: 1180px; margin: 0 auto; }
.upload h1 { font-size: 24px; margin: 0 0 4px; }
.upload .lead { color: var(--text-2); margin: 0 0 20px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; background: var(--bg-2); min-height: 460px; display: grid; place-items: center; text-align: center; padding: 32px; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(124,77,255,.06); }
.drop .in { display: grid; justify-items: center; gap: 12px; }
.drop svg.big { width: 64px; height: 64px; color: var(--text-3); }
.drop h2 { margin: 4px 0 0; font-size: 20px; }
.drop p { margin: 0; color: var(--text-2); }
.drop .specs { display: grid; grid-template-columns: repeat(2, auto); gap: 12px 40px; margin-top: 24px; text-align: left; font-size: 13px; color: var(--text-2); }
.drop .specs b { display: block; color: var(--text); font-size: 14px; }
.up-file { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px; background: var(--bg-2); margin-bottom: 20px; }
.up-file .t { flex: 1; min-width: 0; }
.up-file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-file small { color: var(--text-2); }
.up-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 8px; }
.up-bar b { display: block; height: 100%; background: var(--accent-2); width: 0; transition: width .2s; }
.up-main { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.up-form { background: var(--bg-2); border-radius: 12px; padding: 8px 24px; }
.up-form h3 { margin: 16px 0 0; font-size: 17px; }
.cap-box { position: relative; background: var(--chip); border-radius: 8px; }
.cap-box textarea { width: 100%; min-height: 120px; background: none; border: 0; outline: 0; resize: vertical; padding: 12px 12px 36px; font-size: 15px; }
.cap-box .tools { position: absolute; left: 8px; right: 12px; bottom: 6px; display: flex; align-items: center; gap: 4px; }
.cap-box .tools button { height: 28px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cap-box .tools button:hover { background: var(--bg-hover); }
.cap-box .tools svg { width: 16px; height: 16px; }
.cap-box .tools .cnt { margin-left: auto; font-size: 12px; color: var(--text-3); }
.covers { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.covers button { flex: none; width: 76px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: var(--bg-3); }
.covers button.on { border-color: var(--accent); }
.covers img { width: 100%; height: 100%; object-fit: cover; display: block; }
.radios { display: grid; gap: 4px; }
.radios label { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.radios input { accent-color: var(--accent); width: 18px; height: 18px; }
.radios small { color: var(--text-3); margin-left: 4px; }
.sel { height: 40px; border-radius: 6px; background: var(--chip); border: 0; padding: 0 12px; outline: 0; width: 100%; }
.sel option { background: var(--bg-2); color: var(--text); }
.tog-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.up-actions { display: flex; gap: 12px; padding: 20px 0; }
.up-actions .btn { min-width: 160px; }
.phone { position: sticky; top: 24px; width: 300px; aspect-ratio: 9 / 18.5; border-radius: 36px; background: #000; padding: 10px; box-shadow: 0 0 0 2px #333, var(--shadow); }
.phone .scr { position: relative; width: 100%; height: 100%; border-radius: 28px; overflow: hidden; background: #111; }
.phone video { width: 100%; height: 100%; object-fit: contain; }
.phone .pv-top { position: absolute; top: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; font-weight: 600; z-index: 1; }
.phone .pv-top span { opacity: .6; margin-right: 12px; }
.phone .pv-meta { position: absolute; left: 12px; right: 56px; bottom: 16px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.phone .pv-meta b { display: block; font-size: 13px; margin-bottom: 2px; }
.phone .pv-meta p { margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.phone .pv-rail { position: absolute; right: 8px; bottom: 24px; display: grid; gap: 14px; justify-items: center; color: #fff; }
.phone .pv-rail svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.phone .pv-rail .avatar { width: 34px; height: 34px; border: 1px solid #fff; }
@media (max-width: 900px) {
  .up-main { grid-template-columns: 1fr; }
  .phone { display: none; }
}
@media (max-width: 767px) {
  .upload { padding: 0 0 24px; }
  .upload .in-pad { padding: 16px; }
  .drop { min-height: 320px; margin: 16px; }
  .drop .specs { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .up-form { border-radius: 0; padding: 0 16px; background: none; }
  .up-actions { padding: 16px; position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .up-actions .btn { flex: 1; min-width: 0; }
  .up-file { margin: 16px; }
}

/* ─────────────────── 검색 결과 ─────────────────── */

.search-page { padding: 20px 32px 48px; max-width: 1240px; }
.search-page .tabs { margin-bottom: 20px; padding-right: 320px; }
.search-page .tab { min-width: 0; padding: 0 28px; }
.search-page h3 { font-size: 18px; margin: 8px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.search-page h3 button { font-size: 15px; color: var(--text-2); font-weight: 600; }
.s-users { display: grid; gap: 4px; margin-bottom: 24px; }
.s-user { display: flex; align-items: center; gap: 16px; padding: 10px 8px; border-radius: 8px; }
.s-user:hover { background: var(--bg-hover); }
.s-user .avatar { width: 60px; height: 60px; }
.s-user .t { flex: 1; min-width: 0; }
.s-user .t b { font-size: 18px; display: block; }
.s-user .t small { color: var(--text-2); display: block; font-size: 14px; }
.s-user .t p { margin: 2px 0 0; font-size: 14px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-page .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.search-page .tile .th { aspect-ratio: 3 / 4; }
.m-search-bar { display: none; }
@media (max-width: 767px) {
  .search-page { padding: 0 12px 24px; }
  .search-page .tabs { padding-right: 0; overflow-x: auto; scrollbar-width: none; }
  .search-page .tab { padding: 0 16px; font-size: 15px; }
  .m-search-bar { display: flex; align-items: center; gap: 8px; height: 56px; position: sticky; top: 0; z-index: 9; background: var(--bg); }
  .m-search-bar form { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; background: var(--chip); border-radius: 8px; padding: 0 12px; }
  .m-search-bar form svg { width: 18px; height: 18px; color: var(--text-3); }
  .m-search-bar input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; min-width: 0; }
  .m-search-bar .go { font-weight: 700; color: var(--accent); padding: 0 6px; }
  .search-page .grid { grid-template-columns: repeat(2, 1fr); gap: 12px 8px; }
  .s-user .avatar { width: 52px; height: 52px; }
}

/* ─────────────────── 알림 ─────────────────── */

.inbox-pop { position: fixed; top: 64px; right: 24px; width: 376px; max-height: min(640px, calc(100vh - 88px)); z-index: 60; background: var(--bg-2); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; animation: pop .15s var(--ease); }
[data-theme="light"] .inbox-pop { background: #fff; }
.inbox-pop h3 { margin: 0; padding: 20px 20px 8px; font-size: 22px; }
.inbox-pop .chips { padding: 8px 20px 12px; gap: 8px; }
.inbox-pop .chip { font-size: 14px; height: 30px; }
.nt-list { overflow-y: auto; flex: 1; padding: 0 8px 12px; }
.nt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; }
.nt:hover { background: var(--bg-hover); }
.nt .avatar { width: 48px; height: 48px; }
.nt .t { flex: 1; min-width: 0; font-size: 15px; }
.nt .t b { font-weight: 700; }
.nt .t p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt .t time { color: var(--text-3); font-size: 13px; }
.nt .thumb { width: 44px; height: 58px; border-radius: 4px; object-fit: cover; background: var(--bg-3); flex: none; }
.nt.unread { background: rgba(124,77,255,.06); }
.nt-group { font-size: 14px; color: var(--text-2); font-weight: 600; padding: 12px 12px 4px; }
.inbox-page { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.inbox-page h1 { margin: 0 0 12px; font-size: 24px; }
.inbox-page .chips { margin-bottom: 8px; }
.inbox-page .nt-list { padding: 0; }
@media (max-width: 767px) {
  .inbox-page { padding: 0 8px 24px; }
  .inbox-page h1 { display: none; }
  .inbox-page .chips { padding: 12px 8px 4px; }
}

/* ─────────────────── 라이브·설정·관리·기타 ─────────────────── */

.live-page { padding: 24px 32px 48px; }
.live-page .chips { margin-bottom: 16px; }
.live-box { border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); height: min(510px, 60vh); display: grid; place-items: center; text-align: center; }
.live-box h3 { margin: 0 0 8px; font-size: 24px; }
.live-box p { margin: 0 0 24px; color: var(--text-2); }
@media (max-width: 767px) {
  .live-page { padding: 64px 12px 24px; }
}

.settings { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.settings h1 { margin: 0 0 20px; font-size: 26px; }
.set-sec { background: var(--bg-2); border-radius: 12px; padding: 4px 20px; margin-bottom: 20px; }
.set-sec h2 { font-size: 15px; color: var(--text-2); margin: 16px 0 4px; font-weight: 600; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-size: 16px; }
.set-row:last-child { border-bottom: 0; }
.set-row small { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.set-row.danger { color: #ff4d62; }
@media (max-width: 767px) {
  .settings { padding: 0 12px 24px; }
  .settings h1 { display: none; }
  .set-sec { margin-top: 12px; }
}

.admin { max-width: 1000px; margin: 0 auto; padding: 32px 24px 64px; }
.admin h1 { margin: 0 0 16px; }
.rep { display: flex; gap: 16px; padding: 16px; border-radius: 12px; background: var(--bg-2); margin-bottom: 12px; align-items: flex-start; }
.rep img { width: 64px; height: 86px; object-fit: cover; border-radius: 6px; background: var(--bg-3); flex: none; }
.rep .t { flex: 1; min-width: 0; }
.rep .t p { margin: 4px 0; word-break: break-word; }
.rep .t small { color: var(--text-2); }
.rep .acts { display: flex; flex-direction: column; gap: 6px; }
.tag-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--chip); margin-right: 6px; }

.tag-head { display: flex; gap: 24px; align-items: center; padding: 32px 32px 8px; }
.tag-head .ic { width: 116px; height: 116px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.tag-head .ic svg { width: 56px; height: 56px; }
.tag-head h1 { margin: 0; font-size: 30px; }
.tag-head p { margin: 4px 0 0; color: var(--text-2); }
@media (max-width: 767px) {
  .tag-head { padding: 16px; gap: 16px; }
  .tag-head .ic { width: 72px; height: 72px; }
  .tag-head .ic svg { width: 36px; height: 36px; }
  .tag-head h1 { font-size: 22px; }
}

.not-found { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { font-size: 88px; margin: 0; font-family: "Arial Black", var(--font); background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found p { color: var(--text-2); margin: 8px 0 24px; font-size: 18px; }

@media (max-width: 767px) {
  .pc-only { display: none !important; }
  .app.feed-mode .view { background: #000; color: #fff; }
}

/* 모바일 상세 — 뒤로 단추 */
.m-back { position: fixed; left: 8px; top: calc(8px + env(safe-area-inset-top)); z-index: 55; color: #fff; }
.m-back svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
