/* Public pages anyone can open without an account: grievances, the payment
   ledger, a spice pack's origin, a farmer's receipt and the buyer data room.
   One canopy header with the contour motif, then cards that overlap it. */

.pubhead { background: var(--canopy); color: var(--on-canopy); --contour: rgba(240, 178, 58, .14);
  padding: 22px 16px 58px; padding-top: max(22px, env(safe-area-inset-top)); }
.pubhead .in { max-width: 560px; margin: 0 auto; }
.pubhead.wide .in { max-width: 1100px; }
.pubhead .brand { display: inline-flex; align-items: center; gap: 10px; font: 650 15px/1 var(--display); color: var(--on-canopy-muted); text-decoration: none; }
.pubhead .brand img { width: 28px; height: 28px; }
.pubhead .eyebrow { margin-top: 26px; color: var(--gold); }
.pubhead h1 { color: #fff; font-size: clamp(28px, 6vw, 42px); letter-spacing: -.03em; margin: 18px 0 8px; text-wrap: balance; }
.pubhead .eyebrow + h1 { margin-top: 6px; }
.pubhead p { margin: 0; color: var(--on-canopy-muted); font-size: 15px; max-width: 52ch; }
.pubhead p + p { margin-top: 8px; }
.pubhead p b { color: var(--gold); font-weight: 650; }
.pubhead p:empty { display: none; }
.pubhead .headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.pubhead .headrow > div { flex: 1 1 420px; min-width: 0; }

main.pub { max-width: 560px; margin: -36px auto 0; padding: 0 16px 32px; position: relative; }
main.pub.wide { max-width: 1100px; }
.pub .card + .card, .pub .card + .stats, .pub .stats + .card { margin-top: 14px; }
.pub h2 { font-size: 20px; }
.pub .card > .eyebrow { margin-bottom: 6px; }
.pub .empty.card { padding: 28px 18px; }
.pubfoot { text-align: center; color: var(--muted); font-size: 13px; margin: 22px 0 0; }
.pubfoot a { font-weight: 600; }

/* Big figures: a row of tiles, the first one on canopy. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.stat span { display: block; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font: 650 26px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat b .muted { font: 500 14px/1.3 var(--body); letter-spacing: 0; }
.stat small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.stat.lead { background: var(--canopy); border-color: transparent; color: var(--on-canopy); }
.stat.lead span, .stat.lead small, .stat.lead b .muted { color: var(--on-canopy-muted); }
.stat.lead b { color: var(--gold); }

/* A short promise or privacy line with a tick or shield. */
.promises { list-style: none; margin: 0 0 4px; padding: 0 0 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--line-2); }
.promises li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.promises li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--accent-soft)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7c52' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.privacy { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); font-size: 13.5px; color: var(--ink); margin-bottom: 12px; }
.privacy .ico { color: var(--accent); width: 20px; height: 20px; margin-top: 1px; }
.privacy p { margin: 0; }
.samplebar { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); font-size: 13.5px; margin-bottom: 12px; }
.samplebar b { color: var(--gold-ink); }
.samplebar .ico { color: var(--gold-ink); width: 20px; height: 20px; margin-top: 1px; }

/* Grievance form */
.pub #msg:empty, .pub #status:empty { display: none; }
.pub #status { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 14.5px; }
.pub .checkrow { display: flex; gap: 8px; }
.pub .checkrow input { flex: 1; min-width: 0; margin: 0; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.pub .checkrow input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--body); }
.pub .checkrow .btn { margin: 0; }
.pub footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* Payment ledger: amounts line up; milestones and crops break down underneath. */
.pub td.num, .pub th.num { text-align: right; white-space: nowrap; }
.pub td small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.45; white-space: normal; }
.pub td.num small { max-width: 34ch; margin-left: auto; }
.pub td small.ms { white-space: nowrap; }
.pub td .place { display: block; color: var(--muted); font-size: 13px; }
.breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 28px; }
.breakdown h3 { font-size: 13px !important; font-family: var(--body); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px !important; }
.breakdown .ledger { margin: 0; }
.breakdown .ledger small { display: block; grid-column: 1 / -1; margin: -2px 0 4px; color: var(--muted); font-size: 12.5px; }
.breakdown .ledger small .muted, .breakdown .ledger b .muted { font-size: inherit; }
.stamp { font-size: 12.5px; text-align: center; margin: 16px 0 0; }
/* On a phone the village table reads as one card per row. */
@media (max-width: 640px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack tr:first-child:has(th) { display: none; }
  table.stack tr { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; text-align: left; white-space: normal; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 550; padding-top: 1px; }
  table.stack td.lead { order: -1; grid-template-columns: 1fr; gap: 2px; font-size: 16px; padding-bottom: 6px; }
  table.stack td.lead::before { display: none; }
  table.stack td.num { text-align: left; }
  table.stack tr:hover td { background: none; }
}

