/* Engineer app: one thumb, outdoors, gloves off. Big targets, high contrast. */
:root {
  --navy: #102a54; --ink: #14181f; --muted: #5b6575; --line: #d9dee7; --bg: #f3f5f9; --card: #fff;
  --pass: #157f3b; --defect: #c0262d; --na: #6b5b00; --amber: #ffc400;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
main { padding: 12px 12px calc(110px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
h1, h2 { margin: 0 0 8px; }
h2 { font-size: 18px; }
a { color: var(--navy); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 12px 8px; background: var(--navy); color: #fff; min-height: 56px; }
.bar .title { flex: 1; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .back { color: #fff; text-decoration: none; font-size: 34px; line-height: 1; padding: 0 10px 4px 0; min-width: 44px; }
.sync { border: 0; border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 600; background: var(--amber); color: #111; min-height: 40px; }
.sync.all-synced { background: #2f8f53; color: #fff; }
.sync.has-failed { background: #ffb3b3; }
.offline { background: #fff4cc; color: #5a4600; padding: 8px 12px; font-size: 14px; text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 12px; }
label { display: block; font-weight: 600; margin: 0 0 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 17px; padding: 12px; border: 1px solid #b9c1ce; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input[type=checkbox] { display: inline-block; width: 26px; height: 26px; margin: 0 10px 0 0; vertical-align: middle; flex: none; accent-color: var(--navy); }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--navy); color: #fff; border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; }
.secondary { background: #e7ebf3; color: var(--navy); border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; min-height: 48px; }
.big { width: 100%; min-height: 56px; font-size: 18px; }
.link { background: none; border: 0; color: var(--navy); text-decoration: underline; padding: 12px 0; font-size: 16px; }
.error { color: var(--defect); font-weight: 600; min-height: 1em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 15px; margin: 4px 0 8px; }
.note { font-size: 15px; }

.signin { padding-top: 40px; }
.brand { text-align: center; margin-bottom: 20px; }
.brand .logo { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 18px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 28px; border-bottom: 6px solid var(--amber); }
.brand p { color: var(--muted); margin: 4px 0 0; }

.hello { color: var(--muted); margin: 4px 2px 12px; }
.site-name { font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.list-h { margin: 18px 2px 8px; }
.empty { color: var(--muted); }
.visits { list-style: none; margin: 0; padding: 0; }
.visit-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 14px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 64px; }
.visit-item .when { font-weight: 700; }
.visit-item .what { color: var(--muted); font-size: 15px; grid-column: 1; }
.visit-item .chip { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.chip { border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; background: #fff1c2; color: #6b5200; }
.chip.signed { background: #d8f0df; color: #135e2f; }

.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; }
.banner.signed { background: #d8f0df; color: #135e2f; }
.line-opt { display: flex; align-items: center; font-weight: 500; padding: 10px 0; margin: 0; border-top: 1px solid #eef1f5; min-height: 48px; }
.line-opt:first-of-type { border-top: 0; }
.line-opt b { display: inline-block; min-width: 34px; }
[data-testid=kind-picker] { margin: 0 0 10px 36px; width: calc(100% - 36px); }

.line { margin: 18px 0 0; }
.line h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 2px 8px; }
.line h2 .ref { background: var(--navy); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 14px; }
.line h2 small { color: var(--muted); font-weight: 500; font-size: 14px; }
.asset { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.asset.res-pass { border-left-color: var(--pass); }
.asset.res-defect { border-left-color: var(--defect); }
.asset.res-not_accessed { border-left-color: #b9a000; }
.asset-head b { display: block; font-size: 17px; }
.asset-head span { color: var(--muted); font-size: 14px; }
.checks { list-style: none; margin: 8px 0; padding: 0; }
.checks label { display: flex; align-items: center; font-weight: 400; margin: 0; padding: 8px 0; min-height: 44px; font-size: 16px; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.r { min-height: 52px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: 16px; }
.r.pass.on { background: var(--pass); border-color: var(--pass); color: #fff; }
.r.defect.on { background: var(--defect); border-color: var(--defect); color: #fff; }
.r.na.on { background: #e9d65c; border-color: #b9a000; color: #2b2400; }
.photo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.photo-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 10px 14px; min-height: 48px; border-radius: 10px; background: #e7ebf3; color: var(--navy); font-weight: 700; overflow: hidden; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.photo-btn.off { opacity: .45; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eef1f5; }

.temp { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.temp .outlet { grid-column: 1 / -1; margin: 0; }
.temp label { margin: 0; font-size: 15px; }
.flag { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.flag.pass { background: #d8f0df; color: #135e2f; }
.flag.fail { background: #fbd5d7; color: #8d1a20; }

.footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + var(--safe-b)); background: rgba(243, 245, 249, .96); border-top: 1px solid var(--line); z-index: 4; }
.footer .big { max-width: 616px; margin: 0 auto; display: block; }

.summary ul { margin: 0 0 8px; padding-left: 18px; }
.summary li { margin-bottom: 6px; }
.warn { color: var(--defect); font-weight: 700; }
.sig-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.sig { display: block; width: 100%; height: 180px; border: 2px dashed #9aa5b5; border-radius: 12px; background: #fff; touch-action: none; margin-bottom: 14px; }
