/* Trial gate + lock overlay — Relate & Ledger workspaces */

.sub-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(52, 225, 173, 0.12);
  color: #8ef0d0;
  border: 1px solid rgba(52, 225, 173, 0.28);
  max-width: min(320px, 42vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-banner[data-urgent="1"] {
  background: rgba(255, 158, 138, 0.14);
  color: #ffc9bc;
  border-color: rgba(255, 158, 138, 0.35);
}

.sub-gate[hidden],
.sub-lock[hidden] {
  display: none !important;
}

.sub-gate,
.sub-lock {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(10px);
}

.sub-gate-card,
.sub-lock-card {
  width: min(560px, 100%);
  border-radius: 20px;
  padding: 28px 28px 24px;
  background: linear-gradient(165deg, rgba(22, 30, 38, 0.98), rgba(14, 20, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.sub-gate-card h2,
.sub-lock-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.sub-gate-card p,
.sub-lock-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.sub-plan-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.sub-plan {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sub-plan:has(input:checked) {
  border-color: rgba(52, 225, 173, 0.55);
  background: rgba(52, 225, 173, 0.08);
}

.sub-plan.featured {
  border-color: rgba(77, 227, 255, 0.35);
}

.sub-plan-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}

.sub-plan-copy strong {
  display: block;
  font-size: 0.95rem;
}

.sub-plan-copy span {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.sub-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-gate-actions button {
  width: 100%;
}

.sub-gate-subscribe {
  background: transparent;
  border: 1px solid rgba(77, 227, 255, 0.45);
  color: #9de9ff;
}

.sub-gate-subscribe:hover {
  border-color: rgba(77, 227, 255, 0.75);
  background: rgba(77, 227, 255, 0.08);
}

.sub-lock-card .btn-ghost {
  margin-top: 10px;
  display: block;
  text-align: center;
}

.sub-gate-error {
  margin: 0 0 10px;
  color: #ff9e8a;
  font-size: 0.88rem;
}

.sub-lock-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

body.sub-gate-open #relate-workspace .ws-main,
body.sub-gate-open #ledger-workspace .ledger-workspace-body,
body.sub-locked #relate-workspace .ws-main,
body.sub-locked #ledger-workspace .ledger-workspace-body {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

.account-sub-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.5;
}

.account-sub-panel .sub-status-pill {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(52, 225, 173, 0.15);
  color: #8ef0d0;
}

.account-sub-panel .sub-status-pill.expired {
  background: rgba(255, 158, 138, 0.15);
  color: #ffc9bc;
}

/* ============================================================
   Small screens — a tall trial/lock modal must scroll instead of
   centring past the top edge, which hid the primary button on short
   phones. Flow content from the top and let the overlay scroll.
   ============================================================ */
@media (max-width: 560px) {
  .sub-gate,
  .sub-lock {
    align-items: start;   /* was place-items:center → could clip the top */
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }
  .sub-gate-card,
  .sub-lock-card {
    margin: auto 0;       /* stays centred when it fits, scrolls when it doesn't */
    padding: 22px 20px 20px;
  }
  .sub-plan { padding: 12px; }
}