/* KADGIS field survey — the office app's world at phone scale, tuned for bright sunlight:
   strong contrast, heavier rules, 48px touch targets. Tokens come from /common/theme.css. */
body { font-size: 16px; background: var(--ground); padding-bottom: env(safe-area-inset-bottom); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.pad { padding: 16px; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- header + sync bar */
header.top {
  position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; min-height: 60px; border-bottom: 3px solid var(--amber);
}
header.top img { width: 36px; height: 36px; flex: none; }
header.top h1 { font-size: 18px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top h1 small { display: block; font-size: 12px; font-weight: 500; color: var(--navy-200); letter-spacing: .02em; }
header.top .link {
  background: none; border: 0; color: #fff; min-height: 44px; padding: 0 8px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border-radius: var(--radius);
}
header.top .link:active { background: var(--navy-700); }

.syncbar {
  background: var(--sheet); border-bottom: 1px solid var(--rule); padding: 8px 12px; display: flex; align-items: center;
  gap: 10px; font-size: 14px; position: sticky; top: 60px; z-index: 4;
}
.syncbar .grow { flex: 1; min-width: 0; }
.net { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.net i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.net.off i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.pending { color: var(--warn); font-weight: 700; }

/* ---------------------------------------------------------------- list */
.tools { padding: 12px 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.list { padding: 12px; display: grid; gap: 10px; }
.item {
  background: var(--sheet); border: 1px solid #c4c8dc; border-radius: var(--radius); padding: 14px; display: grid; gap: 4px;
  text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; min-height: 48px;
}
.item:active { background: var(--navy-50); border-color: var(--navy); }
.item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item b { font-size: 17px; color: var(--navy); letter-spacing: .01em; }
.item .addr { font-weight: 600; }
.group { margin: 14px 2px 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 16px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.skel { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, var(--rule-2), var(--navy-50), var(--rule-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* stamps, as in the office app */
.stamp { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid; border-radius: 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.stamp.assigned { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.stamp.rejected, .stamp.error { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.stamp.queued { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.stamp.submitted, .stamp.approved { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }

/* ---------------------------------------------------------------- survey form */
section.block { background: var(--sheet); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 16px; margin: 12px 0; }
section.block h2 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-strong); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
dl.kv dt { color: var(--ink-2); }
dl.kv dd { margin: 0; font-weight: 600; }
.note { background: var(--bad-bg); color: #5a0f0a; border: 1px solid var(--bad-line); padding: 12px; border-radius: var(--radius); margin: 12px 12px 0; }
.note.warn { background: var(--warn-bg); color: #4a3200; border-color: var(--warn-line); }

form.survey { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
label.req > span::after { content: ' *'; color: var(--bad); }
input, select, textarea {
  width: 100%; min-height: 48px; border: 1.5px solid #9fa4c2; border-radius: var(--radius); padding: 10px 12px;
  background-color: #fff; color: var(--ink); font-size: 16px; font-weight: 500;
}
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000068' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 1.5px solid var(--navy); border-radius: var(--radius); background: var(--navy); color: #fff;
  font-weight: 700; font-size: 16px; cursor: pointer; position: relative;
}
.btn:active { transform: translateY(1px); }
.btn.act { background: var(--amber); border-color: var(--amber); color: #1d1300; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn:disabled { opacity: .55; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--busy, #fff); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.ghost.busy, .btn.danger.busy { --busy: var(--navy); }
.btn.act.busy { --busy: #1d1300; }
.error { color: var(--bad); font-size: 15px; font-weight: 600; }
.error:empty { display: none; }

.gps { display: flex; gap: 10px; align-items: center; font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.gps.none { color: var(--ink-2); font-weight: 500; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo { position: relative; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--navy-50); }
.photo img { width: 100%; height: 96px; object-fit: cover; display: block; }
.photo.working { height: 134px; display: grid; place-items: center; color: var(--ink-2); font-size: 13px; text-align: center; }
.photo select { border: 0; border-top: 1px solid var(--rule); border-radius: 0; min-height: 38px; padding: 4px 26px 4px 6px; font-size: 13px; background-position: right 6px center; background-size: 12px; }
.photo .x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 50, .7); color: #fff; border: 0; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; }
.photo .x .ico { width: 16px; height: 16px; }
.filebtn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--navy); color: var(--navy); background: var(--navy-50); border-radius: var(--radius); min-height: 52px; font-weight: 700; cursor: pointer; }
.filebtn input { display: none; }
.footer-actions { position: sticky; bottom: 0; background: var(--sheet); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 8px; border-top: 1px solid var(--rule); box-shadow: 0 -6px 16px -10px rgba(0, 0, 0, .22); }

/* ---------------------------------------------------------------- login */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth .hero { background: var(--navy); color: #fff; padding: max(28px, env(safe-area-inset-top)) 24px 26px; border-bottom: 4px solid var(--amber); }
.auth .hero img { width: 72px; height: 72px; }
.auth .hero h1 { font-size: 24px; font-weight: 800; margin-top: 14px; }
.auth .hero p { color: var(--navy-200); margin-top: 4px; font-size: 14px; }
.auth form { padding: 24px; display: grid; gap: 14px; max-width: 460px; width: 100%; margin: 0 auto; }
.boot { min-height: 100vh; display: grid; place-items: center; }

#toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff;
  padding: 14px 16px; border-radius: var(--radius); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease);
  pointer-events: none; z-index: 10; font-weight: 600; box-shadow: var(--shadow-pop);
}
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--bad); }
a.guide { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- v2: field capture */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.tabs button { min-height: 50px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--amber); }
.tabs .n, .pct { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 10px; font-size: 12px; font-weight: 800; background: var(--navy); color: #fff; }
.pct.ok { background: var(--ok); } .pct.warn { background: var(--amber); color: #1d1300; } .pct.bad { background: var(--bad); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 44px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-weight: 700; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fgrid { display: grid; gap: 14px; }
.field-map { height: 300px; margin-bottom: 10px; }
.corner-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.corners { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.corners li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.corners .n { width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: #1d1300; font-weight: 800; display: grid; place-items: center; font-size: 12px; flex: none; }
.corners .grow, .items .grow, .person .grow, .pick .grow { flex: 1; min-width: 0; }
.corners small, .pick small { display: block; }
.link.sm { background: none; border: 0; color: var(--navy); min-height: 40px; min-width: 40px; display: grid; place-items: center; cursor: pointer; }
.link.sm:disabled { opacity: .3; }
.warn-text { color: var(--warn); font-weight: 700; font-size: 12px; }
.person { display: flex; gap: 12px; align-items: center; }
.person .av { width: 44px; height: 44px; border-radius: 50%; background: var(--navy-50); display: grid; place-items: center; color: var(--navy); flex: none; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; }
.items { list-style: none; padding: 0; margin: 0 0 10px; }
.items li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.items .muted { display: block; }
.missing { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 2px; }
.missing li.must { color: var(--bad); }
.ok-line { color: var(--ok); font-weight: 700; }
label.check { display: flex; align-items: center; gap: 10px; margin-top: 10px; grid-template-columns: none; }
label.check input { width: 22px; min-height: 22px; height: 22px; }
.sub-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 8px; }
.photo .sent { height: 96px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ok); font-weight: 700; font-size: 13px; }
.sheet-overlay { position: fixed; inset: 0; background: rgba(0, 0, 40, .45); z-index: 20; display: flex; align-items: flex-end; }
.sheet { background: var(--sheet); width: 100%; max-height: 92vh; overflow: auto; border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.sheet header { position: sticky; top: 0; background: var(--sheet); display: flex; align-items: center; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--rule); z-index: 1; }
.sheet header h2 { flex: 1; font-size: 17px; font-weight: 800; }
.sheet header .link { background: none; border: 0; min-height: 44px; min-width: 44px; color: var(--navy); }
.sheet-body { padding: 16px; display: grid; gap: 10px; }
.pick-list { border: 1px solid var(--rule); border-radius: var(--radius); max-height: 40vh; overflow: auto; margin-top: 8px; }
.pick { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--rule-2); font: inherit; text-align: left; min-height: 48px; color: inherit; }
.pick.on { background: var(--navy-50); box-shadow: inset 4px 0 0 var(--navy); }
.spin { width: 16px; height: 16px; border: 2.5px solid var(--navy-200); border-top-color: var(--navy); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.photo .rejected { position: absolute; left: 0; right: 0; top: 0; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 6px; }

/* tags on a property (todov3 04) */
.tagbox { display: flex; flex-wrap: wrap; gap: 8px; }
.tagchip, .tagtoggle {
  --tc: #000068; --tb: #e1e3f6;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 3px;
  background: var(--tb); color: var(--tc); border: 1.5px solid color-mix(in srgb, var(--tc) 35%, transparent); font-weight: 700; font-size: 15px;
}
.tagtoggle { cursor: pointer; background: #fff; min-height: 44px; }
.tagtoggle[aria-pressed='true'] { background: var(--tb); border-color: var(--tc); }
.tagtoggle svg { width: 16px; height: 16px; }
.c-navy { --tc: #000068; --tb: #e1e3f6; } .c-blue { --tc: #1d4f99; --tb: #e3eefb; } .c-teal { --tc: #0b6157; --tb: #dff3f1; }
.c-green { --tc: #17663f; --tb: #e6f4ea; } .c-olive { --tc: #4f5b13; --tb: #eef2dc; } .c-amber { --tc: #8f5300; --tb: #fff1d6; }
.c-orange { --tc: #9a3d0a; --tb: #fde7d9; } .c-red { --tc: #a3221a; --tb: #fbe7e5; } .c-rose { --tc: #8e1d4b; --tb: #fbe6ef; }
.c-purple { --tc: #5b2a96; --tb: #efe7fa; } .c-slate { --tc: #3b4058; --tb: #eceef3; } .c-brown { --tc: #6b4425; --tb: #f1e8df; }

/* the agent's areas (todov3 11) */
.area-row { margin-top: 4px; color: var(--ink-2); }
.areas-head { color: var(--ink-2); }
