.grv-tp-profile-page {
  min-height: 100vh;
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-text));
  font-size: 1.4em;
}

.grv-profile-container {
  max-width: 672px;
  margin: 0 auto;
  padding: 40px 24px;
}

.grv-profile-page-header {
  margin-bottom: 32px;
  text-align: center;
}
.grv-profile-page-header .grv-profile-page-title {
  font-size: 1.5em;
  font-weight: 600;
  color: rgb(var(--grv-topic-title));
  margin: 0 0 4px 0;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.grv-profile-page-header .grv-profile-page-subtitle {
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  margin: 0;
  line-height: 1.25;
}

.grv-profile-skeleton {
  background: rgb(var(--grv-body));
  border: 1px solid rgb(var(--grv-panel-strong));
  border-radius: 16px;
  box-shadow: 0 1px 2px 0 rgba(var(--grv-text), 0.05);
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.grv-skeleton-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid rgb(var(--grv-panel-bold));
}

.grv-skeleton-avatar {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgb(var(--grv-panel-strong));
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.grv-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grv-skeleton-line {
  height: 16px;
  border-radius: 4px;
  background: rgb(var(--grv-panel-strong));
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.grv-skeleton-line.grv-skeleton-line-name {
  width: 160px;
}
.grv-skeleton-line.grv-skeleton-line-email {
  width: 224px;
  height: 12px;
  background: rgb(var(--grv-panel-bold));
}
.grv-skeleton-line.grv-skeleton-line-label {
  width: 80px;
  height: 12px;
  background: rgb(var(--grv-panel-strong));
}
.grv-skeleton-line.grv-skeleton-line-value {
  width: 128px;
  height: 12px;
  background: rgb(var(--grv-panel-bold));
}
.grv-skeleton-line.grv-skeleton-line-button {
  width: 128px;
  height: 32px;
  border-radius: 12px;
  background: rgb(var(--grv-panel-strong));
}

.grv-skeleton-details {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgb(var(--grv-panel-bold));
}
.grv-skeleton-details:first-child {
  border-top: none;
}

.grv-skeleton-section {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgb(var(--grv-panel-bold));
}
.grv-skeleton-section:first-child {
  border-top: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.grv-profile-card {
  background: rgb(var(--grv-body));
  border: 1px solid rgb(var(--grv-panel-strong));
  border-radius: 16px;
  box-shadow: 0 1px 2px 0 rgba(var(--grv-text), 0.05);
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.grv-profile-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid rgb(var(--grv-panel-bold));
}

.grv-profile-avatar-container {
  position: relative;
  flex-shrink: 0;
}

.grv-profile-avatar-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgb(var(--grv-panel-strong));
}
.grv-profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grv-profile-header-info {
  flex: 1;
  min-width: 0;
}
.grv-profile-header-info img {
  display: none;
}
.grv-profile-header-info strong {
  display: block;
  font-size: 1.125em;
  font-weight: 600;
  color: rgb(var(--grv-text));
  margin-bottom: 4px;
  letter-spacing: -0.025em;
}
.grv-profile-header-info span {
  display: block;
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  word-break: break-word;
}

.grv-avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgb(var(--primary-color));
  color: rgb(var(--button-text));
  font-size: 0.75em;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(var(--grv-text), 0.1);
}
.grv-avatar-edit-btn:hover {
  background: rgb(var(--flyout-color));
}

.grv-profile-card-details {
  display: flex;
  flex-direction: column;
}

.grv-profile-detail-row {
  padding: 16px 24px;
  border-top: 1px solid rgb(var(--grv-panel-bold));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.grv-profile-detail-row:first-child {
  border-top: none;
}
.grv-profile-detail-row.grv-profile-interests-row {
  display: block;
}

.grv-profile-detail-content {
  flex: 1;
  min-width: 0;
}

.grv-profile-detail-content-full {
  width: 100%;
}

.grv-profile-detail-label {
  font-size: 0.875em;
  font-weight: 500;
  color: rgb(var(--grv-text));
  margin: 0 0 4px 0;
}

.grv-profile-detail-value {
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  margin: 0;
}

.grv-profile-edit-btn {
  font-size: 0.875em;
  font-weight: 500;
  color: rgb(var(--link));
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.grv-profile-edit-btn:hover {
  text-decoration: underline;
}

.grv-interests-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgb(var(--grv-panel-bold));
  border-radius: 9999px;
  background: rgb(var(--grv-body));
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875em;
}
.grv-interests-toggle:hover {
  border-color: rgb(var(--grv-text));
  color: rgb(var(--grv-text));
}
.grv-interests-toggle.open .grv-interests-chevron {
  transform: rotate(180deg);
}

.grv-interests-count-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grv-interests-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgb(var(--grv-panel-strong));
  color: rgb(var(--secondary-color));
  font-size: 0.75em;
  font-weight: 600;
  min-width: 20px;
}

.grv-interests-label {
  font-size: 0.875em;
  font-weight: 500;
  color: rgb(var(--grv-text));
}

.grv-interests-chevron {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.grv-chevron-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.grv-interests-preview {
  width: 100%;
}

.grv-interests-dropdown {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgb(var(--grv-panel-bold));
  border-radius: 8px;
  background: rgb(var(--grv-body));
  box-shadow: 0 1px 2px 0 rgba(var(--grv-text), 0.05);
  display: none;
}
.grv-interests-dropdown.show {
  display: block;
}

.grv-interests-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgb(var(--grv-panel-bold));
}

.grv-interests-selected-count {
  font-size: 0.875em;
  color: rgb(var(--grv-text));
}

.grv-interests-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grv-interests-reset-btn {
  font-size: 0.875em;
  text-decoration: underline;
  background: none;
  border: none;
  color: rgb(var(--grv-lighter-text));
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.grv-interests-reset-btn:hover {
  color: rgb(var(--grv-text));
}

.grv-interests-close-btn {
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.grv-interests-close-btn:hover {
  color: rgb(var(--grv-text));
}

.grv-interests-filter {
  padding: 12px;
}

.grv-interests-search-input {
  width: 50%;
  padding: 8px 12px;
  border: 1px solid rgb(var(--grv-panel-bold));
  border-radius: 8px;
  font-size: 0.875em;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-text));
}
.grv-interests-search-input:focus {
  outline: none;
  border-color: rgb(var(--primary-color));
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}
.grv-interests-search-input::placeholder {
  color: rgb(var(--grv-lighter-text));
}

.grv-interests-categories {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  border: none;
}
.grv-interests-categories::-webkit-scrollbar {
  width: 6px;
}
.grv-interests-categories::-webkit-scrollbar-track {
  background: rgb(var(--grv-panel-bold));
}
.grv-interests-categories::-webkit-scrollbar-thumb {
  background: rgb(var(--grv-panel-bold));
  border-radius: 3px;
}
.grv-interests-categories::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--grv-lighter-text));
}

