body.portal-page {
  --accent: #8b5cf6;
  display: block;
  min-height: 100vh;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: radial-gradient(circle at 18% 0%, rgb(124 92 255 / 22%), transparent 34rem), #090b13;
}

.portal-page .account-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.portal-page .product-brand {
  justify-content: flex-start;
}

.portal-page main {
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.portal-header,
.portal-section-heading,
.portal-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.portal-header h1,
.portal-section h2,
.portal-empty h2 {
  margin: 0;
}

.portal-subtitle {
  margin: .35rem 0 0;
}

.portal-logout {
  margin: 0;
}

.portal-action {
  width: auto;
  min-width: 128px;
  margin-top: 0;
  white-space: nowrap;
}

.portal-stats,
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

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

.portal-stat,
.product-card,
.portal-empty,
.gallery-table-wrap,
.portal-tools {
  border: 1px solid #343750;
  border-radius: 16px;
  background: rgb(12 15 28 / 76%);
}

.portal-stat,
.product-card,
.portal-empty,
.portal-tools {
  padding: 1.2rem;
}

.portal-stat {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  gap: .35rem;
}

.portal-stat > span,
.gallery-table th {
  color: #9da2bd;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.portal-stat > strong {
  font-size: 2rem;
}

.portal-stat small {
  margin-top: auto;
}

.portal-text-link {
  margin-top: .3rem;
  font-weight: 700;
}

.portal-section {
  margin-top: 1.75rem;
}

.portal-credit-list {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .85rem;
}

.portal-credit-list span,
.membership-pill {
  border: 1px solid #454967;
  border-radius: 999px;
  background: #171a2d;
}

.portal-credit-list span {
  padding: .55rem .8rem;
}

.product-card {
  --product-rgb: 124 92 255;
  position: relative;
  display: flex;
  min-height: 292px;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgb(var(--product-rgb) / 18%), transparent 46%),
    rgb(12 15 28 / 88%);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.product-card::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
  content: "";
  pointer-events: none;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  border-color: rgb(var(--product-rgb) / 78%);
  box-shadow: 0 20px 46px rgb(0 0 0 / 30%), 0 0 32px rgb(var(--product-rgb) / 14%);
}

.product-card-logo {
  display: flex;
  min-height: 136px;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: -.25rem -.25rem 1rem;
  padding: 1rem;
  border: 1px solid rgb(var(--product-rgb) / 20%);
  border-radius: 14px;
  background: linear-gradient(145deg, rgb(var(--product-rgb) / 15%), rgb(7 9 18 / 70%));
}

.product-logo-image {
  display: block;
  max-width: 100%;
  height: auto;
}

.product-logo-fuxionmix {
  width: 184px;
  filter: drop-shadow(0 0 18px rgb(229 9 20 / 28%));
}

.product-logo-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 18px rgb(var(--product-rgb) / 26%));
}

.product-wordmark {
  color: #f7f8ff;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 850;
  letter-spacing: -.04em;
}

.product-wordmark-video span { color: #a78bfa; }
.product-wordmark-radio span { color: #38bdf8; }
.product-wordmark-tv span { color: #67e8f9; }

.product-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.product-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.product-card p {
  margin-bottom: 1.25rem;
}

.product-card .portal-action {
  width: 100%;
  margin-top: auto;
}

.membership-pill {
  padding: .3rem .55rem;
  color: #b9fbc0;
  font-size: .7rem;
  font-weight: 800;
}

.product-card-fuxionmix { --product-rgb: 229 9 20; border-color: rgb(229 9 20 / 42%); }
.product-card-fuxionvideo { --product-rgb: 124 92 255; border-color: rgb(124 92 255 / 52%); }
.product-card-fuxionradio { --product-rgb: 56 189 248; border-color: rgb(56 189 248 / 48%); }
.product-card-fuxiontv { --product-rgb: 34 211 238; border-color: rgb(34 211 238 / 48%); }

.portal-tools {
  align-items: center;
}

.portal-tools p {
  max-width: 620px;
  margin-bottom: 0;
}

.portal-tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.portal-notice {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border: 1px solid #3c4d44;
  border-radius: 10px;
  background: #14261e;
  color: #c8f7d5;
}

.portal-notice.error {
  border-color: #633a45;
  background: #301820;
  color: #ffc7cf;
}

.gallery-table-wrap {
  margin-top: 1.25rem;
  overflow-x: auto;
}

.gallery-table {
  width: 100%;
  border-collapse: collapse;
}

.gallery-table th,
.gallery-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid #2c3047;
  text-align: left;
  vertical-align: middle;
}

.gallery-table tbody tr:last-child td {
  border-bottom: 0;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.gallery-actions form {
  margin: 0;
}

.gallery-actions .portal-action {
  min-width: 0;
  padding: .55rem .7rem;
  font-size: .8rem;
}

.gallery-actions .danger {
  border-color: #7b3545;
  color: #ffbec9;
}

.gallery-protected {
  color: #9da2bd;
  font-size: .8rem;
  font-weight: 700;
}

.portal-empty {
  margin-top: 1.25rem;
  text-align: center;
}

.auth-progress-card {
  text-align: center;
}

.auth-spinner {
  width: 48px;
  height: 48px;
  margin: 1.25rem auto;
  border: 4px solid #343750;
  border-top-color: var(--accent, #7c5cff);
  border-radius: 50%;
  animation: aliencat-spin .8s linear infinite;
}

.auth-progress-card .secondary {
  margin-top: 1.25rem;
}

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

@media (max-width: 820px) {
  .portal-stats,
  .product-grid {
    grid-template-columns: 1fr;
  }
  .portal-header,
  .portal-tools {
    flex-direction: column;
  }
  .portal-tool-actions {
    justify-content: flex-start;
  }
}
