/* Proof Pack — phone-first. Targets are 48px+ for gloved hands. */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273549;
  --line: #334155;
  --text: #eef2f7;
  --muted: #9aa8bd;
  --green: #16a34a;
  --green-dark: #15803d;
  --red: #dc2626;
  --amber: #f59e0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 "Segoe UI", Roboto, system-ui, sans-serif;
  padding: 0 0 96px;
}
button, input { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px;
  background: var(--bg); border-bottom: 2px solid var(--line);
}
.brand { font-size: 20px; margin: 0; letter-spacing: .5px; }

/* ---------- buttons: never below 48px ---------- */
.btn {
  min-height: 48px; min-width: 48px;
  padding: 12px 18px;
  background: var(--panel-2); color: var(--text);
  border: 2px solid var(--line); border-radius: 10px;
  cursor: pointer; font-weight: 600;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 56px; font-size: 18px; width: 100%; }
.btn-primary { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn-quiet { background: transparent; color: var(--muted); }
.link-btn {
  min-height: 48px; background: none; border: none; color: var(--green);
  text-decoration: underline; cursor: pointer; padding: 8px;
}
.back-btn { width: 100%; margin-bottom: 12px; text-align: left; }

/* ---------- inputs ---------- */
input[type="text"], input[type="number"] {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: #0b1220; border: 2px solid var(--line); border-radius: 10px;
  margin-bottom: 6px;
}
input:focus { outline: 3px solid var(--green); }
.field-label { display: block; font-weight: 600; margin: 12px 0 4px; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }

/* ---------- cards & list ---------- */
main { padding: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 19px; }
.cta-row { display: grid; gap: 10px; margin-bottom: 14px; }
.job-list, .line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.empty { color: var(--muted); padding: 16px; text-align: center; border: 2px dashed var(--line); border-radius: 12px; }

.job-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.job-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.job-card h2 { margin: 0; font-size: 18px; }
.job-card-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--green-dark); color: #fff; }
.pill-warn { background: #7c5300; color: #ffe9b0; }
.pill-muted { background: var(--line); color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.big { font-size: 26px; font-weight: 700; margin: 4px 0; }
.claim-total { font-size: 30px; font-weight: 800; color: #4ade80; margin: 8px 0 0; }

/* ---------- scope lines: picture first ---------- */
.scope-line {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.scope-photo-box { position: relative; }
.scope-photo { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.scope-photo-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; background: #0b1220; }
.photo-input {
  position: absolute; inset: 0; width: 96px; height: 96px;
  opacity: 0; cursor: pointer; border-radius: 10px;
}
.scope-body { display: grid; gap: 8px; }
.scope-desc { margin: 0; }
.qty-row { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.qty-btn {
  min-height: 56px; font-size: 26px; font-weight: 800;
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.qty-input { text-align: center; font-size: 22px; font-weight: 700; margin: 0; }
.unit-row { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-btn {
  min-height: 48px; padding: 8px 14px; border-radius: 999px;
  background: #0b1220; border: 2px solid var(--line); cursor: pointer;
}
.unit-btn.on { background: var(--green); border-color: var(--green-dark); color: #fff; font-weight: 700; }
.btn-voice { width: 100%; }
.scope-foot { display: flex; justify-content: space-between; align-items: center; }
.line-total { font-weight: 700; }
.rate-label { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }

/* ---------- signature ---------- */
#sig-canvas {
  width: 100%; height: auto; aspect-ratio: 5 / 2;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; touch-action: none;
}
.sig-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 10px; }
.sig-preview { width: 100%; max-width: 320px; background: #fff; border-radius: 10px; }

/* ---------- backup / footer / toast ---------- */
.backup { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 6px; }
.backup summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.backup .btn { width: 100%; margin-bottom: 8px; }
.foot { padding: 8px 14px 20px; text-align: center; }
.foot p { margin: 4px 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 20; max-width: 92vw;
  background: var(--green-dark); color: #fff; font-weight: 600;
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
[hidden] { display: none !important; }