:root {
  color-scheme: dark;
  --bg: #080d18;
  --panel: rgba(20, 28, 49, 0.86);
  --panel-strong: rgba(28, 39, 70, 0.94);
  --line: rgba(151, 172, 255, 0.2);
  --text: #f7f8ff;
  --muted: #b7c1da;
  --accent: #72e2ff;
  --hot: #ff58b1;
  --good: #8effc1;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(114, 226, 255, 0.22), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgba(255, 88, 177, 0.22), transparent 28rem),
    linear-gradient(145deg, #060a13 0%, #10182b 55%, #070b14 100%);
}

button,
input {
  font: inherit;
}

.vault-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero-panel,
.upload-panel,
.library-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 64px);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -14% -48% 42%;
  height: 320px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(114, 226, 255, 0.26), rgba(255, 88, 177, 0.2));
  filter: blur(12px);
  transform: rotate(-9deg);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 0.95;
}

h1 {
  max-width: 820px;
  font-size: clamp(3.4rem, 10vw, 7.6rem);
  letter-spacing: -0.07em;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.auth-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 30px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 13, 24, 0.5);
  color: var(--muted);
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #08101f;
  background: linear-gradient(135deg, var(--accent), var(--good));
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.upload-panel {
  margin-top: 22px;
  padding: 22px;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.8fr) auto;
  gap: 14px;
  align-items: end;
}

.conversion-option {
  grid-column: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.conversion-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.upload-actions .button {
  white-space: nowrap;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

input[type="text"],
.file-picker {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

input[type="text"] {
  width: 100%;
  padding: 0 14px;
  outline: none;
}

.file-picker {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 0 14px;
  cursor: pointer;
}

.file-picker input {
  width: 100%;
  color: var(--muted);
}

.file-picker input[type="file"] {
  color: #dbe5ff !important;
}

.file-picker input[type="file"]::file-selector-button,
input[type="file"]::file-selector-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  margin-right: 12px !important;
  padding: 10px 15px !important;
  border: 1px solid rgba(114, 226, 255, 0.5) !important;
  border-radius: 999px !important;
  color: #08101f !important;
  background: linear-gradient(135deg, #72e2ff, #8effc1) !important;
  font: inherit !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 0 18px rgba(114, 226, 255, 0.22) !important;
}

.file-picker input[type="file"]::-webkit-file-upload-button,
input[type="file"]::-webkit-file-upload-button {
  -webkit-appearance: none !important;
  margin-right: 12px !important;
  padding: 10px 15px !important;
  border: 1px solid rgba(114, 226, 255, 0.5) !important;
  border-radius: 999px !important;
  color: #08101f !important;
  background: linear-gradient(135deg, #72e2ff, #8effc1) !important;
  font: inherit !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 0 18px rgba(114, 226, 255, 0.22) !important;
}

.upload-note {
  margin: 14px 0 0;
  color: var(--muted);
}

.selected-files {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 13, 24, 0.42);
}

.selected-files-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.selected-files ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selected-files li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(151, 172, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 0.88rem;
}

.selected-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-size {
  flex: 0 0 auto;
  color: var(--muted);
}

.upload-progress {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.upload-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.upload-progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(8, 13, 24, 0.7);
}

.upload-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--good), var(--hot));
  box-shadow: 0 0 22px rgba(114, 226, 255, 0.35);
  transition: width 160ms ease;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 34px 0 16px;
}

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

.notification-button {
  gap: 9px;
}

.notification-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: #08101f;
  background: linear-gradient(135deg, #b7c1da, #f7f8ff);
  font-size: 0.84rem;
}

.notification-button.has-alerts {
  border-color: rgba(255, 88, 177, 0.58);
  box-shadow: 0 0 24px rgba(255, 88, 177, 0.16);
}

.notification-button.has-alerts strong {
  background: linear-gradient(135deg, var(--hot), var(--accent));
}

.admin-requests-panel {
  margin-bottom: 18px;
}

.library-browser {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(8, 13, 24, 0.78);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.library-filter,
button.library-filter {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(151, 172, 255, 0.28) !important;
  border-radius: 18px !important;
  color: #f7f8ff !important;
  background: linear-gradient(135deg, rgba(20, 28, 49, 0.98), rgba(28, 39, 70, 0.92)) !important;
  font-weight: 900 !important;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
}

.library-filter span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-filter strong,
button.library-filter strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: #08101f !important;
  background: linear-gradient(135deg, #b7c1da, #f7f8ff) !important;
  font-size: 0.9rem;
}

.library-filter.is-active,
button.library-filter.is-active {
  border-color: rgba(114, 226, 255, 0.72) !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(114, 226, 255, 0.34), rgba(255, 88, 177, 0.28)), rgba(20, 28, 49, 0.96) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 28px rgba(114, 226, 255, 0.18) !important;
}

.library-filter.is-active strong,
button.library-filter.is-active strong {
  background: linear-gradient(135deg, var(--accent), var(--good)) !important;
}

.library-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.library-card {
  padding: 22px;
}

.library-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.item-stack,
.gallery-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

.media-preview {
  width: 100%;
  background: rgba(0, 0, 0, 0.22);
}

audio.media-preview {
  padding: 12px;
}

img.media-preview,
video.media-preview {
  display: block;
  max-height: 320px;
  object-fit: cover;
}

.media-meta {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.media-name {
  margin: 0;
  font-weight: 900;
  word-break: break-word;
}

.media-link {
  color: var(--accent);
  font-size: 0.86rem;
  word-break: break-all;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.request-status.pending {
  color: #ffe0a8;
}

.request-status.rejected {
  color: #ffb3d8;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  cursor: pointer;
}

.mini-button.danger {
  border-color: rgba(255, 88, 177, 0.4);
  color: #ffd6e9;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .upload-form {
    grid-template-columns: 1fr;
  }

  .selected-files ol {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .library-browser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    top: 8px;
  }

  .library-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .vault-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 22px;
  }
}
