/* XYJ-UI-CLOUD-002. Portals use the same color and surface roles as the workspace. */
:root {
  --xyj-brand: #414edb;
  --xyj-ink: #162744;
  --xyj-muted: #52647b;
  --xyj-canvas: #f4f6fa;
  --xyj-line: #dce3ee;
  --xyj-gold: #805918;
  --xyj-success: #17634c;
  --xyj-portal-white: #fff;
  --xyj-portal-tint: #e9edff;
  --xyj-portal-hover: #323ebc;
  --xyj-portal-field: #f8fafd;
  --xyj-portal-warn: #fbf5e7;
  --xyj-portal-positive: #eaf6f0;
  --xyj-portal-danger: #a53a44;
  --xyj-portal-danger-tint: #fff2f3;
  --xyj-portal-shadow: 0 14px 42px rgb(22 39 68 / 8%);
  background: var(--xyj-canvas);
  color: var(--xyj-ink);
}

:is(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace)) {
  --navy: var(--xyj-ink);
  --ink: var(--xyj-ink);
  --muted: var(--xyj-muted);
  --paper: var(--xyj-canvas);
  --line: var(--xyj-line);
  --gold: var(--xyj-gold);
  --green: var(--xyj-success);
  --red: var(--xyj-portal-danger);
  color: var(--xyj-ink);
  background: var(--xyj-canvas);
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  accent-color: var(--xyj-brand);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--xyj-brand);
  outline-offset: 3px;
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(input:not([type='checkbox'], [type='radio'], [type='hidden']), select, textarea) {
  min-inline-size: 0;
  border-color: var(--xyj-line);
  color: var(--xyj-ink);
  background-color: var(--xyj-portal-field);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(input, select, textarea):focus {
  border-color: var(--xyj-brand);
  box-shadow: 0 0 0 3px var(--xyj-portal-tint);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(input, textarea)::placeholder {
  color: var(--xyj-muted);
  opacity: 1;
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.primary, .button.primary):not(:disabled, [aria-disabled='true']) {
  border-color: var(--xyj-brand);
  border-radius: 12px;
  color: var(--xyj-portal-white);
  background: var(--xyj-brand);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.primary, .button.primary):hover:not(:disabled, [aria-disabled='true']) {
  border-color: var(--xyj-portal-hover);
  background: var(--xyj-portal-hover);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.primary, .button.primary):disabled {
  color: var(--xyj-muted);
  background: var(--xyj-line);
  border-color: var(--xyj-line);
  opacity: 1;
}

/* Account entry. The existing original mark, copy and method controls stay in place. */
body[data-page] .brand {
  color: var(--xyj-ink);
}

body[data-page='login-access'] #root {
  display: grid;
  min-block-size: 100svh;
  align-content: center;
  padding-block: clamp(16px, 5vw, 56px);
}

body[data-page='login-access'] .layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  inline-size: min(1184px, calc(100% - 48px));
  min-block-size: min(680px, calc(100svh - 48px));
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--xyj-line);
  border-radius: 16px;
  background: var(--xyj-portal-white);
  box-shadow: var(--xyj-portal-shadow);
}

body[data-page='login-access'] .access {
  min-block-size: 0;
  min-inline-size: 0;
  padding: clamp(24px, 4.5vw, 56px) clamp(24px, 5vw, 64px) 24px;
}

body[data-page='login-access'] .access-inner {
  inline-size: 100%;
  max-inline-size: 432px;
}

body[data-page='login-access'] .form-area {
  padding-block-start: clamp(32px, 5vw, 60px);
}

