@import url("./segmented-control.css");

.profile-layout { min-height: 100dvh; padding-top: var(--dev-banner-height, 0px); background: var(--color-background); color: var(--color-text); }
.profile-back { display: grid; place-items: center; width: 2rem; height: 2rem; margin-inline: -.3125rem; padding: 0; border-radius: 35%; color: var(--color-text-muted); text-decoration: none; }
.profile-back svg { width: 1.375rem; height: 1.375rem; }
.profile-back:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); color: color-mix(in srgb, var(--color-text-muted) 80%, var(--color-text)); }
.profile-text-button:not(.profile-reset):hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 5%, transparent); color: var(--color-text); }
.profile-main { min-width: 0; }
.profile-page-heading { padding: 1rem 1.25rem; color: var(--color-text); }
.profile-content { --profile-content-padding: 2rem; max-width: 48rem; margin: 1rem auto 0; padding: 0 var(--profile-content-padding) calc(6rem + env(safe-area-inset-bottom, 0px)); }
.profile-identity { display: flex; flex-direction: column; align-items: center; padding: .75rem 0 3.5rem; text-align: center; }
.profile-photo-button { position: relative; display: block; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: white; cursor: pointer; }
.profile-photo-button:hover:not(:disabled) { opacity: .9; }
.profile-avatar { display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: 50%; background: var(--avatar-background); color: var(--avatar-foreground); font-size: 2rem; line-height: 1; }
.profile-avatar > * { display: grid; place-items: center; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.profile-photo-badge { position: absolute; right: -.125rem; bottom: -.125rem; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; border: 3px solid var(--color-background); border-radius: 50%; background: var(--color-surface-subtle); color: var(--color-text); }
.profile-photo-badge svg { display: block; width: 1rem; height: 1rem; }
.profile-name { display: flex; align-items: center; justify-content: center; gap: .5rem; max-width: 100%; margin-top: 1rem; }
.profile-identity :is(h1, h3) { min-width: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 400; overflow-wrap: anywhere; }
.profile-joined { max-width: 100%; margin-top: .25rem; color: var(--codex-text-muted); overflow-wrap: anywhere; }
.profile-plan { flex: none; }
.profile-photo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.profile-text-button { padding: .375rem .625rem; border: 0; border-radius: 999px; background: transparent; color: var(--codex-text-muted); font: inherit; cursor: pointer; }
.profile-section h2 { font-size: 1rem; font-weight: 400; line-height: 1.5rem; margin-bottom: 1.5rem; }
.profile-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 1.5rem; margin-bottom: 1.75rem; }
.profile-help { margin-top: .375rem; color: var(--codex-text-muted); font-size: .875rem; line-height: 1.4; }
.profile-username-input { display: flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); border-radius: .75rem; background: var(--color-surface-subtle); color: var(--color-text-muted); }
.profile-username-input:focus-within { border-color: var(--color-text-muted); }
.profile-username-input .input { flex: 1; min-width: 0; width: 100%; min-height: 0; margin-inline: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--color-text); }
.profile-username-input .input:focus-visible { outline: none; box-shadow: none; }
.profile-colors { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; min-height: 2.5rem; }
.profile-color { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; padding: 0; background: var(--avatar-background); color: white; cursor: pointer; }
.profile-color svg { display: block; width: 1rem; height: 1rem; stroke-width: 2.5; }
.profile-color:hover:not(:disabled) { opacity: .8; }
.profile-color[data-state="checked"] { outline: 1px solid var(--color-text-muted); outline-offset: 3px; }
.profile-color:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; }
.profile-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem calc(-1 * var(--profile-content-padding)) 0; padding: 1.5rem var(--profile-content-padding) 0; border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); }
.profile-form-leading { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; min-width: 0; }
.profile-reset { min-height: 2.5rem; padding: .5rem 0; color: var(--color-text-muted); }
.profile-reset:hover:not(:disabled) { color: color-mix(in srgb, var(--color-text-muted) 80%, var(--color-text)); }
.profile-feedback { min-width: 0; color: var(--codex-text-muted); overflow-wrap: anywhere; }
.profile-error { color: var(--color-error); }
.profile-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex: none; }
.button.profile-save { position: relative; min-height: 2.5rem; padding: .5rem 1rem; border-radius: 999px; background: var(--color-text); color: var(--color-background); font-weight: 400; }
.button.profile-save:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 90%, transparent); }
.profile-signout { position: relative; min-height: 2.5rem; padding: .5rem 1rem; border: 1px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--color-text) 6%, transparent); color: var(--color-text); font: inherit; cursor: pointer; }
.profile-signout:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 10%, transparent); }
.profile-layout button:disabled { cursor: default; opacity: .45; }
.profile-layout :is(.profile-save, .profile-signout)[aria-busy="true"] { opacity: 1; }
:is(.profile-save, .profile-signout)[aria-busy="true"] > span { visibility: hidden; }
:is(.profile-save, .profile-signout)[aria-busy="true"]::after { content: ''; position: absolute; inset: 0; width: var(--button-spinner-size); height: var(--button-spinner-size); margin: auto; background: currentColor; mask: var(--loading-spokes-mask); animation: profile-saving-spin .8s linear infinite; }
@keyframes profile-saving-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { :is(.profile-save, .profile-signout)[aria-busy="true"]::after { animation: none; } }
@media (max-width: 900px) { .profile-content { --profile-content-padding: 1.5rem; } .profile-edit-row { gap: 1rem; } .profile-colors { gap: .625rem; } }
@media (max-width: 640px) {
  .profile-page-heading { padding: .75rem .5rem; }
  .profile-content { --profile-content-padding: 1.25rem; margin-top: 2rem; }
  .profile-identity { padding-bottom: 2.5rem; }
  .profile-edit-row { grid-template-columns: 1fr; gap: .75rem; }
  .profile-form-footer { align-items: flex-start; flex-direction: column; }
  .profile-form-actions { align-self: flex-end; }
}

