/* SPS tokens — light/dark via data-sps-theme (same key as website-server sps-theme). */
[data-sps-theme="light"] {
  --sps-bg: #f8f5ef;
  --sps-bg-alt: #ede6da;
  --sps-text: #1a1a3a;
  --sps-heading: #111118;
  --sps-muted: #5c5c6a;
  --sps-card-border: rgba(44, 47, 99, 0.22);
  --sps-input-border: rgba(44, 47, 99, 0.34);
  --sps-placeholder: #4a4a5c;
  --sps-card-bg: #ffffff;
  --sps-modal-surface: #ffffff;
  --sps-modal-border: rgba(44, 47, 99, 0.16);
  --sps-input-bg: #f3efe8;
  --sps-primary: #f2b34c;
  --sps-primary-hover: #e38b2c;
  --sps-primary-text: #1a1a3a;
  --sps-link: #2c2f63;
  --sps-focus: rgba(245, 211, 122, 0.5);
  --sps-error: #b42318;
  --sps-success: #1b6e3c;
  --sps-header-bg: #1a1a3a;
  --sps-toggle-icon: #f5d37a;
}

[data-sps-theme="dark"] {
  --sps-bg: #1a1a3a;
  --sps-bg-alt: rgba(75, 63, 121, 0.45);
  --sps-text: #f8f5ef;
  --sps-heading: #ffdfa3;
  --sps-muted: #c4bfd8;
  --sps-card-border: rgba(110, 79, 158, 0.45);
  --sps-input-border: rgba(245, 211, 122, 0.28);
  --sps-placeholder: #a39ebc;
  --sps-card-bg: rgba(75, 63, 121, 0.5);
  --sps-modal-surface: #2C2F63;
  --sps-modal-border: rgba(110, 79, 158, 0.55);
  --sps-input-bg: rgba(26, 26, 58, 0.75);
  --sps-primary: #f2b34c;
  --sps-primary-hover: #e38b2c;
  --sps-primary-text: #1a1a3a;
  --sps-link: #f5d37a;
  --sps-focus: rgba(245, 211, 122, 0.45);
  --sps-error: #ffb4a8;
  --sps-success: #8fd9a8;
  --sps-header-bg: #1a1a3a;
  --sps-toggle-icon: #f5d37a;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--sps-text);
  -webkit-font-smoothing: antialiased;
}

[data-sps-theme="light"] body {
  background: var(--sps-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(242, 179, 76, 0.22), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(44, 47, 99, 0.06), transparent 50%);
}

[data-sps-theme="dark"] body {
  background: var(--sps-bg);
  background-image:
    linear-gradient(180deg, #1a1a3a 0%, #2c2f63 38%, #2c2f63 68%, #4b3f79 100%),
    radial-gradient(ellipse 100% 70% at 50% -15%, rgba(242, 179, 76, 0.14), transparent 52%),
    radial-gradient(ellipse 75% 55% at 100% 100%, rgba(75, 63, 121, 0.4), transparent 55%);
}

.spslogin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 12px 18px 24px;
}

.spslogin__card {
  width: 100%;
  max-width: 400px;
  background: var(--sps-card-bg);
  border: 1px solid var(--sps-card-border);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(26, 26, 58, 0.04),
    0 12px 32px rgba(26, 26, 58, 0.08);
  padding: 22px 20px 20px;
  overflow: hidden;
}

.spslogin__brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

