/* Usagi Hub — Portal auth (Phase 2) — Inter body / Sora display */
@import url('/assets/tokens.css');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Auth screen ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 166, 58, 0.08), transparent 55%),
    var(--bg);
}

.auth-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bdr);
}

.auth-topbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--white);
}

.auth-topbar-brand em {
  font-style: normal;
  color: var(--gold);
}

.lang-switch {
  display: flex;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 7px;
  padding: 2px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--txt3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.lang-switch button.active {
  background: var(--gold-bg);
  color: var(--gold);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin-top: 48px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 32px 28px 28px;
}

.auth-brand {
  margin-bottom: 24px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  object-fit: cover;
  margin-bottom: 16px;
}

.auth-view-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-view-desc {
  font-size: 14px;
  color: var(--txt2);
  line-height: 1.6;
}

.auth-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--bdr);
}

.auth-tab {
  padding: 0 0 12px;
  border: 0;
  background: transparent;
  color: var(--txt3);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.25s ease;
}

.auth-tab:hover {
  color: var(--white);
}

.auth-tab.active {
  color: var(--white);
  border-bottom-color: var(--gold);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--txt2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr2);
  background: var(--bg2);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(212, 166, 58, 0.12);
}

.field input:read-only {
  opacity: 0.75;
  cursor: not-allowed;
}

.pass-wrap {
  position: relative;
}

.pass-wrap input {
  padding-right: 44px;
}

.pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--txt3);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--red);
  min-height: 1em;
}

.pass-rules {
  list-style: none;
  margin-top: 10px;
  display: grid;
  gap: 5px;
}

.pass-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--txt3);
}

.pass-rule--ok {
  color: var(--green);
}

.pass-rule--bad {
  color: var(--txt3);
}

.pass-rule-ico {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.btn-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  min-height: 46px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: #0a0c12;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-gold:hover:not(:disabled) {
  background: var(--gold-hover);
}

.btn-gold:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-alert {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  min-height: 1.2em;
}

.auth-alert--ok {
  color: var(--green);
}

.auth-alert--err {
  color: var(--red);
}

.auth-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--txt2);
}

.auth-foot a {
  color: var(--gold);
  transition: color 0.25s ease;
}

.auth-foot a:hover {
  color: var(--white);
}

.auth-foot p + p {
  margin-top: 8px;
}

.auth-only-reg {
  display: none;
}

body.auth-mode-register .auth-only-reg {
  display: block;
}

body.auth-mode-forgot .field:has(#authPass),
body.auth-mode-forgot .field:has(#authPass2),
body.auth-mode-forgot #passRules {
  display: none;
}

body.auth-mode-reset .field:has(#regName),
body.auth-mode-reset #passRules {
  display: none;
}

body.auth-mode-reset .field:has(#authPass2) {
  display: block;
}

body:not(.auth-mode-register):not(.auth-mode-reset) .field:has(#authPass2) {
  display: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 11, 20, 0.55);
  display: grid;
  place-items: center;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bdr2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Portal (Phase 3) ── */
.portal-app {
  display: none;
  min-height: 100vh;
}

body.hub-authed .auth-screen {
  display: none;
}

body.hub-authed .portal-app {
  display: flex;
}

.portal-app {
  background: var(--bg);
}

.portal-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.portal-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--bdr);
}

.portal-sidebar__logo {
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  object-fit: cover;
}

.portal-sidebar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: var(--white);
}

.portal-sidebar__title em {
  font-style: normal;
  color: var(--gold);
}

.portal-sidebar__sub {
  font-size: 11px;
  color: var(--txt3);
  font-style: italic;
}

.portal-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-nav__item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--txt2);
  transition: all 0.25s ease;
}

.portal-nav__item:hover {
  color: var(--gold);
  background: rgba(212, 166, 58, 0.08);
}

.portal-nav__item.active {
  color: var(--white);
  background: var(--gold-bg);
  border: 1px solid var(--gold-dim);
}

.portal-nav__item--muted {
  font-size: 13px;
  color: var(--txt3);
}

.portal-sidebar__foot {
  padding: 14px 10px 20px;
  border-top: 1px solid var(--bdr);
}

.portal-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(15, 18, 32, 0.92);
  border-bottom: 1px solid var(--bdr);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-header__greet {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 1.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-badge--active {
  color: var(--green);
  background: rgba(41, 201, 154, 0.12);
  border: 1px solid rgba(41, 201, 154, 0.25);
}

.status-badge--inactive {
  color: var(--txt3);
  background: rgba(74, 85, 128, 0.2);
  border: 1px solid var(--bdr);
}

.portal-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.portal-content {
  flex: 1;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 960px;
}

.portal-page {
  display: none;
  animation: fadeUp 0.25s ease;
}

.portal-page--active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.portal-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 8px;
}

