:root {
  color-scheme: dark;
  --bg: #15111f;
  --surface: #151923;
  --surface-soft: #202537;
  --text: #f8fafc;
  --muted: #aab3c5;
  --line: rgba(168, 132, 255, .28);
  --brand: #8067ff;
  --brand-2: #9a5cff;
  --danger: #c73655;
  --success: #147a49;
  --admin: #080d15;
  --admin-card: #121927;
  --admin-line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
@keyframes panelEntrance {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(.985);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -12%, rgba(126, 87, 255, .36), transparent 34rem),
    radial-gradient(circle at 8% 12%, rgba(77, 80, 255, .24), transparent 22rem),
    linear-gradient(180deg, #26194a 0, #14111f 34rem, #0b0f18 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.modal-open {
  overflow: hidden;
}
.topbar,
.upload-card,
.plan-panel,
.premium-main-panel,
.premium-feature-card,
.library-main-panel,
.library-panel,
.auth-card,
.share-card,
.legal-hero,
.policy-card,
.footer-inner,
.admin-main,
.admin-cards article,
.admin-card,
.table-wrap {
  opacity: 0;
  animation: panelEntrance .62s cubic-bezier(.22, .88, .31, 1) forwards;
  will-change: transform, opacity, filter;
}
.topbar { animation-delay: .04s; }
.upload-card,
.premium-main-panel,
.library-main-panel,
.auth-card,
.share-card,
.admin-main { animation-delay: .09s; }
.plan-panel,
.library-panel,
.legal-hero,
.table-wrap { animation-delay: .14s; }
.premium-feature-card:nth-child(1),
.policy-card:nth-child(1),
.admin-cards article:nth-child(1),
.admin-card:nth-child(1) { animation-delay: .18s; }
.premium-feature-card:nth-child(2),
.policy-card:nth-child(2),
.admin-cards article:nth-child(2),
.admin-card:nth-child(2) { animation-delay: .23s; }
.premium-feature-card:nth-child(3),
.policy-card:nth-child(3),
.admin-cards article:nth-child(3),
.admin-card:nth-child(3) { animation-delay: .28s; }
.premium-feature-card:nth-child(4),
.policy-card:nth-child(4),
.admin-cards article:nth-child(4),
.admin-card:nth-child(4) { animation-delay: .33s; }
.footer-inner { animation-delay: .2s; }
.confirm-card { animation-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .upload-card,
  .plan-panel,
  .premium-main-panel,
  .premium-feature-card,
  .library-main-panel,
  .library-panel,
  .auth-card,
  .share-card,
  .legal-hero,
  .policy-card,
  .footer-inner,
  .admin-main,
  .admin-cards article,
  .admin-card,
  .table-wrap {
    opacity: 1;
    animation: none;
    filter: none;
    transform: none;
  }
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(75%, 960px);
  min-height: 72px;
  margin: 48px auto 26px;
  padding: 10px 14px;
  border: 1px solid rgba(168, 132, 255, .42);
  border-radius: 22px;
  background: rgba(9, 10, 18, .82);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset, 0 0 42px rgba(95, 83, 255, .34);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  font-size: 0;
  line-height: 0;
  font-weight: 850;
  text-decoration: none;
  font-family: "Lato", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.brand .brand-icon-wrap {
  display: grid;
  width: 53px;
  height: 53px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.brand .brand-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  font-size: 0;
  line-height: 0;
}
nav { display: flex; gap: 12px; align-items: center; }
nav a, nav button, .btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #f8fafc;
  font-weight: 700;
  font-family: "Lato", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  box-shadow: none;
  transition: transform .18s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease, color .22s ease;
}
nav form { margin: 0; }
nav a:hover, nav button:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(168,132,255,.44);
  background: rgba(126,87,255,.16);
  box-shadow: 0 8px 24px rgba(95,83,255,.28), 0 0 0 1px rgba(255,255,255,.08) inset;
}
nav a:active, nav button:active {
  transform: translateY(0) scale(.99);
}
nav i,
nav svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}
.btn.primary, .premium {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 14px 30px rgba(85, 71, 255, .25);
}
.premium {
  background: linear-gradient(#121521, #121521) padding-box, linear-gradient(135deg, #f8c44c, #5b5cff) border-box;
  border: 1px solid transparent;
  color: #f8fafc;
  position: relative;
  isolation: isolate;
  z-index: 0;
  overflow: hidden;
}
.premium::before {
  content: "";
  position: absolute;
  inset: -140%;
  background: conic-gradient(from 0deg, rgba(248,196,76,.0), rgba(248,196,76,.95), rgba(91,92,255,.95), rgba(248,196,76,.0));
  opacity: 0;
  transition: opacity .2s ease;
  animation: premiumOrbit 1.8s linear infinite;
  pointer-events: none;
  z-index: -2;
}
.premium::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: #121521;
  pointer-events: none;
  z-index: -1;
}
.premium:hover::before {
  opacity: 1;
}
.premium:hover {
  box-shadow: 0 0 20px rgba(248,196,76,.25), 0 0 32px rgba(91,92,255,.24);
}
.page {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto 54px;
}
.tool-tabs {
  display: inline-flex;
  justify-content: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 4px;
  padding: 7px;
  border: 1px solid rgba(168, 132, 255, .32);
  border-radius: 18px;
  background: rgba(8, 10, 18, .72);
  box-shadow: 0 0 34px rgba(95,83,255,.2);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.top-message {
  width: min(620px, 100%);
  margin: 0 auto 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 186, 108, .4);
  border-radius: 8px;
  background: rgba(255, 186, 108, .14);
  color: #ffe1b7;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
.top-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tool-tabs a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 850;
  text-decoration: none;
}
.tool-tabs a.active, .tool-tabs a:hover {
  background: rgba(126, 87, 255, .2);
  color: #fff;
}
.upload-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.library-page {
  width: min(75%, 960px);
}
.premium-page {
  width: min(75%, 960px);
}
.premium-main-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(126, 87, 255, .22), transparent 32%),
    radial-gradient(circle at 90% 22%, rgba(78, 98, 255, .2), transparent 35%),
    rgba(18, 22, 32, .9);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 40px rgba(95, 83, 255, .22);
  padding: 22px;
}
.premium-header {
  text-align: center;
  margin-bottom: 16px;
}
.premium-kicker {
  margin: 0 0 6px;
  color: #c7b4ff;
  font-weight: 700;
}
.premium-header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.2vw, 42px);
}
.premium-header p {
  margin: 0 auto;
  max-width: 680px;
  color: var(--muted);
}
.premium-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.premium-feature-card {
  border: 1px solid rgba(168, 132, 255, .28);
  border-radius: 12px;
  padding: 16px;
  background: rgba(9, 12, 20, .72);
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset;
}
.premium-feature-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.premium-feature-card ul {
  margin: 0;
  padding-left: 18px;
  color: #dbe3f3;
}
.premium-feature-card li + li {
  margin-top: 6px;
}
.premium-feature-highlight {
  background: linear-gradient(160deg, rgba(126, 87, 255, .3), rgba(79, 97, 255, .12));
  border-color: rgba(182, 145, 255, .64);
  box-shadow: 0 0 26px rgba(126, 87, 255, .25), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.premium-feature-highlight p {
  margin: 0 0 12px;
  color: #ecf0ff;
}
.premium-insight-panel {
  margin-top: 14px;
  border: 1px solid rgba(168, 132, 255, .34);
  border-radius: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(126, 87, 255, .18), transparent 34%),
    rgba(9, 12, 20, .78);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}
