/* ReviewWall styles — scoped to `.rw-root` so they don't bleed into the host page.
   Visual design lifted verbatim from review-wall (2).html prototype. */

@font-face {
  font-family: "HK Nova";
  src: url("../fonts/HKNova-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HK Nova";
  src: url("../fonts/HKNova-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* Avenir ships as woff2/woff only — there is no .ttf in public/fonts, so the
   old truetype URL 404'd and the face never applied. */
@font-face {
  font-family: "Avenir";
  src: url("../fonts/avenirltstd-book.woff2") format("woff2"),
       url("../fonts/avenirltstd-book.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.rw-root {
  scroll-margin-top: 80px;
  --bg:        #000;
  --bg-2:      #0A0A0B;
  --surface:   #111114;
  --surface-2: #18181E;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);
  --text:      #ECECEE;
  --text-2:    #A8A8AE;
  --text-3:    #6E6E76;
  --gold:      #FCBF7A;
  --gold-soft: rgba(252,191,122,0.12);
  --pill-track:rgba(255,255,255,0.06);
  --radius:    20px;
  --radius-sm: 12px;
  --display:   "HK Nova", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --sans:      "HK Nova", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --review:    "Avenir", "Helvetica Neue", system-ui, sans-serif;

  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  /* Last-line defence against the pill row pushing the page wider than
     the viewport: clip anything that wants to escape the root. The
     pill-bar-wrap still gets to scroll internally via its own
     overflow-x: auto. */
  max-width: 100%;
  overflow-x: clip;
}

.rw-root *,
.rw-root *::before,
.rw-root *::after { box-sizing: border-box; }

.rw-root .section {
  position: relative;
  padding: 48px 24px 80px;
  /* `overflow: hidden` clips overflowing CHILDREN, but doesn't stop
     the section itself from being widened by a min-content-sized
     descendant (the pill row's intrinsic width pushing back up the
     ancestor chain). `min-width: 0` lets the section shrink to its
     parent regardless of its content's intrinsic width. */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.rw-root .section::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(212,165,116,0.08), transparent 70%),
    radial-gradient(80% 60% at 50% 120%, rgba(255,255,255,0.025), transparent 70%);
  pointer-events: none;
}

.rw-root .container {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  /* Same min-content trap as .section above — pin to 0 so the pill row's
     intrinsic width can't widen the container past its parent. */
  min-width: 0;
}

.rw-root .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  padding: 6px 12px;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: var(--gold-soft);
}
.rw-root .eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.rw-root h1.headline {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 12px 0 10px;
  max-width: 620px;
}
.rw-root h1.headline em {
  font-style: italic;
  font-weight: 600;
  color: var(--gold);
}
.rw-root .subhead {
  color: var(--text-2);
  font-size: 15px;
  max-width: 560px;
  margin-bottom: 0;
  font-family: var(--review);
}

/* Hero row: eyebrow + h1 + subhead on the left, rating summary on the right.
   Stacks under 900px. */
.rw-root .hero-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding: 16px 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.rw-root .hero-text { min-width: 0; }
@media (max-width: 900px) {
  .rw-root .hero-row {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 8px 0 24px;
  }
}

.rw-root .pill-bar-wrap {
  /* `display: flex` with `justify-content: safe center` so the inner
     pill-bar is centered WHEN it fits, and falls back to flex-start
     WHEN it overflows. The `safe` keyword avoids the classic centered-
     overflow trap where content extends into negative scroll space
     (browser support: Chrome 93+, Firefox 63+, Safari 16+). */
  display: flex;
  justify-content: safe center;
  /* The wrap is rendered inside `.toolbar` which is `display: flex`.
     Flex items default to `min-width: auto`, which sizes them to their
     CONTENT instead of their parent — so the wrap grows wider than the
     viewport and the inner row spills out instead of scrolling inside.
     `min-width: 0` lets it shrink to the toolbar's column, and `flex: 1`
     claims the remaining toolbar space (sort dropdown sits to the right
     and stays its natural width via `flex: 0 0 auto`). Same trick MUI
     applies via `sx={{ flex: 1, minWidth: 0 }}` on `<Tabs>`. */
  flex: 1;
  min-width: 0;
  margin-bottom: 36px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* No `touch-action: pan-x` here — on some hybrid laptops it silently
     killed trackpad horizontal scroll. Letting the browser pick the
     gesture is fine because we're not nesting scroll axes. */
}
.rw-root .pill-bar-wrap::-webkit-scrollbar { display: none; }

.rw-root .pill-bar {
  display: inline-flex;
  background: var(--pill-track);
  border-radius: 999px;
  padding: 4px;
  gap: 0;
  border: 1px solid var(--line);
  /* Flex items default to `flex-shrink: 1`, which makes the inner
     pill-bar shrink to fit the wrap on narrow viewports — defeating
     `overflow-x: auto` because there's nothing to overflow. Pin
     shrink to 0 so the bar keeps its natural width and the wrap
     becomes a real horizontal scroller. */
  flex-shrink: 0;
}
.rw-root .pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  /* Tight horizontal padding so short labels (e.g. "All") don't hog
     space the way the larger 22px padding did. Vertical kept at 10px
     to preserve a comfortable tap target. */
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease, background .25s ease, transform .15s ease;
}
/* Mobile: shrink the persona pills further. The labels are long
   ("Skeptical improver" etc.) and the original sizing pushed the
   row well past the viewport; on small screens we want minimum
   chrome around the text while still hitting tap-target width. */
@media (max-width: 767px) {
  .rw-root .pill {
    font-size: 11.5px;
    padding: 10px 18px;
  }
}
.rw-root .pill .count {
  color: var(--text-3);
  font-size: 12px;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.rw-root .pill:hover { color: var(--text); }
.rw-root .pill[aria-pressed="true"] {
  background: #FAFAFA;
  color: #0A0A0B;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.rw-root .pill[aria-pressed="true"] .count { color: rgba(10,10,11,0.5); }

.rw-root .wall {
  /* Grid masonry. See the "Grid masonry" note in ReviewWall.tsx.

     `auto-fill minmax(240px, 1fr)` keeps the column count in CSS, so the
     first paint is already correct and no script measures the width. It
     yields 4 columns at the 1240px `.container` and 2 in the narrow
     customize reviews tab, which matches the old `columns: 4 240px` rule.

     Rows are 1px tall and each card declares its own span, so a card can end
     at any pixel and the next card in that column starts right below it.
     `row-gap` stays 0 because the 24px vertical gap is inside every span. */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: 1px;
  column-gap: 24px;
  row-gap: 0;
  /* Every span carries a trailing 24px, including the last card in a column.
     Pull that final gap back so the wall ends flush. */
  margin-bottom: -24px;
}
@media (max-width: 720px) {
  /* One full-width column on mobile. This holds from the first paint, which
     the old JS breakpoint could not do. */
  .rw-root .wall { grid-template-columns: 1fr; }
  .rw-root .section { padding: 64px 16px 80px; }
}

/* Screen-reader-only text. Used by the wall's result-count live region. */
.rw-root .rw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rw-root .card {
  /* `--rw-span` is the card height plus the 24px gap, in 1px grid rows. JS
     sets it before the first paint. The fallback only applies with JS off,
     and the wall renders no cards in that case.
     `align-self: start` stops the grid from stretching a card to its slot. */
  grid-row-end: span var(--rw-span, 340);
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  overflow: hidden;
  display: block;
  transition: opacity .35s ease, transform .35s ease, border-color .25s ease;
  will-change: opacity, transform;
}
.rw-root .card:hover { border-color: var(--line-2); }

.rw-root .card-pad { padding: 22px 22px 20px; }

.rw-root .card-stars {
  display: flex; gap: 2px; margin-bottom: 14px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}

.rw-root .card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text);
}

.rw-root .card-content {
  font-family: var(--review);
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 18px;
  white-space: pre-wrap;
}
/* `is-clamped` retired in favour of the JS-driven ReviewContent
   component, which trims the body to ~320 chars and surfaces a
   "Read more" toggle below long reviews. */

.rw-root .card-content-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: -8px 0 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  /* Match the review body color (.card-content uses --text-2) so the
     toggle reads as part of the same passage rather than a separate
     accent. Hover bumps to brighter --text for affordance. */
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.rw-root .card-content-toggle:hover {
  color: var(--text);
}
.rw-root .card-content-toggle:focus-visible {
  outline: 2px solid var(--text-2);
  outline-offset: 3px;
  border-radius: 2px;
}

.rw-root .card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.rw-root .reviewer {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.rw-root .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a31, #1a1a1f);
  color: var(--text);
  font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
}
.rw-root .reviewer-meta { min-width: 0; flex: 1; }
.rw-root .reviewer-name {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rw-root .reviewer-flag {
  display: inline-block;
  margin-right: 6px;
  /* Emoji metrics shift the baseline; tiny nudge keeps the flag
     vertically aligned with the surname text on most macOS/iOS fonts. */
  vertical-align: -1px;
  font-size: 14px;
  line-height: 1;
}
.rw-root .reviewer-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.rw-root .reviewer-sep {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1;
}
.rw-root .verified {
  font-size: 11px; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 4px;
}
.rw-root .verified::before {
  content: ""; width: 11px; height: 11px;
  background: var(--gold);
  border-radius: 50%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 6.2l2.1 2.1L9.2 4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 6.2l2.1 2.1L9.2 4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
.rw-root .reviewer-date {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Response from UBlockout — surfaced under sub-5★ reviews. */
.rw-root .response {
  margin: 4px 0 18px;
  padding: 12px 14px;
  background: rgba(212, 165, 116, 0.06);
  border: 1px solid rgba(212, 165, 116, 0.18);
  border-radius: var(--radius-sm);
}
.rw-root .response-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.rw-root .response-body {
  font-family: var(--review);
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
}
.rw-root .response-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 0 0;
  margin: 0;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
}
.rw-root .response-toggle:hover { text-decoration: underline; }

.rw-root .video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
.rw-root .video-wrap video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.rw-root .video-wrap .play-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 100%);
  transition: opacity .25s ease;
  pointer-events: none;
}
.rw-root .video-wrap.is-playing .play-overlay { opacity: 0; }
.rw-root .play-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  color: #0A0A0B;
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
  transition: transform .2s ease;
}
.rw-root .video-wrap:hover .play-btn { transform: scale(1.06); }
.rw-root .play-btn::before {
  content: "";
  width: 0; height: 0;
  border-left: 14px solid #0A0A0B;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}
.rw-root .video-caption {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  color: #fff;
  z-index: 1;
}
.rw-root .video-caption .vc-stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; margin-bottom: 6px; }
.rw-root .video-caption .vc-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}
.rw-root .video-card .card-pad { padding: 16px 18px 16px; }

