/* B-Cubed Bakery Ops — tablet first (10–11" upright), fine on phones and laptops. */
:root {
  --flour: #faf6ef;
  --card: #ffffff;
  --ink: #2b211a;
  --ink-2: #6b5a4c;
  --line: #e7dccb;
  --line-2: #d6c7b1;
  --crust: #8a4b24;
  --crust-2: #a95f30;
  --crust-tint: #f6e9dc;
  --night: #3b2a1e;
  --warn: #8a5a00;
  --warn-tint: #fdf1d8;
  --bad: #a1271b;
  --bad-tint: #fbe7e4;
  --good: #2f6b3a;
  --radius: 12px;
  --tap: 48px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--flour); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45; }
a { color: var(--crust); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .1rem 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
.center { text-align: center; }
.eyebrow { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.eyebrow a { color: inherit; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .5rem max(1rem, env(safe-area-inset-left)); background: var(--night); color: #f3e8da; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--crust-2);
  color: #fff; font-weight: 800; letter-spacing: -.02em; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; order: 3; width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; color: #e9dccb; text-decoration: none; padding: .55rem .85rem; border-radius: 999px; min-height: 40px;
  display: inline-flex; align-items: center; font-weight: 500; }
.tabs a.on { background: #fff; color: var(--night); font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: #d8c8b4; }
.who .link { color: #fff; }
@media (min-width: 1100px) { .tabs { order: 0; width: auto; } }

.page { max-width: 980px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-left)) 3rem; }
.foot { text-align: center; color: var(--ink-2); font-size: .8rem; padding: 1rem 0 2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: .5rem 0 1rem; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 460px; margin: 2rem auto; }
.coming ol { margin: 0; padding-left: 1.2rem; } .coming li { margin: .35rem 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: 0 1.1rem;
  border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--crust); }
.btn-primary { background: var(--crust); border-color: var(--crust); color: #fff; }
.btn-primary:hover { background: var(--crust-2); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-small { min-height: 38px; padding: 0 .75rem; font-size: .9rem; }
.btn-big { min-height: 56px; font-size: 1.05rem; width: 100%; }
button.link { background: none; border: 0; padding: .4rem; font: inherit; text-decoration: underline; cursor: pointer; }
.savebar { position: sticky; bottom: 0; display: flex; gap: .75rem; padding: .75rem 0; background: linear-gradient(transparent, var(--flour) 30%); z-index: 5; }
.savebar .btn-big { width: auto; flex: 1; }

/* forms */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--line-2);
  border-radius: 10px; padding: .6rem .75rem; min-height: var(--tap); width: 100%; }
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #e9b98f; outline-offset: 1px; border-color: var(--crust); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #fbf8f3; color: var(--ink); opacity: 1; }
label.check { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; min-height: var(--tap); }
label.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--crust); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.grid .span2 { grid-column: 1 / -1; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.pair { display: flex; gap: .5rem; } .pair input { flex: 1; } .pair select { width: 7.5rem; flex: none; }
.hint { font-weight: 400; font-size: .82rem; color: var(--ink-2); }
.field-error { color: var(--bad); font-weight: 600; font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; align-items: center; }
.inline-form .grow, .filters .grow { flex: 1 1 14rem; }
.inline-form input, .inline-form select { width: auto; }
.inline-form .short { width: 6rem; }
form.inline { display: inline; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } }
.choice { border: 1px solid var(--line-2); border-radius: 10px; padding: .75rem .8rem; cursor: pointer; font-weight: 400; position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice strong { font-size: .95rem; } .choice span { font-size: .82rem; color: var(--ink-2); }
.choice.on { border-color: var(--crust); background: var(--crust-tint); box-shadow: inset 0 0 0 1px var(--crust); }
details.advanced, details.history { margin-top: 1rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--crust); min-height: 40px; display: flex; align-items: center; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.filters select { width: auto; flex: 0 1 auto; }
.filters label.check { background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 .8rem; }

/* lists of rows */
.group { margin-bottom: 1.2rem; }
.group-head { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 1rem 0 .4rem; }
.group-head .count { background: var(--line); color: var(--ink-2); border-radius: 999px; padding: .05rem .5rem; margin-left: .3rem; font-size: .75rem; }
ul.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.flush ul.rows { border: 0; border-radius: 0; }
ul.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; min-height: 64px; color: var(--ink); text-decoration: none; }
.row:hover, .row:active { background: #fdfaf5; }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { font-size: .85rem; color: var(--ink-2); }
.row-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.row-qty { text-align: right; display: flex; flex-direction: column; align-items: flex-end; min-width: 7rem; }
.row-qty strong { font-size: 1.2rem; } .unit { color: var(--ink-2); font-size: .85rem; }
.loc-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; flex-wrap: wrap; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.row-actions form { display: flex; gap: .4rem; }
.row-actions .rename input { width: 11rem; min-height: 38px; padding: .3rem .6rem; }
.dim { opacity: .55; }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
ul.checklist { margin: .5rem 0 0; padding-left: 1.1rem; } ul.checklist li { margin: .35rem 0; }

/* pills */
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: var(--crust-tint); color: var(--crust); vertical-align: middle; }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-quiet { background: #efe9e0; color: var(--ink-2); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; padding: .5rem .6rem; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.main td { background: #fdfaf5; }
.tbl-rows tbody tr { cursor: pointer; } .tbl-rows tbody tr:hover td { background: #fdfaf5; }
.tbl-rows td { padding: .8rem .9rem; } .tbl-rows th { padding: .6rem .9rem; }
.loc-tbl td:last-child, .loc-tbl th:last-child { width: 5rem; text-align: center; }
.loc-tbl input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--crust); }
.big-qty { font-size: 1.1rem; } .big-qty strong { font-size: 2rem; margin-right: .2rem; }
dl.facts { display: grid; grid-template-columns: 11rem 1fr; gap: .4rem 1rem; margin: 0; } dl.facts dt { color: var(--ink-2); } dl.facts dd { margin: 0; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 620px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
a.tile:hover { border-color: var(--crust); }
.tile-num { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.tile-label { font-weight: 600; } .tile-sub { font-size: .85rem; color: var(--ink-2); }
.tile-warn { border-color: #e2b46c; background: var(--warn-tint); }

/* flash */
.flash { background: #eef6ee; border: 1px solid #b9d8bd; color: var(--good); padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-error { background: var(--bad-tint); border-color: #f0b9b1; color: var(--bad); }

/* sign in */
body.door { background: radial-gradient(circle at 50% 0, #fff 0, var(--flour) 60%); }
.door-card { text-align: left; }
.door-mark { width: 56px; height: 56px; border-radius: 14px; background: var(--crust); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; margin-bottom: .5rem; }
.people { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.person { border: 1px solid var(--line-2); border-radius: 999px; padding: .6rem 1rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.person.on { background: var(--crust); color: #fff; border-color: var(--crust); }
.pin-display { text-align: center; font-size: 1.8rem; letter-spacing: .5rem; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.key { min-height: 64px; font-size: 1.5rem; font-weight: 600; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; }
.key:active { background: var(--crust-tint); }
.key-fn { font-size: 1rem; color: var(--ink-2); }
body { min-height: 100vh; }
@media (max-width: 620px) {
  .filters select, .filters label.check { flex: 1 1 calc(50% - .5rem); }
  .page-head .btn { width: 100%; }
}

/* ---------------------------------------------------------------- v0.2: counts and freezer */
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill-bad { background: var(--bad-tint); color: var(--bad); }
.progress { display: block; height: 6px; border-radius: 999px; background: var(--line); margin-top: .45rem; overflow: hidden; max-width: 22rem; }
.progress span { display: block; height: 100%; background: var(--crust); border-radius: 999px; }
.row-qty .btn { margin-top: .35rem; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .tiles-4 { grid-template-columns: 1fr 1fr; } }
.choices-2 { grid-template-columns: 1fr 1fr; }
.scope-choices { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .scope-choices { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .scope-choices, .choices-2 { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
ul.plain li.split { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.grow-form { flex: 1; display: flex; } .grow-form .btn-big { width: 100%; }
.savebar form { display: flex; }

/* the count screen: the top bar scrolls away, the location bar stays */
body.counting .topbar { position: static; }
.count-bar { position: sticky; top: 0; z-index: 9; background: var(--flour); padding: .5rem 0 .6rem; margin: 0 0 .5rem;
  border-bottom: 1px solid var(--line); }
.loc-chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .1rem; }
.loc-chips::-webkit-scrollbar { display: none; }
.loc-chips a { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: 0 .9rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.chip-n { font-weight: 500; color: var(--ink-2); font-size: .85rem; } .chip-n b { color: var(--crust); }
.count-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.count-tools input[type=search] { flex: 1 1 12rem; width: auto; min-height: 42px; }
.count-tools label.check { min-height: 42px; }
.sync { margin-left: auto; font-size: .85rem; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; }
.sync-ok { background: #eef6ee; color: var(--good); }
.sync-wait { background: var(--warn-tint); color: var(--warn); }
.sync-bad { background: var(--bad-tint); color: var(--bad); }
.loc-section { scroll-margin-top: 8.5rem; margin-bottom: 1.2rem; }
.loc-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 1rem 0 .5rem; }
.loc-head h2 { margin: 0; }
.loc-head .count { background: var(--line); color: var(--ink-2); border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; margin-left: .3rem; vertical-align: middle; }
ul.crows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.crow { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: var(--radius);
  padding: .7rem .8rem .75rem; scroll-margin-top: 9rem; }
.crow.is-done { border-left-color: var(--good); }
.crow.is-wait { border-left-color: #e2b46c; }
.crow.is-error { border-left-color: var(--bad); }
.crow:target { box-shadow: 0 0 0 3px #e9b98f; }
.crow-head { display: flex; gap: .6rem; align-items: flex-start; }
.crow-no { flex: none; min-width: 2rem; text-align: right; color: var(--ink-2); font-size: .85rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.crow-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.crow-state { flex: none; max-width: 45%; text-align: right; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.crow.is-done .crow-state { color: var(--good); }
.crow.is-wait .crow-state { color: var(--warn); }
.crow-ctrls { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: center; margin: .6rem 0 0 2.6rem; }
.crow-err { margin: .4rem 0 0 2.6rem; color: var(--bad); font-weight: 600; font-size: .88rem; }
.stepper { display: inline-flex; align-items: center; gap: .3rem; }
.stepper .step { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-size: 1.6rem;
  line-height: 1; font-weight: 600; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.stepper .step:active { background: var(--crust-tint); border-color: var(--crust); }
.stepper input { width: 4.4rem; text-align: center; font-size: 1.25rem; font-weight: 700; min-height: 52px; padding: .3rem; }
.step-lab { font-size: .85rem; color: var(--ink-2); min-width: 3.5rem; }
.seg { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.seg-lab { padding: 0 .6rem; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.seg label { display: block; font-weight: 600; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { display: grid; place-items: center; min-width: 52px; min-height: 52px; padding: 0 .6rem; border-left: 1px solid var(--line); font-size: 1.05rem; cursor: pointer; }
.seg input:checked + span { background: var(--crust); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #e9b98f; outline-offset: -3px; }
label.wt { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; color: var(--ink-2); }
label.wt input { width: 5rem; min-height: 52px; text-align: center; }
label.wt .pair { align-items: center; }
label.toggle { flex-direction: row; align-items: center; }
label.toggle input { position: absolute; opacity: 0; pointer-events: none; }
label.toggle span { display: inline-flex; align-items: center; min-height: 52px; padding: 0 1rem; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; }
label.toggle input:checked + span { background: var(--crust); border-color: var(--crust); color: #fff; }
label.toggle input:checked + span::before { content: "✓ "; white-space: pre; }
label.toggle input:focus-visible + span { outline: 3px solid #e9b98f; }
label.bags { flex: 1 1 16rem; font-weight: 500; color: var(--ink-2); }
label.bags input { min-height: 52px; font-size: 1.05rem; }
.bag-hint { font-size: .85rem; color: var(--ink); font-weight: 600; }
.crow-btns { margin-left: auto; display: flex; gap: .3rem; }
.crow-btns .btn { min-height: 44px; }
body.js .save-all { display: none; }
.seg input[value=""]:checked + span { background: #efe9e0; color: var(--ink); }
@media (max-width: 620px) {
  .head-actions { width: 100%; }
  .page-head .head-actions .btn { flex: 1 1 0; width: auto; padding: 0 .5rem; }
  .crow-head { flex-wrap: wrap; }
  .crow-state { flex-basis: 100%; max-width: none; text-align: left; padding-left: 2.6rem; }
  .crow-ctrls { margin-left: 0; }
  .crow-err { margin-left: 0; }
  .stepper .step { width: 48px; height: 48px; }
  .stepper input { width: 3.6rem; }
  .crow-btns { margin-left: 0; }
}

/* review */
.tbl.review td { vertical-align: middle; }
.tbl.review tr.gap td { background: var(--warn-tint); }
.tbl .loc-row-head th { background: #fdfaf5; color: var(--ink); font-size: .82rem; padding: .55rem .6rem; }
.tbl.review .unit { font-size: .8rem; }

/* add items */
.add-row { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; flex-wrap: wrap; }
.add-locs { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; }

/* freezer */
.frow .row { padding-bottom: .4rem; }
details.quick-log { padding: 0 1rem .6rem; }
details.quick-log summary { min-height: 34px; font-size: .9rem; }
details.quick-log .inline-form { margin-top: .3rem; }

/* ---------------------------------------------------------------- v0.3: recipes, menu, plan, need */
.plan-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .6rem; }
.tbl.plan { min-width: 700px; font-size: .9rem; }
.tbl.plan td, .tbl.plan th { padding: .4rem .4rem; }
.tbl.plan td:first-child, .tbl.plan th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 9.5rem;
  max-width: 11rem; box-shadow: 1px 0 0 var(--line); }
.tbl.plan .loc-row-head th { position: sticky; left: 0; }
.tbl.plan th.today, .tbl.plan td.today { background: var(--crust-tint); }
.tbl.plan td.est { background: var(--warn-tint); font-style: italic; }
.tbl.plan a.cell { display: block; color: var(--ink); text-decoration: none; min-height: 2rem; }
.frz { color: #2d5f8a; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; }
.slot { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.ratio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem; }
.menu-row, .match-row { padding: .7rem 1rem; }
.menu-row .row-title a { color: var(--ink); text-decoration: none; }
details.menu-edit summary { min-height: 30px; font-size: .9rem; }
.match-forms { display: flex; flex-direction: column; gap: .1rem; margin-top: .3rem; }
.match-forms .inline-form { margin-top: .3rem; }
details.need-row > summary { list-style: none; cursor: pointer; }
details.need-row > summary::-webkit-details-marker { display: none; }
details.need-row[open] > summary { background: #fdfaf5; }
.why { padding: .2rem 1rem .8rem; border-top: 1px dashed var(--line); }
.why p { margin: .35rem 0; }

/* ---------------------------------------------------------------- v0.4: cafe, prepared foods, packaging */
.view-tabs { display: flex; gap: .4rem; margin: 0 0 .8rem; flex-wrap: wrap; }
.view-tabs a { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  text-decoration: none; font-weight: 600; min-height: 42px; display: inline-flex; align-items: center; }
.view-tabs a.on { background: var(--night); color: #fff; border-color: var(--night); }
.forecast-card { padding: .8rem 1rem; }
.link-row { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.link-row:last-of-type { border-bottom: 0; }
.link-row .inline-form select { max-width: 22rem; }
.per-label { align-self: center; color: var(--muted, #6b5a4e); }

/* ---------- v0.5: shopping list, store routes, look-ahead ---------- */
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.shop-vendor h2 { margin-bottom: .1rem; }
.vendor-head { align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.block-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: .9rem 0 .2rem; }
.shop-rows { list-style: none; margin: 0; padding: 0; min-height: .6rem; }
.shop-row { display: flex; align-items: flex-start; gap: .6rem; border-top: 1px solid var(--line); padding: .55rem 0; background: var(--card); }
.shop-row:first-child { border-top: 0; }
.shop-row .shop-why { flex: 1; min-width: 0; }
.shop-row summary { display: flex; justify-content: space-between; gap: .8rem; cursor: pointer; list-style: none; }
.shop-row summary::-webkit-details-marker { display: none; }
.shop-row .row-main { display: flex; flex-direction: column; min-width: 0; }
.shop-row .row-title { font-weight: 600; }
.shop-row .row-sub { font-size: .85rem; color: var(--ink-2); }
.shop-row .row-qty { text-align: right; white-space: nowrap; }
.shop-row.done .row-title, .shop-row.done .row-qty strong { text-decoration: line-through; color: var(--ink-2); }
.shop-row.waiting .row-title { color: var(--ink-2); }
.tick { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--line-2); background: #fff; font-size: 1.3rem; font-weight: 700; color: var(--good); cursor: pointer; flex: none; }
.tick.on { background: #eef6ee; border-color: #b9d8bd; }
.drag { flex: none; width: 28px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: grab; touch-action: none; user-select: none; font-size: 1.2rem; }
.shop-row.dragging { opacity: .85; box-shadow: 0 4px 14px rgba(0,0,0,.15); border-radius: 8px; position: relative; z-index: 5; }
.why-facts { display: grid; grid-template-columns: 8.5rem 1fr; gap: .25rem .8rem; font-size: .88rem; margin: .5rem 0; }
.why-facts dt { color: var(--ink-2); font-weight: 600; }
.why-facts dd { margin: 0; }
.waiting-block > summary { cursor: pointer; }
.route-row { align-items: center; }
.route-row .row-main { flex: 1; }
.route-place, .route-step { margin: 0; }
.route-place select { max-width: 12rem; }
.route-sections li { padding: .3rem 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .why-facts { grid-template-columns: 1fr; } .tiles-4 { grid-template-columns: 1fr 1fr; } }
.shop-vendor h2 .count, .block-head .count, .card h2 .count { background: var(--line); color: var(--ink-2); border-radius: 999px; padding: .05rem .5rem; margin-left: .3rem; font-size: .75rem; font-weight: 600; vertical-align: middle; letter-spacing: 0; text-transform: none; }

/* ---------- v0.7: photo counts ---------- */
.photo-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.photo-pane { margin: 0; position: sticky; top: .5rem; }
.photo-pane img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.photo-rows .short { width: 4.5rem; }
.inline-form.gap { background: var(--warn-tint); border-radius: 8px; padding: .3rem .5rem; }
.match-row { padding: .5rem 0; border-top: 1px solid var(--line); }
.match-row p { margin: 0 0 .2rem; }
@media (max-width: 900px) { .photo-review { grid-template-columns: 1fr; } .photo-pane { position: static; } }

/* ---------- v0.8: sections and sub-tabs ---------- */
.tabs { justify-content: space-between; }
.tabs a { flex: 1 1 auto; text-align: center; justify-content: center; }
.subtabs { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding: .5rem 1rem; background: var(--card);
  border-bottom: 1px solid var(--line); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; text-decoration: none; color: var(--ink-2); padding: .45rem .9rem; border-radius: 999px; font-weight: 600;
  font-size: .92rem; min-height: 38px; display: inline-flex; align-items: center; }
.subtabs a.on { background: var(--night); color: #fff; }
@media (min-width: 1100px) { .tabs { justify-content: flex-start; } .tabs a { flex: none; } }
.line-edit { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: flex-end; }
.line-edit label { display: flex; flex-direction: column; gap: .15rem; }
.line-edit label.grow { flex: 1 1 12rem; }
.row-remove { display: inline; margin: 0; }
.row-remove .link { color: var(--ink-2); }

/* ---------- v0.8: product picker, menu slots ---------- */
.picker { position: relative; flex: 1 1 14rem; min-width: 12rem; }
.picker-q { width: 100%; }
.picker-q.picker-bad { border-color: var(--bad, #b3261e); box-shadow: 0 0 0 3px rgba(179,38,30,.15); }
.picker-hidden { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 22rem; overflow-y: auto; }
.picker-list li { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem .7rem; border-radius: 8px; cursor: pointer; min-height: 44px; align-items: center; }
.picker-list li:hover, .picker-list li:focus { background: var(--shade, #f6efe6); outline: none; }
.picker-list li.on { font-weight: 700; }
.picker-sub { color: var(--ink-2); font-size: .8rem; }
.picker-list .picker-note { color: var(--ink-2); font-size: .85rem; cursor: default; min-height: 0; }
.picker-list .picker-all { color: var(--crust-2, #8a4b22); font-weight: 600; justify-content: center; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; }
.slot { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .3rem; background: #fff; }
.slot-empty { background: transparent; border-style: dashed; }
.slot-name { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 700; }
.menu-item { border-top: 1px solid var(--line); }
.menu-item:first-child { border-top: 0; }
.menu-item summary, .menu-item > .mi-name { display: flex; flex-direction: column; padding: .35rem 0; cursor: pointer; list-style: none; }
.menu-item summary::-webkit-details-marker { display: none; }
.mi-name { font-weight: 600; }
.mi-sub { font-size: .8rem; color: var(--ink-2); }
.menu-item.now .mi-name::after { content: " ●"; color: var(--good, #2e7d32); font-size: .7rem; }
.menu-item details[open] { background: var(--shade, #f6efe6); border-radius: 8px; padding: 0 .5rem .5rem; margin: 0 -.5rem; }
.menu-staples { columns: 2 16rem; column-gap: 1.2rem; }
.menu-staples .menu-item { break-inside: avoid; }
.menu-staples .menu-item details[open] { column-span: all; }
.menu-form { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: flex-end; margin-top: .4rem; }
.menu-form label { display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; color: var(--ink-2); }
.menu-form label.wide { flex: 1 1 100%; }
.menu-form-buttons { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; flex: 1 1 100%; }
.slot-add > summary { cursor: pointer; color: var(--crust-2, #8a4b22); font-weight: 600; padding: .2rem 0; }
.slot-checks { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.slot-checks legend { font-weight: 600; padding: 0 .3rem; }
.menu-item summary { align-items: flex-start; text-align: left; }
.tabs a { white-space: nowrap; }
@media (max-width: 640px) { .tabs a { flex: none; } }
.slot-name .count { background: var(--line); color: var(--ink-2); border-radius: 999px; padding: 0 .45rem; margin-left: .2rem; }

/* ---------- v0.9: recipe editor and print ---------- */
.card-pad { padding: 1rem 1.1rem .4rem; }
.table-scroll { overflow-x: auto; }
.recipe-lines td { padding: .3rem .35rem; vertical-align: middle; }
.recipe-lines input, .recipe-lines select { min-height: 40px; }
.recipe-lines .tiny, input.tiny { width: 3rem; text-align: center; }
.recipe-lines .rl-sec { width: 7.5rem; }
.recipe-lines .rl-ing { min-width: 14rem; width: 100%; }
.yield-rows { display: grid; gap: .3rem; }
.scale-modes { display: grid; gap: .5rem; margin-bottom: .6rem; }
.choice-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-weight: 600; }
.choice-line input[type=radio] { width: 1.2rem; height: 1.2rem; }
.rp-title { margin-bottom: .1rem; }
.rp-scale { font-size: 1.1rem; margin: .4rem 0; }
.rp-mixes { background: var(--warn-tint); border-radius: 8px; padding: .4rem .6rem; }
.rp-table .rp-amt { font-weight: 700; font-size: 1.05rem; }
.rp-sub { border-top: 2px solid var(--line); margin-top: 1rem; padding-top: .4rem; }
.rp-subtitle { margin: .2rem 0 .3rem; }
.rp-method { white-space: pre-line; line-height: 1.5; }
@media print {
  .topbar, .subtabs, .foot, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .rp-sub { break-inside: avoid; }
}
.recipe-lines select[name^=unit_] { min-width: 4.8rem; }
.recipe-lines select[name^=flour_] { min-width: 6.8rem; }
.recipe-lines .rl-ing { min-width: 11rem; }
.recipe-lines input[name^=qty_] { width: 6rem; }
.yield-rows .inline-form { flex-wrap: nowrap; }
.yield-rows label { display: inline-flex; align-items: center; gap: .4rem; flex-direction: row; white-space: nowrap; }
.scale-form .choice-line { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .45rem; text-align: left; font-weight: 600; margin: 0; }
.scale-form .choice-line input[type=radio] { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; }
.scale-form .choice-line input:not([type=radio]), .scale-form .choice-line select { width: auto; flex: none; }
.scale-form .choice-line input.short { width: 6rem; }
.scale-form .choice-line select { max-width: 16rem; }

/* Today (v0.10) */
.jump { margin: -.25rem 0 1rem; color: var(--ink-2); }
.today-tbl td { vertical-align: middle; }
.big-num { font-size: 1.2rem; font-weight: 700; }
.baked-cell { white-space: nowrap; }
.done-mark { color: var(--crust); font-weight: 700; }
.bake-form, .ws-form { margin: .15rem 0 0; }
.btn-x { border: 0; background: none; color: var(--ink-2); font-size: 1.1rem; padding: 0 .3rem; cursor: pointer; }
.ws-cust { border-top: 1px solid var(--line); padding: .5rem 0; }
.ws-cust h3 { margin: .2rem 0 .3rem; }
.ws-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; padding: .25rem 0; }
.ws-what { flex: 1 1 14rem; }
.ws-add { margin-top: .8rem; flex-wrap: wrap; }
.task-list { margin: .2rem 0 .6rem; }
.task-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.task-main { flex: 1; }
.tick-form { margin: 0; display: inline; }
.tickbtn { width: 40px; height: 40px; border: 2px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 1.2rem; font-weight: 700; color: #fff; cursor: pointer; flex: none; }
.tickbtn.is-done { background: var(--crust); border-color: var(--crust); }
.feed-tbl td, .feed-tbl th { padding: .35rem .5rem; }
.mix-days td { vertical-align: middle; }

/* Expenses: receipt capture (v0.11) */
.cap-buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.cap-big { min-height: 64px; font-size: 1.1rem; flex: 1 1 14rem; }
.cap-pages { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.cap-thumbs { display: flex; gap: .6rem; overflow-x: auto; padding: .25rem 0 .5rem; }
.cap-thumb { position: relative; flex: none; }
.cap-thumb img { height: 150px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.cap-thumb span { position: absolute; left: 6px; bottom: 6px; background: var(--night); color: #fff; border-radius: 10px; padding: 0 .45rem; font-size: .8rem; }
.cap-thumb .btn-x { position: absolute; right: 2px; top: 2px; background: rgba(255,255,255,.9); border-radius: 50%; width: 32px; height: 32px; }
.cap-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .5rem 0; }
.cap-note { display: block; margin: .5rem 0; }
.cap-note input { width: 100%; }
.cap-progress { margin-top: .75rem; }
.cap-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.cap-bar div { height: 100%; width: 0; background: var(--crust); transition: width .2s; }
.cap-msg { font-weight: 600; margin: .75rem 0 0; }
.cap-msg.good { color: var(--good); } .cap-msg.bad { color: var(--bad); }
.cap-tips { margin: .75rem 0 0; padding-left: 1.1rem; }
.cap-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.sub-img { max-width: 100%; max-height: 80vh; border: 1px solid var(--line); border-radius: 8px; display: block; margin: .75rem 0; }
.cap-row label { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.cap-row input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--crust); margin: 0; }

/* Square -> Zoho (v0.12) */
.zh-needs { border-color: #f0b9b1; }
.zh-need { border-top: 1px solid var(--line); padding: .8rem 0; }
.zh-need:first-of-type { border-top: 0; }
.zh-need .inline-form { margin-top: .4rem; }
.zh-warn { margin: 0; padding-left: 1.2rem; } .zh-warn li { margin: .3rem 0; }
.zh-flag { color: var(--warn); }
.zh-steps { padding-left: 1.4rem; } .zh-steps li { margin: .2rem 0; }
.zh-steps .hint { display: block; }
.zh-fix { margin-top: .3rem; } .zh-fix summary { min-height: 30px; }
.zh-fix .inline-form { margin-top: .4rem; }
.zh-tbl td:first-child { min-width: 11rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
#finish .savebar { position: static; background: none; }
