@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --ink-terminal: #0a0e17;
  --ink-terminal-card: #141c2b;
  --border-terminal: #1e293b;
  --border-terminal-strong: #334155;
  --text-primary-dark: #f1f5f9;
  --text-secondary-dark: #94a3b8;
  --text-muted-dark: #64748b;
  --electric-cyan: #00ffd5;
  --risk-red: #ff3366;
  --profit-green: #00ff88;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --accent: var(--electric-cyan);
  --bg-grid:
    linear-gradient(rgba(30, 41, 59, 0.35) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(90deg, rgba(30, 41, 59, 0.35) 1px, transparent 1px) 0 0 / 50px 50px,
    radial-gradient(1200px 600px at 80% -10%, rgba(0, 180, 216, 0.08), transparent 60%),
    var(--ink-terminal);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary-dark);
  background: var(--bg-grid);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.legacy-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(10, 14, 23, 0.78);
  border-bottom: 1px solid var(--border-terminal);
}

.legacy-header__inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding:
    18px
    max(24px, env(safe-area-inset-right))
    18px
    max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
}

.legacy-header--status .legacy-header__inner {
  max-width: 1280px;
  display: grid;
  grid-template-columns: minmax(0, 75%) minmax(0, 25%);
  gap: 20px;
  align-items: center;
}

.legacy-header__logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.legacy-header--status .legacy-header__logo-link {
  grid-column: 1;
  justify-self: start;
}

.legacy-header__logo {
  width: 220px;
  height: auto;
}

.legacy-header__logout {
  position: absolute;
  top: 50%;
  right: max(24px, env(safe-area-inset-right));
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 8px;
  background: rgba(10, 14, 23, 0.72);
  color: var(--text-secondary-dark);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.legacy-header__logout svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.legacy-header__logout:not(:disabled):hover {
  color: var(--risk-red);
  border-color: rgba(255, 51, 102, 0.45);
  background: rgba(255, 51, 102, 0.08);
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.12);
}

.legacy-header__logout:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 213, 0.12);
}

.legacy-header__logout[hidden] {
  display: none !important;
}

.legacy-header--status .legacy-header__logout {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  grid-column: 2;
  justify-self: end;
}

.legacy-main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding:
    48px
    max(24px, env(safe-area-inset-right))
    72px
    max(24px, env(safe-area-inset-left));
}

.legacy-main--status {
  max-width: 1280px;
}

.legacy-card--content {
  min-height: 320px;
}

.legacy-card--status {
  margin-bottom: 28px;
}

.legacy-content-panel__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.legacy-content-panel__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}

.legacy-content-panel__lead {
  max-width: 56ch;
  color: var(--text-secondary-dark);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.legacy-content-panel__body {
  min-height: 180px;
}

.legacy-portal-intro {
  padding: 14px 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(0, 255, 213, 0.22);
  border-radius: 12px;
  background: rgba(0, 255, 213, 0.05);
  color: var(--text-secondary-dark);
  font-size: 15px;
  line-height: 1.65;
}

.legacy-portal-intro strong {
  color: var(--text-primary-dark);
}

.legacy-portal-intro--warn {
  border-color: rgba(255, 51, 102, 0.28);
  background: rgba(255, 51, 102, 0.05);
}

.legacy-portal-bucket {
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 14px;
  background: rgba(10, 14, 23, 0.55);
}

.legacy-portal-bucket:last-child {
  margin-bottom: 0;
}

.legacy-portal-bucket__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.legacy-portal-bucket__meta {
  min-width: 0;
}

.legacy-portal-bucket__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.legacy-portal-bucket__title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary-dark);
}

.legacy-portal-bucket__status {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.legacy-portal-bucket__status.is-active {
  color: var(--profit-green);
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.08);
}

.legacy-portal-bucket__status.is-inactive {
  color: var(--risk-red);
  border-color: rgba(255, 51, 102, 0.35);
  background: rgba(255, 51, 102, 0.08);
}

.legacy-portal-bucket__summary {
  max-width: 72ch;
  margin-bottom: 18px;
  color: var(--text-secondary-dark);
  font-size: 15px;
  line-height: 1.65;
}

.legacy-portal-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.legacy-portal-split__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.legacy-portal-split__label--have {
  color: var(--profit-green);
}

.legacy-portal-split__label--missing {
  color: var(--risk-red);
}

.legacy-portal-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.legacy-portal-list__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary-dark);
}

.legacy-portal-list__marker {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legacy-portal-list--have .legacy-portal-list__marker {
  background: var(--profit-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.45);
}

.legacy-portal-list--missing .legacy-portal-list__marker {
  background: var(--risk-red);
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.35);
}