/* Top band — logo + product line centered together (extends to card edges). */
.spslogin__brand-banner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: calc(100% + 40px);
  margin: -22px -20px 8px;
  padding: 18px 22px 14px;
  border-radius: 16px 16px 0 0;
  background: radial-gradient(ellipse 120% 100% at 50% 0%, #2a1f4a 0%, #1a123d 45%, #121028 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-sps-theme="dark"] .spslogin__brand-banner {
  background: radial-gradient(ellipse 120% 100% at 50% 0%, #4b3f79 0%, #2c2f63 42%, #1f1b35 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Light theme: banner stays on deep purple — use luminous text like dark strip, not page heading tokens */
[data-sps-theme="light"] .spslogin__brand-banner {
  background: radial-gradient(ellipse 120% 100% at 50% 0%, #4a3f72 0%, #2f2858 42%, #1e1a32 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 1px 3px rgba(26, 26, 58, 0.1);
}

[data-sps-theme="light"] .spslogin__brand-banner .spslogin__product-name {
  color: #ffdfa3;
}

[data-sps-theme="light"] .spslogin__brand-banner .spslogin__product-by {
  color: #e2ddf0;
}

.spslogin__logo-wrap {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.spslogin__brand-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
}

.spslogin__product-name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--sps-heading);
  text-align: left;
}

.spslogin__product-by {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--sps-muted);
  text-align: left;
}

.spslogin__logo {
  display: block;
  width: min(64px, 28vw);
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.spslogin__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sps-heading);
}

.spslogin__subtitle {
  margin: 3px auto 0;
  max-width: 32ch;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--sps-muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Compact default; expands when a message is shown (no large empty gap). */
.spslogin__feedback {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  min-height: 0.375rem;
  margin: 2px 0 0;
}

.spslogin__message {
  margin: 0;
  padding: 6px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  border-radius: 8px;
  text-align: center;
}

.spslogin__message--error {
  color: var(--sps-error);
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
}

.spslogin__message--success {
  color: var(--sps-success);
  background: rgba(27, 110, 60, 0.08);
  border: 1px solid rgba(27, 110, 60, 0.22);
}

/* Hide login chrome until we know there is no session, or until account/summary succeeds (see index.html + main.js). */
html.spslogin--hydrating #spslogin-login-form,
html.spslogin--hydrating .spslogin__brand {
  display: none !important;
}

.spslogin__session-check {
  margin: 0 0 10px;
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  color: var(--sps-muted);
}

.spslogin__session-check.hidden {
  display: none;
}

/* Injected only after successful auth (see main.js). */
.spslogin-signed-in {
  text-align: center;
  margin-bottom: 16px;
}

.spslogin-signed-in__lead {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sps-heading);
}

.spslogin-signed-in__email {
  margin: 8px 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--sps-heading);
  word-break: break-all;
}

.spslogin-signed-in__out {
  padding: 8px 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sps-link);
  background: transparent;
  border: 1px solid var(--sps-input-border);
  border-radius: 8px;
  cursor: pointer;
}

.spslogin-signed-in__out:hover {
  background: var(--sps-bg-alt);
}

.spslogin-signed-in__admin {
  display: block;
  width: 100%;
  max-width: 20rem;
  margin: 0 auto 10px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--sps-heading);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.spslogin-signed-in__admin:hover:not(:disabled) {
  filter: brightness(1.06);
}

.spslogin-signed-in__admin:disabled {
  opacity: 0.65;
  cursor: wait;
}

.spslogin__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spslogin__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spslogin__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sps-heading);
}

