/* =============================================================================
 * NDB Review Modal — self-contained casino review form
 *
 * Owns: the "Write a review" CTA button, the modal shell, the star widgets
 * (overall + per-criterion), the textarea/inputs, the submit/success states.
 *
 * Does NOT touch wpDiscuz styles — those live in /wpdiscuz/wpdiscuz-dark.css.
 *
 * Visual language: dark theme, magenta brand gradient on accents, gold stars,
 * comfortable mobile (single column, large hit targets).
 * ============================================================================= */

:root {
  --ndb-rm-brand-from: #ff3d8a;
  --ndb-rm-brand-to: #c81dc4;

  --ndb-rm-bg: #0f1320;
  --ndb-rm-bg-soft: #161a2b;
  --ndb-rm-bg-muted: #1c2138;
  --ndb-rm-bg-input: #11152a;

  --ndb-rm-border: #2a3047;
  --ndb-rm-border-soft: #232940;

  --ndb-rm-text: #f1f5f9;
  --ndb-rm-text-soft: #cbd5e1;
  --ndb-rm-text-muted: #94a3b8;
  --ndb-rm-text-faint: #64748b;

  --ndb-rm-star-empty: #2e3552;
  --ndb-rm-star-hover: #fbbf24;
  --ndb-rm-star-active: #fbbf24;

  --ndb-rm-success: #22c55e;
  --ndb-rm-error: #ef4444;

  --ndb-rm-radius: 16px;
  --ndb-rm-radius-sm: 10px;
  --ndb-rm-radius-xs: 6px;

  --ndb-rm-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* ---------- Hero rating block (Users Reviews / empty state) ---------- */

.ndb-rating-block {
  background: #263044 !important;
  border-radius: 10px;
  width: 24%;
  padding: 10px 8px 8px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.3;
}

.ndb-rating-block__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin: 0;
}

.ndb-rating-block__stars {
  font-size: 13px;
  letter-spacing: 1px;
  color: #f8c307;
  line-height: 1;
}

.ndb-rating-block__stars--empty {
  color: rgba(248, 195, 7, 0.32);
}