.legacy-portal-list__empty {
  font-size: 14px;
  color: var(--text-muted-dark);
  font-style: italic;
}

.legacy-card {
  width: 100%;
  min-width: 0;
  padding: 32px 28px;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 43, 0.98), rgba(10, 14, 23, 0.92));
  box-shadow: var(--shadow-panel);
}

.legacy-card--status {
  overflow-wrap: anywhere;
}

.legacy-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  min-width: 0;
}

.legacy-card__header .legacy-status {
  margin-bottom: 0;
}

.legacy-membership-status,
.legacy-certified {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
}

.legacy-membership-status__label,
.legacy-certified__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted-dark);
}

.legacy-membership-status__value,
.legacy-certified__value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary-dark);
}

.legacy-membership-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}

.legacy-membership-status__value.is-active {
  color: var(--profit-green);
}

.legacy-membership-status__value.is-inactive {
  color: var(--text-muted-dark);
}

.legacy-membership-status__value.is-inactive .legacy-membership-status__dot {
  display: none;
}

.legacy-card__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0;
}

.legacy-card__title {
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.legacy-profile {
  text-align: center;
  margin-bottom: 20px;
  min-width: 0;
}

.legacy-profile__name {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.legacy-profile__handle {
  font-size: clamp(14px, 3.8vw, 15px);
  font-weight: 500;
  color: var(--text-secondary-dark);
  overflow-wrap: anywhere;
}

.legacy-card__lead {
  text-align: center;
  color: var(--text-secondary-dark);
  margin-bottom: 28px;
  font-size: 15px;
}

.legacy-field {
  margin-bottom: 18px;
}

.legacy-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary-dark);
  margin-bottom: 8px;
}

.legacy-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 10px;
  background: rgba(10, 14, 23, 0.85);
  color: var(--text-primary-dark);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.legacy-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 213, 0.12);
}

.legacy-field input::placeholder {
  color: var(--text-muted-dark);
}

.legacy-error {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 51, 102, 0.45);
  border-radius: 10px;
  background: rgba(255, 51, 102, 0.1);
  color: #ffb8c9;
  font-size: 14px;
}

.legacy-error.is-visible {
  display: block;
}

.legacy-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.legacy-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.legacy-btn--primary {
  color: var(--ink-terminal);
  background: linear-gradient(135deg, var(--electric-cyan) 0%, #00b4d8 100%);
  box-shadow: 0 0 24px rgba(0, 255, 213, 0.18);
}

.legacy-btn--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 0 32px rgba(0, 255, 213, 0.28);
}

.legacy-btn--ghost {
  margin-top: 12px;
  color: var(--text-secondary-dark);
  background: transparent;
  border: 1px solid var(--border-terminal-strong);
}

.legacy-btn--ghost:not(:disabled):hover {
  color: var(--text-primary-dark);
  border-color: var(--accent);
}

.legacy-panel[hidden] {
  display: none !important;
}

.legacy-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: var(--profit-green);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legacy-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--profit-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

.legacy-user {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--border-terminal);
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.55);
  min-width: 0;
}

.legacy-user__field {
  min-width: 0;
}

.legacy-user__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted-dark);
  margin-bottom: 6px;
}

.legacy-user__value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary-dark);
  word-break: break-word;
}

.legacy-user__field--wide {
  grid-column: 1 / -1;
}

.legacy-user__tenure {
  padding-top: 4px;
}

.legacy-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.legacy-stat {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 10px;
  background: rgba(10, 14, 23, 0.72);
  text-align: center;
}

.legacy-stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted-dark);
  margin-bottom: 8px;
}

.legacy-stat__value {
  font-family: var(--font-mono);
  font-size: clamp(18px, 4.5vw, 28px);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary-dark);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.legacy-stat__value.is-live {
  color: var(--electric-cyan);
}

#user-ttg-certified.is-yes,
.legacy-certified__value.is-yes {
  color: var(--profit-green);
}

#user-ttg-certified.is-yes::before,
.legacy-certified__value.is-yes::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}

#user-ttg-certified.is-no,
.legacy-certified__value.is-no {
  color: var(--risk-red);
}

#user-ttg-certified.is-no::before,
.legacy-certified__value.is-no::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}

.legacy-status-row__detail:empty {
  display: none;
}

.legacy-user__name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.legacy-user__meta {
  color: var(--text-secondary-dark);
  font-size: 14px;
}

.legacy-tier {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(0, 255, 213, 0.28);
  border-radius: 12px;
  background: rgba(0, 255, 213, 0.06);
}

.legacy-tier__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.legacy-tier__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary-dark);
  margin-bottom: 6px;
}

.legacy-tier__detail {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary-dark);
}

.legacy-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.legacy-status-board {
  position: relative;
  margin-bottom: 20px;
}