.portal-desc {
  font-size: 15px;
  color: var(--txt2);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 560px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin: 28px 0 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 18px 18px 20px;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head-row .panel-title {
  margin-bottom: 0;
}

.panel.is-dimmed {
  opacity: 0.55;
  pointer-events: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-grid--dense {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .stat-grid--dense {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  padding: 14px;
}

.stat-card label {
  display: block;
  font-size: 12px;
  color: var(--txt3);
  margin-bottom: 6px;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.stat-val.muted {
  color: var(--txt3);
}

.stat-val--up { color: var(--green); }
.stat-val--down { color: var(--red); }
.stat-val--gold { color: var(--gold); }

.lic-dl {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.lic-dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.lic-dl dt {
  color: var(--txt3);
}

.lic-dl dd {
  color: var(--white);
  font-weight: 500;
}

.lic-status--ok { color: var(--green); }
.lic-status--warn { color: var(--gold); }
.lic-status--err { color: var(--red); }

.qa-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 540px) {
  .qa-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.product-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  overflow: hidden;
}

.product-card--featured {
  border-color: var(--gold-dim);
}

.product-card__body {
  padding: 16px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.product-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(74, 85, 128, 0.25);
  color: var(--txt2);
}

.product-badge--owned {
  color: var(--gold);
  background: var(--gold-bg);
}

.product-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.product-desc {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.6;
  margin-bottom: 10px;
}

.product-foot {
  font-size: 12px;
  color: var(--txt3);
  margin-bottom: 12px;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-select,
.field input[type='number'] {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr2);
  background: var(--bg2);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  margin-bottom: 14px;
}

.portal-select:focus,
.field input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(212, 166, 58, 0.12);
}

.mono {
  font-variant-numeric: tabular-nums;
}

.file-list {
  margin-top: 4px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bdr);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row--locked {
  opacity: 0.7;
}

.file-type {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--gold-bg);
  color: var(--gold);
  flex-shrink: 0;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-meta strong {
  display: block;
  font-size: 14px;
  color: var(--white);
}

.file-meta small {
  display: block;
  font-size: 12px;
  color: var(--txt3);
  margin-top: 2px;
}

.signal-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.signal-card--buy {
  border-left: 3px solid var(--green);
}

.signal-card--sell {
  border-left: 3px solid var(--red);
}

.signal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.signal-pair {
  font-weight: 600;
  color: var(--white);
}

.signal-dir {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.signal-card--buy .signal-dir {
  color: var(--green);
  background: rgba(41, 201, 154, 0.12);
}

.signal-card--sell .signal-dir {
  color: var(--red);
  background: rgba(224, 82, 82, 0.12);
}

.signal-pnl {
  color: var(--green);
  font-size: 13px;
  margin-top: 4px;
}

.support-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr2);
  color: var(--white);
  transition: all 0.25s ease;
}

.support-link:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.portal-alert {
  margin-top: 12px;
  font-size: 14px;
  min-height: 1em;
}

.portal-alert--ok { color: var(--green); }
.portal-alert--err { color: var(--red); }

.empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--txt3);
  font-size: 14px;
}

.muted {
  color: var(--txt3);
}

.footnote {
  font-size: 13px;
  color: var(--txt3);
  line-height: 1.7;
  margin-top: 8px;
}

.locked-msg a {
  color: var(--gold);
}

.portal-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg2);
  border-top: 1px solid var(--bdr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.portal-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  min-height: 48px;
  min-width: 44px;
  font-size: 10px;
  font-weight: 500;
  color: var(--txt3);
  transition: color 0.25s ease;
}

.portal-tab__ico {
  font-size: 16px;
  line-height: 1;
}

.portal-tab.active {
  color: var(--gold);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--bdr2);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-outline:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-danger-outline {
  border-color: rgba(224, 82, 82, 0.35);
  color: #f0a0a0;
}

.btn-danger-outline:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(224, 82, 82, 0.08);
}

@media (max-width: 900px) {
  .portal-app {
    flex-direction: column;
  }

  .portal-sidebar {
    display: none;
  }

  .portal-tab-bar {
    display: flex;
  }

  .portal-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .portal-header__greet {
    max-width: 120px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px 22px;
  }

  .auth-topbar {
    padding: 14px 16px;
  }

  .portal-content {
    padding: 18px 14px calc(76px + env(safe-area-inset-bottom));
  }

  .portal-header {
    padding: 12px 14px;
  }

  .qa-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .auth-screen {
    justify-content: flex-start;
    padding-top: 72px;
  }

  .auth-card {
    margin-top: 8px;
  }

  .portal-sidebar {
    height: auto;
    max-height: 100vh;
  }
}

