@view-transition { navigation: auto; }
[x-cloak] { display: none !important; }

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f232c;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #e5484d;
  --accent-2: #ff6b6f;
  --ok: #3fb950;
  --warn: #d29922;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(15,17,21,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: .3px; }
.brand b { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.nav a.on { color: var(--text); background: var(--panel-2); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3a4150; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8589; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; }
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err { color: #ff8589; font-size: 14px; margin: 8px 0; }
.ok { color: var(--ok); font-size: 14px; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack > * + * { margin-top: 16px; }

/* Login */
.login { max-width: 380px; margin: 8vh auto 0; }
.login h1 { text-align: center; font-size: 28px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0; }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tag { display: inline-block; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; margin: 2px 4px 0 0; color: var(--muted); }

/* Video grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.vcard { text-decoration: none; display: block; }
.thumb { aspect-ratio: 16/9; border-radius: var(--radius); background: linear-gradient(135deg, #2b1416, #161a24 60%, #10131a); border: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; }
.thumb::after { content: ""; width: 0; height: 0; border-left: 22px solid rgba(255,255,255,.85); border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }
.vcard:hover .thumb { border-color: var(--accent); }
.vtitle { font-weight: 600; margin: 8px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag.free { color: #7ee2a8; border-color: #23603d; background: #0f2a1b; }
.skel { background: var(--panel-2); border-radius: var(--radius); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Player */
.player { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); display: block; }
.desc { white-space: pre-wrap; color: #c9cdd6; }

/* Studio */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.cols { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .top-in { gap: 8px; }
  .nav { margin-left: 0; }
  .nav a { padding: 6px 8px; }
  .who span { display: none; }
}
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.item.sel { border-color: var(--accent); }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; overflow-wrap: anywhere; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--accent); }
.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--accent); transition: width .2s; }
.member { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.member:last-child { border-bottom: 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