body[data-page='login-access'] #login-title,
.auth-redesign .auth-title h2,
.methods-main h1 {
  color: var(--xyj-ink);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

body[data-page='login-access'] .method-tabs,
body[data-page] .access-tabs {
  gap: 4px;
  margin-block: 24px;
  padding: 4px;
  border: 1px solid var(--xyj-line);
  border-radius: 12px;
  background: var(--xyj-canvas);
}

body[data-page='login-access'] .method-tabs button,
body[data-page] .access-tabs button {
  flex: 1 1 0;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 7px 4px;
  border: 0;
  border-radius: 8px;
  color: var(--xyj-muted);
  white-space: normal;
  font-size: 13px;
}

body[data-page='login-access'] .method-tabs [aria-selected='true'],
body[data-page] .access-tabs [aria-pressed='true'] {
  color: var(--xyj-portal-hover);
  background: var(--xyj-portal-white);
  box-shadow: 0 1px 3px rgb(22 39 68 / 14%);
}

body[data-page='login-access'] .access-form .field input,
body[data-page] .auth-redesign .field :is(input:not([type='file'], [type='checkbox']), select, textarea),
body[data-page='account-contacts'] .methods-main .field input {
  border-color: var(--xyj-line);
  border-radius: 12px;
  background-color: var(--xyj-portal-field);
}

body[data-page='login-access'] .access-form .code-line input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-page] :is(.code-line, .scan-placeholder, .scan-fallback, .identity-choice, .methods-account, #access-panel) {
  border-color: var(--xyj-line);
  border-radius: 12px;
}

body[data-page] :is(.access-recovery, .field-title) button,
body[data-page] :is(.signup-note, .redesign-login-link, .methods-header) a:not(.brand) {
  color: var(--xyj-portal-hover);
}

body[data-page='login-access'] .benefits,
.auth-redesign .brand-rail,
.methods-aside {
  background:
    radial-gradient(ellipse at 100% 0, var(--xyj-portal-tint), transparent 66%),
    var(--xyj-canvas);
  color: var(--xyj-ink);
}

body[data-page='login-access'] .benefits {
  min-inline-size: 0;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px) clamp(24px, 4.5vw, 56px);
  border-inline-start: 1px solid var(--xyj-line);
}

body[data-page='login-access'] footer {
  padding-block-start: 24px;
  color: var(--xyj-muted);
}

body[data-page='login-access'] footer > div {
  flex-wrap: wrap;
  column-gap: 8px;
}

body[data-page='login-access'] footer button {
  min-block-size: 36px;
  color: var(--xyj-muted);
  font-size: 12px;
}

body[data-page] .auth-redesign.auth-shell,
body[data-page] .methods-page {
  background: var(--xyj-canvas);
}

body[data-page] :is(.redesign-header, .methods-header) {
  min-block-size: 64px;
  padding-inline: max(24px, calc((100% - 1184px) / 2));
  border-color: var(--xyj-line);
  background: var(--xyj-portal-white);
}

body[data-page] :is(.redesign-progress i, .personal-progress i.done) {
  background: var(--xyj-brand);
}

body[data-page] :is(.redesign-grid, .methods-grid) {
  inline-size: min(1184px, calc(100% - 48px));
  min-block-size: 0;
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid var(--xyj-line);
  border-radius: 16px;
  background: var(--xyj-portal-white);
  box-shadow: var(--xyj-portal-shadow);
}

body[data-page] .auth-redesign .auth-main {
  padding: clamp(24px, 4vw, 48px);
}

body[data-page] :is(.auth-redesign .brand-rail, .methods-aside) {
  padding: clamp(32px, 5vw, 64px);
  border-inline-start: 1px solid var(--xyj-line);
}

body[data-page] .auth-redesign .auth-bottom {
  color: var(--xyj-muted);
  font-size: 12px;
}

body[data-page] :is(.workspace-demo, .outcome, .account-ready, .personal-privacy, .application-result) {
  border-radius: 12px;
}

body[data-page] :is(.outcome, .status.error, .auth-status.error) {
  color: var(--xyj-gold);
}

