/* Theme-aware outlines do not change the dimensions of existing surfaces. */
.header-panel,.social-button,.information-card,.team-member,.calculator-builder,.calculator-summary,#settings,#navigation,#workViewer,.cookie-notice {
  outline:1px solid color-mix(in srgb,var(--ink) 65%,transparent);outline-offset:-1px;
}
#accountDialog {width:min(1080px,calc(100vw - 64px));max-width:none;max-height:calc(100dvh - 64px);margin:auto;padding:32px;overflow-y:auto;border:1px solid var(--ink);border-radius:24px;background:var(--glass-surface);color:var(--ink);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:0 24px 90px #0004}
#accountDialog::backdrop {background:#0005;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.account-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:28px}
.account-heading h1 {font-size:clamp(26px,3vw,36px);margin:8px 0 0;line-height:1.1}
.account-layout {display:grid;grid-template-columns:240px minmax(0,1fr);gap:24px;align-items:start}
.account-surface {border:1px solid color-mix(in srgb,var(--ink) 55%,transparent);border-radius:18px;padding:24px;background:color-mix(in srgb,var(--bg) 70%,transparent)}
.account-sidebar {position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0}
.account-identity {text-align:center;overflow-wrap:anywhere}
.account-avatar {width:88px;height:88px;margin:0 auto 20px;border:1px solid var(--ink);border-radius:24px}
.account-avatar img {width:100%;height:100%;object-fit:cover}
.account-identity h2 {margin:0 0 8px;font-size:24px}.account-identity p {margin:8px 0 20px}
.account-badge {display:inline-block;padding:8px 12px;border:1px solid currentColor;border-radius:999px;font-size:12px}
.account-muted {font-size:13px;line-height:1.6;opacity:.8}
.account-main {display:grid;gap:20px;min-width:0}.account-main h2 {font-size:24px;margin:0 0 16px}
.account-main label {display:block;margin:20px 0 8px;font-size:14px;font-weight:600}
.account-main input:not([type="file"]) {display:block;width:100%;height:48px;padding:12px 16px;border:1px solid color-mix(in srgb,var(--ink) 55%,transparent);border-radius:12px;background:var(--control);color:var(--ink);font:inherit}
.account-main input:focus-visible {outline:2px solid var(--ink);outline-offset:2px}
.account-primary,.account-secondary {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:12px 20px;border:1px solid var(--ink);border-radius:12px;font:inherit;font-weight:600}
.account-primary {background:var(--ink);color:var(--bg);margin-top:20px}.account-secondary {background:transparent;color:var(--ink)}.account-primary:disabled {opacity:.45}
.account-text-button {display:inline-block;padding:12px 0;font:inherit;font-size:13px;text-decoration:underline;text-underline-offset:3px}
.account-auth-tabs {display:flex;gap:12px;margin-bottom:20px}.account-auth-tabs button {flex:1;padding:12px;border:1px solid var(--ink);border-radius:12px;font-size:16px}.account-auth-tabs button[aria-pressed="true"] {background:var(--ink);color:var(--bg)}
.account-notice {padding:16px;background:color-mix(in srgb,var(--ink) 8%,transparent);border:1px solid color-mix(in srgb,var(--ink) 40%,transparent);border-radius:12px;font-size:14px;line-height:1.6}
.account-auth-links,.account-upload {display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:12px}.account-upload .account-secondary,.account-upload .account-primary {margin:0;font-size:14px}
.account-section-title {display:flex;justify-content:space-between;align-items:baseline;gap:20px}.account-section-title>span {white-space:nowrap;font-size:16px}
#accountAchievementGrid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.account-achievement {display:flex;align-items:start;gap:16px;padding:20px;border:1px solid color-mix(in srgb,var(--ink) 42%,transparent);border-radius:18px;background:color-mix(in srgb,var(--bg) 70%,transparent)}
.account-achievement-icon {flex:0 0 32px;width:32px;height:32px;opacity:.65}.account-achievement h3 {margin:0 0 8px;font-size:18px;font-weight:600}.account-achievement p {margin:0 0 12px;font-size:13px;line-height:1.5;opacity:.8}.account-achievement-state {font-size:11px;opacity:.7}
.account-achievement.is-unlocked {border-color:var(--ink);background:color-mix(in srgb,var(--ink) 12%,var(--bg))}.account-achievement.is-unlocked .account-achievement-icon {opacity:1}
.account-message {position:sticky;bottom:-32px;margin:0;padding:0;background:var(--bg);border-radius:12px;font-size:14px;line-height:1.6}.account-message:not(:empty) {padding:16px;margin-top:20px;border:1px solid var(--ink)}.account-message.is-error {font-weight:600}
#accountDialog [hidden] {display:none!important}
@media(max-width:760px) {
  #accountDialog {width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:20px;border-radius:20px}
  .account-layout {grid-template-columns:1fr;gap:20px}.account-identity {position:static;padding:20px}.account-avatar {width:64px;height:64px;margin-bottom:12px;border-radius:18px}
  .account-identity #accountHint {margin-bottom:0}.account-heading {margin-bottom:20px}.account-surface {padding:20px}#accountAchievementGrid {grid-template-columns:1fr}.account-message {bottom:-20px}
}

