:root {
  --bg: #08070a;
  --panel: #121017;
  --panel-2: #191520;
  --line: rgba(255,255,255,.10);
  --text: #fff7fb;
  --muted: #b9adb8;
  --rose: #f26b9c;
  --wine: #8d2857;
  --gold: #e7bf72;
  --violet: #8f77ff;
  --ok: #72e1b2;
  --danger: #ff7c8b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(242,107,156,.24), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(231,191,114,.18), transparent 28%),
    linear-gradient(135deg, #08070a 0%, #130c14 48%, #09070b 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  background: rgba(18,16,23,.88);
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
  backdrop-filter: blur(18px);
}

.brand-mark,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark strong,
.side-brand strong {
  display: block;
  font-size: 15px;
}

.brand-mark small,
.side-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.brand-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 6%, var(--gold) 7% 22%, var(--rose) 45%, var(--wine) 100%);
  box-shadow: 0 0 32px rgba(242,107,156,.42);
}

.auth-copy { margin: 30px 0 24px; }

.auth-copy h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.auth-copy p,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field label {
  color: #e9dfe8;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(242,107,156,.72);
  box-shadow: 0 0 0 4px rgba(242,107,156,.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  color: #17070f;
  font-weight: 800;
  cursor: pointer;
}

.btn.secondary {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border: 1px solid var(--line);
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
}

.notice.error { border-color: rgba(255,124,139,.45); color: #ffd4da; }
.notice.success { border-color: rgba(114,225,178,.45); color: #d4ffec; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(8,7,10,.72);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.side-nav a,
.logout-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid transparent;
}

.side-nav a.active,
.side-nav a:hover,
.logout-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.07);
  border-color: var(--line);
}

.logout-link {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.side-toggle,
.sidebar-scrim {
  display: none;
}

.main-panel {
  padding: 28px;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  grid-column: span 4;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(18,16,23,.82);
}

.card.wide { grid-column: span 8; }
.card.full {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-x: hidden;
}

.card h2,
.card h3 {
  margin: 0 0 10px;
}

.stat {
  font-size: 38px;
  font-weight: 800;
  margin-top: 14px;
}

.ok-dot {
  color: var(--ok);
  font-size: 28px;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-list-large {
  margin-top: 18px;
}

.product-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--panel-2);
}

.product-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 25%, rgba(242,107,156,.22), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: var(--gold);
  font-size: 28px;
}

.fallback-placeholder {
  display: none;
}

.product-media.is-missing-image .fallback-placeholder {
  display: grid;
}

.product-card .body {
  padding: 14px;
}

.product-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.product-card-access .mini-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 4px;
}

.filter-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-weight: 800;
}

.filter-tabs a.active,
.filter-tabs a:hover {
  color: var(--text);
  border-color: rgba(242,107,156,.48);
  background: rgba(242,107,156,.12);
}

.filter-tabs span {
  color: var(--gold);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 20px;
}

.viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.viewer-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.content-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-counts span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--gold);
  background: rgba(255,255,255,.045);
  font-size: 13px;
  font-weight: 800;
}

.viewer-description {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.section-title {
  margin: 28px 0 14px;
}

.media-view-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.media-view-grid.videos {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1100px;
}

.media-view-grid.images {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.media-view-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050406;
  max-width: 100%;
  min-width: 0;
}

button.media-view-card {
  padding: 0;
  color: inherit;
  cursor: zoom-in;
}

.media-view-card video,
.media-view-card img {
  display: block;
  width: 100%;
  background: #050406;
}

.media-view-card video {
  height: min(58vh, 620px);
  max-height: 620px;
  object-fit: contain;
}

.protected-viewer,
.protected-viewer img,
.protected-viewer video,
.image-lightbox img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.protected-viewer {
  transition: filter .18s ease, opacity .18s ease;
}

body.security-blurred .protected-viewer,
body.security-blurred .image-lightbox.is-open img {
  filter: blur(22px);
  opacity: .34;
  pointer-events: none;
}

.security-blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(233,75,135,.20), transparent 28%),
    radial-gradient(circle at 50% 58%, rgba(243,202,120,.10), transparent 30%),
    rgba(6,4,7,.78);
  color: var(--text);
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.security-blur-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 30px 26px;
  border: 1px solid rgba(255,218,233,.16);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.035)),
    rgba(18,11,17,.72);
  box-shadow:
    0 28px 90px rgba(0,0,0,.42),
    0 0 60px rgba(233,75,135,.16),
    inset 0 1px 0 rgba(255,255,255,.08);
  text-align: center;
}

.security-blur-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(243,202,120,.24), rgba(233,75,135,.18));
  color: var(--gold);
  box-shadow: 0 0 36px rgba(243,202,120,.18);
}

.security-blur-icon i {
  font-size: 25px;
}

.security-blur-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.security-blur-card small {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

body.security-blurred .security-blur-overlay {
  display: grid;
}

.media-load-error::after {
  content: "Video kunne ikke indlæses";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8,6,10,.82);
  color: var(--gold);
  font-weight: 900;
}

.media-view-card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.image-gallery-shell {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding: 14px;
}

.gallery-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.gallery-hint span:first-child {
  color: var(--gold);
  font-weight: 800;
}

.compact-gallery {
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.compact-gallery .image-card img {
  aspect-ratio: 1 / 1;
}

.media-watermark {
  position: absolute;
  right: 12px;
  bottom: 10px;
  max-width: calc(100% - 24px);
  padding: 5px 8px;
  background: rgba(0,0,0,.42);
  color: rgba(255,255,255,.72);
  font-size: 11px;
  pointer-events: none;
  word-break: break-word;
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: rgba(3,2,4,.92);
}

.image-lightbox.is-open {
  display: flex;
}

.image-lightbox img {
  max-width: min(100%, 1200px);
  max-height: calc(100vh - 112px);
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

.lightbox-watermark {
  position: absolute;
  right: 22px;
  bottom: 18px;
  padding: 6px 9px;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

.viewer-card {
  padding-bottom: 22px;
}

.image-viewer {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding: 14px;
  max-width: 1100px;
}

.image-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(62vh, 620px);
  max-height: min(62vh, 620px);
  overflow: hidden;
  background: #050406;
  border: 1px solid var(--line);
}

.image-stage img {
  display: block;
  max-width: 100%;
  max-height: min(62vh, 620px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.stage-nav,
.stage-open {
  position: absolute;
  border: 1px solid var(--line);
  background: rgba(8,7,10,.72);
  color: var(--text);
  cursor: pointer;
}

.stage-nav {
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.stage-nav.prev { left: 12px; }
.stage-nav.next { right: 12px; }

.stage-open {
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-weight: 800;
}

.image-viewer-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.image-viewer-footer strong {
  color: var(--gold);
  margin-right: 8px;
}

.thumb-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 76px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,198,91,.72) rgba(255,255,255,.08);
  scroll-snap-type: x proximity;
}

.thumb-strip::-webkit-scrollbar {
  height: 9px;
}

.thumb-strip::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}

.thumb-strip::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--gold), var(--pink));
  border: 2px solid rgba(14,11,18,.92);
}

.thumb-strip::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #ffe0a0, var(--pink));
}

.thumb-button {
  width: 76px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--line);
  background: #050406;
  cursor: pointer;
  opacity: .62;
}

.thumb-button.active,
.thumb-button:hover {
  opacity: 1;
  border-color: var(--gold);
}

