@font-face { font-family: "Sora"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/sora-700-latin.woff2") format("woff2"); }
/* Inter (variable, self-hosted: no third-party requests) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* ==========================================================================
   Porda design system
   ========================================================================== */
:root, [data-theme="dark"] {
  --bg: #0d0f14; --bg-2: #12151c; --surface: #161a22; --surface-2: #1d222c; --hover: #232936;
  --line: #262c38; --line-2: #313848;
  --text: #eceef3; --text-2: #b4bac7; --muted: #8b92a1;
  --accent: #F0588E; --accent-2: #E0457B; --accent-ink: #2A0716; --accent-soft: rgba(240,88,142,.15);
  --danger: #ff6b6b; --danger-soft: rgba(255,107,107,.14); --warn: #f5b84b;
  --overlay: rgba(5,7,10,.72); --shadow: 0 12px 40px rgba(0,0,0,.45);
  --skeleton: #1b2029; --skeleton-2: #232935;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f7f9; --bg-2: #eef0f3; --surface: #ffffff; --surface-2: #f2f4f7; --hover: #e9ecf1;
  --line: #e2e5eb; --line-2: #d3d8e0;
  --text: #11141a; --text-2: #3d4452; --muted: #646c7b;
  --accent: #C8336B; --accent-2: #AE2A5C; --accent-ink: #ffffff; --accent-soft: rgba(200,51,107,.1);
  --danger: #d63c3c; --danger-soft: rgba(214,60,60,.1); --warn: #b7791f;
  --overlay: rgba(10,12,16,.55); --shadow: 0 12px 40px rgba(15,20,30,.14);
  --skeleton: #e8ebf0; --skeleton-2: #f1f3f6;
  color-scheme: light;
}
:root {
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --topbar: 64px; --rail: 232px; --bottomnav: 62px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.noscript, .ssr { padding: 24px 16px; color: var(--text-2); }
.ssr a { color: var(--accent); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); transition: background .15s; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 110px; resize: vertical; }
.field-error { color: var(--danger); font-size: 13px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; flex: none; }
.brand-mark { width: 32px; height: 32px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='12' y='8' width='11' height='48' rx='5.5' fill='%23E0457B'/%3E%3Cpath d='M23 8H34C45 8 53 15.5 53 25.5 53 35.5 45 43 34 43H23Z' fill='%23E0457B'/%3E%3Cpath d='M31 10C29 20 29 31 31 41M39 11C37 20.5 37 30.5 39 40M46.5 15C45 22 45 29 46.5 36' fill='none' stroke='%237A1D45' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M23 43C27 47 27 52 23 56' fill='none' stroke='%23F4A3BF' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.brand-word { font-family: "Sora", "Inter", system-ui, sans-serif; font-weight: 700; letter-spacing: -.03em; }

/* ---------- app shell ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar); display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.rail { display: none; }
.page { padding: 20px 16px calc(40px + var(--bottomnav)); min-height: calc(100vh - var(--topbar)); }
.page-narrow { max-width: 960px; margin: 0 auto; }
.page-title { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--bottomnav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottomnav svg { width: 24px; height: 24px; }
.bottomnav [aria-current="page"] { color: var(--text); }
.bottomnav [aria-current="page"] svg { color: var(--accent); }
.hide-mobile { display: none !important; }

@media (min-width: 1024px) {
  .hide-mobile { display: inline-flex !important; }
  .hide-desktop { display: none !important; }
  .bottomnav { display: none; }
  .topbar { padding: 0 20px; }
  .rail { display: flex; flex-direction: column; gap: 2px; position: fixed; top: var(--topbar); left: 0; bottom: 0; width: var(--rail); padding: 12px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); z-index: 40; }
  .rail a { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
  .rail a:hover { background: var(--surface-2); color: var(--text); }
  .rail a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
  .rail a[aria-current="page"] svg { color: var(--accent); }
  .rail svg { width: 22px; height: 22px; flex: none; }
  .rail hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; width: auto; }
  .rail .rail-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 12px; }
  .rail .rail-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 12px; line-height: 1.6; }
  .page { margin-left: var(--rail); padding: 24px 28px 48px; }
  body.is-watch .rail { display: none; }
  body.is-watch .page { margin-left: 0; }
}

/* ---------- search ---------- */
.search { position: relative; flex: 1; max-width: 620px; margin: 0 auto; }
.search form { display: flex; align-items: center; height: 42px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; transition: border-color .15s, box-shadow .15s; }
.search form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 8px 0 18px; font-size: 15px; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { width: 38px; height: 38px; margin-right: 2px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 70; }
.suggest[hidden] { display: none; }
.suggest-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.suggest-head button { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 600; }
.suggest-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 15px; }
.suggest-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.suggest-item:hover, .suggest-item[aria-selected="true"] { background: var(--surface-2); }
.suggest-item .rm { margin-left: auto; color: var(--muted); border: 0; background: none; padding: 2px 6px; border-radius: 6px; }
.suggest-item .rm:hover { background: var(--hover); color: var(--text); }
.search-page .search { max-width: none; margin-bottom: 16px; }

/* ---------- sections & grid ---------- */
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-head h2 { font-size: 19px; font-weight: 700; }
.section-head a { color: var(--accent); font-size: 14px; font-weight: 600; }
.grid { display: grid; gap: 28px 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1800px) { .grid { grid-template-columns: repeat(5, 1fr); } }

/* ---------- video card ---------- */
.card { position: relative; min-width: 0; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--skeleton); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; letter-spacing: .02em; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 60%); }
.thumb .play span { width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; backdrop-filter: blur(4px); }
.thumb .play svg { width: 26px; height: 26px; color: #fff; margin-left: 3px; }
.thumb .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.3); }
.thumb .progress i { display: block; height: 100%; background: var(--accent); }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.thumb .noimg svg { width: 40px; height: 40px; }
@media (hover: hover) {
  .card:hover .thumb img { transform: scale(1.04); }
  .card:hover .thumb .play { opacity: 1; }
}
.card-body { display: flex; gap: 10px; padding-top: 10px; }
.card-text { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }
.card-meta .creator { display: block; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .more { margin: -4px -8px 0 0; width: 34px; height: 34px; }
.card .more svg { width: 20px; height: 20px; }

/* horizontal (list) card */
.card.row { display: flex; gap: 12px; }
.card.row .thumb { width: 168px; flex: none; border-radius: 10px; }
.card.row .card-body { padding-top: 0; flex: 1; min-width: 0; }
.card.row .card-title { font-size: 14px; }
.card.row .card-meta { font-size: 12px; }
@media (min-width: 700px) { .card.row.wide .thumb { width: 240px; } .card.row.wide .card-title { font-size: 16px; } }

/* ---------- featured ---------- */
.featured { position: relative; display: grid; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); margin-bottom: 36px; }
.featured .thumb { border-radius: 0; aspect-ratio: 16 / 9; }
.featured-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.featured-kicker { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.featured-title { font-size: 24px; font-weight: 700; }
.featured-desc { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
@media (min-width: 900px) {
  .featured { grid-template-columns: 1.55fr 1fr; }
  .featured-body { padding: 32px; }
  .featured-title { font-size: 30px; }
}

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- skeletons ---------- */
.sk { background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-2) 50%, var(--skeleton) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: 6px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-thumb { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.sk-line { height: 14px; margin-top: 10px; }
.sk-line.short { width: 60%; }
.sk-player { aspect-ratio: 16 / 9; border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition-duration: 0s !important; scroll-behavior: auto !important; } }

/* ---------- states ---------- */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 16px; max-width: 460px; margin: 0 auto; }
.state-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin-bottom: 6px; }
.state-icon svg { width: 30px; height: 30px; }
.state.error .state-icon { background: var(--danger-soft); color: var(--danger); }
.state h2 { font-size: 20px; }
.state p { color: var(--muted); }
.state .btn { margin-top: 8px; }

