* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
}
a { color: inherit; }
.account-product-head { position: sticky; top: 0; z-index: 20; }
.fs-signout {
  min-height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font: 650 11px var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.fs-signout svg { width: 15px; height: 15px; flex: 0 0 auto; }
.fs-signout:hover { color: var(--text); background: var(--surface2); }
.fs-signout:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fs-signout:disabled { opacity: .55; cursor: wait; }

.account-wrap {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 86px) clamp(20px, 4vw, 42px) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .78fr);
  gap: clamp(44px, 8vw, 100px);
  align-items: start;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-t);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.intro { padding-top: 18px; }
.intro h1 {
  max-width: 650px;
  margin: 0;
  font: 720 clamp(38px, 5.4vw, 64px)/1.01 var(--font-sans);
  letter-spacing: -.04em;
}
.intro > p:not(.eyebrow) {
  max-width: 570px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.rank-list { margin-top: 38px; border-top: 1px solid var(--line); }
.rank-list div {
  min-height: 68px;
  padding: 15px 0;
  display: grid;
  grid-template-columns: 30px 92px 1fr;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.rank-index { color: var(--accent); font: 11px/1.6 var(--font-mono); }
.rank-list b { font-size: 12px; letter-spacing: .01em; }
.rank-list div > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.55; }

.auth-card {
  overflow: hidden;
  padding: 28px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.16);
  backdrop-filter: blur(18px);
}
.auth-heading { margin-bottom: 22px; }
.auth-heading .eyebrow { margin-bottom: 7px; }
.auth-heading h2 { margin: 0; font: 720 27px/1.1 var(--font-sans); letter-spacing: -.035em; }
.auth-heading > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tabs:has(.tab[hidden]) { grid-template-columns: 1fr; }
.tab {
  height: 44px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--faint);
  background: transparent;
  font: 650 12px var(--font-sans);
  cursor: pointer;
  transition: color var(--mo-1) var(--mo-ease), background var(--mo-1) var(--mo-ease);
}
.tab.is-on { color: var(--text); background: var(--surface2); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tab:not(:disabled):hover { color: var(--text); background: var(--surface2); }
.tab:disabled {
  color: var(--faint);
  background: color-mix(in srgb, var(--line) 58%, transparent);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}
.tab:disabled:hover,
.tab:disabled:active { transform: none; }
.google, .primary, .secondary {
  width: 100%;
  min-height: 46px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 680 12px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--mo-1) var(--mo-ease), border-color var(--mo-1) var(--mo-ease), background var(--mo-1) var(--mo-ease);
}
.google:hover, .primary:hover, .secondary:hover { transform: translateY(-1px); }
.primary:disabled, .secondary:disabled, .avatar-change:disabled, .avatar-remove:disabled, .text-action:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}
.primary:disabled:hover { background: color-mix(in srgb, var(--accent) 30%, var(--surface2)); border-color: var(--accent-w); }
.secondary:hover { border-color: var(--accent); }
.google { color: var(--text); background: var(--bg); border: 1px solid var(--line2); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.google:hover { background: var(--surface2); border-color: color-mix(in srgb, var(--text) 24%, var(--line2)); }
.google-mark { width: 20px; height: 20px; padding: 2px; display: grid; place-items: center; border-radius: 5px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.google-mark svg { width: 100%; height: 100%; display: block; }
.or { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.form { display: flex; flex-direction: column; gap: 15px; }
.form[hidden] { display: none; }
.form label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px var(--font-sans);
  transition: border-color var(--mo-1) var(--mo-ease), box-shadow var(--mo-1) var(--mo-ease);
}
.form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form input[aria-invalid="true"] { border-color: var(--text); }
.form-help { margin: -1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.text-action { display: block; min-height: 44px; margin: 10px auto 0; padding: 10px 6px; border: 0; background: transparent; color: var(--accent-t); font: 650 11px var(--font-sans); cursor: pointer; }
.text-action:hover { text-decoration: underline; }
.recovery-form { margin-top: 2px; }
.primary { margin-top: 5px; border: 1px solid var(--accent-w); background: color-mix(in srgb, var(--accent) 30%, var(--surface2)); color: var(--accent-t); }
.primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 40%, var(--surface2)); border-color: var(--accent); color: var(--text); }
.secondary { margin-top: 5px; border: 1px solid var(--line2); background: var(--surface2); color: var(--text); }

.account-wrap.is-signed-in { grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 68px); }
.account-wrap.is-signed-in .intro { position: sticky; top: 112px; }
.account-wrap.is-signed-in .intro h1 { font-size: clamp(32px, 3.4vw, 46px); }
.account-wrap.is-signed-in .rank-list div { grid-template-columns: 25px 72px 1fr; }
.account-wrap.is-signed-in .auth-card { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }

