.shopping-page.wrap {
  --shop-green: #31543f;
  --shop-muted: #5b685e;
  --shop-rule: #d9ded3;
  max-width: 1176px;
  padding: 0 max(16px, 3.4%, env(safe-area-inset-right)) 64px max(16px, 3.4%, env(safe-area-inset-left));
}
.shop-scope { margin: 12px 0 0; color: var(--shop-muted); line-height: 1.45; }
.shop-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0;
  border-block: 1px solid #bfcabb;
  padding-block: 16px;
}
.shop-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-inline: clamp(14px, 3vw, 32px); }
.shop-stat:first-child { padding-left: 0; }
.shop-stat + .shop-stat { border-left: 1px solid var(--shop-rule); }
.shop-stat small { font: 600 .9rem/1.3 var(--body); color: var(--shop-muted); }
.shop-stat b {
  color: var(--shop-green);
  font: 500 clamp(1.55rem, 3vw, 2.35rem)/1.12 var(--display);
  letter-spacing: -.04em;
  font-variant-numeric: lining-nums tabular-nums;
}
.shop-stat span { color: var(--shop-muted); font-size: .8125rem; line-height: 1.4; }
.shop-stat progress {
  display: block;
  width: min(100%, 9rem);
  height: 5px;
  margin-block: 6px;
  appearance: none;
  border: 0;
  border-radius: 9px;
  background: #d9e1d5;
  color: #587859;
}
.shop-stat progress::-webkit-progress-bar { border-radius: 9px; background: #d9e1d5; }
.shop-stat progress::-webkit-progress-value { border-radius: 9px; background: #587859; }
.shop-stat progress::-moz-progress-bar { border-radius: 9px; background: #587859; }
.shop-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 6px 18px;
}
.shop-controls {
  display: flex; align-items: center; justify-self: end;
  flex-wrap: wrap; gap: 6px 12px; max-width: 100%;
}
.shop-sort, .shop-outstanding {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 550 .875rem/1.25 var(--body);
}
.shop-sort select {
  appearance: none;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 5px 32px 5px 10px;
  color: var(--ink);
  border: 1px solid #c5cbbf;
  border-radius: 6px;
  background: var(--white) url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3 5.5 4 4 4-4' fill='none' stroke='%23455749' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font: inherit;
  cursor: pointer;
}
.shop-outstanding { min-height: 40px; cursor: pointer; }
.shop-outstanding input, .shop-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--shop-green);
  cursor: pointer;
}
.shop-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.shop-filters button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 11px;
  background: transparent;
  color: #536057;
  font: 550 .875rem/1.3 var(--body);
}
.shop-filters button[aria-pressed="true"] { background: var(--shop-green); color: #fff; }
.shop-filters button:hover:not([aria-pressed="true"]) { background: #e7ebe2; color: var(--shop-green); }
.shop-cart-note { margin: 10px 0 0; color: var(--shop-muted); font-size: .875rem; }
.shop-results-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 14px; margin: 16px 0 7px; color: var(--shop-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.shop-scroll { max-width: 100%; }
.shop-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--white);
  border-bottom: 1px solid #bfcabb;
  color: var(--ink);
  font: .9375rem/1.35 var(--body);
}
.shop-table th, .shop-table td { vertical-align: middle; text-align: left; }
.shop-table thead th {
  padding: 0 10px;
  height: 38px;
  border-block: 1px solid #c1cabc;
  color: #4f5e53;
  font: 600 .8125rem/1.2 var(--body);
  background: #f0f2eb;
}
.shop-table thead th:first-child { width: 4.7rem; text-align: center; padding-inline: 2px; }
.shop-table thead .shop-qty { width: 10%; }
.shop-table thead .shop-cart { width: 5rem; }
.shop-table thead :is(.shop-rate, .shop-amount) { width: 11%; }
.shop-table thead .shop-source { width: 16%; }
.shop-table thead :is(.shop-qty, .shop-rate, .shop-amount) { text-align: right; }
.shop-table thead button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
  min-height: 34px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: inherit;
}
.shop-table thead button:hover, .shop-table thead [aria-sort="ascending"], .shop-table thead [aria-sort="descending"] { color: #234f30; }
.shop-sort-indicator { font-size: .75rem; }
.shop-group-head th {
  padding: 11px 12px 7px;
  border-block: 1px solid var(--shop-rule);
  background: #edf0e7;
  text-align: left;
  color: #314d38;
}
.shop-group-head th:has(.guide-section-toggle) { padding-block: 0; }
.shop-group-head .guide-section-toggle { vertical-align: middle; }
.shop-group-head th:has(.guide-section-toggle) .shop-group-amount { padding-top: 11px; }
.shop-group-title { font: 550 1.1rem/1.25 var(--display); letter-spacing: -.02em; }
.shop-group-amount { float: right; margin-left: .75em; font: 550 .875rem/1.6 var(--body); font-variant-numeric: tabular-nums; }
.shop-group-note { display: block; max-width: 90ch; margin: 2px 0; color: #526256; font: normal .8125rem/1.35 var(--body); }
.shop-row { border-bottom: 1px solid #e2e5dd; }
.shop-row > td, .shop-row > th { padding: 4px 10px; font-weight: 400; }
.shop-table .shop-check { padding: 0; text-align: center; }
.shop-check label { display: inline-grid; min-width: 32px; min-height: 36px; place-items: center; cursor: pointer; }
.shop-check input { vertical-align: middle; }
.shop-table .shop-cart { padding-inline: 2px; text-align: center; }
.shop-cart-quantity {
  min-height: 36px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--shop-muted);
  font: 600 .875rem/1.2 var(--body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}
.shop-cart-quantity[data-status="full"] { background: #e3ede0; color: #284b34; }
.shop-cart-quantity[data-status="partial"] { background: #f8ebd4; color: #664512; }
.shop-cart-quantity:hover { border-color: #91a18f; }
.shop-item-toggle {
  display: block;
  position: relative;
  width: 100%;
  min-height: 31px;
  padding: 2px 0 2px 14px;
  border: 0;
  background: transparent;
  font: 550 .9375rem/1.3 var(--body);
  text-align: left;
  overflow-wrap: anywhere;
}
.shop-item-toggle::before {
  content: "";
  position: absolute;
  left: 1px;
  top: calc(50% - 3px);
  width: 5px;
  height: 5px;
  border: solid #637664;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.shop-item-toggle[aria-expanded="true"]::before { transform: rotate(135deg); }
.shop-code { margin-left: 6px; color: var(--shop-muted); font: 500 .75rem/1.25 var(--mono); }
.shop-table .shop-qty, .shop-table .shop-rate, .shop-table .shop-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.shop-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-amount .shop-money { font-weight: 650; color: var(--shop-green); }
.shop-row :is(.shop-qty,.shop-rate,.shop-amount) small { display: block; color: var(--shop-muted); font: .78rem/1.25 var(--body); }
.shop-muted, .shop-source, .shop-empty { color: var(--shop-muted); }
.shop-source { font-size: .875rem; overflow-wrap: anywhere; }
.shopping-page a { color: var(--shop-green); text-decoration-thickness: 1px; text-underline-offset: .17em; }
.shopping-page a:hover { text-decoration-thickness: 2px; }
.shop-quoted-quantity {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.shop-quote-shortage { display: block; margin-top: .3rem; color: #773711; font-size: .8125rem; }
.shop-quote-caption { display: block; font: .78rem/1.25 var(--body); color: var(--shop-muted); }
.shop-source .shop-source-link + .shop-source-link { display: block; margin-top: .3rem; }
.shop-source small { display: block; font: .78rem/1.3 var(--body); color: var(--shop-muted); }
.shop-table .shop-mobile-source, .shop-table .shop-amount .shop-mobile-rate { display: none; }
.shop-row.is-received { background: #f1f5ed; }
.shop-detail > td { padding: 14px clamp(12px, 4.5vw, 64px); border-block: 1px solid #d4dcca; background: #f7f8f2; }
.shop-detail p { margin: 3px 0 7px; color: #46574b; font-size: .9rem; max-width: 80ch; }
.shop-detail summary { cursor: pointer; }
.shop-detail .joint-hardware { margin-block: 6px; }
.shop-labels { display: flex; gap: 5px; flex-wrap: wrap; margin-block: 6px; }
.shop-labels a { padding: 4px 7px; border: 1px solid #d5ddcd; border-radius: 4px; font: 500 .8125rem/1.3 var(--mono); }
.shop-allocations { display: grid; gap: 8px; margin: 6px 0 12px; padding-left: 0; list-style: none; }
.shop-allocations li { padding: 6px 0; border-bottom: 1px solid var(--shop-rule); }
.shop-allocations .shop-check { display: flex; align-items: center; gap: 8px; min-height: 32px; text-align: left; cursor: pointer; }
.shop-allocations .shop-check input { flex: none; }
.shop-allocations strong { font-size: .9rem; }
.shop-empty { padding: 18px 0; }
.shopping-page :is(button, select, input, a, summary):focus-visible { outline: 2px solid #386a46; outline-offset: 2px; }
@media (hover: hover) {
  .shop-row:hover { background: #f5f7f1; }
  .shop-item-toggle:hover .shop-item-name { color: var(--shop-green); text-decoration: underline; text-underline-offset: .17em; }
}
@media (max-width: 840px) {
  .shop-table thead th:first-child { width: 2.6rem; font-size: 0; }
  .shop-table thead th:first-child::before { content: "✓"; font: 600 .95rem var(--body); }
  .shop-table thead th, .shop-row > td, .shop-row > th { padding-inline: 7px; }
  .shop-table thead .shop-cart { width: 4rem; }
}
@media (max-width: 680px) {
  .shopping-page.wrap { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .shop-summary { margin: 15px 0; padding-block: 12px; }
  .shop-stat { padding-inline: 10px; }
  .shop-stat:last-child { padding-right: 0; }
  .shop-stat b { font-size: clamp(1.08rem, 5vw, 1.8rem); }
  .shop-stat small, .shop-stat span { font-size: .78rem; }
  .shop-toolbar { grid-template-columns: minmax(0, 1fr); }
  .shop-sort { min-width: 0; }
  .shop-sort select { min-width: 0; max-width: 11rem; }
  .shop-outstanding { flex: none; }
  .shop-filters { gap: 2px; }
  .shop-filters button { padding: 5px 9px; }
  .shop-results-meta { margin-top: 12px; }
  .shop-table thead th:first-child { width: 8%; }
  .shop-table thead .shop-item { width: 41%; }
  .shop-table thead .shop-qty { width: 12%; }
  .shop-table thead .shop-cart { width: 17%; }
  .shop-table thead .shop-amount { width: 22%; }
  .shop-table :is(.shop-rate, .shop-source) { display: none; }
  .shop-cart-quantity { min-height: 44px; padding-inline: 2px; }
  .shop-row > td, .shop-row > th, .shop-table thead th { padding-inline: 4px; }
  .shop-row > td { padding-block: 6px; }
  .shop-row .shop-item-toggle { min-height: 27px; }
  .shop-row .shop-check { padding: 0; }
  .shop-row .shop-check label { min-width: 27px; min-height: 38px; }
  .shop-table .shop-mobile-source { display: block; width: fit-content; max-width: 100%; margin-left: 14px; font-size: .8125rem; overflow-wrap: anywhere; }
  .shop-table .shop-amount .shop-mobile-rate { display: block; color: var(--shop-muted); font: .78rem/1.25 var(--body); }
  .shop-group-head th { padding: 8px; }
  .shop-group-amount { margin-left: .4em; }
  .shop-detail > td { padding: 10px; }
}

.shop-price-trigger {
  display: inline-grid;
  align-content: center;
  min-height: 40px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}
.shop-rate .shop-price-trigger > span, .shop-amount .shop-price-trigger > .shop-muted,
.shop-price-trigger:hover > :first-child { text-decoration: underline dotted; text-underline-offset: .2em; }
.shop-price-editor {
  box-sizing: border-box;
  width: min(24rem, calc(100% - 2rem));
  margin: auto;
  padding: 20px;
  border: 1px solid var(--shop-rule);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}
.shop-price-editor::backdrop { background: rgb(21 35 26 / 38%); }
.shop-price-editor h2 { margin: 0 0 14px; font: 550 1.35rem/1.25 var(--display); }
.shop-price-editor label { display: block; margin-bottom: 5px; font: 550 .9375rem/1.35 var(--body); }
.shop-price-editor input {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 6px 10px;
  border: 1px solid #94a698; border-radius: 5px; font: 1rem var(--body);
}
.shop-price-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.shop-price-actions button {
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--shop-rule); border-radius: 6px;
  background: transparent; color: var(--shop-green); font: 550 .875rem var(--body);
}
.shop-price-actions .shop-price-restore { margin-right: auto; padding-inline: 0; border-color: transparent; }
.shop-price-actions .shop-price-save { background: var(--shop-green); color: white; }
@media (max-width: 680px) {
  .shop-amount .shop-price-trigger > :first-child { text-decoration: underline dotted; text-underline-offset: .2em; }
}

.shop-table tfoot td { padding: .6rem .7rem; border-top: 1px solid var(--shop-rule); }
.shop-table tfoot td span { float: right; color: var(--shop-muted); }
.shop-table tfoot[hidden] { display: none; }
.shop-offer small { display: block; margin-top: .15rem; }


.purchase-list[hidden], .purchase-list [hidden] { display: none; }
.purchase-view-toggle, .purchase-toolbar select {
  min-height: 40px;
  padding: .35rem .65rem;
  border: 1px solid var(--shop-line, #ccd7cc);
  border-radius: 5px;
  color: inherit;
  background: var(--shop-paper, white);
  font: inherit;
}
.purchase-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-block: .9rem; }
.purchase-toolbar label { display: flex; gap: .35rem; align-items: center; }
.purchase-summary { font-weight: 700; }
.purchase-table { width: 100%; min-width: 38rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.purchase-table :is(th, td) { padding: .55rem .6rem; border-bottom: 1px solid var(--shop-line, #ccd7cc); vertical-align: top; }
.purchase-table th { text-align: left; }
.purchase-table td, .purchase-table thead th:not(:first-child) { text-align: right; }
.purchase-table thead th { background: var(--shop-paper, white); }
.purchase-table [scope=row] { width: 39%; font-weight: 650; }
.purchase-table .purchase-group { background: var(--shop-tint, #edf2e9); }
.purchase-table small { display: block; font-size: .8125rem; font-weight: 400; }
.purchase-table td small { color: var(--shop-muted, #4b5a51); }
.purchase-table details { margin-top: .24rem; font-weight: 400; font-size: .8125rem; }
.purchase-table summary { cursor: pointer; color: var(--shop-muted, #4b5a51); }
.purchase-table details small { margin-top: .28rem; }
.purchase-missing { color: #773711; font-weight: 700; }

.purchase-cell-edit {
  padding: .15rem .15rem;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: .2em;
  cursor: pointer;
}
.purchase-cell-edit:focus-visible { outline: 2px solid var(--shop-green, #245d3a); }
.purchase-editor label:not(:first-child) { margin-top: .45rem; }