.ndb-rating-block__score {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.ndb-rating-block__score-num {
  color: #ffffff;
}

.ndb-rating-block__score-denom {
  color: rgba(255, 255, 255, 0.6);
  margin-left: 1px;
}

.ndb-rating-block__count {
  margin-left: 4px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.ndb-rating-block__empty-msg {
  font-size: 12px;
  line-height: 1.3;
}

.ndb-rating-block--pending-moderation .ndb-rating-block__empty-msg {
  color: rgba(251, 191, 36, 0.95);
}

.ndb-rating-block__cta {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* "Write a review" / "Be the first to rate" — text link, not a chubby button.
 * `all: unset` resets browser/theme button styling so it never renders as a
 * white pill. Re-state interactive bits explicitly. */
.ndb-review-text-link,
button.ndb-review-text-link,
a.ndb-review-text-link {
  all: unset;
  display: inline-block;
  cursor: pointer;
  font: inherit;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em;
  color: #f8c307 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-color: rgba(248, 195, 7, 0.5) !important;
  text-align: center;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

.ndb-review-text-link:hover,
button.ndb-review-text-link:hover,
a.ndb-review-text-link:hover {
  color: #fcd34d !important;
  text-decoration-color: #fcd34d !important;
}

.ndb-review-text-link:focus-visible {
  outline: 2px solid var(--ndb-rm-brand-from) !important;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Primary in-card review CTA (higher contrast than plain text link) */
.ndb-rating-block__cta .ndb-review-primary-cta {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 10px;
  padding: 6px 12px !important;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: linear-gradient(90deg, #ff7a18 0%, #ff2f92 100%) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(255, 47, 146, 0.28);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}
.ndb-rating-block__cta .ndb-review-primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 47, 146, 0.4);
  opacity: 0.98;
}
.ndb-rating-block__cta .ndb-review-primary-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95) !important;
  outline-offset: 2px;
}

/* Hero rating CTAs — "Be the first to rate" (empty) + "Write a review" (rated Users Reviews): soft gold glow + pulse */
.ndb-rating-block--empty .ndb-review-text-link,
.ndb-rating-block--empty button.ndb-review-text-link,
.ndb-rating-block--rated .ndb-review-text-link,
.ndb-rating-block--rated button.ndb-review-text-link {
  animation: ndb-first-rate-glow 2.6s ease-in-out infinite;
  text-shadow:
    0 0 10px rgba(253, 224, 71, 0.55),
    0 0 18px rgba(248, 195, 7, 0.35);
  filter: drop-shadow(0 0 8px rgba(248, 195, 7, 0.45));
}

.ndb-rating-block--empty .ndb-review-text-link:hover,
.ndb-rating-block--empty button.ndb-review-text-link:hover,
.ndb-rating-block--rated .ndb-review-text-link:hover,
.ndb-rating-block--rated button.ndb-review-text-link:hover {
  animation-play-state: paused;
  text-shadow:
    0 0 14px rgba(253, 224, 71, 0.85),
    0 0 26px rgba(248, 195, 7, 0.45);
  filter: drop-shadow(0 0 12px rgba(248, 195, 7, 0.65));
}

@keyframes ndb-first-rate-glow {
  0%,
  100% {
    text-shadow:
      0 0 8px rgba(253, 224, 71, 0.45),
      0 0 14px rgba(248, 195, 7, 0.28);
    filter: drop-shadow(0 0 6px rgba(248, 195, 7, 0.38));
  }

  50% {
    text-shadow:
      0 0 14px rgba(253, 224, 71, 0.75),
      0 0 26px rgba(248, 195, 7, 0.42);
    filter: drop-shadow(0 0 12px rgba(248, 195, 7, 0.72));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ndb-rating-block--empty .ndb-review-text-link,
  .ndb-rating-block--empty button.ndb-review-text-link,
  .ndb-rating-block--rated .ndb-review-text-link,
  .ndb-rating-block--rated button.ndb-review-text-link {
    animation: none;
    text-shadow: 0 0 10px rgba(253, 224, 71, 0.45);
    filter: drop-shadow(0 0 6px rgba(248, 195, 7, 0.4));
  }
}

.ndb-hero-contest-teaser__link {
  font-size: 10.5px;
  line-height: 1.3;
  color: rgba(203, 213, 225, 0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(203, 213, 225, 0.35);
}

.ndb-hero-contest-teaser__link:hover {
  color: #fbbf24;
  text-decoration-color: rgba(251, 191, 36, 0.55);
}

/* Mobile sticky review CTA */
.ndb-review-sticky-cta-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9991;
  display: none;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7, 13, 28, 0) 0%, rgba(7, 13, 28, 0.82) 28%, rgba(7, 13, 28, 0.94) 100%);
}
.ndb-review-sticky-cta-wrap--with-offer {
  bottom: 84px;
}
.ndb-review-sticky-cta {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7a18 0%, #ff2f92 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
  padding: 11px 14px;
  box-shadow: 0 10px 24px rgba(255, 47, 146, 0.35);
}
.ndb-review-sticky-cta__icon {
  font-size: 14px;
}
.ndb-review-sticky-cta:hover {
  opacity: 0.98;
}
@media (max-width: 991px) {
  .ndb-review-sticky-cta-wrap {
    display: block;
  }
}

/* Legacy wrapper kept hidden so any cached HTML doesn't double up the CTA */
.ndb-rating-block .ndb-hero-write-review-wrap {
  margin-top: 4px;
  padding: 0;
  line-height: 1.3;
}
.ndb-rating-block .ndb-hero-contest-teaser {
  margin: 2px 0 0;
  padding: 0;
  font-size: 10.5px;
  line-height: 1.3;
}

/* ---------- Editor's Note: staff review summary ---------- */
.ndb-staff-summary {
  margin: 12px 0 0;
  padding: 12px 14px 12px 16px;
  background: linear-gradient(180deg, rgba(38, 48, 68, 0.85) 0%, rgba(38, 48, 68, 0.55) 100%);
  border: 1px solid rgba(248, 195, 7, 0.18);
  border-left: 3px solid #f8c307;
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
}

.ndb-staff-summary__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  color: #f8c307;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ndb-staff-summary__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.ndb-staff-summary__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ndb-staff-summary__label {
  line-height: 1;
}

.ndb-staff-summary__text {
  margin: 0;
  color: #f1f5f9;
  font-style: italic;
}

.ndb-staff-summary__byline {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: rgba(241, 245, 249, 0.65);
  font-style: normal;
  letter-spacing: 0.02em;
}

.ndb-staff-summary__author {
  color: rgba(241, 245, 249, 0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(241, 245, 249, 0.3);
}

.ndb-staff-summary__author:hover {
  color: #f8c307;
  text-decoration-color: rgba(248, 195, 7, 0.55);
}

@media (max-width: 600px) {
  .ndb-staff-summary {
    font-size: 12.5px;
    padding: 10px 12px 10px 14px;
  }
}

/* Legacy gradient pill (only if old markup or cache still serves it) */
.ndb-review-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ndb-rm-brand-from) 0%, var(--ndb-rm-brand-to) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    0 6px 18px rgba(200, 29, 196, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.ndb-review-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(200, 29, 196, 0.45);
  color: #fff;
}
.ndb-review-cta:active {
  transform: translateY(0);
}
.ndb-review-cta i {
  font-size: 15px;
}

/* ---------- Modal shell ---------- */
.ndb-review-modal[hidden] {
  display: none !important;
}

.ndb-review-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  box-sizing: border-box;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
/* Logged-in users: wp-admin bar sits above the viewport; clear it so the modal
 * header and close control are not hidden underneath (WP uses body.admin-bar). */
body.admin-bar .ndb-review-modal {
  padding-top: calc(40px + max(20px, env(safe-area-inset-top, 0px)));
}
.ndb-review-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
}
.ndb-review-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--ndb-rm-bg);
  color: var(--ndb-rm-text);
  border-radius: var(--ndb-rm-radius);
  box-shadow: var(--ndb-rm-shadow);
  max-height: min(calc(100vh - 40px), calc(100dvh - 40px));
  overflow: hidden;
  box-sizing: border-box;
}
body.ndb-review-modal-open {
  overflow: hidden;
}

