/* ===========================================================================
   UB Satish — Land Portal  |  Styles
   Property of Zera Technologies (https://zeratech.io/)
   ---------------------------------------------------------------------------
   Two voices on purpose.

   Fraunces, a high-contrast serif, carries the land: mauza names, the acreage,
   the titles. It is the voice of a deed.

   Inter carries the instrument: every number, label and control, with tabular
   figures so khesras and rakwas line up in a column the way they do on a
   register. It is the voice of the machine reading the deed.

   Light by default and unapologetically: this is read one-handed, outdoors, in
   Bihar daylight. Dark mode follows the phone for the evening.
   =========================================================================== */

:root {
  /* paper and ink */
  --paper:     #f7f5f0;
  --surface:   #ffffff;
  --surface-2: #fbfaf6;
  --ink:       #14211a;
  --ink-2:     #4a5852;
  --ink-3:     #8a968f;
  --line:      #e6e2d8;
  --line-2:    #f1ede5;

  /* the estate green */
  --forest:    #1e4632;
  --forest-2:  #2c6145;
  --forest-l:  #eaf0ea;
  --forest-ink:#163527;

  /* brass, for the one thing on screen that should catch the eye */
  --brass:     #9c7327;
  --brass-l:   #fbf3e2;

  --red:       #94281f;
  --red-l:     #fbedeb;

  --use-batai:   #2c6145;
  --use-self:    #6b8f3a;
  --use-vacant:  #a8ada4;
  --use-nursery: #0f7268;

  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r:    16px;
  --r-s:  11px;
  --tap:  48px;
  --gut:  16px;

  --shadow:   0 1px 1px rgba(20,33,26,.04), 0 6px 20px -8px rgba(20,33,26,.10);
  --shadow-2: 0 24px 70px -20px rgba(20,33,26,.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #0e1310;
    --surface:   #161c18;
    --surface-2: #1c2420;
    --ink:       #e9ede8;
    --ink-2:     #aab5ad;
    --ink-3:     #7c887f;
    --line:      #29322c;
    --line-2:    #202824;
    --forest:    #7ab48c;
    --forest-2:  #93c8a3;
    --forest-l:  #1a2a20;
    --forest-ink:#b9dcc4;
    --brass:     #d9ab5c;
    --brass-l:   #2a2317;
    --red:       #e8918a;
    --red-l:     #2b1a18;
    --shadow:   0 1px 1px rgba(0,0,0,.4), 0 6px 20px -8px rgba(0,0,0,.6);
    --shadow-2: 0 24px 70px -20px rgba(0,0,0,.8);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  font-feature-settings: "cv05" 1, "ss03" 1;
  color: var(--ink);
  background: var(--paper);
  overscroll-behavior-y: none;
}

a { color: var(--forest-2); text-underline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }

.num, .fig, .lbl-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.serif {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 40;
  letter-spacing: -.012em;
}

/* a label: the small capitals that make a document feel like a record */
.lbl {
  display: block;
  font-size: 9.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ══ LOGIN ═══════════════════════════════════════════════════════════ */

#login {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -8%, var(--forest-l), transparent 72%),
    var(--paper);
}
#login[hidden] { display: none; }

.login-card {
  width: 100%; max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 40px 28px 26px; text-align: center;
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 58px; height: 58px; margin: 0 auto 20px;
  display: grid; place-items: center; border-radius: 17px;
  background: var(--forest); color: #fff;
}
.brand-mark svg { width: 27px; height: 27px; }
.login-card h1 {
  margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 40; letter-spacing: -.02em;
}
.login-card .sub {
  margin: 6px 0 26px; color: var(--ink-3);
  font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
}
.gsi-slot { display: grid; place-items: center; min-height: 44px; }
.login-err {
  margin-top: 16px; padding: 11px 13px; border-radius: var(--r-s);
  background: var(--red-l); color: var(--red); font-size: 13px; text-align: left;
}
.login-note {
  margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; line-height: 1.6; color: var(--ink-3);
}
.login-note.quiet { border: 0; padding-top: 8px; margin-top: 6px; }

/* ══ LOADING ═════════════════════════════════════════════════════════ */

#loading {
  position: fixed; inset: 0; display: grid; place-items: center;
  align-content: center; gap: 16px; background: var(--paper);
}
#loading[hidden] { display: none; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--forest);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-note { color: var(--ink-3); font-size: 12.5px; letter-spacing: .02em; }

