/* Egg Tracker – mobile-first, light & dark */
/* Local Yolkel – Roleystone. Palette sampled from the logo: cream, chocolate, yolk, sage/olive hills, tan. */
@font-face { font-family: 'Fraunces Yolkel'; src: url('../fonts/fraunces-display.woff') format('woff'); font-weight: 600 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f7eedb; --surface: #fffaf1; --surface-2: #eedfc3; --text: #3a2213; --muted: #6b5240; --line: #e2d0b0;
  --primary: #4a2a18; --on-primary: #fff6e6;
  --accent: #f2a20c; --accent-ink: #8a4a00; --accent-soft: #fbe3b0; --on-accent: #3a2213;
  --c-chicken: #e8950c; --c-quail: #7e8c45; --good: #4f6324; --good-fill: #8c9a4e; --bad: #a63f22; --bad-fill: #c0623a; --warn: #7f5700;
  --sage: #a09c64; --olive: #918b57; --tan: #e2c698;
  --shadow: 0 1px 2px rgba(74, 42, 24, .07), 0 4px 14px rgba(74, 42, 24, .08);
  --radius: 18px; --tap: 48px;
  --font-head: 'Fraunces Yolkel', 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1e140d; --surface: #2b1e15; --surface-2: #3a2a1e; --text: #f6ebd7; --muted: #cdb89c; --line: #4a382a;
  --primary: #f5b23a; --on-primary: #2a170b;
  --accent: #f5b23a; --accent-ink: #ffc764; --accent-soft: #4a3214; --on-accent: #2a170b;
  --c-chicken: #f5b23a; --c-quail: #a4b36a; --good: #b9c77e; --good-fill: #9aaa5c; --bad: #f2906e; --bad-fill: #d4734b; --warn: #f0c060;
  --sage: #5d5a37; --olive: #4c4a2c; --tan: #5a4430;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e140d; --surface: #2b1e15; --surface-2: #3a2a1e; --text: #f6ebd7; --muted: #cdb89c; --line: #4a382a;
    --primary: #f5b23a; --on-primary: #2a170b;
    --accent: #f5b23a; --accent-ink: #ffc764; --accent-soft: #4a3214; --on-accent: #2a170b;
    --c-chicken: #f5b23a; --c-quail: #a4b36a; --good: #b9c77e; --good-fill: #9aaa5c; --bad: #f2906e; --bad-fill: #d4734b; --warn: #f0c060;
    --sage: #5d5a37; --olive: #4c4a2c; --tan: #5a4430;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 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(--text);
  font: 16px/1.45 var(--font-body);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  padding-bottom: calc(76px + var(--safe-b));
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; }
h4 { font-family: var(--font-body); }
h3 { font-size: 1.05rem; margin-bottom: .6rem; }
h4 { font-size: .95rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.pos { color: var(--good); } .neg { color: var(--bad); }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  --hills: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 30' preserveAspectRatio='none'%3E%3Cpath d='M0 30V18C40 6 80 4 130 14s90 14 140 2 90-12 130 2V30Z'/%3E%3C/svg%3E");
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem;
  padding: calc(.7rem + var(--safe-t)) 1rem .7rem; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin-left: auto; font-size: 1.05rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

main { padding: .8rem 1rem 1.5rem; max-width: 640px; margin: 0 auto; outline: none; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  box-shadow: 0 -4px 16px rgba(0,0,0,.05);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent-ink); }
.tabbar a.active svg { fill: var(--accent-soft); }
.tabbar a.active span { font-weight: 800; }