.ndb-review-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ndb-rm-text-muted);
  font-size: 24px;
  line-height: 1;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.ndb-review-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ndb-rm-text);
  transform: rotate(90deg);
}
.ndb-review-modal__close:focus-visible {
  outline: 2px solid var(--ndb-rm-brand-from);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.ndb-review-modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 60px 22px 24px;
  background: linear-gradient(180deg, rgba(200, 29, 196, 0.08), transparent);
  border-bottom: 1px solid var(--ndb-rm-border-soft);
  flex-shrink: 0;
}
.ndb-review-modal__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  flex-shrink: 0;
}
.ndb-review-modal__heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ndb-rm-text);
}
.ndb-review-modal__casino {
  background: linear-gradient(135deg, var(--ndb-rm-brand-from) 0%, var(--ndb-rm-brand-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.ndb-review-modal__sub {
  margin: 0;
  font-size: 13px;
  color: var(--ndb-rm-text-muted);
  line-height: 1.45;
}

/* ---------- Reviewer contest (collapsible rules inside form) ---------- */
.ndb-rm-contest-disclosure {
  flex-shrink: 0;
}

.ndb-rm-contest-details {
  margin: 0;
  padding: 12px 14px;
  background: rgba(248, 195, 7, 0.06);
  border: 1px solid rgba(248, 195, 7, 0.22);
  border-radius: var(--ndb-rm-radius-sm);
}

.ndb-rm-contest-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #fcd34d;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ndb-rm-contest-summary::-webkit-details-marker {
  display: none;
}

.ndb-rm-contest-summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(252, 211, 77, 0.85);
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.ndb-rm-contest-details[open] .ndb-rm-contest-summary::before {
  transform: rotate(0deg);
}

.ndb-rm-contest-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ndb-rm-contest-lead {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ndb-rm-text-soft);
  line-height: 1.5;
}

.ndb-rm-contest-list {
  margin: 0 0 12px;
  padding-left: 1.15rem;
  font-size: 12px;
  color: var(--ndb-rm-text-muted);
  line-height: 1.5;
}

.ndb-rm-contest-list li {
  margin-bottom: 6px;
}

.ndb-rm-contest-list li:last-child {
  margin-bottom: 0;
}

.ndb-rm-contest-full {
  margin: 0;
}

.ndb-rm-contest-full-link {
  font-size: 13px;
  font-weight: 700;
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ndb-rm-contest-full-link:hover {
  color: #fff;
}

/* ---------- Form (scrollable middle area) ---------- */
.ndb-review-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.ndb-review-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Cards (sectional groupings) ---------- */
.ndb-rm-card {
  background: var(--ndb-rm-bg-soft);
  border: 1px solid var(--ndb-rm-border-soft);
  border-radius: var(--ndb-rm-radius-sm);
  padding: 16px;
}
.ndb-rm-card--overall {
  position: relative;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 61, 138, 0.1), transparent 60%), radial-gradient(circle at 100% 100%, rgba(200, 29, 196, 0.08), transparent 60%),
    var(--ndb-rm-bg-soft);
  border-color: rgba(255, 61, 138, 0.25);
}

