/* Kua Farmers App — styles.
   Godwin's rules: white background, green and gold text, flat modern
   buttons, no arrows. Primary green is a diagonal gradient from his deep
   shade rgb(9, 43, 29) to Pantone 343 C #115740; gold is a gradient too
   (#c9971c to #e8b93b). The Kua logo itself is unchanged. */
:root {
  --green-950: #06231a;
  --green-900: #0a2e20;
  --green-850: #0d3826;
  --green-800: #11402c;
  --green-700: #175734;
  --green-600: #1e7046;
  --green-500: #2c8a58;
  --green-100: #dcefe2;
  --green-50: #eef6ef;
  --green: #115740;
  --green-dark: #092b1d;
  --green-grad: linear-gradient(135deg, #092b1d 0%, #115740 100%);
  --green-grad-btn: linear-gradient(90deg, #092b1d 0%, #115740 100%);
  --gold-grad: linear-gradient(90deg, #c9971c 0%, #e8b93b 100%);
  --green-soft: #0d3826;
  --green-pale: #eef6ef;
  --gold: #c9971c;
  --gold-bright: #e8b93b;
  --gold-soft: #faf1d7;
  --gold-text: #8a6508;
  --ink: #12291c;
  --ink-soft: #4c6154;
  --ink-faint: #7d9184;
  --muted: #4c6154;
  --line: #e2ece1;
  --bg: #ffffff;
  --bg-soft: #f6faf4;
  --card: #ffffff;
  --red: #c0392b;
  --red-soft: #fbeae7;
  --danger: #c0392b;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(10,46,32,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #e9f1e7;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app-shell { max-width: 470px; margin: 0 auto; min-height: 100dvh; background: #fff; box-shadow: 0 0 60px rgba(10,46,32,.18); }
h1, h2, h3 { color: var(--green); margin: 0; }
h2.screen-title { font-size: 1.5rem; margin: 4px 0 12px; }
.screen-sub { color: var(--muted); margin: -6px 0 14px; }
.gold { color: var(--gold); }
.green { color: var(--green); }
.center { text-align: center; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.screen { padding: 0 18px 110px; }
button { font-family: inherit; }

/* ---- buttons: flat, no shadows, no arrows ---- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  min-height: 50px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background: var(--green-pale);
  color: var(--green);
}
.btn-primary { background: var(--green-grad-btn); color: #fff; }
.btn-gold { background: var(--gold-grad); color: #000; }
.btn-ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--red-soft); color: var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-small { padding: 8px 12px; font-size: .9rem; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---- inputs ---- */
.input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  margin: 4px 0 12px;
}
.input:focus { outline: 2px solid var(--green); border-color: var(--green); }
textarea.input { resize: vertical; }
.field-label { display: block; font-weight: 700; color: var(--green); font-size: .95rem; margin-top: 6px; }
.field-hint { color: var(--muted); font-size: .85rem; margin: -6px 0 12px; }
.optional { font-weight: 400; color: var(--muted); }
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; min-width: 0; }
.form-error { color: var(--danger); font-weight: 700; margin: 0 0 10px; }
.fineprint { color: var(--muted); font-size: .85rem; }
/* ---- sign-up footer: feature tiles, exactly as the prototype ---- */
.ob-free { text-align: center; margin-top: 12px; font-size: .72rem; color: #4c6154; }
.ob-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.ob-feats div { background: #f6faf4; border: 1px solid #e2ece1; border-radius: 14px; padding: 11px 12px; font-size: .8rem; font-weight: 700; color: var(--green); }
.ob-feats span { display: block; color: #4c6154; font-weight: 600; font-size: .74rem; margin-top: 2px; }
.ob-policies { margin-top: 14px; }
.ob-policies a { color: var(--green); font-weight: 700; }

/* ---- onboarding ---- */
.onboard-wrap { padding: 28px 20px 96px; text-align: center; }
.onboard-wrap form { text-align: left; margin-top: 8px; }
.onboard-logo { width: 104px; height: 104px; border-radius: 26px; display: block; margin: 8px auto 12px; }
.onboard-title { font-size: 1.65rem; font-weight: 800; }
.onboard-sub { color: var(--muted); margin: 4px 0 18px; font-size: 1.1rem; }
.onboard-types-title { font-size: 1.15rem; font-weight: 800; margin: 18px 0 2px; text-align: left; }
.onboard-types-sub { color: var(--muted); font-size: .95rem; margin: 0 0 4px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.type-card {
  position: relative;
  border: 2px solid #e2ece1;
  border-radius: 18px;
  background: #fff;
  padding: 15px;
  min-height: 78px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.type-card.selected { border-color: var(--green); background: #eef6ef; }
.type-card::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #e2ece1;
  background: #fff;
}
.type-card.selected::after {
  content: "✓";
  background: var(--green-grad-btn);
  border-color: #115740;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.type-ico { width: 30px; height: 30px; color: var(--green); }
.type-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.type-name { font-weight: 800; color: var(--green); font-size: 1.05rem; }
.type-desc { color: var(--muted); font-size: .85rem; }
.logo-upload { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 12px; }
.logo-preview { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; border: 1.5px solid var(--line); background: #fff; flex-shrink: 0; overflow: hidden; }
.logo-preview--empty { display: flex; align-items: center; justify-content: center; background: var(--green-pale); color: var(--muted); font-weight: 700; font-size: .78rem; text-align: center; padding: 6px; }

/* ---- header ---- */
.app-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 20;
}
.hdr-titles { flex: 1; min-width: 0; }
.hdr-greet { display: block; font-size: .8rem; color: #7d9184; }
.hdr-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 800; color: var(--green); font-size: 1.02rem; line-height: 1.25; }
/* Narrow phones: the "Offline ready" pill drops to a second row so a
   long farmer name has the full width and never truncates. */
@media (max-width: 400px) {
  .app-header { flex-wrap: wrap; }
  .hdr-offline { order: 4; flex-basis: 100%; max-width: calc(100% - 56px); margin-left: 56px; }
  .ob-feats { grid-template-columns: 1fr; grid-auto-rows: 1fr; }
}
.hdr-avatar {
  width: 46px; height: 46px; border-radius: 14px; border: 2px solid #c9971c;
  background: var(--green-grad-btn); color: #fff; font-weight: 800; font-size: 1.1rem;
  cursor: pointer; overflow: hidden; padding: 0; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.hdr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hdr-offline { display: inline-flex; align-items: center; gap: 6px; background: #eef6ef; color: #175734; font-size: .72rem; font-weight: 700; padding: 8px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.hdr-offline-dot { width: 7px; height: 7px; border-radius: 50%; background: #2c8a58; flex-shrink: 0; }
.hdr-bell { position: relative; width: 46px; height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--green); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; }
.hdr-bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hdr-bell-dot { position: absolute; top: 9px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: #e8b93b; border: 2px solid #fff; }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-eyebrow {
  margin: 0 0 8px; font-size: .8rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
}
.card-sub { color: var(--muted); margin: -2px 0 10px; font-size: .95rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head .card-eyebrow { margin-bottom: 0; }
.weather-card { background: var(--green-grad); color: #fff; border-color: #115740; border-radius: 24px; padding: 20px; position: relative; overflow: hidden; }
.weather-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 88% 0%, rgba(232, 185, 59, .35), rgba(232, 185, 59, 0) 55%); pointer-events: none; }
.weather-card > * { position: relative; }
.weather-top { display: flex; justify-content: space-between; gap: 12px; }
.weather-place { font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #e8b93b; margin: 0; }
.weather-date { margin: 6px 0 0; color: #bcd6c4; font-size: .85rem; }
.weather-temp-row { display: flex; align-items: flex-end; gap: 12px; }
.weather-temp { font-size: 3rem; font-weight: 800; margin: 6px 0 0; line-height: 1.1; }
.weather-cond { margin: 0 0 10px; font-size: .7rem; font-weight: 700; color: #eaf5ec; }
.weather-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.weather-chip { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 700; color: #fff; }
.weather-ico { width: 44px; height: 44px; color: var(--gold); flex-shrink: 0; }
.weather-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sample-note { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.weather-card .sample-note { color: #a9c4b2; }
.weather-forecast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.weather-day { min-width: 0; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 10px 6px; text-align: center; }
.weather-day-name { font-weight: 800; font-size: .85rem; color: #fff; margin: 0; overflow-wrap: break-word; }
.weather-day-temp { font-weight: 800; color: var(--gold); margin: 3px 0 0; overflow-wrap: break-word; }
.weather-day-rain, .weather-day-cond { font-size: .8rem; color: #cfe0d4; margin: 2px 0 0; white-space: nowrap; }
.weather-day-cond { line-height: 1.25; }
/* Forecast stays a 3-column row at every width — Godwin (Dec 3):
   the stacked single-column layout made the weather card too long
   on his 360px phone. Labels stay on one line via nowrap below,
   with a slightly smaller size at ≤360px so they fit. */
@media (max-width: 360px) {
  .weather-day { padding: 10px 4px; }
  .weather-day-rain, .weather-day-cond { font-size: .72rem; }
}
.weather-updated { font-size: .8rem; color: #a9c4b2; margin: 10px 0 0; }
.weather-credit { font-size: .8rem; color: #a9c4b2; margin: 4px 0 0; }
.weather-credit a { color: var(--gold); }
.price-list { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.price-row:last-child { border-bottom: 0; padding-bottom: 0; }
.price-name { font-weight: 700; color: var(--green); }
.price-val { font-weight: 800; color: var(--ink); }
.price-unit { color: var(--muted); font-size: .85rem; font-weight: 400; }
.market-chip { background: #eef6ef; color: #175734; font-size: .74rem; font-weight: 700; padding: 4px 10px; white-space: nowrap; }
.money-row { display: flex; gap: 10px; margin-bottom: 14px; }
.money-cell { flex: 1; margin-bottom: 0; padding: 12px; text-align: center; }
.money-label { margin: 0; color: #7d9184; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.money-value { margin: 2px 0 0; font-size: 1.02rem; font-weight: 800; color: var(--ink); }
.money-value.green { color: var(--green); }
.money-value.gold { color: var(--gold); }
/* With a fourth "Owed to you" cell the money strip becomes two rows
   of two on a phone, so no cell is ever squeezed or cut off. */
.money-row.has-owed { flex-wrap: wrap; }
.money-row.has-owed .money-cell { flex: 1 1 40%; }
.money-row.has-owed .money-value { font-size: .9rem; }
.money-cell-owed { cursor: pointer; }
.money-cell-dark { background: var(--green-grad); border-color: #115740; }
.money-cell-dark .money-label { color: #e8b93b; }
.money-cell-dark .money-value { color: #fff; }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quick-action { min-height: 78px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; cursor: pointer; font-family: inherit; font-size: .8rem; font-weight: 700; color: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.quick-action > span:last-child { white-space: nowrap; }
.quick-action-gold { background: var(--gold-grad); border-color: #c9971c; color: #fff; }
.quick-action-ico { width: 22px; height: 22px; }
.quick-action-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.farm-tiles-title { margin: 2px 0 10px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.farm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.farm-tile { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; text-align: left; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 6px 24px rgba(10, 46, 32, .08); }
.farm-tile-value { font-size: 1.05rem; font-weight: 800; color: var(--green); }
.farm-tile-sub { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- lists ---- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
#remindersCard { scroll-margin-top: 76px; }
.reminder-done { opacity: .45; }
.reminder-done .reminder-title { text-decoration: line-through; }
.list-cards { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.row-card {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px; background: #fff; cursor: pointer; width: 100%;
  text-align: left; font-size: 1rem; font-family: inherit; color: var(--ink);
  display: block;
}
.row-card:hover { border-color: var(--green); }
.row-title { font-weight: 800; color: var(--green); margin: 0 0 2px; }
.row-sub { color: var(--muted); margin: 0; font-size: .92rem; }
.row-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-block; background: var(--green-pale); color: var(--green);
  border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 700;
}
.pill-gold { background: var(--gold-soft); color: #7a5f0e; }
.pill-red { background: #fbeeea; color: var(--danger); }
.empty-note { color: var(--muted); padding: 8px 0; }
.low-badge {
  display: inline-block; background: #fbeae7; color: #c0392b;
  border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 800;
}
.low-banner {
  background: #faf1d7; color: #8a6508; border-radius: var(--radius);
  padding: 12px 14px; font-weight: 700; margin-bottom: 14px;
}
/* Ready for market: same gold notice as the low-stock banner. */
.ready-banner { background: var(--gold-soft); color: var(--gold-text); border-radius: 14px; padding: 12px 14px; font-weight: 700; margin: 8px 0 12px; }
.low-bar { height: 7px; border-radius: 999px; background: var(--gold-grad); margin: 2px 0 8px; }
.low-bar-zero { background: #c0392b; }
.plan-note { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.qty-stepper { display: inline-flex; align-items: center; gap: 8px; }
.qty-stepper button {
  width: 32px; height: 32px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; font-size: 1.1rem; font-weight: 800; color: var(--green); cursor: pointer; line-height: 1;
}
.qty-val { font-weight: 800; min-width: 64px; text-align: center; white-space: nowrap; font-size: .95rem; }

/* ---- segmented tabs ---- */
.seg { display: flex; gap: 6px; background: var(--green-pale); border-radius: 12px; padding: 5px; margin-bottom: 14px; }
.seg-btn {
  flex: 1; border: 0; background: transparent; color: var(--green);
  font-weight: 700; font-size: .95rem; padding: 9px 4px; border-radius: 9px; cursor: pointer;
}
.seg-btn.active { background: var(--green-grad-btn); color: #fff; }

/* ---- payment choice (Paid now / On credit) ---- */
.pay-choice { display: flex; gap: 6px; background: var(--green-pale); border-radius: 12px; padding: 5px; margin-bottom: 6px; }
.pay-choice-btn { flex: 1; border: 0; background: transparent; color: var(--green); font-weight: 700; font-size: .95rem; padding: 9px 4px; border-radius: 9px; cursor: pointer; font-family: inherit; min-height: 44px; }
.pay-choice-btn.is-active { background: var(--green-grad-btn); color: #fff; }

/* ---- tab bar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 470px; background: #fff;
  border-top: 1px solid var(--line);
  display: flex; padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .68rem; font-weight: 700; padding: 4px 2px; min-height: 52px;
}
.tab.active { background: var(--green-grad-btn); color: #fff; border-radius: 999px; }
.tab-ico { width: 24px; height: 24px; }
.tab-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- profile ---- */
.profile-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.profile-logo { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; border: 2px solid #c9971c; background: #fff; flex-shrink: 0; overflow: hidden; }
.profile-logo--initials { display: flex; align-items: center; justify-content: center; background: var(--green-pale); color: var(--green); font-weight: 800; font-size: 1.6rem; }
.profile-card > div { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; color: var(--green); font-size: 1.15rem; margin: 0; }
.profile-farm { margin: 0; font-weight: 700; }
.profile-meta { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.profile-types { font-weight: 700; color: var(--green); margin: 0 0 8px; }
.profile-types-chip { display: inline-block; background: #eef6ef; color: var(--green); border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 700; margin: 12px 0 0; width: max-content; max-width: 100%; }
.plan-card { border-color: var(--gold); background: var(--green-grad); color: #fff; }
.plan-card .card-eyebrow { color: #e8b93b; }
.plan-name { font-size: 1.2rem; font-weight: 800; color: var(--green); margin: 0 0 4px; }
.plan-card .plan-name { color: #fff; }
.plan-desc { margin: 0 0 12px; color: var(--muted); }
.plan-card .plan-desc { color: #bcd6c4; }
.plan-progress { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; margin: 0 0 12px; }
.plan-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c9971c, #e8b93b); }

.settings-list { display: flex; flex-direction: column; }
.settings-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 2px; cursor: pointer; font-family: inherit; color: var(--ink); }
a.settings-row { text-decoration: none; }
.settings-row:last-child { border-bottom: 0; }
.settings-text strong { display: block; font-weight: 800; color: var(--green); font-size: 1rem; }
.settings-sub { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }

/* ---- sheets (bottom sheets) ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(6, 35, 26, .55); z-index: 40;
}
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 470px; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  z-index: 50; box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
}
.sheet h3 { font-size: 1.25rem; margin-bottom: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h3 { margin-bottom: 0; }
.sheet-text { color: var(--ink); }

/* Upgrade sheet: Monthly / Yearly choice */
.plan-choice { display: flex; gap: 8px; margin: 12px 0 4px; }
.plan-choice-btn { flex: 1; background: #fff; color: var(--green); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 6px; font-size: .95rem; font-weight: 700; cursor: pointer; }
.plan-choice-btn span { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.plan-choice-btn.is-active { border-color: var(--gold); background: var(--gold-soft); }
/* ---- upgrade sheet tier list: Free / Pro / Commercial ---- */
.tier-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.tier-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; }
.tier-row.is-current { border-color: var(--gold); background: var(--gold-soft); }
.tier-name { font-weight: 800; color: var(--green); }
.tier-desc { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.tier-tag { flex: none; font-size: .75rem; font-weight: 800; color: #000; background: var(--gold-grad); border-radius: 999px; padding: 4px 10px; }
.tier-rec { flex: none; font-size: .75rem; font-weight: 800; color: var(--green); background: #e3f0e8; border: 1.5px solid var(--green); border-radius: 999px; padding: 4px 10px; }
#trialBtn { margin-top: 14px; }
.invoice-total { font-size: 1.1rem; color: var(--green); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { color: var(--green); }
.qr-wrap { text-align: center; padding: 10px 0; }
.qr-wrap img { width: 150px; height: 150px; }
.qr-tag { font-weight: 800; color: var(--green); letter-spacing: .05em; }
.subhead { font-weight: 800; color: var(--green); margin: 16px 0 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 8px 0 8px 18px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.timeline li:last-child { border-bottom: 0; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.photo-grid img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--line); }

/* ---- records rows: animal thumb, pond actions, crop note ---- */
.row-card--animal { display: flex; gap: 12px; align-items: flex-start; }
.rec-thumb { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid var(--line); }
.rec-thumb--initial { display: flex; align-items: center; justify-content: center; background: var(--green-pale); color: var(--green); font-weight: 800; font-size: 1.3rem; }
.rec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rec-body .row-title, .rec-body .row-sub { display: block; }
.row-actions { display: flex; gap: 8px; margin-top: 8px; }
.row-actions .btn { flex: 1; }
.row-note { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }

/* ---- animal detail: full-screen page (covers the tab bar) ---- */
.animal-detail-page { position: fixed; inset: 0; z-index: 35; background: #fff; overflow-y: auto; padding: 16px 18px 110px; }
.animal-detail-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.animal-detail-top h2 { font-size: 1.35rem; }
.detail-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 14px 0; background: #fff; }
.detail-card .subhead { margin-top: 0; }

/* ---- QR scanner: full-screen camera view ---- */
.scanner-view { position: fixed; inset: 0; z-index: 45; background: #06231a; color: #fff; display: flex; flex-direction: column; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
.scanner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.scanner-top h2 { color: #fff; font-size: 1.25rem; }
.scanner-top .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.scanner-frame-wrap { position: relative; flex: 1; min-height: 0; border-radius: 18px; overflow: hidden; background: #000; }
.scanner-frame-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; left: 50%; top: 50%; width: 230px; height: 230px; max-width: 72vw; max-height: 72vw; transform: translate(-50%, -50%); border: 3px solid #e8b93b; border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); }
.scanner-novideo { text-align: center; padding: 14px 8px 0; color: #fff; font-weight: 700; margin: 0; }
.scanner-status { text-align: center; font-weight: 800; margin: 16px 0 4px; }
.scanner-hint { text-align: center; color: #bcd6c4; margin: 0; font-size: .9rem; }
#scanQrBtn { margin-bottom: 14px; }

/* ---- QR print label: one label per animal, for the pen or cage ---- */
.qr-label { text-align: center; padding: 32px 16px; color: #14201a; background: #fff; }
.qr-label img { width: 260px; height: 260px; }
.qr-label-name { font-size: 1.6rem; font-weight: 800; color: #092b1d; margin: 16px 0 2px; }
.qr-label-tag { font-size: 1.1rem; font-weight: 700; color: #4c6154; margin: 0 0 4px; }
.qr-label-farm { font-size: 1.05rem; font-weight: 700; color: #092b1d; margin: 0 0 12px; }
.qr-label-hint { font-size: .9rem; color: #4c6154; margin: 0; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 104px; background: var(--green-grad-btn); color: #fff; font-weight: 700;
  padding: 12px 18px; border-radius: 13px; z-index: 60; max-width: 92vw; text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

/* ---- invoice print ---- */
.print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block; position: absolute; inset: 0; background: #fff; padding: 24px; }
}
.inv-doc { font-size: 15px; color: #14201a; }
.inv-doc h2 { font-size: 1.4rem; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.inv-head img { width: 54px; height: 54px; object-fit: contain; }
.inv-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.inv-table th, .inv-table td { border-bottom: 1px solid #ddd; padding: 8px 4px; text-align: left; }
.inv-table th { color: var(--green); }
.inv-total-row td { font-weight: 800; font-size: 1.1rem; }
.paid-stamp { display: inline-block; border: 2px solid var(--green); color: var(--green); border-radius: 8px; padding: 4px 12px; font-weight: 800; letter-spacing: .08em; }
