/* Land Logic FLHA — big targets, high contrast for daylight, one-handed: main actions live in the bottom bar. */
:root { --y: #ffc400; --dark: #1c1c1c; --bg: #f4f2ed; --card: #fff; --line: #d8d4ca; --mut: #6b665c;
  --ok: #1f7a3a; --na: #77736a; --warn: #b45a00; --bad: #b3261e; --tap: 58px; --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--dark); font: 18px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
body { padding-bottom: calc(96px + var(--safe-b)); }
button, input, textarea, select { font: inherit; color: inherit; }
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; background: var(--dark); color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px; min-height: 60px; }
#topbar #title { flex: 1; font-size: 20px; } #topbar #title span { color: var(--y); font-weight: 700; }
#netState { font-size: 13px; color: #bbb; }
.icon-btn { background: none; border: 0; color: var(--y); font-size: 40px; line-height: 1; width: 52px; height: 48px; padding: 0; }
main { padding: 12px; max-width: 720px; margin: 0 auto; }
h2 { font-size: 21px; margin: 22px 4px 10px; } h2:first-child { margin-top: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.mut { color: var(--mut); font-size: 15px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap); padding: 12px 16px;
  border-radius: 14px; border: 2px solid var(--dark); background: #fff; font-weight: 650; font-size: 19px; margin: 8px 0; text-align: center; }
.btn.primary { background: var(--y); border-color: var(--y); }
.btn.dark { background: var(--dark); color: #fff; }
.btn.big { min-height: 84px; font-size: 22px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:active, .chip:active, .seg button:active { transform: scale(.98); filter: brightness(.95); }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
label.f { display: block; font-size: 15px; font-weight: 650; color: var(--mut); margin: 10px 2px 4px; }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=email], textarea, select {
  width: 100%; min-height: var(--tap); border: 2px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; font-size: 18px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--y); border-color: var(--dark); }
.list .item { display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 10px; width: 100%; text-align: left; }
.list .item .grow { flex: 1; min-width: 0; } .list .item b { display: block; }
.list .item .sub { color: var(--mut); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #eee; }
.pill.Low { background: #d8f0dd; color: var(--ok); } .pill.Medium { background: #ffe9b8; color: #7a5200; } .pill.High { background: #f8d4d1; color: var(--bad); }
.pill.draft { background: #e5e1d8; }
/* hazards */
.hz { background: #fff; border: 2px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.hz.yes { border-color: var(--warn); } .hz.na { opacity: .75; }
.hz-head { display: flex; align-items: stretch; min-height: 64px; }
.hz-name { flex: 1; display: flex; align-items: center; padding: 10px 12px; font-weight: 700; font-size: 18px; background: none; border: 0; text-align: left; }
.hz-name .st { margin-left: auto; font-size: 13px; font-weight: 800; padding: 3px 8px; border-radius: 8px; }
.hz.yes .st { background: #ffe1bf; color: var(--warn); } .hz.na .st { background: #eee; color: var(--na); }
.seg { display: flex; } .seg button { min-width: 74px; border: 0; border-left: 2px solid var(--line); background: #faf9f6; font-weight: 800; font-size: 16px; }
.seg button.on.y { background: var(--warn); color: #fff; } .seg button.on.n { background: var(--na); color: #fff; }
.hz-body { padding: 4px 12px 12px; border-top: 1px dashed var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { min-height: 50px; padding: 10px 14px; border-radius: 26px; border: 2px solid var(--line); background: #fff; font-size: 16px; font-weight: 600; text-align: left; }
.chip.on { background: var(--dark); border-color: var(--dark); color: #fff; } .chip.on::before { content: "✓ "; color: var(--y); }
.seg3 { display: flex; gap: 8px; } .seg3 button { flex: 1; min-height: 64px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 19px; }
.seg3 button.on.Low { background: var(--ok); color: #fff; border-color: var(--ok); }
.seg3 button.on.Medium { background: #e0a100; color: #fff; border-color: #e0a100; }
.seg3 button.on.High { background: var(--bad); color: #fff; border-color: var(--bad); }
/* photos + signatures */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #ddd; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.x { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 22px; }
.sig { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; margin-bottom: 10px; }
.sig .who { flex: 1; min-width: 0; } .sig .who small { display: block; color: var(--mut); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.sig input { min-height: 52px; }
.sig .pad { width: 120px; height: 60px; border: 2px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #fff; font-weight: 800; color: var(--warn); font-size: 16px; padding: 0; }
.sig .pad img { max-width: 100%; max-height: 100%; } .sig.signed .pad { border-style: solid; border-color: var(--ok); }
.sig .rm { width: 48px; height: 52px; border: 0; background: none; font-size: 26px; color: var(--mut); }
/* bottom bar */
#bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(28,28,28,.97); padding: 10px 12px calc(10px + var(--safe-b));
  display: flex; gap: 10px; } #bottombar .btn { margin: 0; } #bottombar .btn:not(.primary) { background: #2e2e2e; color: #fff; border-color: #555; flex: 0 0 34%; }
/* modal sheets */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
#modal[hidden] { display: none; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 14px calc(16px + var(--safe-b)); }
.sheet h3 { margin: 4px 0 10px; font-size: 21px; }
.warns { list-style: none; padding: 0; margin: 0 0 8px; } .warns li { background: #fff4e5; border-left: 6px solid var(--warn); padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 16px; }
.warns li.ok { background: #e6f4ea; border-color: var(--ok); }
#sigCanvas { width: 100%; height: 46vh; background: #fff; border: 2px solid var(--dark); border-radius: 12px; touch-action: none; display: block; }
.flags { background: #fff4e5; border: 2px solid var(--warn); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.flags ul { margin: 6px 0 0; padding-left: 20px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + var(--safe-b)); background: var(--dark); color: #fff; padding: 12px 18px;
  border-radius: 12px; z-index: 60; max-width: 90vw; font-size: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 16px; } .kv b { color: var(--mut); font-weight: 650; }
.hidden { display: none !important; }