.thumb-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer-shell {
  border: 1px solid var(--line);
  background: rgba(18,16,23,.86);
  padding: 18px;
}

.viewer-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.viewer-counts {
  display: flex;
  gap: 8px;
}

.viewer-counts span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.viewer-media {
  min-width: 0;
}

.viewer-info {
  position: sticky;
  top: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 22% 0%, rgba(242,107,156,.16), transparent 38%),
    rgba(255,255,255,.035);
  padding: 18px;
}

.viewer-info h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.viewer-info .viewer-description {
  margin: 0 0 16px;
  max-width: none;
}

.viewer-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.viewer-info-grid span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  padding: 12px;
  font-size: 12px;
  font-weight: 800;
}

.viewer-info-grid strong {
  display: block;
  color: var(--gold);
  font-size: 24px;
}

.viewer-section-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.viewer-layout .media-view-grid.videos,
.viewer-layout .image-viewer {
  max-width: none;
}

.viewer-layout .media-view-card video {
  width: 100%;
  height: min(56vh, 560px);
}

@media (max-width: 1120px) {
  .viewer-layout {
    grid-template-columns: 1fr;
  }

  .viewer-info {
    position: static;
  }
}

@media (max-width: 720px) {
  .viewer-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.library-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 14% 15%, rgba(242,107,156,.18), transparent 35%),
    linear-gradient(135deg, rgba(18,16,23,.92), rgba(25,21,32,.78));
  margin-bottom: 16px;
}

.library-hero h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
}

.library-hero p {
  max-width: 660px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0 0;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}

.library-stats span {
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-stats strong {
  display: block;
  color: var(--gold);
  font-size: 26px;
  line-height: 1.1;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(320px, 100%);
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
}

.library-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.library-card {
  min-height: 320px;
}

.library-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.library-card-head h2 {
  margin: 0 0 6px;
}

.library-result-count {
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--gold);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  font-weight: 800;
}

.library-empty-search {
  display: none;
  padding: 42px 0 20px;
  text-align: center;
}

.library-empty-search.is-visible {
  display: block;
}

.library-card .product-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.library-card .product-card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.library-card .product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(242,107,156,.45);
  background: linear-gradient(180deg, rgba(242,107,156,.10), rgba(255,255,255,.035));
}

.product-media {
  position: relative;
}

.content-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 9px;
  background: rgba(8,7,10,.72);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 800;
}

.library-card .product-card h3 {
  min-height: 42px;
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.25;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-card .mini-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 840px) {
  .library-hero,
  .library-toolbar,
  .library-card-head {
    flex-direction: column;
  }

  .library-stats,
  .library-search {
    width: 100%;
  }
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.price-line del {
  color: rgba(255,247,251,.48);
  font-size: 13px;
}

.price-line ins {
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.price-line .amount {
  white-space: nowrap;
}

.price-line > .amount {
  color: var(--gold);
  font-weight: 800;
}

.clean-price {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}

.clean-price del {
  color: rgba(255,247,251,.46);
  font-size: 13px;
}

.clean-price strong {
  color: var(--gold);
  font-size: 17px;
  line-height: 1;
}

.clean-price .save-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255,198,91,.38);
  background: rgba(255,198,91,.12);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logout-link { position: static; margin-top: 12px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .card,
  .card.wide { grid-column: 1 / -1; }
}

/* Responsive hardening: keep every panel page usable on phones, tablets, and narrow desktops. */
html {
  overflow-x: hidden;
}

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

.topbar,
.library-hero,
.library-toolbar,
.viewer-titlebar,
.viewer-layout,
.grid,
.product-list {
  min-width: 0;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px;
  }

  .main-panel {
    padding: 22px;
  }

  .viewer-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .viewer-info h2 {
    font-size: 30px;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    display: grid;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-brand {
    justify-content: space-between;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }

  .side-nav a,
  .logout-link {
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
  }

  .logout-link {
    position: static;
    margin-top: 0;
  }

  .viewer-layout {
    grid-template-columns: 1fr;
  }

  .viewer-info {
    position: static;
    order: -1;
  }

  .media-view-grid.videos,
  .image-viewer {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .main-panel {
    padding: 14px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 18px;
  }

  .topbar h1,
  .auth-copy h1 {
    font-size: 38px;
  }

  .user-pill {
    max-width: 100%;
  }

  .user-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    padding: 14px;
  }

  .side-brand small {
    display: none;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-nav a,
  .logout-link {
    font-size: 13px;
  }

  .library-hero {
    padding: 18px;
  }

  .library-hero h2 {
    font-size: 38px;
  }

  .library-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .library-stats span {
    padding: 10px;
  }

  .library-stats strong {
    font-size: 22px;
  }

  .filter-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-tabs a {
    justify-content: center;
    min-width: 0;
    padding: 0 10px;
  }

  .library-card,
  .card.full,
  .viewer-shell {
    padding: 14px;
  }

  .library-card .product-list,
  .product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card h3,
  .library-card .product-card h3 {
    min-height: 0;
    font-size: 14px;
  }

  .product-card .body {
    padding: 12px;
  }

  .content-meta span {
    padding: 6px 8px;
    font-size: 11px;
  }

  .viewer-titlebar,
  .viewer-head,
  .image-viewer-footer,
  .library-card-head,
  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .viewer-counts,
  .content-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-info {
    padding: 14px;
  }

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

  .viewer-layout .media-view-card video,
  .media-view-card video {
    height: min(48vh, 420px);
  }

  .image-stage {
    min-height: min(54vh, 460px);
    max-height: min(54vh, 460px);
  }

  .image-stage img {
    max-height: min(54vh, 460px);
  }

  .stage-nav {
    width: 38px;
    height: 38px;
  }

  .stage-open {
    top: 10px;
    right: 10px;
    padding: 8px 10px;
  }

  .thumb-strip {
    grid-auto-columns: 64px;
  }

  .thumb-button {
    width: 64px;
  }

  .image-lightbox {
    padding: 44px 12px;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 460px) {
  .auth-shell {
    padding: 12px;
  }

  .auth-card {
    padding: 20px;
  }

  .topbar h1,
  .auth-copy h1,
  .library-hero h2 {
    font-size: 32px;
  }

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

  .library-stats {
    grid-template-columns: 1fr;
  }

  .library-card .product-list,
  .product-list {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    grid-template-columns: 1fr;
  }

  .viewer-counts,
  .content-counts,
  .viewer-info-grid {
    grid-template-columns: 1fr;
  }

  .viewer-layout .media-view-card video,
  .media-view-card video {
    height: min(42vh, 340px);
  }

  .image-stage {
    min-height: min(48vh, 380px);
    max-height: min(48vh, 380px);
  }

  .image-stage img {
    max-height: min(48vh, 380px);
  }
}

.main-panel-compact {
  padding-top: 18px;
}

.main-panel-compact .library-hero {
  margin-top: 0;
  padding: 20px;
  align-items: center;
}

.main-panel-compact .library-hero h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.main-panel-compact .library-stats span {
  padding: 12px;
}

.main-panel-compact .library-stats strong {
  font-size: 22px;
}

@media (max-width: 760px) {
  .main-panel-compact {
    padding-top: 14px;
  }

  .main-panel-compact .library-hero {
    padding: 18px;
  }

  .main-panel-compact .library-hero h2 {
    font-size: 34px;
  }
}

@media (max-width: 460px) {
  .main-panel-compact .library-hero h2 {
    font-size: 30px;
  }
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 0%, rgba(242,107,156,.20), transparent 34%),
    linear-gradient(135deg, rgba(18,16,23,.96), rgba(37,29,36,.84));
}

.admin-hero h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

.admin-hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.admin-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.admin-tabs a.active,
.admin-tabs a:hover {
  border-color: rgba(242,107,156,.55);
  background: rgba(242,107,156,.14);
  color: var(--text);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-grid article,
.admin-panel,
.admin-edit-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
}

.admin-stat-grid article {
  padding: 16px;
}

.admin-stat-grid span,
.admin-edit-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-stat-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 28px;
  line-height: 1.1;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 16px;
}

.admin-panel {
  padding: 18px;
  min-width: 0;
}

.admin-panel h3 {
  margin: 0 0 14px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.admin-mini-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-mini-row strong {
  color: var(--gold);
  white-space: nowrap;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-edit-card {
  overflow: hidden;
}

.admin-edit-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.admin-edit-card summary::-webkit-details-marker {
  display: none;
}

.admin-edit-card summary strong,
.admin-edit-card summary small {
  display: block;
}

.admin-form {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(7,6,10,.66);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}

.admin-form textarea {
  resize: vertical;
}

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-section-head h3 {
  margin: 0 0 8px;
}

.discord-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.discord-channel-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}

.discord-channel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
}

.discord-channel-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(88,101,242,.35), rgba(233,75,135,.20));
  color: #fff;
}

