:root {
  --bg: #f5f6f4;
  --card: #ffffff;
  --text: #1c2321;
  --muted: #5d6965;
  --line: #dde2df;
  --accent: #176b5b;
  --accent-ink: #ffffff;
  --track: #e6ebe8;
  --error: #b3261e;
  --error-bg: #fdecea;
  --found: #1d7a46;
  --check: #9a6400;
  --review: #b3401e;
  --none: #6b7470;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615;
    --card: #1b211f;
    --text: #e7ecea;
    --muted: #9aa6a1;
    --line: #2d3532;
    --accent: #3fb59b;
    --accent-ink: #0d1412;
    --track: #2a3330;
    --error: #ff8a80;
    --error-bg: #3a1e1c;
    --found: #5fd08e;
    --check: #f0b84d;
    --review: #ff9a76;
    --none: #9aa6a1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121615; --card: #1b211f; --text: #e7ecea; --muted: #9aa6a1; --line: #2d3532;
  --accent: #3fb59b; --accent-ink: #0d1412; --track: #2a3330; --error: #ff8a80; --error-bg: #3a1e1c;
  --found: #5fd08e; --check: #f0b84d; --review: #ff9a76; --none: #9aa6a1; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang HK", "Microsoft JhengHei", sans-serif;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 32px 16px 48px; }
.top h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.lede { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
h2 { font-size: 1.2rem; margin: 0; line-height: 1.3; }
h3 { font-size: 0.95rem; margin: 0 0 8px; }

.form label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0 0 6px; }
.form input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}
.form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn {
  font: inherit; font-weight: 600; font-size: 0.95rem; border-radius: 8px; padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.notice { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice p { margin: 2px 0 0; }
.error { color: var(--error); background: var(--error-bg); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 14px 0; }

.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.job-head p { margin: 4px 0 0; font-size: 0.9rem; }
.big { font-size: 2.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.phase { margin-bottom: 14px; }
.phase-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; margin-bottom: 6px; }
.phase-row span:first-child { font-weight: 600; }
.phase-row .muted { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }

.chips { list-style: none; padding: 0; margin: 16px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.chips b { margin-right: 4px; }

.recent-wrap { margin-top: 20px; overflow-x: auto; }
.recent { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.recent th, .recent td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.recent th { font-weight: 600; color: var(--muted); }
.recent td:nth-child(2) { word-break: break-all; }
.recent .num { text-align: right; font-variant-numeric: tabular-nums; }
.st { font-weight: 600; white-space: nowrap; }
.st-Found { color: var(--found); }
.st-Spot-check { color: var(--check); }
.st-Needs-review { color: var(--review); }
.st-Not-found { color: var(--none); }
.st-Error { color: var(--error); }

.foot { font-size: 0.85rem; margin-top: 8px; }

@media (max-width: 520px) {
  .wrap { padding-top: 20px; }
  .top h1 { font-size: 1.45rem; }
  .big { font-size: 1.8rem; }
  .recent th:nth-child(3), .recent td:nth-child(3) { display: none; }
}