.spslogin__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--sps-text);
  background: var(--sps-input-bg);
  border: 1px solid var(--sps-input-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.spslogin__input::placeholder {
  color: var(--sps-placeholder);
  opacity: 1;
}

.spslogin__input:hover {
  border-color: rgba(44, 47, 99, 0.42);
}

[data-sps-theme="dark"] .spslogin__input:hover {
  border-color: rgba(245, 211, 122, 0.42);
}

.spslogin__input:focus {
  outline: none;
  border-color: var(--sps-primary-hover);
  box-shadow: 0 0 0 3px var(--sps-focus);
}

/* Single fused control: field + toggle share one border (no default button chrome). */
.spslogin__input-wrap--password {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 44px;
  background: var(--sps-input-bg);
  border: 1px solid var(--sps-input-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spslogin__input-wrap--password:hover {
  border-color: rgba(44, 47, 99, 0.42);
}

[data-sps-theme="dark"] .spslogin__input-wrap--password:hover {
  border-color: rgba(245, 211, 122, 0.42);
}

.spslogin__input-wrap--password:focus-within {
  border-color: var(--sps-primary-hover);
  box-shadow: 0 0 0 3px var(--sps-focus);
}

.spslogin__input--with-toggle {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 10px 10px 14px;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.spslogin__input--with-toggle:focus {
  box-shadow: none;
}

.spslogin__pw-toggle-icons {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.spslogin__pw-icon {
  grid-area: 1 / 1;
  display: block;
  flex-shrink: 0;
}

.spslogin__pw-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  margin: 0;
  min-width: 2.75rem;
  min-height: 44px;
  padding: 0 10px;
  font: inherit;
  color: color-mix(in srgb, var(--sps-link) 87%, transparent);
  background: rgba(255, 255, 255, 0.18);
  border: none;
  border-left: 1px solid rgba(44, 47, 99, 0.045);
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.spslogin__pw-toggle:hover {
  background: rgba(44, 47, 99, 0.05);
}

.spslogin__pw-toggle:active {
  background: rgba(44, 47, 99, 0.08);
}

[data-sps-theme="dark"] .spslogin__pw-toggle {
  color: color-mix(in srgb, var(--sps-link) 92%, white);
  background: rgba(0, 0, 0, 0.22);
  border-left-color: rgba(255, 255, 255, 0.12);
}

[data-sps-theme="dark"] .spslogin__pw-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-sps-theme="dark"] .spslogin__pw-toggle:active {
  background: rgba(255, 255, 255, 0.12);
}

.spslogin__pw-toggle:focus {
  outline: none;
}

.spslogin__pw-toggle:focus-visible {
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--sps-focus);
}

.spslogin__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: -2px;
  padding: 2px 0 0;
  min-height: 2.75rem;
}

.spslogin__remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--sps-muted);
  cursor: pointer;
}

.spslogin__remember-label input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  transform: translateY(-2.5px);
  accent-color: var(--sps-link);
}

.spslogin__link--meta {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--sps-link);
  flex-shrink: 0;
}

.spslogin__link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sps-link);
  text-decoration: none;
}

.spslogin__link:hover {
  text-decoration: underline;
}

.spslogin__link:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--sps-focus);
}

.spslogin__actions {
  margin-top: 0;
}

.spslogin__submit {
  width: 100%;
  min-height: 2.75rem;
}

.spslogin__secondary {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.8125rem;
}

.spslogin__secondary .spslogin__link {
  font-weight: 600;
}

/* Link-styled buttons (Forgot password / Create account) — no default button chrome */
.spslogin__link-btn {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align: inherit;
  vertical-align: baseline;
}

.spslogin__link-btn:hover {
  text-decoration: underline;
}

.spslogin__link-btn:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--sps-focus);
}

.spslogin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.spslogin-modal.hidden {
  display: none;
}

.spslogin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 24, 0.45);
}

[data-sps-theme="dark"] .spslogin-modal__backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.spslogin-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: min(90dvh, 560px);
  overflow: auto;
  padding: 22px 20px 20px;
  background: var(--sps-modal-surface, var(--sps-card-bg));
  border: 1px solid var(--sps-modal-border, var(--sps-card-border));
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(26, 26, 58, 0.06),
    0 16px 40px rgba(26, 26, 58, 0.14);
}

[data-sps-theme="dark"] .spslogin-modal__panel {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.25),
    0 22px 56px rgba(0, 0, 0, 0.5);
}

.spslogin-modal__title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sps-heading);
}

.spslogin-modal__text {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--sps-muted);
}

.spslogin-modal__field {
  margin-bottom: 12px;
}

