/* Canonical CSS owner: auth. Historical layers consolidated 2026-08-02. */
.auth-gate {
  position: fixed;

  inset: 0px;

  z-index: 1000;

  display: grid;

  place-items: center;

  padding: 20px;

  background: rgb(237, 241, 244);
}

.auth-gate[hidden] {
  display: none;
}

.auth-shell {
  width: calc(-40px + 100vw);

  max-width: 420px;

  padding: 26px;

  border: 1px solid var(--line-strong);

  border-radius: 6px;

  background: var(--surface);

  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;

  align-items: center;

  gap: 12px;
}

.auth-brand h1 {
  margin: 0px;

  font-size: 22px;
}

.auth-brand span {
  display: block;

  margin-top: 5px;

  color: var(--text-muted);

  font-size: 12px;
}

.auth-tabs {
  display: grid;

  grid-template-columns: 1fr 1fr;

  margin-top: 24px;

  border-bottom: 1px solid var(--line);
}

.auth-tab {
  min-height: 40px;

  border-width: 0px 0px 2px;

  border-style: none none solid;

  border-color: currentcolor currentcolor transparent;

  border-image: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;
}

.auth-tab.active {
  border-bottom-color: var(--coral);

  color: var(--text);

  font-weight: 750;
}

.auth-form {
  display: grid;

  gap: 14px;

  margin-top: 20px;
}

.auth-form .button {
  width: 100%;

  min-height: 40px;
}

.auth-error {
  margin: 0px;

  color: rgb(185, 54, 39);

  font-size: 12px;

  line-height: 1.5;
}

.admin-dialog {
  width: min(1060px, -24px + 100vw);
}

.admin-section-picker {
  display: grid;

  grid-template-columns: 96px minmax(220px, 360px);

  align-items: center;

  gap: 12px;

  padding: 16px 18px;
}

.admin-section-picker label {
  color: var(--text-secondary);

  font-size: 13px;

  font-weight: 700;
}

.admin-section-picker select {
  width: 100%;

  min-height: 40px;

  padding: 0px 11px;

  border: 1px solid var(--line-strong);

  border-radius: 5px;

  background: var(--surface);

  color: var(--text-primary);

  font-size: 13px;
}

.admin-section-picker select:focus-visible {
  outline: 2px solid var(--blue);

  outline-offset: 2px;
}

.admin-panel[hidden] {
  display: none;
}

.admin-inline-actions {
  display: flex;

  justify-content: space-between;

  gap: 10px;
}

.admin-dialog > form,
.settings-section > form {
  padding: 0px;
}

.settings-lead {
  margin: 0px;

  color: var(--text-secondary);

  font-size: 13px;

  line-height: 1.65;
}

.membership-usage {
  margin-top: 12px;

  color: var(--text-muted);

  font-size: 12px;
}

.switch-control {
  display: flex;

  align-items: center;

  gap: 9px;

  margin-top: 13px;

  color: var(--text-secondary);

  font-size: 13px;

  font-weight: 650;
}

.compact-number-field {
  width: min(260px, 100%);

  margin-top: 14px;
}

.admin-users-list {
  display: grid;

  border-top: 1px solid var(--line);
}

.admin-user-row {
  min-width: 0px;

  display: grid;

  grid-template-columns: 160px 100px minmax(0px, 1fr);

  align-items: center;

  gap: 14px;

  padding: 13px 0px;

  border-bottom: 1px solid var(--line);
}

.admin-user-identity strong {
  display: block;

  color: var(--text-primary);

  font-size: 13px;
}

.admin-user-identity small,
.admin-user-identity span {
  display: block;

  margin-top: 4px;

  color: var(--text-muted);

  font-size: 11px;
}

.admin-user-usage {
  margin-top: 4px;

  color: var(--text-muted);

  font-size: 11px;
}