.discord-channel-card h4 {
  margin: 0 0 5px;
}

.discord-channel-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-form-label {
  display: grid;
  gap: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-form-label input,
.admin-form-label select,
.admin-form-label textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7,6,10,.66);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}

.admin-form-span {
  grid-column: 1 / -1;
}

.admin-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  transition: background .18s ease, border-color .18s ease;
}

.admin-switch span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}

.admin-switch input:checked + span {
  border-color: rgba(243,202,120,.45);
  background: rgba(233,75,135,.28);
}

.admin-switch input:checked + span::before {
  transform: translateX(20px);
  background: var(--gold);
}

.admin-shopify {
  display: grid;
  gap: 18px;
}

.shopify-settings-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.shopify-settings-grid > .admin-form-span {
  grid-column: 1 / -1;
}

.shopify-settings-grid > .admin-form-label:not(.admin-form-span) {
  grid-column: span 4;
}

.shopify-toggle-card {
  grid-column: span 2;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  color: var(--text);
}

.shopify-toggle-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shopify-toggle-copy strong {
  font-size: 13px;
  color: var(--gold);
  text-transform: uppercase;
}

.shopify-toggle-copy small {
  color: var(--muted);
  line-height: 1.3;
}

.shopify-toggle-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shopify-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.shopify-toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}

.shopify-toggle-card input:checked + .shopify-toggle {
  border-color: rgba(243,202,120,.45);
  background: rgba(233,75,135,.28);
}

.shopify-toggle-card input:checked + .shopify-toggle::before {
  transform: translateX(22px);
  background: var(--gold);
}

.shopify-map-field {
  gap: 10px;
}

.shopify-map-textarea {
  min-height: 170px;
  overflow: auto;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}

.shopify-example {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.shopify-example code {
  display: inline-block;
  max-width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .shopify-settings-grid > .admin-form-label:not(.admin-form-span),
  .shopify-toggle-card {
    grid-column: span 6;
  }
}

@media (max-width: 720px) {
  .shopify-settings-grid {
    grid-template-columns: 1fr;
  }

  .shopify-settings-grid > .admin-form-label:not(.admin-form-span),
  .shopify-toggle-card {
    grid-column: 1 / -1;
  }

  .shopify-toggle-card {
    min-height: 64px;
  }

  .shopify-map-textarea {
    min-height: 220px;
  }
}

@media (max-width: 1040px) {
  .admin-tabs,
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .admin-hero,
  .admin-edit-card summary {
    flex-direction: column;
    align-items: stretch;
  }

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

/* Tailwind-era premium adult panel skin. Keep this layer last so it upgrades all legacy panel classes. */
:root {
  --bg: #060407;
  --panel: #120b11;
  --panel-2: #1b1019;
  --line: rgba(255, 218, 233, .13);
  --text: #fff7fb;
  --muted: #c8b5c0;
  --rose: #e94b87;
  --wine: #4b1027;
  --gold: #f3ca78;
  --violet: #a78bfa;
  --ok: #72e1b2;
  --danger: #ff7c8b;
}

body {
  background:
    radial-gradient(circle at 8% -10%, rgba(233,75,135,.28), transparent 34%),
    radial-gradient(circle at 86% 2%, rgba(243,202,120,.16), transparent 28%),
    radial-gradient(circle at 60% 100%, rgba(75,16,39,.50), transparent 36%),
    linear-gradient(145deg, #060407 0%, #130911 42%, #070507 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 82%);
}

.auth-card,
.sidebar,
.card,
.library-hero,
.library-card,
.viewer-shell,
.viewer-info,
.image-viewer,
.admin-hero,
.admin-panel,
.admin-edit-card,
.admin-stat-grid article {
  border-color: rgba(255,218,233,.14);
  background:
    linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.028)),
    rgba(18,11,17,.78);
  box-shadow:
    0 24px 70px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(20px);
}

.auth-card,
.card,
.library-hero,
.library-card,
.viewer-shell,
.viewer-info,
.image-viewer,
.admin-hero,
.admin-panel,
.admin-edit-card {
  border-radius: 18px;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(18,11,17,.90), rgba(8,5,8,.78)),
    rgba(8,5,8,.82);
}

.brand-orb {
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 22%, #fff6de 0 7%, var(--gold) 8% 26%, var(--rose) 48%, #4b1027 100%);
  box-shadow: 0 0 34px rgba(233,75,135,.46), inset 0 1px 0 rgba(255,255,255,.35);
}

.side-brand strong,
.brand-mark strong {
  font-size: 16px;
  letter-spacing: .02em;
}

.side-nav a,
.logout-link,
.filter-tabs a,
.admin-tabs a,
.viewer-counts span,
.content-badge,
.admin-badge,
.library-stats span {
  border-radius: 999px;
}

.side-nav a,
.logout-link {
  min-height: 48px;
  background: rgba(255,255,255,.025);
}

.side-nav a.active,
.side-nav a:hover,
.logout-link:hover {
  border-color: rgba(243,202,120,.28);
  background: linear-gradient(135deg, rgba(233,75,135,.18), rgba(243,202,120,.08));
  box-shadow: 0 12px 28px rgba(233,75,135,.12);
}

.topbar h1,
.auth-copy h1,
.library-hero h2,
.admin-hero h2,
.viewer-info h2 {
  letter-spacing: 0;
  text-wrap: balance;
}

.topbar-page {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.eyebrow,
.viewer-section-label,
.admin-table th {
  color: var(--gold);
  letter-spacing: .08em;
}

.btn {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ff8fbd 52%, var(--rose));
  box-shadow: 0 14px 34px rgba(233,75,135,.23);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 44px rgba(233,75,135,.30);
}

.btn.secondary {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,218,233,.16);
  box-shadow: none;
}