/* Phase 7 — license flows */
.founding-banner-wrap {
  margin-bottom: 16px;
}

.founding-banner {
  background: var(--card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.founding-banner p {
  flex: 1;
  min-width: 200px;
  margin: 0;
  color: var(--white);
  font-size: 14px;
  line-height: 1.6;
}

.founding-banner--ok {
  border-color: rgba(41, 201, 154, 0.35);
  background: rgba(41, 201, 154, 0.06);
}

.founding-banner--muted {
  border-color: var(--bdr);
  opacity: 0.9;
}

.path-fork__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.path-fork__card {
  padding: 16px;
  border: 1px solid var(--bdr2);
  border-radius: var(--r-sm);
  background: var(--bg2);
}

.payos-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.mql5-panel textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr2);
  background: var(--bg2);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
}

.mql5-panel input[type='file'] {
  width: 100%;
  font-size: 13px;
  color: var(--txt2);
}

.payos-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
}

.payos-modal[hidden] {
  display: none;
}

/* Admin preview (portal switch) */
.admin-preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(90deg, #1a2744 0%, #2a1f0a 50%, #1a2744 100%);
  border-bottom: 1px solid rgba(212, 168, 83, 0.45);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold2, #e8c97a);
}

.admin-preview-banner__link {
  color: var(--white, #fff);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--r-sm, 8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 500;
}

.admin-preview-banner__link:hover {
  border-color: var(--gold2, #e8c97a);
  color: var(--gold2, #e8c97a);
}

body.admin-preview .portal-app {
  padding-top: 44px;
}

body.admin-preview .portal-sidebar {
  top: 44px;
  height: calc(100% - 44px);
}

.admin-preview-note {
  font-style: italic;
}

.payos-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.payos-modal__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 20px 18px 22px;
}

.payos-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--txt2);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

.payos-qr {
  display: block;
  margin: 12px auto;
  border-radius: var(--r-sm);
  background: #fff;
  padding: 8px;
}

/* ── Dashboard overview ── */
.dash-package-panel {
  border-color: var(--gold-dim);
}

.dash-package-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 14px;
}

.dash-active-ea {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(41, 201, 154, 0.06);
  border: 1px solid rgba(41, 201, 154, 0.2);
  border-radius: var(--r-sm);
}

.dash-active-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(41, 201, 154, 0.15);
  flex-shrink: 0;
}

.ea-module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .ea-module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ea-module-card {
  padding: 12px 14px;
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  background: rgba(15, 18, 32, 0.6);
}

.ea-module-card--on {
  border-color: rgba(41, 201, 154, 0.35);
  background: rgba(41, 201, 154, 0.04);
}

.ea-module-id {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 4px;
}

.ea-module-status {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--green);
}

.product-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* ── Activation workspace panels ── */
.portal-workspace-panel {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 20px 18px 22px;
  margin-bottom: 16px;
}

.portal-workspace-panel--web {
  border-color: var(--gold-dim);
}

.mql5-workspace {
  border-color: rgba(41, 201, 154, 0.35);
  background: linear-gradient(180deg, rgba(41, 201, 154, 0.04), var(--card) 40%);
}

.portal-workspace-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(41, 201, 154, 0.12);
  border: 1px solid rgba(41, 201, 154, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.portal-workspace-badge--web {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: var(--gold-dim);
}

.mql5-workspace__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.45;
}

.mql5-workspace__lead {
  font-size: 14px;
  color: var(--txt2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.mql5-workspace__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.mql5-workspace__input {
  flex: 1 1 220px;
  min-width: 0;
}

.mql5-workspace__tip {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 12px;
  line-height: 1.55;
}

.act-web-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Live history table ── */
.live-hist-tabs {
  display: flex;
  gap: 8px;
}

.live-hist-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}

.portal-table--live {
  font-size: 12px;
}

.portal-table--live th,
.portal-table--live td {
  white-space: nowrap;
}

.live-hist-time {
  font-size: 11px;
}

.live-eng-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gold-bg);
  color: var(--gold);
}

.live-status-closed {
  font-size: 10px;
  color: var(--green);
}

.stat-green {
  color: var(--green);
}

.stat-red {
  color: var(--red);
}
