:root {
  --ink: #f2f5f3;
  --muted: #8b9993;
  --paper: #090b0a;
  --card: #111412;
  --card-raised: #151917;
  --line: #252b28;
  --line-strong: #353e39;
  --brand: #00cc99;
  --brand-hot: #24e0b1;
  --brand-dark: #009b75;
  --green: #5ed39a;
  --danger: #ff725c;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}

a { color: inherit; text-decoration: none; }

nav {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 10, .9);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.045em;
}

.brand::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: var(--brand);
  content: "";
  transform: skewX(-16deg);
}

.brand span { color: var(--brand); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  font-weight: 750;
}

.nav-actions a { transition: color .18s ease; }
.nav-actions a:hover { color: var(--brand-hot); }
.nav-actions form { margin: 0; }

.link-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.link-button:hover { color: var(--ink); }

main {
  width: 100%;
  max-width: 760px;
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 66px 24px 92px;
}

.wide { max-width: 1180px; }

footer {
  padding: 30px;
  color: #64706a;
  font-size: 12px;
  text-align: center;
  letter-spacing: .04em;
}

.eyebrow {
  margin-bottom: 11px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -.055em;
}

h2 { letter-spacing: -.035em; }

.muted,
.video-meta p {
  color: var(--muted);
  line-height: 1.65;
}

