/* ==========================================================================
   TikTok 테마 — tt.css
   · 라이트/다크 변수(body.dark — DX 다크모드 엔진이 붙여 주는 클래스)
   · 그림자(box-shadow / text-shadow / drop-shadow) 사용 안 함 — 테두리와 면 색으로만 구분
   ========================================================================== */
:root {
  --tt-p: #fe2c55;
  --tt-c: #25f4ee;
  --bg: #ffffff;
  --bg2: #f1f1f2;
  --bg3: #e6e6e8;
  --fg: #161823;
  --fg2: #6d6e75;
  --line: rgba(22, 24, 35, .12);
  --veil: rgba(0, 0, 0, .5);
  --side-w: 244px;
  --tabs-h: 54px;
  --ok: #1fa971;
  --warn: #e8a100;
}
body.dark {
  --bg: #121212;
  --bg2: #262626;
  --bg3: #333333;
  --fg: #ffffff;
  --fg2: #a3a3a8;
  --line: rgba(255, 255, 255, .14);
  --veil: rgba(0, 0, 0, .7);
}
*, *::before, *::after { box-sizing: border-box; box-shadow: none !important; text-shadow: none !important; }
html, body { margin: 0; height: 100%; }
body.tt-body {
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
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; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.f { fill: currentColor; stroke: none; }
.tt-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── 레이아웃 ─────────────────────────────────────────────── */
.tt-app { display: flex; height: 100vh; height: 100dvh; width: 100%; }
.tt-side {
  width: var(--side-w); flex: none; height: 100%; overflow-y: auto; padding: 16px 12px 12px;
  border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 6px;
}
.tt-main { flex: 1; min-width: 0; height: 100%; position: relative; overflow: hidden; background: var(--bg); }
.tt-view { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.tt-legacy { position: absolute; inset: 0; overflow-y: auto; padding: 24px; background: var(--bg); color: var(--fg); }
.tt-tabs { display: none; }

.tt-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.tt-logo-mark { width: 34px; height: 34px; border-radius: 10px; background: #000; color: #fff; display: grid; place-items: center; font-size: 18px; border: 2px solid var(--tt-c); border-right-color: var(--tt-p); border-bottom-color: var(--tt-p); }
.tt-search-btn { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 22px; background: var(--bg2); color: var(--fg2); font-size: 15px; margin-bottom: 6px; }
.tt-nav { display: flex; flex-direction: column; gap: 2px; }
.tt-nav-i { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 17px; font-weight: 700; width: 100%; text-align: left; }
.tt-nav-i .ic { font-size: 26px; }
.tt-nav-i:hover { background: var(--bg2); }
.tt-nav-i.on { color: var(--tt-p); }
.tt-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tt-p); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-style: normal; }
.tt-nav-i .tt-badge { position: absolute; left: 30px; top: 3px; }
.tt-side-hint { color: var(--fg2); font-size: 13px; margin: 6px 4px 10px; }
.tt-side-auth { padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.tt-side-auth:empty { display: none; }
.tt-side-me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.tt-side-me:hover { background: var(--bg2); }
.tt-side-me b { display: block; font-size: 14px; line-height: 1.2; }
.tt-side-me small { color: var(--fg2); font-size: 12px; }
.tt-side-suggest { margin-top: 4px; }
.tt-side-suggest h4 { margin: 10px 8px 6px; font-size: 13px; color: var(--fg2); font-weight: 600; }
.tt-sg { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.tt-sg:hover { background: var(--bg2); }
.tt-sg-t { min-width: 0; flex: 1; }
.tt-sg-t b { display: flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-sg-t small { display: block; color: var(--fg2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-side-foot { margin-top: auto; padding: 14px 8px 0; color: var(--fg2); font-size: 12px; }
.tt-side-foot p { margin: 0 0 6px; }
.tt-side-links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tt-side-links a:hover { text-decoration: underline; }

/* ── 버튼 · 폼 ────────────────────────────────────────────── */
.tt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: 15px; white-space: nowrap; }
.tt-btn:hover { background: var(--bg2); }
.tt-btn-p { background: var(--tt-p); border-color: var(--tt-p); color: #fff; }
.tt-btn-p:hover { background: var(--tt-p); filter: brightness(.92); }
.tt-btn-s { min-height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.tt-btn-block { width: 100%; }
.tt-btn-danger { color: var(--tt-p); }
.tt-btn[disabled] { opacity: .5; pointer-events: none; }
.tt-field { display: block; margin: 0 0 14px; }
.tt-field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.tt-field > small { display: block; margin-top: 4px; color: var(--fg2); font-size: 12px; }
.tt-in { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); outline: 0; }
.tt-in:focus { border-color: var(--fg2); }
textarea.tt-in { resize: vertical; min-height: 80px; }
.tt-row { display: flex; align-items: center; gap: 10px; }
.tt-row.sp { justify-content: space-between; }
.tt-sw { position: relative; width: 44px; height: 26px; flex: none; }
.tt-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.tt-sw i { position: absolute; inset: 0; border-radius: 13px; background: var(--bg3); transition: background .15s; }
.tt-sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tt-sw input:checked + i { background: var(--tt-p); }
.tt-sw input:checked + i::after { transform: translateX(18px); }
.tt-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tt-seg button { padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--fg2); }
.tt-seg button.on { background: var(--fg); color: var(--bg); }

.tt-av { width: 40px; height: 40px; border-radius: 50%; background: var(--bg3) center/cover no-repeat; flex: none; overflow: hidden; display: grid; place-items: center; color: var(--fg2); font-weight: 700; }
.tt-av.s { width: 32px; height: 32px; font-size: 13px; }
.tt-av.l { width: 96px; height: 96px; font-size: 32px; }
.tt-av.xl { width: 116px; height: 116px; font-size: 40px; }
.tt-av img { width: 100%; height: 100%; object-fit: cover; }
.tt-vf { color: #20d5ec; font-size: 14px; flex: none; }
.tt-vf .ic { fill: currentColor; stroke: none; }

.tt-empty { text-align: center; padding: 64px 24px; color: var(--fg2); }
.tt-empty .ic { font-size: 54px; opacity: .5; margin-bottom: 10px; }
.tt-empty-title { margin: 0 0 8px; font-size: 20px; color: var(--fg); }
.tt-empty-text { margin: 0 0 18px; font-size: 14px; }
.tt-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bg3); border-top-color: var(--tt-p); animation: ttspin .8s linear infinite; margin: 24px auto; }
@keyframes ttspin { to { transform: rotate(360deg); } }
.tt-more { text-align: center; padding: 16px; }

/* ── 토스트 · 모달 · 시트 ─────────────────────────────────── */
.tt-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.tt-toast div { background: #222; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; max-width: 86vw; border: 1px solid rgba(255,255,255,.2); animation: ttfade .2s ease; }
.tt-toast div.err { background: #5b1020; }
@keyframes ttfade { from { opacity: 0; transform: translateY(8px); } }
.tt-layer { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.tt-layer > * { pointer-events: auto; }
.tt-bg { position: absolute; inset: 0; background: var(--veil); display: grid; place-items: center; padding: 16px; }
.tt-modal { width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 14px; border: 1px solid var(--line); padding: 22px; position: relative; }
.tt-modal h3 { margin: 0 0 14px; font-size: 20px; text-align: center; }
.tt-modal .x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); font-size: 16px; }
.tt-modal p { margin: 0 0 14px; color: var(--fg2); font-size: 14px; }
.tt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.tt-actions .tt-btn { flex: 1; }
.tt-menu { position: absolute; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 210px; max-height: 70vh; overflow-y: auto; }
.tt-menu a, .tt-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; text-align: left; }
.tt-menu a:hover, .tt-menu button:hover { background: var(--bg2); }
.tt-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.tt-menu .ic { font-size: 18px; }
.tt-menu .danger { color: var(--tt-p); }
.tt-or { text-align: center; color: var(--fg2); font-size: 13px; margin: 12px 0; }
.tt-soc { display: flex; flex-direction: column; gap: 8px; }
.tt-soc a { display: block; text-align: center; padding: 10px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.tt-err { color: var(--tt-p); font-size: 13px; min-height: 18px; margin: -4px 0 8px; }
.tt-links { display: flex; justify-content: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--fg2); }
.tt-links a { color: var(--tt-p); font-weight: 700; }

/* ── 피드 ─────────────────────────────────────────────────── */
.tt-view.is-feed { overflow: hidden; background: var(--bg); }
.ff { position: absolute; inset: 0; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.ff::-webkit-scrollbar { display: none; }
.fi-cap { white-space: pre-line; }
.fi { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; display: flex; align-items: center; justify-content: center; padding: 12px 0; }
.fi-card { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; }
.fi-media { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: #000; }
.fi-media video, .fi-media .fi-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.fi-media.cover video, .fi-media.cover .fi-poster { object-fit: cover; }
.fi-media video { opacity: 0; transition: opacity .15s; }
.fi.ready .fi-media video { opacity: 1; }
.fi-media::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 90px; background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,0)); z-index: 1; pointer-events: none; }
.fi-grad { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0)); pointer-events: none; }
.fi-info { position: absolute; left: 14px; right: 74px; bottom: 16px; color: #fff; z-index: 2; }
.fi-user { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 17px; max-width: 100%; }
.fi-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-user:hover b { text-decoration: underline; }
.fi-cap { margin: 6px 0 0; font-size: 15px; line-height: 1.4; max-height: 4.2em; overflow: hidden; word-break: break-word; }
.fi-cap.open { max-height: 40vh; overflow-y: auto; }
.fi-cap a { font-weight: 700; }
.fi-cap a:hover { text-decoration: underline; }
.fi-more { font-weight: 700; margin-left: 6px; opacity: .85; }
.fi-pend { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.4); font-size: 12px; }
.fi-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; font-size: 34px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 3; }
.fi.paused .fi-play { opacity: 1; }
.fi-heart { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; color: var(--tt-p); font-size: 110px; pointer-events: none; z-index: 4; animation: ttheart .8s ease-out forwards; }
.fi-heart .ic { width: 1em; height: 1em; fill: currentColor; stroke: none; }
@keyframes ttheart { 0% { transform: scale(.3); opacity: 0; } 20% { transform: scale(1.1); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.2) translateY(-20px); opacity: 0; } }
.fi-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); z-index: 5; cursor: pointer; transition: height .1s; }
.fi-prog:hover, .fi-prog.drag { height: 8px; }
.fi-prog i { display: block; height: 100%; width: 0; background: #fff; }
.fi-mute { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; display: grid; place-items: center; font-size: 20px; z-index: 5; }
.fi-back { position: absolute; left: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; display: grid; place-items: center; font-size: 20px; z-index: 6; }
.fi-err { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; background: rgba(0,0,0,.6); z-index: 3; text-align: center; padding: 20px; }

.fi-rail { position: absolute; left: calc(100% + 14px); bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 6; }
.rb { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.rb > i { width: 48px; height: 48px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-size: 24px; font-style: normal; transition: transform .1s; }
.rb:active > i { transform: scale(.9); }
.rb.on > i { color: var(--tt-p); }
.rb.on.fav > i { color: #ffb400; }
.rb.on .ic { fill: currentColor; }
.rb-av { position: relative; margin-bottom: 8px; }
.rb-av .tt-av { width: 48px; height: 48px; }
.rb-av .fol { position: absolute; left: 50%; bottom: -10px; margin-left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--tt-p); color: #fff; display: grid; place-items: center; font-size: 13px; border: 0; }
.rb-av .fol.done { display: none; }

.ff-tabs { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; justify-content: center; align-items: center; gap: 22px; z-index: 20; pointer-events: none; }
.ff-tabs a { pointer-events: auto; font-size: 17px; font-weight: 700; color: rgba(255,255,255,.7); padding: 6px 2px; border-bottom: 2px solid transparent; }
.ff-tabs a.on { color: #fff; border-bottom-color: #fff; }
.ff-nav { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; z-index: 20; }
.ff-nav button { width: 44px; height: 44px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-size: 20px; }
.ff-nav button[disabled] { opacity: .35; pointer-events: none; }
.ff-empty { position: absolute; inset: 0; display: grid; place-items: center; }

/* ── 댓글 패널 ────────────────────────────────────────────── */
.cm { position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100%; background: var(--bg); border-left: 1px solid var(--line); z-index: 60; display: flex; flex-direction: column; transform: translateX(0); animation: ttslide .2s ease; }
@keyframes ttslide { from { transform: translateX(40px); opacity: 0; } }
@keyframes ttup { from { transform: translateY(40px); opacity: 0; } }
.cm-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 16px; }
.cm-h .x { width: 32px; height: 32px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; }
.cm-sort { display: flex; gap: 6px; padding: 8px 16px 0; }
.cm-sort button { padding: 4px 12px; border-radius: 14px; background: var(--bg2); font-size: 13px; font-weight: 600; color: var(--fg2); }
.cm-sort button.on { background: var(--fg); color: var(--bg); }
.cm-list { flex: 1; overflow-y: auto; padding: 8px 16px; overscroll-behavior: contain; }
.cmi { display: flex; gap: 10px; padding: 8px 0; }
.cmi-b { flex: 1; min-width: 0; }
.cmi-n { font-size: 13px; font-weight: 700; color: var(--fg2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmi-n .own { background: var(--tt-p); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 3px; font-weight: 600; }
.cmi-t { margin: 2px 0 4px; word-break: break-word; white-space: pre-wrap; font-size: 15px; }
.cmi-t a { color: var(--tt-p); font-weight: 600; }
.cmi-m { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--fg2); }
.cmi-m button { font-weight: 700; color: var(--fg2); }
.cmi-m button:hover { color: var(--fg); }
.cmi-lk { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--fg2); padding-top: 4px; }
.cmi-lk .ic { font-size: 18px; }
.cmi-lk.on { color: var(--tt-p); }
.cmi-lk.on .ic { fill: currentColor; }
.cmi-rp { margin-left: 42px; }
.cmi-rp .tt-av { width: 28px; height: 28px; font-size: 11px; }
.cm-viewrep { margin: 2px 0 6px 42px; font-size: 13px; font-weight: 700; color: var(--fg2); }
.cm-f { border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.cm-f .rt { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg2); margin-bottom: 6px; }
.cm-f form { display: flex; gap: 8px; align-items: flex-end; }
.cm-f textarea { flex: 1; min-height: 40px; max-height: 110px; padding: 10px 14px; border-radius: 20px; border: 0; background: var(--bg2); resize: none; outline: 0; }
.cm-f button { font-weight: 800; color: var(--tt-p); padding: 10px 6px; }
.cm-f button[disabled] { opacity: .4; }
.cm-off { padding: 14px; text-align: center; color: var(--fg2); font-size: 14px; }

/* ── 페이지 공통 ──────────────────────────────────────────── */
.pg { max-width: 1020px; margin: 0 auto; padding: 28px 24px 60px; }
.pg.narrow { max-width: 640px; }
.pg h1 { margin: 0 0 16px; font-size: 24px; letter-spacing: -.02em; }
.pg h2 { margin: 26px 0 12px; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 18px; background: var(--bg2); font-weight: 700; font-size: 14px; }
.chip:hover { background: var(--bg3); }
.chip small { color: var(--fg2); font-weight: 500; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { flex: none; display: flex; align-items: center; gap: 6px; padding: 12px 20px; font-weight: 700; font-size: 16px; color: var(--fg2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .on { color: var(--fg); border-bottom-color: var(--fg); }
.vg { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vg-i { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--bg2); }
.vg-i img { width: 100%; height: 100%; object-fit: cover; }
.vg-i .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--fg2); font-size: 34px; }
.vg-i .vw { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.vg-i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); pointer-events: none; }
.vg-i .vw, .vg-i .tg { z-index: 2; }
.vg-i .tg { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.vg-i .tg.r { background: var(--tt-p); }
.vg-i .vc { position: absolute; left: 8px; right: 8px; bottom: 26px; z-index: 2; color: #fff; font-size: 13px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.vg-i .ed { position: absolute; right: 6px; top: 6px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 15px; }
.ur { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ur-t { flex: 1; min-width: 0; }
.ur-t b { display: flex; align-items: center; gap: 4px; font-size: 16px; }
.ur-t small { display: block; color: var(--fg2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ph-head { display: flex; gap: 28px; align-items: center; margin-bottom: 18px; }
.ph-info h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ph-info h2 { margin: 2px 0 12px; font-size: 17px; font-weight: 600; }
.ph-act { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ph-act .tt-btn { min-width: 120px; }
.ph-stats { display: flex; gap: 18px; margin-bottom: 10px; font-size: 16px; }
.ph-stats button { font-size: 16px; }
.ph-stats b { font-size: 17px; margin-right: 4px; }
.ph-stats span { color: var(--fg2); }
.ph-bio { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ph-bio a { font-weight: 700; }
.lock-note { text-align: center; padding: 50px 20px; color: var(--fg2); }
.lock-note .ic { font-size: 44px; }

.sr-top { position: sticky; top: 0; background: var(--bg); z-index: 5; padding: 14px 24px 0; border-bottom: 1px solid var(--line); }
.sr-form { position: relative; max-width: 640px; margin: 0 auto 10px; }
.sr-form input { width: 100%; padding: 12px 44px 12px 44px; border-radius: 24px; border: 0; background: var(--bg2); outline: 0; font-size: 16px; }
.sr-form .ic { position: absolute; left: 15px; top: 13px; font-size: 20px; color: var(--fg2); }
.sr-sug { position: absolute; left: 0; right: 0; top: 50px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 10; }
.sr-sug a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 600; }
.sr-sug a:hover { background: var(--bg2); }

.set-sec { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.set-sec h3 { margin: 0 0 12px; font-size: 16px; }
.set-av { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

/* 업로드 */
.up-grid { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.up-drop { border: 2px dashed var(--line); border-radius: 14px; aspect-ratio: 9 / 16; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; cursor: pointer; color: var(--fg2); position: relative; overflow: hidden; background: var(--bg2); }
.up-drop.over { border-color: var(--tt-p); }
.up-drop .ic { font-size: 48px; margin-bottom: 8px; }
.up-drop b { color: var(--fg); font-size: 17px; }
.up-drop small { margin-top: 8px; font-size: 12px; }
.up-drop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.up-bar { height: 8px; border-radius: 4px; background: var(--bg3); overflow: hidden; margin: 8px 0 4px; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--tt-p); transition: width .15s; }
.up-msg { font-size: 13px; color: var(--fg2); }
.up-done { text-align: center; padding: 40px 20px; }
.up-done .ic { font-size: 56px; color: var(--ok); }

/* 받은 편지함 */
.ib { display: flex; height: 100%; }
.ib-l { width: 360px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ib-l .tabs { margin: 0; padding: 0 8px; }
.ib-l .tabs button { flex: 1; justify-content: center; padding: 14px 8px; }
.ib-list { flex: 1; overflow-y: auto; }
.ib-r { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ib-i { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; }
.ib-i:hover, .ib-i.on { background: var(--bg2); }
.ib-i .t { flex: 1; min-width: 0; font-size: 14px; }
.ib-i .t b { font-size: 15px; }
.ib-i .t small { display: block; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-i.unread .t small { color: var(--fg); font-weight: 700; }
.ib-i .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tt-p); flex: none; }
.ib-i .th { width: 44px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--bg3); flex: none; }
.ib-i .ago { color: var(--fg2); font-size: 12px; margin-left: 4px; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-h .bk { display: none; font-size: 22px; }
.chat-m { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 76%; padding: 9px 13px; border-radius: 16px; background: var(--bg2); word-break: break-word; white-space: pre-wrap; align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--tt-p); color: #fff; }
.msg small { display: block; font-size: 11px; opacity: .65; margin-top: 2px; }
.msg-v { display: block; width: 150px; border-radius: 10px; overflow: hidden; background: #000; margin: -3px -6px 6px; }
.msg-v img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.chat-f { padding: 10px 14px; border-top: 1px solid var(--line); }
.chat-f form { display: flex; gap: 8px; }
.chat-f input { flex: 1; padding: 11px 16px; border-radius: 22px; border: 0; background: var(--bg2); outline: 0; }
.chat-off { padding: 14px; text-align: center; color: var(--fg2); font-size: 14px; }
.ib-empty { flex: 1; display: grid; place-items: center; color: var(--fg2); text-align: center; }
.ib-empty .ic { font-size: 54px; opacity: .5; }

/* 관리자 */
.ad { display: flex; height: 100%; }
.ad-nav { width: 200px; flex: none; border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.ad-nav h3 { margin: 4px 10px 12px; font-size: 16px; }
.ad-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.ad-nav a:hover { background: var(--bg2); }
.ad-nav a.on { background: var(--fg); color: var(--bg); }
.ad-nav a .tt-badge { margin-left: auto; }
.ad-main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px; }
.ad-main h1 { margin: 0 0 18px; font-size: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card small { color: var(--fg2); font-size: 13px; }
.card b { display: block; font-size: 26px; letter-spacing: -.02em; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 10px 0 0; border-bottom: 1px solid var(--line); }
.chart div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 11px; color: var(--fg2); }
.chart i { display: block; width: 100%; background: var(--tt-p); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart-x { display: flex; gap: 6px; font-size: 10px; color: var(--fg2); }
.chart-x span { flex: 1; text-align: center; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--fg2); font-weight: 600; font-size: 12px; }
.tbl .th { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg3); }
.tbl .cap { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--bg2); }
.st.ok { background: rgba(31,169,113,.15); color: var(--ok); }
.st.w { background: rgba(232,161,0,.18); color: var(--warn); }
.st.d { background: rgba(254,44,85,.15); color: var(--tt-p); }
.tbl-wrap { overflow-x: auto; }
.tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tools .tt-in { max-width: 260px; }
.sys { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 20px; font-size: 14px; }
.sys div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.sys span { color: var(--fg2); }

/* ── 반응형 ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --side-w: 76px; }
  .tt-side { align-items: center; padding: 14px 8px; }
  .tt-logo-text, .tt-nav-i span, .tt-search-btn span, .tt-side-hint, .tt-side-suggest, .tt-side-foot, .tt-side-me div { display: none; }
  .tt-logo { padding: 4px 0 12px; }
  .tt-search-btn { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
  .tt-nav-i { justify-content: center; padding: 11px 0; width: 52px; }
  .tt-nav-i .tt-badge { left: 28px; }
  .tt-side-auth .tt-btn { padding: 0; width: 48px; min-height: 48px; border-radius: 50%; font-size: 0; }
  .tt-side-auth .tt-btn .ic { font-size: 22px; }
  .ff-nav { right: 8px; }
}
@media (max-width: 860px) {
  .up-grid { grid-template-columns: 1fr; }
  .up-drop { aspect-ratio: auto; min-height: 220px; max-width: 320px; margin: 0 auto; }
  .ib-l { width: 100%; border-right: 0; }
  .ib-r { position: absolute; inset: 0; background: var(--bg); z-index: 3; }
  .ib.no-chat .ib-r { display: none; }
  .ib.chat .ib-l { display: none; }
  .chat-h .bk { display: block; }
  .ad { flex-direction: column; }
  .ad-nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .ad-nav h3 { display: none; }
  .ad-nav a { flex: none; padding: 8px 12px; }
}
@media (max-width: 760px) {
  .tt-side { display: none; }
  .tt-app { display: block; }
  .tt-main { height: 100%; }
  .tt-view, .tt-legacy { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
  .tt-view.is-feed { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
  body.tt-body[data-route="video"] .tt-view, body.tt-body[data-route="video"] .tt-main { bottom: 0; }
  .tt-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .tt-tabs a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--fg2); }
  .tt-tabs a .ic { font-size: 24px; }
  .tt-tabs a.on { color: var(--fg); }
  .tt-tabs .tt-tab-plus i { width: 46px; height: 32px; border-radius: 9px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-style: normal; border-left: 3px solid var(--tt-c); border-right: 3px solid var(--tt-p); }
  .tt-tabs .tt-tab-plus .ic { font-size: 20px; }
  .tt-tabs .tt-badge { position: absolute; top: 4px; left: 54%; }
  body.tt-body[data-route="home"] .tt-tabs, body.tt-body[data-route="following"] .tt-tabs { background: #000; border-top-color: rgba(255,255,255,.15); }
  body.tt-body[data-route="home"] .tt-tabs a, body.tt-body[data-route="following"] .tt-tabs a { color: rgba(255,255,255,.65); }
  body.tt-body[data-route="home"] .tt-tabs a.on, body.tt-body[data-route="following"] .tt-tabs a.on { color: #fff; }
  .fi { padding: 0; }
  .fi-card { width: 100%; aspect-ratio: auto; }
  .fi-media { border-radius: 0; }
  .fi-rail { left: auto; right: 8px; bottom: 18px; gap: 12px; color: #fff; }
  .rb > i { background: transparent; width: 44px; height: 44px; font-size: 32px; }
  .rb { font-size: 12px; }
  .ff-tabs a { color: rgba(255,255,255,.65); }
  .ff-tabs a.on { color: #fff; border-bottom-color: #fff; }
  .ff-nav { display: none; }
  .fi-info { right: 70px; left: 12px; bottom: 14px; }
  .fi-prog { bottom: 0; }
  .fi-mute { top: 52px; right: 10px; }
  .cm { top: auto; left: 0; width: 100%; height: 72%; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; animation: ttup .2s ease; }
  .pg { padding: 18px 14px 40px; }
  .ph-head { gap: 16px; }
  .tt-av.xl { width: 88px; height: 88px; }
  .ph-info h1 { font-size: 20px; }
  .vg { grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .vg-i { border-radius: 0; }
  .vg-i .vc { display: none; }
  .tt-toast { bottom: calc(var(--tabs-h) + 24px); }
  .tt-bg { place-items: end center; padding: 0; }
  .tt-modal { max-width: none; border-radius: 16px 16px 0 0; animation: ttup .2s ease; }
  .sr-top { padding: 10px 14px 0; }
  .ad-main { padding: 16px 12px; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .rb > i { width: 40px; height: 40px; font-size: 20px; }
  .fi-rail { gap: 8px; }
}
.tt-empty-code { font-size: 64px; font-weight: 800; color: var(--tt-p); line-height: 1.1; }
@media (max-width: 760px) {
  .ph-act .tt-btn { min-width: 0; flex: 1 1 auto; padding: 0 14px; }
  .ph-act .tt-btn[data-p="more"] { flex: none; }
}
@media (max-width: 760px) { .ph-act { flex-wrap: nowrap; } }

.fi-yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; opacity: 0; transition: opacity .2s; pointer-events: none; }
.fi.ready .fi-yt { opacity: 1; }
.fi-tap { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.fi-err a { display: inline-flex; }
.up-prev { display: none; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 16px; }
.up-prev.on { display: flex; }
.up-prev img { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.up-prev b { display: block; word-break: break-word; }
.up-prev small { color: var(--fg2); }
