/* --- a product you buy in more than one size -------------------------------
   One row in My Products that opens to show its sizes. The sizes are indented
   under a rail so the nesting is readable without a second list. */
.prow.vrow { border-left: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); }
.prow.vrow.vopen { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.vr-toggle {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg);
  color: var(--text-muted); cursor: pointer; padding: 0;
}
.vr-toggle:hover { border-color: var(--blue); color: var(--blue); }
.vr-toggle .ic { width: 13px; height: 13px; transition: transform .15s var(--ease-out); }
.vr-toggle[aria-expanded="true"] .ic { transform: rotate(90deg); }

.vr-count {
  display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 800;
  padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue);
}
.prow.vrow .pname small.vr-links { margin-top: 2px; opacity: .85; }
.prow.vrow .pname small.vr-links .ic { width: 11px; height: 11px; vertical-align: -0.1em; margin-right: 3px; }
.prow.vrow .pname small.vr-links.todo { color: var(--amber); }

.vr-kids {
  margin: 0 0 6px; padding: 9px 10px 3px 16px;
  border: 1px solid var(--border); border-top: none;
  border-left: 3px solid color-mix(in srgb, var(--blue) 45%, transparent);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: color-mix(in srgb, var(--blue) 4%, transparent);
}
.vr-kids .prow { background: var(--bg); }
.vr-kidnote {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 11.5px; line-height: 1.5; color: var(--text-muted); margin-bottom: 8px;
}
.vr-kidnote .ic { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.vr-kidnote a { color: var(--blue); font-weight: 700; }

/* --- a plain household name, and the products that count as it --------------
   The same nesting one level up, in gold rather than blue — the two can sit
   inside each other (three bottles of dishwashing liquid, two of them the same
   product in two sizes), so they have to be told apart without reading. */
.prow.nrow { border-left: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.prow.nrow.vopen { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.prow.nrow .vr-toggle:hover { border-color: var(--gold); color: var(--gold); }
.nm-count {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  font-size: 10.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold);
}
.nm-count .ic { width: 11px; height: 11px; }
.vr-kids.nm-kids {
  border-left-color: color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold) 5%, transparent);
}
.nm-kids .vr-kidnote a { color: var(--gold); }
.nm-links { margin-top: 4px; }
.nm-links .ing-links { padding-left: 2px; }

/* "Keep at least [1] [packs — any size]" */
.vr-minrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.vr-minrow label { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--text-muted); }
.vr-minrow input { width: 92px; }
.vr-minrow input, .vr-minrow select {
  font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text);
}
.vr-minrow input:focus, .vr-minrow select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.helper.vr-warn { display: flex; gap: 7px; align-items: flex-start; color: var(--amber); margin-bottom: 8px; }
.helper.vr-warn .ic { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.helper.vr-warn a { color: inherit; font-weight: 700; text-decoration: underline; }

/* "Keep at least [2] [L]" on a recipe ingredient — sits on its own line under
   the linked products, quiet until it has a number in it */
.ingr-min {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  width: 100%; margin-top: 6px; padding: 6px 9px; border-radius: 9px;
  border: 1px dashed var(--border); background: color-mix(in srgb, var(--text) 3%, transparent);
}
.ingr-min.on { flex-direction: column; align-items: stretch; gap: 10px; padding: 11px 12px;
  border-style: solid; border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 8%, transparent); }
.ingr-minhead { display: flex; align-items: center; gap: 10px; }
.ingr-minhead b { display: flex; align-items: center; gap: 6px; flex: 1; font-size: 12.5px; font-weight: 800; }
.ingr-minhead b .ic { width: 14px; height: 14px; color: var(--gold); }
.ingr-minhead .tool { font-size: 12px; padding: 4px 12px; }

/* the same answer folded back to one line, which is how it spends most of its
   life — the picker is four cards tall and only wanted while you're changing it */
