/* ---------- the product page ------------------------------------------------
   Laid out like the recipe page, because they're the same kind of thing: a bar
   you navigate from, a hero that says what you're looking at, the numbers you
   came to check, the actions, then the working cards.

   The `.prod-*` and `.pcard` rules near the bottom are shared with the group
   page and the pantry row editor — they stay as they are. */

#productInner { max-width: 1160px; padding-bottom: 72px; }

/* ---------- the bar above the page ---------- */
.pp-nav { gap: 10px; margin-bottom: 14px; }
.pp-nav .rp-gap, .pp-actions .rp-gap { flex: 1; }

/* ---------- hero: what this thing is ---------- */
/* `header {}` in header.css pins the app bar to the top — a <header> inside a
   routed page has to say it isn't that one */
.pp-hero {
  position: relative; z-index: auto;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 18px 20px; margin-bottom: 14px;
}
.pp-heroshot {
  position: relative; flex: none; overflow: hidden;
  width: 120px; height: 120px; padding: 8px;
  border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pp-heroshot img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pp-heroshot .ph { display: grid; place-items: center; font-size: 40px; color: #b9c0d4; }
.pp-heroshot:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* the way in to the picture, said only when you're pointing at it */
.pp-heroshot-hint {
  position: absolute; inset: auto 0 0 0; padding: 6px 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(10,14,12,.78);
  transform: translateY(100%); transition: transform var(--dur-2, .18s) var(--ease-out, ease);
}
.pp-heroshot:hover .pp-heroshot-hint, .pp-heroshot:focus-visible .pp-heroshot-hint { transform: none; }
.pp-heroshot-hint .ic { width: 13px; height: 13px; }

.pp-heroid { flex: 1 1 320px; min-width: 0; }
.pp-heroid h1 {
  font-size: clamp(21px, 2.4vw, 28px); font-weight: 800;
  letter-spacing: -.025em; line-height: 1.15; color: var(--text);
  margin: 2px 0 0;
}
.pp-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--green-dark);
}
.pp-pill .ic { width: 13px; height: 13px; }
.pp-pill.soft { background: var(--surface-3); color: var(--text-soft); font-weight: 650; }
.pp-pill.gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }

