/* ============================================================
   grower.components.css · ชาวสวน persona redesign
   ------------------------------------------------------------
   สวนของฉัน (grower_home) + จัดการข้อมูลสวน (grower_manage).
   EXTENDS the shipped Atlas language. Every value resolves to a
   supply.tokens.css variable — NO new colour / font / radius /
   shadow / provenance hue is minted. Zero-dependency, greyscale-
   safe (glyph + edge + weight + position, never hue alone).

   Loaded LAST, after:
     supply.tokens.css → supply.components.css → shell.chrome.css →
     sourcing.components.css → trade.components.css →
     passport.components.css → farm.components.css → harvest.components.css

   The redesign's job: kill the 5-tool stack (~1790px/orchard) that
   broke calm-grower principle #1. New IA = SUMMARY-FIRST:
     · home answers ONE question — "วันนี้ทำอะไร" — then a quiet plot list;
       depth (the harvest block, finance, passport) is ONE TAP deep,
       never stacked on the page.
     · manage is a focused, one-section-at-a-time data surface
       (ปักหมุด GPS · แก้แปลง+วันเก็บ · ใบรับรอง/GAP · ความยินยอม).
   MINTS new (g-/gh-/gm-) ONLY the things with no shipped analogue:
   the calm paper stage, the "วันนี้" focal card + rest-state, the
   compact plot row, the quiet tool tiles, and the GPS pin-drop map.
   ============================================================ */

/* the [hidden] attribute must win over component display:flex/grid */
[hidden]{ display:none !important; }

/* ============================================================
   CALM STAGE — warm paper, a single centred column floats on it.
   (Same idiom as the shipped .ppstage; grower tempo = lots of air.)
   ============================================================ */
.gstage{
  flex:1; min-height:0; overflow-y:auto;
  display:flex; align-items:flex-start; justify-content:center;
  padding:clamp(var(--s4),4vh,var(--s6)) var(--s4) calc(var(--s7) + env(safe-area-inset-bottom));
  background:radial-gradient(125% 90% at 50% -12%, var(--surface2), var(--bg));
}
.gwrap{ width:min(680px,100%); display:flex; flex-direction:column; gap:var(--s5); }

/* a quiet section label (the only headers the calm home uses) */
.g-seclbl{ display:flex; align-items:center; gap:.6rem; }
.g-seclbl .st{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.1em;
  color:var(--muted); font-weight:var(--fw-bold); white-space:nowrap; }
.g-seclbl .ln{ flex:1; height:1px; background:var(--line); }
.g-seclbl .ct{ font-size:var(--fs-2xs); color:var(--muted); font-family:var(--mono); }

/* ============================================================
   GREETING — the calm header: date + who. No metrics, no badges.
   ============================================================ */
.gh-greet{ display:flex; flex-direction:column; gap:.2rem; }
.gh-greet .gh-date{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.09em;
  color:var(--muted); font-weight:var(--fw-bold); font-family:var(--mono); }
.gh-greet h1{ margin:0; font-size:var(--fs-2xl); font-weight:var(--fw-x); letter-spacing:-.02em;
  line-height:var(--lh-tight); color:var(--ink); }
.gh-greet .gh-sub{ font-size:var(--fs-sm); color:var(--muted); }

/* ============================================================
   "วันนี้" — THE FOCAL CARD. One answer to "what do I do today".
   Calm by construction: one headline, one sub-line, at most ONE
   action. A left accent bar carries the state without shouting.
   ============================================================ */
.gh-today{ position:relative; border:1px solid var(--line); border-radius:var(--r-lg);
  background:var(--surface); box-shadow:var(--sh-sm); overflow:hidden;
  padding:var(--s5) var(--s5) var(--s5) calc(var(--s5) + 6px); }
.gh-today::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:6px;
  background:var(--brand); }
.gh-thead{ display:flex; align-items:center; gap:.6rem; margin-bottom:var(--s3); }
.gh-teyebrow{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.1em;
  color:var(--muted); font-weight:var(--fw-bold); }
.gh-thead .grow{ flex:1; }
.gh-tbody{ display:flex; align-items:flex-start; gap:var(--s4); }
.gh-tglyph{ width:46px; height:46px; flex:0 0 46px; border-radius:13px; display:grid; place-items:center;
  background:var(--brand-soft); color:var(--brand-ink); border:1px solid var(--brand); margin-top:.1rem; }
.gh-tglyph svg{ width:25px; height:25px; display:block; }
.gh-tmain{ flex:1; min-width:0; }
.gh-tline{ font-size:var(--fs-xl); font-weight:var(--fw-x); letter-spacing:-.015em;
  line-height:1.15; color:var(--ink); text-wrap:pretty; }