.spslogin-modal__msg {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.spslogin-modal__msg.hidden {
  display: none;
}

.spslogin-modal__msg--success {
  color: var(--sps-success);
}

.spslogin-modal__msg--error {
  color: var(--sps-error);
}

.spslogin-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.spslogin-modal__actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.spslogin-modal__btn {
  min-height: 2.5rem;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.spslogin-modal__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Modal button colors: css/sps-buttons.css */

/* Theme toggle (fixed bottom-left, same pattern as website-server sps-theme-toggle.js) */
.sps-theme-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--sps-header-bg);
  color: var(--sps-toggle-icon);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sps-theme-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sps-theme-toggle:focus {
  outline: 2px solid var(--sps-toggle-icon);
  outline-offset: 2px;
}

.sps-theme-toggle.sps-theme-toggle--hub-footer {
  position: relative;
  left: auto;
  bottom: auto;
  top: auto;
  z-index: 1;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

[data-sps-theme="dark"] .sps-theme-toggle.sps-theme-toggle--hub-footer {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* Theme toggle icons — matches desktop app v0.3/app */
.sps-theme-toggle-icons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  line-height: 1;
}

.sps-theme-toggle-icon {
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

html[data-sps-theme="light"] .sps-theme-toggle-icon--to-dark {
  display: flex;
}

html[data-sps-theme="dark"] .sps-theme-toggle-icon--to-light,
html:not([data-sps-theme="light"]) .sps-theme-toggle-icon--to-light {
  display: flex;
}

.sps-theme-toggle-icon .sps-ui-icon-img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

/* --- Authenticated product hub: dashboard layout + WP-style admin bar --- */
.spslogin--authenticated {
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  padding: 0;
  min-height: 100dvh;
}

.spslogin--authenticated .spslogin__card.spslogin__card--hub {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

[data-sps-theme="dark"] .spslogin--authenticated .spslogin__card.spslogin__card--hub {
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-sps-theme="dark"] .spslogin-hub__product {
  background: #383250;
  border-color: rgba(140, 120, 180, 0.38);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 10px 26px rgba(0, 0, 0, 0.28);
}

[data-sps-theme="dark"] .spslogin-hub__product-desc {
  color: #d8d3e8;
}

[data-sps-theme="dark"] .spslogin-hub__sub {
  color: #c9c3dc;
}

.spslogin-hub {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: min(100dvh, 100%);
  padding: 0;
  --spslogin-hub-footer-h: 48px;
}

.spslogin-hub__topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 clamp(12px, 3vw, 24px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #23282d;
  border: none;
  border-bottom: 1px solid #0a0a0b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.35);
  border-radius: 0;
}

.spslogin-hub__topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.spslogin-hub__toplogo {
  width: 32px;
  height: auto;
  border-radius: 6px;
  flex-shrink: 0;
}

.spslogin-hub__brand-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f0f0f1;
  line-height: 1.2;
}

.spslogin-hub__brand-strong {
  font-weight: 700;
}

.spslogin-hub__brand-light {
  font-weight: 500;
  opacity: 0.88;
}

.spslogin-hub__user-menu {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.spslogin-hub__user-trigger {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 320px);
  min-height: 46px;
  padding: 6px 8px 6px 12px;
  margin: 0;
  font: inherit;
  color: #f0f0f1;
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.spslogin-hub__user-id {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.spslogin-hub__user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #f0f0f1;
}

.spslogin-hub__user-email {
  font-size: 0.6875rem;
  line-height: 1.25;
  color: rgba(240, 240, 241, 0.78);
  max-width: min(240px, 48vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spslogin-hub__user-chevron {
  flex-shrink: 0;
  font-size: 0.625rem;
  line-height: 1;
  color: rgba(240, 240, 241, 0.55);
}

.spslogin-hub__user-trigger:hover,
.spslogin-hub__user-menu--open .spslogin-hub__user-trigger {
  background: rgba(240, 240, 241, 0.12);
}

.spslogin-hub__user-trigger:focus {
  outline: none;
}

.spslogin-hub__user-trigger:focus-visible {
  box-shadow:
    inset 0 0 0 2px #2271b1,
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.spslogin-hub__user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  min-width: 11.5rem;
  padding: 4px 0;
  margin: 0;
  background: #32373c;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.45);
  z-index: 1001;
}

.spslogin-hub__user-menu:hover .spslogin-hub__user-dropdown,
.spslogin-hub__user-menu:focus-within .spslogin-hub__user-dropdown,
.spslogin-hub__user-menu--open .spslogin-hub__user-dropdown {
  display: block;
}

.spslogin-hub__user-dropdown-signout,
.spslogin-hub__user-dropdown-admin {
  display: block;
  width: 100%;
  padding: 9px 16px;
  margin: 0;
  border: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: #f0f0f1;
  background: transparent;
}

.spslogin-hub__user-dropdown-signout:hover,
.spslogin-hub__user-dropdown-signout:focus,
.spslogin-hub__user-dropdown-admin:hover,
.spslogin-hub__user-dropdown-admin:focus {
  background: #2c3338;
  color: #72aee6;
  outline: none;
}

.spslogin-hub__user-dropdown-admin:disabled {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.spslogin-hub__user-dropdown-sep {
  height: 0;
  margin: 4px 0;
  padding: 0;
  border: none;
  border-top: 1px solid rgba(240, 240, 241, 0.18);
  pointer-events: none;
}

.spslogin-hub__main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1rem, 3vw, 1.75rem)
    calc(1.75rem + var(--spslogin-hub-footer-h, 48px));
}

.spslogin-hub__masthead {
  width: 100%;
  margin: 0 0 1.15rem;
}

.spslogin-hub__masthead--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

@media (min-width: 640px) {
  .spslogin-hub__masthead--split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: center;
  }
}

.spslogin-hub__masthead-studio,
.spslogin-hub__masthead-reader {
  min-width: 0;
}

.spslogin-hub__masthead-studio {
  display: flex;
  justify-content: flex-start;
}

.spslogin-hub__masthead-reader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.spslogin-hub__masthead--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.95rem, 3vw, 1.25rem);
}

.spslogin-hub__masthead--split .spslogin-hub__hero-brand-inner {
  margin-inline: 0;
  width: fit-content;
  max-width: 100%;
}

.spslogin-hub__masthead--split .spslogin-hub__greeting {
  margin: 0;
  width: 100%;
  font-size: clamp(1.35rem, 3.8vw, 1.95rem);
  text-align: center;
}

.spslogin-hub__masthead--stacked .spslogin-hub__greeting {
  margin: 0;
}

.spslogin-hub__masthead--stacked .spslogin-hub__hero-brand--stacked {
  justify-content: center;
}

.spslogin-hub__hero-brand {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
}

.spslogin-hub__hero-brand-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.875rem 1.125rem;
  max-width: 100%;
}

.spslogin-hub__hero-brand-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.spslogin-hub__hero-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  text-align: left;
  line-height: 1.28;
}

