:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f5;
  color: #17211d;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f4f6f5;
}

a {
  color: #1c5a88;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.topbar {
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid #d7dfdb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #17211d;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid #12372a;
  border-radius: 4px;
  background: #12372a;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 23px;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  color: #5b6862;
  font-size: 12px;
}

.environment-badge {
  border: 1px solid #9ba9a2;
  border-radius: 3px;
  padding: 5px 8px;
  color: #46534d;
  background: #f8faf9;
  font-size: 11px;
  font-weight: 700;
}

.workspace {
  width: min(1040px, calc(100% - 36px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 500px);
  align-items: start;
  justify-content: center;
  gap: clamp(34px, 7vw, 96px);
  padding: clamp(52px, 9vh, 100px) 0 56px;
}

.status-rail {
  padding-top: 18px;
}

.section-label {
  margin: 0 0 10px;
  color: #517064;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-rail h1 {
  margin: 0 0 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-list {
  margin: 0;
  border-top: 1px solid #cbd5d0;
}

.status-list div {
  min-height: 48px;
  border-bottom: 1px solid #d7dfdb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-list dt {
  color: #64716b;
  font-size: 13px;
}

.status-list dd {
  margin: 0;
  color: #26342e;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.status-list .status-ready {
  color: #17603d;
}

.status-list .status-error {
  color: #9a2c2c;
}

.status-list .status-pending {
  color: #765b12;
}

.auth-surface {
  width: 100%;
  border: 1px solid #cfd8d3;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(26, 42, 35, 0.08);
  overflow: hidden;
}

.auth-heading,
form,
.auth-surface footer {
  padding-right: clamp(24px, 5vw, 44px);
  padding-left: clamp(24px, 5vw, 44px);
}

.auth-heading {
  padding-top: 38px;
}

.auth-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-heading > p:last-child {
  margin: 12px 0 0;
  color: #617069;
  font-size: 14px;
  line-height: 1.6;
}

.compact-view {
  padding-bottom: 30px;
}

form {
  padding-top: 30px;
  padding-bottom: 34px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #2d3a34;
  font-size: 13px;
  font-weight: 650;
}

.label-row {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.label-row label {
  margin-bottom: 8px;
}

.label-row a {
  font-size: 12px;
}

.muted-link {
  color: #7b8781;
  font-size: 12px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #aebbb5;
  border-radius: 4px;
  padding: 10px 12px;
  background: #ffffff;
  color: #17211d;
  font: inherit;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #aebbb5;
  border-radius: 4px;
  padding: 10px 12px;
  background: #ffffff;
  color: #17211d;
  font: inherit;
}

.legal-document {
  grid-column: 1 / -1;
  max-width: 860px;
  padding: clamp(28px, 5vw, 52px);
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.legal-document h1,
.legal-document h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.legal-document h1 { margin: 0 0 20px; }
.legal-document h2 { margin: 32px 0 10px; font-size: 21px; }
.legal-document table { width: 100%; border-collapse: collapse; font-size: 13px; }
.legal-document th,
.legal-document td { border: 1px solid #d7dfdb; padding: 10px; text-align: left; vertical-align: top; }
.legal-document th { background: #f1f4f2; }

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: #12372a;
}

.check-row {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  line-height: 1.55;
}

input:disabled {
  background: #f1f4f2;
  color: #7b8781;
}

button[type="submit"] {
  width: 100%;
  min-height: 44px;
  margin-top: 26px;
  border: 1px solid #12372a;
  border-radius: 4px;
  padding: 10px 14px;
  background: #12372a;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

button[type="submit"]:disabled {
  border-color: #9ba9a2;
  background: #9ba9a2;
  cursor: not-allowed;
}

.account-facts {
  margin: 0;
  padding: 0 clamp(24px, 5vw, 44px) 12px;
}

.account-facts div {
  min-height: 48px;
  border-top: 1px solid #e0e6e3;
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 18px;
}

.account-facts dt {
  color: #64716b;
  font-size: 13px;
}

.account-facts dd {
  min-width: 0;
  margin: 0;
  color: #26342e;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}

/* The optional profile is a section of the hub, not the account centre itself. */
form h3 {
  margin: 0 0 6px;
  color: #26342e;
  font-size: 15px;
}

.account-flash {
  margin: 0 clamp(24px, 5vw, 44px) 4px;
  border: 1px solid #b9d3c4;
  border-left: 3px solid #12372a;
  border-radius: 4px;
  padding: 12px 14px;
  background: #eef5f1;
  color: #1d3a2d;
  font-size: 13px;
  line-height: 1.6;
}

.account-hub {
  border-top: 1px solid #e0e6e3;
  margin-top: 12px;
  padding: 20px clamp(24px, 5vw, 44px) 4px;
}

.account-hub h3 {
  margin: 0 0 14px;
  color: #64716b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.hub-card {
  min-height: 76px;
  border: 1px solid #e0e6e3;
  border-radius: 6px;
  padding: 14px 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

a.hub-card:hover,
a.hub-card:focus-visible {
  border-color: #87968f;
  background: #f8faf9;
}

.hub-card strong {
  color: #26342e;
  font-size: 13px;
}

.hub-card span {
  color: #68756f;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.view-actions {
  min-height: 70px;
  padding: 12px clamp(24px, 5vw, 44px) 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.account-actions {
  justify-content: space-between;
  gap: 18px;
}

.secondary-button,
.text-command {
  min-height: 40px;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button {
  border: 1px solid #87968f;
  padding: 8px 14px;
  background: #ffffff;
  color: #26342e;
}

.primary-command {
  min-height: 40px;
  border: 1px solid #12372a;
  border-radius: 4px;
  padding: 8px 16px;
  background: #12372a;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.security-band,
.consent-scope {
  border-top: 1px solid #e0e6e3;
  padding: 24px clamp(24px, 5vw, 44px);
}

.consent-scope h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.consent-scope ul {
  margin: 0;
  padding-left: 20px;
  color: #46534d;
  font-size: 13px;
  line-height: 1.8;
}

.oauth-facts dd {
  font-weight: 500;
}

.consent-actions {
  justify-content: space-between;
  padding-bottom: 10px;
}

.consent-message {
  margin: 0;
  padding: 8px clamp(24px, 5vw, 44px) 28px;
}

.grant-row {
  min-height: 58px;
  border-top: 1px solid #e0e6e3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.grant-row:first-child {
  border-top: 0;
}

.grant-row strong,
.grant-row span {
  display: block;
}

.grant-row strong {
  font-size: 13px;
}

.grant-row span {
  margin-top: 4px;
  color: #64716b;
  font-size: 12px;
}

.secondary-button:disabled {
  color: #7b8781;
  cursor: wait;
}

.staff-view .auth-heading {
  padding-bottom: 24px;
}

.staff-context {
  margin: 22px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.staff-context dt,
.mfa-secret span {
  color: #64716b;
  font-size: 12px;
}

.staff-context dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.staff-band {
  border-top: 1px solid #e0e6e3;
  padding: 26px clamp(24px, 5vw, 44px);
}

.staff-band-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.staff-band-heading h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.staff-band-heading span {
  color: #64716b;
  font-size: 12px;
}

.staff-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mfa-enrollment {
  margin-top: 20px;
}

.mfa-enrollment img {
  display: block;
  width: 196px;
  height: 196px;
  border: 1px solid #d7dfdb;
}

.mfa-secret {
  margin-top: 14px;
}

.mfa-secret code {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.inline-form {
  padding: 0;
}

.inline-form label {
  margin-top: 18px;
}

.inline-form button[type="submit"] {
  margin-top: 12px;
}

.staff-target-facts {
  padding: 18px 0 0;
}

.staff-write-actions {
  margin-top: 18px;
  border-top: 1px solid #e0e6e3;
  padding-top: 18px;
}

.danger-button,
.icon-command {
  min-height: 40px;
  border-radius: 4px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.danger-button {
  border: 1px solid #8d2525;
  background: #8d2525;
  color: #ffffff;
}

.icon-command {
  border: 0;
  background: transparent;
  color: #1c5a88;
}

.staff-list-row {
  min-height: 48px;
  border-top: 1px solid #e0e6e3;
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.audit-row {
  display: block;
  line-height: 1.55;
}

.empty-state {
  color: #64716b;
  font-size: 13px;
}

.text-command {
  display: inline-flex;
  align-items: center;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #68756f;
  font-size: 12px;
  line-height: 1.5;
}

.auth-surface footer {
  min-height: 54px;
  border-top: 1px solid #e0e6e3;
  background: #f8faf9;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.auth-surface footer a[aria-current="page"] {
  color: #12372a;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid #12372a;
}

@media (max-width: 760px) {
  .workspace {
    grid-template-columns: minmax(0, 500px);
    gap: 30px;
    padding-top: 34px;
  }

  .status-rail {
    padding-top: 0;
  }

  .status-rail h1 {
    margin-bottom: 22px;
    font-size: 28px;
  }
}

@media (max-width: 420px) {
  .topbar {
    min-height: 62px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .workspace {
    width: min(100% - 24px, 500px);
    padding-top: 26px;
  }

  .auth-heading,
  form,
  .auth-surface footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .account-facts,
  .account-flash,
  .account-hub,
  .view-actions {
    padding-right: 20px;
    padding-left: 20px;
  }

  .account-flash {
    margin-right: 20px;
    margin-left: 20px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .account-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }

  .account-facts dd {
    text-align: left;
  }

  .staff-context {
    grid-template-columns: 1fr;
  }

  .staff-actions-row > button {
    flex: 1 1 160px;
  }

  .auth-surface footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .auth-surface footer a {
    white-space: nowrap;
  }

  .auth-surface footer span {
    display: none;
  }
}
