/* ============================================================
   터틀 앱 — 화이트톤 기본, 모바일 우선(최대폭 560px 중앙)
   숏폼 시청 시 검정 이머시브. safe-area 대응.
   ============================================================ */
:root {
  --bg: #ffffff;
  --surface: #f6f7f8;
  --card: #ffffff;
  --line: #ececef;
  --line-2: #e2e3e7;
  --text: #14171a;
  --sub: #6b7280;
  --dim: #9aa1a9;
  --brand: #12b886;
  --brand-deep: #0ca678;
  --brand-ink: #ffffff;
  --brand-soft: #e7f8f1;
  --danger: #e8503a;
  --gold: #e8a020;
  --radius: 14px;
  --appbar-h: 52px;
  --tabbar-h: 56px;
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  --shadow: 0 1px 2px rgba(20,23,26,.05), 0 6px 20px rgba(20,23,26,.05);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:active { opacity: .6; }
a { color: var(--brand-deep); text-decoration: none; }
input, select, textarea { font: inherit; color: var(--text); }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
#view {
  min-height: 100dvh;
  padding-top: calc(var(--appbar-h) + var(--sat));
  padding-bottom: calc(var(--tabbar-h) + var(--sab) + 18px);
}

/* ---------- 상단 앱바 (safe-area 상단 반영 — 잘림 해결) ---------- */
#appbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 50;
  height: calc(var(--appbar-h) + var(--sat)); padding-top: var(--sat);
  display: flex; align-items: center; gap: 6px; padding-left: 6px; padding-right: 6px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ab-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--text); }
.ab-icon svg { width: 24px; height: 24px; }
#appbar-center { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.ab-logo { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.ab-logo img { width: 26px; height: 26px; }
.ab-title { font-weight: 800; font-size: 18px; letter-spacing: -.3px; }

/* 중앙 세그먼트(로고 토글/롱폼숏폼) */
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 3px; position: relative;
}
.seg button { padding: 6px 16px; border-radius: 999px; font-size: 13.5px; color: var(--sub); font-weight: 700; transition: color .2s; z-index: 1; }
.seg button.on { color: var(--brand-ink); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 999px; background: var(--brand); transition: transform .24s cubic-bezier(.4,0,.2,1), width .24s; z-index: 0; }

/* ---------- 가로 스와이프 페이저 ---------- */
#view { display: none; }   /* 레거시 컨테이너 무력화 — 페이저 구조 사용 */
#pager {
  display: flex; overflow-x: scroll; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none;
  height: 100dvh; scroll-behavior: auto;
}
#pager::-webkit-scrollbar { display: none; }
.page {
  flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  overflow-y: auto; overflow-x: hidden; height: 100dvh;
  padding-top: calc(var(--appbar-h) + var(--sat));
  padding-bottom: calc(var(--tabbar-h) + var(--sab) + 12px);
}
.page::-webkit-scrollbar { display: none; }
/* 숏폼 피드를 담은 VOD 페이지는 자체 스크롤 없음 */
.page.immersive { padding: 0; overflow: hidden; }

/* ---------- 하단 탭바 ---------- */
#tabbar {
  position: fixed; z-index: 55; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; height: calc(var(--tabbar-h) + var(--sab));
  display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: var(--sab);
}
#tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); }
#tabbar .tab svg { width: 23px; height: 23px; }
#tabbar .tab span { font-size: 10px; font-weight: 700; }
#tabbar .tab.on { color: var(--brand-deep); }