.field input,
.field textarea,
.admin-form input,
.admin-form select,
.admin-form textarea,
.library-search input {
  border-radius: 14px;
  border-color: rgba(255,218,233,.14);
  background: rgba(5,4,7,.58);
}

.product-list {
  gap: 18px;
  align-items: stretch;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  border-radius: 18px;
  border-color: rgba(255,218,233,.13);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(243,202,120,.34);
  box-shadow: 0 24px 58px rgba(0,0,0,.30), 0 0 34px rgba(233,75,135,.12);
}

.product-card img,
.product-media,
.media-view-card,
.image-stage,
.image-lightbox img {
  border-radius: 14px;
}

.product-card .body {
  display: grid;
  grid-template-rows: minmax(44px, auto) 30px 40px;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.product-card h3 {
  font-weight: 850;
  line-height: 1.2;
  min-height: 44px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-media::after,
.media-view-card::before,
.image-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, rgba(6,4,7,.42));
}

.content-badge {
  background: rgba(6,4,7,.70);
  border-color: rgba(243,202,120,.24);
  color: var(--gold);
  backdrop-filter: blur(12px);
}

.clean-price .save-badge {
  border-radius: 999px;
}

.product-card .clean-price {
  margin: 0;
  min-height: 30px;
  align-items: center;
}

.product-card .clean-price .save-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-height: 28px;
  padding: 5px 10px;
  border-color: rgba(243,202,120,.45);
  background: rgba(6,4,7,.72);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
}

.buy-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ff8fbd 55%, var(--rose));
  color: #16070f;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(233,75,135,.20);
}

.product-card .clean-price + .buy-cta { margin-top: 0; }

.shopify-checkout-button {
  border: 0;
  cursor: pointer;
}

.shopify-checkout-button:disabled {
  cursor: wait;
  opacity: .72;
}

.shopify-checkout-button.is-loading i {
  animation: spin .9s linear infinite;
}

.shopify-buy-status {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

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

.product-card:hover .buy-cta {
  box-shadow: 0 16px 34px rgba(233,75,135,.30);
}

.library-hero,
.admin-hero {
  background:
    radial-gradient(circle at 10% 12%, rgba(233,75,135,.24), transparent 34%),
    radial-gradient(circle at 84% 0%, rgba(243,202,120,.13), transparent 28%),
    linear-gradient(135deg, rgba(22,12,20,.94), rgba(9,6,10,.84));
}

.library-card .product-card {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.026));
}

.viewer-shell {
  padding: 22px;
}

.viewer-layout {
  gap: 22px;
}