/* ---------- watch page ---------- */
.watch { display: grid; gap: 20px; max-width: 1760px; margin: 0 auto; }
.watch-main { min-width: 0; }
.watch-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1023px) {
  body.is-watch .page { padding-top: 0; padding-left: 0; padding-right: 0; }
  body.is-watch .watch-info, body.is-watch .watch-side { padding: 0 16px; }
  body.is-watch .player { border-radius: 0; }
}
@media (min-width: 1024px) {
  .watch { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
}
@media (min-width: 1440px) { .watch { grid-template-columns: minmax(0, 1fr) 420px; } }
.watch-info { padding-top: 14px; }
.watch-title { font-size: 20px; font-weight: 700; }
@media (min-width: 1024px) { .watch-title { font-size: 22px; } }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.creator-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; font-weight: 700; flex: none; }
.creator-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-row small { color: var(--muted); }
.actions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.actions::-webkit-scrollbar { display: none; }
.desc { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.desc-meta { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.desc-text { white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
.desc.collapsed .desc-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { margin-top: 8px; border: 0; background: none; padding: 0; font-weight: 600; color: var(--text); }
.desc .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.desc .tags a { color: var(--accent); font-size: 13px; font-weight: 500; }
.desc .license { margin-top: 12px; font-size: 13px; color: var(--muted); }
.desc .license a { color: var(--accent); }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.side-title { font-size: 16px; font-weight: 700; }

/* playlist panel on watch page */
.pl-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pl-panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.pl-panel-head div { flex: 1; min-width: 0; }
.pl-panel-head b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-panel-head small { color: var(--muted); }
.pl-panel-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.pl-item:hover { background: var(--surface-2); }
.pl-item[aria-current="true"] { background: var(--accent-soft); }
.pl-item .idx { width: 22px; text-align: center; color: var(--muted); font-size: 12px; flex: none; }
.pl-item .thumb { width: 100px; flex: none; border-radius: 8px; }
.pl-item .thumb .dur { font-size: 11px; right: 4px; bottom: 4px; }
.pl-item .t { min-width: 0; flex: 1; }
.pl-item .t b { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-item .t small { color: var(--muted); font-size: 12px; }
.repeat-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
.repeat-badge svg { width: 14px; height: 14px; }

/* ---------- player ---------- */
.player { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 9; color: #fff; user-select: none; -webkit-user-select: none; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player:-webkit-full-screen { border-radius: 0; width: 100%; height: 100%; }
.player.hide-cursor { cursor: none; }
.p-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.p-bigplay { pointer-events: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); transition: transform .15s, background .15s; }
.p-bigplay:hover { transform: scale(1.06); background: rgba(0,0,0,.7); }
.p-bigplay svg { width: 34px; height: 34px; margin-left: 4px; }
.p-spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.6); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.p-flash.show { opacity: 1; }
.p-resume { position: absolute; left: 16px; bottom: 76px; display: flex; gap: 8px; align-items: center; background: rgba(12,14,18,.88); border: 1px solid rgba(255,255,255,.12); padding: 8px 8px 8px 14px; border-radius: 12px; font-size: 14px; backdrop-filter: blur(6px); z-index: 3; }
.p-resume .btn { height: 32px; font-size: 13px; }
.p-resume .btn:not(.btn-primary) { background: rgba(255,255,255,.12); color: #fff; }
.p-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #0b0c10; text-align: center; padding: 16px; z-index: 4; }
.p-error svg { width: 40px; height: 40px; color: var(--danger); }
.p-error p { color: #aab; max-width: 360px; }
.p-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 12px 8px; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.35) 60%, transparent); transition: opacity .25s; z-index: 2; }
.player.idle .p-controls { opacity: 0; pointer-events: none; }
.p-row { display: flex; align-items: center; gap: 2px; }
.p-row .grow { flex: 1; }
.p-btn { width: 42px; height: 42px; border: 0; background: none; color: #fff; display: grid; place-items: center; border-radius: 10px; flex: none; position: relative; }
.p-btn:hover { background: rgba(255,255,255,.12); }
.p-btn svg { width: 24px; height: 24px; }
.p-btn.on::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 16px; height: 2px; margin-left: -8px; background: var(--accent); border-radius: 2px; }
.p-time { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; color: #e9ebf0; }
.p-vol { display: flex; align-items: center; }
.p-vol input { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; }
.p-vol:hover input, .p-vol:focus-within input { width: 80px; opacity: 1; margin-right: 6px; }
.p-seek { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; margin: 0 4px 4px; touch-action: none; }
.p-seek .track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); transition: height .15s; }
.p-seek:hover .track, .p-seek.drag .track { height: 6px; }
.p-seek .buf, .p-seek .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.p-seek .buf { background: rgba(255,255,255,.4); }
.p-seek .fill { background: var(--accent); }
.p-seek .knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s; }
.p-seek:hover .knob, .p-seek.drag .knob, .p-seek:focus-visible .knob { transform: scale(1); }
.p-seek .tip { position: absolute; bottom: 20px; transform: translateX(-50%); background: rgba(0,0,0,.85); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; transition: opacity .1s; }
.p-seek:hover .tip, .p-seek.drag .tip { opacity: 1; }
.p-menu { position: absolute; right: 12px; bottom: 64px; min-width: 220px; max-height: calc(100% - 80px); overflow-y: auto; background: rgba(18,20,26,.96); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 6px; font-size: 14px; z-index: 5; backdrop-filter: blur(10px); }
.p-menu[hidden] { display: none; }
.p-menu .mh { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 4px; font-weight: 600; }
.p-menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 9px 10px; border: 0; background: none; color: #fff; border-radius: 8px; text-align: left; }
.p-menu button:hover, .p-menu button:focus-visible { background: rgba(255,255,255,.1); }
.p-menu button .val { color: #aab0bd; display: flex; align-items: center; gap: 4px; }
.p-menu button[aria-checked="true"]::after { content: "✓"; color: var(--accent); font-weight: 700; }
.p-menu svg { width: 18px; height: 18px; }
@media (max-width: 600px) {
  .p-controls { padding: 28px 6px 4px; }
  .p-btn { width: 38px; height: 38px; }
  .p-btn svg { width: 22px; height: 22px; }
  .p-vol input { display: none; }
  .p-time { font-size: 12px; padding: 0 4px; }
  .p-resume { left: 8px; right: 8px; bottom: 60px; }
}

/* ---------- menus, modal, toast ---------- */
.menu { position: fixed; z-index: 200; min-width: 220px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--surface-2); outline: none; }
.menu svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .danger, .menu .danger svg { color: var(--danger); }
.menu-head { padding: 10px 12px 8px; font-size: 13px; color: var(--muted); }
.modal-back { position: fixed; inset: 0; z-index: 300; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade .15s; }
.modal { width: 100%; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); animation: rise .2s var(--ease); }
@media (min-width: 600px) { .modal-back { align-items: center; padding: 16px; } .modal { max-width: 460px; border-radius: 18px; padding: 22px; } .modal.wide { max-width: 640px; } }
.modal h2 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--text-2); }
.modal form, .modal .stack { display: grid; gap: 14px; margin-top: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav) + 16px + env(safe-area-inset-bottom)); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 1024px) { .toasts { bottom: 24px; left: 24px; transform: none; align-items: flex-start; } }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; animation: rise .2s var(--ease); pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; margin-left: 6px; text-decoration: underline; }

