/* Shared by index.html and model.html. Served by serve.py at /app.css. */
  :root {
    --bg: #ffffff; --card: #f7f7f8; --line: #dcdfe4; --fg: #1a1d24;
    --muted: #6b7280; --accent: #2563eb; --good: #16a34a; --bad: #dc2626; --warn: #b45309;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg); color: var(--fg); padding: 24px;
  }
  h1 { font-size: 20px; margin: 0 0 4px; }
  .sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
  .wrap { max-width: 1000px; margin: 0 auto; }
  .drop {
    display: block;
    border: 2px dashed var(--line); border-radius: 12px; padding: 28px;
    text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
    background: var(--card);
  }
  .drop.hover { border-color: var(--accent); background: #eef2ff; }
  .drop input { display: none; }
  .stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 22px; }
  .stat {
    flex: 1 1 320px; background: var(--card); border: 1px solid var(--line);
    border-left: 4px solid var(--good); border-radius: 12px; padding: 14px 16px;
  }
  .stat.warn { border-left-color: #d97706; }
  .stat.missing { border-left-color: var(--bad); opacity: .75; }
  .stat .task { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
                color: var(--muted); font-weight: 600; }
  .stat .big { font-size: 34px; font-weight: 700; line-height: 1.1; margin: 6px 0 0; }
  .stat .big .spread { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 6px; }
  .stat .unit { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
  .stat .kv { display: flex; justify-content: space-between; font-size: 13px;
              padding: 3px 0; border-top: 1px dotted var(--line); }
  .stat .kv span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
  .stat .basis { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
  .stat .foot { font-size: 11px; color: var(--muted); margin-top: 8px;
                display: flex; justify-content: space-between; gap: 8px; }
  .badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
           border-radius: 999px; background: #fde68a; color: #78350f; vertical-align: 2px; }
  .badge.err { background: #fecaca; color: #7f1d1d; }
  #tablewrap { overflow-x: auto; margin-top: 16px; }
  table.res { border-collapse: collapse; width: 100%; font-size: 14px; }
  table.res th, table.res td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
  table.res th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
                 color: var(--muted); font-weight: 600; white-space: nowrap; }
  table.res tbody tr:hover { background: var(--card); }
  table.res td.file { font-family: ui-monospace, Menlo, monospace; font-size: 12px;
                      max-width: 320px; overflow-wrap: anywhere; }
  table.res img.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px;
                        border: 1px solid var(--line); display: block; }
  .verdict { font-weight: 700; white-space: nowrap; }
  .v-bad { color: var(--bad); } .v-good { color: var(--good); }
  .p { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
  td.pending { color: var(--muted); font-style: italic; }
  .row { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
  .preview { flex: 0 0 260px; }
  .preview img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
  .results { flex: 1 1 380px; min-width: 300px; }
  .card {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 10px;
  }
  .card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .name { font-weight: 600; }
  .arch { color: var(--muted); font-size: 12px; }
  .label { font-size: 16px; font-weight: 700; }
  .label.good { color: var(--good); }
  .label.bad { color: var(--bad); }
  .conf { color: var(--muted); font-size: 12px; }
  .bars { margin-top: 8px; }
  .bar { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 3px 0; }
  .bar .k { width: 120px; color: var(--muted); }
  .bar .track { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
  .bar .fill { display: block; height: 100%; background: var(--accent); }
  button {
    margin-top: 14px; background: var(--accent); color: #fff; border: 0;
    padding: 10px 18px; border-radius: 8px; font-size: 14px; cursor: pointer;
  }
  button:disabled { opacity: .5; cursor: default; }
  .muted { color: var(--muted); font-size: 13px; }
  .err { color: var(--bad); font-size: 13px; }

.nav { margin: 0 0 22px; font-size: 13px; }
.nav a { color: var(--accent); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav .sep { color: var(--muted); margin: 0 8px; }

/* ---- results table: verdict, confidence, disagreement -------------------- */
/* The two models answer DIFFERENT questions (is there a defect / is it dry),
   so they keep distinct wording. What is shared is the visual grammar: a dot
   whose colour is the call and a bar whose length is the confidence. */
.vrow { display: flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.bad { background: var(--bad); } .dot.good { background: var(--good); }
.dot.edge { background: var(--warn, #d97706); }
.bar { height: 5px; border-radius: 3px; background: var(--line); margin: 5px 0 3px;
       overflow: hidden; max-width: 150px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar i.bad { background: var(--bad); } .bar i.good { background: var(--good); }
.bar i.edge { background: var(--warn, #d97706); }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .03em;
       padding: 1px 5px; border-radius: 4px; vertical-align: 1px; }
.tag.edge { background: color-mix(in srgb, var(--warn, #d97706) 18%, transparent);
            color: var(--warn, #d97706); }
.tag.dis  { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
tr.disagree td { background: color-mix(in srgb, var(--bad) 5%, transparent); }
.summary { display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
           padding: 11px 14px; margin: 14px 0 0; border: 1px solid var(--line);
           border-radius: 9px; background: var(--card); font-size: 13px; }
.summary b { font-size: 17px; font-variant-numeric: tabular-nums; }
.summary .sep { color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.toolbar select, .toolbar button {
  font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.toolbar button:hover, .toolbar select:hover { border-color: var(--accent); }
table.res th.sortable { cursor: pointer; user-select: none; }
table.res th.sortable:hover { color: var(--accent); }
table.res img.thumb { cursor: zoom-in; }
table.res td.file { max-width: 210px; overflow: hidden; text-overflow: ellipsis;
                    white-space: nowrap; }
/* Lightbox: 46px cannot show a ring, so the image has to be openable. */
.lb { position: fixed; inset: 0; background: rgba(0,0,0,.86); display: none;
      align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lb.on { display: flex; }
.lb img { max-width: 94vw; max-height: 88vh; border-radius: 8px; }
.lb .cap { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
           color: #fff; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