.grv-interests-loading {
  text-align: center;
  padding: 24px 16px;
  color: rgb(var(--grv-light-text));
  font-style: italic;
  font-size: 0.875em;
}

.grv-interest-category {
  margin-bottom: 16px;
}
.grv-interest-category:last-child {
  margin-bottom: 0;
}
.grv-interest-category.hidden {
  display: none;
}

.grv-interest-category-title {
  font-size: 0.875em;
  font-weight: 600;
  color: rgb(var(--grv-text));
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(var(--grv-panel-strong));
}

.grv-interest-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grv-interest-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.grv-interest-item:hover {
  background: rgb(var(--grv-panel-bold));
}
.grv-interest-item.hidden {
  display: none;
}
.grv-interest-item input[type=checkbox] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: rgb(var(--primary-color));
}
.grv-interest-item label {
  cursor: pointer;
  user-select: none;
  flex: 1;
  color: rgb(var(--grv-lighter-text));
  font-size: 0.875em;
}

.grv-interest-node {
  display: flex;
  flex-direction: column;
}
.grv-interest-node:first-child {
  margin-top: 0;
}
.grv-interest-node.hidden {
  display: none;
}

.grv-interest-label {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.grv-interest-label:hover {
  background-color: rgb(var(--grv-panel-bold));
}

.grv-interest-checkbox {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: rgb(var(--primary-color));
}

.gr-interest-name {
  font-size: 0.875em;
  color: rgb(var(--grv-lighter-text));
  user-select: none;
}

.grv-interest-node[data-depth="0"] .gr-interest-name {
  font-weight: 400;
  color: rgb(var(--grv-text));
}

.grv-interest-node[data-depth="1"] .gr-interest-name {
  color: rgb(var(--grv-lighter-text));
}

.grv-interest-node[data-depth="2"] .gr-interest-name {
  color: rgb(var(--grv-light-text));
}

.grv-interest-children {
  display: flex;
  flex-direction: column;
  margin-left: 20px;
}
.grv-interest-children:empty {
  display: none;
}

.grv-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.grv-profile-action-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.875em;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-family: inherit;
}
.grv-profile-action-btn.grv-profile-save-btn {
  background: rgb(var(--primary-color));
  color: rgb(var(--primary-text));
  border: none;
  box-shadow: 0 1px 2px 0 rgba(var(--grv-text), 0.05);
}
.grv-profile-action-btn.grv-profile-save-btn:hover:not(:disabled) {
  background: rgb(var(--link-accent));
}
.grv-profile-action-btn.grv-profile-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.grv-profile-action-btn.grv-profile-newsletter-btn {
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-lighter-text));
  border: 1px solid rgb(var(--grv-panel-bold));
}
.grv-profile-action-btn.grv-profile-newsletter-btn:hover {
  background: rgb(var(--grv-panel));
}
.grv-profile-action-btn.grv-profile-newsletter-btn[data-subscribed=false] {
  background: rgb(var(--primary-color));
  color: rgb(var(--primary-text));
  border: none;
}
.grv-profile-action-btn.grv-profile-newsletter-btn[data-subscribed=false]:hover {
  background: rgb(var(--link-accent));
}
.grv-profile-action-btn.grv-profile-logout-btn {
  background: rgb(var(--grv-body));
  color: rgb(var(--primary-color));
  border: 1px solid rgb(var(--grv-panel-strong));
}
.grv-profile-action-btn.grv-profile-logout-btn:hover {
  background: rgb(var(--grv-panel-bold));
}

