/* Review (pages/review.js; design/redesign-2026-10/theme.css "screen: review", NOTES.md §8): the
   grid of versions waiting, each card's verdict box, the decline dialog's picture, and a version's
   media one item at a time (media-stage.js, shared with the swipe deck in deck.css). The dialog's
   parts and .with-mic are base.css's. */

/* ---------------------------------------------------------------- screen: review */
.rv-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.rv-tools .chip-row {
  flex: 1 1 auto;
  min-width: 0;
}
.keys {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.keys kbd + span {
  margin-right: 8px;
}
.rv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.rv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.rv-card > .media {
  margin: 6px 6px 0;
  border-radius: 8px; /* 14 card - 6 inset */
}
.rv-body {
  display: grid;
  gap: 8px;
  flex: 1;
  align-content: start;
  padding: 12px 14px 6px;
}
.rv-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.rv-title h3 {
  font-size: var(--fs-15);
  font-weight: 650;
}
.rv-title .ver {
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.rv-title .t-tiny {
  margin-left: auto;
  white-space: nowrap;
}
.rv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.rv-changed {
  font-size: var(--fs-13);
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}
.rv-changed b {
  font-weight: 650;
  color: var(--ink);
}
.rv-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-12);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-amber));
}
.rv-acts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
}
.rv-verdict {
  --h: var(--hue-green);
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: start center;
  padding: 44px 20px 20px; /* the box sits over the picture; the name stays readable */
  text-align: center;
  background: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h) / 0.22);
  backdrop-filter: saturate(0.4);
  -webkit-backdrop-filter: saturate(0.4);
  animation: verdict-in var(--t-med) var(--ease-out);
}
.rv-card[data-judged='declined'] .rv-verdict {
  --h: var(--hue-red);
}
.rv-card[data-judged='redo'] .rv-verdict {
  --h: var(--hue-orange);
}
.rv-verdict-in {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 22px 16px;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--h));
}
.rv-verdict-in > .i {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 50%;
  color: #fff;
  background: oklch(calc(var(--tone-dot-l) - 0.06) var(--tone-dot-c) var(--h));
  stroke-width: 2.5;
}
.rv-verdict-in .what {
  font-size: var(--fs-17);
  font-weight: 650;
}
.rv-verdict-in .undo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-13);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
@keyframes verdict-in {
  from {
    opacity: 0;
  }
}

.rv-tools .keys {
  margin-left: auto;
}
.rv-tools .btn.is-quiet {
  margin-left: -6px;
}
.rv-tools .chip-row[hidden] + .keys {
  margin-left: 0;
}
.rv-new {
  display: flex;
  margin: -4px auto 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
}
.rv-new .i {
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-violet));
}
.rv-msg:empty {
  display: none;
}
.rv-msg .empty {
  padding: 56px 16px;
}
.rv-grid > [hidden] {
  display: none;
}

/* a card: it can be swiped (a reviewer's), focused (← → act on it) and judged */
.rv-card {
  touch-action: pan-y;
  transition-property: box-shadow, transform;
  transition-duration: var(--t-fast);
  transition-timing-function: var(--ease);
  outline: none;
}
.rv-card:focus-visible {
  box-shadow: var(--shadow-1), 0 0 0 2px var(--focus), 0 0 0 5px var(--accent-soft);
}
.rv-card.is-drag {
  z-index: 3;
  transition: none;
  cursor: grabbing;
  box-shadow: var(--shadow-pop);
}
.rv-card.is-snap {
  transition: transform 300ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.rv-card > .ms.media {
  margin: 6px 6px 0;
  border-radius: 8px; /* 14 card - 6 inset */
}
.rv-card[data-n]:not([data-n='0']):not([data-n='1']) > .ms {
  cursor: pointer;
}
.rv-title h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rv-meta > span:not(.label):not(.status) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rv-changed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.rv-note .i {
  margin-top: 1px;
}
.rv-note span {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.rv-acts .btn {
  min-width: 0;
}
.rv-acts.is-note {
  grid-template-columns: minmax(0, 1fr) auto;
}
.rv-acts.is-look {
  grid-template-columns: minmax(0, 1fr);
}
.rv-card.is-judged .rv-acts {
  visibility: hidden;
}
.rv-verdict[hidden] {
  display: none;
}
.rv-card[data-judged='gone'] .rv-verdict {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.rv-card[data-judged='gone'] .rv-verdict-in {
  color: var(--ink-2);
}
.rv-card[data-judged='gone'] .rv-verdict-in > .i {
  background: var(--ink-4);
}
.rv-verdict-in {
  max-width: 100%;
  text-align: center;
}
.rv-verdict-in .what {
  text-wrap: balance;
}

/* the stamps a swipe shows on the picture */
.rv-stamp {
  position: absolute;
  top: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: var(--fs-13);
  font-weight: 700;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.rv-stamp.is-yes {
  left: 14px;
  background: oklch(0.56 0.13 var(--hue-green));
  rotate: -6deg;
}
.rv-stamp.is-no {
  right: 14px;
  background: oklch(0.56 0.17 var(--hue-red));
  rotate: 6deg;
}

/* ---------------------------------------------------------------- a version's media (media-stage.js) */
.ms {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--stage);
  user-select: none;
  -webkit-user-select: none;
}
.ms-slot,
.ms-back {
  position: absolute;
  inset: 0;
}
.ms-slot {
  z-index: 1;
  display: grid;
  place-items: center;
}
.ms-slot > * {
  grid-area: 1 / 1;
  transition: opacity 180ms var(--ease);
}
.ms-slot > .ms-enter {
  opacity: 0;
}
.ms-img,
.ms-vid {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* letterboxed media sits on a blurred, dimmed copy of itself */
.ms-back {
  z-index: 0;
  overflow: hidden;
}
.ms-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(36px) saturate(1.3) brightness(0.42);
  scale: 1.2;
}
.ms-blank {
  color: #9d9a91;
  font-size: var(--fs-12);
}
.ms-audio {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  color: #cbc8be;
}
.ms-audio-ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.ms-audio audio {
  position: relative;
  z-index: 4;
  width: min(320px, 80%);
}
.ms.is-loading .ms-slot::after {
  content: '';
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: 0;
  animation:
    msspin 800ms linear infinite,
    msshow 1ms 350ms forwards;
}
@keyframes msspin {
  to {
    rotate: 360deg;
  }
}
@keyframes msshow {
  to {
    opacity: 1;
  }
}
/* the grid's badges and play mark sit over the slot */
.ms .badge {
  z-index: 3;
  pointer-events: none;
}
.ms .badge[hidden] {
  display: none;
}
.ms .play {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.ms[data-paused='true'] .play {
  opacity: 1;
}

/* the halves: a mouse over one shows its arrow (a click there steps that way) */
.ms-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 50%;
  padding: 0 10px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease);
}
.ms-zone.is-prev {
  left: 0;
}
.ms-zone.is-next {
  right: 0;
  justify-content: flex-end;
}
.ms-zone i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ms-zone .i {
  width: 18px;
  height: 18px;
}
.ms[data-half='prev'] .ms-zone.is-prev,
.ms[data-half='next'] .ms-zone.is-next {
  opacity: 1;
}
.is-drag .ms-zone {
  opacity: 0 !important;
}

/* dots under the media: 24 px to hit, an 8 px dot to see */
.ms-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  z-index: 3;
  display: flex;
  padding: 0 4px;
  border-radius: 14px;
  background: rgba(20, 20, 18, 0.5);
  translate: -50% 0;
}
.ms-dot {
  position: relative;
  width: 24px;
  height: 24px;
}
.ms-dot::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition-property: background-color, scale;
  transition-duration: 120ms;
  transition-timing-function: var(--ease);
}
.ms-dot:hover::before {
  background: rgba(255, 255, 255, 0.8);
}
.ms-dot[aria-current='true']::before {
  background: #fff;
  scale: 1.25;
}

