/* ============================================================
   passport.components.css · Orchard Passport (พาสปอร์ตสวน)
   The public, read-only, LINE-shareable proof-of-orchard surface.
   EXTENDS Atlas — every value resolves to a supply.tokens.css
   variable. NO new colours / fonts / radii / shadows / provenance
   hues are minted. Reuses verbatim: .pv (+ levels) · .band/.bandrow/
   .tilde/.unit · .metric/.metricrow · .hwin · .disc · .gate/.why/.row
   · .btn (+ .full .sm .ghost .secondary .line-cta) · .seg · .state/
   .skel · .scrim/.sheet/.og · .shell-top/.brand/.who-chip · .pad/
   .eyebrow/.pt/.psub. Loaded AFTER shell.chrome.css.
   Adds ONLY: the passport stage + sheet, the identity hero, the
   GAP "seal", the honest-data provenance ledger, the contact/share
   seam, the teaser/opt-in state, and the passport OG card.
   Zero-dependency. Greyscale-safe (glyph + edge + weight, not hue).
   ============================================================ */

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

/* ---- the stage: warm paper, the passport floats centred on it.
   Works standalone (a LINE-shared link) AND embedded in a Spine
   drill — the .psheet is the portable unit either way. ---- */
.ppstage{
  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) var(--s7);
  background:radial-gradient(125% 90% at 50% -12%, var(--surface2), var(--bg));
}
.psheet{ width:min(640px,100%); display:flex; flex-direction:column; gap:var(--s4); }

/* a thin "public read-view" banner so the reader knows what this is and
   why it's visible (consent) — honest-data starts at the frame */
.ppribbon{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  font-size:var(--fs-xs); color:var(--brand-ink); line-height:1.35;
  background:var(--brand-soft); border:1px solid var(--brand);
  border-radius:var(--r); padding:.45rem .8rem; align-self:stretch; }
.ppribbon b{ font-weight:var(--fw-bold); white-space:nowrap; }
.ppribbon .rsub{ color:var(--brand2); }
.ppribbon .compass{ width:18px; height:18px; flex:0 0 18px; }
.ppribbon .compass svg{ width:100%; height:100%; display:block; }
.ppribbon b{ font-weight:var(--fw-bold); }
.ppribbon .sep{ color:var(--brand2); opacity:.55; }

/* ============================================================
   IDENTITY HERO  (the passport "page")
   ============================================================ */
.ppcard{ border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden; }
.pphero{ position:relative; padding:var(--s5) var(--s5) var(--s4); border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, var(--surface2), var(--surface)); }
.pphero .eyebrow{ display:flex; align-items:center; gap:.45rem; }
.pphero .pp-label{ font-size:var(--fs-2xl); font-weight:var(--fw-x); letter-spacing:-.02em;
  line-height:var(--lh-tight); margin:.4rem 0 .15rem; color:var(--ink); }
.pphero .pp-where{ display:flex; align-items:center; gap:.4rem; flex-wrap:wrap;
  font-size:var(--fs-sm); color:var(--muted); }
.pphero .pp-where .pin{ width:14px; height:14px; flex:0 0 14px; color:var(--brand2); display:inline-flex; }
.pphero .pp-where .pin svg{ width:100%; height:100%; display:block; }
.pphero .pp-where .cur{ color:var(--ink2); font-weight:var(--fw-semi); }
.pphero .pp-where .sep{ color:var(--line2); }

/* a small "K1 seal" parked top-right of the hero (brand, never data) */
.pphero .pp-seal{ position:absolute; top:var(--s4); right:var(--s4); width:46px; height:46px; opacity:.92; }
.pphero .pp-seal svg{ width:100%; height:100%; display:block; }
@media (max-width:480px){ .pphero .pp-seal{ display:none; } }

/* identity facts — variety / area / trees, each carrying its OWN certainty */
.ppfacts{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:var(--s3);
  padding:var(--s4) var(--s5); border-bottom:1px solid var(--line); }
.ppfact{ display:flex; flex-direction:column; gap:.28rem; }
.ppfact .fk{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:var(--fw-bold); }
.ppfact .fv{ font-size:var(--fs-lg); font-weight:var(--fw-bold); letter-spacing:-.01em; color:var(--ink); line-height:1.15; }
.ppfact .fv .num{ font-family:var(--mono); font-variant-numeric:tabular-nums; }
.ppfact .fv .u{ font-size:var(--fs-xs); color:var(--muted); font-weight:var(--fw-semi); margin-left:.15rem; }

