/* NPC Field App. GIGW: 16px+ text, contrast >= 4.5:1, visible focus,
   44px touch targets, safe-area padding for phones with notches. */
:root{--ink:#1a1a1a;--muted:#555f6a;--line:#d6dde4;--bg:#f6f8fa;--panel:#fff;--navy:#0b3a66;
  --ok:#0a6b2d;--ok-bg:#e8f5ec;--bad:#a11020;--bad-bg:#fdeced;--warn:#8a5a00;--warn-bg:#fdf4e3}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font:17px/1.5 system-ui,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg);accent-color:var(--navy);
  padding-bottom:calc(4.2rem + env(safe-area-inset-bottom))}
.bar{background:var(--navy);color:#fff;padding:calc(.7rem + env(safe-area-inset-top)) 1rem .7rem;display:flex;
  justify-content:space-between;align-items:center;position:sticky;top:0;z-index:5}
.net{font-size:.85rem;padding:.15rem .6rem;border-radius:999px;background:#ffffff22}
main{max-width:40rem;margin:0 auto;padding:1rem}
main:focus{outline:none}   /* main takes focus by script for screen readers; no orange frame round the page (UX-27) */
h1{font-size:1.35rem;margin:.2rem 0 .8rem}
h2{font-size:1.1rem;margin:1.2rem 0 .5rem;color:var(--navy)}
p{margin:0 0 .8rem}
.muted{color:var(--muted)} .small{font-size:.9rem}
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:1rem;margin:0 0 .8rem}
label{display:block;font-weight:600;margin:0 0 .3rem}
input[type=text],input[type=password],input[type=number],input[type=date],input[type=time],input[type=datetime-local],
input[type=tel],select,textarea{width:100%;min-height:44px;padding:.6rem .7rem;font:inherit;border:1px solid #76838f;
  border-radius:8px;background:#fff;color:var(--ink)}
.btn{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:44px;padding:.6rem 1.1rem;font:inherit;
  font-weight:600;border:1px solid var(--navy);border-radius:8px;background:var(--navy);color:#fff;cursor:pointer;text-decoration:none}
.btn.ghost{background:#fff;color:var(--navy)} .btn.wide{width:100%} .btn:disabled{opacity:.55}
.btn.link{background:none;border-color:transparent;color:var(--navy);text-decoration:underline;font-weight:600}
.row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.choice{display:flex;gap:.7rem;align-items:center;min-height:44px;padding:.3rem .2rem;font-weight:400}
.choice input{width:1.3rem;height:1.3rem;flex:none}
.q{padding:.9rem 0;border-bottom:1px solid var(--line)} .q:last-child{border-bottom:0}
.q legend,.q .qlabel{font-weight:600;padding:0;margin:0 0 .4rem}
.q.err .qlabel,.q.err legend{color:var(--bad)} .q .why{color:var(--bad);font-size:.9rem;margin-top:.3rem}
.q.flag{background:var(--warn-bg);border-radius:8px;padding:.9rem .6rem}
fieldset{border:0;padding:0;margin:0;min-width:0}   /* let a wide grid scroll instead of overflowing */
.req{color:var(--bad)}
.note{padding:.8rem 1rem;border-radius:10px;margin:0 0 .9rem;border:1px solid}
.note.ok{background:var(--ok-bg);color:var(--ok);border-color:#b7dcc4}
.note.bad{background:var(--bad-bg);color:var(--bad);border-color:#f0bcc2}
.note.warn{background:var(--warn-bg);color:var(--warn);border-color:#e8d3a3}
.tag{display:inline-block;font-size:.8rem;font-weight:700;padding:.1rem .5rem;border-radius:999px;border:1px solid var(--line);background:#eef3f8;color:var(--navy)}
.tag.ok{background:var(--ok-bg);color:var(--ok);border-color:#b7dcc4} .tag.bad{background:var(--bad-bg);color:var(--bad);border-color:#f0bcc2}
.tag.wait{background:var(--warn-bg);color:var(--warn);border-color:#e8d3a3}
.grid{overflow-x:auto} .grid table{border-collapse:collapse} .grid th,.grid td{border:1px solid var(--line);padding:.2rem}
.grid input{width:4rem;min-width:0;padding:.45rem .3rem} .grid input[type=text],.grid input[type=date]{width:7rem} .grid select{width:auto;max-width:9.5rem;padding:.45rem .3rem}
.grid tbody th{position:sticky;left:0;z-index:1;background:#fff;min-width:7.5rem;max-width:9rem;overflow-wrap:normal;word-break:normal;hyphens:auto}   /* row label stays in view when a wide grid scrolls */
.grid input[type=number]{-moz-appearance:textfield} .grid input::-webkit-inner-spin-button,.grid input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.grid td.tot,.grid tr.tot td{font-weight:700;background:var(--bg);text-align:right}
.sum-msg{color:var(--bad);background:var(--bad-bg);border:1px solid #f0bcc2;border-radius:8px;padding:.5rem .7rem;margin-top:.4rem;font-weight:600}
.section{padding:1rem 0 .2rem;border-bottom:2px solid var(--navy)} .section h2{margin:.2rem 0 .3rem}
.photo-pick{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin:0 0 .4rem}
.photo{display:flex;gap:.5rem;flex-wrap:wrap} .photo figure{margin:0;width:7rem}
.photo img{width:7rem;height:7rem;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.pin{display:flex;gap:.5rem;justify-content:center;margin:1rem 0} .pin input{width:100%;font-size:1.6rem;text-align:center;letter-spacing:.5rem}
.tabs{position:fixed;left:0;right:0;bottom:0;display:flex;background:#fff;border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);z-index:5}
.tabs button{flex:1;min-height:56px;font:inherit;font-weight:600;line-height:1.2;padding:.3rem .2rem;background:none;border:0;color:var(--navy);cursor:pointer}
.tabs button[aria-current=page]{border-top:3px solid var(--navy)}
a,button,input,select,textarea,summary{outline-offset:2px}
:focus-visible{outline:3px solid #b45309}
[hidden]{display:none!important}
.bar-end{display:flex;gap:.5rem;align-items:center}
.install{min-height:36px;padding:.3rem .8rem;font:inherit;font-size:.9rem;font-weight:600;border:2px solid #fff;border-radius:999px;
  background:transparent;color:#fff;cursor:pointer}
.install:hover{background:#ffffff22}
.ways{list-style:none;padding:0;margin:0} .ways li{margin:0 0 .6rem}
.facts{width:100%;border-collapse:collapse;font-size:.95rem} .facts th,.facts td{text-align:left;padding:.4rem .3rem;border-bottom:1px solid var(--line);vertical-align:top}
.mono{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;overflow-wrap:anywhere}
ol.steps{padding-left:1.3rem} ol.steps li{margin:0 0 .4rem}
/* A trial phone (D-066): never mistaken for real fieldwork. */
.trialbar{background:#ffd84d;color:#1a1a1a;font-weight:700;padding:.5rem 1rem;border-bottom:2px solid #b38600}
.trialbar[hidden]{display:none}
/* A new version waits for the open form to close (D-071). */
.updatebar{background:#e8f0fb;color:#0b3a66;padding:.4rem 1rem;border-bottom:1px solid #b9cde6;display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.updatebar .btn{padding:.3rem .7rem}
.updatebar[hidden]{display:none}
.q.locked{background:var(--bg,#f6f7f9)} .q.locked input,.q.locked textarea{color:inherit}
/* D-109: a figure beyond its usual limits - amber, not red; the remark box under it */
.warnbox{background:var(--warn-bg);border:1px solid #e8d3a3;border-left:4px solid var(--warn);border-radius:8px;padding:.5rem .7rem;margin-top:.5rem;color:var(--warn)}
.warnbox label{color:var(--ink);margin-top:.3rem} .warnbox.err{border-left-color:var(--bad)}
/* D-110: "Who is working?" - one big button per person on this device. */
.people{list-style:none;padding:0;margin:0 0 1rem}
.people li{margin:0 0 .6rem}
.person{display:flex;justify-content:space-between;align-items:center;gap:.6rem;width:100%;min-height:56px;padding:.7rem 1rem;
  font:inherit;text-align:left;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;cursor:pointer}
.person:hover{border-color:var(--navy)}
/* D-110: the same app on a desktop - a wider, centred page; forms and grids are not cramped.
   The phone layout below 900px is unchanged. */
@media (min-width:900px){
  body{font-size:16px}
  main{max-width:62rem;padding:1.5rem 2rem}
  .bar{padding-left:2rem;padding-right:2rem}
  .tabs{left:50%;right:auto;transform:translateX(-50%);width:62rem;max-width:100%;border:1px solid var(--line);border-bottom:0;border-radius:12px 12px 0 0}
  .q{padding:1rem .2rem}
  .q input[type=text],.q input[type=number],.q input[type=date],.q input[type=tel],.q select{max-width:32rem}
  .q textarea{max-width:48rem}
  .grid input{width:5.5rem} .grid input[type=text],.grid input[type=date]{width:9rem} .grid select{max-width:14rem}
  .grid tbody th{max-width:16rem}
  .btn.wide{width:auto;min-width:16rem}
  #f > .row .btn{min-width:14rem}
}
/* D-122: the scan of the paper form. Beside the questions on a wide screen only;
   a phone shows just the "Attach scan" bar. */
.scanbar{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem}
.scanpane{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.8rem}
.scanpane h2{margin-top:0}
.scanhead{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .6rem;margin-bottom:.5rem}
.scanhead h2{margin:0;font-size:1.05rem}
.scanhead .scantabs,.scanhead .scantools{display:flex;flex-wrap:wrap;gap:.3rem;margin:0}
.scanhead [data-pane-big]{margin-left:auto;padding:.35rem .7rem;font-size:.92rem;min-height:auto}
.scanhint{margin:0 0 .4rem}
.scanpane:fullscreen{display:flex;flex-direction:column;height:100vh;max-height:none;border-radius:0;padding:.8rem;box-sizing:border-box}
.scanpane:fullscreen .scanstage{flex:1 1 auto;height:auto}
.scantabs,.scantools{margin:.4rem 0}
.scantabs .btn,.scantools .btn{padding:.35rem .7rem;font-size:.92rem;min-height:auto}
.scantabs .btn[aria-selected=true],.scantools .btn[aria-pressed=true]{background:var(--navy);color:#fff}
.scanstage{border:1px solid var(--line);border-radius:8px;background:#e9edf1;overflow:auto;height:calc(100vh - 12rem);min-height:22rem}
.scanstage iframe{width:100%;height:100%;border:0;background:#fff;display:block}
.scanstage img{display:block;margin:0 auto;max-width:none}
.scan-none{border:2px dashed var(--line);border-radius:8px;padding:2rem 1rem;text-align:center}
@media (min-width:62rem){
  main.wide{max-width:118rem;padding-bottom:0}
  /* UAT 19-11-2026: a long grid's side scrollbar sat at its far bottom, out of sight. On a computer a grid is its own
     window (both scrollbars in view), its column heads and row labels stay put while it scrolls. */
  .grid{max-height:calc(100vh - 8rem);overflow:auto;border:1px solid var(--line);border-radius:6px}
  .grid thead th{position:sticky;top:0;z-index:2;background:#fff}
  .grid thead th:first-child{left:0;z-index:3}
  .grid tbody th{max-width:11rem;min-width:7rem}
  body:has(main.wide){padding-bottom:0}   /* the form screen has no bottom menu: the scan window may reach the bottom */
  .keying{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:1.2rem;align-items:start}   /* the scan gets the wider side */
  /* UAT 20-11-2026 (D-126): a movable divider; the form starts at 40% and can be dragged from 20% to 80%. */
  .keying[data-split]{grid-template-columns:minmax(0,var(--split-left,40%)) 1rem minmax(0,1fr);column-gap:.35rem}
  /* UAT 19-11-2026: the scan window stays in view to the end of the form; the form scrolls with the page,
     the scan scrolls inside its own window (as on the portal check page). The sticky box is the grid item. */
  .keying>#paneSlot{position:sticky;top:4.4rem;align-self:start}
  .keying .scanpane{display:flex;flex-direction:column;height:calc(100vh - 4.4rem - 1rem);min-height:20rem;box-sizing:border-box}
  .keying .scanstage{flex:1 1 auto;height:auto;min-height:12rem}
}
/* Q1 (D-125): Hindi beside the app's own English words - a smaller second line on buttons and tabs,
   a thin addition after headings, labels and status tags. Turned off in More ("Show Hindi labels"). */
.hi{display:block;font-size:.8em;font-weight:500;line-height:1.25}
.hi-in{display:inline;margin-left:.4em;font-size:.82em;font-weight:500}
.hi-in::before{content:"\00B7\00A0"}
h1 .hi-in,h2 .hi-in,label .hi-in{color:var(--muted);font-weight:500}
.tag .hi-in{font-weight:600}
.tabs button .hi{font-size:.76em}
.net{text-align:center;line-height:1.25} .net .hi{font-size:.85em;font-weight:400;line-height:1.35;margin-top:.1rem}
.bar strong,.install{white-space:nowrap} .bar{gap:.5rem}
/* UX-28 (D-125): "Install app" only on sign-in, the task list and More. */
body:not(.install-ok) #install{display:none!important}
/* UX-32 (D-125): where am I in a long form - stays just under the header; pressing it goes to the first
   required question still unanswered. Inside the form column, so the scan window beside it is untouched. */
.formprog{position:sticky;top:var(--barH,3.1rem);z-index:4;display:block;width:100%;min-height:40px;margin:0 0 .6rem;
  padding:.4rem .8rem;font:inherit;font-size:.9rem;font-weight:600;text-align:left;color:var(--navy);background:#e8f0fb;
  border:1px solid #b9cde6;border-radius:8px;cursor:pointer}
.formprog[data-left="0"]{background:var(--ok-bg);color:var(--ok);border-color:#b7dcc4}
/* UX-19 (D-125): a form's parts, folded inside its card in Sent and waiting. */
.parts{margin-top:.5rem}
.parts summary{cursor:pointer;color:var(--navy);font-weight:600;padding:.3rem 0}
.parts ul{margin:.3rem 0 0;padding-left:1.1rem} .parts li{margin:0 0 .3rem}
/* The movable divider (D-126), shared look with the portal check page. Shown on a computer only. */
.splitter{display:none}
@media (min-width:62rem){
  .splitter{display:block;align-self:stretch;position:relative;cursor:col-resize;touch-action:none;border-radius:6px}
  .splitter::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:2px;transform:translateX(-50%);background:var(--line)}
  .splitter:hover::before,.splitter:focus-visible::before{width:4px;background:var(--navy)}
  .splitter span{position:sticky;top:45vh;display:flex;align-items:center;justify-content:center;width:1.6rem;height:3rem;margin-left:-.3rem;
    border:1px solid #76838f;border-radius:7px;background:#fff;color:var(--navy);font-size:1rem;box-shadow:0 1px 3px #0002}
  .splitter:hover span,.splitter:focus-visible span{background:var(--navy);color:#fff}
  .splitting,.splitting *{cursor:col-resize!important;user-select:none!important}
  .splitting iframe{pointer-events:none}
}
