/* ============================================================
   TOOL PAGE — REVIEWS  (/tools/{slug}/#reviews)
   Registered with page_css() from app/Views/tool.php, so it loads
   after goji-main.css.

   ⚠ MOBILE-FIRST. Every breakpoint WIDENS (min-width); do not add
     a max-width query — the base rules are the phone layout.

   ⚠ Every var() carries a literal fallback. An undefined custom
     property inside a shorthand is invalid at computed-value time
     and drops the WHOLE declaration.
   ============================================================ */

.gs-rv-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; align-items: start; }
.gs-rv-main, .gs-rv-side { min-width: 0; }

/* ---------- heading ---------- */
.gs-rv-eyebrow {
  display: flex; align-items: center; gap: .9rem;
  margin: 0 0 .65rem;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gs-cp, #5b21b6);
}
.gs-rv-eyebrow::after {
  content: ""; flex: 1 1 auto; max-width: 7rem;
  height: 1px; background: var(--gs-bd0, #e2e8f0);
}
.gs-rv-h2 {
  font-size: clamp(2.1rem, 6vw, 3.25rem);
  font-weight: 800; letter-spacing: -.025em; line-height: 1.05;
  margin: 0 0 .5rem;
  color: var(--gs-tx0, #0f172a);
}
.gs-rv-sub { font-size: 1.0625rem; color: var(--gs-tx2, #64748b); margin: 0 0 1.5rem; }

/* ---------- the write-a-review card ---------- */
.gs-rv-card {
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 18px;
  padding: 1.35rem;
  box-shadow: 0 18px 40px -30px rgba(15, 23, 42, .4);
}
.gs-rv-card-hd { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.35rem; }
.gs-rv-card-ic {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(124, 58, 237, .12);
  color: var(--gs-cp, #5b21b6);
  font-size: 1.15rem;
}
.gs-rv-card-t { font-size: 1.15rem; font-weight: 800; margin: 0 0 .15rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-card-s { font-size: .9375rem; color: var(--gs-tx2, #64748b); margin: 0; }

.gs-rv-fs { border: 0; padding: 0; margin: 0 0 1.15rem; min-width: 0; }
.gs-rv-label {
  display: block; float: none;
  font-size: .875rem; font-weight: 700;
  color: var(--gs-tx0, #0f172a);
  margin: 0 0 .5rem; padding: 0;
}
.gs-rv-label span { font-weight: 500; color: var(--gs-tx2, #64748b); }

/* ---------- star input ----------
   DOM order is 5→1 and row-reverse flips it, so `:checked ~ label`
   reaches every star BEFORE the chosen one. No JS is required for
   the choice itself — the script only adds the hover preview. */
.gs-rv-rate { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.gs-rv-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .3rem; }
.gs-rv-stars input {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gs-rv-stars label {
  cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 .1rem;
  font-size: 1.9rem;
  color: var(--gs-bd0, #e2e8f0);
  transition: color .12s ease, transform .12s ease;
}
.gs-rv-stars input:checked ~ label,
.gs-rv-stars label:hover,
.gs-rv-stars label:hover ~ label { color: var(--gs-rv-star, #d97706); }
.gs-rv-stars label:hover { transform: scale(1.08); }
/* the radio is visually hidden, so the ring has to land on its label */
.gs-rv-stars input:focus-visible + label {
  outline: 2px solid var(--gs-cp, #5b21b6); outline-offset: 3px; border-radius: 4px;
}

.gs-rv-hint { display: inline-flex; align-items: center; gap: .4rem; color: var(--gs-cp, #5b21b6); }
.gs-rv-hint > i { font-size: 1.05rem; opacity: .75; }
.gs-rv-hint-pill {
  font-size: .8125rem; font-weight: 700;
  background: rgba(124, 58, 237, .12);
  border-radius: 999px;
  padding: .3rem .7rem;
  white-space: nowrap;
}
.gs-rv-hint.is-done { display: none; }

/* ---------- fields ---------- */
.gs-rv-field { margin-bottom: 1.15rem; }
.gs-rv-input-wrap { position: relative; }
.gs-rv-input {
  display: block; width: 100%;
  font: inherit; font-size: .9375rem;
  color: var(--gs-tx0, #0f172a);
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 12px;
  padding: .8rem 4.5rem .8rem .95rem;
  min-height: 48px;
}
.gs-rv-input::placeholder { color: var(--gs-tx2, #64748b); opacity: .85; }
.gs-rv-input:focus {
  outline: none;
  border-color: var(--gs-cp, #5b21b6);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .16);
}
.gs-rv-textarea { min-height: 130px; resize: vertical; padding-right: .95rem; padding-bottom: 2rem; }
.gs-rv-count {
  position: absolute; right: .85rem; bottom: .7rem;
  font-size: .75rem;
  color: var(--gs-tx2, #64748b);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.gs-rv-input:not(.gs-rv-textarea) ~ .gs-rv-count { top: 50%; bottom: auto; transform: translateY(-50%); }

.gs-rv-submit {
  width: 100%; min-height: 52px;
  border-radius: 12px; font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
.gs-rv-terms {
  text-align: center; font-size: .8125rem;
  color: var(--gs-tx2, #64748b);
  margin: .9rem 0 0;
}
.gs-rv-terms a { color: var(--gs-cp, #5b21b6); font-weight: 600; }

/* signed-out / already-reviewed */
.gs-rv-note {
  display: flex; align-items: flex-start; gap: .75rem;
  background: rgba(124, 58, 237, .06);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 12px;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
}
.gs-rv-note > i { color: var(--gs-cp, #5b21b6); font-size: 1.15rem; line-height: 1.4; }
.gs-rv-note strong { display: block; font-size: .9375rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-note span { font-size: .875rem; color: var(--gs-tx1, #334155); }

/* ---------- the list ---------- */
.gs-rv-list { margin-top: 2rem; }
.gs-rv-list-t { font-size: 1.05rem; font-weight: 800; margin: 0 0 .9rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-item {
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
}
.gs-rv-item-hd { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; }
.gs-rv-ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 36px; }
.gs-rv-ava-i {
  display: flex; align-items: center; justify-content: center;
  background: rgba(124, 58, 237, .12);
  color: var(--gs-cp, #5b21b6);
  font-weight: 700;
}
.gs-rv-item-who { display: flex; flex-direction: column; min-width: 0; }
.gs-rv-item-name { font-weight: 700; font-size: .9375rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-item-date { font-size: .75rem; color: var(--gs-tx2, #64748b); }
.gs-rv-item-stars { margin-left: auto; color: var(--gs-rv-star, #d97706); font-size: .8125rem; white-space: nowrap; }
.gs-rv-item-t { font-weight: 700; font-size: .9375rem; margin: 0 0 .2rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-item-b { font-size: .9375rem; line-height: 1.65; color: var(--gs-tx1, #334155); margin: 0; }

/* ---------- nothing to list yet ----------------------------------
   Sits where the list would be, so the column never ends in white
   space. Dashed rather than solid: this is a gap waiting to be
   filled, not a card presenting something. */
.gs-rv-empty {
  margin-top: 2rem;
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1px dashed rgba(124, 58, 237, .22);
  border-radius: 16px;
  background: rgba(124, 58, 237, .035);
}
.gs-rv-empty-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(124, 58, 237, .12);
  color: var(--gs-cp, #5b21b6);
  font-size: 1.3rem;
  margin-bottom: .85rem;
}
.gs-rv-empty-t {
  font-size: 1.05rem; font-weight: 800;
  color: var(--gs-tx0, #0f172a);
  margin: 0 0 .4rem;
  text-wrap: balance;
}
.gs-rv-empty-s {
  font-size: .9375rem; line-height: 1.65;
  color: var(--gs-tx1, #334155);
  max-width: 34rem;
  margin: 0 auto;
}
.gs-rv-empty-list {
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .9rem;
  margin: .9rem 0; padding: 0;
  font-size: .875rem; font-weight: 600;
  color: var(--gs-tx0, #0f172a);
}
.gs-rv-empty-list li { display: inline-flex; align-items: center; }
.gs-rv-empty-list li > i { color: var(--gs-cp, #5b21b6); font-size: 1.1rem; }
.gs-rv-empty .gs-btn { margin-top: 1rem; }

/* ---------- side ---------- */
.gs-rv-side { display: flex; flex-direction: column; gap: 1rem; }
.gs-rv-panel {
  background: rgba(124, 58, 237, .05);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 18px;
  padding: 1.15rem;
}
.gs-rv-tool { display: flex; align-items: center; gap: .9rem; }
.gs-rv-tool-logo {
  width: 56px; height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 15px;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  color: var(--gs-cp, #5b21b6);
  font-size: 1.5rem;
  overflow: hidden;
}
.gs-rv-tool-logo img { width: 100%; height: 100%; object-fit: contain; padding: .35rem; }
.gs-rv-tool-name { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--gs-tx0, #0f172a); }
.gs-rv-tool-cat { font-size: .875rem; color: var(--gs-tx1, #334155); margin: 0; }

.gs-rv-score { background: var(--gs-sf0, #ffffff); }
.gs-rv-score-hd { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.gs-rv-score-n {
  font-size: 2.6rem; font-weight: 800; line-height: 1;
  color: var(--gs-tx0, #0f172a);
  font-variant-numeric: tabular-nums;
}
.gs-rv-score-stars { color: var(--gs-rv-star, #d97706); font-size: 1.05rem; letter-spacing: .06em; }
.gs-rv-score-c { font-size: .875rem; color: var(--gs-tx2, #64748b); margin: .2rem 0 0; }
.gs-rv-score-empty { text-align: center; padding: .35rem 0 .2rem; }
.gs-rv-score-empty .gs-rv-score-stars { font-size: 1.35rem; }
.gs-rv-score-empty strong { color: var(--gs-tx0, #0f172a); }

.gs-rv-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.gs-rv-bar-row { display: flex; align-items: center; gap: .6rem; }
.gs-rv-bar-lbl {
  font-size: .8125rem; color: var(--gs-tx2, #64748b);
  flex: 0 0 3.4rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gs-rv-bar {
  flex: 1 1 auto; height: 9px; border-radius: 999px;
  background: var(--gs-bd0, #e2e8f0);
  overflow: hidden;
}
.gs-rv-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gs-cp, #5b21b6); }
.gs-rv-bar-pct {
  font-size: .8125rem; color: var(--gs-tx2, #64748b);
  flex: 0 0 2.4rem; text-align: right;
  font-variant-numeric: tabular-nums;
}

.gs-rv-why { position: relative; overflow: hidden; }
.gs-rv-why-t { font-size: 1.05rem; font-weight: 800; margin: 0 0 .9rem; color: var(--gs-tx0, #0f172a); }
.gs-rv-why-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.gs-rv-why-list li {
  display: flex; align-items: center; gap: .7rem;
  font-size: .9375rem; color: var(--gs-tx1, #334155);
}
.gs-rv-why-list li > span {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--gs-sf0, #ffffff);
  color: var(--gs-cp, #5b21b6);
  font-size: .9rem;
}
/* decorative flourish — a system cursive stack, so it costs no font request */
.gs-rv-voice {
  display: none;
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: 1.05rem;
  color: var(--gs-cp, #5b21b6);
  opacity: .5;
  transform: rotate(-8deg);
}

@media (min-width: 992px) {
  .gs-rv-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.25rem; }
  .gs-rv-card { padding: 1.9rem; }
  .gs-rv-panel { padding: 1.5rem; }
  .gs-rv-stars label { font-size: 2.15rem; }
  .gs-rv-score-n { font-size: 3rem; }
  .gs-rv-voice { display: block; position: absolute; right: 1rem; bottom: .9rem; }
}

/* ---------- dark ------------------------------------------------
   The surfaces alias tokens that already flip, so the cards follow
   on their own. Only the hardcoded rgba() tints and the amber need
   a dark value — amber-600 is too dark to read on a dark ground.

   ⚠ Three states, not two: an explicit choice stamps data-theme and
     the DEFAULT "system" setting stamps nothing, so the un-stamped
     document needs prefers-color-scheme, guarded with
     :not([data-theme="light"]) so an explicit light choice wins.
     These must never sit outside the media query. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gs-rv-panel { background: rgba(167, 139, 250, .08); }
  :root:not([data-theme="light"]) .gs-rv-card-ic,
  :root:not([data-theme="light"]) .gs-rv-ava-i,
  :root:not([data-theme="light"]) .gs-rv-hint-pill { background: rgba(167, 139, 250, .18); }
  :root:not([data-theme="light"]) .gs-rv-note { background: rgba(167, 139, 250, .09); }
  :root:not([data-theme="light"]) .gs-rv-empty { background: rgba(167, 139, 250, .05); }
  :root:not([data-theme="light"]) .gs-rv-empty-ic { background: rgba(167, 139, 250, .18); }
  :root:not([data-theme="light"]) .gs-rv-input:focus { box-shadow: 0 0 0 3px rgba(167, 139, 250, .22); }
  :root:not([data-theme="light"]) { --gs-rv-star: #fbbf24; }
}
:root[data-theme="dark"] .gs-rv-panel { background: rgba(167, 139, 250, .08); }
:root[data-theme="dark"] .gs-rv-card-ic,
:root[data-theme="dark"] .gs-rv-ava-i,
:root[data-theme="dark"] .gs-rv-hint-pill { background: rgba(167, 139, 250, .18); }
:root[data-theme="dark"] .gs-rv-note { background: rgba(167, 139, 250, .09); }
:root[data-theme="dark"] .gs-rv-empty { background: rgba(167, 139, 250, .05); }
:root[data-theme="dark"] .gs-rv-empty-ic { background: rgba(167, 139, 250, .18); }
:root[data-theme="dark"] .gs-rv-input:focus { box-shadow: 0 0 0 3px rgba(167, 139, 250, .22); }
:root[data-theme="dark"] { --gs-rv-star: #fbbf24; }