.account-summary {
  min-height: 108px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surface), var(--surface2));
}
.account-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-w);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-t);
  font: 760 16px var(--font-sans);
  letter-spacing: .04em;
  overflow: hidden;
}
.account-avatar img, .profile-avatar-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-summary .eyebrow { margin-bottom: 4px; }
.account-summary h2 { margin: 0; font: 720 25px/1.1 var(--font-sans); letter-spacing: -.03em; }
.account-summary-copy { min-width: 0; overflow-wrap: anywhere; }
.muted, .message, .setup { color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-summary .muted { margin: 4px 0 0; }
.rank { display: inline-flex; padding: 6px 10px; border: 1px solid var(--plus-w); border-radius: 999px; color: var(--plus-t); background: var(--plus-soft); font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .11em; }

.account-panels { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.account-panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--surface);
}
.panel-icon { width: 34px; height: 34px; margin-bottom: 17px; padding: 8px; border: 1px solid var(--line2); border-radius: 9px; color: var(--accent); background: var(--surface2); }
.profile-heading { min-height: 48px; margin-bottom: 2px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.profile-heading h3 { margin: 3px 0 0; font: 700 17px var(--font-sans); letter-spacing: -.02em; }
.profile-heading span { color: var(--accent-t); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.profile-heading small { max-width: 110px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: right; }
.avatar-editor { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 15px; margin: 9px 0 3px; padding: 14px; border: 1px solid var(--line2); border-radius: 12px; background: linear-gradient(145deg, var(--surface2), color-mix(in srgb, var(--surface2) 94%, var(--accent))); transition: opacity var(--mo-1) var(--mo-ease), border-color var(--mo-1) var(--mo-ease); }
.avatar-editor:focus-within { border-color: var(--accent-w); box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar-editor.is-uploading { opacity: .62; }
.profile-avatar-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--accent-w); border-radius: 17px; background: var(--accent-soft); color: var(--accent-t); font: 760 17px var(--font-sans); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.avatar-editor-copy strong, .avatar-editor-copy > span { display: block; }
.avatar-editor-copy strong { font-size: 12px; letter-spacing: -.01em; }
.avatar-editor-copy > span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.avatar-editor-copy small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.avatar-change, .avatar-remove { min-height: 44px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); color: var(--text); font: 680 11px var(--font-sans); cursor: pointer; transition: border-color var(--mo-1) var(--mo-ease), background var(--mo-1) var(--mo-ease), color var(--mo-1) var(--mo-ease); }
.avatar-change { border-color: var(--accent-w); background: var(--accent-soft); color: var(--accent-t); }
.avatar-remove { color: var(--muted); }
.avatar-change:hover { border-color: var(--accent); }
.avatar-remove:hover { border-color: color-mix(in srgb, var(--s4) 48%, var(--line2)); color: var(--s4); }
.avatar-change:focus-visible, .avatar-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.security-action { margin-top: 5px; }
.settings-callout {
  grid-column: 1 / -1;
  min-height: 98px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--surface);
}
.settings-callout .eyebrow { margin-bottom: 4px; }
.settings-callout h3 { max-width: 620px; margin: 0; color: var(--muted); font: 600 13px/1.5 var(--font-sans); }
.settings-callout a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 12px; padding: 10px 13px; border: 1px solid var(--line2); border-radius: 8px; color: var(--text); background: var(--surface2); font-size: 11px; font-weight: 700; text-decoration: none; }
.settings-callout a span { color: var(--accent); }
.message { min-height: 20px; margin: 14px 2px 0; color: var(--accent-t); }
.message:empty { min-height: 0; margin: 0; }
.avatar-editor > .message { grid-column: 1 / -1; margin-top: 0; }
.form > .message { margin-top: 0; }
.message.error { color: var(--s4); }
.setup { margin-top: 14px; padding: 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface2); }

