/* Shared account pages. All rules are scoped to preserve other portal screens. */
.account-profile {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 0 32px;
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.55;
}
.account-profile * { box-sizing: border-box; }
.account-profile .ap-heading { margin-bottom: 28px; }
.account-profile .ap-eyebrow { margin: 0 0 8px; color: var(--text-muted); font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.account-profile h1 { margin: 0; color: var(--text-heading); font-size: clamp(25px, 3vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; }
.account-profile .ap-description { margin: 10px 0 0; color: var(--text-muted); font-size: 13px; }
.account-profile .ap-identity { display: flex; align-items: center; gap: 18px; padding: 24px 0 28px; border-top: 1px solid var(--border); margin-bottom: 8px; }
.account-profile .ap-avatar { display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 60px; border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-secondary); color: var(--text-heading); font-size: 21px; font-weight: 500; letter-spacing: -.04em; }
.account-profile .ap-identity-text { min-width: 0; flex: 1; }
.account-profile .ap-name { margin: 0; color: var(--text-heading); font-size: 19px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.account-profile .ap-email { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.account-profile .ap-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.account-profile .ap-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.account-profile .ap-layout,
.account-profile.sp-page .ap-layout,
.account-profile .ap-layout-stacked {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}
.account-profile .ap-column { display: grid; gap: 22px; min-width: 0; }
.account-profile .ap-panel { border: 1px solid var(--border); background: var(--bg-secondary); border-radius: 12px; overflow: hidden; }
.account-profile .ap-panel-head { padding: 23px 24px 18px; }
.account-profile h2 { margin: 0; font-size: 15px; color: var(--text-heading); letter-spacing: -.015em; font-weight: 600; }
.account-profile .ap-panel-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.account-profile .ap-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; padding: 0 24px 24px; margin: 0; }
.account-profile .ap-fields > div { min-width: 0; }
.account-profile dt { color: var(--text-muted); font-size: 11px; margin-bottom: 5px; }
.account-profile dd { margin: 0; font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.account-profile .ap-fields .ap-wide { grid-column: 1 / -1; }
.account-profile .ap-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--border); }
.account-profile .ap-note { color: var(--text-muted); font-size: 11px; margin: 0; }
.account-profile .ap-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--border-light); background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; font-weight: 550; line-height: 1.4; cursor: pointer; text-align: center; transition: var(--transition); }
.account-profile .ap-btn:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }
.account-profile .ap-btn-primary { background: var(--action-bg); border-color: var(--action-bg); color: var(--on-action); }
.account-profile .ap-btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.account-profile .ap-btn-quiet { border-color: transparent; color: var(--text-muted); padding-inline: 0; text-align: left; justify-content: flex-start; }
.account-profile .ap-btn-quiet:hover { background: transparent; color: var(--text-heading); border-color: transparent; text-decoration: underline; }
.account-profile .ap-btn-danger { color: var(--danger); }
.account-profile .ap-btn:focus-visible, .account-profile .sp-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.account-profile .ap-security { padding: 0 24px 22px; }
.account-profile .ap-security-state { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-heading); }
.account-profile .ap-security-state svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-muted); }
.account-profile .ap-security p { color: var(--text-muted); font-size: 12px; margin: 10px 0 18px; }
.account-profile .ap-security-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.account-profile .ap-secondary-actions { border-top: 1px solid var(--border); padding: 10px 24px; display: grid; justify-items: start; }
.account-profile .ap-device-label { margin-top: 10px; color: var(--text-muted); font-size: 11px; }
.account-profile .ap-facilities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; padding: 0 24px 24px; }
.account-profile .sp-chip { display: flex; align-items: center; gap: 10px; min-height: 42px; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 11px; font-weight: 400; text-align: left; cursor: pointer; line-height: 1.45; box-shadow: none; word-break: break-word; }
.account-profile .sp-chip::before { content: ''; display: block; flex: 0 0 12px; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-light); }
.account-profile .sp-chip.selected { background: var(--bg-card); color: var(--text-heading); border-color: var(--border-light); }
.account-profile .sp-chip.selected::before { background: var(--text-secondary); border-color: var(--text-secondary); box-shadow: inset 0 0 0 3px var(--bg-card); }
.account-profile .sp-chip:hover { border-color: var(--text-muted); background: var(--bg-card); }
.account-profile .ap-session-email { font-size: 12px; overflow-wrap: anywhere; color: var(--text-primary); margin-bottom: 18px; }
.account-profile .ap-signout { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.account-profile .ap-signout strong { display: block; font-weight: 500; font-size: 12px; margin-bottom: 3px; }
.account-profile .ap-signout .ap-btn { flex-shrink: 0; }
.modal:has(.ap-edit-form) { width: 460px; max-width: calc(100vw - 32px); }
.modal:has(.ap-edit-form) .modal-body { padding: 24px; }
.modal:has(.ap-edit-form) .modal-header,
.modal:has(.ap-edit-form) .modal-footer { padding: 18px 24px; }
.ap-edit-form { color: var(--text-primary); font-family: var(--font-stack); }
.ap-edit-form p { margin: 0 0 22px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.ap-edit-form label { display: block; margin-bottom: 8px; font-size: 12px; }
.ap-edit-form input { width: 100%; box-sizing: border-box; min-height: 44px; margin-bottom: 20px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 7px; background: var(--bg-input); color: var(--text-heading); font: inherit; font-size: 14px; }
.ap-edit-form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-edit-form .ap-edit-note { font-size: 11px; margin: 0; }
.modal:has(.ap-edit-form) .btn:disabled { opacity: .55; cursor: wait; }
/* The profile needs more room than the supplier portal's single-column forms. */
@media (min-width: 768px) {
  .portal-container:has(.account-profile) { max-width: none; padding: 32px clamp(24px, 4vw, 64px) 60px; }
}
@media (max-width: 1050px) {
  .account-profile .ap-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .account-profile { padding-top: 8px; }
  .account-profile .ap-heading { margin-bottom: 22px; }
  .account-profile .ap-identity { flex-wrap: wrap; gap: 12px; padding: 20px 0; }
  .account-profile .ap-identity-text { flex-basis: calc(100% - 72px); }
  .account-profile .ap-identity > .ap-status { margin-left: 72px; margin-top: -8px; }
  .account-profile .ap-panel-head { padding: 20px 18px 18px; }
  .account-profile .ap-fields { padding: 0 18px 22px; gap: 20px; }
  .account-profile .ap-security { padding: 0 18px 20px; }
  .account-profile .ap-secondary-actions { padding: 10px 18px; }
  .account-profile .ap-facilities { padding: 0 18px 20px; grid-template-columns: minmax(0, 1fr); }
  .account-profile .ap-panel-foot { padding: 14px 18px; flex-wrap: wrap; }
  .account-profile .ap-panel-foot .ap-btn { margin-left: auto; }
  .account-profile .ap-signout { align-items: flex-start; }
}
