/* Profile editing lives on the identity it changes. */
#account .account-profile-banner { min-height: 430px !important; padding-top: 64px !important; }
#account .account-profile-banner .settings-profile-identity { width: min(100%, 760px) !important; }
#account .account-profile-banner .profile-cover-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
#account .account-profile-banner.has-custom-cover::after {
  display: block !important; position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(4,18,40,.3), rgba(4,18,40,.68)) !important;
  content: '' !important; pointer-events: none;
}
#account .profile-avatar-slot { position: relative; width: max-content; margin: 0 auto; }
#account .profile-avatar-edit,
#account .profile-cover-edit,
#account .profile-edit-name {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-width: 0; min-height: 38px; padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.35) !important; border-radius: 9px !important;
  background: rgba(9,30,60,.75) !important; color: #fff !important; box-shadow: none !important;
  font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
}
#account .profile-avatar-edit svg,
#account .profile-cover-edit svg,
#account .profile-edit-name svg,
.profile-image-dialog svg {
  width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
#account .profile-avatar-edit {
  position: absolute; right: 0; bottom: 3px; width: 40px; height: 40px; padding: 9px;
  border: 3px solid #fff !important; border-radius: 50% !important; background: #245ce1 !important;
}
#account .profile-avatar-edit > span,
#account .profile-edit-name > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#account .profile-cover-edit { position: absolute; z-index: 3; top: 20px; right: 20px; }
#account .profile-name-row { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; }
#account .profile-name-row h1 { min-width: 0; }
#account .profile-edit-name { flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px; padding: 7px; }
#account .profile-name-row[hidden],
#account .profile-name-editor[hidden],
#account .profile-cover-image[hidden] { display: none !important; }
#account .profile-name-editor {
  display: grid; grid-template-columns: minmax(0, 250px) auto; gap: 7px;
  align-items: center; justify-content: center; width: min(100%, 324px); margin: 7px auto 6px;
  padding: 0; border: 0; background: transparent; text-align: left; box-sizing: border-box;
}
#account .profile-name-editor label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#account .profile-name-editor input {
  width: 100%; min-width: 0; height: 42px; margin: 0; padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.58) !important; border-radius: 8px; background: rgba(8,35,75,.38) !important;
  color: #fff !important; font: inherit; font-size: 24px; font-weight: 750;
  letter-spacing: -.025em; text-align: center; box-sizing: border-box;
}
#account .profile-edit-actions { display: flex; gap: 6px; }
#account .profile-edit-actions button { width: 32px; min-width: 32px; min-height: 32px; height: 32px; margin: 0; padding: 7px; border-radius: 50%; font-size: 12px; }
#account .profile-edit-actions button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#account .profile-edit-actions .profile-secondary { background: rgba(8,35,75,.45) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.5) !important; }
#account .profile-edit-actions svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
#account .profile-name-editor .profile-edit-status { grid-column: 1 / -1; margin: 0 !important; color: #ffddd1 !important; font-size: 12px !important; text-align: center; }
#account .profile-hero-status { margin: 14px 0 0 !important; color: #fff !important; font-size: 12px !important; }
#account .profile-hero-status:empty,
.profile-edit-status:empty { display: none; }
#account .profile-hero-username { display: inline-flex; max-width: 100%; align-items: center; justify-content: center; gap: 6px; color: #d8e6ff; }
#account .profile-hero-username-value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
#account .profile-hero-copy {
  display: grid; width: 28px; height: 28px; min-height: 28px; margin: 0; padding: 0; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: #d8e6ff; cursor: pointer;
}
#account .profile-hero-copy:hover { background: rgba(255,255,255,.13); color: #fff; }
#account .profile-hero-copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#account .profile-hero-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#account .profile-hero-copy > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#account .account-profile-personal .account-current-email { margin: 0 !important; padding: 0 !important; border: 0 !important; }
#account .account-current-email .account-provider-label { display: inline-flex; align-items: center; gap: 7px; }
#account .profile-google-mark { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
#account :is(.profile-avatar-edit,.profile-cover-edit,.profile-edit-name):hover { background: #174eaa !important; }
#account :is(.profile-avatar-edit,.profile-cover-edit,.profile-edit-name):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#account .profile-name-editor input:focus-visible { outline: 3px solid #9cc2ff; outline-offset: 2px; }

