/* Phase 2 server-auth controls live inside the established signed-out
   landing. The parent owns the tabs, map, Explore toggle, and product strip;
   no rule here may replace that shell. */
.pt-gate.gv6 .rs-p2-inline { width: 100%; }
.pt-gate.gv6 .pt-gate-map-status {
  position: absolute;
  z-index: 3;
  right: .75rem;
  bottom: .75rem;
  max-width: min(32rem, calc(100% - 1.5rem));
  padding: .65rem .8rem;
  border: 1px solid #a85e12;
  border-radius: .4rem;
  background: rgba(255, 248, 238, .96);
  color: #6e3608;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 3px 12px rgba(16, 28, 45, .16);
}
.pt-gate.gv6 .rs-p2-inline h2 { margin: 1.25rem 0 .4rem; color: var(--pha-text); font-size: 1.2rem; }
.pt-gate.gv6 .rs-p2-inline h3 { margin: 0 0 .35rem; color: var(--pha-text); font-size: 1rem; }
.pt-gate.gv6 .rs-p2-intro,
.pt-gate.gv6 .rs-p2-inline p { color: var(--pha-muted); line-height: 1.5; }
.pt-gate.gv6 .rs-p2-intro { margin: 0 0 1rem; }
.rs-p2-form { display: grid; gap: .5rem; margin: 1rem 0; }
.pt-gate.gv6 .rs-p2-form label { color: var(--pha-text); font-size: .75rem; font-weight: 700; }
.rs-p2-form input {
  width: 100%;
  min-height: 2.6rem;
  padding: .6rem .7rem;
  border: 1px solid var(--pha-hairline-strong);
  border-radius: .4rem;
  background: var(--pha-bg, #fff);
  color: var(--pha-text);
}
.rs-p2-form .pt-gate-cta { margin-top: .35rem; }
.rs-p2-message {
  margin: 1rem 0;
  padding: .75rem;
  border: 1px solid var(--pha-hairline-strong);
  border-radius: .4rem;
  background: var(--pha-cyan-bg, #eef6ff);
  color: var(--pha-text);
  font-size: .875rem;
}
.rs-p2-message.error {
  border-color: var(--pha-red, #a43b3b);
  background: var(--pha-red-bg, #fff0f0);
  color: var(--pha-red, #8f3030);
}
.rs-p2-aal {
  display: inline-block;
  padding: .35rem .55rem;
  border-radius: 999px;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: .75rem;
  font-weight: 700;
}
.rs-p2-aal1 { background: var(--pha-amber-bg, #fff5df); color: var(--pha-amber, #9d5d0a); }
.rs-p2-aal2 { background: var(--pha-cyan-bg, #e8f3ff); color: var(--pha-blue-deep); }
.rs-p2-whoami {
  margin: .1rem 0 .9rem;
  font-size: .8125rem;
  color: var(--pha-muted);
}
.rs-p2-whoami b { color: var(--pha-text); }
.rs-p2-tier2 {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--pha-hairline);
}
.rs-p2-results { margin-top: .75rem; font-size: .8125rem; }
.rs-p2-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--pha-hairline); border-radius: .4rem; }
.rs-p2-table-wrap table { width: 100%; border-collapse: collapse; }
.rs-p2-table-wrap th, .rs-p2-table-wrap td {
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--pha-hairline);
  color: var(--pha-text);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.rs-p2-table-wrap th {
  background: var(--pha-panel, var(--pha-cyan-bg, #eef6ff));
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: .6875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rs-p2-link {
  margin-top: 1rem;
  padding: .25rem 0;
  color: var(--pha-blue);
  font: inherit;
  text-decoration: underline;
}
.rs-p2-qr {
  width: min(100%, 14rem);
  margin: .75rem auto;
  padding: .5rem;
  border: 1px solid var(--pha-hairline);
  border-radius: .5rem;
  background: #fff;
}
.rs-p2-foot { margin-top: 1.5rem !important; font-size: .75rem; }
/* G-09b: agency SSO divider + toggle, sitting between the password form and
   its own (separate, hidden-by-default) domain-entry form. Reuses the
   existing .rs-p2-link / .rs-p2-form look so it reads as part of the same
   sign-in card, not a bolted-on widget. */
.rs-p2-sso-divider {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .9rem 0;
  color: var(--pha-text-muted, #6b7280);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.rs-p2-sso-divider::before,
.rs-p2-sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pha-hairline, #e2e8f0);
}
#rs-p2-sso-toggle { margin-top: 0; display: block; width: 100%; text-align: center; }
.pt-gate.gv6 .rs-p2-inline :focus-visible {
  outline: 3px solid var(--pha-blue);
  outline-offset: 3px;
}
@media (max-width: 30rem) {
  .pt-gate.gv6 .rs-p2-inline .rs-p2-message { padding: .65rem; }
}

/* The original landing header is intentionally retained for signed-out
   visitors.  At phone width, preserve its portal switcher as one readable
   row and remove only its secondary marketing links rather than allowing
   the brand lock-up or links to overlap the auth entry point. */
@media (max-width: 40rem) {
  .pt-gate.gv6 .rs-authority-top {
    min-height: 56px;
    height: auto;
    padding: 7px 12px;
    gap: 8px;
  }
  .pt-gate.gv6 .rs-authority-brand {
    flex: 0 1 108px;
    gap: 6px;
  }
  .pt-gate.gv6 .rs-authority-brand svg {
    width: 22px;
    height: 22px;
  }
  .pt-gate.gv6 .rs-authority-brand b { font-size: 15px; }
  .pt-gate.gv6 .rs-authority-brand > div > span {
    font-size: 11px;
    letter-spacing: .08em;
  }
  .pt-gate.gv6 .rs-authority-links { gap: 0; min-width: 0; }
  .pt-gate.gv6 .rs-authority-portals a {
    padding: 8px 7px;
    font-size: 11px;
    white-space: nowrap;
  }
  .pt-gate.gv6 .pt-gate-tabs {
    align-items: stretch;
  }
  .pt-gate.gv6 .pt-gtab {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pt-gate.gv6 .rs-authority-link,
  .pt-gate.gv6 .rsn-slot { display: none; }
  /* v18 P2 register #15 (2026-08-17): Contact Sales and Sign In must stay
     reachable on phones. Re-show ONLY those two CTAs in compact form and
     let the bar wrap to a second row; the Self-Serve Demo link stays
     reachable through the Platform menu at this width. */
  .pt-gate.gv6 .rs-authority-top { flex-wrap: wrap; }
  .pt-gate.gv6 .rs-authority-links { flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
  .pt-gate.gv6 .rs-authority-link.rs-authority-cta,
  .pt-gate.gv6 .rs-authority-link.rs-authority-signin {
    display: inline-block;
    padding: 7px 9px;
    font-size: 11px;
  }
  /* v18 P2 register #18: keep the PHA SOLUTIONS lock-up on one line. */
  .pt-gate.gv6 .rs-authority-brand > div > span,
  .pt-gate.gv6 .rs-authority-brand-link > div > span { white-space: nowrap; font-size: 11px; letter-spacing: .14em; }
}

/* ---- v14 fold density (2026-08-15 owner directive) ---- */
/* BUG FIX: .rs-p2-form{display:grid} overrode the hidden attribute, so the
   email/password form stayed visible after sign-in and pushed the card below
   a 740px fold. Scoped hard override: */
.pt-gate.gv6 .rs-p2-inline [hidden] { display: none !important; }
.pt-gate.gv6 .rs-p2-inline h2 { margin: .65rem 0 .3rem; font-size: 1.05rem; }
.pt-gate.gv6 .rs-p2-inline p { margin: .25rem 0 .55rem; font-size: .8125rem; line-height: 1.45; }
.rs-p2-form { gap: .4rem; margin: .6rem 0; }
.rs-p2-form input { min-height: 2.35rem; padding: .5rem .65rem; }
.rs-p2-message { margin: .6rem 0; padding: .55rem .65rem; font-size: .8125rem; }
.rs-p2-toprow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .2rem; }
.rs-p2-toprow .rs-p2-aal { margin: 0; }
.rs-p2-toprow .rs-p2-link { margin-top: 0; font-size: .75rem; }
.rs-p2-foot { margin-top: .9rem !important; font-size: .75rem; }
.rs-p2-why { margin: .55rem 0 0; }
.rs-p2-why summary { cursor: pointer; color: var(--pha-blue); font-size: .75rem; text-decoration: underline; }
.rs-p2-why p { margin: .3rem 0 0; font-size: .75rem; }
.rs-p2-tier2 { margin-top: .8rem; padding-top: .8rem; }
/* gv14: explore row in the signed-out card — quiet pill links */
.rs-p2-explore{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:14px;
  padding-top:12px;border-top:1px solid #e7edf5}
/* Wave 4 (2026-08-30, VPAT 1.4.3): was 10px #7a8aa0 (3.52:1 on white) — raised to the
   12px floor and darkened within the slate ramp to #5a6c85 (5.36:1). */
.rs-p2-explore-t{font:700 12px/1 ui-monospace,monospace;letter-spacing:.09em;text-transform:uppercase;
  color:#5a6c85;flex:0 0 100%}
.rs-p2-explore a{font:600 12px/1 Inter,system-ui;color:#10407f;text-decoration:none;
  border:1px solid #d7dfeb;border-radius:999px;padding:6px 11px;white-space:nowrap}
.rs-p2-explore a:hover{background:#eef3fa}

/* D-01 (2026-09-11 defect audit): a Supabase auth round-trip can take 5-15s
   on cold, and a static "Signing in…" button label with no motion was reading
   as a stuck app. This spinner is injected inside the busy sign-in button by
   setBusy() in portal-auth-phase2.js. Uses only CSS transform, no external
   assets. Reduced-motion users get a static ring instead of the spin. */
.rs-p2-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: rs-p2-spin 0.7s linear infinite;
}
.pt-gate-cta:disabled .rs-p2-spinner {
  border-color: rgba(255,255,255,0.5);
  border-top-color: #ffffff;
}
@keyframes rs-p2-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rs-p2-spinner { animation: none; }
}

/* 2026-09-28 — password-reset landing: the gate becomes one card with one job. */
.pt-gate-card.rs-p2-recovery-mode .pt-gate-foot,
.pt-gate-card.rs-p2-recovery-mode .pt-gate-counters,
.pt-gate-card.rs-p2-recovery-mode .pt-gate-kpis,
.pt-gate-card.rs-p2-recovery-mode .gv17-cardstats,
.pt-gate-card.rs-p2-recovery-mode .rs-p2-explore,
.pt-gate-card.rs-p2-recovery-mode .pt-gate-tabs { display: none; }
.pt-gate-card.rs-p2-recovery-mode #rs-p2-authenticated { display: block; }
.pt-gate-card.rs-p2-recovery-mode #rs-p2-authenticated .pt-gate-cta { margin-top: 12px; }
/* 2026-09-29 — sign-in / MFA panel tightened (Brett: "still very verbose and lots of prose"). Explainers live in hover tips. */
.rs-tip { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 1px solid var(--pha-hairline, #d9d4c9); font: 700 .68rem/1 Inter, system-ui, sans-serif; color: var(--pha-muted, #565146); background: #fff; cursor: help; position: relative; vertical-align: middle; margin-left: .25rem; text-decoration: none; }
.rs-tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + .45rem); transform: translateX(-50%); width: max-content; max-width: 18rem; padding: .5rem .65rem; border-radius: .45rem; background: #1c1a15; color: #fff; font: 400 .74rem/1.4 Inter, system-ui, sans-serif; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.rs-tip:hover::after, .rs-tip:focus::after, .rs-tip:focus-visible::after { opacity: 1; }
.rs-p2-h2 { font-size: 1rem; margin: .6rem 0 .35rem; display: flex; align-items: center; gap: .2rem; }
.rs-p2-whoami { margin: .15rem 0 0; font-size: .8rem; }
.rs-p2-enroll-grid { display: grid; grid-template-columns: 11rem 1fr; gap: .9rem; align-items: start; margin-top: .35rem; }
.rs-p2-enroll-grid .rs-p2-qr { width: 11rem; margin: 0; padding: .35rem; }
.rs-p2-enroll-side { display: grid; gap: .55rem; font-size: .82rem; }
.rs-p2-step { line-height: 1.35; }
.rs-p2-key { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; }
.rs-p2-key code { font: 600 .78rem/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .04em; background: #f4f3ef; border: 1px solid var(--pha-hairline, #d9d4c9); border-radius: .35rem; padding: .3rem .45rem; word-break: break-all; }
.rs-p2-copy { font: 600 .72rem Inter, system-ui, sans-serif; border: 1px solid var(--pha-hairline, #d9d4c9); background: #fff; border-radius: .35rem; padding: .3rem .5rem; cursor: pointer; }
.rs-p2-form-inline { display: flex; gap: .4rem; align-items: center; margin: .4rem 0 0; }
.rs-p2-form-inline input { width: 7.2rem; font: 600 1.05rem/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .25em; text-align: center; }
.rs-p2-form-inline .pt-gate-cta { margin: 0; min-height: 2.35rem; padding: 0 .9rem; width: auto; }
.rs-p2-alt { font-size: .78rem; margin: .7rem 0 0; color: var(--pha-muted, #565146); }
.rs-p2-spin { font-size: .8rem; color: var(--pha-muted, #565146); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) { .rs-p2-enroll-grid { grid-template-columns: 1fr; } .rs-p2-enroll-grid .rs-p2-qr { margin: 0 auto; } }
.rs-p2-aal .rs-tip::after, .rs-p2-toprow .rs-tip::after { left: 0; transform: none; }
.rs-p2-whoami { margin: .1rem 0 .3rem; }
/* 2026-09-29 22:44 — focus mode: once a session exists the card shows only the
   one step that matters. Tabs, intro, footer links, trust line, counters and
   explore row hide until sign-out (Brett: "it's a lot"). */
.pt-gate-card.rs-p2-authed .pt-gate-tabs, .pt-gate-card.rs-p2-authed .rs-p2-intro, .pt-gate-card.rs-p2-authed .rs-p2-foot,
.pt-gate-card.rs-p2-authed .pt-gate-foot, .pt-gate-card.rs-p2-authed .gv17-cardstats, .pt-gate-card.rs-p2-authed .rs-p2-explore,
.pt-gate-card.rs-p2-authed #rs-p2-forgot-form, .pt-gate-card.rs-p2-authed .rs-p2-message:empty { display: none !important; }
.pt-gate-card.rs-p2-authed .rs-p2-toprow { justify-content: space-between; }
.pt-gate-card.rs-p2-authed .rs-p2-whoami { margin: 0; }
.pt-gate-card.rs-p2-authed .rs-p2-h2 { font-size: 1.05rem; margin: .8rem 0 .5rem; }
.pt-gate-card.rs-p2-authed .rs-p2-enroll-grid { grid-template-columns: 12rem 1fr; }
.pt-gate-card.rs-p2-authed .rs-p2-enroll-grid .rs-p2-qr { width: 12rem; }
.pt-gate-card.rs-p2-authed .rs-p2-sso-divider, .pt-gate-card.rs-p2-authed #rs-p2-sso-toggle, .pt-gate-card.rs-p2-authed #rs-p2-sso-form { display: none !important; }
/* 2026-09-30 00:45 — density: one centered column, card shrinks to content, no dead space (Brett screenshot). */
.pt-gate-card.rs-p2-authed { min-height: 0 !important; height: auto !important; padding-bottom: 1.1rem; }
.pt-gate-card.rs-p2-authed .rs-p2-enroll-stack { display: grid; justify-items: center; gap: .7rem; margin-top: .3rem; }
.pt-gate-card.rs-p2-authed .rs-p2-enroll-stack .rs-p2-qr { width: 13.5rem; margin: 0; padding: .35rem; }
.pt-gate-card.rs-p2-authed .rs-p2-enroll-stack .rs-p2-step { width: 100%; max-width: 26rem; font-size: .86rem; line-height: 1.4; }
.pt-gate-card.rs-p2-authed .rs-p2-key { margin-top: .35rem; }
.pt-gate-card.rs-p2-authed .rs-p2-key code { flex: 1; font-size: .86rem; letter-spacing: .06em; text-align: center; }
.pt-gate-card.rs-p2-authed .rs-p2-form-inline { justify-content: flex-start; }
.pt-gate-card.rs-p2-authed .rs-p2-form-inline input { width: 9rem; font-size: 1.25rem; letter-spacing: .35em; padding-left: .3rem; }
.pt-gate-card.rs-p2-authed .rs-p2-form-inline input::placeholder { letter-spacing: 0; font-size: .85rem; }
.pt-gate-card.rs-p2-authed .rs-p2-h2 { margin-top: .9rem; }
.pt-gate-card.rs-p2-authed .rs-p2-alt { text-align: center; margin-top: .8rem; }
.gv6-left .pt-gate-card.rs-p2-authed { align-self: flex-start; }
.gv6-left .pt-gate-card.rs-p2-authed #gate-staff:not([hidden]) { flex: 0 0 auto; }
/* 2026-09-30 02:50 — passkey first (Brett Spain sign-off). */
.rs-p2-passkey { width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: 1rem; padding: .8rem 1rem; }
.rs-p2-passkey-ico { font-size: 1.05rem; line-height: 1; }
.rs-p2-passkey-hint { margin: .45rem 0 .2rem; font-size: .82rem; color: #475569; text-align: center; }
.rs-p2-pw-divider { margin: .9rem 0 .4rem; }
.rs-p2-alt-details { margin-top: .9rem; border-top: 1px solid #e2e8f0; padding-top: .6rem; }
.rs-p2-alt-details > summary { cursor: pointer; font-size: .86rem; color: #1d4ed8; text-decoration: underline; list-style: none; text-align: center; }
.rs-p2-alt-details > summary::-webkit-details-marker { display: none; }
.rs-p2-alt-details[open] > summary { margin-bottom: .6rem; }
.rs-p2-lbl { display: block; width: 100%; font-size: .86rem; margin-bottom: .3rem; }
.pt-gate-card.rs-p2-authed .rs-p2-h2 { margin-top: .6rem; margin-bottom: .6rem; }