.pl-pick { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; margin: 12px 0; }
.pl-pick label { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.pl-pick label:hover { background: var(--surface-2); }
.pl-pick input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- library / playlists ---------- */
.lib-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 32px; }
@media (min-width: 900px) { .lib-links { grid-template-columns: repeat(4, 1fr); } }
.lib-link { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; transition: background .15s; }
.lib-link:hover { background: var(--surface-2); }
.lib-link svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.lib-link small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.pl-card .thumb::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -60px 50px -30px rgba(0,0,0,.6); }
.pl-card .count { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.pl-card .count svg { width: 16px; height: 16px; }
.pl-hero { display: grid; gap: 20px; margin-bottom: 24px; }
@media (min-width: 900px) { .pl-hero { grid-template-columns: 360px 1fr; align-items: end; } }
.pl-hero .thumb { max-width: 520px; }
.pl-hero h1 { font-size: 26px; }
.pl-hero p { color: var(--text-2); margin-top: 6px; white-space: pre-line; }
.pl-hero .meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.pl-hero .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pl-rows { display: flex; flex-direction: column; gap: 4px; }
.pl-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid transparent; }
.pl-row:hover { border-color: var(--line); }
.pl-row.dragging { opacity: .5; }
.pl-row.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.pl-row .handle { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 28px; flex: none; touch-action: none; }
.pl-row .handle svg { width: 20px; height: 20px; }
.pl-row .card { flex: 1; min-width: 0; }
.pl-row .order { display: flex; flex-direction: column; }
.pl-row .order .icon-btn { width: 30px; height: 26px; border-radius: 6px; }
.pl-row .order svg { width: 18px; height: 18px; }
.hist-list { display: flex; flex-direction: column; gap: 16px; max-width: 960px; }
.hist-item { display: flex; gap: 8px; align-items: flex-start; }
.hist-item .card { flex: 1; min-width: 0; }

