:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-subtle: #f7f9fb;
  --text: #0f172a;
  --muted: #53657a;
  --border: #d7e1ec;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --warning: #a16207;
  --warning-soft: #fff8db;
  --danger: #b91c1c;
  --danger-soft: #fff1f2;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); min-width: 320px; overflow-x: hidden; }
button, input { font: inherit; touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, opacity .14s ease; }
button:focus-visible, input:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .5; }

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(16px, calc(env(safe-area-inset-top) + 8px)) 12px calc(88px + env(safe-area-inset-bottom));
}
.topbar { display: block; padding: 4px 4px 14px; }
.topbar-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; }
.topbar-title > div { min-width: 0; }
.topbar-title .secondary-button { flex: 0 0 auto; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
h1, h2, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.1; letter-spacing: -.03em; }
h2 { font-size: 16px; line-height: 1.25; }
.top-actions { display: flex; gap: 6px; align-items: center; margin-top: 8px; }

button { border: 0; cursor: pointer; }
.ghost-button, .secondary-button, .text-button, .link-button, .danger-link { min-height: 44px; }
.ghost-button, .secondary-button { border-radius: 9px; padding: 0 12px; font-weight: 700; font-size: 13px; }
.ghost-button { color: var(--primary); background: var(--primary-soft); }
.ghost-button span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 3px; border-radius: 50%; color: #fff; background: var(--primary); font-size: 11px; }
.secondary-button { color: var(--text); background: #edf1f5; }
.primary-button { min-width: 118px; min-height: 82px; border-radius: 12px; color: #fff; background: var(--primary); display: grid; place-content: center; gap: 1px; font-weight: 800; box-shadow: 0 5px 12px rgba(37,99,235,.18); }
.primary-button:active { background: #1d4ed8; box-shadow: none; }
.primary-button strong { font-size: 18px; line-height: 1; }
.primary-button span { font-size: 12px; line-height: 1.2; }
.primary-button.compact { min-width: 80px; min-height: 48px; padding: 0 18px; }
.text-button { padding: 0 4px; color: var(--primary); background: transparent; font-size: 12px; font-weight: 800; }
.link-button, .danger-link { flex: 0 0 auto; min-height: 48px; padding: 0 6px; background: transparent; font-size: 11px; font-weight: 800; white-space: nowrap; }
.link-button { color: var(--primary); }
.danger-link { color: var(--danger); }

.meta-card, .warehouse-section, .weigh-card, .flow-card, .settlement-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.meta-card { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 10px; padding: 10px 12px; }
.meta-card label { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.meta-card input { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; color: var(--text); background: var(--surface-subtle); font-size: 13px; font-weight: 700; }
.vehicle-name { align-self: end; padding-bottom: 11px; color: var(--text); font-size: 15px; white-space: nowrap; }

.warehouse-section, .weigh-card, .flow-card, .settlement-card { margin-top: 12px; padding: 13px; }
.section-line, .card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.section-line > strong { color: var(--primary); font-size: 11px; white-space: nowrap; }
.warehouse-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding: 2px 1px 1px; }
.warehouse-section { position: static; z-index: auto; box-shadow: none; background: var(--surface); }
.warehouse-card { min-width: 0; min-height: 60px; border: 1px solid var(--border); border-radius: 10px; padding: 7px 7px 6px; text-align: left; background: var(--surface-subtle); color: var(--text); }
.warehouse-card strong, .warehouse-card span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warehouse-card strong { font-size: 12px; }
.warehouse-card span { margin-top: 3px; font-size: 10px; font-weight: 700; }
.warehouse-card span + span { margin-top: 1px; color: var(--muted); font-size: 9px; }
.warehouse-card.active { box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 1px rgba(37,99,235,.12); }
.warehouse-card.normal { border-color: #72c18e; background: var(--success-soft); }
.warehouse-card.warning { border-color: #e5bd4a; background: var(--warning-soft); }
.warehouse-card.over { border-color: #f08a8a; background: var(--danger-soft); }
.warehouse-card.normal strong { color: var(--success); }
.warehouse-card.warning strong { color: var(--warning); }
.warehouse-card.over strong { color: var(--danger); }
.helper { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }


.card-heading { align-items: center; }
.card-heading h2 { font-size: 18px; }
.current-fish-total { min-width: 88px; padding: 7px 9px; border: 1px solid #bfe4cc; border-radius: 10px; background: var(--success-soft); text-align: right; }
.current-fish-total strong, .current-fish-total b, .current-fish-total small { display: block; }
.current-fish-total strong { color: var(--success); font-size: 11px; }
.current-fish-total b { margin-top: 1px; color: var(--success); font-size: 16px; }
.current-fish-total small { color: var(--muted); font-size: 9px; }
.weight-row { margin-top: 12px; }
.weight-input-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.input-and-button { display: flex; gap: 10px; margin-top: 5px; }
.weight-input-wrap { display: flex; align-items: center; justify-content: space-between; min-width: 0; flex: 1; min-height: 82px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface-subtle); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.weight-input-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; padding: 0; color: var(--text); background: transparent; font-size: 42px; font-weight: 800; }
.weight-input-wrap input::placeholder { color: #213047; opacity: 1; }
.weight-input-wrap span { color: var(--muted); font-size: 15px; font-weight: 700; }
.selector-row { display: flex; align-items: center; gap: 4px; min-height: 48px; border-bottom: 1px solid #eef2f5; }
.selector-row:last-of-type { border-bottom: 0; }
.field-label { flex: 0 0 36px; color: var(--muted); font-size: 12px; font-weight: 800; }
.tare-edit-hint { flex: 0 0 auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.chips { display: flex; align-items: center; gap: 3px; min-width: 0; overflow-x: auto; flex: 1; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
#fishOptions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; overflow: visible; }
#fishOptions .chip { width: 100%; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; color: var(--text); background: transparent; font-size: 12px; font-weight: 700; }
.chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.inline-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 7px; margin-top: 8px; padding: 8px; border: 1px solid #b9caff; border-radius: 9px; background: var(--primary-soft); }
.inline-editor[hidden] { display: none; }
.inline-editor label { display: grid; gap: 3px; color: var(--primary); font-size: 11px; font-weight: 800; }
.inline-editor input { min-height: 44px; min-width: 0; border: 1px solid #b9caff; border-radius: 8px; padding: 0 9px; color: var(--text); background: var(--surface); font-weight: 700; }
.calc-line { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.calc-line strong { color: var(--text); font-size: 17px; }
.calc-line small { font-size: 10px; }
.feedback { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.flow-card { min-height: 176px; }
.flow-groups { display: grid; gap: 7px; margin-top: 10px; }
.flow-grade-section { display: grid; gap: 6px; padding: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.flow-grade-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 1px 2px 3px; color: var(--text); }
.flow-grade-heading strong, .flow-grade-heading span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-grade-heading strong { font-size: 13px; }
.flow-grade-heading span { color: var(--muted); font-size: 9px; font-weight: 700; text-align: right; }
.flow-grade-heading .flow-tare-edit, .history-grade-heading .history-tare-edit { grid-column: 1 / -1; justify-self: start; min-height: 36px; padding: 0 9px; border: 1px solid #b9caff; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 800; }
.flow-grade-heading .flow-tare-edit:active, .history-grade-heading .history-tare-edit:active { background: #dbe6ff; }
.flow-group { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface-subtle); }
.flow-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.flow-heading-actions { display: flex; align-items: center; gap: 6px; }
.flow-card.editing { border-color: #9db7ff; box-shadow: inset 0 0 0 1px #dce6ff; }
.flow-item { min-width: 0; min-height: 66px; padding: 4px 3px; border-left: 2px solid #9bb5ff; color: var(--text); background: transparent; font-size: 10px; font-weight: 800; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flow-card.editing .flow-item { background: #f1f5ff; }
.warehouse-assignment { min-height: 24px; margin: 7px 0 0; padding: 5px 8px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.switch-dialog { width: min(360px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: var(--surface); box-shadow: 0 18px 50px rgba(20,34,53,.22); }
.switch-dialog::backdrop { background: rgba(20,34,53,.38); }
.switch-dialog form { padding: 16px; }
.switch-message { margin: 10px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.switch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.flow-item:active { background: var(--primary-soft); }
.flow-item.dragging { opacity: .45; }
.flow-item.drop-target { outline: 2px dashed var(--primary); outline-offset: -2px; }
.flow-item small, .flow-item strong, .flow-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-item small { color: var(--muted); font-size: 9px; font-weight: 700; }
.flow-item strong { margin-top: 3px; color: var(--text); font-size: 15px; line-height: 1; }
.flow-item span { margin-top: 3px; color: var(--primary); font-size: 8px; line-height: 1.05; font-weight: 800; }
.flow-item .flow-cell-tare { color: var(--muted); }
.flow-group-total { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 9px; text-align: left; }
.flow-group-total span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-group-total strong { flex: 0 0 auto; color: var(--primary); font-size: 11px; white-space: nowrap; }
.empty-flow { padding: 14px 8px; color: var(--muted); font-size: 12px; text-align: center; }
.older-records { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 7px 10px; border: 1px dashed #b7c6d8; border-radius: 8px; color: var(--primary); background: #f7faff; font-size: 12px; font-weight: 850; }
.older-records:active { background: #eaf0ff; }

.settlement-card { display: block; }
.settlement-card h2 { font-size: 14px; }
.settlement-card .section-line > strong { font-size: 16px; }
.settlement-hint { margin-top: 4px; color: var(--muted); font-size: 10px; }
.settlement-rows { display: grid; gap: 7px; margin-top: 9px; }
.settlement-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 70px; align-items: center; gap: 7px; min-height: 62px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.settlement-label strong, .settlement-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settlement-label strong { font-size: 13px; }
.settlement-label span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.price-field { display: flex; align-items: center; gap: 3px; min-height: 48px; padding: 0 5px 0 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 700; }
.price-field input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; font-weight: 800; }
.price-field span { white-space: nowrap; }
.settlement-amount { color: var(--primary); font-size: 13px; text-align: right; white-space: nowrap; }
.empty-settlement { padding: 12px 8px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }
.settlement-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.settlement-save, .settlement-pdf { width: 100%; min-height: 52px; margin-top: 0; }
.settlement-pdf { padding: 0 8px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.settlement-pdf:disabled { color: var(--muted); background: #edf1f5; }
.summary-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 10; display: flex; justify-content: center; gap: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); color: #fff; background: #0f1f35; box-shadow: 0 -5px 18px rgba(15,31,53,.18); }
.summary-bar > div { width: min(31%, 150px); padding: 0 8px; border-right: 1px solid #ffffff22; }
.summary-bar > div:last-child { border-right: 0; }
.summary-bar span, .summary-bar strong { display: block; }
.summary-bar span { color: #c7d3e2; font-size: 10px; }
.summary-bar strong { margin-top: 2px; font-size: 14px; }

dialog { max-width: calc(100% - 24px); border: 0; border-radius: 14px; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 18px 48px #14223533; }
dialog::backdrop { background: #14223566; }
.editor-dialog { width: min(430px, calc(100% - 24px)); }
.editor-dialog > form, .editor-dialog > div { padding: 16px; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.dialog-title h2 { font-size: 18px; }
.close-button { width: 44px; height: 44px; border-radius: 8px; color: var(--muted); background: var(--surface-subtle); font-size: 26px; }
.bulk-row { display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 6px; margin-bottom: 10px; }
.bulk-row label, .editor-row label { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.bulk-row input, .editor-row input { min-height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; color: var(--text); background: var(--surface-subtle); }
.editor-rows { display: grid; gap: 7px; max-height: 48vh; overflow: auto; }
.editor-row { display: grid; grid-template-columns: 28px repeat(4, minmax(0, 1fr)); align-items: end; gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; }
.editor-row input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--primary); }
.warehouse-editor-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.warehouse-editor-tools button { min-height: 44px; }
.warehouse-editor-tools span { color: var(--muted); font-size: 12px; }
#warehouseEditorNotice { margin: 0 0 10px; }
#warehouseEditorRows .editor-row { grid-template-columns: 44px repeat(2, minmax(0, 1fr)); }
#warehouseEditorRows label { min-width: 0; }
#warehouseEditorRows input:not([type="checkbox"]) { width: 100%; min-width: 0; min-height: 44px; font-size: 14px; }
#warehouseEditorRows .warehouse-select { grid-row: span 2; align-self: stretch; place-items: center; min-height: 44px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.record-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.record-edit-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.record-edit-grid input, .record-edit-grid select { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 0 9px; color: var(--text); background: var(--surface-subtle); font-weight: 700; }
.edit-note { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.record-edit-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; }
.danger-button { min-height: 48px; padding: 0 10px; border: 1px solid #f3b5b5; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 12px; font-weight: 800; }
.history-rows { display: grid; gap: 8px; max-height: 54vh; overflow: auto; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.history-row-actions, .history-detail-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-delete { min-height: 42px; padding: 0 9px; border: 1px solid #e2a8a8; border-radius: 7px; color: #b42323; background: #fff7f7; font-size: 11px; font-weight: 800; }
.pdf-file-list { display: grid; gap: 5px; margin-top: 7px; }
.pdf-file-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 6px; border: 1px solid #c9d8f4; border-radius: 7px; background: #f5f8ff; }
.pdf-file-icon { display: inline-flex; min-width: 28px; height: 30px; align-items: center; justify-content: center; border-radius: 5px; color: #fff; background: #d14343; font-size: 8px; font-weight: 900; }
.pdf-file-copy { min-width: 0; }
.pdf-file-copy strong, .pdf-file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-copy strong { color: var(--text); font-size: 10px; }
.pdf-file-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.pdf-file-open { min-height: 34px; padding: 0 8px; border: 1px solid var(--primary); border-radius: 6px; color: var(--primary); background: #fff; font-size: 10px; font-weight: 850; }
.pdf-file-delete { min-height: 34px; padding: 0 8px; border: 1px solid #e2a8a8; border-radius: 6px; color: #b42323; background: #fff7f7; font-size: 10px; font-weight: 850; }
.pdf-file-actions { display: flex; gap: 4px; }
.history-row strong, .history-row span { display: block; }
.history-row strong { font-size: 13px; }
.history-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.history-open, .history-back { min-height: 48px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 8px; color: var(--primary); background: var(--surface); font-size: 12px; font-weight: 800; white-space: nowrap; }
.history-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.history-detail-meta span { color: var(--muted); font-size: 10px; }
.history-detail-meta strong { display: block; margin-top: 2px; color: var(--text); font-size: 12px; }
.history-section-title { margin: 13px 0 6px; font-size: 13px; }
.history-price-list, .history-record-list { display: grid; gap: 5px; }
.history-record-group { display: grid; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.history-grade-section { display: grid; gap: 4px; padding: 5px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.history-grade-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 1px 2px; color: var(--text); font-size: 10px; }
.history-grade-heading span { color: var(--muted); font-size: 8px; font-weight: 750; }
.history-grade-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.history-grade-heading .history-tare-edit { grid-column: 1 / -1; }
.history-price-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 160px); gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.history-price-row > div > strong { display: block; color: var(--text); font-size: 11px; }
.history-price-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.history-price-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 4px; min-width: 0; }
.history-price-editor input { width: 100%; min-width: 0; min-height: 42px; padding: 0 7px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.history-price-editor > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.history-price-amount { grid-column: 1 / -1; color: var(--primary); text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.history-price-amount.pending { color: var(--muted); }
.history-record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-subtle); font-size: 10px; }
.history-record-row span:nth-child(2) { color: var(--primary); font-weight: 800; }
.history-record-row strong { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 700; }
.history-record-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 4px 5px 2px; color: var(--muted); font-size: 9px; font-weight: 800; }
.history-record-summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-record-summary strong { flex: 0 0 auto; color: var(--primary); font-size: 11px; }
.history-flow-group { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.history-flow-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 7px; color: var(--muted); font-size: 9px; font-weight: 800; }
.history-flow-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-flow-header span { flex: 0 0 auto; }
.history-flow-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.history-flow-cell { min-width: 0; min-height: 52px; padding: 5px 1px 4px; border-top: 3px solid #c63636; border-right: 1px solid var(--border); background: #fff9f9; text-align: center; }
.history-flow-cell small, .history-flow-cell strong, .history-flow-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-flow-cell small { margin-bottom: 2px; color: var(--muted); font-size: 7px; line-height: 1; }
.history-flow-cell strong { color: var(--text); font-size: 11px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.history-flow-cell span { margin-top: 2px; color: var(--primary); font-size: 7px; line-height: 1; }
.history-flow-cell .history-flow-net { color: var(--muted); }
.history-flow-empty { border-top-color: transparent; background: transparent; }
.history-flow-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 6px 7px; border-top: 1px solid var(--border); color: var(--muted); background: #f7faff; font-size: 9px; font-weight: 800; }
.history-flow-summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-flow-summary strong { color: var(--primary); font-size: 12px; }
.history-pdf { width: 100%; min-height: 50px; margin-top: 12px; }
.toast { position: fixed; right: 16px; bottom: 94px; left: 16px; z-index: 20; max-width: 460px; margin: auto; padding: 11px 14px; border-radius: 9px; color: #fff; background: #142235eF; text-align: center; font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.bulk-tare-field { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.bulk-tare-field input { min-height: 50px; width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; color: var(--text); background: var(--surface-subtle); font-size: 20px; font-weight: 800; }

@media (min-width: 600px) {
  .app-shell { padding-top: 24px; }
  .summary-bar { position: static; margin-top: 10px; border-radius: 10px; }
}
@media (max-width: 360px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .warehouse-line { gap: 5px; }
  .warehouse-card { min-height: 58px; padding-right: 5px; padding-left: 5px; }
  .warehouse-card strong { font-size: 11px; }
  .warehouse-card span { font-size: 9px; }
  .weight-input-wrap input { font-size: 38px; }
  .primary-button { min-width: 108px; }
  .history-price-row { grid-template-columns: minmax(0, 1fr) 124px; gap: 5px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .app-shell { width: min(100%, 760px); padding-bottom: 16px; }
  .warehouse-line { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .warehouse-card { min-height: 54px; }
  .summary-bar { position: static; margin-top: 12px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
.history-review { padding: 12px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