.ndb-rm-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ndb-rm-card__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ndb-rm-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ndb-rm-card__title i {
  color: var(--ndb-rm-text-muted);
  font-size: 13px;
}

.ndb-rm-card__required,
.ndb-rm-card__optional {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
}
.ndb-rm-card__required {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}
.ndb-rm-card__required.is-fulfilled {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}
.ndb-rm-card__optional {
  background: rgba(148, 163, 184, 0.12);
  color: var(--ndb-rm-text-muted);
}
/* Desktop: long label; mobile: short (see @media block). */
.ndb-rm-opt-short {
  display: none;
}

/* ---------- Stars ---------- */
.ndb-rm-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ndb-rm-stars--lg {
  gap: 8px;
}
/* One size everywhere (desktop + mobile): 42px glyphs per product request. */
.ndb-rm-stars .ndb-rm-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--ndb-rm-star-empty);
  -webkit-text-fill-color: currentColor;
  font-size: 42px;
  line-height: 1;
  transition:
    color 0.12s,
    transform 0.12s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
/* Star glyph: plain text (Unicode BLACK STAR) so `color` on the button
 * always paints the visible shape — no Font Awesome pseudo-element layer. */
.ndb-rm-stars .ndb-rm-star__glyph {
  display: block;
  line-height: 1;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  pointer-events: none;
  user-select: none;
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols2", sans-serif;
}
.ndb-rm-stars--lg .ndb-rm-star,
.ndb-rm-stars--md .ndb-rm-star {
  font-size: 42px;
  padding: 6px 8px;
}
/* Active / preview / hover colours. We use !important defensively here
 * because Font Awesome's autoloaded CSS in this theme ships with its own
 * colour declarations that, depending on load order, can win over our
 * cascade. !important is scoped to a rare interaction state, so this is
 * a controlled escape hatch, not a global override. */
.ndb-rm-stars .ndb-rm-star.is-active,
.ndb-rm-stars .ndb-rm-star.is-preview,
.ndb-rm-stars .ndb-rm-star:hover {
  color: var(--ndb-rm-star-active) !important;
  -webkit-text-fill-color: var(--ndb-rm-star-active) !important;
}
.ndb-rm-stars .ndb-rm-star:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}
.ndb-rm-stars .ndb-rm-star:focus-visible {
  outline: 2px solid var(--ndb-rm-brand-from);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Overall rating card layout (centered, prominent) */
.ndb-rm-card--overall .ndb-rm-stars {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px;
}
.ndb-rm-card__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--ndb-rm-text-muted);
  text-align: center;
}
.ndb-rm-card__hint i {
  font-size: 14px;
  color: var(--ndb-rm-brand-from);
}
.ndb-rm-card__hint.is-rated i {
  color: var(--ndb-rm-success);
}
.ndb-rm-card__hint.is-rated {
  color: var(--ndb-rm-text-soft);
}