.pp-facts {
  display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.pp-facts > span { display: inline-flex; align-items: center; gap: 7px; }
.pp-facts .ic { width: 14px; height: 14px; opacity: .8; }
.pp-facts i { font-style: normal; font-weight: 500; opacity: .75; }
.pp-heroLinks { margin-top: 10px; }
.pp-heroLinks .ing-links { padding-left: 0; }

/* ---------- the four numbers you came to check ----------
   Each one is a button onto the card that owns it, so the summary is also the
   way in. Nothing here shows a bare dash without saying what to do about it. */
.pp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pp-stats.n2 { grid-template-columns: repeat(2, 1fr); }
.pp-stats.n3 { grid-template-columns: repeat(3, 1fr); }
.pp-stat {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); cursor: pointer; min-width: 0;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.pp-stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.pp-stat-k {
  font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted);
}
.pp-stat b {
  font-size: 20px; font-weight: 780; letter-spacing: -.02em; line-height: 1.2;
  color: var(--text); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-stat-s {
  font-size: 11px; color: var(--text-muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-stat.good b { color: var(--green-dark); }
.pp-stat.warn  { background: color-mix(in srgb, var(--amber) 8%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 26%, transparent); }
.pp-stat.warn b { color: var(--amber); }
.pp-stat.bad   { background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.pp-stat.bad b { color: var(--red); }
/* Nothing answered yet. A tile that shows a big bold dash reads as broken, so
   this one says the state plainly and the sub-line becomes the invitation. */
.pp-stat.todo {
  border-style: dashed; box-shadow: none;
  border-color: var(--border-strong); background: var(--surface-2);
}
.pp-stat.todo b { color: var(--text-muted); font-weight: 650; font-size: 14.5px; padding: 3px 0; }
.pp-stat.todo .pp-stat-s { color: var(--accent); font-weight: 650; }
.pp-stat.todo:hover .pp-stat-s { text-decoration: underline; }

@media (max-width: 900px) { .pp-stats { grid-template-columns: repeat(2, 1fr); } }
/* on a phone a truncated tile says nothing useful — let the words wrap instead,
   and keep the hero short enough that the tabs are still on the first screen */
@media (max-width: 560px) {
  .pp-stats { gap: 8px; }
  .pp-stat { padding: 10px 12px; }
  .pp-stat b, .pp-stat-s { white-space: normal; overflow: visible; }
  .pp-nav .rp-pos { display: none; }
  .pp-hero { gap: 14px; padding: 14px; align-items: flex-start; flex-wrap: nowrap; }
  .pp-heroshot { width: 78px; height: 78px; padding: 5px; }
  .pp-heroshot-hint { display: none; }
  .pp-heroid { flex: 1 1 auto; }
  .pp-heroid h1 { font-size: 19px; }
  /* the department is already in the bar above, and the order-list state is a
     button three rows down — one pill is enough beside a 78px thumbnail */
  .pp-pill.soft, .pp-pill.gold { display: none; }
  .pp-heroLinks .linkbtn { text-align: left; }
  .pp-actions { gap: 6px; padding: 8px; }
  .pp-actions .tool, .pp-actions .iconbtn { padding: 9px 12px; font-size: 12.5px; }
}

/* ---------- the actions, which follow you down the page ---------- */
.pp-actions {
  position: sticky; top: 0; z-index: 6;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 0 -8px 14px; padding: 10px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pp-actions .tool { padding: 10px 16px; font-size: 13px; }
.pp-actions .iconbtn { padding: 10px 14px; }
.pp-actions .iconbtn.on {
  background: var(--accent-soft); color: var(--green-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}
.pp-actions .iconbtn.danger:hover {
  background: color-mix(in srgb, var(--red) 11%, transparent);
  color: var(--red); border-color: color-mix(in srgb, var(--red) 28%, transparent);
}

/* ---------- finishing the setup ----------
   Six answers make a product work properly and none of them is compulsory, so
   a half-set-up product used to look finished. This says what's left, in one
   line, with a button straight to each field. */
.pp-setup {
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--border-strong));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 14px;
}
.pp-setup-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-setup-top b { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.pp-setup-top b .ic { width: 15px; height: 15px; color: var(--accent); }
.pp-setup-bar {
  flex: 1 1 90px; max-width: 180px; height: 6px; border-radius: 99px;
  background: var(--surface-3); overflow: hidden;
}
.pp-setup-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pp-setup-n { font-size: 11.5px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pp-setup-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.pp-todo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; padding: 6px 12px;
  border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text-soft);
  border: 1px solid var(--border-strong);
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.pp-todo:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pp-todo .ic { width: 13px; height: 13px; }

.pp-setup.done {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  border-style: solid; border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  font-size: 12.5px; padding: 9px 14px;
}
.pp-setup.done b { font-weight: 700; }
.pp-setup.done span:not(.pp-setup-tick) { color: var(--text-muted); }
.pp-setup-tick { display: inline-flex; color: var(--accent); }
.pp-setup-tick .ic { width: 16px; height: 16px; }

/* ---------- tabs ---------- */
.prod-tabs { flex-wrap: wrap; margin: 0 0 16px; }
.prod-tabs button > .ic { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.prod-tabs button.on > .ic { color: var(--accent); }
/* on a phone four tabs stacked three rows deep push the page off the screen,
   so they become one strip you swipe across instead */
@media (max-width: 720px) {
  .prod-tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: -2px; padding: 2px;
  }
  .prod-tabs::-webkit-scrollbar { display: none; }
  .prod-tabs button { flex: none; white-space: nowrap; padding: 8px 13px; }
  .prod-tabs .pt-l i { display: none; }
}

/* ---------- the cards ----------
   Two columns that fill independently, so a short card never leaves a hole
   beside a tall one — which is what a plain auto-fit grid does. */
.pp-cardgrid { display: flex; flex-direction: column; gap: 16px; }
.pp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pp-col:empty { display: none; }
.pp-cols:has(.pp-col:empty) { grid-template-columns: 1fr; }
@media (max-width: 900px) { .pp-cols { grid-template-columns: 1fr; } }

/* every card on this page is headed the same way the recipe page heads its own */
#productInner .pcard > h4 {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 750; letter-spacing: -.01em; color: var(--text);
  text-transform: none;
  padding-bottom: 11px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
#productInner .pcard > h4 > .ic { width: 16px; height: 16px; color: var(--accent); }
#productInner .pcard > h4 small {
  margin-left: auto; font-size: 11px; font-weight: 650;
  color: var(--text-muted); text-transform: none; letter-spacing: 0;
  text-align: right;
}
/* Jumped to from a stat tile or a setup chip — say what you landed on. An
   outline rather than a shadow, so it works on a whole card and on a single
   field, and puts back nothing when it fades. */
.pp-flash { animation: pp-flash 1.8s var(--ease-out, ease); border-radius: var(--radius-sm); }
@keyframes pp-flash {
  0%, 45% { outline: 2px solid var(--accent); outline-offset: 5px; }
  100%    { outline: 2px solid transparent; outline-offset: 5px; }
}
@media (prefers-reduced-motion: reduce) { .pp-flash { animation: none; } }

/* ---------- the setup form ----------
   A twelve-column grid, so a name gets the room a name needs and a pack size
   gets the room a three-digit number needs. Fourteen boxes all the same width
   is what made this page read as a wall. */
.pp-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px 18px; align-items: start; }
.pp-form > .pf-3  { grid-column: span 3; }
.pp-form > .pf-4  { grid-column: span 4; }
.pp-form > .pf-5  { grid-column: span 5; }
.pp-form > .pf-6  { grid-column: span 6; }
.pp-form > .pf-7  { grid-column: span 7; }
.pp-form > .pf-12 { grid-column: 1 / -1; }
@media (max-width: 820px) { .pp-form > [class*="pf-"] { grid-column: 1 / -1; } }

/* labels here read as questions, not as shouted column headings */
#productInner .pfield > label {
  font-size: 12px; font-weight: 700; letter-spacing: 0;
  text-transform: none; color: var(--text-soft);
}
#productInner .pfield > label small {
  font-weight: 500; color: var(--text-muted); text-transform: none;
}
#productInner .pfield input, #productInner .pfield select { font-size: 13.5px; padding: 9px 11px; }
/* a number is a number: it never needs to be 600px wide */
#productInner .pp-num { flex: 0 0 130px; max-width: 130px; }
#productInner .pfield-row .pp-num { flex: 0 0 110px; }

/* three boxes that only make sense together, each said out loud */
.pp-subgrid { display: flex; gap: 12px; flex-wrap: wrap; }
.pp-sub { display: flex; flex-direction: column; gap: 4px; flex: 0 0 150px; min-width: 0; }
.pp-sub.grow { flex: 1 1 240px; }
.pp-sub > span {
  font-size: 11px; font-weight: 650; color: var(--text-muted);
}
.pp-sub input {
  font: inherit; font-size: 13.5px; padding: 9px 11px; width: 100%; min-width: 0;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
}
.pp-sub input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.pp-sub .pfield-row input { flex: 1; }

/* the picture and the two things that name a product, side by side */
.pp-identity { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.pp-shotcol { flex: none; width: 132px; display: flex; flex-direction: column; gap: 9px; }
.pp-shot {
  width: 132px; height: 132px; padding: 8px; object-fit: contain;
  border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--border);
}
.pp-shot.ph { display: grid; place-items: center; font-size: 42px; color: #b9c0d4; }
.pp-shotbtns { display: flex; gap: 6px; }
.pp-shotbtns .tool { flex: 1; justify-content: center; padding-inline: 10px; font-size: 12px; }
.pp-shotbtns .warnlink { flex: 0 0 auto; color: var(--red); }
.pp-identity .pp-form { flex: 1 1 320px; min-width: 0; }

/* ---------- notes, empty states, the danger at the foot of Setup ---------- */
.pp-blank {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 16px 16px 18px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.pp-blank > .ic { width: 20px; height: 20px; color: var(--text-muted); opacity: .7; }
.pp-blank b { font-size: 13.5px; font-weight: 700; }
.pp-blank span { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-width: 46ch; }

.pp-note {
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--blue) 7%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  font-size: 12.5px; line-height: 1.55; color: var(--text-soft);
}
.pp-note > b:first-child { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.pp-note b { color: var(--text); }
.pp-note > b:first-child .ic { width: 15px; height: 15px; color: var(--blue); }
.pp-note .tool { margin-top: 10px; }

.pp-inline-note {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.5; color: var(--text-muted);
}
.pp-inline-note > .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--accent); }
.pp-inline-note.todo > .ic { color: var(--amber); }
.pp-inline-note b { color: var(--text); }
.pp-inline-note a { color: var(--blue); font-weight: 650; }
/* inside a form field it's a sentence under a label, not a footer */
.pfield > .pp-inline-note { margin-top: 0; padding-top: 0; border-top: none; }

.pp-danger { border-color: color-mix(in srgb, var(--red) 26%, transparent); }
#productInner .pp-danger > h4 { border-bottom-color: color-mix(in srgb, var(--red) 20%, transparent); }
#productInner .pp-danger > h4 > .ic { color: var(--red); }
.pp-dangerrow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pp-dangerrow .phelp { flex: 1 1 320px; }

.pp-cardactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.pp-mt { margin-top: 14px; }
.pp-tablewrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }

/* ============================================================================
   Shared below this line — the group page and the pantry row editor draw the
   same cards, steppers and tables, so these rules are not product-page-only.
   ========================================================================== */
.prod-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.prod-img {
  width: 132px; height: 132px; object-fit: contain; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--border); padding: 8px; flex-shrink: 0;
}
.prod-img.ph { display: grid; place-items: center; font-size: 44px; color: var(--text-muted); }
.prod-img.clickable { cursor: pointer; transition: border-color .15s ease; }
.prod-img.clickable:hover { border-color: var(--accent); }
.prod-title { flex: 1; min-width: 240px; }
.prod-title h2 { font-size: 24px; font-weight: 780; letter-spacing: -.02em; margin-bottom: 4px; }
.prod-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--text-muted); font-size: 12.5px; }
.prod-meta .sep { opacity: .5; }
.prod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* min() rather than a bare 330px: a hard minimum is a floor the track can't go
   under, so on a phone every card sat 67px wider than the page it was in. */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; align-items: start; }
.pcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-card);
}
.pcard.span2 { grid-column: 1 / -1; }

/* the picture: preview on the left, the ways to change it on the right */
.pimg-edit { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.pimg-preview {
  width: 164px; height: 164px; object-fit: contain; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--border); padding: 8px; flex-shrink: 0;
}
.pimg-preview.ph { display: grid; place-items: center; font-size: 52px; color: var(--text-muted); }
.pimg-controls { flex: 1; min-width: 240px; }
.pimg-controls .pfield input { width: 100%; }