.media-view-card,
.image-stage {
  background: radial-gradient(circle at 50% 12%, rgba(233,75,135,.10), transparent 38%), #050406;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.media-watermark,
.lightbox-watermark {
  border-radius: 999px;
  background: rgba(6,4,7,.48);
  color: rgba(255,255,255,.54);
  backdrop-filter: blur(10px);
}

.stage-nav,
.lightbox-close,
.lightbox-nav,
.stage-open {
  border-radius: 999px;
  backdrop-filter: blur(14px);
}

.thumb-button {
  border-radius: 12px;
  overflow: hidden;
}

.thumb-button.active {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.admin-tabs a.active,
.admin-tabs a:hover {
  border-color: rgba(243,202,120,.34);
  background: linear-gradient(135deg, rgba(233,75,135,.20), rgba(243,202,120,.10));
}

.admin-table tr:hover td {
  background: rgba(255,255,255,.035);
}

@media (max-width: 760px) {
  .auth-card,
  .card,
  .library-hero,
  .library-card,
  .viewer-shell,
  .viewer-info,
  .image-viewer,
  .admin-hero,
  .admin-panel,
  .admin-edit-card {
    border-radius: 14px;
  }

  .side-nav a,
  .logout-link {
    border-radius: 14px;
  }
}

/* Mobile app shell: keep the sidebar as a collapsed left rail instead of a top bar. */
@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr) !important;
    align-items: stretch;
  }

  .sidebar {
    position: sticky !important;
    top: 0;
    display: flex !important;
    flex-direction: column;
    min-height: 100vh !important;
    height: 100vh;
    padding: 12px 10px !important;
    border-right: 1px solid var(--line) !important;
    border-bottom: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1200;
    transition: width .2s ease, box-shadow .2s ease;
  }

  .side-toggle {
    display: grid;
    place-items: center;
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
    color: var(--gold);
    cursor: pointer;
  }

  .side-brand {
    justify-content: center !important;
    gap: 0;
  }

  .side-brand span:not(.brand-orb),
  .side-nav span,
  .logout-link span {
    display: none !important;
  }

  .side-brand .brand-orb {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .side-nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
    width: 100%;
    margin-top: 22px !important;
  }

  .side-nav a,
  .logout-link {
    justify-content: center !important;
    width: 100%;
    min-height: 48px;
    padding: 0 !important;
    border-radius: 16px !important;
    font-size: 16px;
  }

  .side-nav a i,
  .logout-link i {
    font-size: 18px;
  }

  .logout-link {
    position: static !important;
    margin-top: auto !important;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .main-panel {
    min-width: 0;
    padding: 18px !important;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 1100;
    border: 0;
    background: rgba(6,4,7,.56);
    backdrop-filter: blur(3px);
  }

  .app-shell.sidebar-open {
    grid-template-columns: 260px minmax(0, 1fr) !important;
  }

  .app-shell.sidebar-open .sidebar {
    width: 260px;
    box-shadow: 24px 0 70px rgba(0,0,0,.42);
  }

  .app-shell.sidebar-open .side-toggle {
    justify-content: center;
  }

  .app-shell.sidebar-open .side-toggle i::before {
    content: "\f00d";
  }

  .app-shell.sidebar-open .side-brand {
    justify-content: flex-start !important;
    gap: 12px;
  }

  .app-shell.sidebar-open .side-brand span:not(.brand-orb),
  .app-shell.sidebar-open .side-nav span,
  .app-shell.sidebar-open .logout-link span {
    display: inline !important;
  }

  .app-shell.sidebar-open .side-nav a,
  .app-shell.sidebar-open .logout-link {
    justify-content: flex-start !important;
    gap: 12px;
    padding: 0 14px !important;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    display: block;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 68px minmax(0, 1fr) !important;
  }

  .sidebar {
    padding: 10px 8px !important;
  }

  .side-brand .brand-orb {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .side-nav {
    gap: 8px;
    margin-top: 18px !important;
  }

  .side-nav a,
  .logout-link {
    min-height: 44px;
    border-radius: 14px !important;
  }

  .main-panel,
  .main-panel-compact {
    padding: 12px !important;
  }

  .topbar h1,
  .auth-copy h1,
  .library-hero h2,
  .admin-hero h2 {
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.05;
  }

  .topbar,
  .library-hero,
  .admin-hero,
  .library-toolbar,
  .library-card-head,
  .viewer-titlebar,
  .image-viewer-footer {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .library-hero,
  .admin-hero,
  .library-card,
  .card.full,
  .viewer-shell,
  .viewer-info,
  .admin-panel,
  .admin-edit-card {
    padding: 14px !important;
  }

  .library-stats,
  .admin-stat-grid,
  .admin-tabs,
  .viewer-counts,
  .content-counts,
  .viewer-info-grid {
    grid-template-columns: 1fr !important;
  }

  .filter-tabs {
    grid-template-columns: 1fr 1fr !important;
  }

  .product-list,
  .library-card .product-list {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .product-card h3,
  .library-card .product-card h3 {
    font-size: 16px !important;
    line-height: 1.22;
  }

  .product-card img,
  .product-media {
    aspect-ratio: 4 / 3;
  }

  .viewer-layout,
  .admin-grid,
  .admin-form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .viewer-info {
    order: -1;
    position: static;
  }

  .viewer-layout .media-view-card video,
  .media-view-card video {
    height: min(44vh, 360px) !important;
  }

  .image-stage {
    min-height: min(46vh, 360px) !important;
    max-height: min(46vh, 360px) !important;
  }

  .image-stage img {
    max-height: min(46vh, 360px) !important;
  }

  .admin-table {
    min-width: 620px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    grid-template-columns: 60px minmax(0, 1fr) !important;
  }

  .sidebar {
    padding: 8px 6px !important;
  }

  .side-brand .brand-orb {
    width: 34px;
    height: 34px;
  }

  .side-nav a,
  .logout-link {
    min-height: 40px;
    border-radius: 12px !important;
  }

  .main-panel,
  .main-panel-compact {
    padding: 10px !important;
  }

  .filter-tabs {
    grid-template-columns: 1fr !important;
  }

  .clean-price {
    gap: 8px;
  }
}

/* Product library polish: search and count pills. */
.library-toolbar .library-search {
  width: min(380px, 100%);
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid rgba(255,218,233,.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025)),
    rgba(7,5,8,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.18);
}

.main-panel-compact {
  display: grid;
  align-content: start;
}

.main-panel-compact > .library-hero,
.main-panel-compact > .library-toolbar,
.main-panel-compact > .library-card {
  width: 100%;
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
}

.library-toolbar {
  align-items: center;
}

.library-toolbar .filter-tabs {
  align-items: center;
}

.library-toolbar .library-search i {
  color: rgba(243,202,120,.78);
  font-size: 17px;
}

.library-toolbar .library-search input {
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.library-toolbar .library-search input::placeholder {
  color: rgba(255,247,251,.55);
}

.library-hero .library-stats {
  grid-template-columns: repeat(3, minmax(88px, 112px));
  justify-content: end;
  align-self: center;
  gap: 12px;
  min-width: auto;
}

.library-hero .library-stats span {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 22px;
  border-color: rgba(255,218,233,.14);
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025)),
    rgba(7,5,8,.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.library-hero .library-stats strong {
  margin-bottom: 2px;
  font-size: 25px;
  line-height: 1;
}

@media (max-width: 760px) {
  .main-panel-compact > .library-hero,
  .main-panel-compact > .library-toolbar,
  .main-panel-compact > .library-card {
    max-width: none;
  }

  .library-toolbar {
    gap: 12px;
  }

  .library-toolbar .filter-tabs {
    width: 100%;
  }

  .library-toolbar .library-search {
    width: 100%;
  }

  .library-hero .library-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-content: stretch;
    width: 100%;
  }

  .library-hero .library-stats span {
    min-height: 64px;
    padding: 10px;
    border-radius: 18px;
  }

  .library-hero .library-stats strong {
    font-size: 22px;
  }
}

@media (max-width: 420px) {
  .library-hero .library-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Celestial sidebar split shell: fixed white app rail, PlugUpgrader-style structure. */
:root {
  --cs-sidebar-w: 280px;
  --cs-sidebar-primary: #e30b5c;
  --cs-sidebar-primary-rgb: 227, 11, 92;
  --cs-sidebar-bg: #ffffff;
  --cs-sidebar-ink: #21131a;
  --cs-sidebar-muted: #7b6570;
  --cs-sidebar-line: rgba(227, 11, 92, .14);
}

.app-shell {
  display: block !important;
  min-height: 100vh;
}

.sidebar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 1200;
  width: var(--cs-sidebar-w) !important;
  height: 100vh !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden !important;
  color: var(--cs-sidebar-ink) !important;
  background:
    radial-gradient(520px circle at 0% 0%, rgba(var(--cs-sidebar-primary-rgb), .105), transparent 58%),
    linear-gradient(180deg, #ffffff 0%, #fff7fa 100%) !important;
  border-right: 1px solid var(--cs-sidebar-line) !important;
  box-shadow: 18px 0 46px rgba(67, 19, 38, .08) !important;
  backdrop-filter: none !important;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(var(--cs-sidebar-primary-rgb), .62), transparent);
}

.side-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(227, 11, 92, .10);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(227, 11, 92, .16);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  color: var(--cs-sidebar-ink);
  box-shadow: 0 12px 28px rgba(227, 11, 92, .08);
}

.brand-orb {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #ff6fa4, var(--cs-sidebar-primary)) !important;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(var(--cs-sidebar-primary-rgb), .28) !important;
}

.brand-copy,
.side-user-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.side-brand strong {
  color: var(--cs-sidebar-ink);
  font-size: 15px;
  font-weight: 900;
}

.side-brand small,
.side-user-copy small {
  margin-top: 3px;
  color: var(--cs-sidebar-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(227, 11, 92, .10);
  border-radius: 16px;
  background: rgba(227, 11, 92, .045);
}

.side-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--cs-sidebar-primary);
  background: #fff;
  border: 1px solid rgba(227, 11, 92, .18);
  font-weight: 900;
}

.side-user-copy strong {
  color: var(--cs-sidebar-ink);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 11, 92, .25) transparent;
}

.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-track { background: transparent; }
.side-scroll::-webkit-scrollbar-thumb {
  background: rgba(227, 11, 92, .22);
  border-radius: 999px;
}

