/* Review Hub (spec 318): a three-pane review workspace. */

#view-review-hub { padding-bottom: 24px; }

.rh { display: flex; flex-direction: column; gap: var(--sp-3, 12px); height: calc(100vh - 110px); min-height: 520px; }
.rh-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rh-head h2 { margin: 0; color: var(--c-gold-300); font-size: 1.35rem; }
.rh-head .rh-total { color: var(--c-text-muted); font-size: .9rem; }
.rh-head .rh-spacer { flex: 1; }
.rh-head input[type=search] { background: var(--c-bg-400); border: 1px solid var(--c-border); color: var(--c-text-primary); border-radius: var(--radius-sm, 4px); padding: 6px 10px; min-width: 220px; }

.rh-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(320px, 1fr) minmax(360px, 1.1fr); gap: 12px; }
.rh-panes > * { background: var(--c-bg-panel); border: 1px solid var(--c-border-subtle); border-radius: var(--radius-md, 8px); overflow-y: auto; min-height: 0; }

/* rail */
.rh-rail { padding: 10px; }
.rh-cat { margin-bottom: 14px; }
.rh-cat-head { display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--c-text-muted); padding: 4px 6px; }
.rh-cat-head b { color: var(--c-gold-300); }
.rh-src { display: flex; justify-content: space-between; width: 100%; background: none; border: 1px solid transparent; color: var(--c-text-body); text-align: left; padding: 8px 10px; border-radius: var(--radius-sm, 4px); cursor: pointer; font: inherit; }
.rh-src:hover { background: var(--c-bg-500); }
.rh-src.is-active { background: var(--c-bg-500); border-color: var(--c-red-700); color: var(--c-text-primary); }
.rh-src em { font-style: normal; background: var(--c-red-700); color: #fff; border-radius: 10px; padding: 0 8px; font-size: .78rem; }
.rh-src.is-empty em { background: var(--c-bg-400); color: var(--c-text-muted); }
.rh-cat-soon p { font-size: .8rem; padding: 0 6px; margin: 2px 0; }
.rh-legacy { display: block; font-size: .78rem; color: var(--c-text-muted); padding: 6px 10px; }

/* groups */
.rh-groups { padding: 0 10px 10px; }
.rh-toolbar { position: sticky; top: 0; z-index: 2; background: var(--c-bg-panel); border-bottom: 1px solid var(--c-border); padding: 10px 0; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.rh-toolbar-sel { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: .88rem; color: var(--c-text-muted); }
.rh-toolbar-sel b { color: var(--c-text-primary); }
.rh-toolbar-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rh-hint { font-size: .8rem; color: var(--c-gold-300); }
.rh-group { border: 1px solid var(--c-border-subtle); border-radius: var(--radius-sm, 4px); margin-top: 8px; background: var(--c-bg-700); }
.rh-group.is-open { border-color: var(--c-border-hover); }
.rh-group-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--c-text-primary); padding: 10px 12px; cursor: pointer; font: inherit; text-align: left; }
.rh-group-head b { margin-left: auto; color: var(--c-gold-300); font-variant-numeric: tabular-nums; }
.rh-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-group-reason { font-size: .8rem; color: var(--c-text-muted); padding: 0 12px 8px; }
.rh-kind-junk { border-left: 3px solid var(--c-red-500); }
.rh-kind-tier_A { border-left: 3px solid hsl(140, 45%, 42%); }
.rh-kind-tier_B { border-left: 3px solid hsl(90, 40%, 42%); }
.rh-kind-tier_C { border-left: 3px solid hsl(43, 70%, 50%); }
.rh-kind-tier_D { border-left: 3px solid var(--c-red-500); }
.rh-hist-head { cursor: default; }

.rh-pill { font-size: .7rem; border-radius: 10px; padding: 1px 8px; background: var(--c-bg-400); color: var(--c-text-body); white-space: nowrap; }
.rh-pill-approve { background: hsla(140, 45%, 35%, .35); color: hsl(140, 45%, 75%); }
.rh-pill-reject { background: hsla(0, 70%, 40%, .35); color: var(--c-red-200); }
.rh-pill-lock { background: hsla(43, 70%, 45%, .25); color: var(--c-gold-300); }

.rh-conf { display: inline-block; width: 48px; height: 6px; border-radius: 3px; background: var(--c-bg-400); overflow: hidden; flex: none; }
.rh-conf span { display: block; height: 100%; }
.rh-conf-high span { background: hsl(140, 45%, 45%); }
.rh-conf-mid span { background: hsl(43, 75%, 55%); }
.rh-conf-low span { background: var(--c-red-400); }

