/* R&R Register: builds on /style.css */
.wide-main { max-width: 1280px; }
.ghost-link { color: var(--muted); font-weight: 600; text-decoration: none; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.ghost-link:hover { background: var(--accent-soft); color: var(--accent); }
body.owner .staff-only { display: none; }
textarea { font: inherit; color: var(--text); border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; width: 100%; margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin-top: 14px; }
label.check input { width: 22px; height: 22px; min-height: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1.2fr .6fr 1.2fr; gap: 10px; }
.card h3 + label, form.card h3 { margin-top: 18px; }
form.card h3:first-child { margin-top: 0; }

.banner { max-width: 1280px; margin: 12px auto 0; padding: 10px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-weight: 600; width: calc(100% - 32px); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner a { color: inherit; }

/* Two-column register layout */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 16px; align-items: start; }
.pos-right { position: sticky; top: 72px; margin: 0; max-height: calc(100vh - 90px); overflow: auto; }
@media (max-width: 900px) { .pos-grid { grid-template-columns: 1fr; } .pos-right { position: static; max-height: none; } }
.left-actions { margin: 10px 0; flex-wrap: wrap; }

.results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.results li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.results li:hover { border-color: var(--accent); }
.results li .thumb { width: 48px; height: 48px; }
.results li .grow { flex: 1; min-width: 0; }
.results li .t { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results li .p { font-weight: 800; font-size: 17px; }
.results li.out { opacity: .6; }
.results .empty { grid-column: 1 / -1; cursor: default; color: var(--muted); }

/* Order panel */
.ord-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ord-head h3 { margin: 0; }
.kind-tag { font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.kind-tag.refund { background: var(--bad-soft); color: var(--bad); }
.kind-tag.trade { background: var(--good-soft); color: var(--good); }
.kind-tag.held { background: var(--warn-soft); color: var(--warn); }
.cust-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: 15px; }
.cust-row button { min-height: 36px; padding: 6px 10px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines .l1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lines .lt { font-weight: 600; min-width: 0; }
.lines .lp { font-weight: 800; white-space: nowrap; }
.lines .l2 { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.lines .l2 button { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.lines .disc { color: var(--good); font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.qty button { border: 0; min-height: 32px; padding: 2px 10px; background: transparent; font-weight: 800; }
.qty span { min-width: 26px; text-align: center; font-weight: 700; color: var(--text); }
.totals { margin: 12px 0; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 24px; font-weight: 800; border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; }
.totals .due { font-size: 20px; font-weight: 800; color: var(--accent); }
.totals .pay { color: var(--muted); }
.totals .pay button { min-height: 0; padding: 0 6px; border: 0; background: none; color: var(--bad); }
.pay-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.pay-btns button { font-weight: 700; min-height: 54px; }
.pay-btns .cash { background: var(--good); color: #fff; border-color: var(--good); }
.ord-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ord-actions button { flex: 1; min-width: 90px; }
.complete-btn { width: 100%; min-height: 60px; font-size: 20px; margin-top: 10px; }
.empty-order { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-order b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* Keypad-ish money entry */
.money-input { font-size: 30px; font-weight: 800; text-align: right; min-height: 64px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.quick button { font-weight: 700; }
.change-big { font-size: 44px; font-weight: 900; color: var(--good); text-align: center; margin: 10px 0; }

/* Lists */
.items li .amt { font-weight: 800; white-space: nowrap; }
.neg { color: var(--bad); }

/* Report */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
table.tbl td.r, table.tbl th.r { text-align: right; }

/* Till denomination counter */
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.denoms label { margin: 0; }
.denoms input { text-align: right; }
.over { color: var(--good); font-weight: 800; } .short { color: var(--bad); font-weight: 800; }

/* Receipt: on screen in a modal, printed narrow for thermal printers (works on letter paper too) */
.receipt { font: 13px/1.35 ui-monospace, Menlo, Consolas, monospace; color: #000; background: #fff; width: 72mm; margin: 0 auto; padding: 4mm 2mm; }
.receipt .c { text-align: center; }
.receipt .big { font-size: 16px; font-weight: 700; }
.receipt .row { display: flex; justify-content: space-between; gap: 6px; }
.receipt .row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .tot { font-weight: 700; font-size: 15px; }
.receipt .sub { padding-left: 10px; }
.receipt svg { display: block; margin: 6px auto 0; max-width: 100%; }
.receipt-wrap { background: var(--line); padding: 12px; border-radius: 10px; max-height: 55vh; overflow: auto; }

/* Price tag for register-created items: 2x1" */
.label.tag2x1 { width: 2in; height: 1in; padding: .04in .06in; justify-content: space-between; }
.label.tag2x1 .tt { font: 700 9px/1.1 system-ui, sans-serif; max-height: 2.2em; overflow: hidden; width: 100%; }
.label.tag2x1 .tp { font: 900 16px/1 system-ui, sans-serif; }
.label.tag2x1 svg { width: 1.85in; height: .42in; }

/* v2 */
.test-chip { font-size: 11px; font-weight: 900; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.subtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.subtabs button { border-radius: 999px; font-weight: 700; min-height: 40px; }
.subtabs button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; line-height: 20px; }
.count:empty { display: none; }
.offer-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
@media (max-width: 720px) { .offer-preview { grid-template-columns: 1fr 1fr; } }
.offer-preview:empty { display: none; }
.offer-preview div { background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; }
.offer-preview .k { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.offer-preview .v { font-size: 20px; font-weight: 800; }
.prod-filters { grid-template-columns: 1fr 180px 180px auto; }
.rep-filters { grid-template-columns: 180px 160px 160px auto; justify-content: start; }
@media (max-width: 720px) { .prod-filters, .rep-filters { grid-template-columns: 1fr 1fr; } }
.items li .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.btnlink { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; }
.btnlink:hover { border-color: var(--accent); color: var(--accent); }
.pay-btns.five { grid-template-columns: repeat(5, 1fr); }
.pay-btns.five button { font-size: 14px; padding: 6px; }
.modal.wide { max-width: 860px; }
.cond-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cond-table th { font-size: 12px; color: var(--muted); text-align: left; padding: 4px; }
.cond-table td { padding: 3px 4px; }
.cond-table input { min-height: 36px; padding: 6px 8px; }
.cond-table input[type=checkbox] { width: 20px; height: 20px; min-height: 0; }
.cond-table td.n input { width: 80px; }
.cat-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; margin-top: 6px; }
.cat-checks label { margin: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 15px; margin: 8px 0; }
.kv span:nth-child(odd) { color: var(--muted); }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 8px 0; }

/* trade-in rework */
.cat-chips, .cond-pick .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chips button, .cond-pick button { min-height: 38px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.cat-chips button.on, .cond-pick button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.cond-pick { display: grid; gap: 6px; margin-top: 6px; }
.cond-pick .grp { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; }
.cond-pick .grp.nogrp { grid-template-columns: 1fr; }
.cond-pick .gname { font-size: 13px; font-weight: 700; color: var(--muted); }
.price-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.price-fields label { margin: 0; }
.price-fields label.need input { border-color: var(--accent); }
.payout .pay-btns button { line-height: 1.25; }
.split-box { background: var(--accent-soft); border-radius: 12px; padding: 12px; margin-top: 4px; }
.split-box input[type=range] { width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; accent-color: var(--accent); height: 32px; }
.split-labels { display: flex; justify-content: space-between; font-size: 15px; }
.split-labels b { font-size: 20px; }
.split-exact { margin-top: 8px; }
.sugg-wrap { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 280px; overflow: auto; }
.sugg li { padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 15px; }
.sugg li:hover, .sugg li.on { background: var(--accent-soft); }
#tr-plat-other { margin-top: 6px; }
.inline-select { width: auto; min-height: 30px; padding: 2px 6px; font-size: 13px; display: inline-block; }
#tr-plat-wrap[hidden] + label { grid-column: 1 / -1; }
.lines .qty.small button { min-height: 26px; padding: 0 8px; }

/* Two apps from one page: Price & Add (body.app-priceadd) shows only its screens; the register doesn't show them. */
body.app-priceadd #tabs a:not([data-tab="books"]):not([data-tab="settings"]),
body.app-priceadd .test-chip, body.app-priceadd .ghost-link,
body.app-priceadd #set-form, body.app-priceadd #view-settings > .card:last-child,
body.app-register #tabs a[data-tab="books"], body.app-register #book-set-form, body.app-register #people-card { display: none !important; }
body.app-priceadd #people-card, body.app-priceadd #book-set-form { display: block; }
.setup-form { text-align: left; margin-top: 12px; }
.setup-form label { margin-bottom: 10px; }
/* Whose stuff: a banner on every add, from who is signed in. Stef's sign-in only sees Price & add. */
.owner-banner { border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 15px; }
.owner-banner b { font-size: 17px; letter-spacing: .02em; }
.owner-banner span { font-size: 13px; opacity: .85; }
.owner-banner.store { background: #e7f6ec; color: #17663a; border: 2px solid #2f9e5b; }
.owner-banner.stef { background: #fff1e0; color: #8a4b00; border: 2px solid #e08a1e; }
@media (prefers-color-scheme: dark) {
  .owner-banner.store { background: #12301f; color: #8fe0b0; border-color: #2f9e5b; }
  .owner-banner.stef { background: #33230d; color: #ffc27a; border-color: #e08a1e; }
}
body.stef-user #tabs a:not([data-tab="books"]), body.stef-user .ghost-link { display: none; }
/* Phone camera scanning */
.cam-box { margin: 10px 0; }
.cam-view { border-radius: 12px; overflow: hidden; background: #000; }
.cam-view video { width: 100% !important; }
.ocr-btn { flex-direction: column; gap: 0; line-height: 1; font-weight: 800; font-size: 13px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); margin: 0; padding: 0 6px; }
.ocr-btn .ocr-sub { font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.ocr-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cam-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
@media (max-width: 720px) { .scanbar .primary { padding: 0 12px; } }
/* Phones: Books scan box on its own row, the barcode / ISBN photo / Look up buttons under it. */
@media (max-width: 520px) {
  #book-scan { flex-wrap: wrap; }
  #book-scan input { flex: 1 1 100%; }
  #book-scan .cam-btn, #book-scan .primary { flex: 1 1 0; min-height: 52px; }
}

/* Books */
.book-head { display: flex; gap: 14px; align-items: flex-start; }
.book-head .t { font-size: 24px; font-weight: 800; line-height: 1.2; color: var(--accent); }
/* The name that goes on the price tag: big and in the accent color so it stands out from the rest. */
.tag-name { font-weight: 700; }
.tag-name input, .tag-name textarea { font-size: 21px; font-weight: 800; color: var(--accent); min-height: 54px; line-height: 1.25; resize: none; font-family: inherit; }
/* The price that goes on the tag: same treatment as the name. */
.price-big { font-weight: 700; }
.price-big input { font-size: 26px; font-weight: 800; color: var(--accent); min-height: 56px; }
.book-calc b { font-size: 24px; color: var(--accent); }
.tag-name-big { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.25; margin: 4px 0 8px; }
.book-cover { width: 84px; min-width: 84px; height: 124px; object-fit: cover; border-radius: 6px; background: var(--accent-soft); }
.book-cover.none { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.book-stats { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 14px; }
.book-stats th, .book-stats td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.book-stats th:first-child, .book-stats td:first-child { text-align: left; }
.book-stats th { font-size: 12px; color: var(--muted); font-weight: 600; }
.book-conds { display: flex; flex-wrap: wrap; gap: 6px; }
.book-toggles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.book-toggles .seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
#book-batch li.clickable { cursor: pointer; }
#book-batch .small-btn { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.it-details { margin-top: 12px; }
.it-details summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--accent); }
.item-listings { list-style: none; margin: 8px 0 0; padding: 0; }
.item-listings li { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; opacity: .55; }
.item-listings li.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.item-listings input[type=checkbox] { width: 20px; height: 20px; min-height: 0; flex: none; pointer-events: none; }
.item-listings img, .item-listings .noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; background: var(--line); }
.item-listings .t { font-size: 14px; line-height: 1.3; }
.item-listings .p { text-align: right; white-space: nowrap; }
.log.listings li { align-items: flex-start; }
.log.listings li.out { opacity: .6; }
.log.listings li > span:first-child { min-width: 90px; font-size: 13px; }
.book-calc { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 15px; }
.book-calc b { font-size: 20px; }
@media (max-width: 720px) { .book-stats th:nth-child(4), .book-stats td:nth-child(4) { display: none; } .book-cover { width: 64px; min-width: 64px; height: 94px; } }

@media print {
  #print-area .receipt { width: 72mm; }
  #print-area .label.tag2x1 { break-after: page; }
  @page { margin: 4mm; }
}
@media (max-width: 720px) {
  .pay-btns { grid-template-columns: repeat(2, 1fr); }
  .three { grid-template-columns: 1fr 1fr; }
  .ghost-link { display: none; }
}