.profile-image-dialog {
  --editor-bg: #fff; --editor-text: #16355d; --editor-muted: #60748c; --editor-line: #d8e3f0; --editor-soft: #f0f5fc;
  width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px;
  overflow: auto; box-sizing: border-box; border: 1px solid var(--editor-line); border-radius: 18px;
  background: var(--editor-bg); color: var(--editor-text); box-shadow: 0 24px 80px #00102655;
  font-family: inherit;
}
html[data-theme='dark'] .profile-image-dialog {
  --editor-bg: #102238; --editor-text: #eef5ff; --editor-muted: #a7bad1; --editor-line: #345172; --editor-soft: #172f4c;
}
.profile-image-dialog::backdrop { background: rgba(2,12,28,.7); backdrop-filter: blur(5px); }
.profile-image-dialog header { display: flex; width: 100%; min-height: 0; align-items: start; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 0; border: 0; background: transparent; box-shadow: none; box-sizing: border-box; }
.profile-image-dialog h2 { margin: 0 0 6px; color: var(--editor-text); font-size: 21px; line-height: 1.3; }
.profile-image-dialog header p { margin: 0; color: var(--editor-muted); font-size: 13px; line-height: 1.5; }
.profile-image-dialog button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-height: 40px; margin: 0; padding: 9px 14px; border: 1px solid var(--editor-line); border-radius: 8px;
  background: var(--editor-soft); color: var(--editor-text); box-shadow: none; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.profile-image-dialog .primary { background: #3168ef; border-color: #3168ef; color: #fff; }
.profile-image-dialog .profile-dialog-close { flex: 0 0 36px; width: 36px; min-height: 36px; padding: 8px; background: transparent; }
.profile-image-dialog button:disabled { opacity: .5; cursor: not-allowed; }
.profile-image-dialog :is(button, input, canvas):focus-visible { outline: 3px solid #80aaff; outline-offset: 3px; }
.profile-image-preview {
  display: grid; place-items: center; min-height: 210px; margin-bottom: 16px; overflow: hidden;
  border: 1px solid var(--editor-line); border-radius: 12px; background: var(--editor-soft);
}
.profile-image-preview-avatar { min-height: 300px; padding: 16px; }
.profile-image-preview canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.profile-image-preview canvas:active { cursor: grabbing; }
.profile-image-preview-avatar canvas { width: min(100%, 300px); border-radius: 50%; }
.profile-current-image { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.profile-image-preview-avatar .profile-current-image { width: 260px; height: 260px; max-width: 100%; border-radius: 50%; }
.profile-image-empty { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.profile-image-empty svg { width: 32px; height: 32px; color: #5186f4; }
.profile-image-empty strong { font-size: 15px; }
.profile-image-empty span { color: var(--editor-muted); font-size: 12px; }
.profile-image-dialog [hidden] { display: none !important; }
.profile-image-controls { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px 20px; align-items: center; margin-top: 20px; }
.profile-image-controls label { font-size: 13px; font-weight: 650; }
.profile-image-controls input { width: 100%; min-width: 0; padding: 0; accent-color: #3168ef; cursor: pointer; }
.profile-image-controls p { grid-column: 1/-1; margin: 0; color: var(--editor-muted); font-size: 12px; }
.profile-image-dialog .profile-edit-status { margin: 14px 0 0; color: var(--editor-text); font-size: 13px; }
.profile-image-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--editor-line); }
.profile-image-actions .profile-image-reset { margin-right: auto; padding-inline: 0; background: transparent; border-color: transparent; color: var(--editor-muted); font-size: 12px; }
@media (max-width: 620px) {
  #account .profile-cover-edit { top: 12px; right: 12px; min-height: 34px; font-size: 11px; padding: 6px 10px; }
  #account .account-profile-banner { padding-top: 66px !important; }
  #account .profile-name-row { gap: 7px; }
  #account .profile-edit-name { flex-basis: 30px; width: 30px; height: 30px; min-height: 30px; padding: 5px; }
  #account .profile-name-editor { grid-template-columns: minmax(0, 220px) auto; width: min(100%, 294px); padding-inline: 0; }
  #account .profile-name-editor input { height: 40px; font-size: 21px; }
  .profile-image-dialog { padding: 18px; border-radius: 14px; }
  .profile-image-dialog h2 { font-size: 18px; }
  .profile-image-preview-avatar { min-height: 230px; }
  .profile-image-preview-avatar canvas { width: min(100%, 240px); }
  .profile-image-actions .profile-image-reset { width: 100%; justify-content: flex-start; }
}

/* Account actions belong in the shared header, not the section tabs. */
body[data-excelxtr-session-owner="account"] .topbar .account-header-logout {
  display: inline-flex !important; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px;
  order: 10; min-height: 36px; margin: 0 !important; padding: 8px 11px !important;
  border: 1px solid #d8e3f0 !important; border-radius: 8px !important;
  background: transparent !important; color: #60748c !important;
  font-size: 12px !important; font-weight: 650; box-shadow: none !important; cursor: pointer;
}
body[data-excelxtr-session-owner="account"] .account-header-logout .account-logout-icon { display: flex; width: 17px; height: 17px; }
body[data-excelxtr-session-owner="account"] .account-header-logout svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
html[data-theme="dark"] body[data-excelxtr-session-owner="account"] .topbar .account-header-logout {
  border-color: #29415d !important; color: #b5c7dd !important;
}
body[data-excelxtr-session-owner="account"] .topbar .account-header-logout:is(:hover, :focus-visible, :active) { background: #eaf1fb !important; color: #24466f !important; border-color: #b4c8e1 !important; }
html[data-theme="dark"] body[data-excelxtr-session-owner="account"] .topbar .account-header-logout:is(:hover, :focus-visible, :active) { background: #1b304b !important; color: #eef5ff !important; border-color: #557397 !important; }
body[data-excelxtr-session-owner="account"] .account-header-logout:focus-visible { outline: 2px solid #80aaff; outline-offset: 3px; }
body[data-excelxtr-session-owner="account"] .account-header-logout:disabled { opacity: .5; cursor: wait; }
#account .account-profile-banner .profile-name-row { margin: 8px 0 5px !important; align-items: center !important; }
#account .account-profile-banner .profile-name-row h1 { margin: 0 !important; }
#account .account-profile-banner .profile-edit-name {
  margin: 0 !important; align-self: center; transform: translateY(3px);
  border-color: transparent !important; background: transparent !important;
}
#account .account-profile-banner .profile-edit-name svg { width: 20px; height: 20px; flex-basis: 20px; }
#account .account-profile-banner .profile-edit-name:hover { background: rgba(255,255,255,.12) !important; }
#account .profile-cover-actions { position: absolute; z-index: 3; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; }
#account .profile-cover-actions .profile-cover-edit { position: static; margin: 0; }
#account .profile-cover-remove {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; margin: 0; padding: 8px 12px; border: 1px solid rgba(255,255,255,.35);
  border-radius: 9px; background: rgba(9,30,60,.75); color: #fff; box-shadow: none;
  font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
}
#account .profile-cover-remove svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#account .profile-cover-remove[hidden] { display: none !important; }
#account .profile-cover-remove:hover { background: #713a40; }
#account .profile-cover-remove:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#account .profile-cover-actions button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 760px) {
  body[data-excelxtr-session-owner="account"] .topbar .account-header-logout { width: 34px; min-height: 34px; padding: 7px !important; }
  .account-header-logout-label { display: none; }
}
@media (max-width: 620px) {
  #account .profile-cover-actions { top: 12px; right: 12px; left: 12px; justify-content: flex-end; gap: 6px; }
  #account .profile-cover-remove { min-height: 34px; padding: 6px 9px; font-size: 11px; }
}

/* Compact profile cover with the layered blue artwork used across Excelxtr. */
#account .account-profile-banner {
  min-height: 300px !important;
  padding: 30px 24px 24px !important;
  background:
    radial-gradient(82% 175% at 14% -76%, transparent 49.5%, rgba(45,126,255,.22) 50%, rgba(45,126,255,.22) 62%, transparent 62.5%),
    radial-gradient(74% 180% at 95% 138%, transparent 48%, rgba(5,51,140,.48) 48.5%, rgba(5,51,140,.48) 61%, transparent 61.5%),
    linear-gradient(125deg,#073477 0%,#0b4aa6 43%,#1475ff 100%) !important;
}
#account .account-profile-banner .settings-profile-avatar {
  width: 124px !important; height: 124px !important; flex-basis: 124px !important;
  border-width: 5px !important; font-size: 34px !important;
}
#account .account-profile-banner .settings-profile-copy { margin-top: 12px !important; }
#account .account-profile-banner .settings-profile-copy h1 { font-size: clamp(28px,3vw,34px) !important; }
#account .account-profile-banner .account-eyebrow { font-size: 9px !important; }
#account .account-profile-banner .profile-name-row { margin: 6px 0 4px !important; }
#account .account-profile-banner .profile-edit-name {
  width: 30px; height: 30px; min-height: 30px; flex-basis: 30px; padding: 5px; transform: none;
}
#account .account-profile-banner .profile-edit-name svg { width: 17px; height: 17px; flex-basis: 17px; }
#account .profile-avatar-edit { width: 36px; height: 36px; padding: 8px; }
@media (max-width: 620px) {
  #account .account-profile-banner { min-height: 310px !important; padding: 58px 18px 24px !important; }
  #account .account-profile-banner .settings-profile-avatar { width: 112px !important; height: 112px !important; flex-basis: 112px !important; }
  #account .account-profile-banner .settings-profile-copy h1 { font-size: 28px !important; }
}