@media (max-width: 900px) {
  .account-wrap, .account-wrap.is-signed-in { grid-template-columns: 1fr; gap: 34px; padding-top: 42px; }
  .account-wrap.is-signed-in .intro { position: static; }
  .intro { padding-top: 0; }
  .intro h1, .account-wrap.is-signed-in .intro h1 { font-size: clamp(36px, 8vw, 52px); }
  .rank-list { display: none; }
}
@media (max-width: 680px) {
  .fs-signout { width: 44px; min-height: 44px; padding: 0; }
  .fs-signout span { display: none; }
  .account-wrap { padding-left: 16px; padding-right: 16px; }
  .auth-card { padding: 20px; }
  .account-wrap.is-signed-in .auth-card { padding: 0; }
  .account-summary { grid-template-columns: 48px minmax(0, 1fr); padding: 18px; }
  .account-avatar { width: 48px; height: 48px; }
  .account-summary .rank { grid-column: 2; justify-self: start; }
  .account-panels { grid-template-columns: 1fr; }
  .account-panel { padding: 19px; }
  .avatar-editor { grid-template-columns: 62px minmax(0, 1fr); padding: 12px; }
  .profile-avatar-preview { width: 62px; height: 62px; border-radius: 15px; }
  .settings-callout { grid-column: auto; align-items: stretch; flex-direction: column; }
  .settings-callout a { justify-content: space-between; }
}
@media (min-width: 681px) and (max-width: 1100px) {
  .account-panels { grid-template-columns: minmax(0, 1fr); }
}


/* Account interaction pass. Authentication is a deliberate workflow, so its
   motion explains state changes (which form is active, whether a save landed)
   while keeping every control usable on the first frame. */
body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 18%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30%),
    radial-gradient(circle at 88% 28%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 26%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 64px 0 0;
  z-index: 0;
  pointer-events: none;
  opacity: .3;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.account-wrap { position: relative; z-index: 1; }

@keyframes accountEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes accountSlide {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes accountTrace {
  from { transform: translateX(-115%); }
  to { transform: translateX(230%); }
}

.intro,
.auth-card {
  animation: accountEnter var(--mo-3) var(--mo-ease) both;
}
.auth-card { position: relative; animation-delay: 48ms; }
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: accountTrace 720ms var(--mo-ease) 120ms both;
  pointer-events: none;
}
.auth-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line2));
  box-shadow: 0 28px 74px rgba(0,0,0,.18), 0 0 34px color-mix(in srgb, var(--accent) 8%, transparent);
}

.form:not([hidden]),
#signed-in:not([hidden]),
.message:not(:empty) {
  animation: accountSlide var(--mo-3) var(--mo-ease) both;
}
.tab,
.fs-signout,
.text-action,
.avatar-change,
.avatar-remove,
.settings-callout a {
  transition: transform var(--mo-1) var(--mo-ease), color var(--mo-1) var(--mo-ease), background-color var(--mo-1) var(--mo-ease), border-color var(--mo-1) var(--mo-ease), box-shadow var(--mo-2) var(--mo-ease);
}
.tab:hover,
.fs-signout:hover,
.settings-callout a:hover { transform: translateY(-1px); }
.tab:active,
.fs-signout:active,
.text-action:active,
.avatar-change:active,
.avatar-remove:active,
.settings-callout a:active,
.google:active,
.primary:active,
.secondary:active { transform: scale(.98); }

.rank-list div,
.account-panel,
.account-summary,
.settings-callout {
  transition: transform var(--mo-2) var(--mo-ease), border-color var(--mo-2) var(--mo-ease), box-shadow var(--mo-2) var(--mo-ease), background-color var(--mo-2) var(--mo-ease);
}
.rank-list div:hover { transform: translateX(4px); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.account-panel:focus-within,
.account-summary:hover,
.settings-callout:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line2));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--text) 8%, transparent);
}
.account-panel:focus-within { transform: translateY(-2px); }
.settings-callout a span { transition: transform var(--mo-1) var(--mo-ease); }
.settings-callout a:hover span { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
