:root {
  --bg: #0b0b12;
  --surface: #12121c;
  --surface-raised: #191925;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f3ff;
  --muted: #9795a8;
  --violet: #9b7cff;
  --violet-bright: #b9a4ff;
  --teal: #38d5bd;
  --blue: #5f8dff;
  --amber: #f3b95f;
  --red: #ff6b7c;
  --radius: 18px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
html:has(.video-dialog[open]),
body:has(.video-dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(100px);
  border-radius: 999px;
  opacity: .17;
}
.ambient-one { width: 450px; height: 450px; background: #6941ff; top: -220px; right: 15%; }
.ambient-two { width: 380px; height: 380px; background: #164e63; bottom: -240px; left: 20%; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--violet-bright);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.login-view {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(390px, 540px) 1fr;
  min-height: 100vh;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 110px);
  background: rgba(11, 11, 18, .82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 42px;
  border: 1px solid rgba(185, 164, 255, .6);
  border-radius: 18px 6px 18px 6px;
  color: var(--violet-bright);
  background: linear-gradient(145deg, rgba(155, 124, 255, .2), rgba(56, 213, 189, .05));
  box-shadow: inset 0 0 22px rgba(155, 124, 255, .12);
  font-weight: 850;
  letter-spacing: -.05em;
}
.login-panel h1 {
  max-width: 520px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 70px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
}
.login-copy {
  max-width: 420px;
  margin: 24px 0 34px;
  color: var(--muted);
  line-height: 1.65;
}
.login-form { display: grid; gap: 17px; max-width: 430px; }
.login-form label { display: grid; gap: 8px; color: #c9c6d5; font-size: 13px; }
.login-form input, .filter-bar input, .filter-bar select {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
}
.login-form input { height: 50px; padding: 0 15px; }
.login-form input:focus, .filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(155, 124, 255, .12);
}
.form-error { margin: 0; color: #ff9eaa; font-size: 13px; }
.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 720;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  margin-top: 5px;
  color: #0d0b16;
  background: linear-gradient(135deg, var(--violet-bright), #d2c5ff);
}
.button-secondary {
  color: #dad7e6;
  background: rgba(255, 255, 255, .045);
  border-color: var(--line-strong);
}
.privacy-note { margin-top: 24px; color: #656476; font-size: 11px; }
.login-art {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-art::after {
  content: "";
  position: absolute;
  inset: 15%;
  background: radial-gradient(circle, rgba(155, 124, 255, .2), transparent 68%);
}
.orbit { position: absolute; border: 1px solid rgba(185, 164, 255, .14); border-radius: 50%; }
.orbit-a { width: 620px; height: 620px; top: 8%; left: 15%; }
.orbit-b { width: 440px; height: 440px; top: 19%; left: 25%; border-style: dashed; }
.vault-card {
  position: absolute;
  z-index: 2;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(18, 18, 28, .74);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.vault-card-main {
  top: 30%;
  left: 24%;
  width: min(420px, 52vw);
  min-height: 260px;
  border-radius: 32px 10px 32px 10px;
  transform: rotate(-3deg);
}
.vault-card-main strong {
  display: block;
  margin: 48px 0 34px;
  font-family: Georgia, serif;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1;
  font-weight: 500;
}
.vault-index { color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.vault-status { color: #b9b6c7; font-size: 12px; }
.vault-status i {
  display: inline-block;
  width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 16px var(--teal);
}
.vault-card-small {
  right: 12%;
  bottom: 18%;
  display: grid;
  gap: 8px;
  width: 145px;
  border-radius: 10px 24px 10px 24px;
  transform: rotate(7deg);
}
.vault-card-small span { color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.vault-card-small strong { font-size: 24px; }

.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  background: rgba(12, 12, 19, .94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; }
.brand-mark-small { width: 38px; height: 38px; margin: 0; border-radius: 12px 4px 12px 4px; font-size: 13px; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.nav-label { margin: 22px 12px 8px; color: #595868; font-size: 9px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: 10px;
  color: #aaa8b9;
  font-size: 13px;
  font-weight: 600;
}
.nav-link > span:first-child { width: 18px; color: #777586; font-size: 17px; text-align: center; }
a.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-link.active { color: var(--text); background: rgba(155,124,255,.12); }
.nav-link.active > span:first-child { color: var(--violet-bright); }
.nav-link-muted { opacity: .48; cursor: default; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.account > span:last-child { display: grid; min-width: 0; }
.account strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account small { color: var(--muted); font-size: 10px; }
.account-avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: #e3dcff; background: rgba(155,124,255,.18); font-size: 11px; font-weight: 800; }
.icon-button, .menu-button {
  border: 0; color: var(--muted); background: transparent; cursor: pointer;
}
.icon-button { font-size: 17px; }

.workspace { min-width: 0; padding: 0 clamp(22px, 4vw, 58px) 60px; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 140px;
  padding: 36px 0 28px;
}
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 500; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
#refresh-button.attention {
  border-color: rgba(56,213,189,.65);
  color: #d7fff8;
  background: rgba(56,213,189,.12);
  box-shadow: 0 0 0 3px rgba(56,213,189,.08);
}
.button-danger {
  border-color: rgba(255,107,124,.38);
  color: #ffd5da;
  background: rgba(255,107,124,.1);
}
.button-danger:hover { border-color: rgba(255,107,124,.7); background: rgba(255,107,124,.16); }
.last-update { color: var(--muted); font-size: 11px; }
.menu-button { display: none; }
.page { animation: reveal .25s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

.alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 15px; border: 1px solid rgba(255,107,124,.22); border-radius: 12px;
  color: #ffd5da; background: rgba(255,107,124,.07); font-size: 12px;
}
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card {
  position: relative;
  min-height: 142px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
}
.metric-card::after {
  content: ""; position: absolute; right: -35px; bottom: -45px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--glow, var(--violet)); filter: blur(45px); opacity: .2;
}
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card strong { display: block; margin: 17px 0 5px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.metric-card small { color: #696879; font-size: 10px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #15151f, #1c1c28, #15151f); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.metric-skeleton { min-height: 142px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 12px; margin-top: 12px; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18,18,28,.76); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.text-link { color: var(--violet-bright); font-size: 11px; font-weight: 700; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.recent-row:first-child { border-top: 0; }
.thumb-placeholder { display: grid; place-items: center; width: 44px; height: 54px; overflow: hidden; border-radius: 8px; color: rgba(255,255,255,.35); background: linear-gradient(145deg, #292039, #152c32); font-size: 10px; }
.thumb-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.recent-copy { min-width: 0; }
.recent-copy strong, .recent-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy strong { font-size: 12px; }
.recent-copy span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; color: var(--badge-color, #aaa); background: color-mix(in srgb, var(--badge-color, #aaa) 12%, transparent); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.system-status { display: grid; gap: 2px; }
.system-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }
.system-row:first-child { border-top: 0; }
.system-row span { color: var(--muted); font-size: 11px; }
.system-row strong { font-size: 11px; }
.status-ok { color: var(--teal); }
.status-bad { color: var(--red); }
.runtime-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.runtime-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.runtime-workers-panel { margin-top: 12px; }
.runtime-workers { display: grid; gap: 8px; }
.runtime-worker {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(100px, auto));
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  font-size: 10px;
}
.runtime-worker strong, .runtime-worker span, .runtime-worker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runtime-worker span, .runtime-worker small { color: var(--muted); }
.backup-panel { margin-top: 12px; }
.backup-panel .panel-heading { align-items: center; }
.backup-summary { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(420px, 1.28fr); gap: 12px; }
.backup-skeleton { grid-column: 1 / -1; min-height: 260px; }
.backup-highlight {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(56,213,189,.2);
  border-radius: 15px;
  background: radial-gradient(circle at 100% 0, rgba(56,213,189,.13), transparent 48%), #101921;
}
.backup-highlight > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.backup-highlight strong { margin: 19px 0 7px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.backup-highlight .backup-date { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.12; }
.backup-highlight p { margin: 0; color: #cfccd9; font-size: 11px; }
.backup-highlight small { margin-top: 19px; color: var(--teal); font-size: 10px; }
.backup-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.backup-metrics > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.backup-metrics span, .backup-metrics strong { display: block; }
.backup-metrics span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.backup-metrics strong { margin-top: 7px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.backup-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.backup-details > div { min-width: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.backup-details > div:nth-child(odd):not(.backup-detail-wide) { border-right: 1px solid var(--line); }
.backup-details span, .backup-details strong, .backup-details code { display: block; }
.backup-details span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.backup-details strong, .backup-details code { margin-top: 4px; overflow: hidden; color: #d9d6e5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.backup-details code { color: #b9a4ff; }
.backup-detail-wide { grid-column: 1 / -1; }
.backup-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 11px; font-size: 10px; }
.backup-footer.ready { border: 1px solid rgba(56,213,189,.2); background: rgba(56,213,189,.06); }
.backup-footer.not-ready { border: 1px solid rgba(255,107,124,.25); background: rgba(255,107,124,.06); }
.backup-footer strong { color: var(--teal); white-space: nowrap; }
.backup-footer.not-ready strong { color: var(--red); }
.backup-footer span { color: var(--muted); }
.backup-failure { grid-column: 1 / -1; margin: 0; color: #d6a0a8; font-size: 9px; }

.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) 210px auto; align-items: end; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(18,18,28,.7); }
.video-filter-bar { grid-template-columns: minmax(220px, 1fr) 170px 150px minmax(270px, auto) auto; }
.author-filter-bar { grid-template-columns: minmax(240px, 1fr) 190px minmax(260px, auto) auto; }
.search-field { position: relative; }
.search-field > span:not(.sr-only) { position: absolute; left: 14px; top: 10px; color: var(--muted); font-size: 18px; }
.filter-bar input, .filter-bar select { height: 42px; padding: 0 13px; }
.filter-bar input { padding-left: 42px; }
.filter-bar select { appearance: none; cursor: pointer; color-scheme: dark; background-color: #171722; }
.filter-bar select option { color: var(--text); background: #171722; }
.sort-field { display: grid; gap: 5px; }
.sort-field > span { padding-left: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; margin: 20px 2px 12px; color: var(--muted); font-size: 11px; }
.jobs-help { margin: 0; text-align: right; }
.job-list { display: grid; gap: 9px; }
.job-row {
  display: grid;
  grid-template-columns: 64px minmax(280px, 1.5fr) minmax(180px, .8fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(25,24,38,.95), rgba(17,17,26,.9));
}
.job-cover { display: grid; place-items: center; width: 64px; height: 82px; overflow: hidden; border-radius: 9px; color: rgba(255,255,255,.35); background: #09090f; font-family: Georgia, serif; }
.job-cover img { width: 100%; height: 100%; object-fit: cover; }
.job-cover img.failed { display: none; }
.job-main, .job-error { min-width: 0; }
.job-title-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.job-title-line > strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.job-main p { margin: 7px 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.job-main small, .job-error small { color: var(--muted); font-size: 8px; }
.job-progress { height: 3px; margin: 8px 0 6px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.08); }
.job-progress i { display: block; width: var(--progress); height: 100%; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.job-error span, .job-error code, .job-error small { display: block; }
.job-error span { margin-bottom: 6px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.job-error code { overflow: hidden; color: #e2afbb; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.job-error small { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-actions { display: grid; gap: 7px; }
.job-actions .button { justify-content: center; min-width: 105px; height: 34px; padding: 0 12px; font-size: 9px; }
.operations-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(280px, .7fr); gap: 14px; }
.operation-form-panel, .operations-note { padding: 24px; }
.operation-form { display: grid; gap: 15px; }
.operation-form label { display: grid; gap: 7px; color: #c9c6d5; font-size: 10px; }
.operation-form input, .operation-form select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #0f0f18;
}
.operation-form input[type="file"] { height: auto; padding: 11px 13px; }
.operation-form input:focus, .operation-form select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(155,124,255,.12); }
.operation-form small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.operation-form .button { justify-content: center; margin-top: 4px; }
.operations-note { background: radial-gradient(circle at 100% 0, rgba(56,213,189,.11), transparent 52%), var(--surface); }
.operations-note h2 { margin: 4px 0 12px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.operations-note p, .operations-note li { color: var(--muted); font-size: 10px; line-height: 1.65; }
.operations-note ul { padding-left: 17px; }
.import-list, .key-list { display: grid; gap: 9px; }
.import-row, .key-row {
  display: grid;
  grid-template-columns: 58px minmax(240px, 1fr) minmax(260px, .8fr) auto;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(25,24,38,.95), rgba(17,17,26,.9));
}
.import-icon, .key-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 11px; color: var(--violet-bright); background: rgba(155,124,255,.1); font: 10px ui-monospace, monospace; }
.key-mark { color: var(--teal); background: rgba(56,213,189,.09); font-size: 23px; }
.import-main, .key-main { min-width: 0; }
.import-main p { margin: 7px 0; color: var(--muted); font-size: 9px; }
.import-counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.import-counts span { color: var(--muted); font-size: 8px; }
.import-counts strong { margin-right: 3px; color: var(--text); font-size: 11px; }
.import-counts .count-error strong { color: var(--red); }
.import-row > .button, .key-row > .button { justify-content: center; min-width: 112px; }
.key-main code, .key-main small { display: block; }
.key-main code { margin: 7px 0; color: #c8c5d4; font-size: 10px; }
.key-main small { color: var(--muted); font-size: 8px; }
.key-scopes { display: flex; flex-wrap: wrap; gap: 6px; }
.key-scopes code { padding: 5px 7px; border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 8px; }
.created-secret { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 16px; margin-top: 14px; padding: 18px; border: 1px solid rgba(56,213,189,.34); border-radius: 14px; background: rgba(56,213,189,.07); }
.created-secret p { margin-bottom: 5px; }
.created-secret code { min-width: 0; overflow: hidden; color: #d8fff8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.created-secret small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.operation-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 18px; color: var(--text); background: #101019; box-shadow: var(--shadow); }
.operation-dialog::backdrop { background: rgba(3,3,8,.78); backdrop-filter: blur(7px); }
.operation-detail { padding: 54px 30px 30px; }
.operation-detail h2 { margin: 6px 0 17px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.operation-progress { height: 7px; margin: 18px 0; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.08); }
.operation-progress i { display: block; width: var(--progress); height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.import-stats { grid-template-columns: repeat(4, 1fr); }
.import-item-counts { margin-top: 14px; }
.import-errors { margin-top: 24px; }
.import-error-row { display: grid; grid-template-columns: minmax(120px,.5fr) 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.import-error-row code { color: #e2afbb; }
.empty-state.compact { padding: 20px; }
.view-toggle button { width: 32px; height: 30px; border: 1px solid var(--line); color: var(--text); background: var(--surface); border-radius: 8px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; }
.video-card {
  position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: 15px; background: var(--surface); cursor: pointer; transition: transform .2s ease, border-color .2s ease;
}
.video-card:hover { transform: translateY(-3px); border-color: rgba(155,124,255,.38); }
.video-visual { position: relative; display: grid; place-items: center; aspect-ratio: 4/5; overflow: hidden; background: linear-gradient(145deg, #242034 0%, #171a28 45%, #15302f 100%); }
.video-visual::before { content: ""; position: absolute; width: 90px; height: 140%; border: 1px solid rgba(255,255,255,.07); transform: rotate(28deg); }
.video-visual span { position: relative; color: rgba(255,255,255,.24); font-family: Georgia, serif; font-size: 32px; }
.video-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.video-card:hover .video-cover { transform: scale(1.025); }
.video-cover.failed { display: none; }
.video-card .status-badge { position: absolute; top: 10px; left: 10px; }
.video-card-copy { padding: 13px; }
.video-card-copy h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-card-copy p { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.video-card-copy .video-author { margin-bottom: 10px; }
.video-card-dates { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.video-card-dates span { display: flex; justify-content: space-between; gap: 8px; }
.video-card-dates strong { color: #d8d5e5; font-weight: 650; }
.load-more-wrap { display: flex; justify-content: center; padding: 24px; }
.infinite-scroll-sentinel { min-height: 60px; padding: 20px; color: transparent; text-align: center; font-size: 10px; }
.infinite-scroll-sentinel.loading { color: var(--muted); }
.infinite-scroll-sentinel.loading span::before { content: "↻"; display: inline-block; margin-right: 8px; color: var(--violet-bright); animation: spin .8s linear infinite; }
.empty-state { grid-column: 1/-1; padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }

.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 11px; }
.author-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(25,24,38,.96), rgba(17,17,26,.9));
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.author-card:hover { transform: translateY(-2px); border-color: rgba(155,124,255,.38); }
.author-avatar, .author-profile-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(155,124,255,.24);
  border-radius: 50%;
  color: #d8cfff;
  background: radial-gradient(circle at 30% 20%, rgba(155,124,255,.3), rgba(56,213,189,.08));
  font-family: Georgia, serif;
  font-size: 18px;
}
.author-card-main { min-width: 0; }
.author-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.author-title > div { min-width: 0; }
.author-title strong, .author-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-title strong { font-size: 13px; }
.author-title > div span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.author-card-main > p { margin: 11px 0; overflow: hidden; color: #aaa8b9; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.author-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.author-metrics span { padding: 7px; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 8px; }
.author-metrics strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 12px; }
.author-card-main > small { display: block; margin-top: 10px; color: #747283; font-size: 8px; }

.author-dialog {
  width: min(1100px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 24px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  background: #101019;
  box-shadow: var(--shadow);
}
.author-dialog::backdrop { background: rgba(3,3,8,.78); backdrop-filter: blur(7px); }
.author-detail-layout { padding: 54px 30px 35px; }
.author-profile { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 16px; }
.author-profile-avatar { width: 76px; height: 76px; font-size: 24px; }
.author-profile h2 { margin: 3px 0 5px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.author-profile p { margin: 0; color: var(--muted); font-size: 11px; }
.author-signature { margin: 20px 0; color: #b8b5c5; line-height: 1.6; font-size: 11px; }
.author-stats { grid-template-columns: repeat(6, 1fr); }
.author-section { margin-top: 26px; }
.author-section h3 { margin: 0 0 10px; font-size: 13px; }
.alias-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.alias-columns > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.alias-columns > div > strong { display: block; margin-bottom: 8px; font-size: 10px; }
.alias-columns > div > span { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.alias-columns code { color: #d8cfff; }
.alias-columns small { text-align: right; }
.author-history { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.author-history > div { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.author-history > div:first-child { border-top: 0; }
.author-history time { color: #d5d2df; }
.author-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.author-video-grid article { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); cursor: pointer; }
.author-video-grid article > div { position: relative; display: grid; place-items: center; aspect-ratio: 4/5; overflow: hidden; border-radius: 8px; color: var(--muted); background: #09090f; }
.author-video-grid article img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.author-video-grid strong, .author-video-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-video-grid strong { margin-top: 7px; font-size: 9px; }
.author-video-grid small { margin-top: 4px; color: var(--muted); font-size: 8px; }

.video-dialog {
  width: min(1500px, calc(100vw - 24px));
  max-width: none;
  height: min(920px, calc(100vh - 24px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: #101019;
  box-shadow: var(--shadow);
}
.video-dialog::backdrop { background: rgba(3,3,8,.78); backdrop-filter: blur(7px); }
.dialog-close { position: sticky; z-index: 4; float: right; top: 14px; right: 14px; width: 36px; height: 36px; margin: 14px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: rgba(10,10,17,.8); cursor: pointer; font-size: 22px; }
.dialog-nav {
  position: fixed;
  z-index: 5;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 82px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  color: white;
  background: rgba(9,9,15,.76);
  box-shadow: 0 12px 35px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 1;
  transform: translateY(-50%);
}
.dialog-nav:hover { border-color: var(--violet); background: rgba(30,25,48,.92); }
.dialog-nav:disabled { opacity: .2; cursor: default; }
.dialog-previous { left: max(18px, calc(50vw - 790px)); }
.dialog-next { right: max(18px, calc(50vw - 790px)); }
.detail-layout { display: grid; grid-template-columns: minmax(520px, 1.65fr) minmax(330px, .7fr); height: 100%; min-height: 0; }
.detail-media { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; background: #050507; }
.detail-media video { width: 100%; height: min(896px, calc(100vh - 24px)); object-fit: contain; background: #000; }
.detail-placeholder { color: rgba(255,255,255,.25); font-family: Georgia, serif; font-size: 50px; }
.detail-content {
  padding: 52px 24px 22px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 164, 255, .42) transparent;
}
.detail-content::-webkit-scrollbar { width: 6px; }
.detail-content::-webkit-scrollbar-track { background: transparent; }
.detail-content::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(185, 164, 255, .32); }
.detail-content::-webkit-scrollbar-thumb:hover { background: rgba(185, 164, 255, .58); }
.detail-content > .eyebrow { margin-bottom: 4px; font-size: 9px; }
.detail-content h2 { margin: 4px 0 7px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.05; }
.detail-description { margin: 9px 0; color: #b8b5c5; line-height: 1.4; font-size: 11px; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 12px; }
.detail-actions .button { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 10px; }
.detail-actions .status-badge { padding: 5px 8px; font-size: 8px; }
.detail-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.detail-fact { padding: 9px 10px; background: #14141e; }
.detail-fact span, .detail-fact strong { display: block; }
.detail-fact span { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .07em; }
.detail-fact strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.stats-section, .metadata-summary { margin-top: 14px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-heading h3, .metadata-summary h3 { margin: 0 0 7px; font-size: 11px; }
.section-heading small { color: var(--muted); font-size: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.stat-card { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, #191827, #13131c); }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 7px; letter-spacing: .05em; text-transform: uppercase; }
.stat-card strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.metadata-grid > div { min-width: 0; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.metadata-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.metadata-grid span, .metadata-grid strong { display: block; }
.metadata-grid span { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.metadata-grid strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; font-size: 9px; white-space: nowrap; }
.asset-list { margin-top: 14px; }
.asset-list h3 { margin-bottom: 7px; font-size: 11px; }
.asset-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.metadata-details { margin-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.metadata-details summary { padding: 9px 0; color: #c8c5d4; cursor: pointer; font-weight: 600; }
.metadata-details pre { max-height: 360px; margin: 0; padding: 13px; overflow: auto; border-radius: 10px; color: #c3c0d1; background: #09090f; font: 9px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.history-table > div { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.history-table time { color: #c8c5d4; }
.toast-region { position: fixed; z-index: 20; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: #1a1925; box-shadow: var(--shadow); font-size: 12px; }
.toast.error { border-color: rgba(255,107,124,.4); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1200px) {
  .video-filter-bar { grid-template-columns: minmax(240px, 1fr) 190px; }
  .video-filter-bar .sort-field { grid-column: 1; }
  .author-filter-bar { grid-template-columns: minmax(240px, 1fr) 190px; }
}
@media (max-width: 950px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { border-right: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .backup-summary { grid-template-columns: 1fr; }
  .backup-highlight { grid-row: auto; min-height: 190px; }
  .job-row { grid-template-columns: 54px minmax(220px, 1fr) auto; }
  .job-cover { width: 54px; height: 72px; }
  .job-error { grid-column: 2; }
  .job-actions { grid-column: 3; grid-row: 1 / span 2; }
  .operations-grid { grid-template-columns: 1fr; }
  .runtime-grid { grid-template-columns: 1fr; }
  .author-stats { grid-template-columns: repeat(3, 1fr); }
  .import-row, .key-row { grid-template-columns: 58px minmax(220px, 1fr) auto; }
  .import-counts, .key-scopes { grid-column: 2; }
  .import-row > .button, .key-row > .button { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; width: 240px; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .workspace { padding-inline: 17px; }
  .topbar { align-items: center; min-height: 110px; padding: 25px 0 18px; }
  .topbar > div:nth-child(2) { flex: 1; }
  .topbar h1 { font-size: 30px; }
  .menu-button { display: block; font-size: 20px; }
  .last-update { display: none; }
  .filter-bar { grid-template-columns: 1fr; }
  .video-filter-bar .sort-field { grid-column: auto; }
  .author-filter-bar { grid-template-columns: 1fr; }
  .author-profile { grid-template-columns: 58px minmax(0,1fr); }
  .author-profile-avatar { width: 58px; height: 58px; }
  .author-profile > .status-badge { grid-column: 1 / -1; justify-self: start; }
  .alias-columns { grid-template-columns: 1fr; }
  .author-history > div { grid-template-columns: 1fr 1fr; }
  .catalog-meta { align-items: flex-start; gap: 10px; }
  .jobs-help { max-width: 55%; }
  .job-row { grid-template-columns: 54px minmax(0, 1fr); }
  .job-error { grid-column: 2; }
  .job-actions { grid-column: 1 / -1; grid-row: auto; display: flex; }
  .job-actions .button { flex: 1; }
  .import-row, .key-row { grid-template-columns: 48px minmax(0, 1fr); }
  .import-icon, .key-mark { width: 48px; height: 52px; }
  .import-counts, .key-scopes { grid-column: 2; }
  .import-row > .button, .key-row > .button { grid-column: 1 / -1; grid-row: auto; }
  .created-secret { grid-template-columns: 1fr; }
  .created-secret small { grid-column: auto; }
  .import-stats { grid-template-columns: repeat(2, 1fr); }
  .runtime-worker { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .detail-media { min-height: 330px; }
  .video-dialog { height: calc(100vh - 12px); width: calc(100vw - 12px); overflow-y: auto; overscroll-behavior: contain; }
  .detail-content { overflow: visible; scrollbar-gutter: auto; }
  .detail-media video { height: 62vh; }
  .dialog-nav { width: 42px; height: 60px; font-size: 36px; }
  .dialog-previous { left: 12px; }
  .dialog-next { right: 12px; }
}
@media (max-width: 480px) {
  .login-panel { padding: 30px 22px; }
  .brand-mark { margin-bottom: 34px; }
  .metric-grid { grid-template-columns: 1fr; }
  .backup-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backup-details { grid-template-columns: 1fr; }
  .backup-details > div, .backup-details > div:nth-child(odd):not(.backup-detail-wide) { border-right: 0; }
  .backup-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-card-copy h3 { font-size: 11px; }
  .topbar-actions .button { width: 42px; overflow: hidden; color: transparent; position: relative; }
  .topbar-actions .button::after { content: "↻"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