.grv-profile-logged-out {
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.3s ease-out;
}
.grv-profile-logged-out p {
  font-size: 1em;
  color: rgb(var(--grv-light-text));
  margin: 0 0 24px 0;
  line-height: 1.5;
}
.grv-profile-logged-out .grv-btn-primary {
  padding: 11px 24px;
  font-size: 0.875em;
  font-weight: 500;
  background: rgb(var(--primary-color));
  color: rgb(var(--primary-text));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}
.grv-profile-logged-out .grv-btn-primary:hover {
  background: rgb(var(--link-accent));
}

.grv-tp-profile-page .grv-modal-profile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.grv-tp-profile-page .grv-modal-profile .grv-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--grv-text), 0.6);
  z-index: 999;
}
.grv-tp-profile-page .grv-modal-profile .grv-modal-content {
  position: relative;
  width: 100%;
  max-width: 448px;
  margin: 16px;
  background: rgb(var(--grv-body));
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(var(--grv-text), 0.1), 0 4px 6px -4px rgba(var(--grv-text), 0.1);
  padding: 24px;
  animation: slideUp 0.2s ease-out;
  z-index: 1000;
}
.grv-tp-profile-page .grv-modal-profile .grv-modal-content.grv-modal-content-sm {
  max-width: 384px;
}

.grv-tp-profile-page .grv-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: rgb(var(--grv-lighter-text));
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grv-tp-profile-page .grv-modal-close:hover {
  color: rgb(var(--grv-light-text));
}

