/* ── Review stars ────────────────────────────────────────────── */
/* Two-layer overlay: a grey "track" row of ★ behind a gold "fill"
   row clipped to the exact rating width. No background-clip hacks. */

.review-stars {
  position: relative;
  display: inline-block;
  font-family: -apple-system, "SF Pro Text", sans-serif;
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.review-stars--small  { font-size: 0.95rem; }
.review-stars--medium { font-size: 1.2rem; }
.review-stars--large  { font-size: 1.6rem; }

.review-stars__track {
  color: rgb(255 255 255 / 0.3);
}

.review-stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: rgb(255 190 48);
  pointer-events: none;
}

/* On light surfaces (profile container), make the empty track darker
   so it's visible against the frosted white background. */
.profile-container .review-stars__track {
  color: rgb(20 20 30 / 0.2);
}

/* ── Review list (profile) ───────────────────────────────────── */

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-2, 0.75rem);
  background: rgb(255 255 255 / 0.5);
  border: 1px solid rgb(0 0 0 / 0.08);
}

.review-card__link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.review-card__link:hover .review-card__title {
  text-decoration: underline;
}

.review-card__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.review-card__icon-img,
.review-card__icon-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  background: rgb(0 0 0 / 0.06);
}

.review-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.review-card__stars-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.review-card__subject {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(20 20 30 / 0.5);
}

.review-card__title {
  font-size: var(--font-size-300);
  font-weight: 700;
  color: rgb(20 20 30 / 0.95);
  margin: 0;
  padding-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-card__menu-trigger {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgb(0 0 0 / 0.06);
  border: 0;
  border-radius: 8px;
  color: rgb(20 20 30 / 0.7);
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.review-card__menu-trigger:hover {
  background: rgb(0 0 0 / 0.12);
}

.review-card__menu {
  position: absolute;
  top: calc(var(--space-3) + 32px);
  right: var(--space-3);
  background: rgb(20 20 26 / 0.95);
  backdrop-filter: blur(18px);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 12px;
  min-width: 160px;
  padding: 6px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.4);
  z-index: 5;
}

.review-card__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: none;
  border: 0;
  color: rgb(255 255 255 / 0.9);
  text-decoration: none;
  font-size: var(--font-size-300);
  border-radius: 8px;
  cursor: pointer;
}

.review-card__menu-item:hover {
  background: rgb(255 255 255 / 0.12);
}

.review-card__menu-item--danger {
  color: rgb(255 120 120 / 0.95);
}

/* ── Review form ─────────────────────────────────────────────── */

.review-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.review-form__errors {
  background: rgb(255 80 80 / 0.15);
  border: 1px solid rgb(255 80 80 / 0.35);
  border-radius: 10px;
  padding: var(--space-3);
  color: rgb(255 200 200 / 0.95);
  font-size: var(--font-size-300);
}

.review-form__errors ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
}

.review-form__label {
  display: block;
  font-size: var(--font-size-300);
  font-weight: 600;
  color: rgb(255 255 255 / 0.85);
  margin: 0 0 var(--space-2);
}

.review-form__input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.08);
  color: rgb(255 255 255 / 0.95);
  font-size: var(--font-size-400);
}

.review-form__input:focus {
  outline: none;
  border-color: rgb(255 255 255 / 0.5);
  background: rgb(255 255 255 / 0.12);
}

.review-form__trix {
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 10px;
  color: rgb(255 255 255 / 0.95);
  min-height: 140px;
  padding: var(--space-3);
}

/* Review form on frosted surfaces (profile container AND the
   show-page review form wrap — both are surface-frosted now) */
.profile-container .review-form__label,
.reviews-section .review-form__label     { color: rgb(20 20 30 / 0.82); }
.profile-container .review-form__hint,
.reviews-section .review-form__hint      { color: rgb(20 20 30 / 0.5);  }
/* Star picker on light surfaces — the base empty color is already
   dark (set in .review-form__star-half above), and the gold filled
   color is set on [data-state] selectors. No extra overrides needed. */