/* ══ SHELL ═══════════════════════════════════════════════════════════ */

#app { display: none; min-height: 100dvh; flex-direction: column; }
#app.ready { display: flex; }

.wrap { width: 100%; max-width: 660px; margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: max(10px, env(safe-area-inset-top)) var(--gut) 11px;
}
.tb-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.tb-brand { display: flex; align-items: center; gap: 9px; }
.tb-logo {
  width: 26px; height: 26px; padding: 5px; border-radius: 8px;
  background: var(--forest); color: #fff;
}
.tb-name {
  font-family: var(--serif); font-weight: 500; font-size: 17px;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 24; letter-spacing: -.01em;
}
.tb-row .icon-btn { margin-left: auto; }

.icon-btn {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink-2);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:active { background: var(--surface-2); }

.search-row { display: flex; gap: 9px; margin-top: 11px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-3); pointer-events: none;
}
#q {
  width: 100%; height: var(--tap); padding: 0 42px 0 39px;
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, background .15s;
}
#q::placeholder { color: var(--ink-3); }
#q:focus { outline: none; border-color: var(--forest); background: var(--surface); }
#q::-webkit-search-cancel-button { display: none; }
.clear-btn {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: none; color: var(--ink-3); border-radius: 8px;
}
.clear-btn svg { width: 14px; height: 14px; }

.filter-btn {
  position: relative; flex: none; width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2); color: var(--ink-2);
}
.filter-btn svg { width: 18px; height: 18px; }
.filter-btn.on { border-color: var(--forest); color: var(--forest); background: var(--forest-l); }
.filter-count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--forest);
  font-variant-numeric: tabular-nums;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px 5px 11px;
  font-size: 12.5px; font-weight: 500; letter-spacing: -.005em;
  color: var(--forest-ink); background: var(--forest-l); border-radius: 999px;
}
.chip button {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: 0; background: none; color: inherit; opacity: .6; padding: 0;
}
.chip button svg { width: 10px; height: 10px; }
.chip-clear {
  padding: 5px 12px; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  background: none; border: 1px solid var(--line); border-radius: 999px;
}

/* ══ MAIN ════════════════════════════════════════════════════════════ */

#view { flex: 1; padding: 14px var(--gut) 32px; }