.spslogin-hub__hero-brand-title {
  font-size: clamp(1.05rem, 3.2vw, 1.4rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--sps-heading);
  align-self: flex-start;
  text-align: left;
  width: 100%;
}

.spslogin-hub__hero-brand-by {
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--sps-muted);
  align-self: flex-start;
  text-align: left;
  width: 100%;
}

.spslogin-hub__greeting {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--sps-heading);
}

.spslogin-hub__sub {
  margin: 0;
  padding: 0 0.5rem;
  text-align: center;
  font-size: clamp(0.9rem, 2.35vw, 1.05rem);
  font-weight: 500;
  max-width: min(100%, 22rem);
  line-height: 1.38;
  color: var(--sps-muted);
}

.spslogin-hub__masthead--stacked .spslogin-hub__sub {
  max-width: 44rem;
}

.spslogin-hub__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 0;
}

@media (min-width: 640px) {
  .spslogin-hub__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    align-items: stretch;
  }

  .spslogin-hub__grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 859px) {
  .spslogin-hub__grid--three .spslogin-hub__product:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 420px;
    width: 100%;
    justify-self: center;
  }
}

@media (min-width: 860px) {
  .spslogin-hub__grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .spslogin-hub__grid--three {
    gap: 22px;
  }
}

.spslogin-hub__product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 26px 20px 20px;
  border-radius: 12px;
  background: var(--sps-card-bg);
  border: 1px solid var(--sps-card-border);
  box-shadow:
    0 1px 2px rgba(26, 26, 58, 0.06),
    0 10px 28px rgba(26, 26, 58, 0.07);
}

