.account-page { width: min(100% - 32px, 900px); }
.account-header { margin: 0 0 22px; }
.account-header h1 { margin: 0; font-size: clamp(1.45rem, 4vw, 1.85rem); line-height: 1.3; }
.account-header p { margin: 5px 0 0; color: var(--keyrof-muted); font-size: .78rem; }
.account-status { text-align: center; }
.account-status h2 { margin: 0; font-size: 1.05rem; }
.account-status p { color: var(--keyrof-muted); font-size: .75rem; }
.account-status .identity-button { margin-top: 12px; }

.account-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; margin-bottom: 18px; }
.account-summary-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.account-monogram { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(245,196,81,.24); border-radius: 16px; color: #fbe3a1; background: linear-gradient(145deg, rgba(245,196,81,.12), rgba(99,102,241,.07)); font-size: 1.1rem; font-weight: 900; text-transform: uppercase; }
.account-summary-copy { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.account-summary h2 { max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.12rem; }
.account-summary-copy > p { max-width: 100%; margin: 0; overflow: hidden; color: var(--keyrof-muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.account-plan-summary { display: grid; justify-items: end; gap: 3px; text-align: left; }
.account-plan-summary strong { font-size: .76rem; }
.account-plan-summary small { color: var(--keyrof-muted); font-size: .66rem; }
.account-plan-summary a { margin-top: 3px; color: #dbe4ff; font-size: .68rem; text-underline-offset: 3px; }
.account-page-message, .account-connection { margin-bottom: 12px; }
.account-page-message:empty, .account-local-message:empty { display: none; }
.account-connection { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.account-settings-group { margin-top: 22px; }
.account-group-title { margin: 0 0 8px; padding-inline: 4px; color: var(--keyrof-subtle); font-size: .74rem; font-weight: 800; }
.account-settings-container { overflow: hidden; border: 1px solid var(--keyrof-border); border-radius: 15px; background: rgba(13,20,33,.66); }
.account-settings-row { width: 100%; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 0; border-bottom: 1px solid rgba(148,163,184,.09); color: var(--keyrof-text); background: transparent; text-align: start; text-decoration: none; cursor: pointer; }
.account-settings-row:last-child { border-bottom: 0; }
.account-settings-row:hover { background: rgba(148,163,184,.035); }
.account-settings-row:focus-visible { position: relative; outline: 2px solid rgba(139,164,255,.55); outline-offset: -3px; }
.account-settings-row > span { display: grid; gap: 2px; min-width: 0; }
.account-settings-row strong { font-size: .8rem; }
.account-settings-row small { overflow: hidden; color: var(--keyrof-muted); font-size: .68rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.account-settings-row svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--keyrof-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.account-settings-row[aria-expanded="true"] svg { transform: rotate(90deg); }
.account-settings-panel { display: grid; gap: 18px; padding: 17px 16px 20px; border-bottom: 1px solid rgba(148,163,184,.09); background: rgba(4,8,14,.3); }
.account-settings-panel h3 { margin: 0; font-size: .78rem; }
.account-settings-panel .identity-form { max-width: 580px; }
.account-settings-panel .identity-form > .identity-button { justify-self: start; }
.account-current-value { display: grid; gap: 3px; }
.account-current-value span { color: var(--keyrof-muted); font-size: .68rem; }
.account-current-value b { font-size: .78rem; font-weight: 700; }
.account-note { margin: 0; color: var(--keyrof-muted); font-size: .7rem; }
.account-code-input { max-width: 230px; text-align: center; letter-spacing: .3em; font-weight: 800; }
.account-metadata { display: flex; flex-wrap: wrap; gap: 18px 30px; margin: 0; padding-top: 2px; }
.account-metadata div { display: grid; gap: 2px; }
.account-metadata dt { color: var(--keyrof-muted); font-size: .66rem; }
.account-metadata dd { margin: 0; font-size: .7rem; }
.account-inline-action { justify-self: start; }
.account-password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-sessions { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--keyrof-border); }
.account-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-session > div { min-width: 0; }
.account-session .identity-button { flex: 0 0 auto; }
.identity-list-item.is-unread { border-color: rgba(139,164,255,.25); background: rgba(72,90,150,.09); }
.account-empty { padding: 8px 2px; }
.account-empty strong { display: block; font-size: .76rem; }
.account-empty p { margin: 3px 0 0; color: var(--keyrof-muted); font-size: .68rem; }
.account-quiet-danger { color: #fca5a5; }
.account-links .account-settings-row { cursor: pointer; }

.account-danger-zone { display: grid; gap: 14px; margin-top: 24px; padding: 18px 4px 4px; border-top: 1px solid rgba(248,113,113,.15); }
.account-danger-zone h2 { margin: 0; color: #fecaca; font-size: .78rem; }
.account-danger-zone p { max-width: 680px; margin: 4px 0 0; color: var(--keyrof-muted); font-size: .7rem; }
.account-delete-form { display: grid; justify-items: start; gap: 10px; max-width: 420px; }
.account-delete-form .identity-field { width: 100%; }
.account-logout { display: flex; justify-content: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(148,163,184,.08); }

.account-recovery { max-width: 620px; margin: 0 auto; text-align: center; }
.account-recovery-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; border: 1px solid rgba(245,196,81,.25); border-radius: 15px; color: var(--keyrof-gold); background: rgba(245,196,81,.07); }
.account-recovery-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-recovery h2 { margin: 12px 0 2px; font-size: 1.05rem; }
.account-recovery > p { color: var(--keyrof-muted); font-size: .73rem; }
.account-recovery .identity-actions { justify-content: center; margin-top: 18px; }

@media (max-width: 640px) {
    .account-page { width: min(100% - 24px, 900px); }
    .account-summary { align-items: flex-start; flex-wrap: wrap; padding: 17px 15px; }
    .account-monogram { width: 46px; height: 46px; border-radius: 14px; }
    .account-plan-summary { width: 100%; justify-items: start; padding-top: 13px; border-top: 1px solid rgba(148,163,184,.09); text-align: right; }
    .account-settings-row { min-height: 62px; padding: 11px 13px; }
    .account-settings-panel { padding: 15px 13px 18px; }
    .account-password-grid { grid-template-columns: 1fr; }
    .account-panel-heading { align-items: flex-start; }
    .account-connection { align-items: stretch; flex-direction: column; }
}