.grv-tp-profile-page .grv-modal-title {
  font-size: 1.125em;
  font-weight: 600;
  color: rgb(var(--grv-text));
  margin: 0 0 8px 0;
  letter-spacing: -0.025em;
}

.grv-tp-profile-page .grv-modal-subtitle {
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  margin: 0 0 24px 0;
}

.grv-tp-profile-page .grv-modal-status {
  margin-top: 12px;
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
  text-align: center;
}

.grv-tp-profile-page .grv-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.grv-tp-profile-page .grv-avatar-option {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgb(var(--grv-panel-strong));
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: none;
  padding: 0;
}
.grv-tp-profile-page .grv-avatar-option:hover {
  border-color: rgb(var(--grv-text));
}
.grv-tp-profile-page .grv-avatar-option.selected {
  border-color: rgb(var(--primary-color));
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}

.grv-tp-profile-page .grv-avatar-option-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grv-tp-profile-page .grv-modal-form {
  margin-top: 24px;
}

.grv-tp-profile-page .grv-form-group {
  margin-bottom: 16px;
}

.grv-tp-profile-page .grv-form-label {
  display: block;
  font-size: 0.875em;
  font-weight: 500;
  color: rgb(var(--grv-lighter-text));
  margin-bottom: 8px;
}

.grv-tp-profile-page .grv-handle-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grv-tp-profile-page .grv-handle-at {
  color: rgb(var(--grv-light-text));
  font-size: 0.875em;
}

.grv-tp-profile-page .grv-handle-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgb(var(--grv-panel-bold));
  border-radius: 8px;
  font-size: 0.875em;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-text));
}
.grv-tp-profile-page .grv-handle-input:focus {
  outline: none;
  border-color: rgb(var(--primary-color));
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}
.grv-tp-profile-page .grv-handle-input::placeholder {
  color: rgb(var(--grv-lighter-text));
}

.grv-tp-profile-page .grv-age-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgb(var(--grv-panel-bold));
  border-radius: 8px;
  font-size: 0.875em;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-text));
  cursor: pointer;
}
.grv-tp-profile-page .grv-age-select:focus {
  outline: none;
  border-color: rgb(var(--primary-color));
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}

.grv-tp-profile-page .grv-form-message {
  margin-top: 8px;
  font-size: 0.75em;
}
.grv-tp-profile-page .grv-form-message.error {
  color: rgb(var(--primary-color));
}
.grv-tp-profile-page .grv-form-message.success {
  color: rgb(var(--success-color, 5, 150, 105));
}

.grv-tp-profile-page .grv-form-helper {
  margin-top: 8px;
  font-size: 0.875em;
  color: rgb(var(--grv-light-text));
}

.grv-tp-profile-page .grv-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.grv-tp-profile-page .grv-modal-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 0.875em;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}
.grv-tp-profile-page .grv-modal-btn.grv-modal-btn-primary {
  background: rgb(var(--primary-color));
  color: rgb(var(--primary-text));
  border: none;
}
.grv-tp-profile-page .grv-modal-btn.grv-modal-btn-primary:hover:not(:disabled) {
  background: rgb(var(--link-accent));
}
.grv-tp-profile-page .grv-modal-btn.grv-modal-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.grv-tp-profile-page .grv-modal-btn.grv-modal-btn-secondary {
  background: rgb(var(--grv-body));
  color: rgb(var(--grv-lighter-text));
  border: 1px solid rgb(var(--grv-panel-bold));
}
.grv-tp-profile-page .grv-modal-btn.grv-modal-btn-secondary:hover {
  background: rgb(var(--grv-panel));
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 768px) {
  .grv-profile-container {
    padding: 24px 16px;
  }
  .grv-profile-page-header {
    margin-bottom: 24px;
  }
  .grv-avatar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .grv-avatar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grv-modal-content {
    margin: 12px;
    padding: 20px;
  }
}
