.profile-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.profile-main {
  flex: 1;
  width: 100%;
  padding:
    clamp(96px, 14vh, 128px)
    clamp(20px, 4vw, 48px)
    clamp(64px, 10vh, 96px);
}

.profile-shell {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  width: fit-content;
  transition: color 0.2s ease;
}

.profile-back:hover {
  color: var(--text);
}

.profile-card {
  position: relative;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  box-shadow: var(--shadow, 0 8px 32px rgba(15, 23, 42, 0.04));
  padding: clamp(20px, 3.5vw, 28px);
}

.profile-loading {
  display: none;
}

.profile-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-skeleton.hidden {
  display: none;
}

.profile-skeleton-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.profile-skeleton-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.profile-skeleton-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-skeleton-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.profile-skeleton-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 4px;
}

.profile-skeleton-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-skeleton-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: #fafbfc;
}

.profile-skeleton-line,
.profile-skeleton-block,
.profile-skeleton-pill,
.profile-skeleton-card {
  border-radius: 8px;
}

.profile-skeleton-line {
  height: 12px;
  max-width: 100%;
}

.profile-skeleton-line--xs {
  width: 72%;
  height: 10px;
}

.profile-skeleton-line--sm {
  width: 40%;
  height: 14px;
}

.profile-skeleton-line--md {
  width: 56%;
}

.profile-skeleton-line--lg {
  width: 48%;
  height: 22px;
  border-radius: 10px;
}

.profile-skeleton-block {
  height: 40px;
  width: 100%;
  border-radius: 10px;
}

.profile-skeleton-pill {
  height: 36px;
  width: 120px;
  border-radius: 999px;
}

.profile-skeleton-pill--sm {
  width: 96px;
  height: 34px;
  flex-shrink: 0;
}

.profile-skeleton-card {
  height: 56px;
  width: 100%;
  border-radius: 12px;
}

.profile-skeleton-pulse {
  background: linear-gradient(
    90deg,
    #e8edf3 0%,
    #f1f5f9 45%,
    #e8edf3 90%
  );
  background-size: 220% 100%;
  animation: profile-skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes profile-skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.profile-content {
  animation: profile-content-in 0.28s ease;
}

@keyframes profile-content-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-skeleton-pulse {
    animation: none;
    background: #e8edf3;
  }

  .profile-content {
    animation: none;
  }

  .profile-spinner,
  .profile-btn--loading::before {
    animation: none;
    border-top-color: #0f172a;
  }
}

.profile-content.hidden {
  display: none;
}

/* ── Card top: identity + logout ── */

.profile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.profile-identity {
  flex: 1;
  min-width: 0;
}

.profile-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.profile-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.profile-avatar-edit svg {
  width: 14px;
  height: 14px;
}

.profile-avatar-edit:hover {
  background: #1e293b;
}

.profile-avatar-edit[aria-expanded="true"] {
  background: #334155;
}

.profile-avatar-wrap--loading .profile-avatar-edit {
  pointer-events: none;
  opacity: 0.5;
}

.profile-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(240px, calc(100vw - 48px));
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.profile-avatar-menu.hidden {
  display: none;
}

.profile-avatar-menu-status {
  padding: 8px 10px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-avatar-menu-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.profile-avatar-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}

.profile-avatar-menu-item:hover:not(:disabled) {
  background: #f1f5f9;
}

.profile-avatar-menu-item:disabled,
.profile-avatar-menu-item.profile-btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

.profile-avatar-menu-item--file {
  position: relative;
}

.profile-avatar-menu-formats {
  padding: 6px 10px 8px;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--muted);
  border-top: 1px solid var(--line, #e2e8f0);
  margin-top: 4px;
}

.profile-avatar-menu--loading {
  pointer-events: none;
  opacity: 0.72;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  z-index: 1;
}

.profile-avatar-overlay.hidden {
  display: none;
}

.profile-avatar-wrap--loading .profile-avatar,
.profile-avatar-wrap--loading .profile-avatar-fallback {
  opacity: 0.55;
}

.profile-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(15, 23, 42, 0.12);
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: profile-spin 0.75s linear infinite;
}

.profile-avatar-actions--loading,
.profile-avatar-menu--loading {
  opacity: 0.6;
  pointer-events: none;
}

.profile-form--loading {
  opacity: 0.72;
  pointer-events: none;
}

.profile-form--loading .profile-field input {
  background: #f8fafc;
}

@keyframes profile-spin {
  to {
    transform: rotate(360deg);
  }
}

