/* =====================================================================
   THE REVIEWS MANAGER (/reviews - docs/claude/REVIEWS.md "The faces"; reviews-r2 spec 4.4) and a reviews moment's Source and Recipe
   pickers in the builder's drawer (4.5): the gallery, a source's card and its chips, the source form, the keys and the written OK,
   the mapping table, the recipe editor, Try it. ONE stylesheet owns every rv-* class. Colours, lines and radii are --theme-* / --wf-*
   tokens only, so a light and a dark workspace theme both work.
   ===================================================================== */

.rv-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rv-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px 20px; }
.rv-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rv-section-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.rv-subtitle { margin: 6px 0 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 650; }
.rv-label { color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 650; }
.rv-quiet { margin: 0; color: var(--theme-text-muted); font-size: var(--wf-text-sm); line-height: 1.45; overflow-wrap: anywhere; }
.rv-strong { color: var(--theme-text-emphasis); font-weight: 600; }
.rv-code { font-family: var(--theme-font-mono); font-size: 12.5px; color: var(--theme-text-secondary); overflow-wrap: anywhere; }
.rv-note { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 8px 12px; border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: var(--wf-text-sm); line-height: 1.45; overflow-wrap: anywhere; }
.rv-note > .bi { flex: none; color: var(--wf-primary-ink); }
.rv-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--theme-text-secondary); }
.rv-failed > p { margin: 0; }
.rv-skel { height: 12rem; border-radius: var(--wf-radius-md); }
.rv-empty { gap: 16px; }

/* ---- Tones (a chip, a badge, a note) ---- */
.rv-tone-neutral { background: var(--wf-neutral-soft); color: var(--theme-text-secondary); }
.rv-tone-good { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.rv-tone-warn { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.rv-tone-bad { background: var(--wf-danger-soft); color: var(--wf-danger-ink); }
.rv-note.rv-tone-good > .bi,
.rv-note.rv-tone-warn > .bi,
.rv-note.rv-tone-bad > .bi { color: inherit; }

/* ---- Badges and chips ---- */
.rv-badges,
.rv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rv-badge,
.rv-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: var(--wf-radius-pill); font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.rv-badge { background: var(--wf-neutral-soft); color: var(--theme-text-secondary); letter-spacing: 0.02em; }
.rv-badge-price { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.rv-badge-provider { border: 1px solid var(--theme-border); background: var(--theme-background-raised); color: var(--theme-text-emphasis); }
.rv-chip { background: var(--wf-neutral-soft); color: var(--theme-text-secondary); }

/* ---- The gallery ---- */
.rv-gallery-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rv-gallery-title { margin: 8px 0 0; color: var(--theme-text-secondary); font-size: var(--wf-text-xs); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.rv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 12px; min-width: 0; }
.rv-gallery.is-compact { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.rv-provider { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; }
.rv-provider.is-muted { background: var(--theme-background-subtle); }
.rv-provider-head { display: flex; flex-direction: column; gap: 6px; }
.rv-provider-name { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 700; }
.rv-provider-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-top: auto; }
.rv-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.rv-facts dt { color: var(--theme-text-secondary); font-size: var(--wf-text-xs); font-weight: 650; }
.rv-facts dd { margin: 0; color: var(--theme-text); font-size: var(--wf-text-sm); line-height: 1.45; }

/* ---- A source's card ---- */
.rv-source.is-off,
.rv-recipe.is-off { background: var(--theme-background-subtle); }
.rv-source-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.rv-source-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.rv-source-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.rv-source-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rv-problems { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rv-problems > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: var(--wf-radius-md); background: var(--wf-warning-soft); color: var(--wf-warning-ink); font-size: var(--wf-text-sm); }
.rv-fix { padding: 0; color: var(--wf-primary-ink); font-weight: 600; }
.rv-confirm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--theme-border); border-radius: var(--wf-radius-md); }
.rv-confirm > label { color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 600; }
.rv-menu { position: relative; display: inline-flex; }
.rv-menu-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; display: flex; flex-direction: column; min-width: 13rem; padding: 4px; border: 1px solid var(--theme-border); border-radius: var(--wf-radius-md); background: var(--theme-background-raised); box-shadow: var(--theme-shadow); }
.rv-menu-item { padding: 6px 10px; border: 0; border-radius: var(--wf-radius-sm); background: transparent; color: var(--theme-text); font-size: var(--wf-text-sm); text-align: left; }
.rv-menu-item:hover,
.rv-menu-item:focus-visible { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }

