/* Account surfaces only. ID scoping intentionally outranks legacy workspace
   button selectors without changing shared tokens or other business modules. */
:is(#authView, #profilePage) {
  --account-ink: #142540;
  --account-muted: #64748b;
  --account-blue: #2563eb;
  --account-border: #dce4ef;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--account-ink);
  line-height: 1.6;
}
:is(#authView, #profilePage) button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--account-border);
  border-radius: 10px;
  background: #fff;
  color: #34445e;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
:is(#authView, #profilePage) button:hover:not(:disabled) {
  background: #eff5ff;
  border-color: #b6cced;
  color: #1d4ed8;
  box-shadow: none;
  transform: none;
}
:is(#authView, #profilePage) button:active:not(:disabled) { transform: none; }
:is(#authView, #profilePage) button:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
  transform: none;
}
:is(#authView, #profilePage) button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 10px rgb(37 99 235 / 12%);
}
:is(#authView, #profilePage) button.primary:hover:not(:disabled) {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 6px 16px rgb(37 99 235 / 18%);
}
:is(#authView, #profilePage) button:disabled {
  background: #edf1f6;
  border-color: #e1e7ef;
  color: #69778b;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}
:is(#authView, #profilePage) .field { display: flex; flex-direction: column; gap: 9px; }
:is(#authView, #profilePage) .field > span { color: #34445e; font-size: 13px; font-weight: 600; }
:is(#authView, #profilePage) input,
:is(#authView, #profilePage) select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--account-border);
  border-radius: 10px;
  background: #fff;
  color: var(--account-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
}
:is(#authView, #profilePage) input::placeholder { color: #8491a4; opacity: 1; }
:is(#authView, #profilePage) input:focus,
:is(#authView, #profilePage) select:focus {
  border-color: #6098f5;
  outline: none;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}
:is(#authView, #profilePage) input:disabled { background: #f4f7fb; color: #64748b; opacity: 1; }
:is(#authView, #profilePage) .auth-message { margin: 14px 0 0; min-height: 0; font-size: 13px; overflow-wrap: anywhere; }
:is(#authView, #profilePage) .auth-message:empty { display: none; }

/* Login: an integrated brand canvas, with a quiet, task-focused form. */
#authView { grid-template-columns: minmax(0, 1.08fr) minmax(460px, 1fr); min-height: 100vh; min-height: 100svh; }
#authView .auth-visual-panel {
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(40px, 5vw, 88px);
  align-items: center;
  background: radial-gradient(ellipse at 5% 8%, #124b72 0, transparent 55%),
              radial-gradient(ellipse at 94% 95%, #24396b 0, transparent 60%), #0b1c35;
}
#authView .auth-visual-copy { position: static; width: 100%; max-width: 700px; padding-top: 100px; padding-bottom: 65px; }
#authView .auth-mark {
  position: absolute;
  top: clamp(36px, 4.5vw, 72px);
  left: clamp(40px, 5vw, 88px);
  width: clamp(220px, 19vw, 310px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#authView .auth-mark img { width: 100%; height: auto; max-height: none; }
#authView .auth-visual-kicker { margin: 35px 0 22px; color: #8dc9ed; font-size: 11px; letter-spacing: .19em; }
#authView .auth-visual-copy h1 { max-width: 700px; font-size: clamp(34px, 3.25vw, 60px); line-height: 1.38; letter-spacing: -.04em; text-wrap: balance; }
#authView .auth-visual-copy h1 em { color: #88d6ff; }
#authView .auth-visual-copy > p:not(.auth-visual-kicker) { max-width: 510px; margin-top: 24px; color: #b5c5dc; font-size: 15px; line-height: 1.9; }
#authView .auth-visual-status { position: absolute; left: clamp(40px, 5vw, 88px); bottom: 42px; margin: 0; color: #b5c5dc; font-size: 12px; }
#authView .auth-visual-grid { opacity: .15; }
#authView .auth-visual-orbit { opacity: .42; pointer-events: none; }
#authView .orbit-one { top: 22%; right: -35%; }
#authView .orbit-two { bottom: 5%; left: -35%; }
#authView .auth-visual-floating { display: none; }
#authView .auth-panel { padding: 56px clamp(32px, 5vw, 100px); background: #fff; }
#authView .auth-card { width: 100%; max-width: 420px; padding: 0; border: 0; background: transparent; box-shadow: none; }
#authView .auth-brand { margin-bottom: 30px; }
#authView .auth-brand-logo { display: none; width: 185px; height: auto; margin-bottom: 32px; }
#authView .auth-eyebrow { display: block; margin-bottom: 12px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
#authView .auth-brand h2 { margin: 0; color: #142540; font-size: 34px; font-weight: 750; line-height: 1.4; letter-spacing: -.04em; }
#authView .auth-brand p { margin-top: 10px; color: #64748b; font-size: 14px; }
#authView .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 28px; padding: 5px; border: 1px solid #e8edf5; border-radius: 12px; background: #f2f5fa; }
#authView button.auth-tab { min-width: 0; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 8px; background: transparent; color: #64748b; box-shadow: none; }
#authView button.auth-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 2px 6px rgb(28 49 84 / 9%); }
#authView button.auth-tab:hover:not(:disabled) { background: #e6edf8; color: #1d4ed8; }
#authView button.auth-tab.active:hover:not(:disabled) { background: #fff; }
#authView .field { margin: 0 0 22px; }
#authView .field small { margin-left: 5px; color: #7b8799; font-size: 11px; font-weight: 400; }
#authView input { min-height: 52px; padding: 14px 15px; }
#authView .auth-password-wrap { position: relative; display: block; }
#authView .auth-password-wrap input { padding-right: 72px; }
#authView button.auth-password-toggle { position: absolute; right: 5px; top: 5px; min-height: 42px; padding: 8px 12px; border: 0; background: transparent; color: #64748b; font-size: 12px; }
#authView button.auth-submit { width: 100%; min-height: 52px; margin-top: 6px; padding: 14px 20px; font-size: 15px; letter-spacing: .06em; }
#authView .invite-preview { margin-bottom: 22px; padding: 14px 16px; border: 1px solid #dce8fa; border-radius: 10px; background: #f0f6ff; color: #496385; font-size: 13px; overflow-wrap: anywhere; }
#authView .auth-footnote { gap: 10px; margin-top: 32px; color: #7b8799; font-size: 11px; }

/* Account center: readable navigation and one consistent hierarchy of actions. */
#profilePage { grid-template-columns: 244px minmax(0, 1fr); background: #f4f7fb; }
#profilePage .profile-sidebar { position: sticky; top: 0; align-self: start; height: 100vh; min-height: 620px; padding: 36px 18px 22px; background: #0d203c; }
#profilePage .profile-brand { width: 100%; padding: 4px 9px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#profilePage .profile-brand img { width: 100%; height: auto; max-height: none; }
#profilePage .profile-side-caption { margin: 48px 16px 16px; color: #8ca6c6; font-size: 11px; letter-spacing: .08em; }
#profilePage .profile-nav { gap: 8px; }
#profilePage button.profile-nav-item { justify-content: flex-start; gap: 13px; width: 100%; min-height: 49px; padding: 13px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #c5d3e8; text-align: left; font-size: 14px; font-weight: 500; box-shadow: none; }
#profilePage .profile-nav-icon { width: 19px; height: 19px; flex: 0 0 19px; color: #92afd3; }
#profilePage .profile-nav-label { width: auto; color: inherit; font-size: inherit; text-align: left; white-space: nowrap; }
#profilePage button.profile-nav-item:hover { background: #193454; color: #fff; border-color: transparent; }
#profilePage button.profile-nav-item.active { background: #214776; color: #fff; border-color: #325984; box-shadow: inset 3px 0 #70c8ff; font-weight: 650; }
#profilePage .profile-nav-item.active .profile-nav-icon { color: #8cd6ff; }
#profilePage .profile-sidebar-bottom { padding: 18px 12px 0; color: #a4bad6; font-size: 11px; }
#profilePage .profile-topbar { min-height: 76px; gap: 16px; padding: 14px clamp(24px, 3vw, 48px); background: #fff; }
#profilePage button.profile-back-button { padding: 9px 12px; border-color: transparent; background: transparent; color: #455c7a; font-size: 13px; }
#profilePage .profile-breadcrumb { color: #64748b; font-size: 12px; }
#profilePage .profile-top-actions { gap: 18px; min-width: 0; color: #64748b; }
#profilePage #profileTopEmail { overflow-wrap: anywhere; }
#profilePage #profilePageLogout { min-height: 40px; padding: 9px 16px; font-size: 12px; }
#profilePage .profile-content { max-width: 1320px; padding: 42px clamp(24px, 3.5vw, 56px) 64px; }
#profilePage .profile-heading { flex-direction: row; align-items: center; margin-bottom: 28px; }
#profilePage .profile-eyebrow { color: #657b98; font-size: 10px; letter-spacing: .16em; }
#profilePage .profile-heading h1 { margin: 8px 0; font-size: 32px; line-height: 1.4; letter-spacing: -.035em; }
#profilePage .profile-heading p { color: #64748b; font-size: 13px; line-height: 1.8; }
#profilePage .profile-avatar { flex-shrink: 0; width: 50px; height: 50px; border-radius: 15px; background: #2563eb; box-shadow: 0 6px 14px rgb(37 99 235 / 15%); }
#profilePage .profile-overview-grid { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
#profilePage :is(.profile-hero-card, .profile-stat-card, .profile-panel-card, .billing-placeholder) { min-width: 0; border: 1px solid #e0e7f0; border-radius: 16px; box-shadow: 0 4px 16px rgb(24 45 79 / 3%); overflow-wrap: anywhere; }
#profilePage .profile-hero-card { padding: 24px 26px; background: linear-gradient(120deg, #17375f, #225386); border-color: transparent; }
#profilePage .profile-hero-card h2 { margin: 16px 0 6px; font-size: 21px; line-height: 1.5; color: #fff; }
#profilePage .profile-hero-card p { color: #c7d9ee; }
#profilePage .profile-card-label { color: #bbd5f2; font-size: 12px; }
#profilePage .profile-card-footer { margin-top: 24px; color: #d8e9fa; font-size: 11px; }
#profilePage .profile-stat-card { padding: 24px; min-height: 172px; }
#profilePage .profile-stat-card > span { color: #64748b; font-size: 12px; }
#profilePage .profile-stat-card > strong { margin: 14px 0 10px; font-size: 19px; }
#profilePage .profile-stat-card > small { color: #64748b; font-size: 12px; }
#profilePage .profile-panel-grid { grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr); gap: 24px; }
#profilePage .profile-panel-card { padding: 28px; }
#profilePage .profile-panel-title { align-items: center; margin-bottom: 24px; }
#profilePage .profile-panel-title h2, #profilePage .profile-quick-card h2 { font-size: 18px; }
#profilePage .profile-form-grid { gap: 22px 18px; }
#profilePage #saveProfileButton { margin-top: 26px; min-width: 120px; }
#profilePage .profile-quick-card { background: linear-gradient(155deg, #eaf2fe, #fff); display: flex; align-items: flex-start; flex-direction: column; }
#profilePage .profile-quick-card p { margin: 18px 0 26px; color: #5b708c; font-size: 13px; }
#profilePage button.profile-link-button { margin-top: auto; border-color: #ccdcf4; background: #fff; color: #1d4ed8; font-size: 13px; }
#profilePage .profile-member-limit { color: #275a9d; white-space: nowrap; }
#profilePage .team-member-row { gap: 16px; padding: 16px; border-radius: 10px; }
#profilePage .team-member-row > div { min-width: 0; }
#profilePage .team-member-row button { flex-shrink: 0; min-height: 38px; padding: 8px 14px; font-size: 12px; }
#profilePage .team-member-row small { margin-top: 5px; }
#profilePage .team-invite-row { gap: 12px; margin-top: 22px; }
#profilePage .team-invite-row .primary { margin-top: 0; }
#profilePage .team-logs { max-height: 65vh; }
#profilePage .team-log-row { padding: 16px 4px; font-size: 13px; line-height: 1.8; }
#profilePage button.danger { background: #fff5f4; border-color: #f0c7c3; color: #a53731; }
#profilePage button.danger:hover:not(:disabled) { background: #fee9e7; border-color: #df9c96; color: #912b25; }
#profilePage .security-row > div > span { color: #64748b; line-height: 1.7; }
#profilePage .billing-placeholder p { color: #64748b; }

@media (min-width: 901px) and (max-width: 1150px) {
  #authView .auth-visual-panel { padding: 40px; }
  #authView .auth-mark, #authView .auth-visual-status { left: 40px; }
  #authView .auth-visual-copy h1 { font-size: 34px; }
  #profilePage { grid-template-columns: 218px minmax(0, 1fr); }
  #profilePage .profile-overview-grid { grid-template-columns: 1fr 1fr; }
  #profilePage .profile-hero-card { grid-column: 1 / -1; }
  #profilePage .profile-panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #authView { grid-template-columns: 1fr; background: #fff; }
  #authView .auth-visual-panel { display: none; }
  #authView .auth-panel { min-height: 100svh; padding: 44px 28px; }
  #authView .auth-brand-logo { display: block; }
  #authView .auth-eyebrow { display: none; }
  #profilePage { grid-template-columns: 1fr; }
  #profilePage .profile-sidebar { position: static; height: auto; min-height: 0; padding: 20px; }
  #profilePage .profile-brand { width: 190px; padding: 0; }
  #profilePage .profile-side-caption, #profilePage .profile-sidebar-bottom { display: none; }
  #profilePage .profile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; gap: 5px; margin-top: 22px; }
  #profilePage button.profile-nav-item { justify-content: center; flex-direction: column; gap: 8px; min-height: 68px; padding: 10px 4px; font-size: 12px; }
  #profilePage button.profile-nav-item.active { box-shadow: inset 0 -3px #70c8ff; }
  #profilePage .profile-topbar { padding: 14px 24px; }
  #profilePage .profile-content { padding: 30px 24px 48px; }
  #profilePage .profile-panel-grid { grid-template-columns: 1fr; }
  #profilePage .profile-overview-grid { grid-template-columns: 1fr 1fr; }
  #profilePage .profile-hero-card { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  #authView .auth-panel { align-items: start; padding: 36px 24px; }
  #authView .auth-brand h2 { font-size: 29px; }
  #authView .auth-brand-logo { width: 170px; margin-bottom: 32px; }
  #authView .auth-brand { margin-bottom: 26px; }
  #authView input { font-size: 16px; }
  #authView .auth-footnote { margin-top: 28px; }
  #profilePage .profile-sidebar { padding: 22px 12px 14px; }
  #profilePage .profile-brand { margin-left: 10px; width: 175px; }
  #profilePage .profile-nav { gap: 3px; }
  #profilePage button.profile-nav-item { padding: 10px 2px; font-size: 11px; }
  #profilePage .profile-topbar { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 18px 14px; }
  #profilePage .profile-breadcrumb { margin-left: 8px; }
  #profilePage .profile-top-actions { justify-content: space-between; gap: 10px; }
  #profilePage .profile-content { padding: 26px 18px 40px; }
  #profilePage .profile-heading { align-items: flex-start; gap: 12px; }
  #profilePage .profile-heading h1 { font-size: 27px; }
  #profilePage .profile-heading p { font-size: 12px; }
  #profilePage .profile-avatar { width: 42px; height: 42px; font-size: 18px; border-radius: 12px; }
  #profilePage .profile-overview-grid { gap: 12px; margin-bottom: 18px; }
  #profilePage .profile-hero-card { padding: 22px; }
  #profilePage .profile-hero-card h2 { font-size: 20px; }
  #profilePage .profile-stat-card { min-height: 148px; padding: 18px 14px; }
  #profilePage .profile-stat-card > strong { font-size: 16px; }
  #profilePage .profile-stat-card > small { font-size: 11px; }
  #profilePage .profile-panel-grid { gap: 18px; }
  #profilePage .profile-panel-card { padding: 22px; }
  #profilePage .profile-form-grid { grid-template-columns: 1fr; gap: 20px; }
  #profilePage .profile-member-limit { white-space: normal; max-width: 105px; text-align: center; }
  #profilePage .team-member-row { flex-wrap: wrap; }
  #profilePage .team-invite-row { flex-direction: column; }
  #profilePage .security-row { gap: 12px; align-items: flex-start; }
  #profilePage .security-row button { flex-shrink: 0; padding: 10px; }
  #profilePage .billing-placeholder { padding: 38px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #authView .auth-visual-grid, #authView .auth-visual-orbit { animation: none; }
  :is(#authView, #profilePage) button { transition: none; }
}
/* Visibility is owned by the existing authentication/role logic, not layout. */
:is(#authView, #profilePage) .hidden,
:is(#authView, #profilePage) [hidden] { display: none !important; }

/* 2026-09-28: auth and account-center finishing layer. Keep all selectors
   within the two account surfaces; workspace modules retain their styling. */
#authView {
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr);
  background: #0b1c35;
}
#authView .auth-visual-panel {
  background:
    radial-gradient(ellipse at 92% 33%, rgba(24, 120, 166, .31), transparent 42%),
    radial-gradient(ellipse at 82% 89%, rgba(49, 56, 139, .29), transparent 48%),
    linear-gradient(150deg, #071a31 5%, #07172c 55%, #101a38 100%);
}
#authView .auth-mark {
  width: clamp(250px, 20vw, 340px);
  filter: drop-shadow(0 12px 25px rgba(2, 13, 31, .2));
}
#authView .auth-mark img,
#profilePage .profile-brand img { display: block; width: 100%; height: auto; object-fit: contain; }
#authView .auth-visual-copy { max-width: 670px; padding-top: 78px; }
#authView .auth-visual-kicker { margin-bottom: 20px; }
#authView .auth-visual-copy h1 { font-weight: 800; line-height: 1.2; }
#authView .auth-panel {
  background: radial-gradient(circle at 96% 3%, #eaf2ff 0, transparent 37%), #f7f9fd;
  padding: 48px clamp(28px, 5vw, 94px);
}
#authView .auth-card {
  max-width: 466px;
  padding: clamp(28px, 3.2vw, 48px);
  border: 1px solid #e2e9f3;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(22, 45, 79, .09), 0 2px 8px rgba(22, 45, 79, .03);
}
#authView .auth-brand { margin-bottom: 28px; }
#authView .auth-mobile-brand { display: none; }
#authView .auth-eyebrow { margin-bottom: 10px; color: #52729b; }
#authView .auth-brand h2 { font-size: clamp(29px, 2.1vw, 36px); line-height: 1.3; }
#authView .auth-brand p { margin: 8px 0 0; line-height: 1.7; }
#authView .auth-tabs { margin-bottom: 26px; }
#authView button.auth-tab { min-height: 44px; font-weight: 650; }
#authView .field { gap: 9px; margin-bottom: 19px; }
#authView .field > span { line-height: 1.5; }
#authView .field small { display: inline-block; margin-left: 4px; }
#authView input { min-height: 51px; }
#authView button.auth-submit {
  min-height: 54px;
  margin-top: 9px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .03em;
}
#authView button.auth-submit:disabled { background: #9ab9ee; color: #fff; border-color: #9ab9ee; }
#authView .auth-footnote { margin-top: 26px; }
#authView .auth-message:not(:empty) { padding: 9px 11px; border-radius: 8px; background: #fff2f3; }

#profilePage { grid-template-columns: 260px minmax(0, 1fr); }
#profilePage .profile-sidebar { padding: 34px 18px 23px; }
#profilePage .profile-brand { width: 218px; margin: 0 auto; padding: 0; }
#profilePage .profile-side-caption { margin: 52px 12px 14px; color: #9fb9d8; }
#profilePage .profile-nav { display: grid; gap: 7px; }
#profilePage button.profile-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #d4e3f5;
  text-align: left;
  line-height: 1.45;
}
#profilePage button.profile-nav-item.active { color: #fff; background: #204677; }
#profilePage button.profile-nav-item:hover:not(:disabled) { background: #1d3b60; color: #fff; border-color: #365a83; }
#profilePage button.profile-nav-item.active:hover:not(:disabled) { background: #265184; }
#profilePage .profile-nav-icon { flex: 0 0 20px; width: 20px; height: 20px; color: #8cceff; }
#profilePage .profile-nav-item .profile-nav-label {
  display: inline-block;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  color: inherit;
  font-size: 14px;
  font-weight: inherit;
  text-align: left;
  opacity: 1;
}
#profilePage .profile-nav-item.active .profile-nav-label { color: #fff; }
#profilePage .profile-topbar { border-bottom: 1px solid #e0e8f2; }
#profilePage .profile-content { width: 100%; }

@media (min-width: 901px) and (max-width: 1150px) {
  #profilePage { grid-template-columns: 228px minmax(0, 1fr); }
  #profilePage .profile-brand { width: 190px; }
  #authView .auth-card { padding: 30px; }
}
@media (max-width: 900px) {
  #profilePage { grid-template-columns: minmax(0, 1fr); }
  #authView { grid-template-columns: 1fr; background: #f7f9fd; }
  #authView .auth-panel { min-height: 100svh; padding: 32px 22px; }
  #authView .auth-card { max-width: 480px; padding: 32px; }
  #authView .auth-mobile-brand { display: block; margin-bottom: 27px; color: #103261; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
  #authView .auth-mobile-brand small { display: block; margin-top: 1px; color: #617895; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
  #profilePage .profile-sidebar { padding: 20px; }
  #profilePage .profile-brand { width: 190px; margin: 0; }
  #profilePage button.profile-nav-item { justify-content: center; gap: 6px; padding: 8px 3px; }
  #profilePage .profile-nav-item .profile-nav-label { flex: 0 1 auto; width: auto; font-size: 12px; text-align: center; }
}
@media (max-width: 560px) {
  #authView .auth-panel { padding: 24px 14px; }
  #authView .auth-card { padding: 26px 20px; border-radius: 18px; }
  #authView .auth-mobile-brand { margin-bottom: 22px; }
  #profilePage .profile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #profilePage button.profile-nav-item { white-space: normal; min-height: 64px; }
  #profilePage .profile-nav-item .profile-nav-label { font-size: 11px; line-height: 1.25; white-space: normal; }
}
/* The interaction is a light source, not a permanent layer of UI. */
#authView .auth-visual-panel::before {
  z-index: 0;
  opacity: 1;
  inset: -15%;
  background:
    radial-gradient(ellipse at 93% 29%, rgba(75, 193, 228, .13), transparent 31%),
    radial-gradient(ellipse at 71% 89%, rgba(84, 91, 207, .14), transparent 40%);
  filter: blur(38px);
  transform: none;
  animation: authAmbient 12s ease-in-out infinite alternate;
}
#authView .auth-visual-panel::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(124deg, transparent 0 57%, rgba(103, 202, 230, .045) 57.1% 57.3%, transparent 57.5% 100%);
  opacity: .6;
}
@keyframes authAmbient {
  from { transform: translate3d(-2%, 1%, 0) scale(1); }
  to { transform: translate3d(2%, -2%, 0) scale(1.08); }
}
#authView .auth-particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Keep the absolute logo anchored to the full panel. */
#authView .auth-visual-copy { position: static; z-index: auto; }
#authView .auth-visual-kicker,
#authView .auth-visual-copy h1,
#authView .auth-visual-copy > p:not(.auth-visual-kicker) { position: relative; z-index: 2; }
#authView .auth-mark,
#authView .auth-visual-status { z-index: 2; }
@media (prefers-reduced-motion: reduce) {
  #authView .auth-visual-panel::before { animation: none; }
}

/* React Bits GlowCursor canvas layer; the login card on the right is untouched. */
#authView .auth-particle-canvas { display: block; mix-blend-mode: screen; user-select: none; }

/* Restore the first auth design's orbit satellites behind the GlowCursor layer. */
#authView .auth-visual-orbit { z-index: 0; }

/* Idle scene: quiet radar sweep + drifting data points, kept behind the text
   and the React Bits pointer trail. No effect extends into the form panel. */
#authView .auth-space-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#authView .auth-space-field::before {
  content: "";
  position: absolute;
  inset: -12%;
  opacity: .72;
  background:
    radial-gradient(circle at 13% 22%, #9bd6ff 0 1px, transparent 2px),
    radial-gradient(circle at 72% 12%, #73c5f9 0 1px, transparent 2px),
    radial-gradient(circle at 89% 36%, #87e3ff 0 1.4px, transparent 2.6px),
    radial-gradient(circle at 36% 73%, #9fbbff 0 1px, transparent 2px),
    radial-gradient(circle at 64% 82%, #79cbff 0 1.4px, transparent 2.6px),
    radial-gradient(circle at 91% 88%, #af9bff 0 1px, transparent 2px),
    radial-gradient(circle at 22% 54%, #8bc9ff 0 1px, transparent 2px);
  filter: drop-shadow(0 0 5px rgba(98, 210, 255, .75));
  animation: authStarDrift 9s ease-in-out infinite alternate;
}
#authView .auth-space-field::after {
  content: "";
  position: absolute;
  inset: -22%;
  opacity: .7;
  background: linear-gradient(115deg, transparent 39%, rgba(93, 186, 238, .015) 45%, rgba(82, 191, 246, .10) 50%, rgba(94, 129, 238, .035) 54%, transparent 61%);
  transform: translateX(-72%);
  animation: authSignalSweep 12s ease-in-out infinite;
}
#authView .orbit-one::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 305deg, rgba(86, 196, 246, .025) 322deg, rgba(105, 220, 255, .16) 355deg, transparent 360deg);
  filter: blur(8px);
  animation: authRadarSweep 11s linear infinite;
}
/* Dots follow the visible arc of each ellipse rather than only pulsating in place. */
#authView .orbit-one::after { animation: authOrbitSatelliteOne 10s ease-in-out infinite alternate; }
#authView .orbit-two::after { animation: authOrbitSatelliteTwo 13s ease-in-out infinite alternate; animation-delay: -4s; }
@keyframes authOrbitSatelliteOne {
  0% { left: 29%; top: -5px; transform: scale(.85); opacity: .72; }
  48% { left: -1%; top: 45%; transform: scale(1.22); opacity: 1; }
  100% { left: 29%; top: calc(100% - 5px); transform: scale(.92); opacity: .75; }
}
@keyframes authOrbitSatelliteTwo {
  0% { right: 18%; bottom: -5px; transform: scale(.9); opacity: .7; }
  52% { right: -1%; bottom: 47%; transform: scale(1.18); opacity: 1; }
  100% { right: 23%; bottom: calc(100% - 5px); transform: scale(.85); opacity: .68; }
}
@keyframes authRadarSweep { to { transform: rotate(360deg); } }
@keyframes authStarDrift {
  from { transform: translate3d(-14px, 22px, 0); opacity: .38; }
  to { transform: translate3d(22px, -28px, 0); opacity: .78; }
}
@keyframes authSignalSweep {
  0%, 8% { transform: translateX(-72%); opacity: 0; }
  21% { opacity: .65; }
  64% { opacity: .65; }
  78%, 100% { transform: translateX(72%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #authView .auth-space-field::before,
  #authView .auth-space-field::after,
  #authView .orbit-one::before,
  #authView .auth-visual-orbit::after { animation: none; }
  #authView .auth-space-field::after { opacity: 0; }
}