/* ---------- search results ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.results-head p { color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.result-list { display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }

/* ---------- upload ---------- */
.upload-grid { display: grid; gap: 20px; }
@media (min-width: 1000px) { .upload-grid { grid-template-columns: 1fr 360px; align-items: start; } }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; min-height: 260px; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .state-icon { background: var(--accent-soft); color: var(--accent); }
.dropzone small { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress.indeterminate i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.up-status { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.file-card { display: flex; gap: 12px; align-items: center; }
.file-card .thumb { width: 160px; flex: none; }
.file-card b { display: block; word-break: break-all; }
.file-card small { color: var(--muted); }
.thumb-pick { display: grid; gap: 10px; }
.thumb-pick .thumb { width: 100%; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--warn); }
.notice.ok svg { color: var(--accent); }

/* ---------- admin ---------- */
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.admin-toolbar .input { max-width: 320px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-row .thumb { border-radius: 8px; }
.admin-row .info { min-width: 0; }
.admin-row .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .info small { color: var(--muted); }
.admin-row .ops { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 900px) { .admin-row { grid-template-columns: 140px 1fr auto; } .admin-row .ops { grid-column: auto; } }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge.pub { background: var(--accent-soft); color: var(--accent); }
.badge.draft { background: rgba(245,184,75,.15); color: var(--warn); }

.login-card { max-width: 400px; margin: 40px auto; }
.footer { color: var(--muted); font-size: 13px; padding: 32px 0 8px; border-top: 1px solid var(--line); margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.footer a:hover { color: var(--text); }

/* ==========================================================================
   v2: hero, shelves, channels, comments, accounts
   ========================================================================== */
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); }
.btn-glass:hover { background: rgba(255,255,255,.24); }
.btn.icon-only { width: 40px; padding: 0; }
.btn-signin { border: 1px solid var(--line-2); background: transparent; color: var(--accent); height: 36px; padding: 0 14px 0 10px; }
.btn-signin:hover { background: var(--accent-soft); }
.signin-group { display: flex; align-items: center; gap: 4px; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; display: grid; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; letter-spacing: .02em; text-decoration: none; overflow: hidden; }
.link-sm { font-size: 14px; color: var(--accent); justify-self: start; }
.title-icon { width: 26px; height: 26px; vertical-align: -4px; margin-right: 8px; color: #ff7a45; }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.section-head a { display: inline-flex; align-items: center; gap: 2px; }
.section-head a svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip svg { width: 16px; height: 16px; color: #ff7a45; }
.desc-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* hero carousel */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; margin-bottom: 24px; aspect-ratio: 16 / 9; max-height: 520px; width: 100%; }
@media (min-width: 900px) { .hero { aspect-ratio: 21 / 8; } }
.hero-sk { aspect-ratio: 21 / 8; border-radius: var(--radius-lg); margin-bottom: 24px; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.hero-slide.active .hero-bg { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.08); } }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,12,.92) 0%, rgba(5,7,12,.65) 38%, rgba(5,7,12,0) 70%), linear-gradient(0deg, rgba(5,7,12,.85), transparent 45%); }
.hero-body { position: absolute; left: 0; bottom: 0; top: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 20px; max-width: 640px; color: #fff; }
@media (min-width: 900px) { .hero-body { padding: 40px 48px; justify-content: center; } }
.hero-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: rgba(255,255,255,.8); flex-wrap: wrap; }
.pill { background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.hero-title { font-size: clamp(22px, 3.4vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.hero-desc { color: rgba(255,255,255,.82); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
@media (max-width: 600px) { .hero-desc, .hero-channel { display: none; } .hero-title { font-size: 22px; } .hero-actions .btn-lg { height: 42px; padding: 0 18px; } }
.hero-channel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: none; place-items: center; z-index: 2; }
.hero-nav svg { width: 24px; height: 24px; }
.hero-nav.prev { left: 12px; } .hero-nav.next { right: 12px; }
@media (hover: hover) and (min-width: 900px) { .hero:hover .hero-nav { display: grid; } }
.hero-dots { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 6px; z-index: 2; }
.hero-dots button { width: 8px; height: 8px; border-radius: 8px; border: 0; background: rgba(255,255,255,.45); padding: 0; transition: width .3s, background .3s; }
.hero-dots button[aria-selected="true"] { width: 24px; background: #fff; }

/* shelves (horizontal rows) */
.shelf { position: relative; }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; overscroll-behavior-x: contain; }
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track > * { scroll-snap-align: start; min-width: 0; }
@media (min-width: 560px) { .shelf-track { grid-auto-columns: calc((100% - 14px) / 2.3); } }
@media (min-width: 900px) { .shelf-track { grid-auto-columns: calc((100% - 28px) / 3.2); } }
@media (min-width: 1280px) { .shelf-track { grid-auto-columns: calc((100% - 42px) / 4.2); gap: 14px; } }
@media (min-width: 1700px) { .shelf-track { grid-auto-columns: calc((100% - 56px) / 5.2); } }
.shelf-track.channels { grid-auto-columns: 150px; }
.shelf-btn { position: absolute; top: calc(50% - 40px); z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow); }
.shelf-btn svg { width: 22px; height: 22px; }
.shelf-btn.prev { left: -12px; } .shelf-btn.next { right: -12px; }
@media (hover: none) { .shelf-btn { display: none !important; } }

/* card with channel avatar */
.card-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; margin-top: 2px; }
.card-meta a.creator:hover { color: var(--text); }
.thumb .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; pointer-events: none; background: #000; }
.thumb.previewing .preview { opacity: 1; }
.thumb.previewing .play { opacity: 0 !important; }

/* channel cards + grids */
.ch-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ch-card-name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.ch-card .card-meta { margin: 0; font-size: 12px; }
.ch-card .btn { height: 32px; font-size: 13px; padding: 0 14px; }
.ch-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sub-btn.is-subscribed { color: var(--text-2); }

/* channel page */
.channel-page { max-width: 1500px; margin: 0 auto; }
.ch-banner { position: relative; height: 150px; border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 900px) { .ch-banner { height: 210px; } }
.ch-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(1.1); }
.ch-info { display: flex; gap: 20px; align-items: center; padding: 18px 4px; flex-wrap: wrap; }
.ch-info > .avatar { border: 4px solid var(--bg); margin-top: -48px; }
@media (min-width: 900px) { .ch-info > .avatar { margin-top: 0; } }
.ch-text { flex: 1; min-width: 220px; }
.ch-text h1 { font-size: 28px; font-weight: 800; }
.ch-stats { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 4px; }
.ch-desc { color: var(--text-2); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 720px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--text); }
.about-panel { max-width: 760px; }
.stats-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 18px 0 0; }
.stats-list dt { color: var(--muted); }
.stats-list dd { margin: 0; font-weight: 600; }

