body[data-page="profile"] .profile-reviews-section,
body[data-page="profile-public"] .profile-reviews-section {
  display: grid;
  gap: 16px;
}

body[data-page="profile"] .profile-reviews-section-header,
body[data-page="profile-public"] .profile-reviews-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body[data-page="profile"] .profile-reviews-section-header h2,
body[data-page="profile-public"] .profile-reviews-section-header h2 {
  margin: 0;
}

body[data-page="profile"] .profile-reviews-section-header h2 span,
body[data-page="profile-public"] .profile-reviews-section-header h2 span {
  color: var(--text-muted);
  font-size: 0.9em;
}

body[data-page="profile"] .profile-review-controls,
body[data-page="profile-public"] .profile-review-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-page="profile"] .profile-review-sort-select,
body[data-page="profile-public"] .profile-review-sort-select {
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border-color));
  border-radius: 999px;
  background: var(--surface-panel);
  color: var(--text);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--bg) 42%, transparent);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  color-scheme: dark;
  cursor: pointer;
}

body[data-theme="light"][data-page="profile"] .profile-review-sort-select,
body[data-theme="light"][data-page="profile-public"] .profile-review-sort-select {
  background: var(--bg-card);
  color-scheme: light;
}

body[data-page="profile"] .profile-review-sort-select option,
body[data-page="profile-public"] .profile-review-sort-select option {
  background: var(--surface-panel);
  color: var(--text);
  font-weight: 700;
}

body[data-theme="light"][data-page="profile"] .profile-review-sort-select option,
body[data-theme="light"][data-page="profile-public"] .profile-review-sort-select option {
  background: var(--bg-card);
}

body[data-page="profile"] .profile-review-sort-select:focus,
body[data-page="profile-public"] .profile-review-sort-select:focus,
body[data-page="profile"] .profile-review-view-toggle button:focus-visible,
body[data-page="profile-public"] .profile-review-view-toggle button:focus-visible,
body[data-page="profile"] .profile-review-card-action:focus-visible,
body[data-page="profile-public"] .profile-review-card-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

body[data-page="profile"] .profile-review-sort-select:disabled,
body[data-page="profile-public"] .profile-review-sort-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body[data-page="profile"] .profile-review-view-toggle,
body[data-page="profile-public"] .profile-review-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 86%, var(--bg-elevated) 14%);
}

body[data-page="profile"] .profile-review-view-toggle button,
body[data-page="profile-public"] .profile-review-view-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

body[data-page="profile"] .profile-review-view-toggle button.is-active,
body[data-page="profile-public"] .profile-review-view-toggle button.is-active {
  background: var(--surface-control, var(--bg-elevated));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

body[data-page="profile"] .profile-reviews-body,
body[data-page="profile-public"] .profile-reviews-body {
  min-width: 0;
}

body[data-page="profile"] .profile-reviews-grid,
body[data-page="profile-public"] .profile-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

body[data-page="profile"] .profile-reviews-grid-list,
body[data-page="profile-public"] .profile-reviews-grid-list {
  grid-template-columns: 1fr;
}

body[data-page="profile"] .profile-review-card,
body[data-page="profile-public"] .profile-review-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 164px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-elevated) 12%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

body[data-page="profile"] .profile-review-card-link,
body[data-page="profile-public"] .profile-review-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

body[data-page="profile"] .profile-review-card-link:hover,
body[data-page="profile-public"] .profile-review-card-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-color));
  background: color-mix(in srgb, var(--bg-card) 82%, var(--accent) 4%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

body[data-page="profile"] .profile-review-card-link:focus-visible,
body[data-page="profile-public"] .profile-review-card-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: 3px;
}

body[data-page="profile"] .profile-review-card-cover,
body[data-page="profile-public"] .profile-review-card-cover {
  display: grid;
  place-items: center;
  width: 76px;
  min-height: 112px;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-elevated));
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

