.account-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 28px;
}
.account-sidebar {
  display: grid;
  gap: 6px;
  position: sticky;
  top: 24px;
}
.account-sidebar button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  text-align: left;
  padding: 12px 16px;
  color: var(--rc-ink);
  background: transparent;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.account-sidebar button[aria-current] {
  color: #fff;
  background: #202522;
  border-color: #202522;
}
.account-sidebar button:hover:not([aria-current]) {
  background: var(--rc-surface);
  border-color: var(--rc-line);
}
.account-content {
  min-width: 0;
}
.account-content > section > h2 {
  margin-top: 0;
}
.account-content h2:focus {
  outline-offset: 6px;
}
.account-content [hidden],
.account-workspace [hidden] {
  display: none !important;
}
.account-content p,
.commerce-overview-email,
.account-saved-model {
  overflow-wrap: anywhere;
}
.account-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.account-metric {
  display: grid;
  text-align: left;
  gap: 4px;
  padding: 20px;
  background: var(--rc-card);
  color: var(--rc-ink);
  border: 1px solid var(--rc-line);
  font: inherit;
  cursor: pointer;
}
.account-metric strong {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.2;
}
.account-metric span {
  font-size: 13px;
}
.account-history-controls {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.account-history-controls label:first-child {
  flex: 1 1 220px;
}
.account-history-controls select {
  max-width: 100%;
}
.account-saved-model h3 {
  margin: 0;
}
.account-saved-model {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.account-saved-model > div {
  min-width: 0;
}
.account-single-column {
  grid-template-columns: 1fr;
}
.account-password {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.account-password input {
  min-width: 0;
  flex: 1;
}
.account-password button {
  flex: none;
  padding: 8px 12px;
}
.account-types {
  border: 0;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 12px;
}
.account-types legend {
  font-size: 14px;
  margin-bottom: 12px;
}
.account-type {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--rc-line-strong);
  padding: 16px;
  cursor: pointer;
  background: var(--rc-card);
}
.account-type:has(input:checked) {
  border: 2px solid #202522;
  padding: 15px;
  background: #e6e3d9;
}
.account-type input,
.account-consent input {
  width: 20px !important;
  height: 20px;
  min-height: 20px !important;
  margin: 2px 0 0;
  flex: none;
  accent-color: #202522;
}
.account-type span {
  display: grid;
  gap: 4px;
}
.account-type small {
  color: var(--rc-muted);
  font-size: 13px;
  line-height: 1.5;
}
.account-consent {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
}
.account-notice {
  background: var(--rc-surface);
  padding: 16px;
  border-left: 3px solid #202522;
}
.account-content .commerce-builder-row {
  margin-bottom: 16px;
}
.commerce-page:has(.account-workspace) .primary,
.customer-auth .primary {
  background: #202522;
  color: #fff;
  border-color: #202522;
}
.commerce-page:has(.account-workspace) .primary:hover,
.customer-auth .primary:hover {
  background: #384139;
  color: #fff;
}
.commerce-page:has(.account-workspace) button,
.customer-auth button {
  min-height: 44px;
}
.customer-auth-benefits {
  background: #202522;
}
.customer-auth-benefits .commerce-eyebrow {
  color: #d8d7cb;
}
.commerce-page :focus-visible {
  outline: 3px solid #596c36;
  outline-offset: 3px;
}
.commerce-page #commerce-message:not(:empty) {
  border: 1px solid var(--rc-line-strong);
  padding: 16px;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.commerce-page #commerce-root[aria-busy='true'] {
  cursor: progress;
}
.regional-save-model {
  margin-top: 16px;
}
@media (max-width: 900px) {
  .account-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .account-sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .account-sidebar button {
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
  }
}
@media (max-width: 480px) {
  .account-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-metrics {
    gap: 8px;
  }
  .account-metric {
    padding: 12px 8px;
  }
  .account-metric strong {
    font-size: 28px;
  }
  .account-metric span {
    font-size: 11px;
  }
  .account-history-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .account-history-controls label:first-child {
    min-width: 0;
  }
  .account-saved-model .commerce-actions {
    width: 100%;
  }
  .customer-auth-tabs {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .account-workspace *,
  .customer-auth-shell * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .account-sidebar,
  .commerce-overview,
  [data-panel='history'] > .commerce-card-head button,
  .account-history-controls,
  #history-empty,
  #history-count {
    display: none !important;
  }
  .account-workspace {
    display: block;
  }
  .account-print-history [data-panel] {
    display: none !important;
  }
  .account-print-history [data-panel='history'] {
    display: block !important;
  }
}

/* Commerce pages also receive editorial CSS; keep the account palette explicit. */
.commerce-page .customer-auth button.primary,
.commerce-page:has(.account-workspace) button.primary {
  background: #202522;
  color: #fff;
  border-color: #202522;
}
.commerce-page .customer-auth-benefits {
  border-top-color: #202522;
}
.commerce-page .customer-auth-benefits .commerce-eyebrow {
  color: #d8d7cb;
}
.commerce-page .customer-auth-list li::before {
  background: #596c36;
  border-color: #596c36;
}

.commerce-page .account-sidebar button {
  display: flex;
  justify-content: space-between;
  background: transparent;
  color: var(--rc-ink);
  border-color: transparent;
  text-align: left;
}
.commerce-page .account-sidebar button[aria-current],
.commerce-page .account-sidebar button[aria-current]:hover {
  color: #fff;
  background: #202522;
  border-color: #202522;
}
.commerce-page .account-sidebar button:not([aria-current]):hover {
  color: var(--rc-ink);
  background: var(--rc-surface);
  border-color: var(--rc-line);
}
.commerce-page .account-metric {
  display: grid;
  justify-content: start;
  background: var(--rc-card);
  color: var(--rc-ink);
  border-color: var(--rc-line);
  text-align: left;
}
.commerce-page .account-metric:hover {
  background: var(--rc-surface);
}
.commerce-page:has(.account-workspace) .commerce-overview {
  border-top-color: #202522;
}

@media print {
  .account-print-history [data-record-key]:not(.is-print-target) {
    display: none !important;
  }
}

.commerce-page:has(.account-workspace) .commerce-overview-link.is-cta,
.commerce-page:has(.account-workspace) .commerce-overview-link.is-cta:hover {
  background: #eeeae1;
  border-color: #eeeae1;
  color: #202522;
}

/* Avoid transient white-on-paper text while changing the selected section. */
.commerce-page .account-sidebar button {
  transition: none;
}

/* Long legal names and record titles must wrap without clipping their content. */
.account-content h2,
.account-content h3,
.account-content strong {
  overflow-wrap: anywhere;
}