/* Image-only review card (P2 of the brief — render Yotpo Published Image URLs) */
.rw-root .image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  overflow: hidden;
}
.rw-root .image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.rw-root .image-card .card-pad { padding: 18px 20px 18px; }

.rw-root .wall-foot {
  margin-top: 28px;
  color: var(--text-3);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.rw-root .wall-foot .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }

@keyframes rwFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rw-root .card.is-revealing { animation: rwFadeUp .42s ease both; }

.rw-root .pagination {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rw-root .pagination button {
  appearance: none;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  min-width: 40px;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
}
.rw-root .pagination button:hover:not(:disabled):not([aria-current="page"]) {
  color: var(--text);
  border-color: var(--line-2);
  background: var(--surface-2);
}
.rw-root .pagination button:active:not(:disabled) { transform: scale(0.97); }
.rw-root .pagination button[aria-current="page"] {
  background: #FAFAFA;
  color: #0A0A0B;
  border-color: #FAFAFA;
  cursor: default;
}
.rw-root .pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.rw-root .pagination .pg-arrow { padding: 9px 16px; }
.rw-root .pagination .pg-arrow .label { display: inline; }
.rw-root .pagination .pg-ellipsis {
  color: var(--text-3);
  padding: 0 4px;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .rw-root .pagination .pg-arrow .label { display: none; }
  .rw-root .pagination button { padding: 9px 12px; min-width: 38px; }
}

.rw-root .rating-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 280px);
  justify-content: start;
  gap: 24px;
  align-items: center;
}
@media (max-width: 720px) {
  .rw-root .rating-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  /* Compress the entire rating-summary block on mobile — original
     sizing was tuned for a full-width whyub layout. On the customize
     page's narrow column the big "4.9" + 5 stars + bar chart pushed
     the block well past a screen height, so everything here is
     scaled down to roughly half of the original sizing. */
  .rw-root .rs-summary-left { gap: 10px; }
  .rw-root .rs-avg { font-size: 26px; }
  .rw-root .rs-stars-big {
    font-size: 11px;
    letter-spacing: 0.5px;
    /* Belt-and-braces emoji-suppression on mobile too. Some Android
       browsers swap fonts mid-cascade. */
    font-family: Arial, "Helvetica Neue", sans-serif;
  }
  .rw-root .rs-based-on { font-size: 11px; }
  .rw-root .rs-row {
    grid-template-columns: 20px 1fr 30px;
    gap: 6px;
    padding: 1px 4px;
    font-size: 11px;
  }
  .rw-root .rs-row .rs-label .rs-star { font-size: 9px; }
  .rw-root .rs-bar-track { height: 5px; }
}
.rw-root .rs-summary-left { display: flex; align-items: center; gap: 24px; }
.rw-root .rs-avg {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rw-root .rs-meta { display: flex; flex-direction: column; gap: 6px; }
.rw-root .rs-stars-big {
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 3px;
  /* Force a text-style glyph for the ★ character. Mobile Safari and
     some Android browsers silently fall back to a color emoji font at
     certain font-size ranges, which renders the stars 1.5-2x bigger
     than the declared size. Pinning a plain sans font keeps them
     scaling with font-size. */
  font-family: Arial, "Helvetica Neue", sans-serif;
}
.rw-root .rs-based-on { color: var(--text-2); font-size: 14.5px; }
.rw-root .rs-based-on strong { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.rw-root .rs-histogram { display: grid; gap: 0; }

/* Each row is a real <button>: clicking filters the wall to that score. */
.rw-root .rs-row {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr 48px;
  align-items: center;
  gap: 12px;
  padding: 3px 10px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
}
.rw-root .rs-row:hover:not(:disabled) {
  background: rgba(212, 165, 116, 0.06);
  border-color: rgba(212, 165, 116, 0.18);
}
.rw-root .rs-row[aria-pressed="true"] {
  background: rgba(212, 165, 116, 0.10);
  border-color: rgba(212, 165, 116, 0.45);
  color: var(--text);
}
.rw-root .rs-row:disabled {
  cursor: default;
  opacity: 0.4;
}
.rw-root .rs-row .rs-label { display: flex; align-items: center; gap: 4px; color: inherit; }
.rw-root .rs-row .rs-label .rs-star { color: var(--gold); font-size: 12px; }
.rw-root .rs-bar-track {
  display: block;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.rw-root .rs-bar-fill {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width .6s cubic-bezier(0.16, 1, 0.3, 1), opacity .25s ease;
}
.rw-root .rs-row .rs-count { text-align: right; color: inherit; font-weight: 500; }

.rw-root .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  /* Toolbar can be a flex item in some host layouts — pin shrinkability
     so it never sizes to its descendants' intrinsic widths. */
  min-width: 0;
  max-width: 100%;
}
.rw-root .toolbar .pill-bar-wrap {
  margin: 0;
  /* `!important` because the wrap's `min-width: auto` (flex default)
     keeps fighting our override in some browsers — and we can't
     diagnose which without seeing computed styles in their DevTools.
     The compound selector + !important guarantees the size escape
     hatch wins regardless of cascade order or specificity. */
  flex: 1 1 0% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.rw-root .sort-wrap { position: relative; }
.rw-root .sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.rw-root .sort-trigger:hover { background: var(--surface); border-color: var(--line-2); }
.rw-root .sort-trigger .sort-prefix { color: var(--text-2); font-weight: 400; }
.rw-root .sort-trigger .sort-chevron {
  width: 10px; height: 10px;
  border-right: 1.5px solid var(--text-2);
  border-bottom: 1.5px solid var(--text-2);
  transform: rotate(45deg) translate(-1px,-1px);
  transition: transform .2s ease;
}
.rw-root .sort-trigger[aria-expanded="true"] .sort-chevron {
  transform: rotate(-135deg) translate(-1px,-1px);
}

.rw-root .sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  z-index: 50;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.rw-root .sort-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.rw-root .sort-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  gap: 12px;
}
.rw-root .sort-option:hover { background: var(--surface-2); }
.rw-root .sort-option[aria-checked="true"] { font-weight: 500; }
.rw-root .sort-option .check {
  opacity: 0;
  width: 14px; height: 14px;
  color: var(--gold);
}
.rw-root .sort-option[aria-checked="true"] .check { opacity: 1; }

@media (max-width: 480px) {
  .rw-root .toolbar { gap: 12px; }
  .rw-root .sort-trigger { font-size: 13.5px; padding: 9px 12px; }
}

/* Skeleton loading state — fetch placeholders */
.rw-root .skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: rwShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes rwShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.rw-root .sk-summary {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1fr;
  gap: 56px;
  padding: 32px 0 36px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) { .rw-root .sk-summary { grid-template-columns: 1fr; gap: 28px; } }
.rw-root .sk-block { height: 88px; }
.rw-root .sk-card {
  /* Fixed height, so the span is a constant. 5 lines at 12px plus 8px of
     margin above and below each, plus 44px of padding, is 184px. Add the
     24px wall gap for the grid span. */
  grid-row-end: span 208;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 22px;
}
.rw-root .sk-line { height: 12px; margin: 8px 0; }
.rw-root .sk-line.short { width: 40%; }
.rw-root .sk-line.med { width: 70%; }

/* ── Centered layout variant ── */
.rw-root.rw-centered .hero-row {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}
.rw-root.rw-centered .hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rw-root.rw-centered h1.headline {
  /* Match the Installation tab's `h2.main-title` so the heading on the
     Reviews tab reads at the same size + rhythm as every other help
     tab on the customize page. See `installationGuideStyles` in
     features/Common/styles/common.ts for the source of truth:
       fontSize:    1.375rem (xxs) / 2.25rem (md+)
       fontWeight:  700
       marginTop:   2rem
       marginBottom: 1.5rem
       text-align:  center
     We re-declare them here (rather than only on the tab's own SX) so
     the wall's existing `font-size: clamp(...)` and `margin` rules
     are explicitly overridden. */
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  max-width: 700px;
  margin: 2rem auto 1.5rem;
}
@media (min-width: 768px) {
  .rw-root.rw-centered h1.headline {
    font-size: 2.25rem;
  }
}
.rw-root.rw-centered .subhead {
  text-align: center;
  max-width: 600px;
}
/* No-op now that `.pill-bar-wrap` is a plain block container — the inner
   `.pill-bar` is an inline-flex element flowing from the left edge of
   the scroller. Centering an overflowing horizontal scroll container is
   incompatible with reliable swipe/wheel behavior (overflow ends up in
   negative scroll space), so we accept left-aligned pills site-wide. */
.rw-root.rw-centered .toolbar {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.rw-root.rw-centered .rating-summary {
  justify-content: center;
}

/* ── Warm gold theme variant ── */
.rw-root.rw-theme-warm {
  --gold: #FCBF7A;
  --gold-soft: rgba(252,191,122,0.12);
}

/* ── Transparent-background modifier ──
   Lets the host page bleed through behind the wall — used on the v3
   PDP where the surrounding sections are dark and the wall would
   otherwise paint its own #000 panel on top, creating a visible seam
   between PricingTierGrid and MeasureAndInstallTabs. Apply via
   `className='... rw-no-bg'` on the ReviewWallSection. */
.rw-root.rw-no-bg {
  background: transparent;
}
/* Match the v3 PDP `.h2` typography (Why UBlockout, FAQs, etc.) so
   "Customer reviews" reads at the same scale + weight as every other
   section heading on the page. Stronger than `.rw-centered` (which
   sits at 1.375rem / 2.25rem to match the customize-wizard tabs). */
.rw-root.rw-no-bg h1.headline {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.005em;
  text-align: center;
}
@media (max-width: 768px) {
  .rw-root.rw-no-bg h1.headline { font-size: 28px; }
}

/* ── PDP variant ──
   Used only on /ultimate-blackout-shade (SectionContent.tsx).
   Matches `headerTitleStyle` h2 from features/ShadeDetail/styles/shadeDetails.ts
   so "Customer reviews" reads identically to "Zero light leak" + the rest
   of the section headers on the PDP. No letter-spacing, no italic-em
   gold treatment — distinct from /reviews and the customize wizard. */
.rw-root.rw-pdp h1.headline {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 2.5rem;
  letter-spacing: 0;
  text-align: center;
  max-width: 700px;
  margin: 2rem auto 1.5rem;
}
.rw-root.rw-pdp h1.headline strong { font-weight: 600; }
.rw-root.rw-pdp h1.headline em {
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}
@media (min-width: 600px) {
  .rw-root.rw-pdp h1.headline { font-size: 2rem; line-height: 2rem; }
}
@media (min-width: 1200px) {
  .rw-root.rw-pdp h1.headline { font-size: 3rem; line-height: 2.5rem; }
}

/* ════════════════════════════════════════════════════════════════════════
   ── Light theme variant ──

   The wall is a dark component: a black ground, white ink and a gold
   accent, built for the v3 PDP's dark review band. The v4 PDP is a white
   page, and the reviews section it opens FROM is white cards on white with
   black chips — so the dark wall arrived as a different site.

   This is the same wall in that page's own vocabulary. It is additive and
   scoped to `.rw-root.rw-theme-light`; no existing call site passes it, so
   /reviews, the customize wizard and the live PDP are untouched.

   TOKENS COME FROM `components/theme.ts` AND `v4BelowStyles.ts`, not from
   taste: the ink is `text.primary`, the muted ink `v4MutedInk` (black at
   62%), the hairline `v4BelowHairline` (black at 8%), the star
   `yellow.star`, the alt band `#F2F4F5` — the offer card's own ground —
   and the radius the 12px of `V4_RADIUS.card` rather than the wall's 20.

   Most of the work is done by the custom properties. The overrides below
   exist only where the base sheet hard-codes a colour that assumes a dark
   ground; each one says what it is standing in for.
   ════════════════════════════════════════════════════════════════════════ */
.rw-root.rw-theme-light {
  --bg:        #FFFFFF;
  --bg-2:      #F2F4F5;
  --surface:   #FFFFFF;
  --surface-2: #F2F4F5;
  --line:      rgba(0,0,0,0.08);
  --line-2:    rgba(0,0,0,0.14);
  --text:      #0F0F10;
  --text-2:    rgba(0,0,0,0.62);
  --text-3:    rgba(0,0,0,0.45);
  --gold:      #FFB84D;
  --gold-soft: rgba(255,184,77,0.16);
  --pill-track: rgba(0,0,0,0.05);
  --radius:    12px;
  --radius-sm: 10px;
}

/* The section's two radial washes are a glow for a black ground. On white
   they are a grey smudge across the top of the wall. */
.rw-root.rw-theme-light .section::before { background: none; }

/* CARDS ARE LIFTED, NOT OUTLINED — `v4CardShell`'s own treatment, which is
   what every other card on the v4 page uses. An outlined card on white
   reads as a wireframe box; the shadow reads as an object. */
.rw-root.rw-theme-light .card {
  border-color: transparent;
  box-shadow: 0 3px 10px 1px rgba(0,0,0,0.08);
}
.rw-root.rw-theme-light .card:hover { border-color: transparent; }

/* Chips: the v4 reviews section's exact pair — white with a hairline at
   rest, solid black with white text when pressed. The base sheet does the
   inverse (near-white on black), which on this ground would make the
   pressed chip the palest thing in the row. */
.rw-root.rw-theme-light .pill {
  border: 1px solid var(--line);
  background: #FFFFFF;
}
.rw-root.rw-theme-light .pill[aria-pressed="true"] {
  background: #000000;
  border-color: #000000;
  color: #FFFFFF;
  box-shadow: none;
}
.rw-root.rw-theme-light .pill[aria-pressed="true"] .count { color: rgba(255,255,255,0.62); }

/* Same inversion, same reason. */
.rw-root.rw-theme-light .pagination button[aria-current="page"] {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

/* Initials disc. The base gradient is two near-blacks. */
.rw-root.rw-theme-light .avatar {
  background: linear-gradient(135deg, #EFF1F4, #D0D6DE);
  color: rgba(0,0,0,0.70);
}

/* The star-distribution rows. Gold at 6% is invisible on white, so the
   hover and pressed states move to neutral ink — the gold stays where it
   carries meaning, on the star glyph and the bar fill. */
.rw-root.rw-theme-light .rs-row:hover:not(:disabled) {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
.rw-root.rw-theme-light .rs-row[aria-pressed="true"] {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.20);
}
.rw-root.rw-theme-light .rs-bar-track { background: rgba(0,0,0,0.08); }

/* UBlockout's reply under a sub-5★ review. `blue.base25` is the tint the
   v4 review card already uses for its tag chip. */
.rw-root.rw-theme-light .response {
  background: #EFF3F8;
  border-color: rgba(23,94,183,0.18);
}
.rw-root.rw-theme-light .response-label { color: #175EB7; }

/* The photo behind a review. #000 is a hole punched in a white card while
   the image decodes; the page's own pale ground is not. Video KEEPS its
   black box — that one is letterboxing, and it is correct. */
.rw-root.rw-theme-light .image-wrap { background: #F2F4F5; }

/* A 55%-black drop is a dark-UI shadow. */
.rw-root.rw-theme-light .sort-menu { box-shadow: 0 16px 48px rgba(0,0,0,0.16); }