/* Spice origin: lot, journey, payment. */
.lothead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lothead .tag { background: var(--bg); padding: 5px 8px; border-radius: 8px; }
.lotcrop { font-size: 28px !important; letter-spacing: -.025em; margin: 12px 0 6px !important; }
.places { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 8px; }
.places li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.places li .ico { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-ink); }
.places li span { flex: 1; min-width: 0; }
.places li small { display: block; color: var(--muted); font-size: 12.5px; }
.places li b { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
ol.journey { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 0; }
ol.journey li { position: relative; padding: 0 0 14px 26px; font-size: 14px; }
ol.journey li:last-child { padding-bottom: 0; }
ol.journey li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
ol.journey li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 2px; width: 2px; background: var(--line); }
ol.journey li:last-child::after { display: none; }
ol.journey b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.paidcard .bigfig { font: 650 38px/1.05 var(--display); letter-spacing: -.03em; color: var(--accent); margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.paidcard .bigsub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.minis div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.minis b { display: block; font: 650 18px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.minis span { font-size: 12.5px; color: var(--muted); }
.paidbar { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 2px 0 6px; }
.paidbar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.sharenote { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); margin-top: 14px; }
.sharenote b { flex: none; font: 650 22px/1 var(--display); letter-spacing: -.02em; color: var(--gold-ink); white-space: nowrap; }
.sharenote span { font-size: 13.5px; color: var(--ink); }

/* Receipt: a paper slip with a torn edge between the amount and the details. */
.slip { padding: 0; overflow: hidden; }
.slip .top { padding: 18px 18px 20px; }
.slip .who { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.slip .kind { margin: 16px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slip .amount { font: 650 40px/1.05 var(--display); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.slip .tear { height: 18px; position: relative; background:
  radial-gradient(circle at 0 50%, var(--bg) 9px, transparent 9.5px) left / 18px 18px no-repeat,
  radial-gradient(circle at 100% 50%, var(--bg) 9px, transparent 9.5px) right / 18px 18px no-repeat; }
.slip .tear::after { content: ''; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed var(--line); }
.slip .rest { padding: 6px 18px 18px; }
.slip .kv { font-size: 14.5px; gap: 10px 18px; }
.slip .rest p.muted { margin: 16px 0 0; font-size: 13.5px; }
.stage .ico { width: 12px; height: 12px; margin-right: 3px; }

/* Data room */
.pubhead #dl { flex: none; }
.pubhead .btn.gold:hover { filter: brightness(1.05); }
.pub .mapcard .map { height: 440px; border-radius: 12px; }
.pub .split3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.pub .split3 .card { margin: 0; }
.pub .card .kv + .kv { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.pub code.hash { display: inline-block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pub table td b { font-weight: 600; }
.pub td.pname { min-width: 200px; }
#invalid, .card.notice { text-align: center; padding: 30px 20px; }
#invalid h2, .notice h2 { font-size: 21px; }
#invalid p, .notice p { max-width: 46ch; margin: 0 auto; }
#invalid .ico, .notice .ico { width: 44px; height: 44px; padding: 11px; margin: 0 auto 12px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); }
@media (max-width: 640px) { .pub .mapcard .map { height: 340px; } .slip .amount { font-size: 34px; } }