.side-section {
  display: block;
  padding: 8px 10px 7px;
  color: rgba(33, 19, 26, .48);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.side-nav {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  margin-top: 0 !important;
}

.side-nav a,
.logout-link {
  min-height: 46px !important;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px !important;
  border-radius: 14px !important;
  color: var(--cs-sidebar-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  font-size: 14px;
  font-weight: 800;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.side-nav a i,
.logout-link i {
  width: 20px;
  min-width: 20px;
  text-align: center;
  color: rgba(227, 11, 92, .68);
}

.side-nav a.active,
.side-nav a:hover,
.logout-link:hover {
  color: var(--cs-sidebar-primary) !important;
  background: linear-gradient(135deg, rgba(227, 11, 92, .12), rgba(227, 11, 92, .045)) !important;
  border-color: rgba(227, 11, 92, .18) !important;
  box-shadow: 0 10px 24px rgba(227, 11, 92, .09) !important;
  transform: translateX(2px);
}

.side-nav a.active::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 999px;
  background: var(--cs-sidebar-primary);
  box-shadow: 0 0 18px rgba(227, 11, 92, .38);
}

.side-footer {
  flex: 0 0 auto;
  padding: 12px 12px 18px;
  border-top: 1px solid rgba(227, 11, 92, .10);
  background: rgba(255,255,255,.78);
}

.logout-link {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
}

.main-panel {
  margin-left: var(--cs-sidebar-w) !important;
  min-height: 100vh;
  padding: 30px !important;
}

.side-toggle {
  display: none;
}

@media (max-width: 1040px) {
  :root { --cs-sidebar-w: 76px; }

  .app-shell { display: block !important; }

  .sidebar {
    width: var(--cs-sidebar-w) !important;
    transition: width .22s ease, box-shadow .22s ease;
  }

  .main-panel {
    margin-left: var(--cs-sidebar-w) !important;
    padding: 18px !important;
  }

  .side-toggle {
    display: grid !important;
    place-items: center;
    width: calc(100% - 20px);
    height: 42px;
    margin: 12px 10px 0;
    border: 1px solid rgba(227, 11, 92, .20);
    border-radius: 14px;
    color: var(--cs-sidebar-primary);
    background: #fff;
    cursor: pointer;
  }

  .side-header { padding: 12px 10px; }

  .side-brand {
    justify-content: center;
    padding: 8px;
  }

  .brand-copy,
  .side-user,
  .side-section,
  .side-nav span,
  .logout-link span {
    display: none !important;
  }

  .side-nav a,
  .logout-link {
    justify-content: center !important;
    padding: 0 !important;
  }

  .side-nav a.active::before { display: none; }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    border: 0;
    background: rgba(33, 19, 26, .24);
    backdrop-filter: blur(4px);
  }

  .app-shell.sidebar-open .sidebar {
    width: 280px !important;
    box-shadow: 24px 0 70px rgba(67, 19, 38, .20) !important;
  }

  .app-shell.sidebar-open .side-toggle i::before { content: "\f00d"; }

  .app-shell.sidebar-open .side-brand {
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .app-shell.sidebar-open .brand-copy,
  .app-shell.sidebar-open .side-user,
  .app-shell.sidebar-open .side-nav span,
  .app-shell.sidebar-open .logout-link span {
    display: flex !important;
  }

  .app-shell.sidebar-open .side-section {
    display: block !important;
  }

  .app-shell.sidebar-open .side-nav a,
  .app-shell.sidebar-open .logout-link {
    justify-content: flex-start !important;
    padding: 0 13px !important;
  }

  .app-shell.sidebar-open .side-nav a.active::before {
    display: block;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    display: block;
  }
}

@media (max-width: 560px) {
  :root { --cs-sidebar-w: 66px; }
  .main-panel { padding: 14px !important; }
}


/* Single content viewer: no summary card, media takes the full workspace. */
.viewer-layout.viewer-layout-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.viewer-layout.viewer-layout-single .viewer-media {
  width: 100%;
}


/* Vis indhold page: cleaner white/pink viewer surface. */
.content-view-page {
  max-width: 1500px;
  margin: 0 auto;
  border-color: rgba(227, 11, 92, .14) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(760px circle at 92% -18%, rgba(227, 11, 92, .12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(255, 247, 251, .94)) !important;
  color: #25131b !important;
  box-shadow: 0 22px 58px rgba(107, 24, 56, .10) !important;
}

.content-view-head {
  align-items: stretch !important;
  margin-bottom: 18px !important;
  border: 1px solid rgba(227, 11, 92, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
  padding: 18px;
}

.content-view-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.content-view-copy .back-link {
  width: max-content;
  color: #806774;
  font-weight: 900;
  text-decoration: none;
}

.content-view-copy .back-link:hover {
  color: #e30b5c;
}

.content-view-eyebrow {
  color: #e30b5c;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.content-view-copy h1 {
  max-width: 980px;
  margin: 0;
  color: #25131b;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.content-view-counts {
  align-self: end;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 10px;
}

.content-view-counts span {
  display: grid;
  min-height: 68px;
  align-content: center;
  border: 1px solid rgba(227, 11, 92, .12) !important;
  border-radius: 16px;
  background: #fff7fb !important;
  color: #806774 !important;
  padding: 10px 14px !important;
}

.content-view-counts strong {
  display: block;
  color: #e30b5c;
  font-size: 25px;
  line-height: 1;
}

.content-view-page .viewer-section-label {
  color: #e30b5c !important;
  letter-spacing: .12em;
}

.content-view-page .media-view-card,
.content-view-page .image-viewer,
.content-view-page .image-stage {
  border: 1px solid rgba(227, 11, 92, .12);
  border-radius: 18px;
  background: #120912 !important;
  box-shadow: 0 18px 46px rgba(37, 19, 27, .12) !important;
}

.security-blur-overlay {
  background:
    radial-gradient(640px circle at 50% 36%, rgba(227, 11, 92, .18), transparent 56%),
    rgba(255, 247, 251, .78) !important;
  color: #25131b !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

.security-blur-card {
  width: min(420px, 100%) !important;
  border: 1px solid rgba(227, 11, 92, .16) !important;
  border-radius: 26px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 247, 251, .94)) !important;
  box-shadow: 0 30px 90px rgba(107, 24, 56, .20) !important;
}

.security-blur-icon {
  border-radius: 22px !important;
  background: linear-gradient(135deg, rgba(227, 11, 92, .14), rgba(255, 255, 255, .96)) !important;
  color: #e30b5c !important;
  box-shadow: 0 16px 36px rgba(227, 11, 92, .14) !important;
}

.security-blur-card strong {
  color: #25131b !important;
}

.security-blur-card small {
  color: #806774 !important;
}

@media (max-width: 760px) {
  .content-view-page {
    padding: 14px !important;
  }

  .content-view-head {
    padding: 14px;
  }

  .content-view-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}


/* Vis indhold media fill: remove the old video width cap and use the full page width. */
.content-view-page {
  width: 100% !important;
  max-width: none !important;
}

.content-view-page .viewer-media,
.content-view-page .media-view-grid,
.content-view-page .media-view-grid.videos,
.content-view-page .image-viewer {
  width: 100% !important;
  max-width: none !important;
}

.content-view-page .media-view-card {
  width: 100% !important;
}

.content-view-page .media-view-card video {
  width: 100% !important;
  height: clamp(520px, calc(100vh - 300px), 760px) !important;
  max-height: none !important;
}

.content-view-page .image-stage {
  min-height: clamp(520px, calc(100vh - 330px), 760px) !important;
  max-height: none !important;
}

@media (max-width: 760px) {
  .content-view-page .media-view-card video,
  .content-view-page .image-stage {
    height: min(62vh, 520px) !important;
    min-height: min(62vh, 520px) !important;
  }
}


/* Mobile viewer safety: fixed sidebar must not cover content or fullscreen media. */
@media (max-width: 1040px) {
  .main-panel,
  .main-panel-compact {
    width: calc(100vw - var(--cs-sidebar-w)) !important;
    max-width: calc(100vw - var(--cs-sidebar-w)) !important;
    margin-left: var(--cs-sidebar-w) !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
}

.image-lightbox {
  z-index: 6000 !important;
}

body.lightbox-open .sidebar,
body.security-blurred .sidebar {
  pointer-events: none !important;
}


/* Admin upgrades: Shopify revenue, user management, manual access grants. */
.admin-stat-grid-wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-grid-wide {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
}

.admin-scroll-panel {
  max-height: 520px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) rgba(255,255,255,.08);
}

.admin-scroll-panel.small {
  max-height: 420px;
}

.admin-scroll-panel::-webkit-scrollbar,
.admin-pending-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.admin-scroll-panel::-webkit-scrollbar-track,
.admin-pending-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.admin-scroll-panel::-webkit-scrollbar-thumb,
.admin-pending-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--rose), var(--gold));
  border-radius: 999px;
}

.admin-mini-list {
  display: grid;
  gap: 10px;
}

.admin-mini-row.stacked {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.admin-pending-list {
  display: grid;
  gap: 12px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.admin-pending-card,
.admin-grant-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}

.admin-pending-card strong,
.admin-grant-row strong {
  display: block;
  color: var(--text);
}

.admin-pending-card small,
.admin-grant-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-inline-form.compact {
  display: flex;
  justify-content: flex-end;
}

.admin-inline-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7,6,10,.66);
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
}