.ingr-rule {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; text-align: left;
  font: inherit; font-size: 11.5px; padding: 3px 11px 3px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: color-mix(in srgb, var(--gold) 9%, transparent); color: var(--text);
}
.ingr-rule:hover { border-color: var(--gold); }
.ingr-rule .ic { width: 12px; height: 12px; flex: none; color: var(--gold); }
.ingr-rule b { font-weight: 750; }
.ingr-rule i { font-style: normal; color: var(--text-muted); }
.ingr-rule.low, .ingr-rule.out { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
.ingr-rule.low i, .ingr-rule.out i { color: var(--amber); font-weight: 700; }
.ingr-min label { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--text-muted); }
.ingr-min input { width: 78px; }
.ingr-min input, .ingr-min select {
  font: inherit; font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
}
.ingr-min input:focus, .ingr-min select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ingr-add {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border: 1px dashed var(--border); border-radius: 999px;
  background: none; color: var(--text-muted);
}
.ingr-add:hover { border-color: var(--gold); color: var(--gold); border-style: solid; }
.ingr-add .ic { width: 12px; height: 12px; }
.ingr-verdict { font-style: normal; font-size: 11.5px; color: var(--text-muted); }
.ingr-verdict.ok { color: var(--green-dark); }
.ingr-verdict.low, .ingr-verdict.out { color: var(--amber); font-weight: 700; }

/* --- the one-off "sort your old groups out" screen ------------------------- */
.mig-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mig-top b { font-size: 14px; font-weight: 800; }
.mig-list { display: flex; flex-direction: column; gap: 14px; }
.mig-card {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 14px 15px; display: flex; flex-direction: column; gap: 12px;
}
.mig-head b { font-size: 15px; font-weight: 800; }
.mig-why { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.mig-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 9px; }
.mig-opt {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  padding: 11px 13px; border-radius: 12px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  transition: border-color .15s ease, background-color .15s ease;
}
.mig-opt:hover { border-color: var(--accent); }
.mig-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.mig-opt b { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; }
.mig-opt b .ic { width: 14px; height: 14px; flex: none; }
.mig-opt i { font-style: normal; font-size: 11.5px; color: var(--text-soft); line-height: 1.45; }

.mig-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.mig-mems { display: flex; flex-direction: column; gap: 2px; }
.mig-mem { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; cursor: pointer;
  padding: 4px 3px; border-radius: 7px; }
.mig-mem:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.mig-mem input { margin-top: 2px; accent-color: var(--accent); flex: none; }
.mig-mem small { display: block; font-size: 10.5px; color: var(--text-muted); }
.mig-mem.off > span { text-decoration: line-through; opacity: .55; }
.mig-mem.target { cursor: default; }
.mig-mem.target > span { font-weight: 700; }
.mig-mem.target small { color: var(--gold); font-weight: 600; }

.mig-target { border-top: 1px dashed var(--border); padding-top: 11px; }
.mig-target .linkfield { position: relative; margin-top: 8px; }
.mig-target .linkfield > input {
  width: 100%; font: inherit; font-size: 12.5px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text);
}
.mig-target .linkfield > input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.mig-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 4px 6px 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
.mig-chip .ic { width: 12px; height: 12px; }
.mig-chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 0 2px; }
.mig-chip button:hover { color: var(--red); }
.mig-none { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--amber); }
.mig-none .ic { width: 13px; height: 13px; }

