.brand { font-weight: 700; text-decoration: none; }
form.inline { display: inline; margin: 0; }
button.small { padding: 0.25rem 0.75rem; font-size: 0.85rem; margin: 0; }
.narrow { max-width: 420px; margin: 2rem auto; }
.muted { color: var(--pico-muted-color); }
.error { color: #c62828; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.notice { padding: 0.75rem 1rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.stat { border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 0.75rem; font-size: 0.85rem; }
.stat span { display: block; font-size: 1.6rem; font-weight: 700; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.status-pending { background: #e3e7ee; color: #37474f; }
.badge.status-correct { background: #d7f2dc; color: #1b5e20; }
.badge.status-incorrect { background: #fbd9d9; color: #b71c1c; }
.badge.status-needs_review { background: #ffecc7; color: #8a5300; }
.stat.status-incorrect span { color: #b71c1c; }
.stat.status-needs_review span { color: #8a5300; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }

.table-scroll { overflow-x: auto; }
.ok { color: #1b5e20; }
.warn { color: #8a5300; }
.low-conf { background: #ffecc7; color: #8a5300; font-weight: 600; }
.stat-link { text-decoration: none; color: inherit; }
.stat.attention { border-color: #e0a100; }
.stat.attention span { color: #8a5300; }

.flash { padding: 0.6rem 1rem; border-radius: 6px; border: 1px solid var(--pico-muted-border-color); }
.flash-success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.flash-error { background: #fdecea; border-color: #ef9a9a; color: #b71c1c; }

.group { padding: 1rem; }
.group > header { margin-bottom: 0.75rem; }
.photo-card { border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 0.5rem; font-size: 0.85rem; }
.photo-card strong { display: block; overflow-wrap: anywhere; }
.photo-card .thumb img { width: 100%; height: 160px; object-fit: cover; border-radius: 4px; }
.photo-card details { margin: 0.25rem 0 0; }
.select-photo { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.25rem; }
.role-form { margin: 0.25rem 0; }
.role-form select { padding: 0.2rem 0.5rem; font-size: 0.85rem; margin: 0; height: auto; }
.assign-bar { display: flex; gap: 0.5rem; align-items: center; max-width: 520px; }
.assign-bar input, .assign-bar button { margin: 0; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.photo-panel { padding: 0.75rem; }
.photo-panel .thumb img { width: 100%; max-height: 360px; object-fit: contain; background: #0001; border-radius: 4px; }
table.readings { font-size: 0.85rem; margin: 0.5rem 0; }
table.readings th, table.readings td { padding: 0.25rem 0.4rem; text-align: center; }
table.history { font-size: 0.85rem; }
.warnings li { margin-bottom: 0.4rem; }
.warnings .warn-job_number_mismatch { color: #b71c1c; font-weight: 600; }
.confirm footer { margin-top: 1rem; }

.result { padding: 1rem; border-left: 6px solid #90a4ae; }
.result-correct { border-left-color: #2e7d32; }
.result-incorrect { border-left-color: #c62828; }
.result-needs_review { border-left-color: #e0a100; }
.result header { margin-bottom: 0.5rem; }
.result footer { margin-top: 0.5rem; }
.result .note { font-weight: 600; color: #8a5300; }
table.findings { font-size: 0.85rem; margin: 0.5rem 0; }
table.findings td { vertical-align: top; }
tr.finding-incorrect td { background: #fdecea; }
tr.finding-needs_review td { background: #fff6e0; }
td.flag-incorrect { outline: 2px solid #c62828; outline-offset: -2px; color: #b71c1c; font-weight: 700; }
td.flag-needs_review { outline: 2px dashed #e0a100; outline-offset: -2px; }
ul.issues { margin: 0.25rem 0; padding-left: 1.2rem; font-size: 0.85rem; color: #8a5300; }

.badge.stage-waiting_photos { background: #e3e7ee; color: #37474f; }
.badge.stage-needs_attention { background: #ffecc7; color: #8a5300; }
.badge.stage-awaiting_remake { background: #fbd9d9; color: #b71c1c; }
.badge.stage-ready { background: #d7f2dc; color: #1b5e20; }
.badge.stage-dispatched { background: #dbe7fb; color: #0d47a1; }
.decision { padding: 1rem; }
.decision-actions form { margin: 0.75rem 0 0; }
.decision-actions label { font-size: 0.9rem; }
a[role="button"].small { padding: 0.25rem 0.75rem; font-size: 0.85rem; }
table.correct-form input { width: 5.5rem; padding: 0.2rem 0.35rem; margin: 0; height: auto; font-size: 0.9rem; }

.health { padding: 0.75rem 1rem; border-left: 6px solid #90a4ae; }
.health-ok { border-left-color: #2e7d32; }
.health-warning, .health-never { border-left-color: #e0a100; }
.health-stale, .health-failing { border-left-color: #c62828; }
.badge.run-ok { background: #d7f2dc; color: #1b5e20; }
.badge.run-partial, .badge.run-running { background: #ffecc7; color: #8a5300; }
.badge.run-failed { background: #fbd9d9; color: #b71c1c; }
table.runs details { margin: 0; }

td.actions { white-space: nowrap; }
td.actions form { margin-right: 0.25rem; }
form.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
form.filters > * { width: auto; margin: 0; }