/* story segments over the top: one per item, filling while its clip plays */
.ms-segs {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  gap: 4px;
  padding: 2px 10px 0;
}
.ms-segs::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 64px;
  background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}
.ms-seg {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 8px 0 0;
}
.ms-seg-bar {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: background-color 120ms var(--ease);
}
.ms-seg:hover .ms-seg-bar {
  background: rgba(255, 255, 255, 0.5);
}
.ms-seg-fill {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.ms-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.ms.is-segments .ms-tools {
  top: 34px;
  right: 12px;
}
.ms-tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.5);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition-property: background-color, scale;
  transition-duration: 120ms;
  transition-timing-function: var(--ease);
}
.ms-tool::after {
  content: '';
  position: absolute;
  inset: -4px;
}
.ms-tool:hover {
  background: rgba(20, 20, 18, 0.75);
}
.ms-tool:active {
  scale: 0.96;
}
.ms-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.55);
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.ms-flash .i {
  width: 26px;
  height: 26px;
}
.ms-flash.is-on {
  animation: msflash 650ms var(--ease-out);
}
@keyframes msflash {
  0% {
    opacity: 0;
    scale: 0.7;
  }
  25% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.15;
  }
}

/* zoom: a picture at its own pixels, over everything */
.ms-zoom {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(15, 15, 14, 0.96);
  animation: msfade var(--t-med) var(--ease-out);
}
@keyframes msfade {
  from {
    opacity: 0;
  }
}
.ms-zoom-pane {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: auto;
  outline: none;
  overscroll-behavior: contain;
}
.ms-zoom-pane img {
  flex: none;
  max-width: none;
  margin: auto;
  cursor: zoom-out;
  -webkit-user-drag: none;
}
.ms-zoom.is-fit .ms-zoom-pane img {
  cursor: zoom-in;
}
.ms-zoom-x {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background-color var(--t-fast) var(--ease);
}
.ms-zoom-x:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------------------------------------------------------------- the decline dialog (review-why.js) */
.dialog.rv-why {
  width: min(560px, calc(100% - 32px));
}
.rv-why-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-4);
  background: var(--stage);
}
.rv-why-pic {
  position: relative;
  display: block;
  cursor: crosshair;
}
.rv-why-pic img {
  display: block;
  max-width: 100%;
  max-height: 34dvh;
  -webkit-user-drag: none;
}
.rv-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: oklch(calc(var(--tone-dot-l) - 0.04) var(--tone-dot-c) var(--hue-amber));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.35);
  translate: -50% -50%;
  pointer-events: none;
}
.rv-why .textarea {
  padding-right: 44px;
}
.rv-why .with-mic .icon-btn.is-on {
  --h: var(--hue-red);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--h));
  background: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h) / var(--tone-fill-a));
  animation: dot-pulse 1.8s var(--ease) infinite;
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 720px) {
  .keys {
    display: none;
  }
  .rv-tools {
    gap: 10px;
  }
  .rv-tools .chip-row {
    flex: 1 1 100%;
  }
  .rv-grid {
    gap: 14px;
  }
  .rv-acts .btn {
    height: 44px;
  }
  .rv-why .textarea {
    font-size: 16px; /* iOS doesn't zoom into a 16 px field */
  }
}
@media (hover: none) {
  .keys {
    display: none;
  }
}