.membership-form {
  padding: 0px;

  min-width: 0px;

  display: grid;

  grid-template-columns: 100px minmax(170px, 0.8fr) minmax(160px, 1fr) auto;

  align-items: end;

  gap: 8px;
}

.membership-form label {
  min-width: 0px;

  display: grid;

  gap: 5px;
}

.membership-form label span {
  color: var(--text-muted);

  font-size: 10px;
}

.membership-form input,
.membership-form select {
  width: 100%;

  min-width: 0px;

  height: 34px;

  padding: 0px 8px;

  border: 1px solid var(--line-strong);

  border-radius: 4px;

  background: var(--surface);
}

.membership-expiry {
  min-width: 0px;

  display: grid;

  gap: 5px;

  align-self: end;
}

.membership-expiry span {
  color: var(--text-muted);

  font-size: 10px;
}

.membership-expiry strong {
  min-height: 34px;

  display: flex;

  align-items: center;

  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 650;
}

@media (max-width: 820px) {
  .admin-user-row {
    grid-template-columns: 1fr auto;
  }

  .admin-user-row .membership-form {
    grid-column: 1 / -1;
  }

  .membership-form {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }

  .membership-form .button {
    align-self: end;
  }
}

@media (max-width: 600px) {

  .membership-form {
    grid-template-columns: minmax(0px, 1fr);
  }
}

.connection-status {
  margin: 18px 18px 0px;

  padding: 10px 12px;

  border: 1px solid var(--line);

  border-radius: 4px;

  background: var(--surface-muted);
}

.connection-status.connected {
  border-color: rgb(167, 222, 201);

  background: var(--green-soft);

  color: rgb(8, 106, 75);
}

.settings-dialog form {
  padding: 18px;
}

.settings-dialog .membership-form,
.settings-dialog .settings-section > form,
.settings-dialog.admin-dialog > form {
  padding: 0px;
}

.settings-section {
  padding: 18px;

  border-top: 1px solid var(--line);
}

.settings-section h3 {
  margin: 0px 0px 12px;

  font-size: 15px;
}

.settings-section-heading {
  display: flex;

  align-items: baseline;

  justify-content: space-between;

  gap: 12px;
}

.settings-section-heading span {
  color: var(--text-muted);

  font-size: 12px;
}

.account-birth-form {
  display: grid;

  grid-template-columns: 1fr 0.8fr 0.7fr;

  gap: 10px;
}

.account-birth-form .dialog-actions {
  grid-column: 1 / -1;
}

.backfill-controls {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;
}

@media (max-width: 600px) {
  .admin-inline-actions {
    align-items: stretch;

    flex-direction: column;
  }
}

.form-hint {
  margin: 10px 0px 0px;

  color: var(--text-muted);

  font-size: 12px;

  line-height: 1.6;
}

.account-button > span {
  min-width: 0px;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .account-button {
    width: 32px;
  }
}

@media (max-width: 767px) {
  .header-command-group .account-button {
    width: 100%;

    min-height: 38px;

    justify-content: flex-start;

    padding: 0px 10px;

    border-color: transparent;

    background: transparent;
  }
}

@media (max-width: 860px) {
  .account-birth-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .settings-dialog {
    right: 8px;

    left: 8px;

    width: calc(-16px + 100vw);

    max-width: calc(-16px + 100vw);

    margin: 8px 0px;

    max-height: calc(-16px + 100vh);
  }

  .settings-dialog form,
  .settings-section {
    min-width: 0px;

    padding-right: 12px;

    padding-left: 12px;
  }

  .settings-dialog .membership-form,
  .settings-dialog .settings-section > form,
  .settings-dialog.admin-dialog > form {
    padding: 0px;
  }

  .settings-dialog .connection-status,
  .settings-dialog .form-hint {
    overflow-wrap: anywhere;
  }

  .backfill-controls {
    grid-template-columns: 1fr;
  }
}

.account-menu-chevron {
  margin-left: 1px;

  transition: transform 180ms var(--ease-out);

  width: 13px !important;

  height: 13px !important;
}