/* ---- Forms (a source, a recipe) ---- */
.rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px 16px; min-width: 0; }
.rv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rv-field > label { color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 650; }
.rv-field-narrow { max-width: 22rem; }
.rv-field.is-invalid > .form-control,
.rv-field.is-invalid > .form-select { border-color: var(--wf-danger-ink); }
.rv-problem { margin: 0; color: var(--wf-danger-ink); font-size: var(--wf-text-sm); line-height: 1.4; }
.rv-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rv-checks > legend { width: 100%; margin: 0 0 2px; }
.rv-check { display: inline-flex; align-items: baseline; gap: 8px; color: var(--theme-text); font-size: var(--wf-text-sm); }
.rv-check > input { flex: none; }
.rv-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.rv-issues { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--wf-text-sm); }
.rv-issues > li { padding: 6px 10px; border-radius: var(--wf-radius-md); background: var(--wf-danger-soft); color: var(--wf-danger-ink); overflow-wrap: anywhere; }
.rv-terms,
.rv-copy,
.rv-keys,
.rv-approval { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--theme-border-subtle); border-radius: var(--wf-radius-md); }
.rv-keys-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rv-keys-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rv-keys-what { display: flex; flex: 1 1 16rem; flex-direction: column; min-width: 0; }
.rv-keys-name { color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 600; }
.rv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rv-grow { flex: 1 1 18rem; min-width: 0; }
.rv-num { max-width: 7rem; }
.rv-inline { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--theme-text-secondary); font-size: var(--wf-text-xs); }

/* ---- The mapping table ---- */
.rv-table-wrap { min-width: 0; overflow-x: auto; }
.rv-table { margin: 0; }
.rv-table th { color: var(--theme-text-secondary); font-size: var(--wf-text-xs); font-weight: 650; white-space: nowrap; }
.rv-table td { vertical-align: top; overflow-wrap: anywhere; }
.rv-table td > .rv-quiet,
.rv-table td > .rv-code,
.rv-table td > .rv-problem { display: block; margin-top: 4px; }

/* ---- Recipes ---- */
.rv-maps { display: flex; flex-direction: column; gap: 6px; }
.rv-map-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 8px; max-width: 40rem; color: var(--theme-text-muted); }
.rv-starters { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rv-starter { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 10px 12px; border: 1px solid var(--theme-border-subtle); border-radius: var(--wf-radius-md); }
.rv-starter > div { display: flex; flex: 1 1 20rem; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.rv-starter .rv-quiet { width: 100%; }

/* ---- Try it ---- */
.rv-try-answer { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--theme-border-subtle); }
.rv-say { margin: 0; padding: 10px 14px; border-left: 3px solid var(--theme-primary); border-radius: var(--wf-radius-sm); background: var(--theme-background-subtle); color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); line-height: 1.5; }
.rv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.rv-review { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--theme-border-subtle); border-radius: var(--wf-radius-md); background: var(--theme-background-raised); font-size: var(--wf-text-sm); }
.rv-review > p { margin: 0; color: var(--theme-text); line-height: 1.45; overflow-wrap: anywhere; }
.rv-review-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.rv-stars { color: var(--wf-warning-ink); letter-spacing: 1px; }
.rv-disclosure { margin: 0; color: var(--theme-text-secondary); font-size: var(--wf-text-xs); font-style: italic; }
.rv-try-note { font-variant-numeric: tabular-nums; }

/* ---- The builder's reviews pickers (a reviews moment's drawer) ---- */
.rv-pick { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.rv-pick-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rv-pick-token { display: inline-flex; align-items: center; gap: 6px; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); }
.rv-pick-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--wf-warning-ink); }
.rv-pick-link { color: var(--wf-primary-ink); font-weight: 600; }
.rv-pick-help { margin: 0; }
.rv-pick-help-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--wf-primary-ink); font-size: var(--wf-text-sm); font-weight: 600; cursor: pointer; }
.rv-pick-help-btn:hover,
.rv-pick-help-btn:focus-visible { text-decoration: underline; }

/* ---- The page header's guides zip: its size, muted beside the words ---- */
.rv-zip-note { color: var(--theme-text-secondary); font-weight: 400; }

@media (max-width: 640px) {
    .rv-card { padding: 14px; }
    .rv-map-pair { grid-template-columns: minmax(0, 1fr) auto; }
    .rv-map-pair > .bi { display: none; }
}