.legacy-status-board.is-loading .legacy-status-rows {
  visibility: hidden;
}

.legacy-status-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legacy-status-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 320px;
  padding: 32px 20px;
}

.legacy-status-board.is-loading .legacy-status-loading {
  display: flex;
  position: absolute;
  inset: 0;
}

.legacy-status-loading__text {
  color: var(--text-secondary-dark);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legacy-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 255, 213, 0.18);
  border-top-color: var(--electric-cyan);
  border-radius: 50%;
  animation: legacy-spin 0.8s linear infinite;
}

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

@keyframes legacy-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.legacy-card--status.is-visible .legacy-card__header,
.legacy-card--status.is-visible .legacy-profile,
.legacy-card--status.is-visible .legacy-user,
.legacy-card--status.is-visible .legacy-stat,
.legacy-card--status.is-visible .legacy-status-row,
.legacy-card--status.is-visible .legacy-debug,
.legacy-card--content.is-visible,
.legacy-card--content.is-visible .legacy-content-panel__label,
.legacy-card--content.is-visible .legacy-content-panel__title,
.legacy-card--content.is-visible .legacy-content-panel__lead,
.legacy-card--content.is-visible .legacy-content-panel__body {
  animation: legacy-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.legacy-card--status.is-visible .legacy-card__header {
  animation-delay: 0.01s;
}

.legacy-card--status.is-visible .legacy-profile {
  animation-delay: 0.02s;
}

.legacy-card--status.is-visible .legacy-user {
  animation-delay: 0.06s;
}

.legacy-card--status.is-visible .legacy-stat:nth-child(1) {
  animation-delay: 0.12s;
}

.legacy-card--status.is-visible .legacy-stat:nth-child(2) {
  animation-delay: 0.16s;
}

.legacy-card--status.is-visible .legacy-stat:nth-child(3) {
  animation-delay: 0.2s;
}

.legacy-card--status.is-visible .legacy-stat:nth-child(4) {
  animation-delay: 0.24s;
}

.legacy-card--status.is-visible .legacy-status-row:nth-child(1) {
  animation-delay: 0.1s;
}

.legacy-card--status.is-visible .legacy-status-row:nth-child(2) {
  animation-delay: 0.16s;
}

.legacy-card--status.is-visible .legacy-status-row:nth-child(3) {
  animation-delay: 0.22s;
}

.legacy-card--status.is-visible .legacy-status-row:nth-child(4) {
  animation-delay: 0.28s;
}

.legacy-card--status.is-visible .legacy-debug {
  animation-delay: 0.34s;
}

.legacy-card--content.is-visible {
  animation-delay: 0.08s;
}

.legacy-card--content.is-visible .legacy-content-panel__label {
  animation-delay: 0.1s;
}

.legacy-card--content.is-visible .legacy-content-panel__title {
  animation-delay: 0.14s;
}

.legacy-card--content.is-visible .legacy-content-panel__lead {
  animation-delay: 0.18s;
}

.legacy-card--content.is-visible .legacy-content-panel__body {
  animation-delay: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  .legacy-card--status.is-visible .legacy-card__header,
  .legacy-card--status.is-visible .legacy-profile,
  .legacy-card--status.is-visible .legacy-user,
  .legacy-card--status.is-visible .legacy-stat,
  .legacy-card--status.is-visible .legacy-status-row,
  .legacy-card--status.is-visible .legacy-debug,
  .legacy-card--content.is-visible,
  .legacy-card--content.is-visible .legacy-content-panel__label,
  .legacy-card--content.is-visible .legacy-content-panel__title,
  .legacy-card--content.is-visible .legacy-content-panel__lead,
  .legacy-card--content.is-visible .legacy-content-panel__body {
    animation: none;
  }
}

.legacy-card--status.is-loading .legacy-user,
.legacy-card--status.is-loading .legacy-debug {
  display: none;
}

.legacy-status-row {
  padding: 18px 20px;
  border: 1px solid var(--border-terminal-strong);
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.55);
  min-width: 0;
}

.legacy-status-row__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.legacy-status-row__value {
  font-size: clamp(16px, 4.5vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary-dark);
  overflow-wrap: anywhere;
}

.legacy-status-row__value.is-active {
  color: var(--profit-green);
}

.legacy-status-row__value.is-none {
  color: var(--risk-red);
}

.legacy-status-row.is-inactive {
  border-color: rgba(255, 51, 102, 0.32);
  background: rgba(255, 51, 102, 0.05);
}

.legacy-status-row.is-inactive .legacy-status-row__label {
  color: rgba(255, 51, 102, 0.78);
}

.legacy-status-row.is-inactive .legacy-status-row__detail {
  color: rgba(255, 51, 102, 0.82);
}