/* a tick-box that reads as a sentence, for the settings that are a yes or a no */
.pfield > label.pcheck, .pcheck {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  text-transform: none; letter-spacing: 0;
}
.pcheck:hover { color: var(--text); }
.pcheck input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.pcard h4 { font-size: 13px; font-weight: 750; letter-spacing: .02em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pcard h4 small { font-weight: 500; color: var(--text-muted); margin-left: auto; }

.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper button {
  width: 40px; height: 40px; border-radius: 11px; font-size: 20px; font-weight: 700;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
}
.qty-stepper button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qty-stepper input {
  width: 86px; text-align: center; font-size: 20px; font-weight: 750;
  padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 11px; outline: none;
  background: var(--surface-2); color: var(--text);
}
.qty-stepper .unit { font-weight: 650; color: var(--text-soft); }

/* stock for a multipack: whole packs on one side, what's left in the open one on
   the other, so nobody has to read "1.875 box" */
.inner-stock { display: flex; gap: 22px; flex-wrap: wrap; }
.inner-stock .is-field { display: flex; flex-direction: column; gap: 6px; }
.inner-stock label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.inner-stock .qty-stepper input { width: 68px; }
.inner-stock .is-of { font-size: 12.5px; font-weight: 650; color: var(--text-muted); }

/* portions of a pack — "half" said in the unit the product is counted in */
.portion-row { display: flex; gap: 8px; flex-wrap: wrap; }
.portion-row .tool { flex-direction: column; align-items: center; gap: 1px; padding: 8px 13px; line-height: 1.25; }
.portion-row .tool b { font-size: 15px; font-weight: 750; }
.portion-row .tool i { font-style: normal; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.unit-tag {
  display: flex; align-items: center; flex: none; padding: 0 11px; border-radius: 9px;
  font-size: 12.5px; font-weight: 650; color: var(--text-soft);
  background: var(--surface-3); border: 1px solid var(--border);
}

/* the settings that only some products want: there, but folded away */
.advanced { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.advanced > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-soft);
  list-style: none; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before {
  content: ""; width: 13px; height: 13px; flex: none;
  background: currentColor; color: var(--text-muted);
  -webkit-mask: var(--chevron-right) center / contain no-repeat;
          mask: var(--chevron-right) center / contain no-repeat;
  transition: transform var(--dur-2) var(--ease-out);
}
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced > summary:hover { color: var(--accent); }
.advanced > summary i { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--text-muted); }
.advanced .minmax-row { margin-top: 10px; }
.minmax-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.minmax-row .mfield { display: flex; flex-direction: column; gap: 4px; }
.minmax-row label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.minmax-row input {
  width: 110px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  outline: none; background: var(--surface-2); color: var(--text);
}
.minmax-row .mhint { font-size: 11px; color: var(--text-muted); max-width: 130px; }

.stock-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* grocer price table */
.grocer-table { width: 100%; border-collapse: collapse; }
.grocer-table td { padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
.grocer-table tr:first-child td { border-top: none; }
.grocer-name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13px; }
.grocer-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.grocer-prod { font-size: 12px; color: var(--text-muted); max-width: 220px; }
.grocer-prod a { color: inherit; }
.grocer-price { font-size: 17px; font-weight: 780; white-space: nowrap; }
.grocer-price s { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 5px; }
.grocer-price .cup { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; }
tr.bestprice .grocer-price { color: var(--green-dark); }
.bestbadge {
  font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px;
  border-radius: 99px; background: var(--accent-soft); color: var(--green-dark);
  text-transform: uppercase;
}
.syncdot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.syncdot i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); font-style: normal; }
.syncdot.api i { background: var(--accent); }
.syncdot.manual i { background: var(--amber); }
.syncdot.stale i { background: var(--red); }
.gaction { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.gaction button {
  font-size: 11.5px; font-weight: 650; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
}
.gaction button:hover { background: var(--surface-3); }

/* batches */
.batch-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-top: 1px solid var(--border); font-size: 13px;
}
.batch-row:first-of-type { border-top: none; }
.batch-qty { font-weight: 750; min-width: 54px; }
.batch-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.batch-add input, .batch-add select {
  padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 8px; outline: none;
  background: var(--surface-2); color: var(--text);
}
.batch-add input[type=number] { width: 74px; }

