:root {
  color-scheme: dark;
  --bg: #050b13;
  --bg-deep: #03070c;
  --surface: rgba(12, 25, 42, 0.78);
  --surface-strong: #0d1b2d;
  --surface-soft: rgba(19, 39, 64, 0.58);
  --border: rgba(142, 181, 227, 0.16);
  --border-strong: rgba(102, 178, 255, 0.34);
  --text: #f3f7fc;
  --text-soft: #aab8ca;
  --text-faint: #78899e;
  --blue: #2388ff;
  --blue-bright: #59a8ff;
  --blue-soft: rgba(35, 136, 255, 0.14);
  --green: #35d39a;
  --red: #ff6577;
  --yellow: #f3c969;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 20px;
  --radius-small: 12px;
  --shell: 1240px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(33, 121, 222, 0.2), transparent 38rem),
    radial-gradient(circle at 96% 30%, rgba(24, 87, 159, 0.13), transparent 34rem),
    linear-gradient(155deg, #06101c 0%, var(--bg) 48%, #040910 100%);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.16;
  letter-spacing: -0.026em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 700;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.narrow-main {
  max-width: 850px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(139, 181, 229, 0.1);
  background: rgba(5, 12, 21, 0.78);
  backdrop-filter: blur(18px) saturate(135%);
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: #f8fbff;
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(119, 190, 255, 0.42);
  border-radius: 10px;
  background: linear-gradient(145deg, #2492ff, #1051ab);
  box-shadow: 0 7px 24px rgba(19, 120, 231, 0.28), inset 0 1px rgba(255, 255, 255, 0.22);
}

.brand-mark::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid white;
  content: "";
}

.brand-mark span {
  position: absolute;
  right: -7px;
  bottom: -8px;
  width: 22px;
  height: 22px;
  border: 5px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.admin-label {
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--blue-bright);
  background: var(--blue-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.page-main {
  padding-block: clamp(42px, 7vw, 76px) 80px;
}

.page-heading {
  display: flex;
  margin-bottom: 28px;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.heading-copy {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--text-soft);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue-bright);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.glass-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 30, 50, 0.82), rgba(8, 18, 31, 0.74));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px);
}