.legacy-status-row__detail {
  margin-top: 6px;
  font-size: clamp(12px, 3.5vw, 13px);
  line-height: 1.5;
  color: var(--text-secondary-dark);
  overflow-wrap: anywhere;
}

.legacy-stat__value.is-eligible {
  color: var(--profit-green);
}

.legacy-stat__value.is-ineligible {
  color: var(--text-secondary-dark);
}

.legacy-sub-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legacy-sub-list li {
  padding: 14px 16px;
  border: 1px solid var(--border-terminal);
  border-radius: 10px;
  background: rgba(10, 14, 23, 0.55);
}

.legacy-sub-list__title {
  font-weight: 700;
  color: var(--text-primary-dark);
  margin-bottom: 4px;
}

.legacy-sub-list__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted-dark);
}

.legacy-sub-list__badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 255, 213, 0.1);
  border: 1px solid rgba(0, 255, 213, 0.25);
}

.legacy-empty {
  margin: 0 0 20px;
  color: var(--text-muted-dark);
  font-size: 14px;
}

.legacy-debug {
  margin-bottom: 16px;
}

.legacy-debug summary {
  cursor: pointer;
  color: var(--text-muted-dark);
  font-size: 13px;
  margin-bottom: 10px;
}

.legacy-debug[open] summary {
  margin-bottom: 12px;
}

.legacy-section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.legacy-json {
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border-terminal);
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.75);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary-dark);
  white-space: pre-wrap;
  word-break: break-word;
}

.legacy-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  color: var(--text-muted-dark);
  font-size: 13px;
}

.legacy-footer__links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

@media (max-width: 960px) {
  .legacy-header--status .legacy-header__inner {
    display: flex;
    justify-content: center;
    max-width: 100%;
    padding:
      14px
      max(46px, calc(10px + env(safe-area-inset-right)))
      14px
      max(46px, calc(10px + env(safe-area-inset-left)));
  }

  .legacy-header--status .legacy-header__logout {
    position: absolute;
    top: 50%;
    right: max(8px, env(safe-area-inset-right));
    transform: translateY(-50%);
    grid-column: auto;
    justify-self: auto;
  }

  .legacy-card--content {
    min-height: 240px;
  }
}

@media (max-width: 560px) {
  .legacy-header__inner {
    padding:
      14px
      max(46px, calc(10px + env(safe-area-inset-right)))
      14px
      max(10px, env(safe-area-inset-left));
  }

  .legacy-header__logout {
    right: max(8px, env(safe-area-inset-right));
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .legacy-header__logout::before {
    content: "";
    position: absolute;
    inset: -5px;
  }

  .legacy-header__logout svg {
    width: 17px;
    height: 17px;
  }

  .legacy-header__logo {
    width: min(220px, 72vw);
  }

  .legacy-main {
    padding:
      24px
      max(12px, env(safe-area-inset-right))
      48px
      max(12px, env(safe-area-inset-left));
  }

  .legacy-card {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .legacy-card__header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .legacy-membership-status,
  .legacy-certified {
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-terminal);
    border-radius: 10px;
    background: rgba(10, 14, 23, 0.55);
  }

  .legacy-profile {
    margin-bottom: 16px;
  }

  .legacy-user {
    grid-template-columns: 1fr;
    padding: 14px;
    margin-bottom: 18px;
  }

  .legacy-user__label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .legacy-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .legacy-stat {
    padding: 12px 8px;
  }

  .legacy-stat__label {
    font-size: 9px;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }

  .legacy-stat__value {
    font-size: clamp(22px, 8vw, 28px);
  }

  .legacy-status-board {
    margin-bottom: 16px;
  }

  .legacy-status-row {
    padding: 14px 14px;
  }

  .legacy-status-row__label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .legacy-status-grid {
    grid-template-columns: 1fr;
  }

  .legacy-btn {
    min-height: 48px;
  }

  .legacy-footer {
    padding:
      20px
      max(16px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
}

@media (max-width: 360px) {
  .legacy-main {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  .legacy-card {
    padding: 16px 12px;
  }

  .legacy-membership-status__label,
  .legacy-certified__label {
    font-size: 10px;
  }

  .legacy-membership-status__value,
  .legacy-certified__value {
    font-size: 11px;
  }

  .legacy-stat__value {
    font-size: clamp(20px, 9vw, 24px);
  }

  .legacy-portal-split {
    grid-template-columns: 1fr;
  }

  .legacy-portal-bucket {
    padding: 16px;
  }

  .legacy-portal-bucket__head {
    flex-direction: column;
    align-items: stretch;
  }

  .legacy-portal-bucket__status {
    align-self: flex-start;
  }
}
