/* Area: review (S23 review grid, S24 export dialog, status and exports list).
   Owned by the review area. Loaded on every page by base.html, so every rule is scoped under .pg-review.
   The export dialog opens on other areas' pages too, so its wrapper (.rv-x) carries .pg-review itself.
   Layout: docs/SHELL-SPEC.md §6 Review, mockup 2 #review (queues | cards | stage). The column frame
   (.colbar, .colbody, .stageview, .stageft, .stageempty) comes from shell.css. */

/* ---------- S23 columns: #rv-main and the stage carry their own column bars ---------- */
.pg-review-grid .center{padding:0}
.pg-review-grid .inspector{padding:0;gap:0}
.pg-review .rv-queues h6{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-views{padding:0 0 6px}
.pg-review .rv-views .seg{display:flex;width:100%}
.pg-review .rv-views .seg > a{flex:1 1 0;justify-content:center}

/* ---------- S23 work column (#rv-main): column bar, facts, chips, cards ---------- */
.pg-review .rv-main{min-width:0}
.pg-review .rv-tools{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;margin-left:auto;min-width:0}
.pg-review .rv-tools form,.pg-review .rv-inline,.pg-review .rp-fix form,.pg-review .rv-dec form{display:inline-flex;margin:0}
.pg-review .rv-body{display:flex;flex-direction:column;gap:12px}
.pg-review .rv-info{min-width:0;font:500 11.5px/1.55 var(--mono);color:var(--muted);overflow-wrap:anywhere}
.pg-review .rv-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.pg-review .rv-foot{font-size:11.5px;color:var(--muted)}

/* One row as a card: thumb | name + decision / chips / re-run and note. */
.pg-review .rv-list{list-style:none;display:flex;flex-direction:column;gap:6px;margin:0;padding:0;min-width:0}
.pg-review .rv-card{display:grid;grid-template-columns:44px minmax(0,1fr) auto;column-gap:10px;row-gap:6px;align-items:center;padding:8px 10px 8px 8px;border:1px solid var(--line);border-radius:var(--radius-box);background:var(--panel);cursor:pointer;min-width:0}
.pg-review .rv-card:hover{border-color:var(--line-2)}
.pg-review .rv-card.sel{border-color:var(--lime-line);box-shadow:inset 0 0 0 1px var(--lime-line);background:var(--raised)}
.pg-review .rv-card .th{grid-column:1;grid-row:1 / span 2;align-self:start;width:44px;height:44px;border-radius:var(--radius-sm);overflow:hidden;background:var(--thumb-cool);display:grid;place-items:center}
.pg-review .rv-card .th.warm{background:var(--thumb-warm)}
.pg-review .rv-card .th img{width:100%;height:100%;object-fit:contain}
.pg-review .rv-card .th.cv img{object-fit:cover}
.pg-review .rv-card .th .noprev{font-size:0;gap:0}
.pg-review .rv-card .th .noprev .i{width:16px;height:16px}
.pg-review .rv-card .as{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:1px;min-width:0;color:var(--text);text-decoration:none;border-radius:var(--radius-xs)}
.pg-review .rv-card .as b{font-weight:600;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-card .as .mono{font:500 10.5px var(--mono);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-card .as:hover b{text-decoration:underline;text-underline-offset:2px}
.pg-review .rv-dec{grid-column:3;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0}
.pg-review .rv-dec .status{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.pg-review .rv-cks{grid-column:2 / 4;grid-row:2;display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}
.pg-review .rv-meta{grid-column:2 / 4;grid-row:3;display:flex;align-items:center;gap:2px 10px;flex-wrap:wrap;min-width:0}
.pg-review .rv-meta .dt{font:500 10.5px var(--mono);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* Check chips (cards and the stage's viewer): the shared verdict, compact and mono. */
.pg-review .rv-ck{display:inline-flex;align-items:center;gap:4px;max-width:100%;min-width:0}
.pg-review .rv-ck .vd{height:20px;padding:0 5px;border-radius:var(--radius-xs);font:500 10.5px var(--mono);gap:3px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.pg-review .rv-ck .vd .i{width:10px;height:10px}
.pg-review .rv-ck .x{font:500 10px var(--mono);color:var(--pass);white-space:nowrap}

/* "Re-run" / "Retry" / "Run": one quiet link per card. */
.pg-review .rv-link{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:none;color:var(--text-2);font:500 10.5px var(--mono);cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.pg-review .rv-link .i{width:11px;height:11px}
.pg-review .rv-link:hover{color:var(--text)}
.pg-review .rv-link.htmx-request{opacity:.6}

/* ---------- S23 stage (#inspector): column bar, viewer, decision panel, evidence ---------- */
/* #inspector is a flex column that scrolls: its parts keep their height instead of shrinking into it. */
.pg-review .inspector > *{flex:none}
.pg-review .inspector > .stageempty{flex:1 1 auto}
.pg-review .rv-shead .sub{flex:0 1 auto}
.pg-review .rv-pills{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.pg-review .rv-alert{padding:12px 16px 0}
.pg-review .rv-view{height:clamp(300px,46vh,520px);min-height:0}
.pg-review .rv-view .ov.tl{right:16px}
.pg-review .rv-view .ov .rv-ck{background:var(--overlay);border-radius:var(--radius-xs)}
.pg-review .rv-view .ov .rv-ck{max-width:min(100%,300px)}
.pg-review .rv-view .ov .rv-ck .vd{display:block;height:22px;line-height:20px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pg-review .rv-view .ov .rv-ck .vd .i{margin-right:4px;vertical-align:-1px}
.pg-review .rv-view .frame{color:var(--muted)}
.pg-review .rv-view .frame.warm{background:var(--stage-warm)}
.pg-review .rv-view .frame:hover{box-shadow:0 40px 80px -30px rgba(0,0,0,.9),0 0 0 1px var(--line-2)}
.pg-review .rv-lbl{display:inline-block;max-width:min(320px,60vw);font:500 10.5px var(--mono);color:var(--text-2);background:var(--overlay);border:1px solid var(--overlay-line);border-radius:var(--radius-badge);padding:2px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rp-dp{flex:1 1 100%;display:flex;flex-direction:column;gap:10px;min-width:0}
.pg-review .rp-dp > .sec-h{margin:2px 0 -2px}
.pg-review .rp-dp .flag,.pg-review .rp-dp .look-ok,.pg-review .rp-dp .look{padding:8px 11px}
.pg-review .rp-dp .flag > div,.pg-review .rp-dp .look-ok > div,.pg-review .rp-dp .look > div{min-width:0}
.pg-review .rp-dp .flag .rp-ic{color:var(--warn)}
.pg-review .rp-dp .look-ok .ic .i{width:12px;height:12px}
.pg-review .rp-dp .look b{font-weight:600}
.pg-review .rp-ic{width:22px;height:22px;display:grid;place-items:center;color:var(--muted);flex:none}
.pg-review .rp-checking{border-color:var(--violet-line)}
.pg-review .rp-checking .vd{flex:none}
.pg-review .rp-form{display:flex;flex-direction:column;gap:10px;min-width:0}
.pg-review .rp-form .fld textarea{min-height:64px}
.pg-review .rp-acts{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.pg-review .rp-acts .btn{min-width:0}
.pg-review .rp-note{font-size:11.5px;color:var(--muted);line-height:1.45}
.pg-review .rp-held{display:flex;gap:6px;align-items:flex-start;color:var(--text-2)}
.pg-review .rp-held .i{width:13px;height:13px;flex:none;margin-top:2px;color:var(--violet-text)}
.pg-review .btn.amber{background:transparent;border-color:var(--warn-line);color:var(--warn)}
.pg-review .btn.amber:hover{background:var(--warn-soft)}
.pg-review .btn.danger:hover{background:var(--fail-soft)}
.pg-review .rv-more{display:flex;flex-direction:column;gap:18px}
.pg-review .rp-sec{display:flex;flex-direction:column;gap:8px;min-width:0}
.pg-review .rp-sec > .sec-h{margin:0}
.pg-review .rp-ev{list-style:none;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius-box);background:var(--panel)}
.pg-review .rp-ev li{padding:9px 11px;border-bottom:1px solid var(--line);min-width:0}
.pg-review .rp-ev li:last-child{border-bottom:0}
.pg-review .rp-ev .h{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:600;font-size:12.5px;margin-bottom:4px}
.pg-review .rp-ev .h .vd{flex:none;max-width:60%;overflow:hidden;text-overflow:ellipsis}
.pg-review .rp-ev .ln{font:500 11px/1.5 var(--mono);color:var(--muted);overflow-wrap:anywhere}
.pg-review .rp-ev .ln:nth-child(2){color:var(--text-2)}
.pg-review .rp-fix{display:flex;flex-wrap:wrap;gap:6px}
.pg-review .rp-log{list-style:none;display:flex;flex-direction:column;border-left:1.5px solid var(--line-2);margin-left:5px}
.pg-review .rp-log li{position:relative;padding:0 0 11px 14px;min-width:0}
.pg-review .rp-log li:last-child{padding-bottom:0}
.pg-review .rp-log li::before{content:"";position:absolute;left:-6px;top:4px;width:9px;height:9px;border-radius:50%;background:var(--surface);border:2px solid var(--muted)}
.pg-review .rp-log li.d-approve::before{border-color:var(--pass);background:var(--pass)}
.pg-review .rp-log li.d-exception::before{border-color:var(--pass)}
.pg-review .rp-log li.d-changes_requested::before{border-color:var(--warn)}
.pg-review .rp-log li.d-reject::before{border-color:var(--fail)}
.pg-review .rp-log b{font-weight:600;font-size:12.5px;display:block}
.pg-review .rp-log .m{font:500 10.5px var(--mono);color:var(--muted)}
.pg-review .rp-log p{font-size:12px;color:var(--text-2);margin-top:3px;overflow-wrap:anywhere}
.pg-review .rp-open{align-self:flex-start}

/* The empty stage: nothing selected (.rv-idle), or nothing to review on the selected asset (.rv-none). */
.pg-review .rv-idle .ic{width:42px;height:42px;border-radius:var(--radius-panel);background:var(--raised-2);color:var(--text-2);display:grid;place-items:center;margin:0 auto 2px}
.pg-review .rv-idle .ic .i{width:20px;height:20px}
.pg-review .rv-idle h3{font-size:15px;color:var(--text)}
.pg-review .rv-idle p{font-size:12.5px;max-width:42ch;margin:0 auto}
.pg-review .rv-none{min-height:320px}
.pg-review .rv-none .empty{background:var(--surface);max-width:420px}

/* ---------- table.qa (the exports list) ---------- */
.pg-review .rv-xbody{display:flex;flex-direction:column;gap:12px}
.pg-review .rv-scroll{position:relative;overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius-panel);background:var(--panel);min-width:0;-webkit-overflow-scrolling:touch}
.pg-review table.qa{width:100%;min-width:740px;border-collapse:separate;border-spacing:0;table-layout:fixed}
.pg-review .qa thead th{font:600 10.5px var(--ui);letter-spacing:.07em;text-transform:uppercase;color:var(--muted);text-align:left;padding:10px 8px;border-bottom:1px solid var(--line);background:var(--surface);white-space:nowrap;vertical-align:bottom}
.pg-review .qa tbody th,.pg-review .qa td{padding:8px;border-bottom:1px solid var(--line);vertical-align:middle;text-align:left;font-weight:400;background:var(--panel);min-width:0}
.pg-review .qa tbody tr:last-child > *{border-bottom:0}
.pg-review .qa tbody tr:hover > *{background:linear-gradient(rgba(255,255,255,.018),rgba(255,255,255,.018)) var(--panel)}
/* The first column stays put while the table scrolls sideways (narrow screens). */
.pg-review .qa tbody th,.pg-review .qa thead th:first-child{position:sticky;left:0;z-index:1}
.pg-review .qa thead th:first-child{z-index:2}
.pg-review .qa .dt{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 10px var(--mono);color:var(--muted);margin-top:4px}
.pg-review .qa .c-dec{text-align:right}
.pg-review table.rv-exports{min-width:900px}
.pg-review .rv-exports col.w-ex{width:26%} .pg-review .rv-exports col.w-pk{width:13%} .pg-review .rv-exports col.w-ct{width:15%}
.pg-review .rv-exports col.w-sz{width:8%} .pg-review .rv-exports col.w-gd{width:12%} .pg-review .rv-exports col.w-stt{width:9%}
.pg-review .rv-exports col.w-ac{width:17%}
.pg-review .rv-exports .nm{display:flex;flex-direction:column;gap:2px;min-width:0}
.pg-review .rv-exports .nm b{font:500 12px var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-exports .nm span{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-exports .dt.rv-wrap{white-space:normal;margin-top:0}
.pg-review .rv-acts{display:inline-flex;gap:6px;justify-content:flex-end;flex-wrap:nowrap}
.pg-review .status.rv-failed{background:var(--fail-soft);color:var(--fail);border-color:var(--fail-line)}

/* ---------- S24 export dialog ---------- */
.pg-review.rv-x .dh .ic{width:34px;height:34px;border-radius:9px;background:#478CBF;color:#fff;display:grid;place-items:center;flex:none}
.pg-review.rv-x .dh .ic .i{width:18px;height:18px}
.pg-review.rv-x .dh .sub{overflow-wrap:anywhere}
.pg-review .rv-xform{display:flex;flex-direction:column;min-width:0}
.pg-review .rv-xalert{padding:12px 20px 0}
.pg-review .rv-only{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 20px;border-bottom:1px solid var(--line);font-size:12.5px;color:var(--text-2)}
.pg-review .rv-only .btn{margin-left:auto}
.pg-review .rv-xfield{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.pg-review .rv-xfield .l{color:var(--muted);font-size:12px}
.pg-review .rv-ver{display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:var(--radius-seg);background:var(--raised-2);box-shadow:inset 0 0 0 1px var(--line-2);font:600 12.5px var(--mono);color:var(--text)}
.pg-review .rv-root{flex:1;min-width:150px;height:32px;display:flex;align-items:center;padding:0 10px;border:1px solid var(--line-2);border-radius:var(--radius-ctl);background:var(--panel);font:500 12px var(--mono);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-tight{margin:4px 0 -4px}
.pg-review .rv-tight label{cursor:pointer}
.pg-review .rv-opt{cursor:default;padding:8px 10px;align-items:flex-start}
.pg-review .rv-opt .cb{width:17px;height:17px;border-radius:5px;background:var(--lime);color:var(--lime-ink);display:grid;place-items:center;flex:none;margin-top:1px}
.pg-review .rv-opt .cb .i{width:11px;height:11px}
.pg-review .rv-opt b{font-size:12.5px}
.pg-review .rv-opt small{display:block;font-size:11.5px;color:var(--muted)}
.pg-review.rv-x code{font:500 11px var(--mono);color:var(--text-2);background:var(--raised-2);padding:0 4px;border-radius:var(--radius-xs)}
.pg-review.rv-x .rv-root{background:var(--panel);padding:0 10px;color:var(--text);font-size:12px}
.pg-review .tree{font:500 11.5px/1.65 var(--mono);color:var(--text-2);border:1px solid var(--line);border-radius:var(--radius-box);background:var(--canvas);padding:9px 12px;overflow-x:auto}
.pg-review .tree .tl{white-space:pre}
.pg-review .tree .h{color:var(--lime)}
.pg-review .tree .f{color:var(--muted)}
.pg-review .tree .p{color:var(--violet-text)}
.pg-review .rv-skip{padding:8px 12px;gap:6px;flex-direction:column;align-items:stretch}
.pg-review .rv-skiphead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.pg-review .rv-skip .d{font-size:12px;color:var(--text-2)}
.pg-review .rv-thumbs{display:flex;gap:6px;margin-left:auto}
.pg-review .rv-thumbs .t{width:34px;height:34px;border-radius:8px;overflow:hidden;background:radial-gradient(#3A2E24,#15120F);border:1px solid var(--warn-line);display:grid;place-items:center;flex:none}
.pg-review .rv-thumbs img{width:100%;height:100%;object-fit:contain}
.pg-review .rv-thumbs .noprev{font-size:0;color:var(--muted);display:grid;place-items:center}
.pg-review .rv-thumbs .noprev .i{width:16px;height:16px}
.pg-review .rv-open{font-size:12px;color:var(--text-2);text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
.pg-review .rv-open:hover{color:var(--text)}
.pg-review .rv-skiplist{list-style:none;display:flex;flex-direction:column;gap:2px;font-size:11.5px;min-width:0}
.pg-review .rv-skiplist li{display:flex;justify-content:space-between;gap:10px;min-width:0}
.pg-review .rv-skiplist li > span:first-child{color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.pg-review .rv-skiplist .mono{font:500 10.5px var(--mono);color:var(--muted);white-space:nowrap}
.pg-review .rv-skiplist li:has(.rv-fix){flex-wrap:wrap}
.pg-review .rv-skiplist .rv-fix{font-size:11px;font-weight:600;color:var(--warn);text-decoration:none;white-space:nowrap;margin-left:auto}
.pg-review .rv-skiplist .rv-fix:hover{text-decoration:underline}
.pg-review .rv-skip .rv-skiplist{border-top:1px solid var(--warn-line);padding-top:6px}
.pg-review .rv-ph{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pg-review .rv-ph h3{font-size:15px}
.pg-review .rv-ph .tagai{font-size:10px;padding:1px 6px;margin-left:0}
.pg-review .stat{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:8px}
.pg-review .stat > div{border:1px solid var(--line);border-radius:var(--radius-box);background:var(--panel);padding:8px 10px;min-width:0}
.pg-review .stat b{font:600 18px var(--head);display:block}
.pg-review .stat span{font-size:11px;color:var(--muted)}
.pg-review .lin{border:1px solid var(--line);border-radius:var(--radius-box);background:var(--panel);max-height:224px;overflow-y:auto}
.pg-review .lin .r{display:grid;grid-template-columns:110px minmax(0,1fr) auto;gap:8px;padding:6px 10px;border-bottom:1px solid var(--line);font-size:11.5px;align-items:center}
.pg-review .lin .r:last-child{border-bottom:0}
.pg-review .lin .r b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .lin .ch{color:var(--text-2);min-width:0}
.pg-review .lin .uses{color:var(--muted)}
.pg-review .lin .c{font:500 10.5px var(--mono);color:var(--muted);display:flex;align-items:center;gap:6px;justify-content:flex-end;white-space:nowrap}
.pg-review .disc{display:block;width:100%;min-height:150px;border:1px solid rgba(139,92,246,.35);border-radius:var(--radius-box);background:rgba(139,92,246,.07);padding:10px 12px;font:12px/1.55 var(--ui);color:var(--text);resize:vertical}
.pg-review .disc:focus{outline:none;border-color:var(--violet);box-shadow:0 0 0 3px var(--violet-soft)}
.pg-review .disc[readonly]{min-height:120px}
.pg-review .rv-cb{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-2);cursor:pointer;width:max-content;max-width:100%}
.pg-review .rv-cb input{accent-color:var(--lime);width:15px;height:15px;flex:none}
.pg-review .rv-out{font-size:12px;min-width:0;overflow-wrap:anywhere}
.pg-review .rv-copy{display:none}
.xw-can-copy .pg-review .rv-copy{display:inline-flex}

/* ---------- S24 export status ---------- */
.pg-review .rv-st{padding:16px 20px;display:flex;flex-direction:column;gap:12px;min-width:0}
.pg-review .rv-st-h{display:flex;align-items:center;gap:12px}
.pg-review .rv-st-h b{font-weight:600}
.pg-review .rv-st-h .d{font:500 11.5px var(--mono);color:var(--muted)}
.pg-review .rv-st .pipe{margin-top:0}
.pg-review .rv-st .look-ok .ic .i{width:12px;height:12px}
.pg-review .rv-st .look-ok b{overflow-wrap:anywhere}
.pg-review .rv-note{font-size:12px;color:var(--muted)}
.pg-review .rv-facts .row > :last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-review .rv-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.pg-review .rv-cols .sec-h{margin-bottom:6px}

/* ---------- Responsive (docs/SHELL-SPEC.md §5) ---------- */
@media (max-width:979px){
  .pg-review .rv-view{height:clamp(260px,42vh,440px)}
}
@media (max-width:767px){
  .pg-review .colbody{padding:14px var(--gutter) 28px}
  .pg-review .rv-head{position:relative}
  .pg-review .rv-tools{margin-left:0;justify-content:flex-start}
  .pg-review .rv-card .rv-dec{grid-column:2 / 4;grid-row:3;justify-content:flex-start}
  .pg-review .rv-card .rv-meta{grid-row:4}
  .pg-review .rp-acts{justify-content:stretch}
  .pg-review .rp-acts .btn{flex:1 1 100%}
  .pg-review .rv-thumbs{margin-left:0}
  .pg-review .lin .r{grid-template-columns:minmax(0,1fr) auto}
  .pg-review .lin .r .ch{grid-column:1 / -1;grid-row:2}
  .pg-review .rv-only .btn{margin-left:0}
}
@media (pointer:coarse){
  .pg-review .rv-link{min-height:40px}
  .pg-review .rv-card .as{min-height:40px;justify-content:center}
}