.mig-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 11px; }
.mig-plan { flex: 1; min-width: 200px; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.mig-plan b { color: var(--text-soft); }

/* --- product groups -------------------------------------------------------- */
.groupchip {
  display: inline-block; font-size: 11px; font-weight: 700; cursor: pointer;
  padding: 1px 8px; border-radius: 999px; margin-left: 6px;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
}
.groupchip:hover { background: color-mix(in srgb, var(--blue) 24%, transparent); }
.glist { display: flex; flex-direction: column; gap: 14px; }
.prow.grow .pname small { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.prow.grow .grow-members { opacity: .75; }
.grow-warn { color: var(--amber); font-weight: 700; }
.pthumb.ph { display: grid; place-items: center; font-size: 16px; color: var(--text-muted); cursor: pointer; }
.gstock-total { display: flex; align-items: baseline; gap: 9px; margin: 4px 0 12px; }
.gstock-total b { font-size: 28px; font-weight: 800; color: var(--text); }
.gstock-total span { font-size: 12px; color: var(--text-muted); }

/* suggested groups — folded to one line until you open it, so a page whose job
   is the product list starts with the product list */
.sug-reopen {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--blue) 26%, transparent);
  background: color-mix(in srgb, var(--blue) 6%, transparent);
  border-radius: 12px; padding: 9px 13px; margin-bottom: 14px;
  font: inherit; color: var(--text);
}
.sug-reopen:hover { border-color: var(--blue); }
.sug-reopen > .ic { flex: none; width: 15px; height: 15px; color: var(--blue); }
.sug-reopen b { font-size: 13px; font-weight: 750; }
.sug-reopen small { font-size: 11.5px; color: var(--text-muted); }
.sug-reopen i {
  margin-left: auto; display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-style: normal; font-size: 12px; font-weight: 700; color: var(--blue);
}
.sug-reopen i .ic { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .sug-reopen { flex-wrap: wrap; gap: 2px 8px; padding: 8px 11px; line-height: 1.35; }
  .sug-reopen > .ic { align-self: flex-start; margin-top: 2px; }
  .sug-reopen b { flex: 1 1 0; }
  .sug-reopen small { flex: 1 1 100%; margin-left: 24px; }
  .sug-reopen i { flex: 1 1 100%; margin-left: 24px; }
}

.sugbox {
  border: 1px solid color-mix(in srgb, var(--blue) 26%, transparent);
  background: color-mix(in srgb, var(--blue) 6%, transparent);
  border-radius: 14px; padding: 14px 15px; margin-bottom: 18px;
}
.sugtop { position: relative; padding-right: 30px; }
.sug-x {
  position: absolute; top: -3px; right: -4px; width: 26px; height: 26px; cursor: pointer;
  display: grid; place-items: center; border: none; background: none; border-radius: 8px;
  color: var(--text-muted);
}
.sug-x:hover { background: var(--surface-3); color: var(--text); }
.sug-x .ic { width: 14px; height: 14px; }
/* the two arrangements, never mixed in one list */
.sugsec { margin-top: 14px; }
.sugsec-h b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; }
.sugsec-h b .ic { width: 14px; height: 14px; color: var(--blue); }
.sugsec-h span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.sugcard.link { border-color: color-mix(in srgb, var(--gold) 34%, var(--line)); }
.sugtarget {
  display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-soft);
  background: var(--surface-3); border-radius: 8px; padding: 5px 8px;
}
.sugtarget .ic { width: 13px; height: 13px; flex: none; color: var(--gold); }
.sugtarget b { font-weight: 750; color: var(--text); }
.sugtarget button {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 2px;
}
.sugtarget button:hover { color: var(--text); }
.sugpick { position: relative; }
.sugpick input {
  font: inherit; font-size: 12.5px; width: 100%; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
.sugpick input:focus { outline: none; border-color: var(--blue); }
.sugtop b { display: block; font-size: 14px; font-weight: 800; }
.sugtop span, .empty-sug span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.empty-sug b { font-size: 13.5px; font-weight: 800; }
.empty-sug .tool { margin-top: 10px; }
.suglist { display: grid; gap: 10px; margin-top: 9px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.sugcard {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: var(--card); display: flex; flex-direction: column; gap: 9px;
}
.sugcard .sughead { display: flex; flex-direction: column; gap: 4px; }
.sugcard .sughead b { font-size: 13.5px; font-weight: 800; }
.sugname {
  font: inherit; font-size: 13.5px; font-weight: 700; width: 100%;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.sugname:focus { outline: none; border-color: var(--blue); }
.sugwhy { font-size: 11px; color: var(--text-muted); }
.sugmems { display: flex; flex-direction: column; gap: 2px; }
.sugmem { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; cursor: pointer; padding: 3px 2px; border-radius: 7px; }
.sugmem:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.sugmem input { margin-top: 2px; accent-color: var(--blue); flex: none; }
.sugmem small { display: block; font-size: 10.5px; color: var(--text-muted); }
.sugmem.off > span { text-decoration: line-through; opacity: .5; }
.sugacts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.sugacts .tool { font-size: 12px; padding: 6px 11px; }
.sugfoot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sugpill {
  display: inline-block; margin-left: 5px; font-size: 10.5px; font-weight: 800;
  padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff;
}

/* Shared by the add wizard (css/add-wizard.css) and the product page: a field
   grid, the three count-mode cards, and the plain-words preview of what the
   answers will do. The lookup box, the or-divider and the form's own action row
   went with the form the wizard replaced. */
.af-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; }
.af-grid .pfield.wide { grid-column: 1 / -1; }

/* "how do you count this?" — three shapes, and a plain-words preview of what
   each one will actually do once the item exists */
.cmode-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.cmode {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  padding: 11px 13px; border-radius: 12px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  transition: border-color .15s ease, background-color .15s ease;
}
.cmode:hover { border-color: var(--accent); }
.cmode.on { border-color: var(--accent); background: var(--accent-soft); }
.cmode b { font-size: 13px; font-weight: 750; }
.cmode i { font-style: normal; font-size: 11.5px; color: var(--text-soft); line-height: 1.4; }
.cmode small { font-size: 10.5px; color: var(--text-muted); }
.af-preview { margin-top: 11px; display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.af-preview b { color: var(--text-soft); font-weight: 700; }
.af-preview .af-guess { color: var(--accent); }
@media (max-width: 560px) { .af-grid { grid-template-columns: 1fr; } }

/* the optional half — one line until you want it */
.af-more { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }

.af-more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-soft);
}

.af-more > summary::-webkit-details-marker { display: none; }
.af-more > summary:hover { border-color: var(--accent); color: var(--accent); }
.af-more > summary .ic { width: 14px; height: 14px; flex: none; }

.af-more > summary i {
  font-style: normal;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-muted);
}