.profile-container .review-form__rating-label,
.reviews-section .review-form__rating-label { color: rgb(20 20 30 / 0.7); }
/* Stars track inside frosted review blocks */
.reviews-section .review-stars__track    { color: rgb(20 20 30 / 0.2); }

.review-form__hint {
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.5);
  margin: var(--space-2) 0 0;
}

.review-form__rating {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.review-form__stars {
  display: inline-flex;
  gap: 0;
}

/* Each star button contains two overlapping ★ halves. Only one star
   glyph is visible — the halves clip to 50% width each so click
   position determines .5 vs 1.0. Color is set via data-state on
   the parent button by the review-rating Stimulus controller. */
.review-form__star {
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

/* Both halves are absolutely positioned over the full button width,
   each clipped to 50%. The ★ is always centered in the full 28px
   button, and the clip shows only the left or right half of it. */
.review-form__star-half {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: rgb(20 20 30 / 0.2);
}

.review-form__star-half--left {
  clip-path: inset(0 50% 0 0);
}

.review-form__star-half--right {
  clip-path: inset(0 0 0 50%);
}

.review-form__star[data-state="full"] .review-form__star-half { color: rgb(255 190 48); }
.review-form__star[data-state="half"] .review-form__star-half--left { color: rgb(255 190 48); }

.review-form__rating-label {
  font-size: var(--font-size-300);
  color: rgb(255 255 255 / 0.7);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}

.review-form__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
}

.review-form__trix--tall {
  min-height: 220px;
}

.review-form__submit {
  appearance: none;
  background: rgb(255 255 255 / 0.95);
  color: rgb(10 10 20 / 0.95);
  border: 0;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  font-size: var(--font-size-400);
  font-weight: 600;
  cursor: pointer;
}

.review-form__cancel {
  color: rgb(255 255 255 / 0.6);
  text-decoration: none;
  font-size: var(--font-size-300);
}

/* ── Review edit page (profile) ──────────────────────────────── */

.review-edit {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) 0;
}

.review-edit__subject {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.6);
  margin: 0 0 var(--space-4);
}

.review-edit__subject-link {
  color: rgb(20 20 30 / 0.95);
  font-weight: 600;
  text-decoration: none;
}

/* ── Reviews on portal show pages ────────────────────────────── */

.reviews-section {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--material-frosted-radius, 1.8rem);
  color: rgb(20 20 30 / 0.9);
}

.reviews-section__divider {
  border: none;
  border-top: 1px solid rgb(0 0 0 / 0.08);
  margin: 0;
}

.reviews-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.reviews-section__title {
  font-size: var(--font-size-600);
  font-weight: 700;
  margin: 0;
  color: rgb(20 20 30 / 0.95);
}

.reviews-section__aggregate {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgb(20 20 30 / 0.85);
}

.reviews-section__aggregate-value {
  font-weight: 700;
  font-size: var(--font-size-500);
  font-variant-numeric: tabular-nums;
}

.reviews-section__aggregate-count {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.55);
}

.reviews-section__sub10 {
  margin: 0 0 var(--space-8);
  padding: var(--space-4);
  border-radius: var(--radius-2, 0.75rem);
  background: rgb(245 165 25 / 0.18);
  border: 1px solid rgb(245 165 25 / 0.4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.reviews-section__sub10-icon {
  flex-shrink: 0;
  margin-top: 1px;
  width: 36px;
  height: 36px;
  filter: brightness(0) saturate(100%) sepia(1) hue-rotate(15deg) saturate(2) brightness(0.7);
  opacity: 0.6;
}

.reviews-section__sub10-text {
  min-width: 0;
}

.reviews-section__sub10-headline {
  font-size: var(--font-size-400);
  font-weight: 700;
  color: rgb(120 75 0);
  margin: 0 0 var(--space-1);
}

.reviews-section__sub10-body {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.8);
  margin: 0;
  line-height: 1.5;
}

.reviews-section__own,
.reviews-section__form-wrap,
.reviews-section__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reviews-section__own-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(20 20 30 / 0.5);
  margin: 0;
}