.admin-user-card .admin-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.admin-grant-list {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.admin-grant-list h4 {
  margin: 6px 0 0;
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-grant-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

html[data-cs-theme="dark"] .main-panel :is(.admin-pending-card, .admin-grant-row, .admin-mini-row.stacked) {
  background: #1c1c1c !important;
  border-color: rgba(var(--cs-primary-rgb), .24) !important;
  color: var(--cs-dark-text) !important;
}

html[data-cs-theme="dark"] .admin-inline-form input {
  background: #171717 !important;
  color: var(--cs-dark-text) !important;
  border-color: rgba(var(--cs-primary-rgb), .28) !important;
}

@media (max-width: 1180px) {
  .admin-stat-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .admin-stat-grid-wide {
    grid-template-columns: 1fr;
  }

  .admin-inline-form,
  .admin-grant-row {
    grid-template-columns: 1fr;
  }
}


/* Dark mode hard-edge cleanup: keep one flat dark surface behind content. */
html[data-cs-theme="dark"] body,
html[data-cs-theme="dark"] .main-panel,
html[data-cs-theme="dark"] .main-panel-compact,
html[data-cs-theme="dark"] .page-shell,
html[data-cs-theme="dark"] .content-page,
html[data-cs-theme="dark"] .content-view-page,
html[data-cs-theme="dark"] .shop-page,
html[data-cs-theme="dark"] .support-shell,
html[data-cs-theme="dark"] .settings-page {
  background: #1c1c1c !important;
  background-image: none !important;
}

html[data-cs-theme="dark"] .main-panel :is(
  .panel-card,
  .content-card,
  .library-card,
  .shop-card,
  .support-card,
  .support-hero,
  .support-chat-card,
  .support-chat-head,
  .support-chat-log,
  .support-compose,
  .settings-card,
  .settings-hero,
  .admin-card,
  .product-card,
  .order-card,
  .media-card,
  .glass-card,
  .stat-card,
  .catalog-shell,
  .content-grid-shell,
  .filters-shell,
  .viewer-shell,
  .content-view-head,
  .media-view-card,
  .image-viewer,
  .image-stage
) {
  background: #1c1c1c !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-cs-theme="dark"] .main-panel :is(
  .support-message,
  .support-message-meta,
  .chat-message,
  .chat-message-meta,
  .message-row,
  .message-meta,
  .activity-row,
  .activity-meta
) {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-cs-theme="dark"] .main-panel :is(
  .support-bubble,
  .support-empty,
  .content-tile,
  .library-tile,
  .shop-product,
  .product-card-inner
) {
  background: #1c1c1c !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-cs-theme="dark"] .support-message.is-user .support-bubble,
html[data-cs-theme="dark"] .main-panel :is(.primary-button, .settings-submit, .policy-button, .support-send, .buy-button, .shopify-buy-button, .open-content-btn, .content-open-button) {
  background: linear-gradient(135deg, #ff8bb8, #e30b5c) !important;
  color: #fff !important;
}


/* Admin customer/access polish */
.admin-meta-dot {
  display: inline-block;
  margin: 0 6px;
  color: var(--rose, #e30b5c);
  font-weight: 950;
}

.admin-panel .admin-form-grid label,
.admin-panel .admin-form-label {
  min-width: 0;
}

.admin-panel .admin-form-grid :is(input, select, textarea),
.admin-inline-form input {
  min-height: 44px;
}

.admin-pending-card {
  gap: 14px;
}

.admin-pending-card > div:first-child,
.admin-grant-row > div:first-child,
.admin-user-card summary > span:first-child {
  min-width: 0;
}

.admin-pending-card small,
.admin-grant-row small,
.admin-user-card summary small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  line-height: 1.45;
}

.admin-pending-card .admin-inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-pending-card .admin-inline-form.compact {
  justify-content: flex-end;
}

.admin-pending-card .btn,
.admin-grant-row .btn {
  min-height: 44px;
  white-space: nowrap;
}

.admin-user-card summary {
  gap: 18px;
}

.admin-user-card summary .admin-badge {
  flex: 0 0 auto;
}

html[data-cs-theme="dark"] .admin-panel .admin-form-grid :is(input, select, textarea),
html[data-cs-theme="dark"] .admin-inline-form input {
  background: #1c1c1c !important;
  background-image: none !important;
  border-color: rgba(var(--cs-primary-rgb), .32) !important;
  color: var(--cs-dark-text) !important;
}

html[data-cs-theme="dark"] .admin-pending-card,
html[data-cs-theme="dark"] .admin-grant-row,
html[data-cs-theme="dark"] .admin-user-card {
  background: #1c1c1c !important;
  background-image: none !important;
  box-shadow: none !important;
}

@media (max-width: 720px) {
  .admin-pending-card .admin-inline-form {
    grid-template-columns: 1fr;
  }

  .admin-pending-card .admin-inline-form.compact,
  .admin-pending-card .btn,
  .admin-grant-row .btn {
    width: 100%;
    justify-content: center;
  }
}


/* Admin UI v2: cleaner operational dashboard */


.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-live-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(227, 11, 92, .24);
  border-radius: 999px;
  background: rgba(227, 11, 92, .12);
  color: #ffd7e7;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.admin-stat-grid article > i {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff8bb8, #e30b5c);
  color: #fff;
  box-shadow: 0 14px 34px rgba(227, 11, 92, .20);
}

@media (max-width: 760px) {
  .admin-hero-actions {
    justify-content: stretch;
  }

  .admin-hero-actions > * {
    width: 100%;
  }
}

.admin-shell {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  gap: 22px !important;
}

.admin-hero {
  position: relative;
  overflow: hidden;
  align-items: center !important;
  min-height: 168px;
  padding: clamp(22px, 3vw, 34px) !important;
  border-radius: 30px !important;
  border: 1px solid rgba(227, 11, 92, .22) !important;
  background:
    radial-gradient(860px circle at 92% -22%, rgba(227, 11, 92, .25), transparent 45%),
    linear-gradient(135deg, rgba(28, 28, 28, .98), rgba(28, 28, 28, .92)) !important;
  box-shadow: none !important;
}

.admin-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #ff8bb8, #e30b5c);
}

.admin-hero > * {
  position: relative;
  z-index: 1;
}

.admin-hero h2 {
  max-width: 820px;
  font-size: clamp(36px, 5vw, 64px) !important;
  font-weight: 950;
  letter-spacing: 0 !important;
}

.admin-hero p {
  max-width: 760px;
  color: #d7c5cf !important;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.6;
}

.admin-tabs {
  position: sticky;
  top: 14px;
  z-index: 40;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px !important;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding: 10px !important;
  border: 1px solid rgba(227, 11, 92, .18);
  border-radius: 26px;
  background: rgba(28, 28, 28, .92);
  backdrop-filter: blur(14px);
}

.admin-tabs a {
  min-width: 0;
  min-height: 48px !important;
  border-radius: 18px !important;
  border-color: rgba(227, 11, 92, .18) !important;
  background: #1c1c1c !important;
  color: #d7c5cf !important;
  font-weight: 900 !important;
  box-shadow: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}

.admin-tabs a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-tabs a i { color: #e30b5c; }

.admin-tabs a.active,
.admin-tabs a:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 11, 92, .46) !important;
  background: linear-gradient(135deg, rgba(227, 11, 92, .22), rgba(227, 11, 92, .08)) !important;
  color: #fff7fb !important;
}

.admin-stat-grid {
  gap: 14px !important;
}

.admin-stat-grid article {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 20px !important;
  border-radius: 24px !important;
  border: 1px solid rgba(227, 11, 92, .22) !important;
  background: #1c1c1c !important;
  box-shadow: none !important;
}

.admin-stat-grid article::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(227, 11, 92, .22), transparent 68%);
}

