:root {
  --ink: #13251e;
  --muted: #6f7c76;
  --line: #dfe7e2;
  --paper: #f5f7f4;
  --white: #ffffff;
  --green: #12372a;
  --green-2: #1e5943;
  --mint: #dcefe5;
  --ok: #1e7a4c;
  --short: #b33b32;
  --short-bg: #fae7e3;
  --over: #a46716;
  --over-bg: #fff0d2;
  --pending: #386a8c;
  --pending-bg: #e6f1f7;
  --shadow: 0 18px 50px rgba(18, 55, 42, 0.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; min-height: 100dvh; background: var(--paper); }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(30, 89, 67, .28); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { width: min(100%, 720px); min-height: 100dvh; margin: 0 auto; background: var(--paper); padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(22px + env(safe-area-inset-top)) 20px 16px; background: var(--green); color: white; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; opacity: .68; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.035em; }
h3 { margin-bottom: 6px; font-size: 17px; }
.icon-button, .round-close { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: white; font-size: 28px; cursor: pointer; }
.round-close { flex: 0 0 auto; }
.round-close.dark { background: var(--paper); color: var(--ink); }
.view { display: none; padding: 16px; }
.view.active { display: block; }

.batch-card { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 6px 22px rgba(18,55,42,.05); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
input, select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--ink); background: #fbfcfb; font-size: 16px; }
input::placeholder { color: #a4ada8; }
.batch-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#saveState { color: var(--ok); }
#lockStoreButton { padding: 0; font-size: inherit; }
.store-access { width: min(100%, 430px); margin: 0 auto; padding: calc(42px + env(safe-area-inset-top)) 16px 20px; }
.store-access .batch-card { padding: 22px; }
.store-access h1 { margin-bottom: 12px; }
#storeAccessStatus { color: var(--muted); font-size: 13px; }
#storeAccessForm { display: grid; gap: 14px; }

.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 14px 0; }
.summary-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 13px 4px 11px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.summary-card strong { font-size: 23px; letter-spacing: -.04em; }
.summary-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.summary-card.ok strong { color: var(--ok); }
.summary-card.pending strong { color: var(--pending); }
.summary-card.short strong { color: var(--short); }
.summary-card.over strong { color: var(--over); }

.action-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.primary-action, .secondary-action, .save-button, .complete-button, .danger-button { border: 0; border-radius: 15px; font-weight: 800; cursor: pointer; }
.primary-action { grid-column: 1 / -1; min-height: 66px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; text-align: left; color: white; background: var(--green); box-shadow: 0 10px 24px rgba(18,55,42,.19); }
.primary-action .action-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 22px; }
.primary-action strong, .primary-action small { display: block; }
.primary-action small { margin-top: 2px; color: rgba(255,255,255,.68); font-size: 11px; font-weight: 600; }
.secondary-action { min-height: 50px; padding: 0 17px; border: 1px solid var(--line); color: var(--ink); background: white; }
.action-panel > .secondary-action { min-height: 50px; }
.import-action { color: var(--green-2); background: var(--mint); border-color: #c7e1d2; }
.import-status { margin: 0 0 22px; padding: 12px 14px; border: 1px solid #c7e1d2; border-radius: 13px; color: var(--green-2); background: var(--mint); font-size: 12px; font-weight: 700; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 2px 12px; }
.text-button { padding: 8px; border: 0; background: transparent; color: var(--green-2); font-size: 13px; font-weight: 800; cursor: pointer; }
.empty-state { padding: 38px 26px; border: 1px dashed #cdd8d1; border-radius: 20px; text-align: center; background: rgba(255,255,255,.55); }
.empty-state p { max-width: 390px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 17px; background: var(--mint); color: var(--green); font-size: 25px; }
.item-list { display: grid; gap: 10px; }
.item-card { position: relative; display: grid; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; cursor: pointer; }
.item-card::before { content: ""; position: absolute; inset: 13px auto 13px 0; width: 4px; border-radius: 0 5px 5px 0; background: var(--line); }
.item-card.status-ok::before { background: var(--ok); }
.item-card.status-short::before { background: var(--short); }
.item-card.status-over::before { background: var(--over); }
.item-card.status-pending::before { background: var(--pending); }
.item-card-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.item-card-top .item-note { grid-column: 1 / -1; }
.item-name { margin: 0 0 7px; font-size: 16px; font-weight: 850; line-height: 1.3; }
.item-code, .item-note { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.item-code span { margin-right: 6px; font-weight: 700; }
.item-code strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .02em; }
.item-note { margin-top: 7px; color: #6f5c3d; }
.item-quantity-grid { display: grid; grid-template-columns: 72px 72px minmax(110px, 1fr); gap: 8px; }
.qty-box { min-width: 0; padding: 8px 7px; border-radius: 11px; text-align: center; background: var(--paper); }
.qty-box span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.qty-box strong { font-size: 20px; letter-spacing: -.04em; }
.qty-box.result strong { display: block; margin-top: 2px; font-size: 14px; letter-spacing: 0; }
.qty-box.result.ok { color: var(--ok); background: var(--mint); }
.qty-box.result.short { color: var(--short); background: var(--short-bg); }
.qty-box.result.over { color: var(--over); background: var(--over-bg); }
.qty-box.result.pending { color: var(--pending); background: var(--pending-bg); }
.status-pill { align-self: start; min-width: 64px; max-width: 132px; padding: 6px 9px; border-radius: 999px; text-align: center; color: var(--muted); background: #eef2ef; font-size: 10px; line-height: 1.25; font-weight: 850; }
.status-pill.ok { color: var(--ok); background: var(--mint); }
.status-pill.short { color: var(--short); background: var(--short-bg); }
.status-pill.over { color: var(--over); background: var(--over-bg); }
.status-pill.pending { color: var(--pending); background: var(--pending-bg); }
.complete-button { width: 100%; min-height: 56px; margin-top: 16px; color: white; background: var(--green-2); font-size: 16px; }
.complete-button:disabled { opacity: .35; cursor: not-allowed; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; width: min(100%, 720px); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr; padding: 9px 20px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(18px); }
.nav-item { min-height: 50px; border: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #88928d; background: transparent; font-size: 18px; cursor: pointer; }
.nav-item strong { font-size: 11px; }
.nav-item.active { color: var(--green); background: var(--mint); }

.history-title { margin-top: 8px; }
.history-list { display: grid; gap: 11px; }
.history-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.history-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.history-actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 8px; }
.history-delete { min-height: 32px; padding: 5px 11px; border: 1px solid #f3c9c5; border-radius: 999px; color: #a83d34; background: #fff7f5; font-size: 11px; font-weight: 850; cursor: pointer; }
.history-delete:active { transform: scale(.96); }
.history-card h3 { margin: 0 0 4px; }
.history-card p { margin: 0; color: var(--muted); font-size: 12px; }
.history-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.history-badges span { padding: 5px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 800; }
.history-badges .problem { color: var(--short); background: var(--short-bg); }
.empty-history { padding: 50px 20px; text-align: center; color: var(--muted); }

.modal-layer { position: fixed; z-index: 80; inset: 0; }
.scanner-layer { background: #07110d; color: white; }
.scanner-header { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(18px + env(safe-area-inset-top)) 18px 14px; background: linear-gradient(#07110d 45%, transparent); }
.scanner-header p { margin: 0 0 3px; font-weight: 850; }
.scanner-header small { color: rgba(255,255,255,.6); }
.reader { position: absolute; inset: 0; overflow: hidden; }
.reader video { width: 100% !important; height: 100% !important; object-fit: cover !important; }
.reader > div { border: 0 !important; }
.scanner-guide { pointer-events: none; position: absolute; z-index: 3; left: 2%; right: 2%; top: 8%; height: 84%; border: 2px solid rgba(255,255,255,.9); border-radius: 19px; box-shadow: 0 0 0 999px rgba(0,0,0,.22); overflow: hidden; }
.scanner-guide span { position: absolute; left: 4%; right: 4%; top: 8%; height: 2px; background: #71e4aa; box-shadow: 0 0 15px #71e4aa; animation: scanline 2.4s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 8%; } to { top: 92%; } }
.scan-message { position: absolute; z-index: 4; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: calc(100% - 36px); max-width: 560px; padding: 12px 15px; border-radius: 13px; text-align: center; background: rgba(7,17,13,.78); backdrop-filter: blur(12px); font-size: 13px; }
.scanner-tools { position: absolute; z-index: 4; left: 50%; bottom: calc(35px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: calc(100% - 28px); }
.scanner-tool { min-height: 48px; padding: 0 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; color: white; background: rgba(7,17,13,.72); font-size: 12px; font-weight: 800; }
.scanner-tool[aria-pressed="true"] { color: #092217; background: #71e4aa; border-color: #71e4aa; }

.camera-dialog-layer { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); background: rgba(4, 13, 9, .76); backdrop-filter: blur(12px); }
.camera-dialog { width: min(100%, 480px); max-height: 90dvh; overflow: auto; padding: 25px 22px 22px; border-radius: 24px; color: var(--ink); background: white; box-shadow: 0 26px 90px rgba(0, 0, 0, .38); }
.camera-dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 16px; color: white; background: var(--green); font-size: 24px; }
.camera-dialog h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.camera-dialog-message { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.camera-dialog-steps { margin: 17px 0 0; padding: 15px 15px 15px 36px; border-radius: 15px; color: var(--ink); background: var(--paper); font-size: 13px; line-height: 1.75; }
.camera-dialog-tip { margin: 13px 0 0; color: #65736d; font-size: 12px; line-height: 1.6; }
.camera-dialog-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
.camera-retry-button, .camera-manual-button { min-height: 52px; border: 0; border-radius: 14px; font-weight: 850; cursor: pointer; }
.camera-retry-button { color: white; background: var(--green); }
.camera-retry-button:disabled { opacity: .55; cursor: wait; }
.camera-manual-button { color: var(--green); background: var(--mint); }

.sheet-backdrop { position: fixed; z-index: 89; inset: 0; background: rgba(12,26,20,.46); backdrop-filter: blur(2px); }
.bottom-sheet { position: fixed; z-index: 90; left: 50%; bottom: 0; width: min(100%, 720px); max-height: 92dvh; overflow: auto; transform: translateX(-50%); padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: white; box-shadow: var(--shadow); }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 16px; border-radius: 99px; background: #d7ddd9; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
#itemForm { display: grid; gap: 14px; }
#manualBarcodeForm { display: grid; gap: 12px; }
#manualBarcodeForm .form-warning { margin: 0; }
#manualBarcodeForm .text-button { min-height: 44px; }
.price-input-wrap { display: grid; grid-template-columns: 42px 1fr; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; }
.price-input-wrap > span { display: grid; min-height: 46px; place-items: center; border-right: 1px solid var(--line); color: var(--green); background: var(--mint); font-size: 17px; font-weight: 850; }
.price-input-wrap input { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.manual-price-preview { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 12px; margin-top: -4px; padding: 11px 13px; border: 1px solid #cce3d5; border-radius: 13px; background: var(--mint); }
.manual-price-preview span { color: var(--muted); font-size: 11px; font-weight: 750; }
.manual-price-preview strong { color: var(--green-2); font-size: 22px; }
.manual-price-preview p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.quantity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: grid; grid-template-columns: 42px 1fr 42px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.stepper input { min-width: 0; padding: 0; border: 0; border-radius: 0; text-align: center; font-weight: 850; background: white; }
.stepper button { border: 0; color: var(--green); background: var(--paper); font-size: 20px; font-weight: 800; }
.stepper button:disabled { color: #b8c0bc; cursor: not-allowed; }
.stepper input[readonly] { color: var(--green); background: #f1f6f3; }
.form-warning { padding: 10px 12px; border-radius: 10px; color: var(--short); background: var(--short-bg); font-size: 12px; font-weight: 700; }
.sheet-actions { display: flex; gap: 10px; margin-top: 4px; }
.save-button { flex: 1; min-height: 52px; padding: 0 18px; color: white; background: var(--green); }
.save-button:disabled { opacity: .38; cursor: not-allowed; }
.danger-button { min-height: 52px; padding: 0 16px; color: var(--short); background: var(--short-bg); }

.scan-quantity-sheet { max-height: 88dvh; }
.scan-match-card { padding: 14px 15px; border-radius: 14px; color: white; background: var(--green); }
.scan-match-card strong, .scan-match-card span { display: block; }
.scan-match-card strong { font-size: 16px; line-height: 1.35; }
.scan-match-card span { margin-top: 6px; color: rgba(255,255,255,.72); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.scan-count-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0 14px; }
.scan-count-summary div { padding: 11px 7px; border-radius: 12px; text-align: center; background: var(--paper); }
.scan-count-summary span, .scan-count-summary strong { display: block; }
.scan-count-summary span { color: var(--muted); font-size: 10px; font-weight: 750; }
.scan-count-summary strong { margin-top: 3px; font-size: 22px; }
.scan-price-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; padding: 12px; border: 1px solid #cce3d5; border-radius: 14px; background: var(--mint); }
.scan-price-card > div { padding: 8px 9px; border-radius: 10px; background: rgba(255,255,255,.72); }
.scan-price-card span, .scan-price-card strong { display: block; }
.scan-price-card span { color: var(--muted); font-size: 10px; font-weight: 750; }
.scan-price-card strong { margin-top: 4px; color: var(--green); font-size: 18px; }
.scan-price-card .sale-price strong { color: var(--green-2); font-size: 23px; }
.scan-price-card p { grid-column: 1 / -1; margin: 1px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
#scanQuantityForm { display: grid; gap: 12px; }
#scanQuantityInput { min-height: 58px; text-align: center; color: var(--green); font-size: 25px; font-weight: 900; }
.scan-quick-quantities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.scan-quick-quantities button { min-height: 43px; border: 1px solid var(--line); border-radius: 11px; color: var(--green); background: white; font-size: 12px; font-weight: 850; }
.scan-quick-quantities .remaining { grid-column: 1 / -1; color: var(--green-2); background: var(--mint); border-color: #c7e1d2; }
.scan-over-warning { padding: 10px 12px; border-radius: 11px; color: var(--over); background: var(--over-bg); font-size: 12px; font-weight: 800; }
.continue-option { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.continue-option input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--green); }
.continue-option span { margin: 0; color: var(--ink); }

.import-empty { padding: 8px 0; text-align: center; }
.import-empty > strong { display: block; margin-bottom: 7px; font-size: 18px; }
.import-empty > p { margin: 0 auto 18px; max-width: 480px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.import-empty > .save-button { width: 100%; }
.import-secondary { margin-top: 9px; }
.paste-panel { margin-top: 10px; }
.paste-panel textarea { width: 100%; min-height: 150px; resize: vertical; margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfb; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.file-summary { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; padding: 12px 14px; border-radius: 13px; background: var(--mint); }
.file-summary strong { overflow-wrap: anywhere; }
.file-summary span { color: var(--muted); font-size: 11px; }
.mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.mapping-grid label:nth-child(n+3) { grid-column: span 1; }
.preview-heading { display: flex; justify-content: space-between; gap: 12px; margin: 17px 0 8px; font-size: 12px; }
.preview-heading span { color: var(--muted); text-align: right; }
.table-wrap { max-height: 27dvh; overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12px; }
.table-wrap th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; text-align: left; color: var(--muted); background: #eef2ef; }
.table-wrap td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.table-wrap td:first-child { max-width: 110px; overflow-wrap: anywhere; }
.table-wrap td:first-child strong, .table-wrap td:first-child small { display: block; }
.table-wrap td:first-child small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 650; white-space: nowrap; }
.table-wrap .preview-end td { padding: 10px; color: var(--ok); text-align: center; background: var(--mint); font-weight: 800; }
.import-issues { display: grid; gap: 7px; margin-top: 10px; padding: 12px; border: 1px solid #f0d7c7; border-radius: 13px; background: #fff8f2; }
.import-issues > strong { font-size: 12px; }
.import-issue { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; font-size: 11px; }
.import-issue span { color: var(--short); font-weight: 800; white-space: nowrap; }
.import-issue em { color: var(--muted); font-style: normal; line-height: 1.4; }
.import-issue.merged span { color: var(--over); }
.replace-option { display: flex; align-items: center; gap: 9px; margin: 13px 0; }
.replace-option input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--green); }
.replace-option span { margin: 0; color: var(--ink); }
.full-width { width: 100%; }
.match-code { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.match-code strong { color: var(--ink); overflow-wrap: anywhere; }
.match-search { margin-bottom: 11px; }
.pending-match-list { display: grid; gap: 8px; max-height: 48dvh; overflow: auto; margin-bottom: 12px; }
.match-item { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; text-align: left; color: var(--ink); background: white; }
.match-item strong, .match-item span { display: block; }
.match-item span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.match-item > em { flex: 0 0 auto; align-self: center; color: var(--pending); font-style: normal; font-size: 12px; font-weight: 800; }
.no-match { padding: 22px 14px; border-radius: 13px; text-align: center; color: var(--muted); background: var(--paper); font-size: 12px; }

.report-sheet { padding-top: 16px; }
.report-hero { text-align: center; }
.report-check { width: 52px; height: 52px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ok); font-size: 28px; font-weight: 800; }
.report-hero > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 17px 0; }
.report-stat { padding: 13px 6px; border-radius: 13px; text-align: center; background: var(--paper); }
.report-stat strong, .report-stat span { display: block; }
.report-stat strong { font-size: 23px; }
.report-stat span { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.difference-list { display: grid; gap: 8px; max-height: 28dvh; overflow: auto; }
.difference-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 12px; border-radius: 12px; background: var(--short-bg); }
.difference-row.over { background: var(--over-bg); }
.difference-row.ok { background: var(--mint); }
.difference-row strong { font-size: 13px; }
.difference-row small { display: block; margin-top: 3px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; overflow-wrap: anywhere; }
.difference-row span { color: var(--muted); text-align: right; font-size: 11px; }
.difference-row span b { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; }
.all-clear { padding: 18px; border-radius: 14px; text-align: center; color: var(--ok); background: var(--mint); font-size: 13px; font-weight: 800; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 17px; }
.report-actions .save-button, .report-actions .centered { grid-column: 1 / -1; }
.centered { justify-self: center; }

.confirm-layer { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(12,26,20,.56); backdrop-filter: blur(4px); }
.confirm-card { width: min(100%, 390px); padding: 22px; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.confirm-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.confirm-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toast { position: fixed; z-index: 140; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); max-width: calc(100% - 40px); transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 999px; color: white; background: rgba(15,34,26,.94); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; font-weight: 750; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 390px) {
  .field-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(5, minmax(68px, 1fr)); gap: 5px; overflow-x: auto; padding-bottom: 3px; }
  .summary-card strong { font-size: 20px; }
  .action-panel > .secondary-action { min-height: 48px; padding: 0 10px; }
  .mapping-grid { grid-template-columns: 1fr; }
  .mapping-grid label:nth-child(n+3) { grid-column: auto; }
  .item-quantity-grid { grid-template-columns: 64px 64px minmax(100px, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
