:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #667085; --line: #dde1e7;
  --accent: #1f5fae; --bad: #b42318; --warn: #b54708; --ok: #067647;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
header .brand { font-weight: 700; color: var(--ink); text-decoration: none; }
header nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
a { color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
main.wide { max-width: none; }
h1 { font-size: 22px; margin: 0 0 8px; } h3 { margin: 4px 0 8px; }
.muted { color: var(--muted); }
.bad { color: var(--bad); } .warn { color: var(--warn); font-weight: 600; }
.flash { background: #eef4ff; border: 1px solid #c7d7fe; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 12px 0; }
.card.narrow { max-width: 380px; margin: 60px auto; }
label { display: block; margin: 10px 0; }
label.radio { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
label > input:not([type=radio]):not([type=checkbox]), label > select, label > textarea { display: block; width: 100%; margin-top: 4px; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; padding: 8px 14px; }
legend { font-weight: 600; padding: 0 6px; }
button, .button { font: inherit; background: #eef1f5; border: 1px solid var(--line); color: var(--ink);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .card > button:last-of-type.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost, .button.ghost { background: transparent; }
form.inline { display: inline; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; background: var(--card); width: 100%; }
th, td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
th { background: #f0f2f5; font-size: 13px; white-space: nowrap; }
.status { padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef1f5; }
.status.extracted { background: #e0f2fe; } .status.reviewed { background: #dcfae6; color: var(--ok); }
.status.error { background: #fee4e2; color: var(--bad); } .status.duplicate { background: #f2f4f7; color: var(--muted); }
.status.queued, .status.running, .status.submitted { background: #fef0c7; }
.split { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.imgpane { position: sticky; top: 8px; }
.imgwrap { overflow: auto; max-height: 85vh; border: 1px solid var(--line); background: #222; }
.imgwrap img { display: block; max-width: 100%; }
.zoombar { display: flex; gap: 6px; margin-bottom: 6px; }
table.edit td { padding: 2px; }
table.edit input { border: 1px solid transparent; padding: 3px 4px; min-width: 3em; }
table.edit input:focus { border-color: var(--accent); outline: none; }
table.edit td.flag input { border: 2px solid var(--bad); background: #fff5f4; }
tr.rowflag { background: #fffaeb; }
table.subt { width: auto; } table.subt th { font-size: 11px; } table.subt input { min-width: 2.5em; }
.pii { font-size: 10px; color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 0 3px; }
.actions { display: flex; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.notice { border-color: #c7d7fe; background: #f5f8ff; }
.bigpw { font: 600 24px/1.3 ui-monospace, Consolas, monospace; letter-spacing: 1px; margin: 6px 0; user-select: all; }
button.danger { background: transparent; color: var(--bad); border-color: #fda29b; }
td.btns { white-space: nowrap; }
tr.inactive td { color: var(--muted); }