/* ---------- Criteria list ---------- */
.ndb-rm-criteria {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Row 1: title (col 1) + stars (col 2). Row 2: description full width.
 * `display: contents` on __label hoists __name and __desc into this grid 
 * without changing the HTML/JS structure. */
.ndb-rm-criterion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: var(--ndb-rm-bg-muted);
  border: 1px solid var(--ndb-rm-border-soft);
  border-radius: var(--ndb-rm-radius-xs);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.ndb-rm-criterion:hover {
  border-color: var(--ndb-rm-border);
}
.ndb-rm-criterion__label {
  display: contents;
}
.ndb-rm-criterion__name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ndb-rm-text);
}
.ndb-rm-criterion__desc {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 11.5px;
  color: var(--ndb-rm-text-faint);
  line-height: 1.35;
}
.ndb-rm-criterion .ndb-rm-stars {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  flex-shrink: 0;
}

/* ---------- Inputs ---------- */
.ndb-rm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ndb-rm-text);
  margin-bottom: 6px;
}
.ndb-rm-label__hint {
  font-weight: 400;
  color: var(--ndb-rm-text-faint);
  font-size: 12px;
}
.ndb-rm-required-mark {
  color: var(--ndb-rm-error);
  font-weight: 700;
}
.ndb-rm-textarea,
.ndb-rm-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--ndb-rm-bg-input);
  border: 1px solid var(--ndb-rm-border);
  border-radius: var(--ndb-rm-radius-xs);
  color: var(--ndb-rm-text);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.ndb-rm-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
.ndb-rm-textarea:focus,
.ndb-rm-input:focus {
  outline: none;
  border-color: var(--ndb-rm-brand-from);
  box-shadow: 0 0 0 3px rgba(255, 61, 138, 0.18);
}
.ndb-rm-textarea__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ndb-rm-text-faint);
}
.ndb-rm-textarea__counter.is-short {
  color: #fca5a5;
}
.ndb-rm-textarea__counter.is-near-max {
  color: #fbbf24;
}

.ndb-rm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ndb-rm-field {
  display: flex;
  flex-direction: column;
}

.ndb-rm-loggedin-as {
  margin: 0;
  padding: 10px 12px;
  background: var(--ndb-rm-bg-muted);
  border-radius: var(--ndb-rm-radius-xs);
  color: var(--ndb-rm-text-muted);
  font-size: 13px;
}
.ndb-rm-loggedin-as strong {
  color: var(--ndb-rm-text);
}

/* Honeypot — visually + a11y hidden but kept in the form. */
.ndb-rm-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Inline error ---------- */
.ndb-rm-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: var(--ndb-rm-radius-xs);
  font-size: 13px;
  line-height: 1.4;
}
.ndb-rm-error[hidden] {
  display: none;
}

.ndb-rm-error__text {
  margin: 0 0 8px;
}

.ndb-rm-error__text:last-child {
  margin-bottom: 0;
}

.ndb-rm-error__link {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ndb-rm-error__link:hover {
  color: #fcd34d;
}

.ndb-rm-error__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ndb-rm-text-faint);
  line-height: 1.35;
}