/* ---- the credentials section ---- */
.ppsec{ padding:var(--s5); display:flex; flex-direction:column; gap:var(--s3); }
.ppsec + .ppsec{ border-top:1px solid var(--line); }
.ppsec .seclbl{ display:flex; align-items:center; gap:.5rem; }
.ppsec .seclbl .st{ font-size:var(--fs-2xs); text-transform:uppercase; letter-spacing:.1em;
  color:var(--muted); font-weight:var(--fw-bold); }
.ppsec .seclbl .ln{ flex:1; height:1px; background:var(--line); }

/* ============================================================
   GAP "SEAL" — verified cert reads as the SOLID, hard credential.
   It must visibly out-weigh the soft "owner-declared" chip below.
   ============================================================ */
.gapseal{ display:flex; align-items:center; gap:var(--s3);
  border:1px solid var(--pv-verified-ln); border-radius:var(--r);
  background:var(--pv-verified-bg);
  /* the verified "ring" material, echoed from the map cell-ring */
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--pv-verified) 28%, transparent);
  padding:.7rem .8rem; }
.gapseal .gsmark{ width:40px; height:40px; flex:0 0 40px; border-radius:50%; display:grid; place-items:center;
  background:var(--surface); color:var(--pv-verified); border:2px solid var(--pv-verified);
  filter:drop-shadow(0 0 2px color-mix(in srgb,var(--pv-verified) 45%, transparent)); }
.gapseal .gsmark .ic{ width:22px; height:22px; display:inline-flex; }
.gapseal .gsmark .ic svg{ width:100%; height:100%; display:block; }
.gapseal .gsmain{ flex:1; min-width:0; }
.gapseal .gsmain b{ display:block; font-size:var(--fs-md); color:var(--pv-verified); font-weight:var(--fw-bold); }
.gapseal .gsmain span{ display:block; font-size:var(--fs-xs); color:var(--ink2); margin-top:1px; line-height:1.4; }
.gapseal .gsmain .gsvalid{ color:var(--muted); }
.gapseal .gsmain .num{ font-family:var(--mono); font-variant-numeric:tabular-nums; color:var(--ink); font-weight:var(--fw-semi); }
.gapseal .gsval{ flex:0 0 auto; align-self:flex-start; }

/* secondary certs (organic / GI) as a tidy chip row — verified-grade */
.certrow{ display:flex; flex-wrap:wrap; gap:.45rem; }

/* ============================================================
   DECLARED CHIP — NEW honest-data tier, passport-scoped.
   "owner stated this" ≠ "platform verified" ≠ "official public".
   Neutral ground + ◆ glyph + dotted underline weight: on the record,
   but deliberately SOFTER than .pv.verified / .pv.official.
   ============================================================ */
.pv.declared{ background:var(--surface2); color:var(--ink2); border-color:var(--line2); border-style:dashed; }
.pv.declared .g{ color:var(--muted); }

/* a labelled "declared by owner" line under the variety, when shown big */
.declaredrow{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.declaredrow .dlab{ font-size:var(--fs-xs); color:var(--muted); }

/* ============================================================
   HONEST-DATA PROVENANCE LEDGER  — the brand's spine made visible.
   Each row = glyph + claim + what-it-means + its tier chip, so a
   buyer reads exactly "what is proven vs what is estimated."
   ============================================================ */
.provledger{ border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface); }
.provledger .pl-row{ display:grid; grid-template-columns:26px 1fr auto; gap:var(--s3); align-items:center;
  padding:.65rem var(--s4); border-top:1px solid var(--line); }
.provledger .pl-row:first-child{ border-top:0; }
.provledger .pl-g{ width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
  font-size:.95rem; font-weight:var(--fw-x); }
.provledger .pl-g.gv{ color:var(--pv-verified); background:var(--pv-verified-bg); border:1px solid var(--pv-verified-ln); }
.provledger .pl-g.gd{ color:var(--ink2); background:var(--surface2); border:1px solid var(--line2); }
.provledger .pl-g.ge{ color:var(--pv-est); background:var(--pv-est-bg); border:1px solid var(--pv-est-ln); }
.provledger .pl-g.gp{ color:var(--pv-private); background:var(--pv-private-bg); border:1px solid var(--pv-private-ln); }
.provledger .pl-main b{ display:block; font-size:var(--fs-sm); color:var(--ink); font-weight:var(--fw-semi); }
.provledger .pl-main span{ display:block; font-size:var(--fs-xs); color:var(--muted); margin-top:1px; line-height:1.4; }
@media (max-width:480px){
  .provledger .pl-row{ grid-template-columns:24px 1fr; }
  .provledger .pl-row .pv{ grid-column:2; justify-self:start; margin-top:.15rem; }
}

/* harvest band detail uses the LIVE .detail card; this only tightens its
   placement inside the sheet (no new look) */