.profile-avatar,
.profile-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-avatar {
  object-fit: cover;
  border: 2px solid var(--line, #e2e8f0);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: var(--text);
  font-size: 1.625rem;
  font-weight: 700;
}

.profile-header h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-email {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-bottom: 10px;
}

.profile-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-meta-item dt {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-meta-item dd {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
}

.profile-security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-form--panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 14px;
  min-height: 0;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}

.profile-badge-dot--muted {
  background: #94a3b8;
}

.profile-logout {
  appearance: none;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.profile-logout:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text);
}

/* ── Accordion ── */

.profile-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-accordion-item {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.profile-accordion-trigger {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-accordion-trigger:hover {
  background: #f8fafc;
}

.profile-accordion-item.is-open .profile-accordion-trigger {
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.profile-accordion-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.22s ease;
}

.profile-accordion-item.is-open .profile-accordion-chevron {
  transform: rotate(180deg);
}

.profile-accordion-panel[hidden] {
  display: none;
}

.profile-accordion-panel-inner {
  padding: 14px;
}

.profile-accordion-panel-inner .profile-body {
  gap: 12px;
}

.profile-section-empty {
  margin: 0;
  padding: 8px 4px 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.profile-skeleton-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-skeleton-accordion-item {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.profile-skeleton-accordion-item--open {
  padding-bottom: 16px;
}

.profile-skeleton-accordion-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e2e8f0);
}

/* ── Two-column body ── */

.profile-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: #fafbfc;
}

.profile-panel-content {
  flex: 1;
  min-height: 0;
}

.profile-panel-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.profile-panel-footer {
  margin-top: auto;
  padding-top: 4px;
}

.profile-panel-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.profile-panel-hint {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: -6px 0 0;
}

.profile-subsection-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e2e8f0);
}

.profile-password-block:first-of-type .profile-subsection-title {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ── Forms ── */

.profile-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.profile-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-btn--compact {
  align-self: flex-start;
  padding: 8px 14px;
}

.profile-btn--primary {
  border: none;
  background: #0f172a;
  color: #fff;
}

.profile-btn--primary:hover:not(:disabled) {
  background: #1e293b;
}

.profile-btn--secondary {
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: var(--text);
}

.profile-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.profile-btn--ghost {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(15, 23, 42, 0.25);
}

.profile-btn--ghost:hover:not(:disabled) {
  text-decoration-color: var(--text);
}

.profile-btn--file {
  position: relative;
}

.profile-btn--loading {
  position: relative;
  pointer-events: none;
  opacity: 0.88;
  padding-left: 36px;
}

.profile-btn--loading::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: profile-spin 0.75s linear infinite;
}

.profile-btn--secondary.profile-btn--loading::before,
.profile-btn--ghost.profile-btn--loading::before {
  border-color: rgba(15, 23, 42, 0.15);
  border-top-color: #0f172a;
}

.profile-btn--file.profile-btn--loading {
  padding-left: 36px;
}

.profile-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.profile-form--inline {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.profile-form--panel .profile-form-grid {
  margin-top: 0;
}

.profile-form--stacked {
  flex-direction: column;
  align-items: stretch;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.profile-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-field-optional {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 500;
}

.profile-field input {
  width: 100%;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.875rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease;
}

.profile-field input:focus {
  outline: none;
  border-color: #94a3b8;
}

.profile-field .auth-input-wrap {
  width: 100%;
}

.profile-field .auth-input-wrap input {
  width: 100%;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.875rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease;
}

.profile-field .auth-input-wrap--password input {
  padding-right: 42px;
}

.profile-field .auth-input-wrap input:focus {
  outline: none;
  border-color: #94a3b8;
}

/* ── Location autocomplete ── */

.profile-location-wrap {
  position: relative;
}

.profile-location-wrap input {
  width: 100%;
}

.profile-location-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
}

.profile-location-wrap.is-open .profile-location-panel,
.profile-location-wrap.has-suggestions .profile-location-panel {
  display: block;
}

.profile-location-suggestions {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  max-height: 220px;
  overflow-y: auto;
}

.profile-location-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

.profile-location-suggestion svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted);
}

.profile-location-suggestion:hover,
.profile-location-suggestion.is-active {
  background: #f1f5f9;
}

.profile-location-suggestion-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.profile-location-suggestion-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
}

.profile-location-suggestion.is-loading,
.profile-location-suggestion.is-empty {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  cursor: default;
}

/* ── Sign-in methods ── */

.profile-password-block.hidden {
  display: none;
}

/* ── Profile modal ── */

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.profile-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(90vh, 560px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  animation: profile-modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb, #0f172a) transparent;
}

.profile-modal-panel::-webkit-scrollbar {
  width: var(--scrollbar-size, 6px);
  height: var(--scrollbar-size, 6px);
}