/* ---------- Footer ---------- */
.ndb-review-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--ndb-rm-border-soft);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.ndb-review-modal__footer-note {
  font-size: 12px;
  color: var(--ndb-rm-text-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ndb-review-modal__footer-note i {
  color: var(--ndb-rm-success);
}
.ndb-review-modal__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.ndb-rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.15s,
    color 0.15s;
  font-family: inherit;
}
.ndb-rm-btn--primary {
  background: linear-gradient(135deg, var(--ndb-rm-brand-from) 0%, var(--ndb-rm-brand-to) 100%);
  color: #fff;
  box-shadow:
    0 6px 18px rgba(200, 29, 196, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
.ndb-rm-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(200, 29, 196, 0.45);
  color: #fff;
}
.ndb-rm-btn--primary:disabled,
.ndb-rm-btn--primary.is-loading {
  cursor: progress;
  opacity: 0.85;
  transform: none;
}
.ndb-rm-btn--ghost {
  background: transparent;
  color: var(--ndb-rm-text-muted);
  border: 1px solid var(--ndb-rm-border);
}
.ndb-rm-btn--ghost:hover {
  background: var(--ndb-rm-bg-muted);
  color: var(--ndb-rm-text);
}
/* FA's `.fas { display: inline-block }` loads after this file and ties our
 * specificity — spinner looked always visible + spinning. Beat it with a
 * descendant selector + !important on both states. */
.ndb-rm-btn .ndb-rm-btn__spinner {
  display: none !important;
}
.ndb-rm-btn.is-loading .ndb-rm-btn__spinner {
  display: inline-block !important;
}
.ndb-rm-btn.is-loading .ndb-rm-btn__label::after {
  content: "…";
}

/* ---------- Success state ---------- */
.ndb-review-modal__success {
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.ndb-review-modal__success[hidden] {
  display: none;
}
.ndb-review-modal__success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: var(--ndb-rm-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  animation: ndb-rm-pop 0.4s ease;
}
@keyframes ndb-rm-pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.ndb-review-modal__success-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ndb-rm-text);
}
.ndb-review-modal__success-msg {
  margin: 0;
  color: var(--ndb-rm-text-muted);
  font-size: 14px;
  max-width: 440px;
}
.ndb-review-modal__success-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Mobile (compact sheet UX) ---------- */
@media (max-width: 600px) {
  .ndb-review-modal {
    padding: 0;
  }
  body.admin-bar .ndb-review-modal {
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
  }
  .ndb-review-modal__panel {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .ndb-review-modal__close {
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
  .ndb-review-modal__header {
    padding: 12px 48px 10px 12px;
    gap: 10px;
    align-items: flex-start;
  }
  .ndb-review-modal__logo {
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 10px;
  }
  .ndb-review-modal__heading h2 {
    font-size: 15px;
    line-height: 1.25;
  }
  .ndb-review-modal__sub {
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ndb-review-modal__body {
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .ndb-rm-card {
    padding: 10px 12px;
    border-radius: 12px;
  }
  .ndb-rm-card__head {
    margin-bottom: 8px;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
  }
  .ndb-rm-card__title {
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .ndb-rm-card__title i {
    font-size: 12px;
  }
  .ndb-rm-card__required,
  .ndb-rm-card__optional {
    font-size: 9px;
    padding: 2px 7px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .ndb-rm-opt-long {
    display: none;
  }
  .ndb-rm-opt-short {
    display: inline;
  }

  .ndb-rm-card--overall .ndb-rm-stars {
    margin: 2px 0 6px;
  }
  /* Same 42px stars as desktop; tighten gaps so five stars fit narrow screens. */
  .ndb-rm-stars--lg,
  .ndb-rm-stars--md {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .ndb-rm-stars--lg .ndb-rm-star,
  .ndb-rm-stars--md .ndb-rm-star {
    font-size: 42px;
    padding: 5px 6px;
    min-width: 40px;
    min-height: 48px;
  }
  .ndb-rm-card__hint {
    font-size: 11px;
    gap: 6px;
    line-height: 1.3;
  }
  .ndb-rm-card__hint i {
    font-size: 12px;
  }

  .ndb-rm-criteria {
    gap: 6px;
  }
  .ndb-rm-criterion {
    column-gap: 8px;
    row-gap: 4px;
    padding: 8px 10px;
    align-items: center;
  }
  .ndb-rm-criterion__name {
    font-size: 12px;
  }
  .ndb-rm-criterion__desc {
    font-size: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ndb-rm-label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .ndb-rm-textarea {
    min-height: 88px;
    font-size: 14px;
    padding: 9px 11px;
  }
  .ndb-rm-textarea__meta {
    font-size: 11px;
    margin-top: 4px;
  }

  .ndb-rm-grid {
    grid-template-columns: 1fr;
  }
  .ndb-rm-loggedin-as {
    font-size: 12px;
    padding: 8px 10px;
  }

  .ndb-review-modal__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
  .ndb-review-modal__footer-note {
    order: 2;
    text-align: center;
    justify-content: center;
    font-size: 10px;
  }
  .ndb-review-modal__actions {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .ndb-rm-btn {
    flex: none;
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }
}

/* Very small phones: keep 42px stars (no shrink). */
@media (max-width: 380px) {
  .ndb-review-modal__header {
    padding-right: 44px;
    padding-left: 10px;
  }
  .ndb-review-modal__body {
    padding-left: 10px;
    padding-right: 10px;
  }
  .ndb-rm-stars--lg,
  .ndb-rm-stars--md {
    gap: 2px;
  }
}