/* Cards & sections */
.card { background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin: .8rem 0; }
.card.empty { text-align: center; }
.card.empty p { color: var(--muted); }
section { margin: .4rem 0; }
.section-h { display: flex; align-items: center; justify-content: space-between; font-size: 1.05rem; margin: 1.2rem .2rem .6rem; }
.pill { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 650; }
.pill.light { background: rgba(255,255,255,.35); color: inherit; margin-left: .3rem; }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 6px; font-size: .7rem; font-weight: 700; vertical-align: middle; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.st-active { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.st-broody { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--warn); }
.st-moulting { background: color-mix(in srgb, var(--c-quail) 22%, transparent); color: var(--good); }
.st-sold { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.st-deceased { background: var(--surface-2); color: var(--muted); }
.demo-banner { background: repeating-linear-gradient(45deg, var(--accent-soft), var(--accent-soft) 10px, transparent 10px, transparent 20px), var(--surface); border: 1.5px dashed var(--accent); color: var(--accent-ink); border-radius: 12px; padding: .5rem .8rem; font-size: .85rem; font-weight: 650; margin-bottom: .6rem; }
.hint { margin: .2rem .2rem 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: .6rem 1.1rem;
  border-radius: 14px; border: 1.5px solid transparent; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--text); transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.outline { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn.ghost { background: var(--surface-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--bad); margin-right: auto; padding-left: .4rem; padding-right: .4rem; }
.btn.small { min-height: 40px; padding: .4rem .8rem; font-size: .9rem; }
.btn.block { display: flex; width: 100%; margin: .8rem 0; }
.btn.xl { min-height: 60px; font-size: 1.15rem; border-radius: 18px; }
.btn-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.btn-col { display: grid; gap: .6rem; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.icon-btn.lg { min-width: 52px; min-height: 52px; font-size: 1.8rem; background: var(--surface); box-shadow: var(--shadow); }
.icon-btn:disabled { opacity: .3; }
.fab-wrap { position: fixed; right: 1rem; bottom: calc(76px + var(--safe-b)); z-index: 25; }
.fab { min-height: 56px; padding: 0 1.3rem; border: 0; border-radius: 28px; background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 750; font-size: 1rem; box-shadow: 0 6px 20px rgba(74, 42, 24, .35); cursor: pointer; }
.fab:active { transform: scale(.96); }
[data-view="birds"] { padding-bottom: 5rem; }
.back { display: inline-block; padding: .4rem 0 .2rem; text-decoration: none; font-weight: 650; min-height: 40px; }

/* Day bar & hero */
.daybar { display: flex; align-items: center; gap: .6rem; }
.daypick { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; }
.daypick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.daypick-main { font-weight: 750; font-size: 1.05rem; }
.daypick-sub { font-size: .8rem; color: var(--muted); }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; background: linear-gradient(135deg, #f2a20c 0%, #f7c25c 100%); color: #3a2213; }
.hero::after { content: ''; position: absolute; left: -10%; right: -10%; bottom: -1px; height: 34px; background: rgba(126, 140, 69, .35); -webkit-mask: var(--hills) bottom / 100% 100% no-repeat; mask: var(--hills) bottom / 100% 100% no-repeat; pointer-events: none; }
.hero-num { font-family: var(--font-head); font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-label { font-weight: 650; }
.hero-split { display: grid; gap: .3rem; font-weight: 750; font-size: 1.15rem; text-align: right; }
.hero-flock { grid-column: 1 / -1; color: #4a2a18; margin-top: .3rem; position: relative; z-index: 1; font-weight: 600; }

/* Quick-log tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.tile { position: relative; }
.tile-main {
  width: 100%; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  padding: .7rem .4rem; border: 2px solid transparent; border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); font: inherit; cursor: pointer; transition: transform .08s ease, border-color .2s;
}
.tile-main:active { transform: scale(.95); }
.tile.laid .tile-main { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.tile.dim .tile-main { opacity: .72; }
.tile-name { font-weight: 700; font-size: .95rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font-size: .72rem; color: var(--muted); min-height: 1.1em; }
.tile-count { font-weight: 800; font-size: 1rem; color: var(--accent-ink); font-family: var(--font-head); }
.tile-minus { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }

/* Avatars */
.avatar { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--surface-2); font-weight: 800; font-size: 1.2rem; overflow: visible; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar i { position: absolute; right: -5px; bottom: -5px; font-style: normal; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface), var(--shadow); overflow: hidden; background: var(--surface); }
.avatar i .sp-ico { width: 100%; height: 100%; margin: 0; }
.avatar.sp-chicken { background: color-mix(in srgb, var(--c-chicken) 25%, var(--surface)); color: #6b3a00; }
.avatar.sp-quail { background: color-mix(in srgb, var(--c-quail) 28%, var(--surface)); color: #3d4a17; }
:root[data-theme="dark"] .avatar.sp-chicken { color: var(--c-chicken); } :root[data-theme="dark"] .avatar.sp-quail { color: var(--c-quail); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar.sp-chicken { color: var(--c-chicken); } :root:not([data-theme="light"]) .avatar.sp-quail { color: var(--c-quail); } }
.avatar.flock { background: var(--surface-2); font-size: 1.4rem; }
.avatar.sm { width: 38px; height: 38px; font-size: 1rem; } .avatar.sm i { display: none; }
.avatar.xl { width: 88px; height: 88px; font-size: 2.2rem; } .avatar.xl i { width: 32px; height: 32px; }
.avatar.xxl { width: 96px; height: 96px; font-size: 2.4rem; } .avatar.xxl i { width: 36px; height: 36px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 64px; padding: .6rem .9rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; color: inherit; text-decoration: none; }
.row-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { flex: none; text-align: right; font-weight: 650; }
.row-icon { font-size: 1.5rem; width: 38px; text-align: center; flex: none; }

/* Segmented controls & chips */
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; margin: .5rem 0; }
.seg[data-wrap] { flex-wrap: wrap; }
.seg label { flex: 1 1 auto; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 .6rem; border-radius: 10px; font-weight: 650; font-size: .92rem; color: var(--muted); cursor: pointer; white-space: nowrap; text-align: center; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.chips, .presets { display: flex; flex-wrap: wrap; gap: .45rem; }
.presets { flex-wrap: nowrap; overflow-x: auto; padding: .2rem .1rem .5rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.presets::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; scroll-snap-align: start; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip input:focus-visible + span { outline: 2px solid var(--accent-ink); }
.chip.big span { min-height: 46px; }
.chips.cat { display: grid; grid-template-columns: 1fr 1fr; } .chips.cat .chip span { width: 100%; }
.chip-btn { min-height: 40px; padding: 0 .8rem; border-radius: 999px; border: 1.5px dashed var(--muted); background: transparent; color: var(--text); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; }
.helpers { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
form[data-species="chicken"] .helpers[data-for="quail"], form[data-species="quail"] .helpers[data-for="chicken"] { display: none; }

/* Forms */
.field { display: block; margin: .9rem 0; }
.field > span { display: block; font-weight: 650; font-size: .9rem; margin-bottom: .35rem; }
.field small { display: block; color: var(--muted); margin-top: .3rem; font-size: .8rem; }
.input { width: 100%; min-height: var(--tap); padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 70px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
input[type="date"].input { display: block; -webkit-appearance: none; }
.mt { margin-top: .5rem; }
.money-input { position: relative; } .money-input span { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money-input .input { padding-left: 1.8rem; font-size: 1.3rem; font-weight: 700; }
.stepper { display: grid; grid-template-columns: 60px 1fr 60px; gap: .5rem; }
.step-btn { min-height: 56px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.8rem; font-weight: 600; cursor: pointer; }
.step-btn:active { background: var(--accent-soft); }
.step-input { text-align: center; font-size: 1.5rem; font-weight: 800; min-height: 56px; }
.row-inline { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; margin-top: 1rem; }
.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.numkey { min-height: 60px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.4rem; font-weight: 800; cursor: pointer; }
.numkey:active { background: var(--accent); }
.photo-pick { display: flex; align-items: center; gap: 1rem; }
.photo-btns { display: grid; gap: .4rem; }
.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; } .custom-range .field { margin: .3rem 0; }

/* Sheets & dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 12, 4, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.overlay.show { background: rgba(20, 12, 4, .45); }
.overlay.center { align-items: center; padding: 1rem; }
.sheet { width: 100%; max-width: 640px; max-height: calc(100dvh - 24px - var(--safe-t)); display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.2); }
.overlay.show .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .4rem .6rem .2rem 1.1rem; }
.sheet-head h2 { font-size: 1.15rem; }
.sheet-body { overflow-y: auto; padding: 0 1.1rem 1rem; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: .6rem; justify-content: flex-end; padding: .7rem 1rem calc(.7rem + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .btn.primary { min-width: 120px; }
.dialog { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 1.2rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); transform: scale(.95); opacity: 0; transition: .18s; }
.overlay.show .dialog { transform: none; opacity: 1; }
.dialog h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.dialog p { color: var(--muted); margin: .4rem 0 1rem; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* Toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(84px + var(--safe-b)); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 1rem; }
.toast { display: flex; align-items: center; gap: .8rem; max-width: 520px; padding: .5rem .5rem .5rem 1rem; min-height: 48px; border-radius: 14px; background: #3a2213; color: #fff6e6; box-shadow: 0 8px 24px rgba(0,0,0,.3); pointer-events: auto; transform: translateY(20px); opacity: 0; transition: .2s; font-weight: 600; }
.toast.show { transform: none; opacity: 1; }
.toast-btn { min-height: 38px; padding: 0 .9rem; border: 0; border-radius: 10px; background: #f2a20c; color: #3a2213; font: inherit; font-weight: 750; cursor: pointer; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .6rem 0; }
.stats-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--surface); border-radius: 16px; padding: .75rem .85rem; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.stat b { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-grid.three .stat b { font-size: 1.1rem; }
.stat small { color: var(--muted); font-size: .78rem; }
.stat.accent { background: var(--accent-soft); }
.stat.good b { color: var(--good); } .stat.bad b { color: var(--bad); }
.range-label { margin: .2rem .2rem 0; }
.money-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .8rem 0; }

/* Charts */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.fill-chicken { fill: var(--c-chicken); background: var(--c-chicken); }
.fill-quail { fill: var(--c-quail); background: var(--c-quail); }
.fill-good { fill: var(--good-fill); background: var(--good-fill); }
.fill-bad { fill: var(--bad-fill); background: var(--bad-fill); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.legend { display: flex; gap: 1rem; justify-content: center; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.hbars { display: grid; gap: .6rem; }
.hbar-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .2rem; }
.hbar-track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; }
.leader { list-style: none; padding: 0; margin: 0; }
.leader li { display: flex; align-items: center; gap: .6rem; min-height: 56px; border-top: 1px solid var(--line); }
.leader li:first-child { border-top: 0; }
.rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.leader .row-end b { font-size: 1.2rem; }

/* Profile */
.profile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; }
.profile-name { font-size: 1.6rem; margin-bottom: .3rem; }
.info { margin: 0; display: grid; gap: .55rem; }
.info div { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem; }
.info dt { color: var(--muted); font-size: .9rem; } .info dd { margin: 0; font-weight: 600; }
.notes { white-space: normal; background: var(--surface-2); padding: .7rem; border-radius: 12px; }
.danger-zone { border: 1.5px solid color-mix(in srgb, var(--bad) 40%, transparent); }

@media (min-width: 560px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Local Yolkel brand ---------- */
:root { --hills: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 30' preserveAspectRatio='none'%3E%3Cpath d='M0 30V18C40 6 80 4 130 14s90 14 140 2 90-12 130 2V30Z'/%3E%3C/svg%3E"); }
.topbar { padding-bottom: 1rem; border-bottom: 0; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; pointer-events: none;
  background: linear-gradient(90deg, var(--olive), var(--sage) 55%, var(--tan));
  -webkit-mask: var(--hills) bottom / 100% 100% no-repeat; mask: var(--hills) bottom / 100% 100% no-repeat; opacity: .9; }
.brand { display: flex; align-items: center; gap: .45rem; text-decoration: none; min-height: 44px; }
.brand-badge { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), var(--shadow); transition: transform .25s; }
body[data-species="quail"] .brand-badge { transform: rotate(-4deg); }
.brand-word { height: 30px; width: auto; border-radius: 8px; mix-blend-mode: multiply; }
:root[data-theme="dark"] .brand-word { mix-blend-mode: normal; background: #f7eedb; padding: 2px 6px; height: 32px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-word { mix-blend-mode: normal; background: #f7eedb; padding: 2px 6px; height: 32px; } }
.tabbar { border-top: 0; box-shadow: 0 -2px 12px rgba(74, 42, 24, .08); }
.tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 13px; background: var(--surface);
  -webkit-mask: var(--hills) bottom / 100% 100% no-repeat; mask: var(--hills) bottom / 100% 100% no-repeat; }
.brand-banner { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); margin: .6rem 0; }
.brand-banner.sp-quail { aspect-ratio: 874 / 395; object-fit: cover; max-height: 190px; }
.sp-ico { width: 1.35em; height: 1.35em; border-radius: 50%; vertical-align: -.32em; object-fit: cover; flex: none; }
.sp-lbl { display: inline-flex; align-items: center; gap: .35em; }
.section-h .sp-lbl .sp-ico { width: 1.6em; height: 1.6em; }
.hero-split .sp-ico { width: 1.5em; height: 1.5em; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.badge-av { overflow: hidden; } .badge-av .sp-ico.full { width: 100%; height: 100%; }
.seg span .sp-lbl { gap: .3em; }

/* Sample egg thumbnails & swatches */
.egg-thumb { position: relative; display: inline-block; flex: none; width: 22px; height: 28px; vertical-align: middle;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #fff 0 8%, var(--egg, #f1e3c2) 30%, color-mix(in srgb, var(--egg, #f1e3c2) 75%, #5a3a1a) 100%);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.15); overflow: hidden; }
.egg-thumb.speckled { background: radial-gradient(circle at 30% 40%, #5a3a1a 0 6%, transparent 7%), radial-gradient(circle at 65% 30%, #4a2a18 0 7%, transparent 8%), radial-gradient(circle at 55% 70%, #5a3a1a 0 9%, transparent 10%), radial-gradient(circle at 25% 75%, #4a2a18 0 5%, transparent 6%), radial-gradient(circle at 75% 60%, #6b4a2a 0 5%, transparent 6%), radial-gradient(circle at 35% 30%, #fff 0 8%, var(--egg) 30%, color-mix(in srgb, var(--egg) 75%, #5a3a1a) 100%); }
.egg-thumb.photo { border-radius: 10px; width: 28px; height: 28px; background: var(--surface-2); }
.egg-thumb.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.egg-thumb.xs { width: 14px; height: 18px; vertical-align: -3px; margin-right: .2rem; }
.egg-thumb.sm.photo { width: 30px; height: 30px; }
.egg-thumb.tile { width: 22px; height: 28px; } .egg-thumb.tile.photo { width: 30px; height: 30px; border-radius: 8px; }
.egg-thumb.xl { width: 72px; height: 92px; } .egg-thumb.xl.photo { width: 88px; height: 88px; border-radius: 16px; }
.egg-thumb.xl.empty { display: grid; place-items: center; background: var(--surface-2); font-size: 2rem; box-shadow: inset 0 0 0 2px var(--line); }
.egg-thumb.sm.empty { visibility: hidden; }
.egg-thumb.profile { width: 60px; height: 76px; } .egg-thumb.profile.photo { width: 76px; height: 76px; border-radius: 16px; box-shadow: 0 0 0 3px var(--surface), var(--shadow); }
.tile-egg { position: absolute; top: 8px; left: 8px; line-height: 0; pointer-events: none; }
.row-egg { display: inline-block; margin-right: .45rem; vertical-align: middle; }
.row-end .row-egg + * { vertical-align: middle; }
.profile-pics { display: flex; align-items: flex-end; gap: .5rem; }
.pic-btn { display: inline-flex; flex-direction: column; align-items: center; gap: .2rem; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.pic-btn small { font-size: .7rem; font-weight: 700; }
.pic-btn.egg { margin-left: -14px; }
.profile { grid-template-columns: auto 1fr auto; }
.egg-fields { border: 1.5px solid var(--line); border-radius: 16px; padding: .4rem .9rem .2rem; margin: 1.2rem 0 .4rem; background: var(--surface); }
.egg-fields legend { font-family: var(--font-head); font-weight: 700; padding: 0 .3rem; }
.swatch-btn { display: inline-flex; align-items: center; gap: .35rem; border-style: solid; border-color: var(--line); text-transform: capitalize; }
.dot { display: inline-block; width: 14px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--egg); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.dot.speckled { background: radial-gradient(circle at 35% 40%, #4a2a18 0 12%, transparent 14%), radial-gradient(circle at 65% 65%, #4a2a18 0 12%, transparent 14%), var(--egg); }
.lightbox { flex-direction: column; background: rgba(20, 12, 4, .0); }
.lightbox.show { background: rgba(20, 12, 4, .88); }
.lightbox figure { margin: 0; max-width: 92vw; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 72vh; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox figcaption { color: #fff6e6; margin-top: .7rem; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.lb-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; color: #fff; background: rgba(255,255,255,.15); }

/* Carton credit */
.check { display: flex; align-items: flex-start; gap: .6rem; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.credit-box { background: color-mix(in srgb, var(--good-fill) 16%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--good-fill) 55%, transparent); border-radius: 14px; padding: .7rem .8rem; margin: .6rem 0; }
.sale-summary:not(:empty) { background: var(--surface); border-radius: 14px; padding: .6rem .8rem; box-shadow: var(--shadow); margin: .6rem 0; }
.sale-summary div { display: flex; justify-content: space-between; padding: .15rem 0; }
.sale-summary .net { border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .35rem; font-size: 1.05rem; }
.sale-summary .net b { font-family: var(--font-head); font-size: 1.2rem; }
.credit-pill { display: inline-block; padding: .2rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--good-fill) 25%, var(--surface)); color: var(--good); font-weight: 750; font-size: .85rem; }
.credit-text { color: var(--good); }
.credit-card { background: linear-gradient(160deg, color-mix(in srgb, var(--good-fill) 22%, var(--surface)), var(--surface)); }
.credit-balance { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: .6rem; }
.credit-balance span { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.credit-balance b { font-family: var(--font-head); font-size: 2.6rem; color: var(--good); line-height: 1.1; }
.credit-balance small { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.mini-stats div { background: var(--surface-2); border-radius: 12px; padding: .55rem .6rem; display: flex; flex-direction: column; }
.mini-stats b { font-family: var(--font-head); font-size: 1.2rem; }
.mini-stats span { font-size: .75rem; color: var(--muted); }
.credit-preview { background: var(--surface-2); border-radius: 12px; padding: .6rem .8rem; }
.carton-grid { display: grid; grid-template-columns: 1fr 96px 96px; gap: .45rem .5rem; align-items: center; }
.money-input.sm .input { font-size: 1rem; min-height: 44px; padding-left: 1.6rem; }
.money-input.sm span { left: .7rem; }
.btn-row.split { justify-content: space-between; margin: .6rem 0; }
.avatar.cust { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); color: var(--primary); font-family: var(--font-head); }
:root[data-theme="dark"] .avatar.cust { color: var(--accent-ink); }
.stats-grid.three .stat b { font-size: 1.15rem; }
.leader .row-end b, .stat b, .hero-num { font-variant-numeric: lining-nums tabular-nums; }
.cust-head .profile-name { font-size: 1.3rem; }
.mini-stats.four { grid-template-columns: 1fr 1fr; }

/* ---------- Customer register: sale lines, payments, customer list ---------- */
.lines { display: grid; gap: .55rem; }
.line { border: 1px solid var(--line); border-radius: 14px; padding: .55rem; background: var(--surface); display: grid; gap: .45rem; }
.line-top { display: grid; grid-template-columns: 1fr 44px; gap: .4rem; }
.line-top .icon-btn { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 700; }
.line-grid { display: grid; grid-template-columns: 1.25fr 1fr auto; gap: .45rem; align-items: center; }
.line-custom { display: grid; grid-template-columns: 1fr auto; gap: .45rem; align-items: center; }
.inline-num { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.inline-num .input { width: 64px; text-align: center; }
.stepper.sm { grid-template-columns: 40px 1fr 40px; gap: .3rem; }
.stepper.sm .step-btn, .stepper.sm .input { min-height: 44px; }
.stepper.sm .input { padding: 0 .2rem; text-align: center; font-size: 1.05rem; }
.line-sum { min-width: 4.4rem; text-align: right; font-variant-numeric: tabular-nums; }
.lines-total { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-top: .5rem; padding: .4rem .2rem 0; border-top: 1px dashed var(--line); }
.lines-total b { font-size: 1.15rem; margin-left: auto; }
.new-cust { display: grid; }
.mt { margin-top: .45rem; }
.unpaid-badge { display: block; margin-top: .2rem; background: color-mix(in srgb, var(--bad-fill) 22%, var(--surface)); color: var(--bad); text-transform: none; letter-spacing: 0; font-size: .75rem; white-space: nowrap; }
li.unpaid, li.hist.unpaid { background: color-mix(in srgb, var(--bad-fill) 7%, transparent); }
.pay-btn { margin: 0 .75rem .6rem auto; display: block; }
.owing { color: var(--bad); }
.owing-card { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.owing-card > div { display: grid; }
.owing-card span, .owing-strip span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.owing-card b { font-size: 1.5rem; font-family: var(--font-head); }
.owing-card small { color: var(--muted); }
.owing-card.has-owing b, .owing-strip.has-owing b { color: var(--bad); }
.owing-strip { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .5rem; margin: .5rem 0; padding: .65rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.owing-strip b { font-size: 1.15rem; grid-row: span 2; }
.owing-strip small { color: var(--muted); }
.input.search { margin: .6rem 0 .5rem; }
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .4rem 0; }
.list-meta .check { margin: 0; }
.row-end .credit-pill { display: block; margin-top: .2rem; font-size: .75rem; }
.contact { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-top: .25rem; }
.contact a { color: var(--accent-ink); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.prefs { margin: .2rem .25rem .6rem; color: var(--muted); }
.carton-grid.three { grid-template-columns: 1fr 80px 80px 80px; }
.carton-grid.three .money-input.sm .input { padding-left: 1.35rem; font-size: .95rem; }
.carton-grid.three .money-input.sm span { left: .5rem; }
.hbar-top a { color: inherit; text-decoration: none; }
.check.small { margin: .5rem .25rem; }
.cust-head .avatar.xxl { width: 64px; height: 64px; font-size: 1.8rem; align-self: start; }
.cust-head .profile-name { overflow-wrap: anywhere; }
.list-meta .check span { line-height: 1.3; }