.ppsec .detail{ margin-top:0; }

/* ============================================================
   CONTACT + SHARE SEAM  (the flywheel CTA)
   contact = ALWAYS via platform; never the owner's own channel.
   ============================================================ */
.ppcta{ display:flex; flex-direction:column; gap:var(--s3);
  border:1px solid var(--brand); border-radius:var(--r-lg);
  background:linear-gradient(100deg, var(--brand-soft), color-mix(in srgb,var(--brand-soft) 50%, var(--surface)));
  padding:var(--s5); }
.ppcta h3{ margin:0; font-size:var(--fs-lg); font-weight:var(--fw-bold); color:var(--brand-ink); letter-spacing:-.01em; }
.ppcta p{ margin:0; font-size:var(--fs-sm); color:var(--brand2); line-height:1.45; }
.ppcta .ctabtns{ display:flex; gap:var(--s3); flex-wrap:wrap; }
.ppcta .ctabtns .btn{ flex:1 1 auto; }
.ppcta .viaplat{ display:flex; align-items:center; gap:.45rem; font-size:var(--fs-2xs); color:var(--brand2); }
.ppcta .viaplat .ic{ width:14px; height:14px; flex:0 0 14px; color:var(--pv-verified); display:inline-flex; }
.ppcta .viaplat .ic svg{ width:100%; height:100%; display:block; }

/* the share strip — LINE-first, then copy-link / OG preview */
.sharebar{ display:flex; gap:var(--s3); flex-wrap:wrap; }
.sharebar .btn{ flex:1 1 auto; justify-content:center; }
.sharebar .btn .ic{ width:18px; height:18px; flex:0 0 18px; display:inline-flex; }
.sharebar .btn .ic svg{ width:100%; height:100%; display:block; }

/* tiny passport footer: as-of + privacy floor line */
.ppfoot{ display:flex; flex-direction:column; gap:.35rem; align-items:center; text-align:center;
  padding:var(--s2) var(--s3) 0; font-size:var(--fs-2xs); color:var(--muted); }
.ppfoot .asof{ display:flex; align-items:center; gap:.4rem; font-family:var(--mono); }
.ppfoot .asof .dot{ width:7px; height:7px; border-radius:50%; background:var(--pv-verified); }
.ppfoot .privacy{ display:flex; align-items:center; gap:.4rem; max-width:48ch; line-height:1.45; }
.ppfoot .privacy .ic{ width:13px; height:13px; flex:0 0 13px; color:var(--pv-private); display:inline-flex; }
.ppfoot .privacy .ic svg{ width:100%; height:100%; display:block; }

/* ============================================================
   STATE · NOT-CONSENTED TEASER  (the passport simply doesn't exist
   yet — the owner hasn't opened it). For an owner viewing their own,
   an opt-in invite appears.
   ============================================================ */
.teaser{ width:min(460px,100%); text-align:center; border:1.5px dashed var(--line2);
  border-radius:var(--r-lg); background:var(--surface2); padding:var(--s6) var(--s5); align-self:center;
  display:flex; flex-direction:column; align-items:center; gap:var(--s3); }
.teaser .tmk{ width:54px; height:54px; opacity:.5; }
.teaser .tmk svg{ width:100%; height:100%; display:block; }
.teaser .tlock{ display:inline-flex; align-items:center; gap:.4rem; font-size:var(--fs-2xs); font-weight:var(--fw-bold);
  text-transform:uppercase; letter-spacing:.06em; color:var(--pv-private);
  background:var(--pv-private-bg); border:1px solid var(--pv-private-ln); border-radius:var(--r-pill); padding:.16rem .6rem; }
.teaser h2{ margin:0; font-size:var(--fs-xl); font-weight:var(--fw-x); letter-spacing:-.01em; }
.teaser p{ margin:0; color:var(--muted); font-size:var(--fs-sm); max-width:42ch; line-height:1.5; }
/* the owner-only opt-in invite (degrades away for non-owners) */
.optin{ width:100%; margin-top:var(--s2); border:1px solid var(--brand); border-radius:var(--r);
  background:var(--brand-soft); padding:var(--s4); text-align:left; display:flex; flex-direction:column; gap:var(--s3); }
.optin .oh{ display:flex; align-items:center; gap:.5rem; }
.optin .oh{ display:flex; align-items:center; gap:.5rem; }
.optin .ownerdot{ width:9px; height:9px; border-radius:50%; flex:0 0 9px; background:var(--brand); }
.optin .oh b{ font-size:var(--fs-md); color:var(--brand-ink); font-weight:var(--fw-bold); }
.optin .own{ font-size:var(--fs-2xs); color:var(--brand2); }
.optin p{ margin:0; color:var(--brand2); font-size:var(--fs-xs); line-height:1.5; }