.reviews-section__own-title {
  font-size: var(--font-size-500);
  font-weight: 700;
  margin: 0;
  color: rgb(20 20 30 / 0.95);
}

.reviews-section__own-body {
  color: rgb(20 20 30 / 0.78);
  line-height: 1.55;
}

.reviews-section__own-edit {
  align-self: flex-start;
  color: rgb(255 255 255 / 0.85);
  text-decoration: none;
  font-size: var(--font-size-300);
  padding: 0.45rem 0.95rem;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.1);
}

.reviews-section__form-title {
  font-size: var(--font-size-500);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: rgb(20 20 30 / 0.95);
}

/* CTA block layout: text on top, Apple button at the bottom */
.reviews-section__cta {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.reviews-section__cta-body {
  flex: 1;
  min-width: 0;
}

.reviews-section__cta-title {
  font-size: var(--font-size-500);
  font-weight: 700;
  color: rgb(20 20 30 / 0.95);
  margin: 0 0 var(--space-2);
}

.reviews-section__cta-text {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.65);
  margin: 0;
  line-height: 1.5;
}

.reviews-section__cta-textarea {
  resize: vertical;
  min-height: 80px;
  font-size: var(--font-size-300);
}

.reviews-section__cta-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.reviews-section__cta-auth-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgb(200 40 40 / 0.9);
  margin: 0;
}

.reviews-section__cta .sidebar-signin {
  flex-shrink: 0;
}

/* Pulse animation on the Apple button when the guest starts typing */
@keyframes btn-pulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); box-shadow: 0 0 0 4px rgb(0 0 0 / 0.15); }
  60%  { transform: scale(1.04); box-shadow: 0 0 0 2px rgb(0 0 0 / 0.1); }
  100% { transform: scale(1); box-shadow: none; }
}

.sidebar-signin--pulse {
  animation: btn-pulse 0.6s ease 2;
}

.reviews-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reviews-section__item {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.reviews-section__item + .reviews-section__item {
  border-top: 1px solid rgb(0 0 0 / 0.06);
}

.reviews-section__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.reviews-section__item-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reviews-section__item-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  overflow: hidden;
  background: rgb(0 0 0 / 0.08);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(20 20 30 / 0.7);
}

.reviews-section__item-avatar:has(img) {
  background: transparent;
}

.reviews-section__item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reviews-section__item-author-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  line-height: 1.2;
}

.reviews-section__item-author-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.reviews-section__item-name {
  font-weight: 600;
  color: rgb(20 20 30 / 0.9);
}

.reviews-section__item-time {
  font-size: 0.75rem;
  color: rgb(20 20 30 / 0.35);
}

.reviews-section__item-link {
  align-self: flex-start;
  max-width: 100%;
  font-size: 0.75rem;
  color: rgb(20 20 30 / 0.55);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reviews-section__item-link:hover {
  color: rgb(20 20 30 / 0.9);
  text-decoration: underline;
}

.reviews-section__item-title {
  font-size: var(--font-size-400);
  font-weight: 700;
  margin: 0;
  color: rgb(20 20 30 / 0.95);
}

.reviews-section__item-body {
  color: rgb(20 20 30 / 0.78);
  line-height: 1.55;
}

/* Compact pending state when reviews aren't public yet */
.reviews-section__own-pending {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reviews-section__own-pending-note {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.85);
  margin: 0;
  line-height: 1.5;
}

.reviews-section__own-pending-pill {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-2, 0.75rem);
  background: rgb(0 0 0 / 0.05);
  border: 1px solid rgb(0 0 0 / 0.08);
}

.reviews-section__own-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.reviews-section__own-pending-title {
  font-size: var(--font-size-300);
  font-weight: 600;
  color: rgb(20 20 30 / 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stars track inside the reviews section (frosted bg) */
.reviews-section .review-stars__track {
  color: rgb(20 20 30 / 0.2);
}