.gh-tsub{ font-size:var(--fs-sm); color:var(--ink2); line-height:1.5; margin-top:.35rem; text-wrap:pretty; }
.gh-tsub .who{ color:var(--brand2); font-weight:var(--fw-semi); }
.gh-tact{ display:flex; flex-wrap:wrap; gap:var(--s3); margin-top:var(--s4); }
.gh-tact .btn{ min-width:0; }
/* a calm "why this is today's read" provenance chip under the line */
.gh-tchip{ margin-top:.5rem; }

/* --- state tints (accent bar + glyph), greyscale-safe via glyph --- */
.gh-today.go::before{ background:var(--brand); }              /* in-window → brass (action) */
.gh-today.spray::before{ background:var(--pv-official); }     /* official ◆ weather */
.gh-today.spray .gh-tglyph{ background:var(--pv-official-bg); color:var(--pv-official); border-color:var(--pv-official-ln); }
.gh-today.price::before{ background:var(--pv-est); }          /* estimate ~ market */
.gh-today.price .gh-tglyph{ background:var(--pv-est-bg); color:var(--pv-est); border-color:var(--pv-est-ln); }
.gh-today.price .gh-tline .num{ font-family:var(--mono); }
.gh-today.past::before{ background:var(--pv-stale); }         /* stale ◷, never red */
.gh-today.past .gh-tglyph{ background:var(--pv-stale-bg); color:var(--pv-stale); border-color:var(--pv-stale-ln); }
.gh-today.past .gh-tline{ color:var(--ink2); }

/* --- REST STATE — the boldest calm move: when there's nothing to do,
   SHOW nothing to do, beautifully. Centred, mostly empty, restful. --- */
.gh-today.rest{ padding:var(--s6) var(--s5); text-align:center;
  background:linear-gradient(180deg, color-mix(in srgb,var(--pv-verified-bg) 30%, var(--surface)), var(--surface)); }
.gh-today.rest::before{ background:var(--pv-verified); }
.gh-today.rest .gh-thead{ justify-content:center; }
.gh-today.rest .gh-tbody{ flex-direction:column; align-items:center; gap:var(--s3); }
.gh-today.rest .gh-tglyph{ width:54px; height:54px; flex-basis:54px; border-radius:50%;
  background:var(--pv-verified-bg); color:var(--pv-verified); border-color:var(--pv-verified-ln); margin-top:0; }
.gh-today.rest .gh-tglyph svg{ width:28px; height:28px; }
.gh-today.rest .gh-tline{ font-size:var(--fs-xl); }
.gh-today.rest .gh-tsub{ max-width:42ch; margin-inline:auto; }

/* ============================================================
   PLOT LIST — the 1790px stack, replaced. Each plot = ONE calm row
   (~64px) carrying name · where · a single glanceable harvest read ·
   a consent dot. Tap → detail drawer (depth is one tap, not stacked).
   ============================================================ */
.gh-plots{ display:flex; flex-direction:column; gap:var(--s3); }
.gh-plotrow{ display:grid; grid-template-columns:auto 1fr auto; gap:var(--s4); align-items:center;
  width:100%; text-align:left; cursor:pointer; font:inherit; color:inherit;
  border:1px solid var(--line); border-radius:var(--r); background:var(--surface);
  box-shadow:var(--sh-sm); padding:var(--s4); transition:border-color .12s, box-shadow .12s, transform .05s; }
.gh-plotrow:hover{ border-color:var(--brand); box-shadow:var(--sh-md); }
.gh-plotrow:active{ transform:translateY(1px); }
.gh-plotrow:focus-visible{ outline:2px solid var(--ring); outline-offset:2px; }

/* the swatch = harvest-pressure tint, echoing the map ramp + cell ring */
.gh-pswatch{ width:14px; height:42px; flex:0 0 14px; border-radius:5px; background:var(--ramp-2); }
.gh-plotrow.go .gh-pswatch{ background:var(--ramp-3); box-shadow:inset 0 0 0 2px var(--brand); }
.gh-plotrow.past .gh-pswatch{ background:var(--pv-stale-bg); box-shadow:inset 0 0 0 1.6px var(--pv-stale-ln); }
.gh-plotrow.nopin .gh-pswatch{ background:var(--pv-private-bg); box-shadow:inset 0 0 0 1.6px var(--pv-private-ln); }