/* ============================================================
   STATE · LOADING skeleton (reuses .skel)
   ============================================================ */
.ppskel{ width:min(640px,100%); display:flex; flex-direction:column; gap:var(--s4); }
.ppskel .skcard{ border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface);
  box-shadow:var(--sh-sm); padding:var(--s5); display:flex; flex-direction:column; gap:.8rem; }
.ppskel .sk{ height:14px; border-radius:7px; }
.ppskel .sk.h{ height:34px; width:62%; } .ppskel .sk.w50{ width:50%; }
.ppskel .sk.w80{ width:80%; } .ppskel .sk.w35{ width:35%; }
.ppskel .skgrid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:var(--s3); }
.ppskel .skgrid .sk{ height:42px; }

/* ============================================================
   PASSPORT OG CARD  (the LINE share preview)
   Honest by construction: NO parcel polygon / coordinates — a
   tambon-level brand panel + variety + GAP seal + the K1 lockup.
   ============================================================ */
.ppog{ border:1px solid var(--line2); border-radius:var(--r); overflow:hidden; background:var(--surface); box-shadow:var(--sh-sm); }
.ppog .og-top{ position:relative; height:158px; padding:var(--s4);
  background:
    radial-gradient(120% 120% at 85% -10%, color-mix(in srgb,var(--brand-soft) 80%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, var(--surface2) 0 16px, var(--surface) 16px 32px);
  display:flex; flex-direction:column; justify-content:flex-end; gap:.3rem; }
.ppog .og-chip{ position:absolute; left:var(--s4); top:var(--s4); display:inline-flex; align-items:center; gap:.3rem;
  background:var(--surface); border:1px solid var(--line2); border-radius:var(--r-pill);
  font-size:var(--fs-2xs); font-weight:var(--fw-bold); padding:.14rem .55rem; color:var(--ink2); }
.ppog .og-seal{ position:absolute; right:var(--s4); top:var(--s4); width:74px; height:74px; transform:rotate(-7deg);
  filter:drop-shadow(0 4px 10px rgba(60,44,18,.26)); }
.ppog .og-seal svg{ width:100%; height:100%; display:block; }
.ppog .og-var{ font-size:var(--fs-2xl); font-weight:var(--fw-x); letter-spacing:-.02em; color:var(--ink); line-height:1; }
.ppog .og-where{ font-size:var(--fs-sm); color:var(--ink2); font-weight:var(--fw-semi); }
.ppog .og-body{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.7rem .8rem; border-top:1px solid var(--line); }
.ppog .og-lock{ display:flex; align-items:center; gap:8px; }
.ppog .og-lmk{ width:26px; height:26px; flex:0 0 26px; }
.ppog .og-lmk svg{ width:100%; height:100%; display:block; }
.ppog .og-wm{ display:flex; flex-direction:column; line-height:1; }
.ppog .og-wm b{ font-size:.9rem; font-weight:var(--fw-x); letter-spacing:-.01em; color:var(--ink); }
.ppog .og-wm span{ font-size:.5rem; letter-spacing:.2em; color:var(--muted); font-family:var(--mono); margin-top:3px; }
.ppog .og-band{ font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:var(--fs-xs); color:var(--pv-est); font-weight:var(--fw-bold); }

/* link-copy row inside the share sheet (reuses .linkrow idiom) */
.copied{ font-size:var(--fs-xs); color:var(--pv-verified); font-weight:var(--fw-bold); display:none; align-items:center; gap:.3rem; }
.copied.on{ display:inline-flex; }

/* a small toast for "shared / copied" feedback */
.pptoast{ position:fixed; left:50%; bottom:calc(18px + env(safe-area-inset-bottom)); transform:translateX(-50%) translateY(8px);
  background:var(--ink); color:var(--surface); font-size:var(--fs-sm); font-weight:var(--fw-semi);
  padding:.55rem .9rem; border-radius:var(--r-pill); box-shadow:var(--sh-lg); z-index:90;
  opacity:0; pointer-events:none; transition:opacity .16s, transform .16s; }
.pptoast.on{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- responsive ---- */
@media (max-width:480px){
  .ppstage{ padding:var(--s3) var(--s3) var(--s7); }
  .pphero{ padding:var(--s4); }
  .pphero .pp-label{ font-size:var(--fs-xl); }
  .ppfacts,.ppsec{ padding:var(--s4); }
  .ppcta{ padding:var(--s4); }
}
@media (pointer:coarse){
  .ppcta .btn, .sharebar .btn, .optin .btn{ min-height:44px; }
}