.af-more[open] > summary { margin-bottom: 16px; border-style: solid; }
.af-more[open] > summary i { display: none; }

/* cost + price history */
.cost-hero { display: flex; gap: 26px; flex-wrap: wrap; margin: 2px 0 12px; }
.cost-hero > div { display: flex; flex-direction: column; }
.cost-hero b { font-size: 26px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cost-hero span { font-size: 11.5px; color: var(--text-muted); }
.ptrail { display: flex; flex-direction: column; gap: 3px; }
.ptrail-row { display: flex; gap: 10px; align-items: center; font-size: 12.5px; }
.ptrail-when { min-width: 92px; color: var(--text-muted); font-size: 11.5px; }
.ptrail-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; min-width: 40px; }
.ptrail-bar i { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.ptrail-price { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 58px; text-align: right; }
.ptrail-diff { min-width: 62px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.ptrail-diff.up { color: var(--red); }
.ptrail-diff.down { color: var(--green-dark); }
.gcard { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px 15px; }
.gcard.hl { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.gcard-top { display: flex; gap: 12px; align-items: flex-start; }
.gimg { width: 46px; height: 46px; border-radius: 10px; object-fit: contain; background: var(--bg); flex: none; }
.gimg.ph { display: grid; place-items: center; font-size: 19px; color: var(--text-muted); }
.gcard-id { flex: 1; min-width: 0; }
.gname {
  width: 100%; font: inherit; font-size: 15px; font-weight: 750; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 7px; margin: -5px -7px 0;
}
.gname:hover { border-color: var(--border); }
.gname:focus { outline: none; background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.gmeta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.gmeta-dim { font-size: 11.5px; color: var(--text-muted); }
.gfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 13px; }
.gfields label { display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--text-muted); }
.gfields label small { font-weight: 500; letter-spacing: 0; opacity: .8; }
.gfields input, .gfields select {
  font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text); min-width: 0;
}
.gfields input:focus, .gfields select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* --- the sizes of one product, side by side ---------------------------------
   Seven narrow columns of records, read on a phone as often as on the Mac, so
   the table scrolls inside its own box rather than pushing the page sideways. */
.gsz-wrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
.gsz-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gsz-table th {
  text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 8px 7px; white-space: nowrap;
}
.gsz-table td { padding: 9px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.gsz-table tbody tr.in { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.gsz-table tbody tr.bestvalue .gsz-val b { color: var(--green-dark); }
.gsz-table b { display: block; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.gsz-table i { display: block; font-style: normal; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gsz-table i .ic { width: 11px; height: 11px; vertical-align: -0.1em; margin-right: 3px; }

.gsz-open {
  display: flex; gap: 9px; align-items: flex-start; text-align: left; cursor: pointer;
  border: none; background: none; padding: 0; color: inherit; font: inherit; min-width: 175px;
}
.gsz-open img, .gsz-open .ph {
  width: 34px; height: 34px; flex: none; border-radius: 8px;
  object-fit: contain; background: var(--bg);
}
.gsz-open .ph { display: grid; place-items: center; color: var(--text-muted); }
.gsz-open .ph .ic { width: 15px; height: 15px; }
.gsz-open b { font-size: 12.5px; }
.gsz-open:hover b { color: var(--accent); }

.gsz-stock.out b { color: var(--text-muted); font-weight: 650; }
.gsz-stock.low b { color: var(--amber); }
.gsz-price b, .gsz-val b { white-space: nowrap; }
.gsz-special {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 99px; margin-left: 4px;
  background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red);
}
.gsz-bc span { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.gsz-bc .ic { width: 11px; height: 11px; vertical-align: -0.1em; margin-right: 4px; }
/* a record that isn't filled in yet — the thing to go and set, not a blank */
.gsz-table .gsz-gap { color: var(--amber); font-size: 11px; }
.gsz-gap a { color: inherit; text-decoration: underline; font-weight: 650; }
.gsz-act { text-align: right; }
.gsz-act button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 8px; padding: 4px; cursor: pointer; line-height: 0;
}
.gsz-act button:hover { border-color: var(--red); color: var(--red); }
.gsz-act .ic { width: 12px; height: 12px; }
.gsz-act button span { display: none; }
.helper.gsz-verdict { display: flex; gap: 7px; align-items: flex-start; margin-top: 11px; }
.helper.gsz-verdict .ic { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--green-dark); }

/* On a phone seven columns is two-and-a-bit screens of sideways scrolling, and
   this app is opened from a phone as often as from the Mac. So each row becomes
   its own little card, every record labelled — the same table, read down. */
@media (max-width: 720px) {
  .gsz-wrap { overflow-x: visible; margin-inline: 0; padding-inline: 0; }
  .gsz-table, .gsz-table tbody { display: block; }
  .gsz-table thead { display: none; }
  .gsz-table tbody tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 11px 12px; margin-bottom: 9px;
  }
  .gsz-table td { display: block; border: none; padding: 0; }
  .gsz-table td[data-l]::before {
    content: attr(data-l); display: block; margin-bottom: 2px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-muted);
  }
  .gsz-name, .gsz-act { grid-column: 1 / -1; }
  .gsz-open { min-width: 0; }
  .gsz-act { text-align: left; }
  .gsz-act button {
    display: inline-flex; align-items: center; gap: 6px; line-height: 1.2;
    padding: 5px 9px; font-size: 11.5px; font-weight: 650;
  }
  .gsz-act button span { display: inline; }
}

/* the two search boxes on the product page — "add another size" and "counts as".
   Scoped to the page rather than to a wrapper class: they sit straight inside a
   .pcard, so a bare <input> would otherwise be browser-default width and cut
   its own placeholder in half. */
#groupPage .linkfield > input {
  width: 100%; font: inherit; font-size: 12.5px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text);
}
#groupPage .linkfield > input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.link-sug button[disabled] { opacity: .55; cursor: default; }
/* group row on the order list */
.order-row.ogroup { border-left: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); }
/* a thing rather than a product — "milk", "toothpaste" */
.order-row.ostandin { border-left: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.order-row.ostandin .oinfo > b .ic { color: var(--gold); }
.ogroup-members { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  font-size: 11.5px; color: var(--text-muted); }
.ogm { cursor: pointer; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); }
.ogm.in { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--green-dark); }
.ogm:hover { border-color: var(--accent); }
.ogroup-pick { display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-muted); }
.ogroup-pick b { color: var(--text-soft); }
.ggroup-note {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 12.5px; color: var(--text-muted);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 26%, transparent);
}
.ggroup-note b { color: var(--text); }
.ggroup-note > b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.ggroup-note .tool { margin-top: 10px; }

