:root {
  --bg: #0A0A0C;
  --surface: #131317;
  --surface-2: #17171C;
  --raised: #1B1B21;
  --line: #1F1F26;
  --line-2: #2A2A32;
  --text: #F4F4F5;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --faint: #8B8B95;
  --ok: #7FE3AE;
  --danger: #FF6B5A;
  --accent: #F5B544;
  --accent-ink: #16110A;
  --radius: 12px;
  --wrap: 1360px;
  --gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
a { color: var(--accent); }
a:hover { filter: brightness(1.15); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
.brand:hover { filter: none; }
.mono { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; gap: 2px; }
.brand-name { font-size: 18px; font-weight: 800; }
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { min-height: 40px; padding: 0 14px; border-radius: 10px; display: flex; align-items: center; color: var(--text-2);
  font-size: 14px; font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--surface); filter: none; }
.nav a.on { background: var(--surface); color: var(--text); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.account form { margin: 0; }
.lang { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; }
.lang a, .lang span { min-width: 30px; padding: 4px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-align: center; color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--text); background: var(--surface); filter: none; }
.lang .on { background: var(--surface); color: var(--text); }

/* ---------- buttons & forms */
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-ghost { background: none; }
.btn-danger { background: none; border-color: #5A2A26; color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date] { color-scheme: dark; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 0 20px; }

/* ---------- flash */
.flashes { margin: 20px 0 0; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); }
.flash-error { border-color: #5A2A26; color: #FFC2BA; background: #1E1212; }
.flash-ok { border-color: #1F4A35; color: #BFF3D6; background: #0F1A15; }

/* ---------- generic */
.card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 24px; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.display { margin: 0; font-size: clamp(40px, 6vw, 84px); line-height: .9; font-weight: 800; font-stretch: 70%; text-transform: uppercase; }
.h2 { margin: 0; font-size: 30px; line-height: 1; font-weight: 800; font-stretch: 72%; text-transform: uppercase; }
.h3 { margin: 0; font-size: 20px; font-weight: 800; font-stretch: 80%; text-transform: uppercase; letter-spacing: .01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 700; color: var(--text-2); }
.pill-draft { border-color: #4A3A1A; color: #F5D08A; background: #1D170C; }
.pill-live { border-color: #1F4A35; color: var(--ok); background: #0F1A15; }
.empty { margin: 40px 0; padding: 56px 24px; border-radius: 18px; border: 1px dashed var(--line-2); text-align: center; }
.empty .h2 { font-size: 28px; }
.page-head { padding: 48px 0 32px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-head { display: flex; align-items: center; gap: 16px; margin: 48px 0 22px; }
.section-head .rule { flex: 1 1 auto; height: 1px; background: var(--line); }
.section-head .count { font-size: 14px; color: var(--faint); white-space: nowrap; }

/* ---------- auth */
.auth { max-width: 420px; margin: 64px auto; }
.auth .display { font-size: clamp(36px, 7vw, 56px); margin-bottom: 8px; }
.auth .btn-primary { width: 100%; margin-top: 4px; }

/* ---------- film grid */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolbar form { flex: 1 1 260px; max-width: 380px; margin: 0; }
.film-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 13vw, 190px), 1fr)); gap: 36px 24px; }
.film-card { display: flex; flex-direction: column; gap: 14px; color: var(--text); text-decoration: none; transition: transform .2s ease; }
.film-card:hover { transform: translateY(-4px); filter: none; }
.film-card:hover .poster { box-shadow: 0 22px 44px rgba(0,0,0,.6); }
.film-meta { display: flex; flex-direction: column; gap: 4px; }
.film-date { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.film-title { font-size: 17px; line-height: 1.25; font-weight: 700; }
.film-orig { font-size: 13px; font-style: italic; color: var(--muted); }
.film-sub { font-size: 13px; color: var(--faint); }

.poster { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden;
  background: #1A1A20; container-type: inline-size; box-shadow: 0 10px 28px rgba(0,0,0,.45); transition: box-shadow .2s ease; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-type { position: absolute; inset: 0; padding: 8%; display: flex; flex-direction: column; justify-content: flex-end; gap: 3cqw;
  background: radial-gradient(circle at 50% 30%, var(--p-accent) 0 33%, transparent 33.5%), var(--p-bg); color: var(--p-ink); }
.poster-type .pt-credit, .poster-type .pt-date { font-size: 4.6cqw; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.poster-type .pt-title { font-size: 14cqw; line-height: .88; font-weight: 800; font-stretch: 65%; text-transform: uppercase; overflow-wrap: anywhere; }
.poster .badge { position: absolute; z-index: 2; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  background: rgba(10,10,12,.72); color: var(--text); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.poster .badge-left { right: auto; left: 8px; background: #F5D08A; color: #16110A; text-transform: uppercase; letter-spacing: .04em; padding: 0 8px; }

/* ---------- film page */
.film-hero { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: clamp(24px, 4vw, 56px); padding: 48px 0 40px; align-items: start; }
.film-hero .poster { max-width: 300px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 28px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 4px 0 0; font-size: 15px; color: var(--text); }
.lead { font-size: 19px; line-height: 1.5; color: var(--text-2); margin: 20px 0 0; max-width: 70ch; }
.prose { white-space: pre-line; color: var(--text-2); max-width: 72ch; line-height: 1.65; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }

.video-rows { display: flex; flex-direction: column; gap: 12px; }
.video-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 16px; align-items: center; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.video-row .name { font-size: 20px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); text-decoration: none; }
a.slot:hover { border-color: var(--accent); filter: none; }
.slot .s-label { font-size: 13px; font-weight: 700; }
.slot .s-size { font-size: 12px; color: var(--faint); }
.slot.missing { border-style: dashed; color: var(--faint); background: none; }
.slot svg { flex: 0 0 auto; color: var(--accent); }

.file-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.file-row:first-child { border-top: 0; }
.file-row:hover { background: #16161B; }
.file-name { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 14px; }
.file-info { font-size: 13px; color: var(--faint); white-space: nowrap; }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-actions form { margin: 0; display: flex; gap: 6px; align-items: center; }
.file-actions select, .file-actions input[type=text] { min-height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; border-radius: 8px; width: auto; }
.file-actions input[type=text] { padding-right: 10px; width: 90px; }
.thumb { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 8px; object-fit: contain; background: var(--raised); }
.thumb-ext { width: 64px; height: 64px; flex: 0 0 64px; align-items: center; border-radius: 8px; }
.ext { display: inline-flex; min-width: 42px; justify-content: center; padding: 3px 6px; border-radius: 6px; background: var(--raised);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }

/* ---------- studio */
.studio-table { width: 100%; border-collapse: collapse; }
.studio-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.studio-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.studio-table tr:hover td { background: #111115; }
.studio-table .t { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.table-scroll { overflow-x: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.status-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.status-choice label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; font-size: 14px; }
.status-choice input { accent-color: var(--accent); }
.danger-zone { margin-top: 48px; border-color: #3A1E1B; }
.danger-zone form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 0; }
.danger-zone input { max-width: 320px; }

/* ---------- uploader */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; padding: 32px 20px;
  border: 2px dashed var(--line-2); border-radius: 18px; background: #0F0F12; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #141210; }
.dropzone .big { font-size: 24px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; }
.dropzone p { margin: 0; }
.queue { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.q-item { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.q-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.q-name { flex: 1 1 240px; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.q-label { font-size: 12px; color: var(--muted); }
.q-state { font-size: 12px; font-weight: 700; color: var(--faint); white-space: nowrap; }
.q-item.done .q-state { color: var(--ok); }
.q-item.error .q-state { color: var(--danger); }
.q-bar { height: 6px; margin-top: 10px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.q-item.done .q-bar span { background: var(--ok); }
.q-item.error .q-bar span { background: var(--danger); }
.naming { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.naming code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: var(--text-2); }

/* ---------- download links */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.pick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; font-size: 14px; line-height: 1.4; }
.pick:has(input:checked) { border-color: var(--accent); }
.pick input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.pick .faint { font-size: 13px; }
.toggle-row { margin-top: 18px; }
.toggle-row > label { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; cursor: pointer; }
.toggle-row > label input { width: 18px; height: 18px; accent-color: var(--accent); }
.reveal { margin: 8px 0 0 28px; }
.js .reveal.hidden { display: none; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mono-input { flex: 1 1 280px; min-width: 0; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important; font-size: 14px !important; border-color: var(--accent) !important; }
.card-accent { border-color: var(--accent); }
.share-head { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: clamp(20px, 4vw, 48px); padding: 40px 0 8px; align-items: end; }
.share-head .display { font-size: clamp(36px, 5.5vw, 72px); }
.share-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media (max-width: 640px) {
  .share-head { grid-template-columns: 1fr; }
  .share-poster { max-width: 160px; }
}

.invite-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.flash { overflow-wrap: anywhere; }

/* ---------- video player */
.video-head { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.video-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 10px;
  overflow: hidden; background: #000; cursor: pointer; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .15s; }
.video-thumb:hover img { opacity: 1; }
.video-thumb .play-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.video-thumb .play-icon svg { margin-left: 3px; }
.video-thumb .dur { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(10,10,12,.75);
  color: var(--text); font-size: 12px; font-weight: 700; }
.video-thumb-sm { width: 112px; flex: 0 0 112px; border-radius: 8px; }
.video-thumb-sm .play-icon { width: 32px; height: 32px; }
.player { width: min(1200px, 96vw); max-height: 96vh; padding: 0; border: 1px solid var(--line-2); border-radius: 14px;
  background: #000; color: var(--text); }
.player::backdrop { background: rgba(0,0,0,.8); }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px;
  background: var(--surface); font-weight: 700; font-size: 15px; }
.player video { display: block; width: 100%; max-height: calc(96vh - 60px); background: #000; }
.video-row { grid-template-columns: minmax(160px, 260px) 1fr; }

.fr-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-mark { width: 64px; height: 40px; flex: 0 0 64px; border-radius: 8px; background: var(--raised); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; }

/* ---------- admin site list */
.sites { display: flex; flex-direction: column; gap: 10px; }
.site-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.site-row .mono { background: var(--row-accent); color: var(--row-ink); }
.site-row .grow { flex: 1 1 220px; min-width: 0; }

/* ---------- footer */
.footer { border-top: 1px solid var(--line); margin-top: 64px; }
.footer .wrap { padding-top: 24px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--faint); }

@media (max-width: 720px) {
  .film-hero { grid-template-columns: 1fr; }
  .film-hero .poster { max-width: 220px; }
  .video-row { grid-template-columns: 1fr; }
  .account .who { display: none; }
  .page-head { padding-top: 32px; }
}