body[data-page="profile"] .profile-review-card-cover img,
body[data-page="profile-public"] .profile-review-card-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body[data-page="profile"] .profile-review-card-main,
body[data-page="profile-public"] .profile-review-card-main {
  display: grid;
  grid-template-rows: auto auto minmax(24px, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-card-heading,
body[data-page="profile-public"] .profile-review-card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

body[data-page="profile"] .profile-review-card-title-block,
body[data-page="profile-public"] .profile-review-card-title-block {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-card h3,
body[data-page="profile-public"] .profile-review-card h3,
body[data-page="profile"] .profile-review-card p,
body[data-page="profile-public"] .profile-review-card p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="profile"] .profile-review-card h3,
body[data-page="profile-public"] .profile-review-card h3 {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body[data-page="profile"] .profile-review-card p,
body[data-page="profile-public"] .profile-review-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

body[data-page="profile"] .profile-review-card-rating-row,
body[data-page="profile-public"] .profile-review-card-rating-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-card-stars,
body[data-page="profile-public"] .profile-review-card-stars {
  display: inline-flex;
  gap: 1px;
  color: color-mix(in srgb, var(--text-muted) 62%, transparent);
  font-size: 0.96rem;
  line-height: 1;
}

body[data-page="profile"] .profile-review-card-stars .is-active,
body[data-page="profile-public"] .profile-review-card-stars .is-active {
  color: var(--accent);
}

body[data-page="profile"] .profile-review-card-rating-text,
body[data-page="profile-public"] .profile-review-card-rating-text {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

body[data-page="profile"] .profile-review-rating-muted,
body[data-page="profile-public"] .profile-review-rating-muted {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

body[data-page="profile"] .profile-review-card-meta,
body[data-page="profile-public"] .profile-review-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: start;
  gap: 8px 12px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-card-meta-item,
body[data-page="profile-public"] .profile-review-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

body[data-page="profile"] .profile-review-card-meta-item svg,
body[data-page="profile-public"] .profile-review-card-meta-item svg,
body[data-page="profile"] .profile-review-status-pill svg,
body[data-page="profile-public"] .profile-review-status-pill svg {
  flex: 0 0 auto;
}

body[data-page="profile"] .profile-review-card-footer,
body[data-page="profile-public"] .profile-review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-status-pill,
body[data-page="profile-public"] .profile-review-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

body[data-page="profile"] .profile-review-status-public,
body[data-page="profile-public"] .profile-review-status-public {
  border-color: color-mix(in srgb, #74c69d 34%, var(--border-color) 66%);
  color: #74c69d;
}

body[data-page="profile"] .profile-review-status-draft,
body[data-page="profile-public"] .profile-review-status-draft {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-color) 58%);
  color: var(--accent);
}

body[data-page="profile"] .profile-review-card-action,
body[data-page="profile-public"] .profile-review-card-action {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

body[data-page="profile"] .profile-review-card-action:hover,
body[data-page="profile-public"] .profile-review-card-action:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

body[data-page="profile"] .profile-reviews-empty-state-clean,
body[data-page="profile-public"] .profile-reviews-empty-state-clean {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 24px;
  border: 1px dashed var(--border-color);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-elevated) 12%);
  text-align: center;
}

body[data-page="profile"] .profile-reviews-empty-state-clean h3,
body[data-page="profile-public"] .profile-reviews-empty-state-clean h3,
body[data-page="profile"] .profile-reviews-empty-state-clean p,
body[data-page="profile-public"] .profile-reviews-empty-state-clean p {
  margin: 0;
}

body[data-page="profile"] .profile-reviews-empty-state-clean p,
body[data-page="profile-public"] .profile-reviews-empty-state-clean p {
  color: var(--text-muted);
}

body[data-page="profile"] .profile-review-grid-status,
body[data-page="profile-public"] .profile-review-grid-status {
  min-height: 1.1em;
  margin: -6px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

@media (max-width: 1220px) {
  body[data-page="profile"] .profile-reviews-grid,
  body[data-page="profile-public"] .profile-reviews-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="profile"] .profile-reviews-grid-list,
  body[data-page="profile-public"] .profile-reviews-grid-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-page="profile"] .profile-reviews-section-header,
  body[data-page="profile-public"] .profile-reviews-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="profile"] .profile-review-controls,
  body[data-page="profile-public"] .profile-review-controls {
    justify-content: flex-start;
    width: 100%;
  }

  body[data-page="profile"] .profile-reviews-grid,
  body[data-page="profile-public"] .profile-reviews-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body[data-page="profile"] .profile-review-card,
  body[data-page="profile-public"] .profile-review-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    min-height: 150px;
    padding: 12px;
  }

  body[data-page="profile"] .profile-review-card-cover,
  body[data-page="profile-public"] .profile-review-card-cover {
    width: 64px;
    min-height: 96px;
    border-radius: 12px;
  }

  body[data-page="profile"] .profile-review-card-footer,
  body[data-page="profile-public"] .profile-review-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="profile"] .profile-review-card-action,
  body[data-page="profile-public"] .profile-review-card-action {
    width: 100%;
  }
}