/* Feedback and administration retain their separate data and permission surfaces. */
:where(body.feedback-page, body:has(> .sidebar + .workspace)) .topbar {
  gap: 12px;
  background: var(--xyj-portal-white);
  border-color: var(--xyj-line);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .breadcrumb {
  min-inline-size: 0;
  color: var(--xyj-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .breadcrumb strong {
  color: var(--xyj-ink);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .page-header {
  gap: 16px;
  margin-block-end: 24px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) h1 {
  color: var(--xyj-ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) h2 {
  color: var(--xyj-ink);
  font-size: 16px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.subtitle, .metric-head, .metric small, .empty, .mini-row small, .definition dt, .message small) {
  color: var(--xyj-muted);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) :is(.panel, .metric, .feature, .info-box, .message) {
  min-inline-size: 0;
  border-color: var(--xyj-line);
  border-radius: 16px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) :is(.panel, .metric) {
  box-shadow: 0 4px 16px rgb(22 39 68 / 4%);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .metric.featured::before {
  background: var(--xyj-brand);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .metric strong {
  color: var(--xyj-ink);
  font-variant-numeric: tabular-nums;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .metric strong.amber {
  color: var(--xyj-gold);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .button {
  min-block-size: 40px;
  max-inline-size: 100%;
  padding-inline: 12px;
  border-color: var(--xyj-line);
  border-radius: 12px;
  color: var(--xyj-ink);
  font-size: 13px;
  white-space: normal;
  text-align: center;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .button:hover:not(.primary, .danger, :disabled) {
  background: var(--xyj-portal-tint);
  border-color: var(--xyj-brand);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .text-button {
  color: var(--xyj-portal-hover);
  font-size: 12px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .button.danger {
  color: var(--xyj-portal-danger);
  background: var(--xyj-portal-danger-tint);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.tag.amber, .preview-tag, .review-note, .operation-status) {
  color: var(--xyj-gold);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace))
  :is(.tag.amber, .preview-tag, .review-note) {
  background: var(--xyj-portal-warn);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .tag {
  border-radius: 8px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .tag.green {
  color: var(--xyj-success);
  background: var(--xyj-portal-positive);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) :is(.tag.red, .state-error) {
  color: var(--xyj-portal-danger);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .tag.red {
  background: var(--xyj-portal-danger-tint);
}

body:has(> .sidebar + .workspace) .sidebar nav a {
  border-radius: 12px;
  color: var(--xyj-muted);
}

body:has(> .sidebar + .workspace) .sidebar nav a:is(:hover, [aria-current='page']) {
  color: var(--xyj-portal-hover);
  background: var(--xyj-portal-tint);
}

body:has(> .sidebar + .workspace) .sidebar nav a[aria-current='page'] {
  box-shadow: inset 3px 0 var(--xyj-brand);
}

body:has(> .sidebar + .workspace) .admin-profile {
  border-radius: 12px;
}

body:has(> .sidebar + .workspace) .search-field input,
body:has(> .sidebar + .workspace) .toolbar select {
  min-block-size: 40px;
  border-color: var(--xyj-line);
  border-radius: 12px;
}

body:has(> .sidebar + .workspace) .tabs button[aria-selected='true'] {
  border-color: var(--xyj-brand);
  color: var(--xyj-portal-hover);
}

body:has(> .sidebar + .workspace) .table-scroll {
  max-inline-size: 100%;
}

body:has(> .sidebar + .workspace) th {
  color: var(--xyj-muted);
  background: var(--xyj-portal-field);
}

body:has(> .sidebar + .workspace) td {
  color: var(--xyj-ink);
}

body.feedback-page {
  max-inline-size: 1120px;
  min-block-size: 100svh;
}

body.feedback-page > .topbar {
  margin: 16px 24px 0;
  padding-inline: 16px;
  border: 1px solid var(--xyj-line);
  border-radius: 16px;
}

body.feedback-page > #content {
  padding: 24px;
}

body.feedback-page .mini-row > span:first-child {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

body.feedback-page .info-box {
  color: var(--xyj-muted);
  background: var(--xyj-portal-field);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace)) dialog {
  color: var(--xyj-ink);
  border-color: var(--xyj-line);
  box-shadow: var(--xyj-portal-shadow);
}

:where(body[data-page], body.feedback-page, body:has(> .sidebar + .workspace)) dialog:not(.drawer) {
  border-radius: 16px;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) :is(.drawer-header, .modal-header) {
  border-color: var(--xyj-line);
  background: var(--xyj-portal-field);
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .form-grid {
  gap: 16px;
  min-inline-size: 0;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .form-grid label {
  min-inline-size: 0;
  color: var(--xyj-ink);
  font-size: 13px;
  font-weight: 500;
}

:where(body.feedback-page, body:has(> .sidebar + .workspace)) .form-grid :is(input, select, textarea) {
  min-inline-size: 0;
  min-block-size: 44px;
  border-color: var(--xyj-line);
  border-radius: 12px;
  background: var(--xyj-portal-field);
}

body.feedback-page #feedback-attachments {
  min-inline-size: 0;
  margin-inline: 0;
  padding: 12px;
  border: 1px dashed var(--xyj-line);
  border-radius: 12px;
  color: var(--xyj-muted);
  background: var(--xyj-portal-field);
}

body.feedback-page #feedback-attachments legend {
  padding-inline: 4px;
  color: var(--xyj-ink);
  font-weight: 600;
}

body.feedback-page #feedback-files {
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.feedback-page #feedback-file-list {
  padding-inline-start: 16px;
  overflow-wrap: anywhere;
}

body.feedback-page #feedback-file-list li + li {
  margin-block-start: 8px;
}

/* Follow the original portal breakpoints and keep scroll inside responsive tables. */
@media (max-width: 800px) {
  body[data-page='login-access'] #root {
    align-content: start;
    padding-block: 16px;
  }

  body[data-page='login-access'] .layout {
    inline-size: calc(100% - 24px);
    min-block-size: calc(100svh - 32px);
  }

  body[data-page='login-access'] .access {
    padding: 24px clamp(12px, 5vw, 28px) 16px;
  }

  body[data-page='login-access'] .form-area {
    padding-block-start: 32px;
  }

  body[data-page='login-access'] .method-tabs {
    margin-block: 16px;
  }
}

@media (max-width: 760px) {
  body[data-page] :is(.redesign-header, .methods-header) {
    padding-inline: 16px;
  }

  body[data-page] :is(.redesign-grid, .methods-grid) {
    inline-size: calc(100% - 24px);
    margin-block: 12px;
  }

  body[data-page] .auth-redesign .auth-main {
    padding: 20px 12px;
  }

  body[data-page] .methods-main {
    max-inline-size: calc(100% - 24px);
    margin-block: 20px;
  }
}

@media (max-width: 600px) {
  body:has(> .sidebar + .workspace) .sidebar nav a,
  :where(body.feedback-page, body:has(> .sidebar + .workspace)) .button {
    min-block-size: 44px;
  }

  :where(body.feedback-page, body:has(> .sidebar + .workspace)) .page-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-block-end: 16px;
  }

  :where(body.feedback-page, body:has(> .sidebar + .workspace)) .form-grid :is(input, select, textarea) {
    font-size: 16px;
  }

  body.feedback-page > .topbar {
    min-block-size: 64px;
    margin: 8px 12px 0;
    padding-inline: 8px;
  }

  body.feedback-page > #content {
    padding: 16px 12px;
  }

  body.feedback-page .mini-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.feedback-page .modal {
    max-inline-size: calc(100% - 24px);
  }

  body.feedback-page .feedback-recovery .button {
    flex: 1 1 128px;
  }

  body.feedback-page #feedback-files {
    font-size: 13px;
  }
}

/* Login redesign. Scope the new proportions and branding to the login route. */
body[data-page='login-access'] .layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  inline-size: min(1024px, calc(100% - 48px));
  min-block-size: 0;
  border-radius: 20px;
}

body[data-page='login-access'] .access {
  padding: clamp(28px, 4.5vw, 54px) clamp(28px, 5vw, 60px) 28px;
}

body[data-page='login-access'] .access-inner {
  max-inline-size: 400px;
}

body[data-page='login-access'] .form-area {
  padding-block-start: 36px;
}

body[data-page='login-access'] .login-intro {
  margin: 8px 0 0;
  color: var(--xyj-muted);
  font-size: 14px;
  line-height: 1.6;
}

body[data-page='login-access'] .method-tabs {
  margin-block: 22px;
}

body[data-page='login-access'] .access-form .field {
  margin-block-end: 14px;
}

body[data-page='login-access'] .access-form .field-title {
  margin-block-end: 6px;
}

body[data-page='login-access'] footer {
  padding-block-start: 26px;
}

body[data-page='login-access'] .login-brand-panel {
  border-inline-start: 0;
  padding: clamp(28px, 4vw, 52px);
  background: #14273e;
  color: #f6f3eb;
}

body[data-page='login-access'] .login-brand-content {
  inline-size: 100%;
  max-inline-size: 360px;
  margin-inline: auto;
}

.login-brand-label {
  color: #d5bd89;
  font-size: 13px;
  letter-spacing: .12em;
}

.login-brand-panel h2 {
  margin: 18px 0;
  font-family: 'Songti SC', 'Noto Serif SC', SimSun, serif;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.24;
  font-weight: 700;
}

.login-brand-description {
  color: #d0d9e3;
  font-size: 14px;
  line-height: 1.75;
}

.login-ledger-mark {
  display: block;
  inline-size: 100%;
  block-size: auto;
  margin-block: 26px 18px;
  color: #d5bd89;
}

.login-brand-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #e1d6be;
  font-size: 12px;
}

.login-brand-points li::before {
  content: '·';
  margin-inline-end: 7px;
  color: #d5bd89;
}

@media (max-width: 800px) {
  body[data-page='login-access'] .layout {
    inline-size: min(480px, calc(100% - 24px));
  }

  body[data-page='login-access'] .access {
    padding: 24px clamp(14px, 5vw, 32px) 20px;
  }

  body[data-page='login-access'] .form-area {
    padding-block-start: 28px;
  }

  body[data-page='login-access'] .method-tabs {
    margin-block: 16px;
  }
}

/* R3 feedback composer and support notes */
body.feedback-page .feedback-workspace { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:18px; }
body.feedback-page .feedback-workspace .panel { min-width:0; margin:0; padding:20px; }
body.feedback-page .feedback-notes { display:grid; align-content:start; gap:16px; min-width:0; }
body.feedback-page .feedback-identity-row {
 display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:10px; padding:11px;
 margin:14px 0; border:1px solid #e0e8f7; border-radius:9px; background:#f7f9fe; overflow-wrap:anywhere;
}
body.feedback-page .feedback-identity-row p { margin:3px 0 0; color:#607493; }
body.feedback-page .feedback-initial { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#e9edff; color:#5362ca; }
body.feedback-page .feedback-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
body.feedback-page .feedback-full { grid-column:1/-1; }
body.feedback-page .feedback-fields textarea { min-height:132px; resize:vertical; }
body.feedback-page .feedback-workspace fieldset { margin:12px 0; padding:12px; border:1px solid #dfe7f5; border-radius:9px; }
body.feedback-page .feedback-notes p { color:#4b6384; overflow-wrap:anywhere; }
@media(max-width:800px){body.feedback-page .feedback-workspace{grid-template-columns:minmax(0,1fr)}}
@media(max-width:470px){body.feedback-page .feedback-workspace .panel{padding:14px}body.feedback-page .feedback-fields{grid-template-columns:minmax(0,1fr)}}

/* Login and personal registration keep the same brand panel at their existing entry points. */
body:is([data-page='login-access'],[data-page='register']) {
  background: radial-gradient(at 30% 10%, #eef1ff, transparent 55%), #f6f8fd;
}
body[data-page='register'] .auth-redesign.auth-shell { background: transparent; }
body[data-page='login-access'] #root,
body[data-page='register'] .auth-redesign.auth-shell {
  min-block-size: 100svh;
  align-content: start;
  padding-block: 16px 42px;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-shell-header {
  display: flex;
  align-items: center;
  inline-size: min(1268px, calc(100% - 42px));
  block-size: 58px;
  min-block-size: 58px;
  margin: 0 auto 31px;
  padding: 0;
  border: 0;
  background: transparent;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-shell-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}
.r3-auth-shell-header .brand img,
.r3-auth-brand img {
  display: block;
  inline-size: 40px;
  block-size: 40px;
  padding: 5px;
  object-fit: contain;
  border-radius: 12px;
  background: #fdf6e9;
}
body:is([data-page='login-access'],[data-page='register']) :is(.layout,.redesign-grid) {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  inline-size: min(990px, calc(100% - 32px));
  min-block-size: 635px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #e1e6f2;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 70px #21395f0b;
}
body[data-page='register'] .redesign-grid { min-block-size: 660px; }
body[data-page='register'] .auth-redesign .redesign-progress { display: none; }
body[data-page='login-access'] .access,
body[data-page='register'] .auth-redesign .auth-main {
  grid-column: 2;
  grid-row: 1;
  min-block-size: 0;
  min-inline-size: 0;
  padding: 50px 34px 38px;
  background: #fff;
}
body[data-page='register'] .auth-redesign .auth-main { padding-block-start: 38px; }
body[data-page='register'] .auth-redesign .personal-progress { margin-block-end: 12px; }
body[data-page='register'] .auth-redesign .auth-title .eyebrow { margin-block-end: 5px; }
body[data-page='register'] .auth-redesign .auth-bottom { margin-block-start: 24px; padding-block-start: 10px; }
body[data-page='login-access'] .access-inner { max-inline-size: 424px; }
body[data-page='login-access'] .form-area { padding-block-start: 0; }
body[data-page='login-access'] #login-title,
body[data-page='register'] .auth-title h2 { margin-block: 0; font-size: 25px; line-height: 1.4; }
body[data-page='login-access'] .login-intro { margin-block: 24px 0; color: #526784; font-size: 12px; }
body[data-page='login-access'] .method-tabs { margin-block: 22px 18px; }
body[data-page='login-access'] .method-tabs button { min-block-size: 38px; }
body[data-page='login-access'] .access-form .field input,
body[data-page='register'] .auth-redesign .field :is(input:not([type='file'],[type='checkbox']),select,textarea) {
  border-radius: 8px;
}
/* Public account actions use the same navy hierarchy as the official site. */
body:is([data-page='login-access'],[data-page='register'],[data-page='account-contacts']) {
  --xyj-brand: #103558;
  --xyj-portal-hover: #19466f;
  --xyj-portal-tint: #eef3f8;
}
body:is([data-page='login-access'],[data-page='register']) :is(.access,.auth-main) button.primary:not(:disabled,[aria-disabled='true']) {
  border-color: var(--xyj-brand);
  background: var(--xyj-brand);
  color: #fff;
}
body:is([data-page='login-access'],[data-page='register']) :is(.access,.auth-main) button.primary:hover:not(:disabled,[aria-disabled='true']) {
  border-color: var(--xyj-portal-hover);
  background: var(--xyj-portal-hover);
}
.r3-auth-brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-inline-size: 0;
  padding: 52px 40px;
  background: linear-gradient(140deg,#162b51,#20426d);
  color: #eff4ff;
}
.r3-auth-brand img { inline-size: 55px; block-size: 55px; padding: 7px; border-radius: 14px; }
.r3-auth-brand h2 {
  margin: 44px 0 0;
  color: #fff;
  font-size: clamp(27px,3.2vw,32px);
  line-height: 1.55;
  letter-spacing: -.025em;
}
.r3-auth-brand p { color: #d8e6f7; font-size: 12px; line-height: 1.8; }
.r3-auth-brand p:not(.r3-auth-brand-line) { margin: 38px 0 0; }
.r3-auth-brand .r3-auth-brand-line { margin: 36px 0 0; font-size: 13px; }
@media (max-width: 760px) {
  body[data-page='login-access'] #root,
  body[data-page='register'] .auth-redesign.auth-shell { padding-block: 12px 24px; }
  body:is([data-page='login-access'],[data-page='register']) .r3-auth-shell-header {
    block-size: 40px;
    min-block-size: 40px;
    inline-size: calc(100% - 34px);
    margin-block-end: 23px;
  }
  .r3-auth-shell-header .brand img { inline-size: 34px; block-size: 34px; border-radius: 10px; }
  body:is([data-page='login-access'],[data-page='register']) :is(.layout,.redesign-grid) {
    grid-template-columns: minmax(0,1fr);
    inline-size: min(480px, calc(100% - 34px));
    min-block-size: 0;
    border-radius: 17px;
  }
  body:is([data-page='login-access'],[data-page='register']) .r3-auth-brand { display: none; }
  body[data-page='login-access'] .access,
  body[data-page='register'] .auth-redesign .auth-main { grid-column: 1; padding: 30px clamp(18px,6vw,24px); }
  body[data-page='login-access'] .login-intro { margin-block-start: 18px; }
}

/* Approved R3 explicit public return, without replacing the original auth brand action. */
body:is([data-page='login-access'],[data-page='register']) .r3-auth-home{margin-inline-start:auto;display:inline-flex;align-items:center;justify-content:center;min-block-size:36px;padding:7px 10px;border-radius:8px;font-size:11px;font-weight:600;text-decoration:none;color:var(--xyj-brand)}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-home:focus-visible{outline:2px solid var(--xyj-brand);outline-offset:3px}
@media(max-width:760px){body:is([data-page='login-access'],[data-page='register']) .r3-auth-home{font-size:10px}}

/* Approved R3 authentication typography and the three explicit login channels. */
body[data-page]:is([data-page='login-access'],[data-page='register']) {
  font-family: Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 13px;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-shell-header .brand {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 2px;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-brand h2 {
  font-size: 31px;
  line-height: 1.6;
  letter-spacing: -.6px;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-brand p {
  color: #c8d6ed;
  font-size: 12px;
}
body:is([data-page='login-access'],[data-page='register']) .r3-auth-brand p:not(.r3-auth-brand-line) {
  color: #afc0dc;
  font-size: 10px;
  line-height: 1.8;
}
body[data-page='login-access'] #login-title { font-size: 24px; }
body[data-page='login-access'] .login-intro { font-size: 10px; color: #6f8098; }
body[data-page='login-access'] .r3-auth-method-tabs {
  min-block-size: 37px;
  gap: 3px;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  background: #f3f5fb;
}
body[data-page='login-access'] .r3-auth-method-tabs button {
  flex: 0 1 auto;
  min-inline-size: 0;
  min-block-size: 29px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
}
body[data-page='login-access'] .r3-auth-other-methods { margin-block-start: 14px; }
body[data-page='login-access'] .r3-auth-other-methods button {
  min-block-size: 30px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #6f8098;
  font-size: 11px;
}
body[data-page='login-access'] .r3-auth-other-methods button:focus-visible {
  outline: 2px solid var(--xyj-brand);
  outline-offset: 3px;
}
@media(max-width:760px) {
  body:is([data-page='login-access'],[data-page='register']) .r3-auth-shell-header .brand { font-size: 20px; }
  body[data-page='login-access'] .r3-auth-method-tabs button { font-size: 10px; padding-inline: 7px; }
}

/* R3 field geometry, scoped to the original authentication forms. */
body[data-page]:is([data-page='login-access'],[data-page='register']) :is(.access-form,.auth-main) .field :is(input:not([type='checkbox'],[type='radio'],[type='file']),select,textarea),
body[data-page='register'] .auth-main .simple-date-grid input {
  box-sizing: border-box;
  block-size: auto;
  min-block-size: var(--r3-auth-field-min,42px);
  padding: 10px 12px;
  padding-inline-end: var(--r3-auth-field-end,12px);
  border: 1px solid #d3ddea;
  border-radius: 8px;
  background: #fff;
  line-height: 1.65;
}
body[data-page]:is([data-page='login-access'],[data-page='register']) :is(.access-form,.auth-main) .field :is(input,textarea)[readonly] {
  background: #f7f9fc;
  color: #6f8098;
}
body[data-page='register'] .auth-main .field textarea { --r3-auth-field-min: 84px; }
body[data-page='register'] .auth-main .password-box input { --r3-auth-field-end: 58px; }
body[data-page='login-access'] .access-form .password-wrap input { --r3-auth-field-end: 44px; }
body[data-page='register'] .auth-main .password-box button {
  inset-block-start: 50%;
  min-block-size: 28px;
  transform: translateY(-50%);
}
@media(min-width:761px) {
  body[data-page]:is([data-page='login-access'],[data-page='register']) :is(.access-form,.auth-main) .field :is(input:not([type='checkbox'],[type='radio'],[type='file']),select,textarea),
  body[data-page='register'] .auth-main .simple-date-grid input { font-size: 13px; }
  body[data-page]:is([data-page='login-access'],[data-page='register']) :is(.access-form,.auth-main) .field :is(.field-title,label[for],span:first-child) {
    font-size: 12px;
    font-weight: 600;
  }
  body[data-page='login-access'] .access-form > .primary,
  body[data-page='register'] .auth-main :is(.form-stack > .primary,.personal-actions > button) {
    block-size: auto;
    min-block-size: 38px;
    border-radius: 8px;
    padding: 8px 13px;
    font-size: 12px;
    line-height: 1.65;
  }
}
@media(max-width:760px) {
  /* Keep the original touch-input size; do not introduce mobile focus zoom. */
  body[data-page]:is([data-page='login-access'],[data-page='register']) :is(.access-form,.auth-main) .field :is(input:not([type='checkbox'],[type='radio'],[type='file']),select,textarea),
  body[data-page='register'] .auth-main .simple-date-grid input { font-size: 16px; }
}

/* Narrow auth forms keep complete native date text and the calendar control. */
@media(max-width:420px) {
  body[data-page='register'] .auth-main .simple-date-grid { grid-template-columns: minmax(0,1fr); }
  body[data-page='register'] .auth-main .simple-date-grid > span { justify-self: center; }
}