/* the portfolio band — the one place the acreage gets to be the headline */
.portfolio {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
  padding: 16px 18px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.pf-fig { display: flex; align-items: baseline; gap: 7px; }
.pf-acres {
  font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: .95;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  letter-spacing: -.028em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.pf-unit { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pf-meta { margin-top: 7px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pf-meta .sep { color: var(--ink-3); margin: 0 6px; }
.pf-split { display: none; }

.pf-split-row {
  display: flex; align-items: baseline; gap: 14px; width: 100%;
  padding: 4px 0; font-size: 12px; line-height: 1.5;
  border: 0; background: none; text-align: left;
}
.pf-split-row:not(.more):hover .pf-split-name { color: var(--forest); }
.pf-split-name { color: var(--ink-2); }
.pf-split-val {
  margin-left: auto; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pf-split-unit { margin-left: 3px; font-size: 10px; font-weight: 500; color: var(--ink-3); }
.pf-split-row.more { color: var(--ink-3); font-size: 11px; padding-top: 5px; }

.pf-of {
  text-align: right; font-size: 11px; line-height: 1.5; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

#alert-strip { margin-bottom: 12px; }
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; border-radius: var(--r-s);
  font-size: 13px; line-height: 1.5; border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert.red   { background: var(--red-l);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 20%, transparent); }
.alert.amber { background: var(--brass-l); color: var(--brass); border-color: color-mix(in srgb, var(--brass) 20%, transparent); }
.alert b { font-weight: 650; }

.notice {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 0 6px 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink-2); font-size: 13px; text-align: left;
}
.notice > svg { width: 16px; height: 16px; flex: none; color: var(--brass); }
.notice b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.notice span:first-of-type { flex: 1; }
.notice-x { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--ink-3); }
.notice-x svg { width: 11px; height: 11px; }
.notice:active { background: var(--surface-2); }

/* ══ SORT BAR ════════════════════════════════════════════════════════
   Tap a key to sort by it; tap the one already chosen to reverse it. The
   arrow is on the active key only, so the control says both what is in force
   and what tapping again will do.                                          */

.sortbar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sortbar[hidden] { display: none; }
.sortbar::-webkit-scrollbar { display: none; }
.sortbar-lbl {
  flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-right: 2px;
}
.sort-opt {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.sort-opt svg { width: 12px; height: 12px; }
.sort-opt.on {
  background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 600;
}

/* ══ GROUPS ══════════════════════════════════════════════════════════ */

.grp { margin-bottom: 22px; }
.grp:last-of-type { margin-bottom: 0; }
.grp-head {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  padding: 0 2px 9px; margin-bottom: 11px;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.grp-name {
  font-family: var(--serif); font-weight: 500; font-size: 17px;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 30; letter-spacing: -.014em;
  color: var(--ink);
}
.grp-meta {
  margin-left: auto; font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.grp-head:active .grp-name { color: var(--forest); }

/* ══ CARDS ═══════════════════════════════════════════════════════════ */

.cards { display: grid; gap: 11px; }

.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
/* a hairline of land use down the left edge — colour without a coloured box */
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, transparent);
}
.card-body {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 15px 16px 14px 18px;
}
.card-body:active { background: var(--surface-2); }

.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-place { flex: 1; min-width: 0; }
.card-mauza {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.15;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 36; letter-spacing: -.016em;
}
.card-sub { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .01em; }
.card-khesra { text-align: right; flex: none; }
.card-khesra .num {
  display: block; margin-top: 1px; font-size: 21px; font-weight: 650;
  letter-spacing: -.02em; line-height: 1.1;
}

.card-figures {
  display: flex; gap: 22px; margin-top: 13px;
  padding-top: 12px; border-top: 1px solid var(--line-2);
}
.card-figures .fig {
  display: block; margin-top: 2px; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.card-figures .fig .unit { margin-left: 3px; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.card-figures .fig.sm { font-size: 13px; font-weight: 550; }
.card-figures .aside { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.card-owner {
  margin-top: 12px; font-size: 13px; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px;
}
.card-owner svg { width: 13px; height: 13px; color: var(--ink-3); flex: none; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2);
}
.tag .swatch { width: 6px; height: 6px; border-radius: 50%; }
.tag.warn { background: var(--brass-l); color: var(--brass); border-color: transparent; }
.tag.bad  { background: var(--red-l);   color: var(--red);   border-color: transparent; }

.card-acts { display: flex; border-top: 1px solid var(--line-2); }
.act {
  flex: 1; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-left: 1px solid var(--line-2); background: none;
  font-size: 13px; font-weight: 600; color: var(--forest-2); text-decoration: none;
  letter-spacing: -.005em;
}
.act:first-child { border-left: 0; }
.act svg { width: 15px; height: 15px; }
.act:active { background: var(--forest-l); }

.empty { padding: 56px 24px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty svg { width: 30px; height: 30px; opacity: .35; margin-bottom: 12px; }

.more-btn {
  width: 100%; min-height: 48px; margin-top: 11px;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
}

.credit {
  padding: 28px var(--gut) calc(26px + env(safe-area-inset-bottom));
  text-align: center; font-size: 10.5px; line-height: 1.8; color: var(--ink-3);
  letter-spacing: .01em; border-top: 1px solid var(--line-2);
}
.credit a { color: var(--ink-2); }

/* ══ SHEET ═══════════════════════════════════════════════════════════ */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(12,20,15,.5); backdrop-filter: blur(3px); }
.scrim[hidden] { display: none; }

.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 93dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-2);
  animation: rise .26s cubic-bezier(.22,.85,.3,1);
}
.sheet[hidden] { display: none; }
@keyframes rise { from { transform: translateY(26px); opacity: .5; } }

.sheet-grab { width: 34px; height: 4px; margin: 9px auto 0; border-radius: 2px; background: var(--line); }
.sheet-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px var(--gut) 14px; border-bottom: 1px solid var(--line-2);
}
.sheet-heads { flex: 1; min-width: 0; }
.sheet-title {
  font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.2;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 40; letter-spacing: -.018em;
}
.sheet-sub { margin-top: 3px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sheet-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px var(--gut) calc(26px + env(safe-area-inset-bottom));
}

.sec { margin-top: 24px; }
.sec:first-child { margin-top: 0; }
.sec-h {
  font-size: 9.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 11px;
}

.kv { display: grid; grid-template-columns: minmax(98px, 36%) 1fr; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.kv > div:nth-child(odd) { color: var(--ink-3); padding-right: 12px; }
.kv > div:nth-child(even) { color: var(--ink); font-weight: 550; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none; letter-spacing: -.005em;
}
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn:active { opacity: .86; }
.btn-row { display: flex; gap: 9px; margin-top: 11px; }
.btn-row .btn { flex: 1; }

.chauhaddi {
  display: grid; grid-template-areas: ". n ." "w c e" ". s ."; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.ch-n { grid-area: n; } .ch-s { grid-area: s; } .ch-e { grid-area: e; } .ch-w { grid-area: w; }
.ch-c {
  grid-area: c; display: grid; place-items: center; place-content: center;
  border: 1px dashed var(--line); border-radius: var(--r-s);
  color: var(--ink-3); font-size: 10.5px; text-align: center; padding: 8px 4px; line-height: 1.5;
}
.ch-box {
  padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface-2); min-height: 66px;
}
.ch-dir { font-size: 9.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.ch-name { margin-top: 3px; font-size: 13px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.ch-none { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.ch-call {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--forest-2); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.ch-call svg { width: 12px; height: 12px; }

.doc-list { display: grid; gap: 9px; }
.doc {
  display: flex; align-items: center; gap: 11px; min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface-2); color: var(--ink);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.doc svg { width: 16px; height: 16px; color: var(--forest-2); flex: none; }
.doc .arrow { margin-left: auto; color: var(--ink-3); }

.note {
  padding: 12px 14px; border-radius: var(--r-s);
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 13px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap;
}
.muted { color: var(--ink-3); font-size: 13px; }

/* ══ FILTERS ═════════════════════════════════════════════════════════ */

.f-group { margin-bottom: 20px; }
.f-label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; }
.f-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.f-opt {
  padding: 9px 13px; min-height: 40px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.f-opt.on { background: var(--forest-l); border-color: var(--forest); color: var(--forest-ink); font-weight: 600; }

.f-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.f-in {
  width: 100%; height: 46px; padding: 0 13px;
  font-family: var(--sans); font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  -webkit-appearance: none; appearance: none;
}
.f-in::placeholder { color: var(--ink-3); }
.f-in:focus { outline: none; border-color: var(--forest); background: var(--surface); }
.f-range { display: flex; align-items: center; gap: 9px; }
.f-range span { color: var(--ink-3); font-size: 13px; }

/* the jamabandi picker — a register you can scroll */
.f-list {
  max-height: 232px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.f-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 46px; padding: 8px 13px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line-2); background: none;
  font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.f-row:last-child { border-bottom: 0; }
.f-row .f-row-meta { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.f-row.on { background: var(--forest-l); color: var(--forest-ink); font-weight: 650; }
.f-row:active { background: var(--line-2); }
.f-none { padding: 16px 13px; font-size: 13px; color: var(--ink-3); }

/* ══ VISIT ═══════════════════════════════════════════════════════════ */

.visit-shot {
  display: block; width: 100%; max-height: 300px; object-fit: cover;
  border-radius: var(--r-s); background: var(--surface-2);
}

.check {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface-2); font-size: 13.5px; line-height: 1.45; cursor: pointer;
}
.check input {
  width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--forest);
}

/* ══ TOASTS ══════════════════════════════════════════════════════════ */

#toasts {
  position: fixed; z-index: 70; left: var(--gut); right: var(--gut);
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 15px; border-radius: 13px;
  background: var(--ink); color: var(--paper);
  font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-2);
  animation: rise .2s ease;
}
.toast.bad { background: var(--red); color: #fff; }

/* ══ WIDER SCREENS ═══════════════════════════════════════════════════
   The portal is built for a phone, but this portfolio gets shown across a
   desk too — to a lawyer, a buyer, a brother. At tablet width and up it
   opens into two columns rather than staying a thin ribbon of cards.     */

@media (min-width: 760px) {
  :root { --gut: 24px; }
  .topbar > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
  #view { max-width: 1128px; margin: 0 auto; padding-top: 20px; }
  .portfolio { padding: 22px 26px; }
  .pf-acres { font-size: 52px; }
  .pf-split { display: block; min-width: 208px; border-left: 1px solid var(--line-2); padding-left: 22px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .grp-name { font-size: 19px; }
  .sortbar { margin-bottom: 16px; }
  .card:hover { border-color: color-mix(in srgb, var(--forest) 34%, var(--line)); }
  .act:hover { background: var(--forest-l); }
  .sheet {
    left: 50%; transform: translateX(-50%); width: 660px;
    max-height: 86dvh; bottom: 7dvh; border-radius: 22px;
  }
  @keyframes rise { from { transform: translateX(-50%) translateY(26px); opacity: .5; } }
}

@media (min-width: 1180px) {
  .cards { grid-template-columns: 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══ PHOTO INBOX ═════════════════════════════════════════════════════ */

.notice.act { border-color: color-mix(in srgb, var(--forest) 24%, transparent); background: var(--forest-l, var(--surface)); }
.notice-go { margin-left: auto; color: var(--ink-3); display: grid; place-items: center; }
.notice-go svg { width: 13px; height: 13px; }

.ph-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: inherit; font: inherit; cursor: pointer;
}
.ph-row:active { background: var(--surface-2); }
.ph-thumb {
  width: 52px; height: 52px; flex: none; border-radius: 9px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.ph-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ph-txt b { font-size: 13.5px; font-weight: 600; }
.ph-txt .muted { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ph-tag {
  flex: none; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.ph-tag.good { background: var(--brass-l); color: var(--brass); }

.ph-open { display: block; text-decoration: none; color: inherit; }
.ph-open .muted { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 12px; }
.ph-open .muted svg { width: 12px; height: 12px; }

.pick-list { display: grid; gap: 7px; margin-top: 11px; }
.pick {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer;
}
.pick.on { border-color: var(--forest); background: var(--brass-l); }
.pick input { width: 19px; height: 19px; flex: none; accent-color: var(--forest); }
.pick-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pick-t b { font-size: 13.5px; font-weight: 600; }
.pick-t .muted { font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ══ SHARE ═══════════════════════════════════════════════════════════ */

.share-text {
  margin: 11px 0 0; padding: 13px 14px; white-space: pre-wrap; word-break: break-word;
  font: 400 12.5px/1.65 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink-2, var(--ink)); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 12px;
}

.sh-strip {
  display: flex; gap: 9px; margin-top: 11px; overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sh-strip::-webkit-scrollbar { display: none; }

.sh-pic {
  position: relative; flex: none; width: 92px; padding: 0; overflow: hidden;
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2);
  cursor: pointer; font: inherit; color: inherit;
}
.sh-pic img { display: block; width: 100%; height: 92px; object-fit: cover; }
.sh-pic.on { border-color: var(--forest); }
.sh-pic.bad { border-color: var(--red); opacity: .6; }
.sh-pic:not(.on) img { filter: grayscale(.65); opacity: .72; }
.sh-cap {
  display: block; padding: 5px 6px; font-size: 10.5px; font-weight: 600;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-pic.on .sh-cap { color: var(--forest); }
.sh-tick {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--forest); color: #fff;
}
.sh-tick svg { width: 11px; height: 11px; }
.sh-spin {
  position: absolute; top: 36px; left: 50%; margin-left: -11px;
  width: 22px; height: 22px; border-radius: 999px;
  border: 2.5px solid rgba(255,255,255,.55); border-top-color: #fff;
  animation: spin .8s linear infinite;
}

/* ══ PLOT ACTIONS ════════════════════════════════════════════════════
   Two to a row, wide ones on their own line. Every button gets the same
   height and the same share of the width, so nothing is a different size
   from its neighbour and a long name truncates instead of bursting out. */

.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.acts .btn { width: 100%; min-width: 0; padding: 0 14px; }
.acts .wide { grid-column: 1 / -1; }
.acts .btn > svg { flex: none; }
.btn .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calling is not the same kind of act as navigating, so it does not wear
   the same green. Brass: present, clearly tappable, not competing. */
.btn.call {
  background: var(--brass-l); color: var(--brass);
  border-color: color-mix(in srgb, var(--brass) 26%, transparent);
}
.btn.call svg { color: var(--brass); }

/* ══ BATEDAAR FORM ═══════════════════════════════════════════════════ */

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
       background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.seg-b { min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px;
         background: none; color: var(--ink-3); font: 600 13px var(--sans); }
.seg-b.on { background: var(--surface); color: var(--forest); box-shadow: 0 1px 3px rgba(0,0,0,.07); }

.fld-grid { display: grid; gap: 11px; }
@media (min-width: 560px) { .fld-grid { grid-template-columns: 1fr 1fr; } }
.fld { display: block; }
.fld-l { display: block; font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }

.up-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.up-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 12px; min-width: 0;
  border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink-3); font: 600 12.5px var(--sans);
}
.up-box svg { width: 15px; height: 15px; flex: none; }
.up-box span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-box.on { border-style: solid; border-color: var(--forest); background: var(--forest-l); color: var(--forest); }

/* A row that stands on its own rather than inside a scrolling register. */
.doc-list > .f-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.doc-list > .f-row:disabled { opacity: .65; }
.f-rowmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.f-rowmain b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-rowmain .muted { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-rowtag {
  flex: none; margin-left: auto; padding: 4px 8px; border-radius: 999px;
  background: var(--brass-l); color: var(--brass); font-size: 11px; font-weight: 600;
}
.f-row .arrow { flex: none; color: var(--ink-3); display: grid; place-items: center; }
.f-row .arrow svg { width: 13px; height: 13px; }

/* ══ THE PHOTOGRAPH ══════════════════════════════════════════════════
   First thing on a plot. You recognise a field by looking at it long before
   you recognise it by its number. */

.hero { margin: -4px -2px 26px; }
.hero-shot { display: block; border-radius: 15px; overflow: hidden; background: var(--surface-2); }
.hero-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-strip { display: flex; gap: 7px; margin-top: 7px; overflow-x: auto; scrollbar-width: none; }
.hero-strip::-webkit-scrollbar { display: none; }
.hero-mini { flex: none; width: 58px; height: 58px; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.hero-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-cap {
  margin-top: 9px; font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* A picture on its way, and a picture that is not coming. Neither is a
   broken-image icon, which tells you nothing and looks like a bug. */
img.loading {
  background:
    linear-gradient(100deg, transparent 20%, rgba(0,0,0,.045) 40%, transparent 60%)
    var(--surface-2);
  background-size: 260% 100%;
  animation: shim 1.3s linear infinite;
}
@keyframes shim { to { background-position: -160% 0; } }
img.gone {
  background: var(--surface-2);
  position: relative;
}
img.gone::after {
  content: "not available";
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 10.5px var(--sans); color: var(--ink-3);
  background: var(--surface-2); border-radius: inherit;
}

.pick.held { opacity: .72; background: var(--surface-2); }
.pick.held input { accent-color: var(--ink-3); }
