/* Growfica — phone-first public site. Bottle green + danfo yellow for $G. */
:root {
  --bg: #F2F5F0; --surface: #FFFFFF; --surface-2: #E7EDE5;
  --ink: #10241B; --ink-2: #4B5F55; --ink-3: #6B7D73; --line: #D2DCD2;
  --brand: #0F5A40; --brand-ink: #FFFFFF; --brand-soft: #DDEBE2;
  --coin: #F2B705; --coin-ink: #2B2100;
  --hero-bg: #0F5A40; --hero-ink: #E4F2EA; --hero-num: #F7C531; --hero-card: #0C4A35;
  --ticket: #FFFDF5;
  --ok: #1D7A4E; --ok-bg: #DDF1E4; --warn: #8F5A00; --warn-bg: #FCEFCF;
  --bad: #A8261F; --bad-bg: #F9DEDB; --info: #1F5591; --info-bg: #DCE8F6; --mute-bg: #E4E8E4;
  --shadow: 0 1px 2px rgba(16,36,27,.06), 0 4px 14px rgba(16,36,27,.06);
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1611; --surface: #12211A; --surface-2: #192B22; --ink: #E5EFE8; --ink-2: #A0B4A9; --ink-3: #7F9388; --line: #273E33;
    --brand: #49C08C; --brand-ink: #062014; --brand-soft: #173A2B; --coin: #F5C52E; --coin-ink: #241B00;
    --hero-bg: #113727; --hero-ink: #DCEBE2; --hero-num: #F7CB3E; --hero-card: #0D2C1F; --ticket: #17271F;
    --ok: #63D69C; --ok-bg: #133524; --warn: #F0B54A; --warn-bg: #3A2C0D; --bad: #F08A80; --bad-bg: #3D1714;
    --info: #8DB8F0; --info-bg: #132A45; --mute-bg: #1E2C25;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* top bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: inherit; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.brand-tag { font-size: .72rem; color: var(--ink-3); line-height: 1.1; }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--ink-2); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.who { font-size: .8rem; color: var(--ink-3); }

/* page */
main { max-width: 1080px; margin: 0 auto; padding-block: 18px 64px; display: grid; gap: 18px; }
.view { display: grid; gap: 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 880px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 18px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; min-width: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.banner { border-radius: var(--r); padding: 12px 14px; background: var(--warn-bg); color: var(--warn); font-size: .9rem; }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner code { font-family: var(--font-mono); font-size: .85em; }

/* landing */
.hero { background: var(--hero-bg); color: var(--hero-ink); border-radius: 22px; padding: 28px 22px; display: grid; gap: 24px; position: relative; overflow: hidden; }
@media (min-width: 880px) { .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); padding: 44px; align-items: center; } }
.hero::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 28px solid color-mix(in srgb, var(--hero-num) 16%, transparent); pointer-events: none; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 6.5vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--hero-num); }
.hero-copy { display: grid; gap: 16px; align-content: start; position: relative; z-index: 1; }
.hero-copy p { font-size: 1.05rem; max-width: 34em; color: color-mix(in srgb, var(--hero-ink) 88%, transparent); }
.hero-stats { font-size: .85rem; color: color-mix(in srgb, var(--hero-ink) 75%, transparent); }
.rates { background: var(--hero-card); border-radius: 16px; padding: 18px; display: grid; gap: 10px; position: relative; z-index: 1; }
.rates .label { color: color-mix(in srgb, var(--hero-ink) 70%, transparent); }
.rate-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 8px; border-bottom: 1px dashed color-mix(in srgb, var(--hero-ink) 22%, transparent); }
.rate-row:last-of-type { border-bottom: 0; }
.rate-row b { font-family: var(--font-mono); color: var(--hero-num); font-size: 1.05rem; white-space: nowrap; }
.rate-row small { display: block; font-size: .78rem; color: color-mix(in srgb, var(--hero-ink) 65%, transparent); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step { display: grid; gap: 4px; align-content: start; }
.step b { font-family: var(--font-display); font-weight: 500; color: var(--brand); font-size: .95rem; }
.step span { font-size: .88rem; color: var(--ink-2); }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.faq p { margin-top: 8px; color: var(--ink-2); font-size: .92rem; }

/* wallet */
.wallet { background: var(--hero-bg); color: var(--hero-ink); border-radius: 18px; padding: 20px; display: grid; gap: 16px; position: relative; overflow: hidden; }
.wallet::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 22px solid color-mix(in srgb, var(--hero-num) 18%, transparent); pointer-events: none; }
.wallet .label { color: color-mix(in srgb, var(--hero-ink) 70%, transparent); }
.bal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bal-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 9vw, 3.1rem); line-height: 1; color: var(--hero-num); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bal-unit { font-family: var(--font-display); font-weight: 500; color: var(--hero-num); font-size: 1.1rem; }
.bal-ngn { font-family: var(--font-mono); font-size: 1rem; }
.wstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wstats div { display: grid; gap: 2px; }
.wstats b { font-family: var(--font-mono); font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; }
.rate-line { font-size: .8rem; color: color-mix(in srgb, var(--hero-ink) 75%, transparent); }