.spslogin-hub__product-icon {
  align-self: center;
  flex-shrink: 0;
  width: clamp(120px, 52vw, 176px);
  height: clamp(120px, 52vw, 176px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.35rem;
  border-radius: 22px;
  color: #fff;
}

a.spslogin-hub__product-icon {
  text-decoration: none;
  color: inherit;
  outline-offset: 4px;
}

a.spslogin-hub__product-icon:focus-visible {
  outline: 2px solid var(--sps-link, #f5d37a);
}

.spslogin-hub__product-icon svg {
  width: min(96px, 58%);
  height: min(96px, 58%);
}

@media (min-width: 640px) {
  .spslogin-hub__product {
    padding: 28px 22px 22px;
  }

  .spslogin-hub__product-icon {
    width: clamp(176px, 22vw, 248px);
    height: clamp(176px, 22vw, 248px);
    margin-bottom: 1.5rem;
    border-radius: 28px;
  }

  .spslogin-hub__product-icon svg {
    width: min(120px, 52%);
    height: min(120px, 52%);
  }
}

.spslogin-hub__product--blue .spslogin-hub__product-icon:not(.spslogin-hub__product-icon--brand) {
  background: linear-gradient(145deg, #3d7ea8 0%, #2552d0 100%);
}

.spslogin-hub__product-icon.spslogin-hub__product-icon--brand {
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-sps-theme="dark"] .spslogin-hub__product-icon.spslogin-hub__product-icon--brand {
  box-shadow: none;
}

.spslogin-hub__product-icon--brand .spslogin-hub__product-brand-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

.spslogin-hub__product--green .spslogin-hub__product-icon:not(.spslogin-hub__product-icon--brand) {
  background: linear-gradient(145deg, #3fad7a 0%, #12824c 100%);
}

.spslogin-hub__product-desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--sps-muted);
  flex: 1 1 auto;
  text-align: center;
}

.spslogin-hub__product .spslogin-hub__cta {
  align-self: center;
  min-width: min(100%, 220px);
}

.spslogin-hub__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.1s ease;
}

.spslogin-hub__cta:hover {
  filter: none;
}

.spslogin-hub__cta:active {
  transform: scale(0.99);
}

[data-sps-theme="dark"] .spslogin-hub__cta--blue,
[data-sps-theme="dark"] .spslogin-hub__cta--green,
[data-sps-theme="dark"] .spslogin-hub__cta--violet {
  color: rgba(255, 235, 200, 0.95);
  background: rgba(242, 179, 76, 0.1);
  border-color: rgba(245, 211, 122, 0.38);
}

[data-sps-theme="dark"] .spslogin-hub__cta--blue:hover,
[data-sps-theme="dark"] .spslogin-hub__cta--green:hover,
[data-sps-theme="dark"] .spslogin-hub__cta--violet:hover {
  background: rgba(242, 179, 76, 0.2);
  border-color: rgba(255, 224, 160, 0.55);
  color: #fff;
}

[data-sps-theme="light"] .spslogin-hub__cta--blue,
[data-sps-theme="light"] .spslogin-hub__cta--green,
[data-sps-theme="light"] .spslogin-hub__cta--violet {
  color: var(--sps-heading);
  background: rgba(242, 179, 76, 0.14);
  border-color: rgba(44, 47, 99, 0.22);
}

[data-sps-theme="light"] .spslogin-hub__cta--blue:hover,
[data-sps-theme="light"] .spslogin-hub__cta--green:hover,
[data-sps-theme="light"] .spslogin-hub__cta--violet:hover {
  background: rgba(242, 179, 76, 0.26);
  border-color: rgba(44, 47, 99, 0.32);
}

.spslogin-hub__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--sps-bg, #1a1a3a), 0 0 0 4px var(--sps-focus, rgba(245, 211, 122, 0.45));
}