.rh-items { list-style: none; margin: 0; padding: 0 0 6px; }
.rh-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--c-border-subtle); }
.rh-item.is-cursor { background: var(--c-bg-500); box-shadow: inset 3px 0 0 var(--c-gold-300); }
.rh-item.is-unticked .rh-item-body { opacity: .45; text-decoration: line-through; }
.rh-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--c-red-500); flex: none; }
.rh-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 3px; flex: none; background: var(--c-bg-400); }
.rh-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; }
.rh-item-title { color: var(--c-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-item-sub { font-size: .78rem; color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-more { margin: 8px 12px; }

/* detail */
.rh-detail { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.rh-detail-head h3 { margin: 0 0 4px; color: var(--c-text-primary); word-break: break-word; }
.rh-pk { font-size: .78rem; display: flex; gap: 8px; align-items: center; }
.rh-evidence-img { max-width: 100%; max-height: 320px; border-radius: var(--radius-sm, 4px); display: block; margin: 0 auto; background: var(--c-bg-400); }
.rh-caption { font-size: .88rem; color: var(--c-text-body); }
.rh-quote { font-size: .88rem; border-left: 3px solid var(--c-border-hover); padding-left: 8px; color: var(--c-text-body); }
.rh-raw { white-space: pre-wrap; font-size: .8rem; max-height: 260px; overflow: auto; background: var(--c-bg-800); padding: 8px; border-radius: var(--radius-sm, 4px); color: var(--c-text-body); }
.rh-meta { font-size: .8rem; color: var(--c-text-muted); }
.rh-tier-A { background: hsla(140, 45%, 35%, .35); } .rh-tier-D { background: hsla(0, 70%, 40%, .35); }
.rh-warn { background: hsla(0, 70%, 40%, .18); border: 1px solid var(--c-red-700); color: var(--c-red-200); padding: 8px 10px; border-radius: var(--radius-sm, 4px); font-size: .86rem; }
.rh-suggestion, .rh-consequence { font-size: .88rem; }
.rh-consequence { color: var(--c-gold-300); }
.rh-form { display: flex; flex-direction: column; gap: 4px; }
.rh-form label { font-size: .75rem; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.rh-form input, .rh-form textarea, .rh-form select { background: var(--c-bg-400); border: 1px solid var(--c-border); color: var(--c-text-primary); border-radius: var(--radius-sm, 4px); padding: 6px 8px; font: inherit; font-size: .9rem; }
.rh-picker { display: flex; gap: 6px; }
.rh-picker input[type=search] { flex: 1; }
.rh-picker-results { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.rh-picker-results button { width: 100%; text-align: left; background: var(--c-bg-500); border: 0; border-bottom: 1px solid var(--c-border-subtle); color: var(--c-text-primary); padding: 6px 8px; cursor: pointer; }
.rh-picker-results button:hover { background: var(--c-bg-400); }
.rh-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--c-bg-panel); padding-top: 8px; }

/* transcripts (spec 318 wave 3): per-item review cards, hosted in the Hub */
.rh-transcript-items { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.rh-ti { border: 1px solid var(--c-border); border-radius: var(--radius-sm, 4px); padding: 8px 10px; background: var(--c-bg-500); }
.rh-ti.is-confirmed { border-color: hsl(140, 40%, 36%); }
.rh-ti.is-not-game { opacity: .55; }
.rh-ti-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rh-ti-raw { font-weight: 600; }
.rh-ti-type { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.rh-ti-context { font-size: .82rem; margin: 2px 0 6px; }
.rh-ti-row { display: flex; gap: 6px; margin-top: 4px; }
.rh-ti-row select { flex: 0 0 auto; }
.rh-ti-row input[type=text] { flex: 1; background: var(--c-bg-400); border: 1px solid var(--c-border); color: var(--c-text-primary); border-radius: var(--radius-sm, 4px); padding: 6px 8px; font: inherit; font-size: .88rem; }
.rh-ti-candidates { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rh-btn-sm { padding: 3px 8px; font-size: .8rem; }
.rh-ti-notgame { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .82rem; color: var(--c-text-muted); }

/* buttons + misc */
.rh-btn { border-radius: var(--radius-sm, 4px); padding: 7px 14px; border: 1px solid var(--c-border); background: var(--c-bg-500); color: var(--c-text-primary); cursor: pointer; font: inherit; font-size: .88rem; }
.rh-btn:disabled { opacity: .45; cursor: not-allowed; }
.rh-btn-primary.rh-btn-approve { background: hsl(140, 40%, 28%); border-color: hsl(140, 40%, 36%); }
.rh-btn-primary.rh-btn-reject, .rh-btn-reject { background: var(--c-red-700); border-color: var(--c-red-500); }
.rh-btn-ghost { background: transparent; }
.rh-btn kbd { font-size: .7rem; opacity: .7; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.rh-link { background: none; border: 0; color: var(--c-gold-300); cursor: pointer; padding: 0; font: inherit; font-size: .82rem; text-decoration: underline; }
.rh-muted { color: var(--c-text-muted); }
.rh-error { color: var(--c-red-300); }
.rh-pad { padding: 10px 12px; }
.rh-h { color: var(--c-gold-300); margin: 12px 0 4px; }
.rh-empty { padding: 40px 16px; text-align: center; font-size: 1rem; color: var(--c-text-body); }
.rh-progress { position: relative; height: 22px; background: var(--c-bg-400); border-radius: 11px; overflow: hidden; }
.rh-progress span { position: absolute; inset: 0 auto 0 0; background: var(--c-red-700); transition: width .2s; }
.rh-progress em { position: relative; font-style: normal; font-size: .78rem; padding-left: 10px; line-height: 22px; }
.rh-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 9999; background: var(--c-bg-500); border: 1px solid var(--c-border-hover); color: var(--c-text-primary); border-radius: var(--radius-md, 8px); padding: 10px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 520px; }
.rh-toast-ok { border-color: hsl(140, 40%, 36%); }
.rh-toast-warn { border-color: hsl(43, 70%, 50%); }
.rh-toast-error { border-color: var(--c-red-500); }
.rh-help { background: var(--c-bg-500); border: 1px solid var(--c-border); border-radius: var(--radius-md, 8px); padding: 10px 14px; font-size: .85rem; }
.rh-help kbd { border: 1px solid var(--c-border-hover); border-radius: 3px; padding: 0 5px; margin-right: 4px; }

@media (max-width: 1100px) {
  .rh { height: auto; }
  .rh-panes { grid-template-columns: 1fr; }
  .rh-panes > * { max-height: none; }
  .rh-rail { display: flex; flex-wrap: wrap; gap: 8px; }
  .rh-cat { margin: 0; }
}

/* dropdown pickers (wave 2b) */
.rh-fk { position: relative; display: flex; flex-direction: column; gap: 4px; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rh-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--c-bg-500); border: 1px solid var(--c-border-hover); border-radius: 12px; padding: 2px 4px 2px 10px; font-size: .85rem; color: var(--c-text-primary); }
.rh-chip button { background: none; border: 0; color: var(--c-text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.rh-fk-results { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border-radius: var(--radius-sm, 4px); }
.rh-fk-results:empty { display: none; }
.rh-fk-results button { width: 100%; text-align: left; background: var(--c-bg-500); border: 0; border-bottom: 1px solid var(--c-border-subtle); color: var(--c-text-primary); padding: 6px 8px; cursor: pointer; font: inherit; font-size: .88rem; }
.rh-fk-results button:hover { background: var(--c-bg-400); }
.rh-fk-results .rh-create { color: var(--c-gold-300); }

.rh-map { height: 320px; border-radius: var(--radius-sm, 4px); border: 1px solid var(--c-border); background: var(--c-bg-800); }

.rh-sorcery-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.rh-sorcery-evidence section { min-width: 0; }
.rh-sorcery-evidence h4 { margin: 0 0 0.4rem; }
@media (max-width: 720px) { .rh-sorcery-evidence { grid-template-columns: 1fr; } }
.rh-sorcery-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr); gap: 0.75rem; align-items: start; }
.rh-book-page { margin: 0; min-width: 0; }
.rh-book-page figcaption { color: var(--c-gold-300); margin-bottom: .35rem; font-weight: 600; }
.rh-book-page img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: var(--c-bg-800); border: 1px solid var(--c-border); }
.rh-checklist { margin: .75rem 0; padding: .65rem .8rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm, 4px); }
.rh-checklist h4 { margin: 0 0 .35rem; }
.rh-checklist ul { margin: 0; padding-left: 1.25rem; }
.rh-checklist li { margin: .2rem 0; }
@media (max-width: 900px) { .rh-sorcery-page-layout { grid-template-columns: 1fr; } }
