/* EggQueue — warm cream + yolk orange, forced light. External stylesheet only. */
:root {
  color-scheme: light;
  --bg: #FFFBF2;
  --card: #FFFFFF;
  --ink: #33261A;
  --dim: #7A6A58;
  --line: #F0E2CC;
  --brand: #EA580C;
  --brand-dark: #C2410C;
  --yolk: #F59E0B;
  --yolk-soft: #FEF3C7;
  --cream: #FFF7E8;
  --ok: #15803D;
  --bad: #B3261E;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }
.small { font-size: .85rem; color: var(--dim); }
.center { text-align: center; }
h2 { font-size: 1.3rem; margin: 4px 0 14px; }
h3 { margin: 0 0 8px; font-size: 1.05rem; }
p { line-height: 1.55; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FFF3D6 0%, #FFE3B3 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark img { border-radius: 11px; display: block; }
.brand h1 { font-size: 1.25rem; margin: 0; line-height: 1.1; }
.tagline { margin: 0; font-size: .8rem; color: var(--brand-dark); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.pro-badge { background: var(--yolk); color: #fff; font-weight: 800; font-size: .72rem; padding: 4px 9px; border-radius: 999px; letter-spacing: .05em; }
.demo-badge { background: var(--brand); color: #fff; font-weight: 800; font-size: .72rem; padding: 4px 9px; border-radius: 999px; letter-spacing: .05em; }

main { max-width: 680px; margin: 0 auto; padding: 16px 14px 8px; }
.screen { display: none; }
.screen.active { display: block; }

/* Cards & buttons */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(194, 120, 30, .06);
}
.card.today { border: 2px solid var(--yolk); background: #FFFEF9; }
.card.waiting { opacity: .92; }
.card.paused { opacity: .6; }
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: 11px 18px; border-radius: 12px; text-align: center;
  background: var(--cream); color: var(--ink);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-gold { background: var(--yolk); color: #fff; }
.btn-outline { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand-dark); }
.btn-danger { background: #FDECEA; color: var(--bad); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { display: block; width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex: 1 1 auto; }

/* Queue */
.onhand-card { text-align: center; }
.onhand-num { font-size: 2.6rem; font-weight: 800; color: var(--brand); line-height: 1; }
.onhand-form { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.onhand-form input { width: 110px; text-align: center; font-size: 1.1rem; padding: 9px; border: 1.5px solid var(--line); border-radius: 10px; }
.queue-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.queue-head h3 { margin: 0; }
.q-meta { font-size: .85rem; color: var(--dim); }
.q-name { font-size: 1.05rem; font-weight: 700; }
.badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.badge-cadence { background: var(--yolk-soft); color: #92400E; }
.badge-new { background: #DCFCE7; color: var(--ok); }
.badge-skip { background: #F3F4F6; color: var(--dim); }
.owed-line { color: var(--bad); font-weight: 700; font-size: .9rem; }
.ok-line { color: var(--ok); font-weight: 600; font-size: .9rem; }

/* Forms */
.field { margin: 12px 0; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 64px; resize: vertical; }
.check { display: flex; gap: 9px; align-items: center; margin: 10px 0; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.form-error { color: var(--bad); font-size: .9rem; margin: 8px 0; }

/* Lists / stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat-num { font-size: 1.7rem; font-weight: 800; color: var(--brand); line-height: 1.15; }
.stat-lbl { font-size: .8rem; color: var(--dim); font-weight: 600; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { color: var(--dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.tbl-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--dim); padding: 26px 12px; line-height: 1.6; }
.trial-banner { background: var(--yolk-soft); border: 1px solid var(--yolk); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; }
.sync-error { background: #FDECEA; color: var(--bad); padding: 10px 16px; font-size: .9rem; text-align: center; }
.hero { text-align: left; }
.hero-emoji { font-size: 2.6rem; }
.hero h2 { font-size: 1.5rem; line-height: 1.25; }
.plan-card { border: 2px solid var(--line); }
.plan-card.best { border-color: var(--yolk); }
.plan-price { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details summary { font-weight: 700; cursor: pointer; }
.guide-img { font-size: 1.6rem; }

/* Carton label */
.carton-label {
  border: 2.5px dashed var(--brand); border-radius: 14px; padding: 18px 14px;
  text-align: center; background: #fff; max-width: 420px; margin: 12px auto;
}
.carton-label .cl-farm { font-size: 1.35rem; font-weight: 800; }
.carton-label .cl-big { font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; margin-top: 4px; }
.carton-label .cl-sub { font-size: .9rem; color: var(--dim); margin-top: 4px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; border: none; background: transparent; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 2px 7px; font-size: .68rem; font-weight: 600; color: var(--dim);
}
.nav-btn .nav-ico { font-size: 1.25rem; }
.nav-btn.active { color: var(--brand); }

/* Modal + toast */
#modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(51, 38, 26, .48);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
}
.modal-sheet h3 { font-size: 1.2rem; }
#toast-root { position: fixed; left: 0; right: 0; bottom: 92px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .92rem; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 92vw; text-align: center; }
.acct-tabs { display: flex; gap: 8px; margin-bottom: 6px; }
.acct-tab { flex: 1; padding: 9px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.acct-tab.active { background: var(--yolk-soft); border-color: var(--yolk); }

.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; inset: 0; padding: 24px; }
  .bottom-nav, .app-header { display: none; }
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .modal-backdrop { align-items: center; }
  .modal-sheet { border-radius: 20px; }
}
