.customer-profile {
  --profile-copy: #33282d;
  --profile-secondary: #63535b;
  --profile-surface: #fffaf8;
  --profile-control: #fff;
  --profile-border: #866e79;
  --profile-focus: #8a3455;
  color: var(--profile-copy);
}

:root[data-theme="dark"] .customer-profile {
  --profile-copy: #f9eef3;
  --profile-secondary: #d4bec9;
  --profile-surface: #261e24;
  --profile-control: #382a34;
  --profile-border: #9d7d8d;
  --profile-focus: #f2a8c8;
}

.customer-profile .auth-form label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--profile-copy);
}

.customer-profile .phone-field small,
.customer-profile .avatar-picker small {
  font-size: 13px;
  line-height: 1.6;
  color: var(--profile-secondary);
}

.phone-field .phone-input-row {
  direction: ltr;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.phone-input-row > .field-control {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.phone-field .whatsapp-confirm {
  justify-self: start;
  min-height: 44px;
}

.customer-profile .profile-fields .field-control,
.customer-profile .avatar-editor-controls :is(select, input[type="color"]) {
  min-height: 44px;
  padding: .5rem .65rem;
  border: 1px solid var(--profile-border);
  border-radius: 8px;
  background: var(--profile-control);
  color: var(--profile-copy);
  font: inherit;
  font-size: 16px;
}

.customer-profile .profile-fields :is(input, select, button, summary, .avatar-upload-label):focus-visible,
.customer-profile .avatar-upload-label:focus-within {
  outline: 2px solid var(--profile-focus);
  outline-offset: 3px;
}

.customer-profile .avatar-picker {
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid var(--profile-border);
  background: var(--profile-surface);
}

.customer-profile .avatar-picker legend {
  font-size: 17px;
  color: var(--profile-copy);
}

.customer-profile .avatar-grid {
  display: block !important;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.avatar-portrait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: .55rem;
}
.avatar-portrait-choice {
  padding: 2px;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
}
.avatar-portrait-choice img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.customer-profile img[data-avatar-mirror] { transform: scaleX(-1); }
.avatar-portrait-choice[aria-pressed="true"] { border-color: var(--profile-focus, var(--wine)); }
.avatar-portrait-choice:focus-visible { outline: 2px solid var(--profile-focus, var(--wine)); outline-offset: 2px; }

.customer-profile .avatar-editor {
  grid-template-columns: minmax(96px, 28%) minmax(0, 1fr);
  gap: clamp(.75rem, 2vw, 1.25rem);
}

.customer-profile .avatar-maker-preview {
  inset-block-start: 90px;
  border: 2px solid var(--profile-border);
}

.customer-profile .avatar-maker-panels { gap: .6rem; }
.customer-profile .avatar-maker-panels details { padding: .75rem; border-color: var(--profile-border); }
.customer-profile .avatar-maker-panels summary {
  min-height: 32px;
  font-size: 15px;
  line-height: 2;
  color: var(--profile-copy);
}

.customer-profile .avatar-editor-controls label { gap: .35rem; min-width: 0; }
.customer-profile .avatar-editor-controls .avatar-art-credit,
.customer-profile .avatar-editor-controls .avatar-status { grid-column: 1 / -1; }
.customer-profile .avatar-art-credit { font-size: 12px; color: var(--profile-secondary); text-decoration: underline; }
.customer-profile .avatar-status { color: var(--profile-secondary); margin: 0; }
.customer-profile .avatar-status:empty { display: none; }
.avatar-tabbed-controls { min-width: 0; display: grid; gap: .75rem; }
.avatar-tablist { display: flex; flex-wrap: wrap; gap: .45rem; }
.avatar-tablist button, .avatar-option-grid button {
  border: 1px solid var(--profile-border, #987980);
  border-radius: 10px;
  background: var(--profile-control, var(--white));
  color: var(--profile-copy, var(--ink));
  font: inherit;
  cursor: pointer;
}
.avatar-tablist button { display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: .35rem .65rem; font-size: 13px; }
.avatar-tablist button[aria-selected="true"], .avatar-option-grid button[aria-pressed="true"] {
  border-color: var(--profile-focus, var(--wine));
  box-shadow: inset 0 0 0 1px var(--profile-focus, var(--wine));
}
.avatar-tablist button:focus-visible, .avatar-option-grid button:focus-visible {
  outline: 2px solid var(--profile-focus, var(--wine));
  outline-offset: 2px;
}
.avatar-tabpanel { min-width: 0; }
.avatar-option-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(65px,1fr)); gap: .5rem; }
.avatar-option-grid button { display: grid; justify-items: center; align-content: start; padding: .3rem; gap: .3rem; min-width: 0; font-size: 11px; }
.avatar-option-grid button canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
.avatar-swatch { display: block; width: 36px; height: 36px; border: 1px solid var(--profile-border, #987980); border-radius: 50%; }
.avatar-tab-tools { display: flex; flex-wrap: wrap; gap: .65rem; margin-block-end: .75rem; }
.customer-profile .avatar-tab-tools label { display: flex; gap: .3rem; }
.avatar-tab-tools :is(input,select) {
  min-height: 42px;
  min-width: 68px;
  font: inherit;
  color: var(--profile-copy, var(--ink));
  background: var(--profile-control, var(--white));
  border: 1px solid var(--profile-border,#987980);
  border-radius: 7px;
  padding: .35rem;
}
.avatar-tabbed-controls > .button-outline { justify-self: start; min-height: 44px; }
.customer-profile .avatar-editor-controls input[type="color"] { padding: .3rem; }
.customer-profile .avatar-upload-label { min-height: 44px; border-color: var(--profile-border); }

@media (max-width: 560px) {
  .customer-profile .avatar-picker { padding: .8rem; }
  .customer-profile .avatar-editor { grid-template-columns: minmax(0, 1fr); }
  .customer-profile .avatar-maker-preview {
    position: static;
    justify-self: center;
    width: clamp(105px, 36vw, 150px);
  }
  .customer-profile .avatar-editor-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .customer-profile .avatar-editor-controls { grid-template-columns: minmax(0, 1fr); }
}
[data-google-identity] {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
}
[data-google-identity][hidden], [data-auth-provider="google"][hidden] { display: none; }
.social-buttons[data-auth-provider-area] {
  --google-glass: linear-gradient(145deg, #ffffffd9, #f2dce576);
  --google-rim: #80596d55;
  --google-glow: #74475d26;
  display: grid;
  width: min(100%, 300px);
  margin-inline: auto;
  padding: 7px;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--google-rim);
  border-radius: 999px;
  background: var(--google-glass);
  box-shadow: inset 0 1px 1px #ffffff75, 0 5px 15px var(--google-glow);
  backdrop-filter: blur(14px) saturate(140%);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
:root[data-theme="dark"] .social-buttons[data-auth-provider-area] {
  --google-glass: linear-gradient(145deg, #e7a8c235, #b5749120);
  --google-rim: #f3c4d767;
  --google-glow: #09040688;
}
.social-buttons[data-auth-provider-area]:is(:hover, :focus-within) {
  box-shadow: inset 0 1px 2px #ffffff92, 0 8px 20px var(--google-glow);
  transform: translateY(-1px);
}
.social-buttons[data-auth-provider-area] > button[data-auth-provider="google"] {
  min-height: 44px;
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  box-shadow: inset 0 1px 0 #ffffff55;
}
@media (prefers-reduced-motion: reduce) {
  .social-buttons[data-auth-provider-area] { transition: none; }
  .social-buttons[data-auth-provider-area]:is(:hover, :focus-within) { transform: none; }
}

/* Clip the opaque Google frame edges in dark mode. */
:root[data-theme="dark"] [data-google-identity] iframe {
  clip-path: inset(2px 9px round 999px);
}
.account-signin .auth-mode-toggle {
  display: block;
  width: fit-content;
  max-width: 100%;
}
:root[data-theme="dark"] .account-signin .auth-form label,
:root[data-theme="dark"] .account-signin .form-divider {
  color: #d7c5cd;
}

.account-layout { align-items: start; }
.account-layout > .account-signin {
  min-width: 0;
  padding: clamp(16px, 4vw, 36px);
  border-radius: 20px;
}
.account-signin .auth-form .field-control { border-radius: 10px; }
.account-signin .password-control .field-control { padding-inline-end: 50px; }
.account-signin .password-control .password-eye {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: inherit;
}
.account-signin button.auth-mode-toggle:not([hidden]) {
  min-height: 44px;
  margin-block: 9px 0;
  padding: 8px 15px;
  text-decoration: none;
}
.account-signin .form-divider { margin-block: 16px 9px; }
.account-signin .social-buttons[data-auth-provider-area] {
  padding-block: 2px;
  border-color: var(--google-rim);
  box-shadow: inset 0 1px 1px #ffffff40, 0 3px 8px var(--google-glow);
}
.account-admin-entry { margin-block-start: 18px; }
.account-admin-entry .owner-access-link { font-size: .875rem; }
@media (max-width: 720px) {
  .account-layout > .account-aside { display: none; }
  .account-page .page-lede { margin-block-end: 18px; }
  .account-page .page-lede h1 { font-size: clamp(1.85rem, 7vw, 2.4rem); }
}

.account-signin .social-buttons[data-auth-provider-area]:not([hidden]) {
  position: relative;
  width: min(100%, 280px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
}
.account-signin .social-buttons[data-auth-provider-area] > button[data-auth-provider="google"] {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
}
.account-signin [data-google-identity]:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .01 !important;
}
:root[data-theme="dark"] .account-signin [data-google-identity] iframe { clip-path: none; }
.account-signin .social-buttons[data-auth-provider-area]:focus-within {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.account-signin .social-buttons[data-auth-provider-area]:active > button {
  opacity: .72;
}

.account-signin .social-buttons[data-auth-provider-area] > button[data-auth-provider="google"] {
  background: linear-gradient(145deg, #ffffff14, #ffffff05);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
}