/* One roomy window, with scrolling confined to the selected tab. */
#accountDialog {width:min(1320px,calc(100vw - 48px));height:min(860px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:28px;overflow:hidden;scrollbar-width:none}
#accountDialog[open] {display:flex;flex-direction:column}
html:has(#accountDialog[open]),body:has(#accountDialog[open]) {overflow:hidden}
#accountDialog::-webkit-scrollbar,.account-panel::-webkit-scrollbar,.account-identity::-webkit-scrollbar {display:none;width:0;height:0}
.account-heading {flex:none;margin-bottom:24px}.account-heading h1 {margin:0}
.account-layout {flex:1;min-height:0;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:stretch;overflow:hidden}
.account-identity {max-height:100%;overflow-y:auto;scrollbar-width:none}
.account-main {display:flex;flex-direction:column;gap:0;min-height:0;overflow:hidden}
.account-tabs {display:flex;flex:none;gap:0;margin-bottom:20px;border-bottom:1px solid color-mix(in srgb,var(--ink) 25%,transparent)}
.account-tabs button {flex:1;min-width:0;padding:16px 8px;border-radius:0;font-size:16px;opacity:.65;border-bottom:2px solid transparent}
.account-tabs button[aria-selected="true"] {border-color:var(--ink);opacity:1;font-weight:600}
.account-panel {flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;overscroll-behavior:contain;padding:4px 4px 8px}
.account-session-actions {display:flex;align-items:center;justify-content:center;gap:8px 12px;flex-wrap:wrap;padding:16px;flex:none}
.account-message {position:static;flex:none;bottom:auto}
.account-message:not(:empty) {margin-top:16px;padding:12px 16px}
#accountDialog .account-text-button:is(:hover,.gamepad-hover) {background:transparent;box-shadow:none}
.account-achievement-icon {display:grid;place-items:center;font-size:30px;line-height:1;font-weight:500}
.account-achievement-icon svg {width:32px;height:32px}
.account-achievement.is-spotlight {outline:2px solid var(--ink);outline-offset:-2px;box-shadow:0 0 24px color-mix(in srgb,var(--ink) 30%,transparent);animation:achievement-highlight 2.6s ease both}
@keyframes achievement-highlight {0%,100% {background:color-mix(in srgb,var(--ink) 12%,var(--bg))}30%,60% {background:color-mix(in srgb,var(--ink) 28%,var(--bg))}}
button.achievement-toast {
  position:fixed;inset:auto 20px 86px auto;z-index:500002;margin:0;
  width:min(360px,calc(100vw - 40px));display:flex;align-items:center;gap:20px;padding:20px;
  border:1px solid var(--ink);border-radius:18px;background:var(--glass-surface);color:var(--ink);
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:0 12px 40px #0004;
  text-align:left;opacity:0;transform:translateY(calc(100% + 110px));pointer-events:none;
  transition:opacity .32s ease,transform .36s cubic-bezier(.2,.7,.2,1);
}
button.achievement-toast:not(:popover-open)[popover] {display:none}
button.achievement-toast.is-shown {opacity:1;transform:translateY(0);pointer-events:auto}
button.achievement-toast:is(:hover,.gamepad-hover) {background:color-mix(in srgb,var(--ink) 10%,var(--bg))}
.achievement-toast-icon {display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px}
.achievement-toast-icon svg {width:44px;height:44px}
.achievement-toast-content {display:grid;gap:4px;min-width:0}
.achievement-toast-content>span {font-size:13px}.achievement-toast-content>strong {font-size:21px;line-height:1.2;overflow-wrap:anywhere}
@media(max-width:760px) {
  #accountDialog {width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:16px}
  .account-heading {margin-bottom:16px}.account-heading h1 {font-size:27px}
  .account-layout {display:flex;flex-direction:column;gap:16px}
  .account-identity {display:grid;grid-template-columns:56px minmax(0,1fr);column-gap:16px;row-gap:4px;flex:none;width:100%;padding:16px;text-align:left;overflow:visible}
  .account-avatar {grid-column:1;grid-row:1/4;width:56px;height:56px;margin:0}
  .account-identity h2 {grid-column:2;font-size:20px;margin:0;line-height:1.2}
  .account-identity #accountEmail {grid-column:2;margin:0;font-size:12px}
  .account-badge {grid-column:2;justify-self:start;padding:4px 8px;font-size:10px}
  .account-identity #accountHint {display:none}
  .account-sidebar {gap:8px;flex:none}
  .account-session-actions {padding:8px 12px}
  .account-session-actions .account-secondary {min-height:34px;padding:4px 16px;font-size:12px}
  .account-session-actions .account-text-button {font-size:12px;padding:4px 0}
  .account-main {flex:1;width:100%}.account-tabs {margin-bottom:16px}
  .account-tabs button {font-size:13px;padding:12px 4px}
  .account-message:not(:empty) {padding:8px 12px;font-size:12px;margin-top:8px}
  button.achievement-toast {right:12px;bottom:16px;width:min(360px,calc(100vw - 24px));padding:16px}
}
@media(prefers-reduced-motion:reduce) {
  button.achievement-toast {transition:opacity .15s;transform:none}
  .account-achievement.is-spotlight {animation:none}
}

/* Profile details stay at the top, session actions at the bottom. */
@media(min-width:761px) {
  #accountDialog {height:min(720px,calc(100dvh - 48px));max-height:calc(100dvh - 48px)}
  .account-layout {overflow:visible}
  .account-sidebar:has(.account-identity.is-tilting) {z-index:2}
  .account-identity {display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
  .account-identity-top {flex:none}
  .account-quote {flex:1;min-height:0;overflow-y:auto;scrollbar-width:none}
}
.account-quote {margin:24px 0;padding:8px 0 8px 16px;border-left:2px solid color-mix(in srgb,var(--ink) 45%,transparent);text-align:left;font-size:18px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.account-quote.is-empty {opacity:.45}
.account-main textarea {display:block;width:100%;min-height:80px;max-height:160px;resize:vertical;padding:12px 16px;border:1px solid color-mix(in srgb,var(--ink) 55%,transparent);border-radius:12px;background:var(--control);color:var(--ink);font:inherit;line-height:1.45}
.account-main textarea:focus-visible {outline:2px solid var(--ink);outline-offset:2px}
#accountDialog .account-tabs button {background:transparent!important;transition:color .2s,opacity .2s;color:var(--ink)}
#accountDialog .account-tabs button:is(:hover:not(:where(.virtual-cursor-active *)),.gamepad-hover,:focus-visible) {background:transparent!important;opacity:1;color:var(--ink)}
#accountDialog .account-message {position:absolute;left:312px;right:28px;bottom:18px;margin:0;padding:12px 16px;opacity:0;transform:translateY(calc(100% + 40px));pointer-events:none;transition:opacity .28s ease,transform .32s ease;z-index:5}
#accountDialog .account-message:empty {padding:0;border:0}
#accountDialog .account-message.is-shown {opacity:1;transform:translateY(0)}
@media(max-width:760px) {
  .account-identity-top {display:contents}
  .account-quote {grid-column:1/-1;margin:12px 0 4px;font-size:15px;padding:4px 0 4px 12px;max-height:80px;overflow-y:auto;scrollbar-width:none}
  .account-quote.is-empty {display:none}
  #accountDialog .account-message {left:16px;right:16px;bottom:16px;font-size:12px;padding:12px 12px}
}
@media(prefers-reduced-motion:reduce) {
  #accountDialog .account-message {transition:opacity .12s;transform:none}
}

/* Charm showcase and profile refinements. */
.account-quote {flex:0 1 auto;max-height:200px}
#accountAvatar {padding:0;display:grid;place-items:center;background:transparent;color:var(--ink);cursor:pointer}
#accountProfileForm>.account-primary {display:flex;margin:24px auto 0;width:min(100%,360px)}
#accountCharm {position:relative;min-height:100%}
#accountCharm.has-charm h2 {padding-right:152px}
#accountRemoveCharm {position:absolute;right:4px;top:0;padding-block:4px;font-size:13px}
.charm-showcase {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr);gap:12px;align-items:stretch;min-height:360px}
.charm-art,.charm-benefits {min-width:0;border:1px solid color-mix(in srgb,var(--ink) 45%,transparent);border-radius:16px;background:color-mix(in srgb,var(--bg) 60%,transparent);color:var(--ink)}
.charm-art {display:flex;align-items:center;justify-content:center;padding:8px;cursor:zoom-in;overflow:hidden}
.charm-art :is(video,img) {width:100%;max-height:340px;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.charm-benefits {padding:16px}.charm-benefits h3 {margin:0 0 12px}.charm-benefits ul {padding-left:16px;margin:0;font-size:13px;line-height:1.5}.charm-benefits li+li {margin-top:8px}
#charmMediaViewer {border:1px solid var(--ink);border-radius:20px;background:var(--bg);color:var(--ink);padding:44px 20px 20px;max-width:90vw;max-height:90dvh;overflow:hidden}
#charmMediaViewer::backdrop {background:#0009;backdrop-filter:blur(8px)}
#charmMediaViewer>button {position:absolute;top:5px;right:5px}#charmMediaViewer :is(video,img) {display:block;width:min(70vw,650px);height:70dvh;object-fit:contain;image-rendering:pixelated}
@media(max-width:900px){.charm-showcase{grid-template-columns:1fr 1fr;min-height:0}.charm-benefits{grid-column:1/-1}.charm-art :is(video,img){height:180px}.account-quote{max-height:100px}}

.account-achievement-icon img,.achievement-toast-icon img {display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
@media(min-width:761px){
 .account-panel {padding-bottom:0}
 #accountPanel-profile:not([hidden]),#accountPanel-vip:not([hidden]) {display:flex;flex-direction:column}
 #accountProfile,#accountCharm {flex:1;min-height:100%;display:flex;flex-direction:column}
 #accountProfileForm {display:flex;flex-direction:column;flex:1}
 #accountProfileForm>.account-primary {margin:24px auto 0;margin-top:auto;flex:none}
 #accountProfileForm>textarea {margin-bottom:24px;flex:none}
 .charm-showcase {flex:1}
}
@media(min-width:761px){
 #accountProfileForm {min-height:0}
 #accountProfileForm>label {margin:12px 0 8px;flex:none}
 #accountProfileForm>label:first-child {margin-top:0}
 #accountProfileForm>.account-muted {margin:8px 0}
 #accountProfileForm>input,#accountProfileForm>.account-upload {flex:none}
}

/* Tint grayscale art without flattening its shades or alpha channel. */
.theme-icon-filters {position:absolute;pointer-events:none;overflow:hidden}
.theme-icon-accent {flood-color:var(--ink)}
.information-icon,.account-achievement-icon img,.achievement-toast-icon img {filter:url(#themeIconOverlay)}