.spslogin-hub__cta-arrow {
  font-size: 1.1em;
  line-height: 1;
}

/* Fixed strip aligned with desktop app `.app-footer` (v0.3/app/src/index.html) */
.spslogin-hub-app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 920;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--spslogin-hub-footer-h, 48px);
  min-height: var(--spslogin-hub-footer-h, 48px);
  padding: 4px max(18px, env(safe-area-inset-left, 0px)) 4px max(18px, env(safe-area-inset-right, 0px));
  background: rgba(241, 236, 228, 0.96);
  border-top: 1px solid rgba(44, 47, 99, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: visible;
}

[data-sps-theme="dark"] .spslogin-hub-app-footer {
  background: rgba(26, 26, 58, 0.96);
  border-top-color: rgba(75, 63, 121, 0.5);
}

.spslogin-hub-app-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 8px 12px;
}

.spslogin-hub-app-footer__lead {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
}

.spslogin-hub-app-footer__center {
  grid-column: 2;
  min-width: 0;
  max-width: min(calc(100vw - 200px), 520px);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spslogin-hub-app-footer__copyright {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--sps-muted);
}

[data-sps-theme="dark"] .spslogin-hub-app-footer__copyright {
  color: #c8c1b6;
}

.spslogin-hub-app-footer__trail {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  min-height: 0;
}

.spslogin-hub-app-footer__aspen-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 1 auto;
}

.spslogin-hub-app-footer__aspen-slot .ws-aspen-chat-wrap {
  max-width: 100%;
}

.spslogin-hub-app-footer__aspen-slot .ws-aspen-chat-btn {
  max-width: min(280px, calc(100vw - 140px));
}

.spslogin-hub-app-footer__aspen {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.spslogin-hub-app-footer__aspen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(260px, 46vw);
  padding: 5px 11px;
  margin: 0;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--sps-primary-text);
  background: var(--sps-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.spslogin-hub-app-footer__aspen-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.spslogin-hub-app-footer__aspen-btn:focus {
  outline: none;
}

.spslogin-hub-app-footer__aspen-btn:focus-visible {
  box-shadow:
    0 0 0 2px var(--sps-focus),
    0 1px 4px rgba(0, 0, 0, 0.12);
}

.spslogin-hub-app-footer__aspen-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.spslogin-hub-app-footer__aspen-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-sps-theme="dark"] .spslogin-hub-app-footer__aspen-btn {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .spslogin-hub-app-footer__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .spslogin-hub-app-footer__center {
    max-width: none;
    min-width: 0;
  }

  .spslogin-hub-app-footer__copyright {
    font-size: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .spslogin-hub-app-footer__aspen-btn {
    max-width: 38vw;
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* Full-screen busy overlay (parity with desktop app #sps-global-info-modal progress). */
.sps-action-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.sps-action-busy-overlay.hidden {
  display: none !important;
}

.sps-action-busy-overlay:focus {
  outline: none;
}

.sps-action-busy-overlay:focus-visible {
  outline: 2px solid var(--sps-focus);
  outline-offset: 4px;
}

.sps-action-busy-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 10, 36, 0.72);
  backdrop-filter: blur(4px);
}

[data-sps-theme="light"] .sps-action-busy-overlay__backdrop {
  background: rgba(26, 26, 58, 0.45);
}

.sps-action-busy-overlay__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 44px 32px;
  border-radius: 18px;
  max-width: min(90vw, 440px);
  width: 100%;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--sps-card-bg) 94%, transparent);
  border: 1px solid var(--sps-card-border);
  border-left-width: 4px;
  border-left-color: color-mix(in srgb, var(--sps-primary, #f0a046) 50%, var(--sps-card-border));
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
}

.sps-action-busy-overlay__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.sps-action-busy-overlay__logo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.sps-action-busy-overlay__heading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.sps-action-busy-overlay__title {
  margin: 14px 0 0;
  font-family:
    ui-serif,
    "Iowan Old Style",
    "Palatino Linotype",
    Palatino,
    Georgia,
    "Times New Roman",
    serif;
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--sps-heading);
}