.group-display[data-profile-open] .group-scroll { overflow: hidden; }
.profile-modal { --modal-width: 38rem; --modal-max-height: 44rem; }
.profile-modal-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.profile-modal .profile-content { margin: 0; padding: 0; max-width: none; }
.profile-modal .profile-identity { padding: .25rem 0 1.75rem; }
.profile-modal .profile-avatar { width: 4.5rem; height: 4.5rem; font-size: 1.75rem; }
.profile-modal .profile-photo-badge { border-color: var(--review-surface); }
.profile-modal :is(.profile-help, .profile-joined, .profile-plan, .profile-feedback) { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.profile-modal .profile-plan { border-color: color-mix(in srgb, var(--color-text) 10%, transparent); }
.profile-modal .profile-username-input { background: var(--modal-field-background); border-color: color-mix(in srgb, var(--color-text) 10%, transparent); }
.profile-modal .profile-username-input .input { color: var(--color-text); }
.profile-modal .profile-signout { color: var(--color-text); }
.profile-modal .profile-signout { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.profile-modal .profile-signout:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 10%, transparent); }
.profile-modal .profile-save { background: var(--color-text); color: var(--color-background); }
.profile-modal .profile-save:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 90%, transparent); }
.profile-modal .profile-section h2 { margin-bottom: 1.25rem; }
.profile-modal .profile-colors { gap: .5rem; }
.profile-modal .profile-error { color: var(--color-error); }
.profile-modal .profile-edit-row { margin-bottom: 1.5rem; }
.profile-modal .profile-edit-row:last-child { margin-bottom: 0; }
.profile-modal .profile-form-footer { margin: 0; border: 0; padding: 1.25rem var(--modal-padding) var(--modal-padding); }
.profile-modal .profile-feedback { font-size: .875rem; }
.profile-modal button:disabled { cursor: default; opacity: .45; }
.profile-modal .profile-save[aria-busy="true"] { opacity: 1; }
.profile-modal .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.profile-modal-loading { display: grid; place-items: center; min-height: 13rem; }
.profile-modal-spinner { width: 1.25rem; height: 1.25rem; background: currentColor; color: var(--color-text-muted); mask: var(--loading-spokes-mask); animation: profile-saving-spin .8s linear infinite; }
.profile-modal-error { display: grid; justify-items: start; gap: 1rem; min-height: 8rem; }
@media (prefers-reduced-motion: reduce) { .profile-modal-spinner { animation: none; } }
@media (max-width: 640px) {
  .profile-modal .profile-form-footer { gap: .75rem; }
  .profile-modal .profile-form-actions { flex-wrap: wrap; }
}

.profile-appearance { margin-top: 2rem; }
.profile-theme-row { align-items: center; }
.profile-theme-row:last-child { margin-bottom: 0; }
.profile-theme-row .segmented-control { width: 100%; }
