/* Homepage review tubes (#reviews, pulse.js). Light glass card in the site's
   own tokens; four glossy liquid tubes keep their own colours.
   Bump ?v= on index.html when this changes. */

.pulse-stage {
  --g: #22C55E; --b: #3B82F6; --y: #EAB308; --r: #EF4444;
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(110% 80% at 0% 0%, var(--accent-soft), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(6, 182, 212, .07), transparent 60%),
    var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pulse-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.pulse-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  font-size: var(--fs-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink);
}
.pulse-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pulse-stage[data-mode="mine"] .pulse-chip::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-line); }
.pulse-count { font-size: var(--fs-caption); font-weight: 500; color: var(--ink-3); }

.pulse-body { display: grid; gap: 28px; }
@media (min-width: 860px) {
  .pulse-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: center; }
  .pulse-side { border-left: 1px solid var(--hair); padding-left: 40px; }
}

.pulse-sum {
  margin: 0 0 6px; font-family: var(--serif); font-size: 22px; line-height: 1.3; color: var(--ink);
}
.pulse-sum b { font-weight: 500; color: var(--ok); }

/* Tubes */
.pulse-tubes { display: grid; gap: 12px; }
.pulse-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 76px; align-items: center; gap: 14px;
  width: 100%; padding: 6px 8px; margin: 0;
  background: none; border: 0; border-radius: var(--r-sm);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background .2s var(--ease);
}
.pulse-row:hover { background: var(--paper-2); }
.pulse-row:focus-visible, .pulse-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pulse-name { font-size: var(--fs-card); font-weight: 500; color: var(--ink-2); }
.pulse-row[aria-pressed="true"] .pulse-name { color: var(--ink); font-weight: 600; }
.pulse-num { display: grid; justify-items: end; line-height: 1.2; }
.pulse-pct { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.pulse-ppl { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pulse-ppl:empty { display: none; }

.pulse-row[data-pick="loved"], .pulse-dot[data-pick="loved"] { --c: var(--g); }
.pulse-row[data-pick="helpful"], .pulse-dot[data-pick="helpful"] { --c: var(--b); }
.pulse-row[data-pick="okay"], .pulse-dot[data-pick="okay"] { --c: var(--y); }
.pulse-row[data-pick="fix"], .pulse-dot[data-pick="fix"] { --c: var(--r); }

.pulse-tube {
  position: relative; display: block; height: 24px; border-radius: var(--r-pill);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 2px 4px rgba(14, 16, 32, .06);
  overflow: hidden;
}
.pulse-fill {
  position: absolute; inset: 0 auto 0 0; display: block;
  width: var(--w, 0%);
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .1) 40%, rgba(0, 0, 0, .1) 100%),
    var(--c);
  box-shadow: 0 4px 12px -4px var(--c), inset 0 -2px 3px rgba(0, 0, 0, .12);
  transition: width 1.1s cubic-bezier(.22, 1.2, .36, 1);
  overflow: hidden;
}
/* The liquid: a soft wave sliding along the top of the fill. */
.pulse-fill::before {
  content: ''; position: absolute; inset: 0 -60px 0 0;
  background: radial-gradient(14px 7px at 50% 0, rgba(255, 255, 255, .55), transparent 70%) 0 3px / 60px 100% repeat-x;
  animation: pulse-wave 2.4s linear infinite;
}
/* Gloss line, like glass. */
.pulse-fill::after {
  content: ''; position: absolute; left: 10px; right: 10px; top: 4px; height: 4px; border-radius: 4px;
  background: rgba(255, 255, 255, .6);
}
.pulse-fill.is-empty::after, .pulse-fill.is-empty::before { display: none; }
@keyframes pulse-wave { to { transform: translateX(-60px); } }

/* Side: the four round buttons */
.pulse-ask { margin: 0 0 14px; font-family: var(--serif); font-size: 22px; line-height: 1.25; color: var(--ink); }
.pulse-dots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.pulse-dot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 6px 2px; margin: 0; background: none; border: 0; border-radius: var(--r-sm);
  color: var(--ink-3); font: inherit; font-size: var(--fs-caption); white-space: nowrap; cursor: pointer;
  transition: color .2s var(--ease);
}
.pulse-dot:hover { color: var(--ink-2); }
.pulse-orb {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .6), transparent 45%), var(--c);
  opacity: .5;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px transparent;
  transition: transform .25s var(--ease), opacity .25s var(--ease), box-shadow .25s var(--ease);
}
.pulse-dot:hover .pulse-orb { opacity: .8; transform: scale(1.05); }
.pulse-dot[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.pulse-dot[aria-pressed="true"] .pulse-orb {
  opacity: 1; transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c), 0 6px 18px -2px var(--c);
}

.pulse-send { width: 100%; justify-content: center; }
.pulse-send[disabled] { opacity: .45; cursor: not-allowed; }
.pulse-msg { margin: 12px 0 0; font-size: var(--fs-caption); line-height: 1.5; color: var(--ink-3); min-height: 2.6em; }
.pulse-msg.is-ok { color: var(--ok); }
.pulse-msg.is-err { color: var(--bad); }
/* "Already in": a faded red, softer than an error (owner, 2026-10-15). */
.pulse-msg.is-limit { color: #D9707F; }
.pulse-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 559px) {
  .pulse-stage { padding: 20px 16px; border-radius: var(--r-lg); }
  .pulse-row { grid-template-columns: 78px minmax(0, 1fr) 64px; gap: 10px; padding: 4px; }
  .pulse-name { font-size: var(--fs-caption); }
  .pulse-tube { height: 20px; }
  .pulse-sum, .pulse-ask { font-size: 19px; }
  .pulse-orb { width: 38px; height: 38px; }
  .pulse-dot { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-fill { transition: none; }
  .pulse-fill::before { animation: none; }
}
