.account-card { padding: 18px; border: 1px solid #dcecf2; border-radius: 18px; background: white; margin-bottom: 15px; }
.account-card h3 { margin: 0 0 8px; font-size: 16px; }
.account-card details > summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 8px 0; }
.account-card details[open] > summary { margin-bottom: 12px; }
.account-grid { display: grid; gap: 14px; align-items: start; }
.account-grid .account-card { margin: 0; }
.profile-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(140deg,#d9f0ff,#dff9ee); display: grid; place-items: center; font-size: 24px; font-weight: 750; overflow: hidden; flex-shrink: 0; }
.profile-avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 15px; }
.account-actions button, .account-actions label { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 9px 12px; background: var(--accent-soft); border-radius: 11px; color: var(--accent); font-size: 13px; cursor: pointer; font-weight: 600; border: 1px solid var(--accent-border); }
#signed-in-card { padding: 0; border: 0; background: transparent; }
.account-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
#account-view { display: flex; flex-direction: column; }
.account-dialog { width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.account-dialog-content { padding: 20px; }
.account-dialog-content .new-heading { margin-bottom: 12px; }
.account-dialog-content h2 { font-size: 18px; }
#account-view:not([hidden]) { min-height: 540px; }
.account-code { color: var(--accent); font-weight: 750; font-size: 17px; letter-spacing: .5px; }

@media (min-width:960px) {
  .account-grid { grid-template-columns: 1fr 1fr; }
  .account-grid .account-wide { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  #account-view:not([hidden]) { min-height: 0; }
}

.avatar { overflow: hidden; flex-shrink: 0; }

button.profile-avatar { position: relative; padding: 0; border: 1px solid #b6dce8; cursor: pointer; color: var(--ink); }
button.profile-avatar:hover { border-color: #51bdd3; box-shadow: 0 0 0 3px #e0f4fa; }
.avatar-edit-mark { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px 0 0 0; background: #e8f7fc; border: 1px solid #c5e4ee; color: var(--accent); }
.avatar-edit-mark .icon { width: 14px; height: 14px; }

/* Settings-style profile: a quiet header and compact, expandable rows. */
#account-view #signed-in-card{width:min(720px,100%);margin:0 auto}
#account-view #signed-in-card .account-grid{grid-template-columns:minmax(0,1fr);gap:10px}
#account-view #signed-in-card .account-card{border-color:#dfebf1;border-radius:16px;box-shadow:0 2px 8px #164c6610}
#account-view #signed-in-card .profile-overview{padding:22px 20px 0;background:linear-gradient(160deg,#fff,#f5fcff)}
#account-view .profile-heading{gap:16px;margin-bottom:16px;min-width:0}
#account-view .profile-heading>div{min-width:0;flex:1}
#account-view .profile-avatar{width:72px;height:72px;border-radius:50%;font-size:26px;border:3px solid white;box-shadow:0 3px 12px #279fc52b}
#account-view #account-name{font-size:21px;font-weight:650;line-height:1.3;margin-bottom:6px;overflow-wrap:anywhere}
#account-view #account-identity{font-size:12px;line-height:1.65;overflow-wrap:anywhere;color:#648092}
#account-view .avatar-edit-mark{width:24px;height:24px;border-radius:50%;right:2px;bottom:2px;background:white}
.profile-code-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;background:#eaf6fb;margin:0 0 10px;font-size:12px;color:#557c91}
#account-view .profile-code-row .account-code{font-size:13px;font-weight:600;letter-spacing:.4px}
#account-view .account-settings-card,#account-view #billing-card,#account-view #account-backup-card{padding:0}
#account-view .account-setting>summary{display:flex;align-items:center;gap:12px;min-height:58px;padding:12px 16px;font-size:14px;font-weight:600;color:#244d63;list-style:none;margin:0;border-radius:15px;transition:background .15s}
#account-view .account-setting>summary::-webkit-details-marker{display:none}
#account-view .account-setting>summary:after{content:'›';margin-left:auto;font-size:24px;line-height:1;color:#7ca4b7;font-weight:400;transition:transform .15s}
#account-view .account-setting[open]>summary:after{transform:rotate(90deg)}
#account-view .account-setting>summary:hover{background:#f0f9fd}
#account-view .account-setting>summary:focus-visible{outline:3px solid #36b6d350;outline-offset:-3px}
#account-view .setting-icon{display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:10px;background:linear-gradient(145deg,#e3f5ff,#e7faf4);color:#138dac}
#account-view .setting-icon .icon{width:18px;height:18px}
#account-view .setting-content{padding:4px 18px 18px}
#account-view .setting-content .account-note{font-size:12px;margin-bottom:12px}
#account-view .setting-content .field{margin-bottom:12px}
#account-view .profile-edit{margin:0 -20px}
#account-view .profile-edit>summary{border-radius:0 0 15px 15px}
#account-view .profile-edit[open]>summary{border-radius:0;border-bottom:1px solid #e5eef3;margin-bottom:12px}
#account-view .account-logout-card{padding:0;border-color:#f0dcd9!important;background:#fff;box-shadow:none!important}
#account-view .account-logout-button{display:flex;align-items:center;gap:12px;width:100%;min-height:66px;padding:13px 16px;border-radius:15px;text-align:left;background:transparent;color:#c44d43;font-size:14px;font-weight:600}
#account-view .account-logout-button:hover{background:#fff6f4}
#account-view .account-logout-button .setting-icon{background:#fff0ec;color:#c44d43}
.logout-caption{display:block;font-size:11px;font-weight:400;color:#9b7572;margin-top:4px}
#account-view #superadmin-card{padding:16px 18px;background:#effafd}
#account-view #superadmin-card h3{font-size:14px}
@media(max-width:480px){#account-view #signed-in-card .profile-overview{padding:18px 16px 0}#account-view .profile-edit{margin:0 -16px}#account-view .profile-avatar{width:64px;height:64px}#account-view #account-name{font-size:19px}#account-view .setting-content{padding:4px 16px 16px}}

body:not(.auth-entry) #account-view>#server-notice{display:none}
