.document-list { gap: 1px; border: 1px solid #b9c3c3; background: #b9c3c3; }
.document-list-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .45rem 0; }
.document-list-tools label { flex: 1; max-width: 26rem; }
.document-list-tools input { width: 100%; min-height: 2rem; border: 1px solid #aebaba; background: #fff; }
.document-row { display: block; margin: 0; padding: 0; border: 0; border-left: 4px solid var(--ok); background: #fff; }
.document-row:nth-child(even) { background: #f6f8f7; }
.document-row.unavailable { border-left-color: var(--danger); background: #fff7f5; }
.document-row.pending { border-left-color: var(--warn); }
.document-row-summary { display: grid; grid-template-columns: minmax(12rem,1fr) 5.5rem 7rem 7rem auto; align-items: center; min-height: 40px; gap: .4rem; padding: .2rem .4rem .2rem .55rem; }
.document-identity { min-width: 0; }
.document-identity strong,
.document-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-identity strong { font-size: .76rem; }
.document-identity small { margin-top: .08rem; color: var(--muted); font-size: .64rem; }
.document-page-count,
.document-scan-state,
.document-processing-state { overflow: hidden; color: var(--muted); font: 700 .63rem var(--data); text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.document-scan-state { padding: .18rem .3rem; background: #e5eeea; color: #235f54; }
.document-row.unavailable .document-scan-state { background: #f4dfdc; color: #852b24; }
.document-row-actions { display: flex; justify-content: flex-end; gap: .3rem; }

.review-section { --field-tint: #f1f4f4; --field-edge: #cbd5d5; }
:is(#review-panel-overview,#review-panel-coverage) { --field-tint: #edf3f5; --field-edge: #c6d6dc; }
:is(#review-panel-conditions,#review-panel-negotiation) { --field-tint: #f7f2e8; --field-edge: #ddcfb9; }
:is(#review-panel-facts,#review-panel-treatment) { --field-tint: #edf4ef; --field-edge: #c7d7cc; }
:is(#review-panel-damages,#review-panel-bills) { --field-tint: #f5efed; --field-edge: #d9c9c4; }
.review-section .field[data-field-path] { gap: .2rem; padding: .38rem .42rem .42rem; border: 1px solid var(--field-edge); background: var(--field-tint); }
.review-section .field[data-field-path]:focus-within { border-color: var(--accent); background: #f9fbfb; box-shadow: inset 3px 0 var(--accent); }
.review-section .field.is-unlocated[data-field-path] { border-color: #d7b2ad; background: #fff5f3; }
.review-section .field-coverage { display: inline-flex; align-items: center; gap: .3rem; min-height: 1rem; margin-top: .08rem; font: 700 .66rem var(--data); letter-spacing: .02em; }
.review-section .field-coverage i { display: inline-grid; place-items: center; width: .8rem; height: .8rem; border: 1px solid currentColor; font-style: normal; line-height: 1; }
.review-section .field-coverage.located i::before { content: "✓"; font-size: .62rem; }
.review-section .field-coverage:is(.located_edited,.user_supplied,.user_supplied_unverified) i::before { content: "+"; }
.review-section .field-coverage:is(.not_located,.ai_unavailable,.requires_review) i::before { content: "?"; font-size: .62rem; }

.source-panel { position: relative; margin-top: .7rem; border: 1px solid #8f9d9f; background: #eef2f1; }
.source-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.source-viewer-head h2 { margin: .08rem 0 0; }
.source-viewer-actions,
.source-viewer-controls,
.source-page-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.source-viewer-controls { justify-content: space-between; margin-bottom: .35rem; padding: .35rem .45rem; border: 1px solid #c3cdcc; background: #f8faf9; }
.source-viewer-controls label { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .68rem; font-weight: 700; }
.source-viewer-controls select { min-width: min(24rem,50vw); border: 1px solid var(--line); background: #fff; }
#sourcePageNumber { width: 4.2rem; border: 1px solid var(--line); background: #fff; text-align: center; }
#sourcePageTotal,
#sourceZoomValue { min-width: 4.2rem; color: var(--muted); font: 700 .65rem var(--data); text-align: center; }
.source-icon-button { padding-inline: .45rem; font-size: 1rem; }
.source-viewer-actions [aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.source-frame-wrap { width: 100%; min-height: 28rem; overflow: auto; border: 1px solid #667376; background: #566367; }
.source-panel iframe { display: block; width: 100%; height: 68vh; border: 0; background: #566367; }
.source-page-image { display: block; max-width: none; max-height: 68vh; margin: auto; object-fit: contain; background: #dfe3e4; }
.source-page-image.fit-page { width: 100%!important; height: 68vh; object-fit: contain; }
.source-page-image[hidden] { display: none; }
body.source-viewer-expanded { overflow: hidden; }
.source-panel.is-expanded { position: fixed; inset: .65rem; z-index: 190; display: grid; grid-template-rows: auto auto auto auto minmax(0,1fr); margin: 0; padding: .65rem; box-shadow: 0 20px 70px rgba(10,25,34,.35); }
.source-panel.is-expanded .source-frame-wrap { min-height: 0; height: 100%; }
.source-panel.is-expanded iframe,
.source-panel.is-expanded .source-page-image.fit-page { height: 100%; max-height: none; }
@media(max-width:800px){
  .document-row-summary { grid-template-columns: minmax(9rem,1fr) 5rem auto; }
  .document-scan-state,
  .document-processing-state { display: none; }
  .source-viewer-head { align-items: flex-start; flex-direction: column; }
  .source-viewer-actions { width: 100%; }
  .source-viewer-controls { align-items: flex-start; flex-direction: column; }
  .source-viewer-controls select { min-width: min(86vw,24rem); }
}