.gh-pmid{ min-width:0; display:flex; flex-direction:column; gap:.25rem; }
.gh-pname{ font-size:var(--fs-md); font-weight:var(--fw-bold); letter-spacing:-.01em; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gh-pwhere{ display:flex; align-items:center; gap:.3rem; font-size:var(--fs-xs); color:var(--muted); }
.gh-pwhere .pin{ width:12px; height:12px; flex:0 0 12px; color:var(--brand2); display:inline-flex; }
.gh-pwhere .pin svg{ width:100%; height:100%; display:block; }
.gh-pwhere .sep{ color:var(--line2); }
/* the single glanceable harvest read (a compact chip) */
.gh-pstatus{ display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; margin-top:.1rem; }
.gh-pchip{ display:inline-flex; align-items:center; gap:.3rem; white-space:nowrap;
  font-size:var(--fs-2xs); font-weight:var(--fw-bold); line-height:1.5;
  padding:.1rem .5rem; border-radius:var(--r-pill); border:1px solid transparent;
  background:var(--pv-est-bg); color:var(--pv-est); border-color:var(--pv-est-ln); }
.gh-pchip .g{ font-weight:var(--fw-x); }
.gh-pchip .num{ font-family:var(--mono); font-variant-numeric:tabular-nums; }
.gh-pchip.go{ background:var(--brand-soft); color:var(--brand-ink); border-color:var(--brand); }
.gh-pchip.past{ background:var(--pv-stale-bg); color:var(--pv-stale); border-color:var(--pv-stale-ln); border-style:dashed; }
.gh-pchip.nopin{ background:var(--pv-private-bg); color:var(--pv-private); border-color:var(--pv-private-ln); }
/* consent dot — open = brass, closed = private lock (glyph carries it) */
.gh-pconsent{ display:inline-flex; align-items:center; gap:.3rem; font-size:var(--fs-2xs); color:var(--muted); }
.gh-pconsent .d{ width:8px; height:8px; border-radius:50%; flex:0 0 8px; background:var(--pv-private-ln); }
.gh-pconsent.open .d{ background:var(--brand); }
.gh-pconsent.open{ color:var(--brand2); }

.gh-pgo{ color:var(--muted); font-size:1.2rem; flex:0 0 auto; }
.gh-plotrow:hover .gh-pgo{ color:var(--brand2); }

@media (max-width:480px){
  .gh-plotrow{ grid-template-columns:auto 1fr auto; gap:var(--s3); padding:var(--s3) var(--s4); }
  .gh-pswatch{ height:46px; }
}

/* ============================================================
   QUIET TOOL TILES — secondary access, deliberately small & flat so
   they never compete with "วันนี้". Manage · finance · passport.
   ============================================================ */
.gh-tools{ display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3); }
.gh-tool{ display:flex; flex-direction:column; gap:.4rem; align-items:flex-start; text-align:left;
  cursor:pointer; font:inherit; color:inherit; text-decoration:none;
  border:1px solid var(--line); border-radius:var(--r); background:var(--surface2);
  padding:var(--s4); transition:border-color .12s, background .12s; }
.gh-tool:hover{ border-color:var(--brand); background:var(--surface); }
.gh-tool:focus-visible{ outline:2px solid var(--ring); outline-offset:2px; }
.gh-tool .ic{ width:24px; height:24px; flex:0 0 24px; color:var(--brand2); display:inline-flex; }
.gh-tool .ic svg{ width:100%; height:100%; display:block; }
.gh-tool .tl{ font-size:var(--fs-sm); font-weight:var(--fw-bold); color:var(--ink); letter-spacing:-.01em; line-height:1.2; }
.gh-tool .ts{ font-size:var(--fs-2xs); color:var(--muted); line-height:1.35; }
.gh-tool .tbadge{ font-size:var(--fs-2xs); font-weight:var(--fw-bold); color:var(--pv-private);
  font-family:var(--mono); }
@media (max-width:520px){
  .gh-tools{ grid-template-columns:1fr; }
  .gh-tool{ flex-direction:row; align-items:center; gap:var(--s3); }
  .gh-tool .tmeta{ display:flex; flex-direction:column; gap:.15rem; }
}

/* ============================================================
   PLOT DETAIL DRAWER — where the tools LIVE, one tap deep, grouped &
   summary-first (not stacked on the home). Reuses the shipped .drawer
   / .dr-head / .dr-body / .dr-foot bottom-sheet. Adds only the calm
   header band + the quick-action row.
   ============================================================ */
.gh-drhero{ display:flex; align-items:flex-start; justify-content:space-between; gap:var(--s3);
  padding:var(--s4) var(--s5); background:linear-gradient(180deg,var(--surface2),var(--surface));
  border-bottom:1px solid var(--line); }
.gh-drhero .gh-drname{ font-size:var(--fs-xl); font-weight:var(--fw-x); letter-spacing:-.02em; line-height:1.1; }
.gh-drhero .gh-drwhere{ display:flex; align-items:center; gap:.35rem; font-size:var(--fs-sm); color:var(--muted); margin-top:.2rem; }
.gh-drhero .gh-drwhere .pin{ width:13px; height:13px; flex:0 0 13px; color:var(--brand2); display:inline-flex; }
.gh-drhero .gh-drwhere .pin svg{ width:100%; height:100%; display:block; }

.gh-drfacts{ display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3); }
.gh-drlinks{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s3); }
.gh-drlink{ display:flex; align-items:center; gap:.6rem; text-decoration:none; cursor:pointer; font:inherit; color:inherit;
  border:1px solid var(--line2); border-radius:var(--r); background:var(--surface); padding:.7rem .8rem;
  transition:border-color .12s, background .12s; }
