/* Shop-only additions on top of ../styles.css (same tokens, both themes). */
:root { --zone: var(--shallow); --duty: var(--marigold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --zone: #1E4B53; --duty: #F5B33A; } }
:root[data-theme="dark"] { --zone: #1E4B53; --duty: #F5B33A; }

/* ---------- Header: the selector's name, the business under it, the account as initials ---------- */
.tabs .count { background: var(--accent); color: var(--accent-ink); }
/* Short section names in the bottom bar on phones, so "Enquiries" has room like the others */
.lbl-s { display: none; }
@media (max-width: 760px) { .tabs .lbl-l { display: none; } .tabs .lbl-s { display: inline; } }
.bar .brand-sub { font-size: 13.5px; }
.bar #shopSub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-menu { margin-left: auto; flex: none; }
.av-menu > summary.av { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font: 700 14px var(--display); color: var(--text); }
.av-menu[open] > summary.av, .av-menu > summary.av:hover { border-color: var(--accent); color: var(--accent); }
.av-menu .menu-pop { min-width: 230px; }
.menu-who { display: grid; gap: 1px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.av-menu .theme-btn { width: 100% !important; padding: 10px 12px !important; justify-content: flex-start; }
.av-menu .theme-btn .theme-lbl { display: inline !important; font-size: 15px; }

/* ---------- Shop card and site ---------- */
.shop-pick { display: grid; gap: 10px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-change { font-size: 15px; }
.eyebrow { font: 600 var(--t-sm)/1.2 var(--body); color: var(--muted); }
.shopinfo-card { display: grid; gap: 10px; }
.shop-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shop-av { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font: 700 16px var(--display); display: grid; place-items: center; flex: none; }
.shop-nm { font: 600 17px/1.2 var(--display); }
.shop-sub { font-size: 13px; color: var(--muted); }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { font-size: 12px; padding: 4px 9px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
.chip-s.key { font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.sitebox > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sitebox > summary::-webkit-details-marker { display: none; }
.sitebox > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; margin-right: 4px; }
.sitebox[open] > summary::after { transform: rotate(-135deg); }
.sitebox-t { display: grid; gap: 2px; min-width: 0; }
.sitebox-t b { font: 600 16px var(--display); }
#siteSum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------- Finder: the form gets a compact column, the results get the room ---------- */
.sel { align-items: start; }
.split > .col, .sel > .col { min-width: 0; }
@media (min-width: 961px) { .split.sel { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); } #jumpRes { display: none; } }
.unit-in { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.unit-in input { flex: 1; min-width: 0; border: 0; border-radius: 0; font: 600 20px var(--display) !important; padding: 8px 10px; background: transparent; font-variant-numeric: tabular-nums; }
.unit-in select { flex: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--surface-2); padding: 0 8px; width: auto; }
.helper { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 10px 12px; }
.helper summary { cursor: pointer; font-weight: 600; color: var(--accent); }
#r-kind { display: grid; grid-template-columns: 1fr 1fr; }
/* Search by model, HP and stage: on the page, not in a card; In stock as a tile beside the stage */
.ssearch { display: grid; gap: 12px; margin-bottom: 12px; }
.card.ssearch { background: none; border: 0; box-shadow: none; padding: 0; }
.ssearch .search { position: relative; }
.ssearch .search svg { left: 16px; }
.ssearch .search input, .ssel select { min-height: 52px; background: var(--surface); border-color: var(--line); }
.ssearch .search input { padding-left: 46px; }
.ssel { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.ssel select { width: 100%; }
.ssel .btn[hidden], .ssel #shp { display: none; }
.check.stile { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-weight: 600; white-space: nowrap; }
.check.stile:has(input:checked) { border-color: var(--accent); }
#stockAt:empty { display: none; }
.hpchips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.hpchips::-webkit-scrollbar { display: none; }
.hpchip { flex: none; height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); font: 600 14px var(--body); color: var(--text); cursor: pointer; }
.hpchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Result cards: laid out by the width of the results column, not the screen ---------- */
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; container-type: inline-size; }
.more { justify-self: center; }
.btn.more { white-space: normal; max-width: 100%; text-align: center; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pcard.top { border: 1.5px solid var(--accent); }
.pcard .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "fit fit"; gap: 10px 14px; align-items: start; padding: 14px 16px; cursor: pointer; }
.pcard .head .pname { grid-area: name; }
.pcard .head .fit { grid-area: fit; }
.pcard .head .price { grid-area: price; }
.pcard .head .yield { grid-column: 1 / -1; order: 5; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--r-md); background: var(--accent-soft); }
.pcard .head .yield b { font: 700 22px var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.pname { display: grid; gap: 3px; min-width: 0; }
.pname .t { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pname strong { font: 700 20px/1.1 var(--display); }
.pname.has-img { display: flex; gap: 12px; align-items: center; }
.pname-t { display: grid; gap: 3px; min-width: 0; }
.pimg { flex: none; width: 60px; height: 60px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.pimg.none { background: var(--surface-2); }
.pimg img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 480px) { .pimg { width: 48px; height: 48px; } }
.pphoto { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); display: grid; place-items: center; padding: 8px; margin-bottom: 12px; }
.pphoto img { max-width: 100%; max-height: 200px; object-fit: contain; }
.tag { font: 600 11px var(--body); border-radius: var(--r-sm); padding: 2px 6px; background: var(--surface-2); color: var(--muted); }
.tag.rec { background: var(--accent); color: var(--accent-ink); padding: 3px 8px; }
.fit { display: grid; gap: 5px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.fit .pill { white-space: nowrap; }
.strip { position: relative; height: 12px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.strip .zb { position: absolute; top: 0; bottom: 0; background: var(--zone); border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); }
.strip i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--duty); }
.strip .op { position: absolute; top: 2px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.price { text-align: right; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.price .mrp { font: 700 21px var(--display); white-space: nowrap; }
.price .alt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.price .rate { color: var(--accent); white-space: nowrap; }
.price .rate b { font-size: 15px; }
.pbody { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.pcard.top .pbody { background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.pbody svg { width: 100%; height: auto; display: block; }
@container (min-width: 720px) {
  .pcard .head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto; grid-template-areas: "name fit price"; align-items: center; }
  .pbody { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: break-word; word-break: normal; font-variant-numeric: tabular-nums; }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Cart: each set as its own card, then the dark total with the send button inside ---------- */
.card:has(> #cartLines) { background: none; border: 0; box-shadow: none; padding: 0; }
#cartLines.lines { gap: 12px; }
.line.cl { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.cl-top { display: flex; align-items: flex-start; gap: 12px; }
.cl-top .pill { margin-top: 6px; }
.cl-name { font: 700 20px/1.2 var(--display); letter-spacing: -.01em; }
.cl-meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.cl-meta code { color: var(--text); font-weight: 600; }
.cl-rm { flex: none; width: 42px; height: 42px; border: 0; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.cl-rm:hover { color: var(--crit); }
.pair { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-size: 14px; }
.pair-r { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; }
.pair-r + .pair-r { border-top: 1px solid var(--line); }
.pair-r code { font-size: 14.5px; color: var(--text); }
.pair-r b { font: 700 16px var(--display); font-variant-numeric: tabular-nums; }
.ptag { font: 700 12px/1 var(--body); padding: 5px 8px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); }
.ptag.motor { background: var(--warn-soft); color: var(--warn); }
.ptag.set { background: var(--surface-2); color: var(--text); }
/* Stock under each code in the cart */
.pair-r .pc { display: grid; gap: 2px; min-width: 0; }
.sk { font-size: 12.5px; font-weight: 600; }
.sk.ok { color: var(--ok); } .sk.warn { color: var(--warn); } .sk.info { color: var(--info); } .sk.out { color: var(--crit); }
.cl-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-amt { display: grid; text-align: right; gap: 1px; font-variant-numeric: tabular-nums; }
.cl-amt span { font-size: 13.5px; color: var(--muted); }
.cl-amt b { font: 700 24px/1.1 var(--display); letter-spacing: -.01em; }
.sumpanel { background: var(--text); color: var(--bg); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 8px; }
.sumpanel .totals { border: 0; padding: 0; margin: 0; background: none; display: grid; gap: 8px; }
.sumpanel .tr { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; opacity: .85; }
.sumpanel .tr, .sumpanel .tr span, .sumpanel .tr span:first-child, .sumpanel p, .sumpanel .muted { color: inherit; }
.sumpanel .tr.grand { opacity: 1; align-items: baseline; padding-top: 8px; border-color: color-mix(in srgb, currentColor 25%, transparent); }
.sumpanel .tr.grand span:first-child { font-size: 14px; }
.sumpanel .tr.grand span:last-child { font: 700 26px var(--display); }
.sumpanel p { margin: 0; font-size: 12px; opacity: .8; }
.sumbox:has(.sumpanel) { padding: 18px; display: grid; gap: 16px; }
.sumbox .sumpanel { background: none; padding: 0; border-radius: 0; }
.sumbox:not(:has(.sumpanel)) { display: contents; }
#placeBtn.big { min-height: 52px; font-size: 16px; }
.sumbox:has(.sumpanel) #placeBtn:disabled { opacity: .55; }

/* ---------- Orders and shops ---------- */
.reply { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.rrow.shop-row { grid-template-columns: minmax(0, 1fr) auto; }
#v-shops .rrow { padding: 14px 18px; }
@media (max-width: 760px) { #v-shops .view-head { flex-wrap: nowrap; align-items: center; } #v-shops .view-head p { display: none; } }

/* ---------- Add a shop: segmented scheme, big stepper, bottom sheet on phones ---------- */
.seg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface-2); border-radius: var(--r-md); padding: 4px; margin-top: 6px; }
.seg2 button { min-height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg2 button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--lift); }
.stepper-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.stepper-row > span:first-child { display: grid; gap: 2px; }
.stepper.big { border-radius: var(--r-md); }
.stepper.big button { width: 44px; min-height: 44px; font-size: 20px; }
.stepper.big input { width: 64px; border: 0; border-inline: 1px solid var(--line-2); border-radius: 0; text-align: center; font: 700 16px var(--display); }
#ns-prev .totals { background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 12px; }
#ns-prev .totals .grand { font-size: 18px; border-top-color: color-mix(in srgb, var(--accent) 25%, transparent); }
@media (max-width: 760px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92vh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  dialog.sheet .dlg { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  dialog.sheet .dlg::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: -6px auto 10px; }
  dialog.sheet .dlg-foot .row { width: 100%; }
  dialog.sheet .dlg-foot .btn.primary { flex: 1; min-height: 50px; }
}
/* Empty cart: a small box, so the shop and the form are in view on a phone */
.cart-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface); }
.cart-empty > span { display: grid; gap: 1px; min-width: 0; }
.cart-empty .btn { flex: none; min-height: 40px; }
@media (max-width: 760px) { #v-cart .view-head p { display: none; } }
/* Phones: the borewell (site details) leads, the shop being ordered for comes next */
@media (max-width: 760px) { .sel aside.col > #f { order: -1; } }

/* Pumps as a list: one ledger, a row per pump (model, fit, price), the photo and zone strip left out.
   The best fit has a Groundwater bar; a row still opens to its curve. */
.results.as-ledger { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ledger); overflow: hidden; }
.results.as-ledger > .pcard { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.results.as-ledger > .pcard:last-of-type { border-bottom: 0; }
.results.as-ledger > .pcard.top { box-shadow: inset 4px 0 0 var(--accent); }
.results.as-ledger .pimg, .results.as-ledger .strip, .results.as-ledger .fit > .small.muted:first-child { display: none; }
.results.as-ledger .pcard .head { padding: 10px 14px; gap: 4px 12px; }
.results.as-ledger .pcard .head .yield { padding: 4px 10px; }
.results.as-ledger .pcard .head .yield b { font-size: 18px; }
.results.as-ledger .pname strong { font-size: 18px; }
.results.as-ledger .price .mrp { font-size: 18px; }
.results.as-ledger > .addrow, .results.as-ledger > .more, .results.as-ledger > .btn { margin: 10px 14px; }
/* The pump models are set like their nameplates */
.pname strong { letter-spacing: .01em; }
/* The cart total: on the rail colour, with Send enquiry as the cart's one Marigold action */
.sumbox:has(.sumpanel) { background: var(--rail); color: var(--rail-ink); border-radius: var(--r-ledger); }
.sumbox:has(.sumpanel) #placeBtn { background: var(--act); border-color: var(--act); color: var(--act-ink); }
.sumbox:has(.sumpanel) #placeBtn:hover { background: var(--act-hover); }

/* Dealer portal (/shop): Leads first; no shop list or picker (they are the shop); no stock figures */
.portal-dealer nav.tabs [data-view="leads"] { order: -1; }
.portal-dealer nav.tabs [data-view="shops"], .portal-dealer #v-shops,
.portal-dealer #shopClear, .portal-dealer #newShopBtn, .portal-dealer #fshopWrap, .portal-dealer #o-change,
.portal-dealer .check.stile, .portal-dealer #stockAt { display: none !important; }
.portal-dealer .ssel { grid-template-columns: minmax(0, 1fr) auto; }
/* Leads sit in the bordered list box: give the cards, rows and Full / Short switch room inside it */
#leadRows { padding: 12px; }