.search-panel {
  padding: 18px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(170px, 0.85fr) minmax(145px, 0.55fr) auto;
  align-items: end;
  gap: 12px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-label {
  color: #dbe6f2;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.012em;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(143, 178, 217, 0.19);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: rgba(3, 10, 18, 0.68);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input,
select {
  min-height: 45px;
  padding: 0 13px;
}

textarea {
  min-height: 98px;
  padding: 11px 13px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #687b92;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(143, 183, 228, 0.34);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  background: rgba(4, 14, 25, 0.9);
  box-shadow: 0 0 0 3px rgba(35, 136, 255, 0.14);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 101, 119, 0.11);
}

select {
  padding-right: 36px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8296ad 50%),
    linear-gradient(135deg, #8296ad 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 20px,
    calc(100% - 12px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  padding-left: 42px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid #778ba3;
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-55%);
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 1px;
  background: #778ba3;
  content: "";
  transform: rotate(45deg);
}

.button {
  display: inline-flex;
  min-height: 45px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #278dff;
  border-radius: 11px;
  color: white;
  background: linear-gradient(180deg, #2b91ff, #1472dc);
  box-shadow: 0 9px 24px rgba(17, 112, 221, 0.2), inset 0 1px rgba(255, 255, 255, 0.18);
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: #65b2ff;
  box-shadow: 0 12px 28px rgba(17, 112, 221, 0.28), inset 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.media-card-button:focus-visible,
.tag:focus-visible,
.player-button:focus-visible,
.file-drop:focus-within,
.file-drop:has(+ .file-input:focus-visible) {
  outline: 2px solid #77baff;
  outline-offset: 3px;
}

.button-small {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.button-secondary {
  border-color: rgba(91, 162, 238, 0.26);
  background: rgba(27, 103, 186, 0.16);
  box-shadow: none;
}

.button-secondary:hover:not(:disabled) {
  background: rgba(35, 127, 227, 0.23);
  box-shadow: none;
}

.button-ghost {
  border-color: rgba(139, 175, 215, 0.2);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

.button-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.button-danger {
  border-color: rgba(255, 101, 119, 0.3);
  color: #ff9ba7;
  background: rgba(255, 101, 119, 0.08);
  box-shadow: none;
}

.button-danger:hover:not(:disabled) {
  border-color: rgba(255, 101, 119, 0.52);
  background: rgba(255, 101, 119, 0.14);
  box-shadow: none;
}

.button-full {
  width: 100%;
}

.results-bar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.results-bar p {
  margin: 0;
}

.muted {
  color: var(--text-soft);
  font-size: 0.87rem;
}

.text-button {
  padding: 5px;
  border: 0;
  border-radius: 6px;
  color: var(--blue-bright);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 650;
}

.text-button:hover {
  color: #91c7ff;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(10, 22, 37, 0.76);
  box-shadow: 0 13px 40px rgba(0, 0, 0, 0.19);
  user-select: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.media-card:hover,
.media-card:focus-within {
  border-color: rgba(77, 161, 255, 0.4);
  box-shadow: 0 17px 45px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(45, 140, 247, 0.08);
  transform: translateY(-2px);
}

.media-card-button {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.media-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 20%, rgba(62, 141, 228, 0.16), transparent 55%),
    #07111e;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform 350ms ease, opacity 180ms ease;
}

.media-card:hover .media-thumb img {
  transform: scale(1.025);
}

.media-thumb img.is-missing {
  opacity: 0;
}

.media-thumb::after {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(3, 8, 15, 0.5), transparent);
  content: "";
}

.media-type-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  padding: 5px 8px;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #e9f3ff;
  background: rgba(3, 9, 17, 0.68);
  backdrop-filter: blur(8px);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-type-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 8px rgba(89, 168, 255, 0.65);
  content: "";
}

.media-card-body {
  min-width: 0;
  padding: 15px 16px 16px;
}

.media-card h2 {
  margin: 0 0 7px;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-meta {
  display: flex;
  min-height: 23px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.media-card-tags {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
}

.mini-tag {
  max-width: 110px;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 999px;
  color: #9db4cb;
  background: rgba(149, 182, 219, 0.07);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identifier-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skeleton-card {
  min-height: 270px;
  border: 1px solid var(--border);
  border-radius: 17px;
  overflow: hidden;
  background: rgba(10, 22, 37, 0.65);
}

.skeleton-thumb,
.skeleton-line {
  background: linear-gradient(100deg, rgba(102, 142, 188, 0.05) 20%, rgba(120, 169, 224, 0.13) 40%, rgba(102, 142, 188, 0.05) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
}

.skeleton-lines {
  padding: 18px;
}

.skeleton-line {
  width: 72%;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 5px;
}

.skeleton-line.short {
  width: 43%;
  height: 9px;
}

@keyframes shimmer {
  to { background-position-x: -200%; }
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 16px 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
}

.empty-icon {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 37px;
  border: 2px solid #55708f;
  border-radius: 8px;
}

.empty-icon::before {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  height: 14px;
  background: linear-gradient(140deg, transparent 25%, #55708f 26% 44%, transparent 45%), linear-gradient(40deg, transparent 44%, #55708f 45% 64%, transparent 65%);
  content: "";
}

.empty-icon::after {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-bright);
  content: "";
}

[data-protected-media],
[data-protected-media] * {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

dialog {
  padding: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

dialog::backdrop {
  background: rgba(1, 5, 10, 0.84);
  backdrop-filter: blur(10px);
}

.media-dialog {
  width: min(calc(100% - 28px), 1020px);
  max-height: calc(100vh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-surface {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 174, 231, 0.22);
  border-radius: 21px;
  background: #091522;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.62);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  background: rgba(1, 6, 12, 0.7);
  backdrop-filter: blur(8px);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  font-size: 1.35rem;
  line-height: 1;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.media-viewer {
  position: relative;
  display: grid;
  min-height: 240px;
  max-height: min(70vh, 720px);
  place-items: center;
  overflow: hidden;
  background: #010408;
}

.media-viewer > img {
  width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
}

.video-shell {
  position: relative;
  width: 100%;
  background: #000;
}

.video-shell video {
  width: 100%;
  max-height: min(70vh, 720px);
  margin-inline: auto;
  object-fit: contain;
  background: #000;
}

.video-shell:not(.has-started) .center-play {
  opacity: 1;
}

.center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  width: 66px;
  height: 66px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: white;
  background: rgba(8, 18, 31, 0.72);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.35);
  opacity: 0;
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  transition: opacity 150ms ease, background-color 150ms ease;
}

.center-play:hover,
.video-shell.is-paused .center-play {
  opacity: 1;
  background: rgba(23, 107, 204, 0.82);
}

.play-symbol {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  padding: 28px 12px 11px;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), transparent);
  transition: opacity 180ms ease;
}

.player-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: white;
  background: transparent;
  font-size: 0.92rem;
}

.player-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.player-time {
  color: #e2e8ef;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-progress {
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--blue);
}

.player-progress:focus {
  box-shadow: none;
}

.player-progress:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

.dialog-copy {
  padding: 21px 24px 23px;
}

.media-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.media-description {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.identifier-badge,
.count-badge {
  display: inline-flex;
  min-height: 27px;
  padding: 3px 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(89, 168, 255, 0.23);
  border-radius: 999px;
  color: #9bcaff;
  background: rgba(35, 136, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 660;
}

.tag-list {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 5px 9px;
  border: 1px solid rgba(135, 173, 215, 0.13);
  border-radius: 999px;
  color: #a9bbcf;
  background: rgba(151, 183, 220, 0.055);
  font-size: 0.73rem;
  text-decoration: none;
}

button.tag:hover {
  border-color: rgba(89, 168, 255, 0.34);
  color: #d5e9ff;
  background: rgba(35, 136, 255, 0.11);
}

.form-panel {
  padding: clamp(22px, 5vw, 34px);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-drop {
  display: flex;
  min-height: 154px;
  padding: 25px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(98, 165, 238, 0.39);
  border-radius: 14px;
  color: var(--text-soft);
  background: rgba(24, 88, 160, 0.07);
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.file-drop:hover,
.file-drop.is-dragging,
.file-drop.has-file {
  border-color: rgba(91, 171, 255, 0.7);
  background: rgba(35, 136, 255, 0.115);
}

.file-drop.compact {
  min-height: 116px;
}

.file-drop-icon {
  position: relative;
  width: 36px;
  height: 30px;
  margin-right: 15px;
  border: 2px solid #659bd1;
  border-radius: 7px;
}

.file-drop-icon::before {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid #83baff;
  border-left: 2px solid #83baff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.file-drop-icon::after {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 2px;
  height: 12px;
  background: #83baff;
  content: "";
  transform: translateX(-50%);
}

.file-drop-title {
  color: #e3edf8;
  font-size: 0.9rem;
  font-weight: 660;
}

.file-drop-copy {
  margin-left: 8px;
  color: var(--text-faint);
  font-size: 0.78rem;
}

.field-error {
  margin: 0;
  color: #ff94a1;
  font-size: 0.78rem;
}

.upload-progress {
  padding: 13px 15px;
  border: 1px solid rgba(91, 162, 238, 0.16);
  border-radius: 12px;
  background: rgba(35, 136, 255, 0.055);
}

.progress-label {
  display: flex;
  margin-bottom: 8px;
  justify-content: space-between;
  gap: 15px;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--blue);
  background: #122239;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #122239;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #1776e4, #52a6ff);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #1776e4, #52a6ff);
}

.form-message {
  padding: 11px 13px;
  border: 1px solid rgba(53, 211, 154, 0.22);
  border-radius: 10px;
  color: #8ce9c6;
  background: rgba(53, 211, 154, 0.07);
  font-size: 0.82rem;
}

.form-message.is-error {
  border-color: rgba(255, 101, 119, 0.24);
  color: #ff9ca8;
  background: rgba(255, 101, 119, 0.07);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-page {
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(calc(100% - 34px), 430px);
  padding-block: 34px;
}

.auth-card {
  padding: 32px;
}

.auth-brand {
  margin-bottom: 42px;
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-heading h1 {
  font-size: 2rem;
}

.back-link {
  display: block;
  margin-top: 25px;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-align: center;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text-soft);
}

.admin-main {
  padding-top: 45px;
}

.admin-heading {
  margin-bottom: 25px;
}

.session-user {
  margin: 0 0 6px;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 20px;
}

.admin-upload-panel,
.pending-panel,
.library-panel {
  min-width: 0;
}

.pending-panel,
.library-panel {
  padding: 25px;
}

.section-heading,
.dialog-heading {
  display: flex;
  margin-bottom: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-heading .eyebrow,
.dialog-heading .eyebrow {
  margin-bottom: 5px;
}

.section-heading h2,
.dialog-heading h2 {
  font-size: 1.28rem;
}

.library-panel {
  margin-top: 20px;
}

.library-heading {
  align-items: end;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-input {
  width: min(250px, 32vw);
  min-width: 0;
  flex: 1 1 180px;
  min-height: 38px;
}

.compact-select {
  width: 130px;
  min-height: 38px;
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
}

.refresh-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-icon::after {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-right: 5px solid currentColor;
  border-bottom: 4px solid transparent;
  content: "";
  transform: rotate(35deg);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 9px;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(137, 174, 216, 0.11);
  border-radius: 13px;
  background: rgba(4, 12, 21, 0.4);
}

.admin-list-thumb {
  position: relative;
  width: 116px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #050b12;
}

.admin-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.admin-list-main {
  min-width: 0;
}

.admin-list-title {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.meta-separator::before {
  color: #40516a;
  content: "•";
}

.admin-list-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-list-actions .button {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 0.75rem;
}

.compact-list .admin-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px;
}

.submission-sender {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-empty,
.list-loading,
.list-error {
  padding: 27px 14px;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-align: center;
}

.list-error {
  color: #ff9ca8;
}

.form-dialog {
  width: min(calc(100% - 28px), 690px);
  max-height: calc(100vh - 28px);
}

.form-dialog .dialog-surface {
  max-height: calc(100vh - 28px);
  padding: 26px;
  overflow-y: auto;
}

.form-dialog .dialog-heading {
  margin-bottom: 5px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  width: min(360px, calc(100% - 36px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(93, 170, 255, 0.26);
  border-radius: 11px;
  color: #deecfb;
  background: rgba(11, 27, 45, 0.94);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  font-size: 0.81rem;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  border-color: rgba(255, 101, 119, 0.32);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 940px) {
  .search-form {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) 140px;
  }

  .search-button {
    grid-column: 1 / -1;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(calc(100% - 26px), var(--shell));
  }

  .header-inner {
    min-height: 64px;
    gap: 10px;
  }

  .brand > [data-app-name] {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-nav .nav-link {
    display: none;
  }

  .page-main {
    padding-block: 35px 60px;
  }

  .page-heading {
    margin-bottom: 22px;
  }

  .search-panel {
    padding: 14px;
  }

  .search-form,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .search-button {
    grid-column: auto;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-title-row,
  .library-heading,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-copy {
    padding: 18px;
  }

  .identifier-badge {
    align-self: flex-start;
  }

  .file-drop {
    min-height: 140px;
    padding: 22px 15px;
    flex-direction: column;
  }

  .file-drop-icon {
    margin: 0 0 12px;
  }

  .file-drop-copy {
    margin: 5px 0 0;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

  .admin-toolbar {
    width: 100%;
  }

  .compact-input {
    width: 100%;
    flex-basis: 100%;
  }

  .compact-select {
    width: 112px;
  }

  .admin-list-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .admin-list-thumb {
    width: 82px;
  }

  .admin-list-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .compact-list .admin-list-item {
    grid-template-columns: 1fr;
  }

  .compact-list .admin-list-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .compact-list .admin-list-actions .button {
    flex: 1;
  }

  .player-controls {
    grid-template-columns: auto 1fr auto auto;
    gap: 6px;
  }

  .player-time {
    display: none;
  }
}

@media (max-width: 410px) {
  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .main-nav .button {
    padding-inline: 10px;
  }

  .admin-page .brand > [data-app-name] {
    display: none;
  }

  .admin-page .main-nav .nav-link {
    display: none;
  }

  .auth-card {
    padding: 25px 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