.sps-action-busy-overlay__brand {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--sps-muted);
}

.sps-action-busy-overlay__detail {
  margin: 14px 0 0;
  max-width: 26rem;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--sps-muted);
  word-break: break-word;
}

.sps-action-busy-overlay__detail.hidden {
  display: none !important;
}

.sps-action-busy-overlay__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.sps-action-busy-overlay__dots.hidden {
  display: none !important;
}

.sps-action-busy-overlay__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    var(--sps-primary) 0%,
    color-mix(in srgb, var(--sps-primary-hover) 55%, var(--sps-link) 45%) 100%
  );
  animation: sps-action-busy-dot 1.15s ease-in-out infinite;
}

.sps-action-busy-overlay__dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.sps-action-busy-overlay__dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes sps-action-busy-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.52;
  }

  40% {
    transform: translateY(-9px);
    opacity: 1;
  }
}

/* Dark theme: denser card, higher text contrast, dots read as gold (not pink at low opacity). */
[data-sps-theme="dark"] .sps-action-busy-overlay__backdrop {
  background: rgba(8, 6, 22, 0.82);
  backdrop-filter: blur(7px);
}

[data-sps-theme="dark"] .sps-action-busy-overlay__card {
  background: rgba(26, 26, 58, 0.94);
  border: 1px solid color-mix(in srgb, var(--sps-card-border) 85%, rgba(242, 179, 76, 0.28));
  border-left-width: 3px;
  border-left-color: color-mix(in srgb, var(--sps-primary) 82%, transparent);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(245, 211, 122, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-sps-theme="dark"] .sps-action-busy-overlay__brand {
  color: color-mix(in srgb, var(--sps-muted) 42%, var(--sps-text) 58%);
}

[data-sps-theme="dark"] .sps-action-busy-overlay__detail {
  color: color-mix(in srgb, var(--sps-text) 92%, var(--sps-muted) 8%);
}

[data-sps-theme="dark"] .sps-action-busy-overlay__dots span {
  background: linear-gradient(
    145deg,
    var(--sps-primary) 0%,
    color-mix(in srgb, var(--sps-primary-hover) 88%, var(--sps-primary) 12%) 100%
  );
  box-shadow: 0 0 16px color-mix(in srgb, var(--sps-primary) 42%, transparent);
}

@keyframes spslogin-login-card-shake-error {
  0%,
  100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-8px);
  }

  36% {
    transform: translateX(8px);
  }

  54% {
    transform: translateX(-5px);
  }

  72% {
    transform: translateX(5px);
  }
}

#spslogin-login-card.spslogin-login-card--error-shake {
  animation: spslogin-login-card-shake-error 0.42s ease;
}

.spslogin__submit:disabled {
  opacity: 0.72;
  cursor: progress;
}

.spslogin__submit:focus-visible:not(:disabled) {
  outline: 2px solid var(--sps-focus);
  outline-offset: 2px;
}