.gh-drlink:hover{ border-color:var(--brand); background:var(--surface2); }
.gh-drlink .ic{ width:20px; height:20px; flex:0 0 20px; color:var(--brand2); display:inline-flex; }
.gh-drlink .ic svg{ width:100%; height:100%; display:block; }
.gh-drlink .l{ flex:1; min-width:0; font-size:var(--fs-sm); font-weight:var(--fw-semi); color:var(--ink); }
.gh-drlink .a{ color:var(--muted); }

/* --- "soon" (ใกล้เก็บ) — estimate ochre; harvest approaching, calm --- */
.gh-today.soon::before{ background:var(--pv-est); }
.gh-today.soon .gh-tglyph{ background:var(--pv-est-bg); color:var(--pv-est); border-color:var(--pv-est-ln); }
.gh-today.soon .gh-tline .num{ font-family:var(--mono); }

/* ============================================================
   SECONDARY READS (plot sheet) — spray / bargain / GAP as a calm
   single-open chip accordion under the harvest hero. Never a stack:
   harvest is always shown; at most ONE secondary panel is open. Chips
   carry a glanceable micro-summary so the headline reads un-expanded.
   ============================================================ */
.gh-reads{ display:flex; gap:var(--s2); flex-wrap:wrap; }
.gh-readchip{ display:inline-flex; align-items:center; gap:.45rem; cursor:pointer; font:inherit; white-space:nowrap;
  border:1px solid var(--line2); background:var(--surface); color:var(--ink2);
  border-radius:var(--r-pill); padding:.45rem .8rem; font-size:var(--fs-sm); font-weight:var(--fw-semi); }
.gh-readchip:hover{ border-color:var(--brand); background:var(--surface2); }
.gh-readchip .ic{ width:17px; height:17px; flex:0 0 17px; color:var(--brand2); display:inline-flex; }
.gh-readchip .ic svg{ width:100%; height:100%; display:block; }
.gh-readchip .rs{ font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:var(--fs-xs); color:var(--muted); }
.gh-readchip .rs.ok{ font-family:var(--font); color:var(--pv-verified); font-weight:var(--fw-bold); }
.gh-readchip .cv{ color:var(--muted); transition:transform .14s; font-size:.8em; }
.gh-readchip[aria-expanded="true"]{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand-ink); }
.gh-readchip[aria-expanded="true"] .ic{ color:var(--brand-ink); }
.gh-readchip[aria-expanded="true"] .rs{ color:var(--brand2); }
.gh-readchip[aria-expanded="true"] .cv{ transform:rotate(180deg); }

.gh-readpanel{ border:1px solid var(--line); border-radius:var(--r); background:var(--surface2);
  padding:var(--s4); display:flex; flex-direction:column; gap:var(--s3); }
.gh-readpanel[hidden]{ display:none !important; }
.gh-readpanel .rphd{ display:flex; align-items:center; gap:.5rem; font-size:var(--fs-sm);
  font-weight:var(--fw-bold); color:var(--ink); letter-spacing:-.01em; }
.gh-readpanel .rphd .ic{ width:18px; height:18px; flex:0 0 18px; color:var(--brand2); display:inline-flex; }
.gh-readpanel .rphd .ic svg{ width:100%; height:100%; display:block; }
.gh-readpanel .metricrow{ margin-top:0; }

/* the 7-day rain forecast strip (spray read) */
.gh-rain{ display:flex; gap:5px; align-items:flex-end; }
.gh-rd{ flex:1; display:flex; flex-direction:column; align-items:center; gap:.35rem; min-width:0; }
.gh-rd .rbarwrap{ width:100%; height:46px; display:flex; align-items:flex-end; }
.gh-rd .rbar{ width:100%; border-radius:4px 4px 2px 2px;
  background:var(--pv-official-bg); border:1px solid var(--pv-official-ln); }
.gh-rd.good .rbar{ background:var(--brand-soft); border-color:var(--brand); }
.gh-rd .rlab{ font-size:var(--fs-2xs); color:var(--muted); font-family:var(--mono); }
.gh-rd.good .rlab{ color:var(--brand-ink); font-weight:var(--fw-bold); }
/* spray = a forecast RECOMMENDATION (official ◆), not a guarantee */
.gh-spraynote{ display:flex; gap:.55rem; align-items:flex-start;
  background:var(--pv-official-bg); border:1px solid var(--pv-official-ln); border-radius:var(--r);
  padding:.55rem .7rem; font-size:var(--fs-2xs); color:var(--ink2); line-height:1.5; }
.gh-spraynote .g{ color:var(--pv-official); font-weight:var(--fw-x); flex:0 0 auto; font-family:var(--mono); }
/* GAP ≠ GACC clarifier (neutral, on the GAP read) */
.gh-gapneq{ display:flex; gap:.55rem; align-items:flex-start;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:.55rem .7rem; font-size:var(--fs-2xs); color:var(--ink2); line-height:1.5; }
.gh-gapneq .g{ color:var(--muted); font-weight:var(--fw-x); flex:0 0 auto; font-family:var(--mono); }