.premium-insight-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
}
.premium-insight-panel p {
  margin: 0 0 10px;
  color: #d7e0f0;
}
.premium-insight-keywords {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #e9e4ff;
}
.premium-insight-keywords li + li {
  margin-top: 6px;
}
.library-main-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 32, .86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255,255,255,.04) inset;
  padding: 16px;
}
.library-panel {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(9, 12, 20, .72);
  padding: 14px;
}
.library-panel header h1 {
  margin: 0 0 6px;
  text-align: center;
}
.library-panel header p {
  margin: 0 0 12px;
}
.library-scroll {
  min-height: 420px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 6px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.library-empty {
  grid-column: 1 / -1;
  min-height: 420px;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}
.library-item {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(11, 16, 28, .86);
}
.library-preview {
  height: 160px;
  background: #060a14;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  width: 100%;
  cursor: pointer;
}
.library-preview img,
.library-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.library-fallback {
  color: #94a3b8;
  font-weight: 900;
}
.library-preview:disabled {
  cursor: not-allowed;
}
.library-meta {
  padding: 10px;
  display: grid;
  gap: 4px;
}
.library-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-meta span {
  color: var(--muted);
  font-size: 12px;
}
.library-hover-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(4, 8, 16, .7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.library-item:hover .library-hover-actions {
  opacity: 1;
  pointer-events: auto;
}
.library-delete {
  position: absolute;
  right: 8px;
  bottom: 8px;
}
.library-delete .danger {
  background: rgba(199, 54, 85, .2);
  border: 1px solid rgba(199, 54, 85, .4);
  border-radius: 8px;
  min-height: 30px;
  padding: 0 10px;
}
.media-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 16, .62);
  backdrop-filter: blur(10px);
}
.media-modal-backdrop.is-open {
  display: flex;
}
.media-modal {
  width: min(1040px, 100%);
  max-height: 90vh;
  border: 1px solid rgba(168, 132, 255, .35);
  border-radius: 10px;
  background: rgba(11, 15, 24, .96);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.media-modal h2 {
  margin: 0;
  font-size: 18px;
  padding-right: 34px;
}
.media-modal-close {
  justify-self: end;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(20, 24, 34, .88);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.media-modal-body {
  max-height: calc(90vh - 90px);
  display: grid;
  place-items: center;
}
.media-modal-body img,
.media-modal-body video {
  max-width: 100%;
  max-height: calc(90vh - 90px);
  border-radius: 8px;
  display: block;
}
.upload-card, .auth-card, .share-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 32, .86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter: blur(18px);
}
.upload-card {
  width: min(75%, 960px);
  margin: 0 auto;
  padding: 24px;
}
.section-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(126, 87, 255, .38);
  border-radius: 999px;
  color: #c8bcff;
  background: rgba(126,87,255,.14);
  font-size: 12px;
  font-weight: 900;
}
h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 48px); line-height: 1.04; letter-spacing: 0; }
.upload-card > h1 { font-size: clamp(24px, 3vw, 40px); }
h2 { margin: 0 0 12px; }
p { color: var(--muted); }
.dropzone {
  display: grid;
  gap: 16px;
  margin: 24px 0;
  min-height: 300px;
  padding: 40px;
  border: 1.5px dashed rgba(168, 132, 255, .65);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(126, 87, 255, .16), rgba(11, 15, 24, .28)),
    rgba(12, 16, 27, .74);
  text-align: center;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.dropzone.is-dragging {
  border-color: #75e29d;
  background:
    linear-gradient(180deg, rgba(117, 226, 157, .14), rgba(11, 15, 24, .34)),
    rgba(12, 16, 27, .86);
  transform: translateY(-2px);
}
.dropzone input { margin: 0 auto; }
.dropzone label span {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 22px;
  background: rgba(126, 87, 255, .2);
  color: var(--brand);
  font-size: 34px;
}
.dropzone label strong, .dropzone label small { display: block; }
.dropzone label small { color: var(--muted); margin-top: 8px; }
.dropzone button:disabled { opacity: .5; cursor: not-allowed; }
.dropzone .btn.primary {
  justify-self: center;
  width: auto;
  min-width: 148px;
  max-width: 210px;
  padding: 0 18px;
  border: 1px solid rgba(168, 132, 255, .4);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(126, 87, 255, .22), rgba(126, 87, 255, .12));
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 8px 20px rgba(56, 46, 124, .28);
}
.dropzone .btn.primary:hover {
  background: linear-gradient(180deg, rgba(126, 87, 255, .28), rgba(126, 87, 255, .16));
}
.scan-status {
  justify-self: center;
  padding: 9px 12px;
  border: 1px solid rgba(117, 226, 157, .35);
  border-radius: 8px;
  background: rgba(117, 226, 157, .1);
  color: #a8f3c4;
  font-weight: 850;
}
.live-upload {
  position: relative;
  margin: 0 0 18px;
  border: 1px solid rgba(168, 132, 255, .34);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 12, 20, .82);
}
.live-media-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.media-audio-controls {
  display: grid;
  grid-template-columns: auto minmax(140px, 220px);
  gap: 8px;
  align-items: center;
  justify-items: end;
}
.live-media-controls input[type="range"] {
  min-height: 34px;
  padding: 0 4px;
  background: rgba(8, 11, 20, .86);
  border: 1px solid rgba(168,132,255,.42);
  border-radius: 8px;
}
.live-upload-preview {
  min-height: 290px;
  background: #080b14;
  display: grid;
  place-items: center;
  padding: 14px;
}
.live-upload-preview img,
.live-upload-preview video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.live-upload-audio-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(168,132,255,.26);
  border-radius: 10px;
  background: rgba(9,12,20,.78);
}
.live-upload-audio-wrap audio {
  width: 100%;
}
.live-upload-placeholder {
  color: #94a3b8;
  font-weight: 800;
}
.live-upload-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px;
  background: linear-gradient(180deg, rgba(8,11,20,.05), rgba(8,11,20,.92) 60%);
}
.progress-bar {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.14);
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #6ee7b7);
  transition: width .15s ease;
}
.progress-text {
  margin: 8px 0 0;
  color: #e7e3ff;
  font-size: 13px;
  font-weight: 850;
}
.live-upload-result {
  padding: 14px;
  border-top: 1px solid rgba(168, 132, 255, .24);
}
.media-quick-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin: 0;
}
.media-action-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(168,132,255,.36);
  border-radius: 8px;
  background: rgba(20, 24, 36, .82);
  color: #dfe3f8;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.media-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(168,132,255,.58);
  box-shadow: 0 8px 18px rgba(95,83,255,.2);
  background: rgba(30, 35, 50, .92);
}
.media-action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.1;
}
.upload-card.has-live-upload #uploadForm {
  display: none !important;
}
.upload-card.has-live-upload #liveUploadPanel {
  display: block !important;
}
.generated-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 8px 0 10px;
}
.limits-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.plan-panel {
  margin: 10px 0 16px;
  padding: 14px 14px 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(7, 10, 18, .52);
}
.plan-panel-premium {
  border-color: rgba(168, 132, 255, .8);
  box-shadow:
    0 0 0 1px rgba(168, 132, 255, .22) inset,
    0 0 18px rgba(138, 92, 255, .45),
    0 0 34px rgba(126, 87, 255, .35);
}
.limits-heading {
  margin: 2px 0 12px;
  text-align: center;
}
.limit-spacer {
  min-height: 100%;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(9, 12, 20, .72);
}
.limit-spacer h2,
.limit-spacer h3 {
  margin-bottom: 7px;
  font-size: 16px;
}
.limit-spacer ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.limit-spacer p {
  margin: 0;
}
.alert, .auth-required {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.alert.danger { border-color: rgba(255, 106, 136, .4); color: #ff8aa0; }
.alert.success { border-color: rgba(117, 226, 157, .4); color: #75e29d; }
.processing-list { display: grid; gap: 10px; }
.history-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.history-header h2 {
  margin: 0;
}
.upload-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.upload-history-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(9, 12, 20, .66);
}
.upload-history-list a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: #dfe8ff;
}
.upload-history-list small {
  color: var(--muted);
  font-size: 12px;
}
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 12, 20, .72);
}
.upload-row span { display: block; color: var(--muted); font-size: 13px; }
.upload-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #0b0f18; color: #f8fafc; }
.danger { color: var(--danger); }
.auth-page, .share-page { display: grid; place-items: center; }
.auth-card, .share-card { width: min(520px, 100%); padding: 26px; }
.auth-card form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #0b0f18;
  color: var(--text);
}
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 7, 12, .66);
  backdrop-filter: blur(12px);
}
.confirm-backdrop.is-open {
  display: flex;
  animation: fadeIn .16s ease-out;
}
.confirm-card {
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid rgba(168, 132, 255, .38);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 0, rgba(126, 87, 255, .28), transparent 15rem),
    rgba(18, 22, 32, .96);
  box-shadow: 0 24px 80px rgba(0,0,0,.42), 0 0 34px rgba(95,83,255,.18);
  transform-origin: center;
  animation: popIn .18s ease-out;
}
.confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 24px;
  font-weight: 950;
}
.confirm-title-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.confirm-title-inline .confirm-icon {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 12px;
  font-size: 20px;
  flex: 0 0 38px;
}
.confirm-card h2 {
  margin-bottom: 8px;
}
.confirm-card p a {
  color: #ddd7ff;
  font-weight: 800;
}
.confirm-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.confirm-links a {
  padding: 8px 10px;
  border: 1px solid rgba(168, 132, 255, .28);
  border-radius: 8px;
  background: rgba(126,87,255,.12);
  color: #ddd7ff;
  font-weight: 800;
  text-decoration: none;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
#uploadConfirm .confirm-actions {
  justify-content: center;
}
.guest-locked .upload-workspace {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}
.gate-card {
  width: min(380px, 100%);
  text-align: center;
}
.gate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  width: 100%;
}
.gate-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  font-size: 14px;
}
.auth-modal-card {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
}
.auth-modal-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: auto;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 10px 14px;
  font-weight: 400;
  border: 1px solid rgba(168, 132, 255, .42);
  background: rgba(13, 17, 29, .86);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset;
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.auth-modal-form {
  display: grid;
  gap: 12px;
}
.auth-error-message {
  margin: -2px 0 2px;
  color: #ff6b7c;
  font-size: 14px;
  font-weight: 800;
  min-height: 18px;
}
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 46px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid rgba(168,132,255,.34);
  border-radius: 8px;
  background: rgba(20, 24, 36, .88);
  color: #d5ccff;
  cursor: pointer;
  line-height: 1;
}
.password-toggle i {
  width: 16px;
  height: 16px;
}
.auth-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-modal-actions .btn {
  width: 100%;
  cursor: pointer;
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.auth-modal-close {
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
  border: 1px solid rgba(168, 132, 255, .38);
  background: rgba(13, 17, 29, .86);
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.auth-modal-actions .btn:hover,
.auth-modal-google:hover,
.auth-modal-close:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(168, 132, 255, .62);
  box-shadow: 0 10px 22px rgba(95,83,255,.24), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.auth-modal-actions .btn:active,
.auth-modal-google:active,
.auth-modal-close:active {
  transform: translateY(0) scale(.99);
}
.auth-modal-actions .btn.primary:hover {
  background: linear-gradient(135deg, #8b75ff, #a266ff);
}
.auth-modal-actions .btn:not(.primary):hover,
.auth-modal-close:hover,
.auth-modal-google:hover {
  background: rgba(126,87,255,.14);
}
.media-editor-card {
  width: min(760px, 100%);
  display: grid;
  gap: 12px;
}
#imageCropperWrap {
  width: 100%;
  max-height: 62vh;
  overflow: hidden;
  border: 1px solid rgba(168,132,255,.34);
  border-radius: 8px;
  background: rgba(9, 12, 20, .86);
}
#imageCropperTarget {
  max-width: 100%;
  display: block;
}
#videoTrimWrap video {
  width: 100%;
  max-height: 52vh;
  border-radius: 8px;
  border: 1px solid rgba(168,132,255,.34);
  background: #090d18;
}
.trim-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.legal-hero {
  width: min(820px, 100%);
  margin: 0 auto 24px;
  text-align: center;
}
.policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.policy-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 285px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 32, .86);
  box-shadow: 0 18px 54px rgba(0,0,0,.24), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.policy-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.policy-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(126,87,255,.95), rgba(154,92,255,.9));
  color: #fff;
  font-weight: 950;
}
.policy-card h2 {
  margin: 0;
  font-size: 20px;
}
.policy-card p {
  margin: 0;
}
.policy-card details {
  margin-top: 6px;
}
.policy-card summary {
  cursor: pointer;
  color: #ddd7ff;
  font-weight: 850;
}
.policy-card ul,
.full-policy ul {
  display: grid;
  gap: 9px;
  padding-left: 20px;
  color: var(--muted);
}
.policy-card .btn {
  margin-top: 10px;
}
.full-policy {
  width: min(760px, 100%);
  margin: 0 auto;
}
.full-policy .policy-icon {
  margin-bottom: 14px;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
textarea { min-height: 90px; resize: vertical; }
.google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 400;
}
.btn-google {
  width: auto;
  gap: 9px;
}
.google-logo {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  flex: 0 0 18px;
}
.shared-media { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #111827; }
.report-box { display: grid; gap: 12px; margin-top: 20px; }
.footer {
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: calc(100% - 36px);
  margin: 10px auto 28px;
  padding: 12px 16px;
  border: 1px solid rgba(168, 132, 255, .3);
  border-radius: 12px;
  background: rgba(9, 12, 20, .72);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 22px rgba(95, 83, 255, .18);
  color: var(--muted);
}
.footer-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.footer a {
  line-height: 1;
}
.footer-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.footer-divider {
  width: 1px;
  height: 20px;
  background: rgba(200, 204, 223, .45);
}
.admin-body, .admin-body .topbar {
  background: var(--admin);
  color: #f8fafc;
}
.admin-body .topbar { border-color: var(--admin-line); }
.admin-body .premium, .admin-body nav a, .admin-body nav button { background: #111827; color: #f8fafc; border-color: var(--admin-line); }
.admin-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
  background: var(--admin);
}
.admin-side {
  padding: 22px 10px;
  border-right: 1px solid var(--admin-line);
  background: linear-gradient(180deg, rgba(85, 71, 255, .14), transparent 28%), #090f19;
}
.admin-side h1 { padding: 0 12px 16px; font-size: 22px; }
.admin-side small { display: block; color: #9aa4b6; font-size: 11px; letter-spacing: .08em; }
.admin-side a {
  display: block;
  margin: 4px 0;
  padding: 12px;
  border-radius: 8px;
  color: #e8edf7;
  text-decoration: none;
  font-weight: 760;
}
.admin-side a.active, .admin-side a:hover { background: rgba(255,255,255,.1); }
.admin-main {
  min-width: 0;
  padding: 24px;
  background: radial-gradient(circle at 88% 5%, rgba(85, 71, 255, .18), transparent 30rem), var(--admin);
}
.admin-main header { margin-bottom: 20px; }
.admin-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.admin-cards article, .admin-card {
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: var(--admin-card);
}
.admin-cards span { color: #aeb8ca; }
.admin-cards strong { display: block; margin-top: 8px; font-size: 28px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--admin-line); border-radius: 8px; }
table { width: 100%; min-width: 1050px; border-collapse: collapse; background: rgba(255,255,255,.035); }
th, td { padding: 12px; border-bottom: 1px solid var(--admin-line); text-align: left; vertical-align: middle; font-size: 13px; }
th { background: rgba(255,255,255,.06); color: #f8fafc; }
td { color: #dde5f2; }
.thumb, .safe-preview { width: 72px; height: 46px; border-radius: 6px; object-fit: cover; }
.safe-preview { display: grid; place-items: center; background: #1f2937; color: #94a3b8; font-size: 11px; font-weight: 900; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.1); font-weight: 850; text-transform: capitalize; }
.status.safe, .status.approved_after_review { color: #75e29d; background: rgba(34,197,94,.14); }
.status.needs_review, .status.quarantined { color: #ffc16b; background: rgba(245,158,11,.16); }
.status.rejected { color: #ff8aa0; background: rgba(244,63,94,.16); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button, .filters span {
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #111827;
  color: #f8fafc;
  padding: 7px 9px;
  font-weight: 760;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
pre { white-space: pre-wrap; overflow: auto; color: #cbd5e1; }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  nav { overflow-x: auto; width: 100%; justify-content: flex-start; padding-bottom: 2px; }
  .tool-tabs { justify-content: flex-start; overflow-x: auto; }
  .tool-tabs a, nav a, nav button { white-space: nowrap; flex: 0 0 auto; }
  .upload-workspace, .admin-shell { grid-template-columns: 1fr; }
  .library-page { width: min(100% - 36px, 960px); }
  .premium-page { width: min(100% - 36px, 960px); }
  .premium-feature-grid { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: 1fr; }
  .library-empty { min-height: 340px; }
  .library-scroll { min-height: 340px; }
  .upload-card { width: 100%; }
  .admin-side { display: flex; overflow-x: auto; gap: 8px; border-right: 0; border-bottom: 1px solid var(--admin-line); }
  .admin-side h1 { display: none; }
  .admin-side a { white-space: nowrap; }
  .admin-cards { grid-template-columns: 1fr 1fr; }
  .upload-row { grid-template-columns: 1fr; }
  .limits-inline { grid-template-columns: 1fr 1fr; }
  .policy-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .page { width: min(100% - 22px, 1280px); }
  .topbar { width: min(100% - 22px, 1180px); margin-top: 24px; border-radius: 18px; }
  .library-page { width: min(100% - 22px, 960px); }
  .premium-page { width: min(100% - 22px, 960px); }
  .library-empty { min-height: 280px; }
  .library-scroll { min-height: 280px; }
  .brand { min-width: 0; }
  .upload-card { padding: 16px; }
  .dropzone { padding: 22px 12px; }
  .limits-inline { grid-template-columns: 1fr; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; }
  .gate-actions { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 16px 10px; }
  .admin-cards { grid-template-columns: 1fr; }
}