.account-menu-shell.is-open .account-menu-chevron {
  transform: rotate(180deg);
}

.account-dropdown[hidden] {
  display: none;
}

.account-dropdown-head {
  display: grid;

  gap: 2px;

  padding: 9px 10px 10px;

  border-bottom: 1px solid var(--border);

  margin-bottom: 3px;
}

.account-dropdown-head strong {
  color: var(--text-primary);

  font-size: 13px;

  overflow-wrap: anywhere;
}

.account-dropdown-head span {
  color: var(--text-muted);

  font-size: 11px;
}

.account-dropdown button {
  width: 100%;

  min-height: 40px;

  display: grid;

  grid-template-columns: 18px minmax(0px, 1fr) 16px;

  align-items: center;

  gap: 9px;

  padding: 0px 10px;

  border: 0px;

  border-radius: 7px;

  color: var(--text-secondary);

  background: transparent;

  text-align: left;

  cursor: pointer;

  transition: color 160ms, background 160ms;
}

.account-dropdown button:hover {
  color: var(--text-primary);

  background: var(--surface-muted);

  outline: none;
}

.account-dropdown button:focus-visible {
  color: var(--text-primary);

  background: var(--surface-muted);

  outline: none;

  box-shadow: inset 0 0 0 2px var(--focus-ring, #1268c4);
}

.account-dropdown button svg {
  width: 16px;

  height: 16px;
}

.account-dropdown button svg:last-child {
  width: 13px;

  height: 13px;

  color: var(--text-muted);
}

.account-dropdown-separator {
  height: 1px;

  margin: 4px 5px;

  background: var(--border);
}

.account-dropdown .account-menu-danger {
  color: rgb(181, 58, 66);

  grid-template-columns: 18px minmax(0px, 1fr);
}

.account-dropdown .account-menu-danger:focus-visible,
.account-dropdown .account-menu-danger:hover {
  color: rgb(163, 47, 55);

  background: rgb(255, 242, 243);
}

button.account-role-badge {
  font-family: inherit;

  cursor: pointer;

  transition: filter 160ms, box-shadow 160ms;
}

button.account-role-badge:hover {
  filter: brightness(0.98);

  box-shadow: rgba(67, 76, 86, 0.14) 0px 3px 10px;
}

button.account-role-badge:focus-visible {
  outline: 2px solid var(--blue);

  outline-offset: 2px;
}

.account-role-badge svg {
  width: 13px;

  height: 13px;
}

.admin-role-badge {
  color: rgb(83, 103, 124);

  background: rgb(244, 247, 250);
}

.vip-role-badge {
  color: rgb(154, 104, 20);

  background: linear-gradient(135deg, rgb(255, 248, 230), rgb(245, 226, 173));

  border-color: rgb(200, 155, 69);

  box-shadow: rgba(180, 132, 41, 0.18) 0px 2px 8px;
}

.vip-role-badge.is-nonmember {
  color: rgb(105, 117, 128);

  background: rgb(244, 246, 248);

  border-color: rgb(203, 211, 218);

  box-shadow: none;
}

.vip-role-badge.is-nonmember b {
  background: rgb(135, 147, 158);

  color: var(--text-inverse);
}

.vip-role-badge b {
  display: grid;

  place-items: center;

  width: 16px;

  height: 16px;

  border-radius: 50%;

  background: rgb(184, 131, 37);

  color: rgb(255, 250, 240);

  font: 700 10px / 1 Georgia, serif;

  box-shadow: rgba(255, 255, 255, 0.58) 0px 0px 0px 1px inset;
}

.member-feature-view.member-locked {
  position: relative;
}

.member-feature-view.member-locked > :not(.member-gate) {
  opacity: 0.42;

  filter: grayscale(0.38);

  pointer-events: none;

  user-select: none;
}

.member-gate {
  position: relative;

  z-index: 20;

  display: flex;

  align-items: center;

  gap: 14px;

  margin: 0px 0px 22px;

  padding: 16px 18px;

  border: 1px solid rgb(234, 217, 172);

  border-radius: 14px;

  background: linear-gradient(135deg, rgb(255, 253, 247), rgb(255, 248, 233));

  box-shadow: rgba(147, 107, 31, 0.08) 0px 10px 24px;
}

.member-gate-icon {
  display: grid;

  place-items: center;

  flex: 0 0 38px;

  width: 38px;

  height: 38px;

  border-radius: 12px;

  color: rgb(155, 106, 29);

  background: rgb(247, 232, 187);
}

.member-gate-icon svg {
  width: 20px;

  height: 20px;
}

.member-gate > div:nth-child(2) {
  display: grid;

  gap: 3px;

  min-width: 0px;

  flex: 1 1 0%;
}

.member-gate strong {
  color: rgb(60, 70, 80);

  font-size: 14px;
}

.member-gate span {
  color: rgb(123, 107, 77);

  font-size: 12px;

  line-height: 1.5;
}

.member-gate .button {
  flex: 0 0 auto;
}

#settingsDialog[open] {
  display: flex;

  flex-direction: column;
}