/* subscriptions */
.sub-strip { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 18px; }
.sub-strip a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; flex: none; font-size: 12px; text-align: center; color: var(--text-2); }
.sub-strip span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* trending */
.trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.trend-list li { display: flex; gap: 12px; align-items: flex-start; }
.trend-list .rank { width: 28px; flex: none; font-size: 20px; font-weight: 800; color: var(--muted); text-align: center; padding-top: 30px; }
.trend-list li:nth-child(-n+3) .rank { color: var(--accent); }
.trend-list .card { flex: 1; min-width: 0; }
@media (max-width: 560px) { .trend-list .rank { display: none; } }

/* watch: channel row */
.creator-row { gap: 12px; }
.creator-text { min-width: 0; margin-right: 8px; }
.creator-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* comments */
.comments { margin-top: 24px; }
.comments-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.comments-title { font-size: 18px; font-weight: 700; }
.c-sort { width: auto; padding: 6px 10px; font-size: 14px; }
.composer { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.composer .avatar { background: var(--surface-2); color: var(--muted); }
.composer .avatar svg { width: 20px; height: 20px; }
.composer-main { flex: 1; min-width: 0; }
.composer-input { min-height: 40px; resize: none; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 8px 2px; overflow: hidden; }
.composer-input:focus { box-shadow: none; border-bottom-color: var(--text); }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.c-head b { font-weight: 600; }
.c-head span { color: var(--muted); }
.creator-badge { background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.c-body { margin: 4px 0 2px; white-space: pre-line; overflow-wrap: anywhere; font-size: 14.5px; }
.c-actions { display: flex; gap: 4px; align-items: center; margin-left: -8px; }
.c-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; background: none; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.c-act:hover { background: var(--surface-2); }
.c-act svg { width: 18px; height: 18px; }
.c-act.on { color: var(--danger); }
.c-toggle { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.c-replies { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.c-replybox .composer { margin: 10px 0 4px; }

/* auth */
body.is-auth .rail, body.is-auth .bottomnav { display: none; }
body.is-auth .page { margin-left: 0; }
.auth-wrap { min-height: calc(100vh - var(--topbar) - 80px); display: grid; place-items: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin: 14px 0 4px; }
.auth-card .page-sub { margin-bottom: 18px; }
.auth-brand { font-size: 18px; }
.auth-alt { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }
.auth-alt a { color: var(--accent); font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; }
.pw-toggle svg { width: 20px; height: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* rail extras */
.rail a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .rail-ch { height: 38px; }
.rail .rail-ch .avatar { font-size: 10px !important; }

/* admin users */
.user-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.user-row .info { flex: 1; min-width: 0; }
.user-row .info b { display: block; }
.user-row .info small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home { max-width: 1800px; margin: 0 auto; }
.hide-mobile[hidden], .hide-desktop[hidden] { display: none !important; }

/* ===== v3: account & security ===== */
.set-section { margin-bottom: 18px; padding: 0; overflow: hidden; }
.set-section > h2 { padding: 16px 18px 6px; margin: 0; font-size: 16px; }
.set-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-section > h2 + .set-row { border-top: 0; }
.set-text { flex: 1; min-width: 220px; }
.set-text p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.set-head { display: flex; gap: 14px; align-items: center; padding: 8px 18px 4px; }
.set-inline { display: flex; gap: 10px; align-items: flex-end; padding: 10px 18px 18px; flex-wrap: wrap; }
.danger-text { color: var(--danger) !important; }
.warn-notice { margin-bottom: 16px; border: 1px solid rgba(245,184,75,.35); }
.codes { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 18px; font-size: 16px; line-height: 1.9; columns: 2; font-family: ui-monospace, Consolas, monospace; margin: 14px 0; }
.qr { display: grid; place-items: center; margin: 12px 0; }
.qr canvas { border-radius: 10px; }
.secret { font-size: 13px; color: var(--muted); text-align: center; word-break: break-all; }
.secret code { color: var(--text); font-size: 14px; letter-spacing: .05em; }
.steps-list { padding-left: 20px; color: var(--text-2); margin: 10px 0; display: grid; gap: 4px; }
.otp-input { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-icon { display: grid; place-items: center; }
.mfa-icon svg { width: 44px; height: 44px; color: var(--accent); }
.report-row { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }
.report-row .info { flex: 1; min-width: 260px; display: grid; gap: 6px; }
.report-row .ops { display: flex; gap: 8px; align-items: center; }
.report-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-top small { color: var(--muted); }
.report-row a { color: var(--accent); }
.audit-table { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 13.5px; }
.audit-row { display: grid; grid-template-columns: 110px 190px 120px 1fr 170px; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); align-items: center; }
.audit-row.head { border-top: 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.audit-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-row .muted { color: var(--muted); }
.audit-row svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.audit-row.lvl-warn { background: rgba(245,184,75,.07); }
.audit-row.lvl-warn svg { color: var(--warn); }
.audit-row.lvl-alert { background: var(--danger-soft); }
.audit-row.lvl-alert svg { color: var(--danger); }
@media (max-width: 800px) { .audit-row { grid-template-columns: 90px 1fr 90px; } .audit-row span:nth-child(4), .audit-row span:nth-child(5) { display: none; } }
.prose-legal section { margin-top: 22px; }
.prose-legal h2 { font-size: 18px; margin-bottom: 8px; }
.prose-legal li { color: var(--text-2); margin-bottom: 6px; }
.prose-legal a, .rail-foot a { color: var(--accent); }