.admin-stat-grid span {
  position: relative;
  z-index: 1;
  color: #d7c5cf !important;
  font-size: 11px !important;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.admin-stat-grid strong {
  position: relative;
  z-index: 1;
  color: #fff7fb !important;
  font-size: clamp(26px, 2.6vw, 38px) !important;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.admin-grid,
.admin-grid-wide {
  gap: 18px !important;
}

.admin-panel,
.admin-edit-card {
  border-radius: 26px !important;
  border: 1px solid rgba(227, 11, 92, .22) !important;
  background: #1c1c1c !important;
  background-image: none !important;
  box-shadow: none !important;
}

.admin-panel {
  padding: clamp(18px, 2vw, 24px) !important;
}

.admin-section-head {
  align-items: center !important;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(227, 11, 92, .16);
}

.admin-section-head h3,
.admin-panel h3 {
  margin-bottom: 6px !important;
  color: #fff7fb !important;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: 0;
}

.admin-section-head .muted,
.admin-panel .muted {
  color: #c9b4bf !important;
  font-weight: 700;
  line-height: 1.55;
}

.admin-table-wrap {
  border: 1px solid rgba(227, 11, 92, .18);
  border-radius: 20px;
  background: #1c1c1c;
  scrollbar-width: thin;
  scrollbar-color: #e30b5c #1c1c1c;
}

.admin-table {
  border-collapse: separate !important;
  border-spacing: 0;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1c1c1c;
  color: #e30b5c !important;
  font-size: 11px !important;
  letter-spacing: .11em !important;
}

.admin-table td {
  color: #fff7fb;
  font-weight: 750;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px !important;
  border-bottom-color: rgba(227, 11, 92, .14) !important;
}

.admin-table tbody tr:hover td {
  background: rgba(227, 11, 92, .055);
}

.admin-badge {
  min-height: 30px !important;
  border-radius: 999px !important;
  border-color: rgba(227, 11, 92, .24) !important;
  background: rgba(227, 11, 92, .12) !important;
  color: #ffd7e7 !important;
  padding: 5px 12px !important;
  font-weight: 950 !important;
}

.admin-edit-card summary {
  min-height: 78px;
  padding: 18px 20px !important;
  transition: background .18s ease;
}

.admin-edit-card summary:hover,
.admin-edit-card[open] summary {
  background: rgba(227, 11, 92, .065);
}

.admin-edit-card summary strong {
  color: #fff7fb !important;
  font-size: 17px;
  line-height: 1.25;
}

.admin-edit-card summary small {
  margin-top: 5px;
  color: #c9b4bf !important;
  font-weight: 750 !important;
}

.admin-form,
.admin-grant-list {
  padding: 18px 20px 20px !important;
}

.admin-form label,
.admin-form-label {
  color: #e30b5c !important;
  letter-spacing: .08em;
  font-weight: 950 !important;
}

.admin-form :is(input, select, textarea),
.admin-form-label :is(input, select, textarea),
.admin-inline-form input,
.shopify-map-textarea {
  min-height: 48px;
  border-radius: 16px !important;
  border: 1px solid rgba(227, 11, 92, .28) !important;
  background: #151515 !important;
  color: #fff7fb !important;
  box-shadow: none !important;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.admin-form :is(input, select, textarea):focus,
.admin-form-label :is(input, select, textarea):focus,
.admin-inline-form input:focus {
  border-color: rgba(227, 11, 92, .72) !important;
  box-shadow: 0 0 0 4px rgba(227, 11, 92, .14) !important;
}

.admin-actions {
  align-items: center;
  margin-top: 2px;
}

.admin-actions .btn,
.admin-inline-form .btn,
.admin-grant-row .btn,
.admin-section-head .btn,
.admin-hero .btn {
  min-height: 44px;
  border-radius: 999px !important;
  font-weight: 950 !important;
}

.admin-actions .btn.secondary,
.admin-inline-form .btn.secondary,
.admin-grant-row .btn.secondary,
.admin-section-head .btn.secondary,
.admin-hero .btn.secondary {
  border: 1px solid rgba(227, 11, 92, .22) !important;
  background: #1c1c1c !important;
  color: #fff7fb !important;
}

.admin-pending-list,
.admin-list,
.admin-mini-list {
  gap: 14px !important;
}

.admin-pending-card,
.admin-mini-row.stacked,
.admin-grant-row {
  border-radius: 20px !important;
  border-color: rgba(227, 11, 92, .22) !important;
  background: #1c1c1c !important;
  box-shadow: none !important;
}

.admin-pending-card strong,
.admin-mini-row.stacked strong,
.admin-grant-row strong {
  color: #fff7fb !important;
}

.admin-pending-card small,
.admin-mini-row.stacked span,
.admin-grant-row small {
  color: #c9b4bf !important;
  font-weight: 750;
}

.discord-channel-card,
.shopify-toggle-card {
  border-radius: 20px !important;
  border-color: rgba(227, 11, 92, .22) !important;
  background: #1c1c1c !important;
  box-shadow: none !important;
}

.discord-channel-icon {
  background: linear-gradient(135deg, #ff8bb8, #e30b5c) !important;
  box-shadow: 0 14px 34px rgba(227, 11, 92, .20);
}

.shopify-example code {
  border-color: rgba(227, 11, 92, .20) !important;
  background: #151515 !important;
  color: #fff7fb !important;
}

.admin-scroll-panel::-webkit-scrollbar,
.admin-table-wrap::-webkit-scrollbar,
.shopify-map-textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.admin-scroll-panel::-webkit-scrollbar-track,
.admin-table-wrap::-webkit-scrollbar-track,
.shopify-map-textarea::-webkit-scrollbar-track {
  background: #1c1c1c;
}

.admin-scroll-panel::-webkit-scrollbar-thumb,
.admin-table-wrap::-webkit-scrollbar-thumb,
.shopify-map-textarea::-webkit-scrollbar-thumb {
  border: 2px solid #1c1c1c;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8bb8, #e30b5c);
}

@media (max-width: 1040px) {
  .admin-tabs {
    position: relative;
    top: 0;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    gap: 16px !important;
  }

  .admin-hero,
  .admin-panel {
    border-radius: 22px !important;
  }

  .admin-tabs {
    padding: 8px !important;
    border-radius: 22px;
  }

  .admin-tabs {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .admin-section-head {
    align-items: stretch !important;
    flex-direction: column;
  }

  .admin-table th,
  .admin-table td {
    padding: 12px !important;
  }
}

/* Admin tab overflow fix */

@media (max-width: 1280px) {
  .admin-tabs {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-tabs {
    position: relative;
    top: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 22px;
    padding: 8px !important;
  }

  .admin-tabs a {
    min-height: 46px !important;
    padding-inline: 10px !important;
    font-size: 13px !important;
  }
}
