@font-face { font-family: "Fraunces"; src: url(fonts/fraunces.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url(fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --forest: #0D2E0B;
  --forest-2: #1f4a1c;
  --blush: #F5BCB1;
  --blush-deep: #e89a8c;
  --petal: #FFF3F3;
  --paper: #ffffff;
  --ink: #0D2E0B;
  --muted: #5d6b5c;
  --line: #e9d6d2;
  --danger: #a3271b;
  --display: "Fraunces", Georgia, serif;
  --text: "Geist", -apple-system, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--petal); color: var(--ink);
  font: 16px/1.45 var(--text);
  padding-bottom: calc(76px + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
h2 { font: 600 1.35rem/1.2 var(--display); margin: 1.6rem 0 .5rem; }
h3 { font: 600 1.25rem/1.2 var(--display); margin: 0 0 .75rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .5rem 0 1rem; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* header */
.top {
  background: var(--forest); color: var(--petal);
  padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
.logo { height: 40px; width: auto; display: block; }
.top-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.booth-label { font: italic 400 .95rem var(--display); color: var(--blush); }
.booth-label b { font: 600 1.15rem var(--display); font-style: normal; color: var(--petal); margin-left: 4px; }
.sync-pill {
  border: 1px solid color-mix(in srgb, var(--blush) 60%, transparent); background: transparent; color: var(--blush);
  border-radius: 99px; font-size: .75rem; padding: 2px 10px; min-height: 26px;
}

/* totals */
.totals { background: var(--forest); color: var(--petal); padding: 4px 16px 16px; border-radius: 0 0 22px 22px; }
.totals .label { display: block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--petal) 70%, transparent); }
.today strong { font: 600 2.6rem/1.05 var(--display); color: var(--blush); display: block; }
.today .sub { font-size: .85rem; color: color-mix(in srgb, var(--petal) 80%, transparent); }
.market { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--petal) 18%, transparent); }
.market b { font: 600 1.1rem var(--display); }

.banner { margin: 12px 16px 0; background: #fde7c7; border: 1px solid #f0c27a; padding: 10px 12px; border-radius: 12px; font-size: .9rem; }

main { padding: 4px 16px 24px; max-width: 720px; margin: 0 auto; }

/* plant cards */
.plant { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 14px; margin-bottom: 10px; }
.plant.done { opacity: .62; }
.plant-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.plant-name { font: 600 1.05rem/1.25 var(--display); }
.plant-price { font-weight: 600; white-space: nowrap; }
.plant-left { font-size: .78rem; color: var(--muted); display: block; font-weight: 400; text-align: right; }
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.box {
  position: relative; min-height: 52px; border-radius: 12px; border: 1.5px solid #cfc1be; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
  font-size: .78rem; font-weight: 600; color: var(--muted);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: transform .08s ease, background .15s ease;
}
.box:active, .box.pressing { transform: scale(.94); }
.box.pressing { background: #f3ece9; }
.box .n { font-size: .7rem; opacity: .7; }
.box.sold { background: var(--forest); border-color: var(--forest); color: var(--petal); }
.box.sold.custom { background: var(--forest-2); }
.box.sold .tick, .box.got .tick { font-size: 1.05rem; }
.box.po { background: color-mix(in srgb, var(--blush) 45%, white); border: 1.5px dashed var(--blush-deep); color: #7d3a2f; }
.box.got { background: var(--blush); border: 1.5px solid var(--blush-deep); color: var(--forest); }
.box .amt { font-size: .68rem; font-weight: 500; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: 0 6px; border-radius: 6px; }
.chip.po { background: color-mix(in srgb, var(--blush) 45%, white); border: 1px dashed var(--blush-deep); color: #7d3a2f; }

/* days + records */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.day { display: flex; justify-content: space-between; align-items: center; }
.day b { font: 600 1.3rem var(--display); }
.rec { display: grid; grid-template-columns: 52px 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rec:last-child { border-bottom: 0; }
.rec time { color: var(--muted); font-variant-numeric: tabular-nums; }
.rec .note { grid-column: 2 / 4; color: var(--muted); font-size: .82rem; }
.rec.void, .rec.voided { color: var(--muted); }
.rec.voided .what { text-decoration: line-through; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blush-deep); margin-left: 6px; vertical-align: middle; }
.dot.ok { background: #6aa364; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }

/* edit */
.edit-row { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.edit-row input[type=text] { width: 100%; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.edit-grid label, dialog label { font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
input[type=text], input[type=number] {
  font: 16px var(--text); color: var(--ink); padding: 10px 12px; border-radius: 10px; border: 1.5px solid #d8c8c4; background: #fff; min-height: 44px; width: 100%;
}
input:focus { outline: 2px solid var(--forest); outline-offset: 1px; }
.stepper { display: flex; align-items: center; border: 1.5px solid #d8c8c4; border-radius: 10px; overflow: hidden; min-height: 44px; background: #fff; }
.stepper button { border: 0; background: transparent; width: 36px; min-height: 44px; font-size: 1.2rem; }
.stepper span { flex: 1; text-align: center; font-weight: 600; color: var(--ink); font-size: 1rem; }
.edit-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.edit-actions .btn { min-height: 38px; padding: 6px 12px; font-size: .85rem; }

/* buttons */
.btn { border: 1.5px solid var(--forest); background: #fff; color: var(--forest); border-radius: 12px; min-height: 48px; padding: 10px 16px; font-weight: 600; }
.btn.primary { background: var(--forest); color: var(--petal); }
.btn.primary:disabled { opacity: .5; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.wide { width: 100%; margin-top: 8px; }
.big { font: 600 1.25rem var(--display); margin: 0 0 4px; }

/* tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.tabs button { border: 0; background: transparent; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; color: var(--muted); border-radius: 12px; }
.tabs .ico { font-size: 1.25rem; line-height: 1; }
.tabs button[aria-current=page] { color: var(--forest); background: color-mix(in srgb, var(--blush) 30%, white); font-weight: 600; }

/* toast */
.toast {
  position: fixed; left: 12px; right: 12px; top: calc(8px + var(--safe-t)); z-index: 7;
  background: var(--blush); color: var(--forest); border-radius: 14px; padding: 10px 10px 10px 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 10px 30px rgba(13, 46, 11, .35); max-width: 560px; margin: 0 auto;
}
.toast button { background: var(--forest); color: var(--petal); border: 0; border-radius: 10px; font-weight: 600; min-height: 40px; padding: 0 14px; }

/* dialogs */
dialog { border: 0; border-radius: 20px; padding: 20px; width: min(92vw, 420px); background: var(--petal); color: var(--ink); }
dialog::backdrop { background: rgba(13, 46, 11, .45); }
dialog label { margin-bottom: 12px; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
dialog .row .btn { flex: 1; }
dialog .row.reverse { flex-direction: row-reverse; }