.auth-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(145deg, var(--card-raised), var(--card));
  box-shadow: var(--shadow);
}

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.auth-divider::before,.auth-divider::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.auth-help { margin: 20px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.modal { width: min(520px,calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); color: var(--ink); background: var(--card-raised); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(5px); }
.modal>form { padding: 28px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 26px; }
.modal-close { border: 0; color: var(--muted); background: transparent; font-size: 26px; cursor: pointer; }
.user-admin-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.user-admin-actions form { margin: 0; }
.security-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.security-events { grid-column: 1 / -1; }
.setup-2fa img { display: block; width: 220px; max-width: 100%; margin: 18px auto; background: #fff; }
.setup-2fa>code { display: block; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); color: var(--brand-hot); text-align: center; }
.recovery-codes { margin-bottom: 16px; border-color: var(--brand); }
.recovery-codes>div { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.recovery-codes code { padding: 10px; border: 1px solid var(--line); text-align: center; }
.lockout-list { margin: 0; padding: 0; list-style: none; }
.lockout-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.lockout-list span { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.security-events table { width: 100%; border-collapse: collapse; font-size: 11px; }
.security-events th,.security-events td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
@media (max-width:760px) { .security-grid { grid-template-columns: 1fr; } .security-events { grid-column: auto; } }

.client-area-list { display: grid; gap: 12px; }
.client-area-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); background: var(--card); }
.client-area-card>div { min-width: 0; flex: 1; }
.client-area-card h2 { margin: 0; font-size: 19px; }
.client-area-card p { margin: 8px 0; color: var(--muted); }
.client-area-card small { color: var(--brand); }
.client-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.client-video-assignments { grid-column: 1 / -1; }
.assignment-list { display: grid; max-height: 430px; overflow-y: auto; border: 1px solid var(--line); }
.assignment-row { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; padding: 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.assignment-row:last-child { border-bottom: 0; }
.assignment-row:hover { background: rgba(255,255,255,.025); }
.assignment-row input { width: auto; }
.assignment-row strong,.assignment-row small { display: block; }
.assignment-row small { margin-top: 4px; color: var(--muted); }
.danger-zone { border-color: rgba(255,114,92,.35); }
.portal-area-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.portal-area-card { min-height: 230px; padding: 24px; border: 1px solid var(--line); background: linear-gradient(145deg,var(--card-raised),var(--card)); transition: border-color .16s ease,transform .16s ease; }
.portal-area-card:hover { border-color: var(--brand); transform: translateY(-3px); }
.portal-area-card h2 { margin: 0 0 12px; font-size: 24px; }
.portal-area-card p { min-height: 70px; color: var(--muted); line-height: 1.55; }
.portal-area-card>span { color: var(--brand-hot); font-size: 11px; font-weight: 750; }
.portal-video-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.portal-video-card { overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.portal-video-card .thumb { width: 100%; }
.portal-video-card>div { padding: 18px; }
.portal-video-card h2 { margin: 12px 0 8px; font-size: 19px; }
.portal-video-card p { min-height: 45px; color: var(--muted); line-height: 1.5; }
.portal-video-card small { color: var(--brand); }
@media (max-width:900px) { .portal-area-grid,.portal-video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) { .client-admin-grid,.portal-area-grid,.portal-video-grid { grid-template-columns: 1fr; } .client-video-assignments { grid-column: auto; } .client-area-card { align-items: stretch; flex-direction: column; } }

.auth-card {
  max-width: 460px;
  margin: 28px auto;
  padding: 40px;
  border-top: 2px solid var(--brand);
}

.panel { padding: 34px; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 28px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #c9d0cc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: #0c0f0d;
  font: inherit;
  text-transform: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea { resize: vertical; }

input::placeholder,
textarea::placeholder { color: #56615b; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 4px 4px 0 rgba(0, 204, 153, .14);
}

button,
.button {
  border: 0;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}

.primary,
.secondary,
.copy-row button {
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
}

.primary {
  padding: 14px 21px;
  color: #fff;
  background: var(--brand);
  box-shadow: none;
  font-weight: 850;
  transition: background .18s ease, transform .18s ease;
}

.primary:hover {
  background: var(--brand-hot);
  transform: translateY(-2px);
}

.primary:active { transform: translateY(0); }
.primary:disabled { cursor: wait; opacity: .6; }

.secondary {
  padding: 12px 17px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #181c1a;
  font-weight: 750;
}

.secondary:hover { background: #202622; }
.compact { white-space: nowrap; font-size: 12px; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.page-header p { max-width: 570px; }

.library {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 2px solid transparent;
  border-radius: 0;
  background: var(--card);
  transition: border-color .18s ease, background .18s ease;
}

.video-row:hover {
  border-left-color: var(--brand);
  background: var(--card-raised);
}

.video-row[draggable="true"] { cursor: grab; }
.video-row[draggable="true"]:active { cursor: grabbing; }
.video-row.is-dragging { opacity: .35; border-color: var(--brand); }

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  color: var(--muted);
  background: #1a201d;
  font-size: 28px;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.failed { color: var(--brand); background: #281713; }

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.video-meta h2 { margin: 0; font-size: 18px; }
.video-meta p { margin: 6px 0; font-size: 12px; }
.tags { display: flex; gap: 7px; }

.tags span,
.badge {
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.badge.ready { border-color: #285b45; color: var(--green); background: #10231b; }
.badge.failed { border-color: #653226; color: var(--danger); background: #281713; }

.empty {
  position: relative;
  overflow: hidden;
  padding: 94px 20px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
  text-align: center;
}

.empty::before,
.empty::after {
  position: absolute;
  width: 70px;
  height: 1px;
  background: var(--brand);
  content: "";
}

.empty::before { top: 25px; left: -16px; transform: rotate(-45deg); }
.empty::after { right: -16px; bottom: 25px; transform: rotate(-45deg); }
.empty-icon { color: var(--brand); font-size: 31px; }
.empty h2 { margin-bottom: 6px; font-size: 25px; }
.empty p { margin-bottom: 30px; color: var(--muted); }

.alert {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 0;
  font-size: 13px;
}

.alert.error { border-color: #613025; color: #ff9a87; background: #261512; }
.alert.success { border-color: #285b45; color: #83dfb2; background: #10231b; }

.drop-zone {
  align-items: center;
  padding: 34px;
  border: 1px dashed #46514b;
  border-radius: 0;
  background: #0c0f0d;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.drop-zone:hover { border-color: var(--brand); background: #121512; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone span { color: var(--brand-hot); font-size: 15px; text-transform: none; }
.drop-zone small { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding-top: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr);
  gap: 28px;
}

.player-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #030403;
  box-shadow: var(--shadow);
}

video { width: 100%; height: 100%; background: #000; }
.processing { padding: 30px; color: #fff; text-align: center; }
.processing p { color: var(--muted); }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 2px solid #39413d;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.detail-grid aside h1 { font-size: 30px; }

.facts {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 11px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.danger {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  border: 1px solid #663226;
  border-radius: 0;
  color: var(--danger);
  background: transparent;
  font-weight: 750;
}

.danger:hover { background: #281713; }

.share-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
}

.copy-row { display: flex; }
.copy-row input { border-right: 0; font-size: 12px; background: #090b0a; }
.copy-row button { padding: 0 17px; color: #fff; background: var(--brand); font-weight: 750; }

.watch { max-width: 1000px; margin: auto; }
.watch-copy { max-width: 760px; padding: 38px 4px; }
.watch-copy p { color: #a5b0aa; font-size: 17px; line-height: 1.75; }
.embed { overflow: hidden; margin: 0; background: #000; }
.embed video { position: absolute; inset: 0; }
.embed script { display: none; }

@media (max-width: 800px) {
  main { padding-top: 40px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .video-row { grid-template-columns: 120px 1fr; }
  .video-row > .secondary { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .nav-actions { gap: 17px; }
  .auth-card, .panel { padding: 25px; }
}

@media (max-width: 520px) {
  nav { height: 64px; }
  main { padding-inline: 18px; }
  .brand::before { display: none; }
  .video-row { grid-template-columns: 1fr; }
  .thumb { width: 100%; }
  .page-header .button { width: 100%; text-align: center; }
  h1 { font-size: 38px; }
  .empty { padding: 70px 18px; }
}

/* Administration, organisation and background upload states */
.nav-role { padding: 4px 7px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.library-filters { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,.45fr) auto auto; align-items: end; gap: 12px; margin-bottom: 18px; padding: 15px; border: 1px solid var(--line); background: var(--card); }
.library-filters label span { color: var(--muted); }
.filter-clear { align-self: center; color: var(--muted); font-size: 12px; }
.filter-clear:hover { color: var(--brand); }
.upload-progress { padding: 16px; border: 1px solid var(--line); background: #0c0f0d; }
.upload-progress[hidden] { display: none; }
.progress-track { height: 4px; background: #282e2b; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--brand); transition: width .15s linear; }
.progress-copy { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 11px; }
.progress-copy strong { color: var(--ink); }
.category-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.category-picker legend { grid-column: 1/-1; margin-bottom: 8px; color: #c9d0cc; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.check-tile { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); background: #0c0f0d; cursor: pointer; text-transform: none; }
.check-tile:has(input:checked) { border-color: var(--brand); background: #0a211b; }
.check-tile input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); box-shadow: none; }
.check-tile span { color: var(--ink); font-size: 12px; letter-spacing: 0; }
.field-note,.permission-note { padding: 13px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 12px; line-height: 1.5; }
.management-grid { display: grid; grid-template-columns: minmax(280px,.62fr) minmax(0,1.38fr); gap: 24px; align-items: start; }
.management-grid h2 { margin-top: 0; }
.manage-list,.user-list { display: flex; flex-direction: column; gap: 10px; }
.manage-row { display: grid; grid-template-columns: minmax(150px,.7fr) minmax(240px,1fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); background: var(--card); }
.manage-row h2 { margin: 0 0 4px; font-size: 16px; }
.manage-row p { margin: 0; color: var(--muted); font-size: 11px; }
.inline-edit { display: flex; }
.inline-edit input { min-width: 0; border-right: 0; }
.icon-danger { padding: 8px 12px; color: var(--danger); background: transparent; font-size: 21px; }
.icon-danger:hover { background: #281713; }
.compact-empty { padding: 60px 20px; }
.sticky-panel { position: sticky; top: 96px; }
.user-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.user-card { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; padding: 18px; border: 1px solid var(--line); background: var(--card); }
.user-card.inactive { opacity: .58; }
.user-avatar { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--brand); font-weight: 900; clip-path: polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,8px 100%,0 calc(100% - 8px)); }
.user-copy h2 { margin: 0; font-size: 16px; }
.user-copy p { margin: 5px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.user-copy small { color: #68746e; line-height: 1.45; }
.user-card details { grid-column: 1/-1; margin-top: 5px; border-top: 1px solid var(--line); }
.user-card summary { padding-top: 13px; color: var(--brand); font-size: 11px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: .08em; }
.compact-stack { gap: 12px; margin-top: 15px; }
.switch-row { flex-direction: row; align-items: center; }
.switch-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.switch-row span { text-transform: none; }
.public-tags { margin-top: 22px; }

@media (max-width:800px) {
  .nav-role { display: none; }
  .library-filters { grid-template-columns: 1fr 1fr; }
  .management-grid { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .user-list { grid-template-columns: 1fr; }
}

@media (max-width:520px) {
  .nav-actions a:not(:first-child) { display: none; }
  .nav-actions { gap: 14px; }
  .library-filters,.category-picker { grid-template-columns: 1fr; }
  .manage-row { grid-template-columns: 1fr auto; }
  .manage-row>div { grid-column: 1/-1; }
  .inline-edit { min-width: 0; }
}

/* Persistent application sidebar */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: 244px; padding: 28px 18px 18px; border-right: 1px solid var(--line); background: #0c0f0d; }
.sidebar .brand { display: block; padding: 0 10px 27px; border-bottom: 1px solid var(--line); }
.side-scroll { flex: 1; overflow-y: auto; padding-top: 22px; }
.side-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 28px; }
.side-label { padding: 0 12px 8px; color: #58635d; font-size: 9px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.side-group a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 10px 12px; border-left: 2px solid transparent; color: #aeb8b2; font-size: 13px; font-weight: 720; transition: color .16s ease,background .16s ease,border-color .16s ease; }
.side-group a:hover { border-left-color: var(--brand); color: var(--ink); background: #151916; }
.side-icon { width: 18px; color: var(--brand); font-size: 16px; text-align: center; }
.side-account { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.side-account>div { min-width: 0; }
.side-account strong,.side-account span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account strong { max-width: 120px; font-size: 11px; }
.side-account span { margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.side-account .link-button { font-size: 10px; }
.app-frame { min-height: 100vh; margin-left: 244px; }
.app-frame main { min-height: calc(100vh - 80px); }
.guest-header { display: flex; align-items: center; height: 72px; padding: 0 max(24px,calc((100vw - 1180px)/2)); border-bottom: 1px solid var(--line); background: #0c0f0d; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:last-child { color: var(--ink); }
.breadcrumbs a:hover { color: var(--brand); }
.folder-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.folder-card { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; min-width: 0; padding: 17px; border: 1px solid var(--line); background: var(--card); transition: border-color .16s ease,transform .16s ease; }
.folder-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.organising-video .move-target { border-color: #247a64; background: #0c1d18; }
.move-target.drag-over { border-color: var(--brand); color: #fff; background: #0b3026; box-shadow: inset 0 0 0 1px var(--brand); transform: translateY(-2px); }
.folder-icon { color: var(--brand); font-size: 22px; transform: skewX(-8deg); }
.folder-card strong,.folder-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card strong { font-size: 13px; }
.folder-card small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.folder-arrow { color: var(--muted); font-size: 24px; }
.new-folder { position: relative; }
.new-folder>summary { list-style: none; }
.new-folder>summary::-webkit-details-marker { display: none; }
.new-folder[open]>summary { border-color: var(--brand); }
.new-folder form { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: flex; width: 330px; padding: 12px; border: 1px solid var(--line-strong); background: #111412; box-shadow: var(--shadow); }
.new-folder form input { border-right: 0; }
.new-folder form button { white-space: nowrap; }
.scope-toggle { display: flex; gap: 2px; margin: -22px 0 24px; border-bottom: 1px solid var(--line); }
.scope-toggle a { padding: 11px 15px 10px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.scope-toggle a:hover { color: var(--ink); }
.scope-toggle a.active { border-bottom-color: var(--brand); color: var(--ink); }
.video-actions { display: flex; align-items: center; gap: 7px; }
.move-menu { position: relative; }
.move-menu>summary { list-style: none; cursor: pointer; }
.move-menu>summary::-webkit-details-marker { display: none; }
.move-menu[open]>summary { border-color: var(--brand); }
.move-menu form { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; display: grid; grid-template-columns: minmax(180px,1fr) auto; width: 330px; padding: 10px; border: 1px solid var(--line-strong); background: #111412; box-shadow: var(--shadow); }
.move-menu select { min-width: 0; border-right: 0; }
.move-toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; max-width: min(420px,calc(100vw - 48px)); padding: 14px 18px; border: 1px solid var(--green); color: var(--ink); background: #10231b; box-shadow: var(--shadow); font-size: 12px; font-weight: 750; }
.move-toast.error { border-color: var(--danger); background: #281713; }
.drop-overlay { position: fixed; z-index: 100; inset: 20px 20px 20px 264px; border: 2px dashed var(--brand); background: rgba(9,11,10,.94); backdrop-filter: blur(10px); }
.drop-overlay[hidden] { display: none; }
.drop-overlay>div { position: absolute; inset: 50% auto auto 50%; width: min(440px,80%); text-align: center; transform: translate(-50%,-50%); }
.drop-overlay strong,.drop-overlay span { display: block; }
.drop-overlay strong { font-size: 25px; }
.drop-overlay span { margin-top: 8px; color: var(--muted); }
.drop-overlay .progress-track { margin-top: 24px; }
.drop-overlay .progress-track i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .12s linear; }
.drop-zone { display: flex; flex-direction: column; min-height: 190px; justify-content: center; }
.drop-zone.drag-active { border-color: var(--brand); background: #0a211b; }
.drop-zone.has-files { border-style: solid; border-color: var(--green); }
.picker-actions { display: flex; gap: 8px; margin-top: 12px; }
.picker-actions label { color: var(--ink); font-size: 11px; letter-spacing: 0; text-transform: none; }
.selection-count { margin-top: 10px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: none; }
label small { color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }

@media (max-width:1100px) {
  .folder-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width:900px) {
  .sidebar { width: 72px; padding-inline: 10px; }
  .sidebar .brand { height: 42px; padding-inline: 0; overflow: hidden; font-size: 0; text-align: center; }
  .sidebar .brand::before { display: none; }
  .sidebar .brand::after { content: "TV"; color: var(--brand); font-size: 17px; font-weight: 900; }
  .sidebar .brand span,.side-label,.side-group a:not(.side-icon) { font-size: 0; }
  .side-group a { justify-content: center; padding-inline: 0; }
  .side-icon { font-size: 17px; }
  .side-account>div { display: none; }
  .side-account { justify-content: center; padding-inline: 0; }
  .side-account .link-button { font-size: 0; }
  .side-account .link-button::after { content: "↪"; font-size: 18px; }
  .app-frame { margin-left: 72px; }
  .drop-overlay { left: 92px; }
}

@media (max-width:620px) {
  .app-frame main { padding-inline: 16px; }
  .folder-grid { grid-template-columns: 1fr; }
  .header-actions { width: 100%; }
  .header-actions>* { flex: 1; }
  .header-actions .button { width: 100%; text-align: center; }
  .new-folder form { right: auto; left: 0; width: min(330px,calc(100vw - 112px)); }
  .picker-actions { flex-direction: column; width: 100%; }
  .drop-overlay { inset: 10px 10px 10px 82px; }
}

/* Library views and server-side pagination */
.library-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 10px; margin-bottom: 18px; }
.library-tools .library-filters { margin-bottom: 0; }
.view-toggle { display: flex; border: 1px solid var(--line); background: var(--card); }
.view-toggle a { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; color: var(--muted); font-size: 19px; }
.view-toggle a+a { border-left: 1px solid var(--line); }
.view-toggle a:hover { color: var(--ink); background: #191d1b; }
.view-toggle a.active { color: #fff; background: var(--brand); }
.library.grid-view { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 12px; }
.grid-view .video-row { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; gap: 0; border-left-width: 1px; }
.grid-view .video-row:hover { border-left-color: var(--brand); transform: translateY(-2px); }
.grid-view .thumb { width: 100%; }
.grid-view .video-meta { flex: 1; min-width: 0; padding: 16px; }
.grid-view .video-meta h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-view .video-meta p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 38px; }
.grid-view .row-top { align-items: flex-start; }
.grid-view .tags { flex-wrap: wrap; }
.grid-view .video-row>.secondary { align-self: flex-start; margin: 0 16px 16px; }
.grid-view .video-actions { align-items: flex-end; justify-content: space-between; margin: 0 16px 16px; }
.grid-view .move-menu form { right: auto; left: 0; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; margin-top: 26px; }
.pagination a,.pagination span { display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 11px; border: 1px solid var(--line); color: var(--muted); background: var(--card); font-size: 11px; font-weight: 750; }
.pagination a:hover { border-color: var(--brand); color: var(--ink); }
.pagination a.active { border-color: var(--brand); color: #fff; background: var(--brand); }
.pagination .disabled { opacity: .4; }
.pagination .ellipsis { min-width: 26px; padding: 0; border-color: transparent; background: transparent; }

@media (max-width:1200px) {
  .library.grid-view { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width:760px) {
  .library-tools { grid-template-columns: 1fr; }
  .view-toggle { justify-self: end; }
}

@media (max-width:620px) {
  .library.grid-view { grid-template-columns: 1fr; }
  .view-toggle { justify-self: stretch; }
  .view-toggle a { flex: 1; }
  .pagination a,.pagination span { min-width: 34px; height: 34px; padding-inline: 8px; }
  .scope-toggle { margin-top: -26px; }
  .move-menu form { position: fixed; inset: auto 16px 18px 88px; width: auto; }
}

/* Download delivery and password-protected client review */
.download-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 20px; border: 1px solid var(--line); background: var(--card); }
.download-panel h2,.review-admin h2,.review-form h2,.review-timeline h2 { margin: 0; font-size: 19px; }
.download-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.download-links a,.review-downloads a { display: flex; align-items: center; gap: 10px; }
.download-links a span,.review-downloads a span { color: var(--muted); font-size: 9px; }
.download-preparing { max-width: 260px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-admin { margin-top: 18px; }
.review-heading,.review-form-head,.review-timeline-head,.review-comment-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.review-admin>.link-button { margin-top: 14px; color: var(--brand); }
.admin-feedback { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-feedback h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; font-size: 14px; }
.admin-feedback h3 span,.review-timeline-head>span { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; height: 25px; padding: 0 7px; color: #04110d; background: var(--brand); font-size: 10px; font-weight: 900; }
.admin-review-comment { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-review-comment p,.review-comment p { margin: 5px 0 8px; color: #c7cfcb; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.admin-review-comment small,.review-comment small { color: var(--muted); font-size: 9px; }
.comment-source { margin-left: 8px; padding: 3px 6px; color: var(--brand-hot); background: #0a211b; font-size: 9px; }
.admin-review-comment.resolved,.review-comment.resolved { opacity: .55; }
.comment-admin-actions { display: flex; gap: 8px; }
.comment-admin-actions form { margin: 0; }
.comment-admin-actions button { font-size: 10px; }
.danger-link { color: var(--danger); }
.timecode { padding: 6px 8px; border: 1px solid #247a64; color: var(--brand-hot); background: #0a211b; font-size: 10px; font-weight: 850; cursor: pointer; }
.timecode:hover { color: #04110d; background: var(--brand); }
.review-unlock h1 { font-size: 34px; }
.review-workspace { width: 100%; }
.review-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.review-title p { max-width: 620px; }
.review-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(300px,.72fr); gap: 22px; align-items: start; }
.review-player { position: sticky; top: 18px; }
.review-form { margin-top: 18px; }
.review-form .review-form-head { margin-bottom: 20px; }
.review-form .capture-time { font-size: 10px; }
.review-timeline { overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.review-timeline-head { padding: 18px; border-bottom: 1px solid var(--line); }
.review-comment { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.review-comment:last-child { border-bottom: 0; }
.review-comment-top span { color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.review-downloads { position: relative; }
.review-downloads>summary { list-style: none; }
.review-downloads>summary::-webkit-details-marker { display: none; }
.review-downloads[open]>summary { border-color: var(--brand); }
.review-downloads>div { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: grid; gap: 6px; min-width: 220px; padding: 9px; border: 1px solid var(--line-strong); background: #111412; box-shadow: var(--shadow); }
.review-downloads a { justify-content: space-between; }

@media (max-width:900px) {
  .review-layout { grid-template-columns: 1fr; }
  .review-player { position: static; }
}

@media (max-width:620px) {
  .download-panel,.review-title,.review-form-head { align-items: stretch; flex-direction: column; }
  .download-links { justify-content: flex-start; }
  .review-downloads>summary { text-align: center; }
  .review-downloads>div { right: auto; left: 0; }
  .admin-review-comment { grid-template-columns: auto minmax(0,1fr); }
  .comment-admin-actions { grid-column: 2; }
}