/* 숏폼(검정 이머시브) 모드 — body 클래스로 상/하단 검정 전환 */
body.shortform { background: #000; }
body.shortform #appbar { background: transparent; border: 0; color: #fff; }
body.shortform #appbar .ab-icon { color: #fff; }
body.shortform #tabbar { background: #000; border-top-color: #1a1a1a; }
body.shortform #tabbar .tab { color: #888; }
body.shortform #tabbar .tab.on { color: #fff; }
body.shortform .seg { background: rgba(255,255,255,.15); border-color: transparent; }
body.shortform .seg button { color: #ccc; }
body.shortform .seg button.on { color: #000; }
body.shortform .seg .thumb { background: #fff; }

/* ---------- 카테고리 칩 ---------- */
.top {
  position: sticky;
  top: calc(var(--appbar-h) + var(--sat));
  z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand-row h1 { font-size: 20px; font-weight: 800; letter-spacing: 0; }
.brand-row .dot { color: var(--brand-deep); }
.top-sub { display: flex; align-items: center; gap: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--sub); border: 1px solid transparent; }
.chip.on { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 12px; font-weight: 800; font-size: 14.5px; background: var(--surface); color: var(--text); border: 1px solid var(--line-2); transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(232,80,58,.3); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; } .btn-row .btn { flex: 1; }

/* ---------- 카드 ---------- */
.list { display: grid; gap: 12px; padding: 12px 16px; }
.list.rows { grid-template-columns: 1fr; }
.list.grid2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.list.grid3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card { cursor: pointer; }
.card .thumb { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.card .thumb span { font-size: 24px; font-weight: 800; color: var(--dim); }
.card h3 { font-size: 14px; font-weight: 700; line-height: 1.35; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 12px; color: var(--sub); margin-top: 3px; }
.card .badges { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 5px; }
.card.row { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.card.row .thumb { flex: 0 0 112px; height: 84px; }
.card.row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card.row h3 { margin-top: 0; }
.card.row .oneline { font-size: 12px; color: var(--sub); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card.row .badges { position: static; margin-top: auto; padding-top: 6px; }
.card.grid .thumb { aspect-ratio: 16/10; }
.list.grid2 .card.grid .thumb { aspect-ratio: 9/13; }
.list.grid3 .card.grid .thumb { aspect-ratio: 3/4; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.92); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); backdrop-filter: blur(3px); }
.badge.free { color: var(--brand-deep); } .badge.paid { color: var(--gold); }
.badge.type { color: var(--sub); font-weight: 700; } .badge.ai { color: #4263eb; }
.badge.dur { color: #fff; background: rgba(0,0,0,.6); }

/* ---------- 섹션/레일/배너 ---------- */
.section { padding: 14px 16px 2px; } .section h2 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; } .rail .card { flex: 0 0 130px; } .rail .card .thumb { aspect-ratio: 3/4; }
.banner { margin: 12px 16px 2px; border-radius: 18px; overflow: hidden; position: relative; cursor: pointer; aspect-ratio: 16/9; background: var(--surface) center/cover; }
.banner .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), transparent 60%); }
.banner .info { position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff; }
.banner .info h3 { font-size: 19px; font-weight: 800; } .banner .info p { font-size: 12.5px; opacity: .85; margin-top: 3px; }

/* ---------- 상세/뷰어 ---------- */
#overlay:empty { display: none; }
#overlay { position: fixed; inset: 0; z-index: 70; background: var(--bg); max-width: 560px; margin: 0 auto; overflow-y: auto; }
.nav-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: calc(var(--sat) + 8px) 10px 8px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-bar .back { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.nav-bar .nav-title { font-size: 16px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero { aspect-ratio: 16/9; background: var(--surface) center/cover; }
.d-body { padding: 16px; }
.d-body h2 { font-size: 21px; font-weight: 800; line-height: 1.3; }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.owner-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.owner-row .who { flex: 1; } .owner-row .who b { font-size: 14px; } .owner-row .who span { display: block; font-size: 12px; color: var(--sub); }
.stat-row { display: flex; gap: 14px; padding: 10px 0; font-size: 12.5px; color: var(--sub); border-bottom: 1px solid var(--line); } .stat-row b { color: var(--text); }
.d-summary { padding: 12px 0; color: #374151; font-size: 14px; white-space: pre-wrap; }
.d-actions { display: flex; gap: 8px; padding: 10px 0 4px; } .d-actions .btn { flex: 1; }
.notice { margin: 10px 0; padding: 11px 13px; border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--sub); } .notice b { color: var(--text); }
.notice.brand { border: 1px solid rgba(18,184,134,.25); color: var(--text); background: var(--brand-soft); }
.ep-list { margin-top: 4px; } .ep-row { display: flex; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ep-row .no { flex: 0 0 30px; color: var(--dim); font-weight: 800; font-size: 13px; } .ep-row .t { flex: 1; font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row .badge { flex: 0 0 auto; }
.viewer { background: #fff; min-height: 100dvh; } .viewer .pages img { width: 100%; }
mux-player { width: 100%; aspect-ratio: 16/9; background: #000; display: block; --controls: none; }
.prose { padding: 18px 18px 40px; font-size: 15.5px; line-height: 1.8; color: #1f2937; }
.prose h1,.prose h2,.prose h3 { margin: 20px 0 8px; } .prose p { margin: 10px 0; } .prose ul { margin: 10px 0 10px 20px; }
.viewer-end { padding: 24px 16px 60px; text-align: center; color: var(--sub); font-size: 13px; }

/* ---------- 숏폼 세로 피드 ---------- */
.sf-feed { height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; background: #000; scrollbar-width: none; }
.sf-feed::-webkit-scrollbar { display: none; }
.sf-slide { height: 100dvh; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; content-visibility: auto; display: flex; align-items: center; justify-content: center; }
.sf-slide mux-player, .sf-slide video { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.sf-overlay { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 42%); padding-top: calc(var(--appbar-h) + var(--sat)); padding-bottom: calc(var(--tabbar-h) + var(--sab)); }
.sf-rail { position: absolute; right: 12px; bottom: calc(var(--tabbar-h) + var(--sab) + 20px); display: flex; flex-direction: column; gap: 20px; align-items: center; pointer-events: auto; color: #fff; }
.sf-rail button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; font-size: 11px; font-weight: 700; }
.sf-rail svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.sf-cap { position: absolute; left: 14px; right: 84px; bottom: calc(var(--tabbar-h) + var(--sab) + 20px); color: #fff; pointer-events: auto; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sf-cap b { font-size: 15px; font-weight: 800; } .sf-cap p { font-size: 13px; margin-top: 4px; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-cap .paywall { margin-top: 10px; display: inline-flex; }
.sf-tap { position: absolute; inset: 0; }

/* ---------- 폼 ---------- */
.form { padding: 16px; display: grid; gap: 15px; }
.field label { display: block; font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--sub); font-weight: 500; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--sub); }
.check input { width: 19px; height: 19px; accent-color: var(--brand); margin-top: 1px; }
.pick-row { display: flex; gap: 8px; }
.pick { flex: 1; padding: 13px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); text-align: center; font-weight: 700; font-size: 13.5px; color: var(--sub); }
.pick.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.filedrop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 26px 16px; text-align: center; color: var(--sub); font-size: 13.5px; background: var(--surface); }
.filedrop.has { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }
.upbar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.upbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.form-title { padding: 16px 16px 0; } .form-title h2 { font-size: 22px; font-weight: 800; } .form-title p { color: var(--sub); font-size: 13.5px; margin-top: 4px; }
.form-foot { text-align: center; font-size: 13.5px; color: var(--sub); padding: 6px 16px 20px; }

/* ---------- 시트(하단 슬라이드) ---------- */
#backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s; }
#backdrop.open { opacity: 1; }
#sheet { position: fixed; z-index: 90; left: 50%; bottom: 0; transform: translate(-50%,105%); width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.18); padding: 8px 18px calc(20px + var(--sab)); transition: transform .26s cubic-bezier(.32,.72,0,1); }
#sheet.open { transform: translate(-50%,0); }
#sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 6px auto 14px; }
.sheet-head h3 { font-size: 18px; font-weight: 800; } .sheet-head p { font-size: 13px; color: var(--sub); margin-top: 3px; }
.sheet-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .sheet-row b { font-size: 15px; } .sheet-row .coin { color: var(--gold); font-weight: 800; }
.sheet .btn.block { margin-top: 14px; }
.presets { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 14px 0 4px; }
.preset { padding: 13px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 800; text-align: center; }
.preset.on { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }
.stars { display: flex; justify-content: center; gap: 8px; padding: 12px 0 4px; } .stars button { font-size: 30px; color: var(--line-2); } .stars button.on { color: var(--gold); }

/* ---------- 드로어(햄버거 설정) ---------- */
#drawer { position: fixed; top: 0; left: 0; z-index: 100; height: 100dvh; width: 84%; max-width: 380px; background: #fff; transform: translateX(-102%); transition: transform .28s cubic-bezier(.32,.72,0,1); overflow-y: auto; box-shadow: 4px 0 30px rgba(0,0,0,.14); padding-bottom: calc(30px + var(--sab)); }
#drawer.open { transform: translateX(0); }
.dw-head { padding: calc(var(--sat) + 18px) 18px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.dw-group { padding: 8px 0; border-bottom: 8px solid var(--surface); }
.dw-group h4 { font-size: 12px; font-weight: 800; color: var(--dim); padding: 12px 18px 6px; letter-spacing: .3px; }
.dw-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px; font-size: 15px; font-weight: 600; text-align: left; }
.dw-item .r { color: var(--dim); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dw-item .arrow { color: var(--dim); }
.dw-ver { text-align: center; color: var(--dim); font-size: 12px; padding: 18px; }
.toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: 0 0 auto; }
.toggle.on { background: var(--brand); } .toggle i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); } .toggle.on i { transform: translateX(18px); }

/* ---------- 프로필 ---------- */
.profile-head { padding: calc(var(--appbar-h) + var(--sat) + 6px) 16px 14px; }
.ph-top { display: flex; align-items: center; gap: 18px; }
.avatar { width: 78px; height: 78px; border-radius: 50%; flex: 0 0 78px; background: var(--brand-soft) center/cover; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: var(--brand-deep); }
.avatar.sm { width: 40px; height: 40px; flex: 0 0 40px; font-size: 16px; }
.p-stats { flex: 1; display: flex; justify-content: space-around; text-align: center; } .p-stats b { display: block; font-size: 18px; } .p-stats span { font-size: 12px; color: var(--sub); }
.p-name { margin-top: 12px; } .p-name b { font-size: 16px; } .p-name .handle { color: var(--sub); font-size: 13px; margin-left: 5px; } .p-bio { font-size: 13.5px; color: #374151; margin-top: 4px; white-space: pre-wrap; }
.p-actions { display: flex; gap: 8px; margin-top: 14px; } .p-actions .btn { flex: 1; }
.menu-list { padding: 6px 16px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 2px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; text-align: left; }
.menu-item .arrow { color: var(--dim); }
.p-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; padding: 4px 3px; }
.p-grid .cell { aspect-ratio: 1; background: var(--surface) center/cover; position: relative; }
.p-tabs { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.p-tabs button { flex: 1; padding: 12px; color: var(--dim); } .p-tabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }

/* ---------- 지갑 ---------- */
.wallet-hero { margin: 16px; padding: 22px 18px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; }
.wallet-hero .label { font-size: 13px; opacity: .85; } .wallet-hero .amount { font-size: 30px; font-weight: 800; margin: 4px 0 14px; }
.wallet-hero .btn { background: rgba(255,255,255,.2); color: #fff; border: 0; }
.ledger-row { display: flex; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.ledger-row .k { flex: 1; } .ledger-row .k b { font-size: 14px; display: block; } .ledger-row .k span { font-size: 12px; color: var(--dim); }
.ledger-row .delta { font-weight: 800; font-size: 14px; } .ledger-row .delta.plus { color: var(--brand-deep); }

/* ---------- 스켈레톤 ---------- */
.skel { background: linear-gradient(100deg, var(--surface) 30%, #eef0f2 50%, var(--surface) 70%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 10px; }
@keyframes sh { to { background-position: -200% 0; } }
.skel-card { height: 104px; border-radius: 14px; }
.skel-grid { aspect-ratio: 9/13; border-radius: 14px; }

/* ---------- 토스트/기타 ---------- */
#toast { position: fixed; z-index: 120; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 20px); transform: translateX(-50%) translateY(8px); max-width: 88%; padding: 12px 18px; border-radius: 999px; background: #14171a; color: #fff; font-size: 13.5px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 6px 24px rgba(0,0,0,.25); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { padding: 56px 20px; text-align: center; color: var(--dim); font-size: 14px; grid-column: 1/-1; }
.more { margin: 0 16px 18px; width: calc(100% - 32px); }
.loading { padding: 30px 0; text-align: center; color: var(--dim); font-size: 13px; }
.center-box { padding: 70px 24px; text-align: center; } .center-box h3 { font-size: 18px; margin-bottom: 8px; } .center-box p { color: var(--sub); font-size: 14px; margin-bottom: 18px; }

/* ---------- 다크(설정에서 전환) ---------- */
:root[data-theme="dark"] {
  --bg:#0b0d0c; --surface:#15191a; --card:#141a18; --line:#232a27; --line-2:#2b332f;
  --text:#e9efeb; --sub:#93a29a; --dim:#5f6d66; --brand-soft:#0f2a20; --brand-ink:#06281c;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}
:root[data-theme="dark"] #appbar, :root[data-theme="dark"] #tabbar { background: rgba(15,18,17,.94); }
:root[data-theme="dark"] .top { background: rgba(15,18,17,.94); }
:root[data-theme="dark"] .badge { background: rgba(8,12,10,.8); color: var(--text); }
:root[data-theme="dark"] #sheet, :root[data-theme="dark"] #drawer, :root[data-theme="dark"] #overlay { background: var(--surface); }
:root[data-theme="dark"] .field input:focus { background: var(--card); }