/* forms */
form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 460px) { .row2 { grid-template-columns: 1fr; } }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.pin { letter-spacing: .5em; font-family: var(--font-mono); }
.mat-rows { display: grid; gap: 8px; }
.mat-est { color: var(--ink-2) !important; font-weight: 600; }
.mat { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.mat strong { display: block; font-size: .95rem; }
.mat small { color: var(--ink-3); display: block; font-size: .78rem; line-height: 1.3; }
.mat .rate { font-family: var(--font-mono); font-size: .78rem; color: var(--brand); font-weight: 600; }
.mat input { text-align: right; font-family: var(--font-mono); background: var(--surface); }
.estimate { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: .9rem; }
.estimate b { font-family: var(--font-mono); }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.auth { max-width: 460px; width: 100%; margin: 0 auto; }
.tabs.sm { gap: 4px; }
.tabs.sm button { flex: none; padding: 6px 12px; min-height: 36px; font-size: .82rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

/* leaderboard */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.lb-row.me { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.lb-pos { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lb-1 .lb-pos { background: var(--coin); color: var(--coin-ink); }
.lb-2 .lb-pos, .lb-3 .lb-pos { background: var(--brand); color: var(--brand-ink); }
.lb-name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.lb-name small { display: block; font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.lb-kg { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .95rem; white-space: nowrap; }
.w-rank { font-weight: 600; color: var(--hero-num); font-size: .9rem; position: relative; z-index: 1; }

/* buttons */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; min-height: 44px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: var(--brand-ink); text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.coin { background: var(--coin); color: var(--coin-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.hero .btn.ghost { color: var(--hero-ink); border-color: color-mix(in srgb, var(--hero-ink) 35%, transparent); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* lists */
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface); min-width: 0; }
.item-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.item-h .t { font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--mute-bg); color: var(--ink-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.empty { border: 1.5px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--ink-2); font-size: .9rem; }
.track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.track div { display: grid; gap: 4px; font-size: .7rem; color: var(--ink-3); }
.track div::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); }
.track div.on { color: var(--ink); font-weight: 600; }
.track div.on::before { background: var(--brand); }

/* scale ticket */
.ticket { background: var(--ticket); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-family: var(--font-mono); font-size: .82rem; display: grid; gap: 6px; position: relative; font-variant-numeric: tabular-nums; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); transform: translateY(-50%); }
.ticket::before { left: -8px; } .ticket::after { right: -8px; }
.tk-h { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; flex-wrap: wrap; }
.tk-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.tk-line span:nth-child(2), .tk-line span:nth-child(3) { text-align: right; }
.tk-rule { border-top: 1.5px dashed var(--line); }
.tk-total { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; gap: 8px; flex-wrap: wrap; }
.tk-total .g { color: var(--brand); }

/* kpis + tables */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; }
.kpi b { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--ink-3); font-size: .78rem; }
.kpi.hl { background: var(--warn-bg); border-color: transparent; }
.kpi.hl b { color: var(--warn); }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
td.n, th.n { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: 0; }
td input { min-height: 36px; padding: 4px 8px; }
details > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-3); font-size: 1.1rem; }
details[open] > summary::after { content: "–"; }

/* sheet + toast */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(6,18,12,.5); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .scrim { align-items: center; } }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px max(18px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
@media (min-width: 640px) { .sheet { border-radius: 18px; } }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
.copy { font-family: var(--font-mono); font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.copy button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; font-size: .7rem; padding: 2px 6px; cursor: pointer; }
footer { max-width: 1080px; margin: 0 auto; padding-block: 0 40px; font-size: .8rem; color: var(--ink-3); display: flex; gap: 8px 18px; flex-wrap: wrap; }