/* history */
.hist-list { max-height: 300px; overflow-y: auto; }
.hist-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.hist-row:first-child { border-top: none; }
.hist-when { color: var(--text-muted); font-size: 11.5px; min-width: 108px; }
.hist-act { font-weight: 650; }
.hist-act.use { color: var(--red); }
.hist-act.buy { color: var(--green-dark); }
.hist-paid { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.hist-act.adjust, .hist-act.add { color: var(--blue); }
.hist-act.toss { color: var(--amber); }

/* used-in-recipes */
.userecipes { display: flex; flex-direction: column; gap: 6px; }
.userecipes a {
  display: flex; gap: 8px; align-items: baseline; text-decoration: none;
  color: var(--text); font-weight: 600; font-size: 13px; padding: 7px 10px;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border);
}
.userecipes a:hover { border-color: var(--accent); }
.userecipes a small { color: var(--text-muted); font-weight: 500; }


/* ---------- the one question that turns the portion buttons on ----------
   Asked where it's missed, not on another tab. The card it replaces is
   otherwise a dead end: buttons that can't be drawn and a sentence telling
   you to go somewhere else. */
.portion-setup {
  padding: 13px 15px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.portion-setup b {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
}

.portion-setup b .ic { width: 15px; height: 15px; color: var(--accent); }
.portion-setup p { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }
.portion-setup .pfield-row { margin-bottom: 8px; }
.portion-setup input { max-width: 140px; }