.profile-modal-panel::-webkit-scrollbar-track {
  background: transparent;
}

.profile-modal-panel::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb, #0f172a);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.profile-modal-panel::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover, #1e3a5f);
}

.profile-modal-panel::-webkit-scrollbar-corner {
  background: transparent;
}

@keyframes profile-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.profile-modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.profile-modal-close {
  appearance: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.profile-modal-close svg {
  width: 18px;
  height: 18px;
}

.profile-modal-close:hover {
  background: rgba(15, 23, 42, 0.1);
}

.profile-modal-body {
  padding: 16px 20px 20px;
}

.profile-modal-hint {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 14px;
}

.profile-modal-body .profile-form--stacked {
  max-width: none;
}

.profile-modal-body .profile-password-block:not(.hidden) {
  display: block;
}

.profile-signin-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-signin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}

.profile-signin-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.profile-signin-icon--google {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E");
}

.profile-signin-icon--password {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%230f172a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M7 11V8a5 5 0 1 1 10 0v3M6 11h12v9H6z'/%3E%3C/svg%3E");
}

.profile-signin-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1px;
}

.profile-signin-item-detail {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

/* ── Toasts ── */

.profile-flash {
  display: none;
}

.profile-toast-stack {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100vw - 32px, 380px);
  pointer-events: none;
}

.profile-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: auto;
}

.profile-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-toast--leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.profile-toast--success {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.profile-toast--error {
  border-color: #fecaca;
  background: #fef2f2;
}

.profile-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-toast--success .profile-toast-icon {
  background: #10b981;
  color: #fff;
}

.profile-toast--error .profile-toast-icon {
  background: #ef4444;
  color: #fff;
}

.profile-toast-message {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}

.profile-toast-close {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}

.profile-toast-close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.06);
}

/* ── Responsive ── */

@media (max-width: 720px) {
  .profile-skeleton-accordion-body {
    grid-template-columns: 1fr;
  }

  .profile-body,
  .profile-skeleton-body {
    grid-template-columns: 1fr;
  }

  .profile-card-top {
    flex-direction: column;
  }

  .profile-logout {
    align-self: flex-start;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-form--inline {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-form--inline .profile-btn--compact {
    align-self: stretch;
  }
}

@media (max-width: 480px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .profile-meta {
    width: 100%;
  }

  .profile-skeleton-header {
    flex-direction: column;
    align-items: center;
  }

  .profile-skeleton-header-text {
    align-items: center;
    width: 100%;
  }

  .profile-skeleton-meta {
    width: 100%;
  }
}

.profile-accordion-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.profile-accordion-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.profile-accordion-badge.hidden {
  display: none;
}

.profile-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-favorites {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-favorites-group-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
}

.profile-favorites-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-favorites-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.profile-favorites-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.profile-favorites-link--static {
  cursor: default;
}

.profile-favorites-media {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-favorites-media--placeholder {
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.profile-favorites-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-favorites-copy strong {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-favorites-meta {
  font-size: 0.8125rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-favorites-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e11d48;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-favorites-remove svg {
  width: 18px;
  height: 18px;
}

.profile-favorites-remove:hover {
  background: #fff1f2;
}

.profile-appointments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-appointments-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.profile-appointments-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.profile-appointments-link:hover strong {
  text-decoration: underline;
}

.profile-appointments-link--static {
  flex: 1;
  min-width: 0;
}

.profile-appointments-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-appointments-copy strong {
  font-size: 0.98rem;
  font-weight: 600;
}

.profile-appointments-service {
  font-size: 0.88rem;
  color: var(--muted, #64748b);
}

.profile-appointments-when {
  font-size: 0.86rem;
  color: var(--muted, #64748b);
}

.profile-appointments-status {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.profile-appointments-status--pending {
  background: #fef3c7;
  color: #92400e;
}

.profile-appointments-status--confirmed {
  background: #d1fae5;
  color: #065f46;
}

.profile-appointments-status--cancelled {
  background: #f1f5f9;
  color: #475569;
}

.profile-appointments-status--completed {
  background: #e0e7ff;
  color: #3730a3;
}

.profile-appointments-status--no_show {
  background: #fee2e2;
  color: #991b1b;
}

.profile-appointments-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.profile-appointments-hint {
  margin: 0;
  max-width: 160px;
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  text-align: right;
}

@media (max-width: 640px) {
  .profile-appointments-item {
    flex-direction: column;
  }

  .profile-appointments-actions {
    align-items: stretch;
    width: 100%;
  }

  .profile-appointments-hint {
    max-width: none;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-modal-panel {
    animation: none;
  }
}