/* ============================================================
   ===============  จัดการข้อมูลสวน · grower_manage  ===============
   ============================================================ */

/* plot picker — which plot am I managing (calm pill row, scrolls x) */
.gm-pick{ display:flex; gap:var(--s2); flex-wrap:wrap; }
.gm-pickbtn{ display:inline-flex; align-items:center; gap:.45rem; cursor:pointer; font:inherit;
  border:1px solid var(--line2); background:var(--surface); color:var(--ink2);
  border-radius:var(--r-pill); padding:.45rem .85rem; font-size:var(--fs-sm); font-weight:var(--fw-semi); }
.gm-pickbtn .d{ width:9px; height:9px; border-radius:50%; flex:0 0 9px; background:var(--ramp-2); }
.gm-pickbtn[aria-pressed="true"]{ background:var(--brand); border-color:var(--brand); color:#fff; }
.gm-pickbtn[aria-pressed="true"] .d{ background:#fff; }

/* a manage section card — one job, calm, generous */
.gm-card{ border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden; }
.gm-cardhd{ display:flex; align-items:flex-start; gap:.7rem; padding:var(--s4) var(--s5);
  border-bottom:1px solid var(--line); background:var(--surface2); }
.gm-cardhd .ic{ width:32px; height:32px; flex:0 0 32px; border-radius:9px; display:grid; place-items:center;
  background:var(--surface); color:var(--brand-ink); border:1px solid var(--brand); }
.gm-cardhd .ic svg{ width:18px; height:18px; display:block; }
.gm-cardhd .hm{ flex:1; min-width:0; }
.gm-cardhd .hm b{ display:block; font-size:var(--fs-lg); font-weight:var(--fw-bold); letter-spacing:-.01em; color:var(--ink); }
.gm-cardhd .hm span{ display:block; font-size:var(--fs-xs); color:var(--muted); margin-top:1px; line-height:1.4; }
.gm-cardbody{ padding:var(--s5); display:flex; flex-direction:column; gap:var(--s4); }

/* ============================================================
   GPS PIN-DROP MAP — the marquee NEW affordance. The wizard never
   captured a pin; the PATCH endpoint now takes a centroid. The grower
   drops/drags ONE pin on a paper-toned plot canvas → we read a coarse
   centroid (mono). Honest: it's the plot centre, not a fence trace.
   Zero-dep (no tiles); Leaflet is the live vendored swap.
   ============================================================ */
.gm-map{ position:relative; width:100%; aspect-ratio:16 / 10; border-radius:var(--r);
  border:1px solid var(--line2); overflow:hidden; cursor:crosshair; touch-action:none;
  background:
    radial-gradient(140% 120% at 20% 10%, color-mix(in srgb,var(--brand-soft) 30%, var(--surface2)), transparent 55%),
    repeating-linear-gradient(0deg, color-mix(in srgb,var(--line) 55%, transparent) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, color-mix(in srgb,var(--line) 55%, transparent) 0 1px, transparent 1px 34px),
    var(--surface2); }
.gm-map .gm-parcel{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.gm-map .gm-parcel path{ fill:color-mix(in srgb,var(--brand-soft) 45%, transparent);
  stroke:var(--brand2); stroke-width:1.4; stroke-dasharray:5 4; opacity:.7; }
.gm-map .gm-hint{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  display:flex; flex-direction:column; align-items:center; gap:.4rem; text-align:center;
  color:var(--brand2); font-size:var(--fs-sm); font-weight:var(--fw-semi); pointer-events:none; padding:0 var(--s4); }
.gm-map .gm-hint .ic{ width:34px; height:34px; opacity:.85; }
.gm-map .gm-hint .ic svg{ width:100%; height:100%; display:block; }
.gm-map.placed .gm-hint{ display:none; }
/* the pin itself — a teardrop, draggable */
.gm-pin{ position:absolute; width:30px; height:30px; transform:translate(-50%,-100%);
  cursor:grab; pointer-events:auto; filter:drop-shadow(0 4px 6px rgba(60,44,18,.35)); display:none; }
.gm-pin.on{ display:block; }
.gm-pin:active{ cursor:grabbing; }
.gm-pin svg{ width:100%; height:100%; display:block; }
.gm-map.placed{ cursor:default; }
/* an accuracy halo around the pin = honest "this is a coarse centroid" */
.gm-pinhalo{ position:absolute; width:74px; height:74px; border-radius:50%; transform:translate(-50%,-50%);
  background:color-mix(in srgb,var(--brand) 12%, transparent); border:1.5px dashed var(--brand);
  pointer-events:none; display:none; }
.gm-pinhalo.on{ display:block; }

/* coord readout + actions under the map */
.gm-coordrow{ display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; }
.gm-coord{ flex:1; min-width:160px; display:flex; align-items:center; gap:.5rem;
  border:1px solid var(--line2); border-radius:var(--r-sm); background:var(--surface2); padding:.55rem .7rem; }
.gm-coord .ck{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:var(--fw-bold); }
.gm-coord .cv{ font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:var(--fs-sm); color:var(--ink); font-weight:var(--fw-semi); }
.gm-coord.empty .cv{ color:var(--muted); font-style:italic; font-family:var(--font); }

/* the "why we pin" honest note — privacy-toned (it's the owner's own plot) */
.gm-pinnote{ display:flex; gap:.55rem; align-items:flex-start;
  background:var(--pv-private-bg); border:1px solid var(--pv-private-ln); border-radius:var(--r);
  padding:.6rem .7rem; font-size:var(--fs-xs); color:var(--ink2); line-height:1.5; }
.gm-pinnote .ic{ width:16px; height:16px; flex:0 0 16px; color:var(--pv-private); margin-top:1px; display:inline-flex; }
.gm-pinnote .ic svg{ width:100%; height:100%; display:block; }
.gm-pinnote b{ color:var(--pv-private); font-weight:var(--fw-bold); }

/* the harvest-date pair, framed as the OWNER's declared window (◆) */
.gm-declnote{ display:flex; gap:.55rem; align-items:flex-start;
  background:var(--surface2); border:1px solid var(--line); border-radius:var(--r);
  padding:.6rem .7rem; font-size:var(--fs-xs); color:var(--ink2); line-height:1.5; }
.gm-declnote .g{ color:var(--muted); font-weight:var(--fw-x); flex:0 0 auto; font-family:var(--mono); }
.gm-declnote b{ color:var(--ink); font-weight:var(--fw-semi); }

/* save bar — sticky calm footer for the active section */
.gm-savebar{ display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; }
.gm-savebar .grow{ flex:1; }
.gm-savebar .gm-saved{ display:none; align-items:center; gap:.35rem; font-size:var(--fs-xs);
  color:var(--pv-verified); font-weight:var(--fw-bold); }
.gm-savebar .gm-saved.on{ display:inline-flex; }
.gm-savebar .gm-saved .ic{ width:15px; height:15px; display:inline-flex; }
.gm-savebar .gm-saved .ic svg{ width:100%; height:100%; display:block; }

/* a cert chip-row (verified-grade GAP seal reuses the shipped .gapseal) */
.gm-certnote{ font-size:var(--fs-xs); color:var(--muted); line-height:1.5; }
.gm-certnote b{ color:var(--pv-verified); font-weight:var(--fw-semi); }

/* a back-to-home link, calm */
.g-back{ display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; cursor:pointer;
  font-size:var(--fs-sm); font-weight:var(--fw-semi); color:var(--brand2);
  border:1px solid var(--line2); border-radius:var(--r-pill); padding:.4rem .8rem; background:var(--surface);
  align-self:flex-start; }
.g-back:hover{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand-ink); }
.g-back .ic{ width:15px; height:15px; display:inline-flex; }
.g-back .ic svg{ width:100%; height:100%; display:block; }

@media (pointer:coarse){
  .gh-plotrow, .gh-tool, .gm-pickbtn, .gh-drlink, .g-back, .btn{ min-height:44px; }
}
@media (max-width:560px){
  .gh-drfacts{ grid-template-columns:repeat(3,1fr); }
  .gh-drlinks{ grid-template-columns:1fr; }
}

/* Leaflet location picker — reuses the #/parcels vendored map + tile proxy */
.gm-map{ isolation:isolate; }
.gm-map.leaflet-container{ background:#27331f; cursor:grab; }
.gm-map .leaflet-control-attribution{ font-size:9px; background:color-mix(in srgb,var(--surface) 82%, transparent); color:var(--muted); }
.gm-map .leaflet-bar a{ background:var(--surface); color:var(--ink); border-bottom-color:var(--line2); }
.gm-lpin svg{ width:30px; height:30px; display:block; filter:drop-shadow(0 2px 3px rgba(0,0,0,.35)); }

/* inline cert/consent sections — the real FARM_VIEW ladder/GAP, mounted in-page */
.gm-cardbody .fr-inlinewrap .dr-body{ padding:0; max-height:none; overflow:visible; }
.gm-cardbody .fr-inlinewrap{ display:block; }
.fr-inlinebar{ display:flex; align-items:center; gap:.5rem; margin-top:14px; }

/* ============================================================
   ตำแหน่งสวน — GPS-hero-first + collapsed map disclosure
   (ported from Claude Design handoff_out/grower_manage_location;
   additive only — no shipped .gm-* class redefined). Fixes the sim
   finding: the one-tap GPS button sat below the fold under the map.
   ============================================================ */
/* HERO — the one-tap GPS action, now FIRST in the card body (state A/B) */
.gm-gpshero{ display:flex; flex-direction:column; gap:.6rem; }
.gm-gpsbtn{ display:flex; align-items:center; gap:var(--s4); width:100%; text-align:left;
  cursor:pointer; font:inherit; border:0; border-radius:var(--r-lg);
  background:var(--brand); color:#fff; padding:var(--s4) var(--s5);
  box-shadow:var(--sh-md); transition:transform .08s, box-shadow .12s, background .12s; min-height:64px; }
.gm-gpsbtn:hover{ background:var(--brand2); box-shadow:var(--sh-lg); }
.gm-gpsbtn:active{ transform:translateY(1px); }
.gm-gpsbtn:focus-visible{ outline:2px solid var(--ring); outline-offset:2px; }
.gm-gpsic{ width:34px; height:34px; flex:0 0 34px; border-radius:50%; display:grid; place-items:center;
  background:rgba(255,255,255,.16); color:#fff; }
.gm-gpsic svg{ width:22px; height:22px; display:block; }
.gm-gpstxt{ display:flex; flex-direction:column; gap:.15rem; min-width:0; }
.gm-gpstxt b{ font-size:var(--fs-lg); font-weight:var(--fw-x); letter-spacing:-.01em; line-height:1.2; color:#fff; }
.gm-gpstxt span{ font-size:var(--fs-xs); color:rgba(255,255,255,.82); line-height:1.3; }
.gm-gpsbtn.busy{ cursor:progress; background:var(--brand2); }
.gm-gpsbtn.busy .gm-gpsic svg{ animation:gm-spin 1s linear infinite; }
@keyframes gm-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .gm-gpsbtn.busy .gm-gpsic svg{ animation:none; } }
.gm-gpshero.busy .gm-manuallink{ display:none; }
.gm-manuallink{ display:inline-flex; align-items:center; gap:.4rem; align-self:flex-start;
  cursor:pointer; font:inherit; border:0; background:transparent; color:var(--brand2);
  font-size:var(--fs-sm); font-weight:var(--fw-semi); padding:.3rem .1rem; }
.gm-manuallink:hover{ text-decoration:underline; }
.gm-manuallink span svg{ width:15px; height:15px; display:block; }
/* CONFIRMED (state C) — compact, calm, replaces the hero once pinned */
.gm-gpsdone{ display:flex; flex-direction:column; gap:var(--s3); width:100%;
  border:1px solid var(--pv-verified-ln); background:var(--pv-verified-bg); border-radius:var(--r-lg); padding:var(--s4) var(--s5); }
.gm-gpsdonetop{ display:flex; align-items:flex-start; gap:var(--s3); width:100%; }
.gm-gpsdoneic{ width:34px; height:34px; flex:0 0 34px; border-radius:50%; display:grid; place-items:center;
  background:var(--surface); color:var(--pv-verified); border:1px solid var(--pv-verified-ln); }
.gm-gpsdoneic svg{ width:18px; height:18px; display:block; }
.gm-gpsdonemain{ flex:1; min-width:0; display:flex; flex-direction:column; gap:.2rem; }
.gm-gpsdonemain b{ font-size:var(--fs-md); font-weight:var(--fw-bold); color:var(--pv-verified); letter-spacing:-.01em; }
.gm-gpscoord{ font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:var(--fs-sm); color:var(--ink); white-space:nowrap; }
.gm-gpsnudgehint{ font-size:var(--fs-2xs); color:var(--ink2); }
.gm-gpsdone .btn.secondary.sm{ align-self:flex-start; white-space:nowrap; }
/* MANUAL MAP DISCLOSURE (state D) — shipped map/pin/savebar, one-tap toggle */
.gm-mapwrap{ display:flex; flex-direction:column; gap:var(--s3); }
.gm-mapToggle{ display:flex; align-items:center; gap:.5rem; width:100%; text-align:left;
  cursor:pointer; font:inherit; border:1px solid var(--line2); background:var(--surface2);
  color:var(--ink2); border-radius:var(--r); padding:.65rem var(--s4); font-size:var(--fs-sm); font-weight:var(--fw-semi); }
.gm-mapToggle:hover{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand-ink); }
.gm-mapToggle .ic{ width:17px; height:17px; flex:0 0 17px; color:var(--brand2); display:inline-flex; }
.gm-mapToggle .ic svg{ width:100%; height:100%; display:block; }
.gm-mapToggle span:nth-child(2){ flex:1; }
.gm-mapToggle .cv{ width:16px; height:16px; flex:0 0 16px; color:var(--muted); transition:transform .14s; display:inline-flex; }
.gm-mapToggle .cv svg{ width:100%; height:100%; display:block; }
.gm-mapToggle[aria-expanded="true"]{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand-ink); }
.gm-mapToggle[aria-expanded="true"] .cv{ transform:rotate(180deg); }
.gm-mappanel{ display:flex; flex-direction:column; gap:var(--s4); }
.gm-mappanel[hidden]{ display:none !important; }
@media (pointer:coarse){ .gm-gpsbtn, .gm-mapToggle, .gm-manuallink{ min-height:44px; } }

/* ============================================================
   จัดการข้อมูลสวน — condensed manage frame (Claude Design r2)
   One sticky bar merges back + title + plot-chip + section-tabs
   (four stacked blocks → one) so a section's first action clears
   the fold + bottom-nav. Additive; redefines no shipped class.
   Prototype-only .gmc-tabbar/.gmc-tabbtn/.gmc-measure/.gmc-scroll
   are NOT ported (real shell provides the nav + scroller).
   ============================================================ */
.gmc-bar{ position:sticky; top:0; z-index:30; display:flex; flex-direction:column; gap:var(--s3);
  padding:var(--s3) var(--s4); background:color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter:saturate(1.1) blur(8px); border-bottom:1px solid var(--line); }
.gmc-nav{ display:flex; align-items:center; gap:var(--s2); min-width:0; }
.gmc-back{ display:inline-flex; align-items:center; justify-content:center; gap:.35rem; flex:0 0 auto;
  cursor:pointer; font:inherit; width:38px; height:38px; border-radius:var(--r-pill);
  border:1px solid var(--line2); background:var(--surface); color:var(--brand2); }
.gmc-back:hover{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand-ink); }
.gmc-back .ic{ width:17px; height:17px; display:inline-flex; }
.gmc-back .ic svg{ width:100%; height:100%; display:block; }
.gmc-title{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.gmc-title b{ font-size:var(--fs-md); font-weight:var(--fw-bold); letter-spacing:-.01em; color:var(--ink);
  line-height:1.15; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmc-title .crumb{ font-size:var(--fs-2xs); color:var(--muted); font-weight:var(--fw-semi);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmc-plotchip{ display:inline-flex; align-items:center; gap:.4rem; flex:0 1 auto; min-width:0; cursor:pointer;
  font:inherit; border:1px solid var(--line2); background:var(--surface2); color:var(--ink);
  border-radius:var(--r-pill); padding:.4rem .6rem; font-size:var(--fs-xs); font-weight:var(--fw-semi); max-width:36%; }
.gmc-plotchip:hover{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand-ink); }
.gmc-plotchip:focus-visible{ outline:2px solid var(--ring); outline-offset:2px; }
.gmc-plotchip .d{ width:9px; height:9px; border-radius:50%; flex:0 0 9px; background:var(--brand); }
.gmc-plotchip .pn{ min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmc-plotchip .cv{ width:14px; height:14px; flex:0 0 14px; color:var(--muted); display:inline-flex; }
.gmc-plotchip .cv svg{ width:100%; height:100%; display:block; }
.gmc-tabs{ display:flex; gap:var(--s2); overflow-x:auto; scrollbar-width:none;
  margin:0 calc(var(--s4) * -1); padding:0 var(--s4) 1px; }
.gmc-tabs::-webkit-scrollbar{ display:none; }
.gmc-tabs .wbtab{ flex:0 0 auto; white-space:nowrap; }
.gmc-body{ width:min(680px,100%); margin-inline:auto; display:flex; flex-direction:column; gap:var(--s4);
  padding:var(--s4) var(--s4) 0; }
/* plot switch sheet (chip → one tap; reuses .scrim/.sheet) */
.gmc-plotsheet{ display:flex; flex-direction:column; gap:var(--s2); }
.gmc-plotopt{ display:flex; align-items:center; gap:var(--s3); width:100%; text-align:left; cursor:pointer;
  font:inherit; color:inherit; border:1px solid var(--line2); border-radius:var(--r); background:var(--surface);
  padding:.7rem .8rem; transition:border-color .12s, background .12s; }
.gmc-plotopt:hover{ border-color:var(--brand); background:var(--surface2); }
.gmc-plotopt[aria-pressed="true"]{ border-color:var(--brand); background:var(--brand-soft); }
.gmc-plotopt .d{ width:11px; height:11px; border-radius:50%; flex:0 0 11px; background:var(--ramp-2); }
.gmc-plotopt[aria-pressed="true"] .d{ background:var(--brand); }
.gmc-plotopt .pm{ flex:1; min-width:0; }
.gmc-plotopt .pm b{ display:block; font-size:var(--fs-md); font-weight:var(--fw-bold); color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmc-plotopt .pm span{ display:block; font-size:var(--fs-xs); color:var(--muted); }
.gmc-plotopt .chk{ width:18px; height:18px; flex:0 0 18px; color:var(--brand2); display:none; }
.gmc-plotopt[aria-pressed="true"] .chk{ display:inline-flex; }
.gmc-plotopt .chk svg{ width:100%; height:100%; display:block; }
@media (pointer:coarse){ .gmc-back, .gmc-plotchip, .gmc-plotopt{ min-height:44px; } }
