/* Stage B lane logger: Inventory tile, Logger, Finish (reconcile), Inventory, owned-lot details, Confirm purchased.
   Same field-handheld language as app.css (navy + teal, condensed type, big targets). Chrome 73 rules: no flex gap
   (grid gap / margins), no clamp/min/max, aspect-ratio, inset, :is/:where/:has, dvh, color-mix. */

/* ---------- home: Inventory | Selling row (one slim row, two halves) ---------- */
.tile-pair { grid-column: span 3; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; }
.tile.is-half { height: 46px; flex-direction: row; justify-content: flex-start; padding: 0 10px; }
.tile.is-half > * + * { margin-top: 0; margin-left: 8px; }
.tile.is-half .tile-ic { width: 24px; height: 24px; }
.tile.is-half .tile-label { font-size: 15px; }
.tile.is-half .tile-tag { margin: 0 0 0 auto; font-size: 10px; letter-spacing: .06em; text-align: right; line-height: 1.1; }
.tile.is-half .tile-soon { margin: 0 0 0 auto; }
.tile.is-inv { background: linear-gradient(160deg, #1B4A55, var(--tile-a) 80%); }
.tile.is-inv::after { opacity: 1; }
.tile.is-inv .tile-tag { color: var(--teal); }

/* ---------- logger bottom bar ---------- */
.scanbar.is-logger { border-top-color: var(--gold); }
.scanbar.is-logger .sb-meta b { color: var(--gold); letter-spacing: .04em; }

/* ---------- Logger: tally counter ---------- */
.lg { display: grid; grid-template-columns: 100%; align-content: start; padding-bottom: 12px; }
.lg-count { background: var(--navy); color: #fff; padding: 10px 12px 12px; border-bottom: 3px solid var(--teal);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 6px, rgba(255,255,255,0) 6px 12px); }
.lg-name { display: flex; align-items: center; justify-content: space-between; min-width: 0; }
.lg-name b { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lg-mode { flex: none; margin-left: 8px; font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: #A9BCC6; border: 1px solid #35505E; border-radius: 3px; padding: 2px 5px; }
.lg-mode.is-live { color: var(--navy); background: var(--gold); border-color: var(--gold); }
.lg-dials { display: grid; grid-template-columns: 1fr 1.35fr 1fr; grid-gap: 6px; margin-top: 8px; }
.lg-dial { background: #08141A; border: 1px solid #23404E; border-radius: 6px; box-shadow: inset 0 2px 6px rgba(0,0,0,.55); padding: 4px 6px 2px; text-align: center; }
.lg-dial small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: .14em; color: #7F98A4; }
.lg-dial b { display: block; font: 700 32px/1.05 var(--mono); color: #E8F0F3; letter-spacing: -.02em; }
.lg-units b { font-size: 40px; color: var(--teal); text-shadow: 0 0 14px rgba(49,199,175,.35); }
.lg-pend b { color: #7F98A4; }
.lg-pend b.is-warn { color: var(--gold); }
.lg-acts { display: grid; grid-template-columns: 1fr 1.35fr; grid-gap: 6px; margin-top: 8px; }
.lg-undo, .lg-finish { min-height: 52px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 0 6px; }
.lg-undo { border: 2px solid #46636F; color: #fff; }
.lg-undo b, .lg-finish b { font-size: 16px; font-weight: 900; letter-spacing: .1em; }
.lg-undo small, .lg-finish small { font-size: 12px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-undo small { color: #A9BCC6; }
.lg-undo:active { background: #1D3644; }
.lg-undo:disabled { opacity: .45; }
.lg-finish { background: var(--teal); color: var(--navy); box-shadow: 0 2px 0 var(--teal-ink); }
.lg-finish:active { transform: translateY(1px); box-shadow: none; }
.lg-finish:disabled { background: #2E4652; color: #7F98A4; box-shadow: none; }

/* ---------- Logger: lines ---------- */
.lg-list { background: var(--card); border-bottom: 1px solid var(--line); }
.lg-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "img main x" "img foot foot"; grid-column-gap: 10px; align-items: center;
  padding: 8px 6px 8px 12px; border-bottom: 1px solid var(--line-2); }
.lg-row:last-child { border-bottom: 0; }
.lg-row.is-flash { animation: lgflash 1.2s ease-out; }
@keyframes lgflash { 0% { background: rgba(49,199,175,.45); } 100% { background: rgba(49,199,175,0); } }
.lg-row > .photo { grid-area: img; align-self: start; }
.lg-img { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.lg-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.lg-title { font-size: 15.5px; font-weight: 800; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.lg-title.is-unknown { color: var(--ink-3); font-style: italic; }
.lg-main small { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lg-x { grid-area: x; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); align-self: start; margin-top: -6px; }
.lg-x .ic { width: 18px; height: 18px; }
.lg-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-right: 6px; }
.lg-cost { height: 46px; padding: 0 10px; border-radius: 4px; border: 2px solid var(--navy); font-size: 15px; font-weight: 800; background: #fff; }
.lg-cost.is-pending { border-color: var(--gold); background: #FBF1DC; color: var(--gold-ink); font-size: 13px; letter-spacing: .06em; font-weight: 900; }
.lg-qty { display: flex; align-items: center; flex: none; border: 2px solid var(--navy); border-radius: 6px; overflow: hidden; background: #fff; }
.lg-step { width: 48px; height: 46px; font-size: 24px; font-weight: 700; line-height: 1; color: var(--navy); background: #EEF2F5; }
.lg-step:active { background: var(--teal); }
.lg-n { min-width: 40px; text-align: center; font: 700 20px/1 var(--mono); }
.lg-empty { margin: 14px 12px 0; padding: 26px 12px; border: 2px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink-3); }
.lg-empty-ic { width: 48px; height: 48px; color: var(--teal-ink); margin-bottom: 8px; }
.lg-empty b { font-size: 18px; color: var(--ink); }
.lg-empty span { font-size: 14px; margin-top: 4px; }

/* ---------- Logger: new trip ---------- */
.lg-hero { display: grid; grid-template-columns: 44px 1fr; grid-column-gap: 10px; align-items: center; background: var(--navy); color: #fff; border-radius: 8px; padding: 12px; border-left: 5px solid var(--teal); }
.lg-hero-ic { width: 40px; height: 40px; color: var(--teal); grid-row: span 2; }
.lg-hero b { font-size: 19px; font-weight: 800; }
.lg-hero span { font-size: 13.5px; color: #B7C8D0; line-height: 1.3; }
.lg-modes .seg-b { font-size: 14.5px; line-height: 1.15; padding: 0 6px; }
.lg-start { width: 100%; height: 58px; font-size: 18px; }

/* keypad reused for a line cost: no qty / tax keys */
.kp-logger .kp-qty, .kp-logger .kp-tax { display: none; }
.kp-logger .kp-foot { grid-template-columns: 1fr; }

/* ---------- Finish (reconcile) ---------- */
.rc { padding-bottom: 20px; }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.rc-head b { font-size: 17px; font-weight: 800; width: 100%; }
.rc-head > span { font-size: 14px; color: var(--ink-2); font-weight: 700; margin: 4px 8px 0 0; }
.badge-pend, .badge-ok { display: inline-block; font-size: 11.5px !important; font-weight: 900 !important; letter-spacing: .08em; padding: 2px 6px; border-radius: 3px; }
.badge-pend { background: var(--gold); color: var(--navy) !important; }
.badge-ok { background: var(--green); color: #fff !important; }
.rc-list { display: grid; grid-template-columns: 100%; grid-row-gap: 8px; }
.rc-line { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.rc-top { display: grid; grid-template-columns: 44px 1fr; grid-column-gap: 10px; align-items: center; }
.rc-grid { display: grid; grid-template-columns: auto 1fr .8fr; grid-column-gap: 8px; align-items: stretch; margin-top: 8px; }
.rc-cost, .rc-sum { display: flex; flex-direction: column; justify-content: center; border-radius: 6px; padding: 0 8px; line-height: 1.1; min-height: 44px; }
.rc-cost { border: 2px solid var(--navy); background: #fff; text-align: left; }
.rc-cost small, .rc-sum small { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: var(--ink-3); }
.rc-cost b { font: 700 18px/1.1 var(--mono); }
.rc-cost.is-pending { border-color: var(--gold); background: #FBF1DC; }
.rc-cost.is-pending b { font: 900 15px/1.2 var(--font); letter-spacing: .08em; color: var(--gold-ink); }
.rc-sum { background: #EEF2F5; text-align: right; align-items: flex-end; }
.rc-sum b { font: 700 16px/1.1 var(--mono); }
.rc-cond { margin-top: 8px; border-width: 1.5px; }
.rc-cond .seg-b { min-height: 46px; font-size: 14px; }
.rc-receipt { display: grid; grid-template-columns: 1fr 1fr; grid-column-gap: 8px; }
.rc-f { display: block; }
.rc-f small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--ink-2); text-transform: uppercase; margin-bottom: 3px; }
.rc-in { display: flex; align-items: center; position: relative; }
.rc-in i { position: absolute; left: 10px; font-style: normal; font-weight: 800; color: var(--ink-3); font-size: 18px; }
.rc-money { padding-left: 24px; font-family: var(--mono); font-size: 20px; }
.rc-money[data-bad="yes"] { border-color: var(--red); }
.rc-check { border-radius: 8px; padding: 10px 12px; border-left: 6px solid var(--ink-3); background: #EEF2F5; display: flex; flex-direction: column; }
.rc-check b { font-size: 17px; font-weight: 900; }
.rc-math { font: 600 13px/1.3 var(--mono); color: var(--ink-2); margin-top: 3px; }
.rc-check[data-status="MATCH"] { background: #E3F6EC; border-left-color: var(--green); color: var(--green-ink); }
.rc-check[data-status="OFF"] { background: #FBE7E7; border-left-color: var(--red); color: var(--red-ink); }
.rc-check[data-status="PENDING"] { background: #FBF1DC; border-left-color: var(--gold); color: var(--gold-ink); }
.rc-bar { display: grid; grid-template-columns: 1fr 1.5fr; grid-gap: 8px; padding: 8px 12px; background: var(--navy); border-top: 3px solid var(--teal); }
.rc-bar .btn { min-height: 50px; padding: 0 8px; }
.rc-bar .btn-line { background: transparent; color: #fff; border-color: #46636F; }

/* ---------- Inventory list ---------- */
.inv { padding-bottom: 20px; }
.inv-live, .inv-start { display: flex; align-items: center; width: 100%; min-height: 58px; border-radius: 8px; padding: 0 12px; text-align: left; }
.inv-live { background: var(--navy); color: #fff; border-left: 5px solid var(--gold); }
.inv-live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); flex: none; margin-right: 10px; animation: invpulse 1.4s ease-in-out infinite; }
@keyframes invpulse { 50% { box-shadow: 0 0 0 6px rgba(233,180,76,0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(233,180,76,.5); } }
.inv-live-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inv-live-main b { font-size: 17px; font-weight: 800; }
.inv-live-main small { font-size: 13px; color: #B7C8D0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-live-go { flex: none; margin-left: 8px; background: var(--gold); color: var(--navy); font-weight: 900; letter-spacing: .08em; font-size: 14px; padding: 8px 10px; border-radius: 4px; }
.inv-start { border: 2px dashed var(--teal-ink); background: #E6F6F2; color: var(--navy); }
.inv-start-ic { width: 30px; height: 30px; color: var(--teal-ink); margin-right: 10px; }
.inv-start > span { display: flex; flex-direction: column; }
.inv-start b { font-size: 17px; font-weight: 800; }
.inv-start small { font-size: 13px; color: var(--ink-2); }
.inv-sum { display: grid; grid-template-columns: .8fr .9fr 1.3fr .8fr; grid-gap: 4px; }
.inv-stat { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; display: flex; flex-direction: column; min-width: 0; }
.inv-stat small { font-size: 10px; font-weight: 900; letter-spacing: .08em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-stat b { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-stat.is-warn b { color: var(--gold-ink); }
.inv-filters { display: grid; grid-template-columns: .6fr 1fr 1fr .85fr; border: 2px solid var(--navy); border-radius: var(--r); overflow: hidden; }
.inv-f { min-height: 44px; font-size: 13.5px; font-weight: 800; line-height: 1.1; padding: 0 4px; background: #fff; border-right: 1px solid var(--line); }
.inv-f:last-child { border-right: 0; }
.inv-f.is-active { background: var(--navy); color: var(--teal); }
.inv-list { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.inv-row { display: block; width: 100%; text-align: left; border-bottom: 1px solid var(--line-2); }
.inv-row:last-child { border-bottom: 0; }
.inv-row:active { background: #F1F5F7; }
.inv-row.is-pend { box-shadow: inset 4px 0 0 var(--gold); }
.inv-row.is-ready { box-shadow: inset 4px 0 0 var(--teal); }
.inv-row.is-out { opacity: .72; }
.inv-grid { display: grid; grid-template-columns: 48px 1fr auto; grid-column-gap: 10px; align-items: center; padding: 8px 10px 8px 12px; }
.inv-img { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.inv-main { display: flex; flex-direction: column; min-width: 0; }
.inv-main b { font-size: 15.5px; font-weight: 800; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.inv-main b.is-unknown { color: var(--ink-3); font-style: italic; }
.inv-main small { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.inv-qty em { font-style: normal; font-weight: 800; color: var(--ink); }
.inv-appr { color: var(--green-ink); font-weight: 800; }
.inv-sell { color: var(--teal-ink); font-weight: 800; }
.inv-right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.inv-tag { font-size: 10px; font-weight: 900; letter-spacing: .08em; padding: 2px 5px; border-radius: 3px; background: #DCE3E8; color: var(--ink-2); white-space: nowrap; }
.inv-tag.is-pend { background: var(--gold); color: var(--navy); }
.inv-tag.is-ready { background: var(--teal); color: var(--navy); }
.inv-tag.is-out { background: var(--ink-2); color: #fff; }
.inv-cost { font-size: 17px; font-weight: 800; margin-top: 4px; }
.inv-right small { font-size: 11px; color: var(--ink-3); }
.inv-empty { padding: 26px 16px; text-align: center; color: var(--ink-3); background: var(--card); border: 2px dashed var(--line); border-radius: 8px; }

/* ---------- owned lot ---------- */
.lot { padding-bottom: 20px; }
.lot-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lot-top { display: grid; grid-template-columns: 76px 1fr; grid-column-gap: 12px; padding: 12px; align-items: start; }
.lot-img { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.lot-id { display: flex; flex-direction: column; min-width: 0; }
.lot-id > b { font-size: 17px; font-weight: 800; line-height: 1.15; }
.lot-id > b.is-unknown { color: var(--ink-3); font-style: italic; }
.lot-id > small { font: 600 13px var(--mono); color: var(--ink-3); margin-top: 3px; }
.lot-chips { display: flex; flex-wrap: wrap; margin-top: 4px; }
.lot-chips .chip { margin: 4px 6px 0 0; }
.chip.lot-pend { background: var(--gold); color: var(--navy); }
.lot-qty { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy); color: #fff; }
.lq { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; border-right: 1px solid #23404E; }
.lq:last-child { border-right: 0; }
.lq b { font: 700 24px/1 var(--mono); }
.lq small { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: #8FA6B1; margin-top: 3px; }
.lq.is-main b { color: var(--teal); font-size: 28px; }
.lot-rows { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px; display: grid; grid-template-columns: 100%; }
.lot-rows .note { margin: 8px 0; }
.lot-kv { display: flex; align-items: baseline; justify-content: space-between; min-height: 40px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.lot-kv:last-child { border-bottom: 0; }
.lot-kv span { font-size: 14.5px; color: var(--ink-2); font-weight: 600; }
.lot-kv b { font-size: 16px; font-weight: 800; text-align: right; margin-left: 10px; }
.lot-kv.is-strong b { font-size: 18px; }
.lot-kv.is-warn b { color: var(--gold-ink); }
.lot-check { font-size: 12px; letter-spacing: .02em; text-transform: none; padding: 2px 6px; border-radius: 3px; }
.lot-check.is-ok { background: #E3F6EC; color: var(--green-ink); }
.lot-check.is-bad { background: #FBE7E7; color: var(--red-ink); }
.lot-moves { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.lot-move { display: grid; grid-template-columns: auto 1fr auto; grid-column-gap: 10px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line-2); }
.lot-move:last-child { border-bottom: 0; }
.lm-when { font: 600 12.5px var(--mono); color: var(--ink-3); }
.lm-what { font-size: 15px; font-weight: 700; }
.lm-what small { color: var(--ink-3); font-weight: 600; }
.lm-d { font: 700 18px var(--mono); color: var(--green-ink); }
.lm-d.is-neg { color: var(--red-ink); }
.lot-others { display: grid; grid-template-columns: 100%; grid-row-gap: 6px; }
.lot-other { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; font-size: 14.5px; }
.lot-other b { font-size: 14.5px; }

/* ---------- Confirm purchased (details) ---------- */
.act-buy { background: var(--teal); color: var(--navy); box-shadow: 0 2px 0 var(--teal-ink); }
.act-buy .ic { color: var(--navy); }
.act-owned { font-weight: 700; margin-left: 2px; }
.cp-body { display: grid; grid-template-columns: 100%; grid-row-gap: 10px; padding: 12px; }
.cp-item { display: grid; grid-template-columns: 44px 1fr; grid-column-gap: 10px; align-items: center; }
.cp-grid { display: grid; grid-template-columns: auto 1fr; grid-column-gap: 8px; }
.cp-cell { display: flex; flex-direction: column; justify-content: center; }
.cp-cell > small { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 3px; }
.cp-qty { height: 48px; }
.cp-qty .lg-step { height: 44px; }
.cp-cost { border: 2px solid var(--navy); border-radius: 6px; padding: 4px 10px; text-align: left; background: #fff; }
.cp-cost b { font: 700 24px/1.1 var(--mono); }
.cp-cost.is-pending { border-color: var(--gold); background: #FBF1DC; }
.cp-cost.is-pending b { color: var(--gold-ink); font: 900 20px/1.1 var(--font); letter-spacing: .08em; }
.cp-cond .seg-b { min-height: 44px; }
.cp-tax { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 6px; background: #EEF2F5; font-size: 14.5px; font-weight: 700; color: var(--ink-2); text-align: left; }
.cp-tax.is-on { background: #E6F6F2; color: var(--teal-ink); }
.cp-total { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px; }
.cp-total span { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.cp-total b { font: 700 26px var(--mono); }
.cp-go { width: 100%; height: 56px; font-size: 18px; }
.rc-top .lg-main, .cp-item .lg-main { grid-area: auto; }