#settingsDialog > .dialog-header {
  order: 0;
}

#settingsDialog > .connection-status {
  order: 1;
}

#settingsDialog > .account-birth-section {
  order: 2;
}

#settingsDialog > .membership-overview {
  order: 3;
}

#settingsDialog > .password-section {
  order: 5;
}

.privacy-note {
  display: flex;

  align-items: flex-start;

  gap: 8px;

  margin-bottom: 12px;

  color: rgb(83, 103, 124);
}

.privacy-note svg {
  flex: 0 0 15px;

  width: 15px;

  height: 15px;

  margin-top: 3px;

  color: rgb(52, 116, 95);
}

.membership-status-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0px, 1fr));

  gap: 10px;

  margin: 14px 0px 18px;
}

.membership-status-grid > div {
  padding: 12px 13px;

  border: 1px solid var(--line, #e2e8ee);

  border-radius: 10px;

  background: rgb(251, 252, 253);
}

.membership-status-grid span {
  display: block;

  color: rgb(116, 128, 140);

  font-size: 11px;
}

.membership-status-grid strong {
  display: block;

  margin-top: 5px;

  color: rgb(38, 50, 61);

  font-size: 15px;

  font-variant-numeric: tabular-nums;
}

.membership-comparison {
  overflow: hidden;

  border: 1px solid var(--line, #e2e8ee);

  border-radius: 10px;

  font-size: 12px;
}

.membership-comparison > div {
  display: grid;

  grid-template-columns: minmax(0px, 1.6fr) 0.7fr 0.7fr;

  gap: 8px;

  align-items: center;

  padding: 9px 11px;

  border-top: 1px solid var(--line, #e2e8ee);
}

.membership-comparison > div:first-child {
  border-top: 0px;
}

.membership-comparison-head {
  color: rgb(105, 118, 131);

  background: rgb(247, 249, 251);

  font-weight: 700;
}

.membership-comparison b {
  color: rgb(39, 108, 88);

  font-weight: 600;
}

.membership-comparison b.muted {
  color: rgb(154, 164, 173);
}

.membership-comparison b.available {
  color: rgb(154, 104, 20);
}

.membership-topup-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

  margin-top: 14px;

  color: rgb(93, 105, 116);

  font-size: 12px;
}

.membership-topup-row > span {
  display: inline-flex;

  align-items: center;

  gap: 7px;
}

.membership-topup-row svg {
  width: 15px;

  height: 15px;

  color: rgb(154, 104, 20);
}

.password-form {
  display: grid;

  gap: 10px;
}

@media (max-width: 767px) {
  .account-menu-shell {
    width: 100%;

    display: grid;

    grid-template-columns: auto minmax(0px, 1fr);
  }

  .account-menu-shell .account-button {
    min-width: 0px;
  }

  .account-dropdown {
    top: calc(100% + 6px);

    right: 0px;

    width: min(270px, -28px + 100vw);
  }

  .account-role-badges {
    gap: 3px;
  }

  .account-role-badge {
    padding-inline: 5px;
  }

  .account-role-badge > span {
    display: none;
  }

  .membership-status-grid {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }

  .member-gate {
    align-items: flex-start;

    flex-wrap: wrap;
  }

  .member-gate .button {
    margin-left: 52px;
  }
}

.assistant-button.member-locked-control {
  color: var(--text-secondary);

  opacity: 0.72;
}

.assistant-dialog.member-locked .assistant-member-content {
  opacity: 0.42;

  filter: grayscale(0.38);

  pointer-events: none;

  user-select: none;
}

.account-settings-dialog {
  border-radius: 9px;
}

.settings-dialog {
  width: min(780px, -24px + 100vw);

  max-height: calc(-32px + 100vh);

  overflow-x: hidden;

  border-radius: 9px;
}

.account-dropdown {
  position: absolute;

  top: calc(100% + 9px);

  right: 0px;

  z-index: 90;

  width: 242px;

  display: grid;

  gap: 2px;

  padding: 7px;

  background: rgba(255, 255, 255, 0.98);

  transform-origin: right top;

  animation: account-menu-in 180ms var(--ease-out) both;

  border-color: var(--border);

  border-radius: 7px;

  box-shadow: rgba(22, 34, 46, 0.15) 0px 14px 35px;
}

@media (max-width: 767px) {
  .account-settings-dialog,
  .settings-dialog {
    width: calc(-16px + 100vw);

    max-width: none;

    max-height: calc(-20px + 100dvh);

    border-radius: 8px;
  }
}

@media (max-width: 600px) {
  .admin-section-picker {
    grid-template-columns: minmax(0px, 1fr);
  }
}

@media (max-width: 520px) {
  .settings-dialog .form-field {
    width: 100%;

    max-width: 100%;

    min-width: 0px;
  }
}

.auth-form .form-field[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .account-birth-form {
    grid-template-columns: 1fr;
  }
}

.account-role-badges {
  display: inline-flex;

  align-items: center;

  min-height: 32px;

  gap: 3px;
}

@media (min-width: 1280px) and (max-width: 1510px) {
  .app-header .header-command-group .account-role-badge span {
    display: inline;
  }

  .app-header .header-command-group .account-role-badge {
    min-width: 0;

    justify-content: flex-start;
  }
}

@media (min-width: 1380px) and (max-width: 1510px) {
  #settingsButton,
  .header-command-group .account-button {
    width: auto;

    padding: 0px 9px;
  }

  #settingsButton > span,
  .header-command-group .account-button > span {
    display: inline;
  }
}

.auth-brand .brand-mark {
  flex: 0 0 42px;

  display: grid;

  place-items: center;

  border: 0px;

  border-radius: 7px;

  background: rgb(37, 99, 235);

  color: var(--text-inverse);

  box-shadow: none;

  width: 42px;

  height: 42px;
}

.account-menu-shell {
  position: relative;

  align-items: center;

  gap: 5px;
}

.account-role-badge {
  display: inline-flex;

  align-items: center;

  gap: 4px;

  border-width: 1px;

  border-style: solid;

  font-weight: 700;

  letter-spacing: 0.04em;

  white-space: nowrap;

  padding: 0px 7px;

  min-height: 28px;

  height: 28px;

  border-radius: 6px;

  font-size: 11px;
}

.account-button {
  overflow: hidden;

  text-overflow: ellipsis;

  max-width: 108px;

  min-height: 28px;

  height: 28px;

  border-radius: 6px;

  font-size: 11px;

  padding-inline: 8px;
}

.settings-dialog:not(.heaven-reading-dialog) {
  width: min(740px, -28px + 100vw);

  max-height: min(820px, -28px + 100dvh);

  box-sizing: border-box;

  overflow: hidden auto;

  overscroll-behavior: contain;
}

.settings-dialog:not(.heaven-reading-dialog)[open] {
  margin: auto;
}

.settings-dialog:not(.heaven-reading-dialog) .settings-section {
  padding: 18px 20px;

  border-color: var(--dialog-line);
}

.settings-dialog:not(.heaven-reading-dialog) .settings-section-heading {
  margin-bottom: 12px;
}

.settings-dialog:not(.heaven-reading-dialog) .settings-section-heading h3 {
  margin: 0px;

  color: rgb(39, 52, 67);

  font-size: 14px;

  font-weight: 720;
}

.settings-dialog:not(.heaven-reading-dialog) .settings-section-heading > span {
  color: rgb(124, 135, 149);

  font-size: 10.5px;
}

.settings-dialog:not(.heaven-reading-dialog) .form-field {
  gap: 6px;
}

.settings-dialog:not(.heaven-reading-dialog) .form-field > label,
.settings-dialog:not(.heaven-reading-dialog) .form-field > span {
  color: rgb(78, 91, 106);

  font-size: 11px;

  font-weight: 650;
}

.settings-dialog:not(.heaven-reading-dialog) :is(input, select, textarea) {
  border-color: rgb(213, 220, 229);

  border-radius: 7px;
}

.settings-dialog:not(.heaven-reading-dialog) .dialog-actions {
  gap: 8px;
}

.settings-dialog.alerts-dialog {
  width: min(720px, -28px + 100vw);
}

.settings-dialog.assistant-dialog {
  width: min(760px, -28px + 100vw);

  height: min(760px, -28px + 100dvh);

  max-height: min(760px, -28px + 100dvh);

  overflow: hidden !important;
}

.settings-dialog.account-settings-dialog {
  width: min(720px, -28px + 100vw);
}

.account-settings-dialog .connection-status {
  margin: 12px 20px 0px;

  border-radius: 7px;

  font-size: 11px;
}

.account-settings-dialog .connection-status.connected {
  display: none;
}

.account-settings-dialog .settings-lead {
  color: rgb(96, 109, 124);

  font-size: 12px;

  line-height: 1.6;
}

.account-settings-dialog .membership-usage {
  margin-top: 8px;
}

.account-settings-dialog .membership-status-grid {
  gap: 8px;

  margin: 14px 0px 16px;
}

.account-settings-dialog .membership-status-grid > div {
  min-height: 68px;

  padding: 11px 12px;

  border-color: rgb(223, 228, 234);

  border-radius: 7px;

  background: var(--table-header);
}

.account-settings-dialog .membership-status-grid span {
  font-size: 10px;
}

.account-settings-dialog .membership-status-grid strong {
  margin-top: 7px;

  font-size: 14px;
}

.account-settings-dialog .membership-status-grid > div:first-child {
  border-color: rgb(228, 213, 170);

  background: rgb(255, 251, 239);
}

.account-settings-dialog .membership-status-grid > div:first-child strong {
  color: rgb(147, 101, 21);
}

.account-settings-dialog .membership-comparison {
  border-color: rgb(223, 228, 234);

  border-radius: 7px;
}

.account-settings-dialog .membership-comparison > div {
  min-height: 36px;

  padding: 8px 11px;

  border-color: rgb(230, 234, 239);
}

.account-settings-dialog .membership-comparison-head {
  background: var(--table-header);
}

.account-settings-dialog .membership-topup-row {
  margin-top: 12px;
}

.account-settings-dialog .privacy-note {
  padding: 10px 11px;

  border: 1px solid rgb(220, 232, 226);

  border-radius: 7px;

  background: rgb(245, 250, 247);
}

.account-settings-dialog .account-birth-form {
  grid-template-columns: 1.2fr 1fr 0.72fr;
}

.account-settings-dialog .password-form {
  max-width: 460px;
}

.settings-dialog.admin-dialog {
  width: min(900px, -28px + 100vw);
}

.admin-dialog .connection-status {
  margin: 12px 20px 0px;

  padding: 8px 10px;

  border-radius: 7px;

  color: rgb(102, 115, 132);

  font-size: 11px;
}

.admin-dialog .admin-section-picker {
  grid-template-columns: auto minmax(220px, 300px);

  gap: 14px;

  padding: 12px 20px;

  border-bottom: 1px solid var(--dialog-line);

  background: rgb(251, 252, 253);
}

.admin-dialog .admin-section-picker label {
  font-size: 11px;
}

.admin-dialog .admin-section-picker select {
  min-height: 36px;

  border-color: rgb(212, 220, 229);

  border-radius: 7px;

  font-size: 12px;
}

.admin-dialog .admin-panel {
  max-width: 860px;

  margin-inline: auto;
}

.admin-dialog .settings-section + .settings-section {
  border-top: 1px solid var(--dialog-line);
}

.admin-dialog .admin-users-list {
  border-color: var(--dialog-line);
}

.admin-dialog .admin-user-row {
  grid-template-columns: 150px 90px minmax(0px, 1fr);

  gap: 12px;

  padding: 12px 0px;

  border-color: var(--dialog-line);
}

.admin-dialog .membership-form {
  grid-template-columns: 92px minmax(135px, 0.8fr) minmax(140px, 1fr) auto;
}

@media (max-width: 760px) {
  .account-settings-dialog .membership-status-grid {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }

  .account-settings-dialog .account-birth-form {
    grid-template-columns: 1fr;
  }

  .admin-dialog .admin-section-picker {
    grid-template-columns: 1fr;

    gap: 6px;
  }

  .admin-dialog .admin-user-row {
    grid-template-columns: 1fr auto;
  }

  .admin-dialog .admin-user-row .membership-form {
    grid-column: 1 / -1;

    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }
}

@media (max-width: 460px) {
  .account-settings-dialog .membership-status-grid {
    grid-template-columns: 1fr;
  }

  .account-settings-dialog .membership-comparison {
    overflow-x: auto;
  }

  .account-settings-dialog .membership-comparison > div {
    min-width: 510px;
  }

  .admin-dialog .admin-user-row .membership-form {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="dark"] :is(.header-command-group, .account-dropdown) {
  border-color: var(--border);

  background: var(--surface);

  color: var(--text-primary);

  box-shadow: var(--shadow);
}

:root[data-theme="dark"] :is(.account-dropdown-head, .account-dropdown-separator) {
  border-color: var(--line-soft);
}

:root[data-theme="dark"] .account-role-badge.admin-role-badge {
  border-color: var(--blue-line);

  background: var(--action-soft);

  color: var(--action);
}

:root[data-theme="dark"] .settings-dialog :is(.dialog-header h2, .settings-section-heading h3) {
  color: var(--text-primary);
}

:root[data-theme="dark"] .settings-dialog :is(.form-field > span, .settings-section-heading > span, .form-hint, .dialog-eyebrow) {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .settings-dialog .connection-status.connected {
  border-color: var(--market-down);

  background: var(--market-down-soft);

  color: var(--market-down);
}

:root[data-theme="dark"] .settings-dialog .dialog-header .icon-button {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .account-settings-dialog :is(.membership-comparison, .membership-comparison > div, .membership-comparison-head) {
  border-color: var(--border);

  background: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] .account-settings-dialog .membership-comparison > .membership-comparison-head {
  background: var(--surface-muted);

  color: var(--text-secondary);
}

:root[data-theme="dark"] :is(.loading-overlay, .auth-gate) {
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
}

:root[data-theme="dark"] :is(.auth-shell) {
  border-color: var(--border-strong);

  background: var(--surface);

  color: var(--text-primary);

  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .account-menu-shell {
    display: inline-flex;
  }
}
