:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-subtle: #f7f9fb;
  --ink: #0f172a;
  --muted: #53657a;
  --border: #d7e1ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #198754;
  --danger: #c63636;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
.history-review { padding: 12px; border-radius: 10px; background: var(--surface-subtle); color: var(--danger); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--bg); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; touch-action: manipulation; }
button { cursor: pointer; -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, select:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .5; }
.app-shell { max-width: 620px; margin: 0 auto; padding: max(16px, calc(env(safe-area-inset-top) + 8px)) 14px calc(92px + env(safe-area-inset-bottom)); }
.app-shell, .topbar, .topbar-title, .topbar-status, .topbar-actions, .meta-strip, .vehicle-strip, .warehouse-strip, .weigh-panel, .weights-panel, .settlement-panel, .section-heading, .weigh-heading, .flow-heading-actions, .flow-fish-section, .flow-grade-section, .history-content, .history-detail-meta, .history-price-row { min-width: 0; max-width: 100%; }
.topbar-title h1, .weigh-heading h2, .section-heading h2, .history-detail-head strong { min-width: 0; overflow-wrap: anywhere; }
.topbar, .meta-strip, .weigh-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { display: block; margin-bottom: 10px; }
.topbar-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; }
.topbar-title > div { min-width: 0; }
.topbar-title .new-record-button { flex: 0 0 auto; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.topbar-actions { margin-top: 8px; flex-wrap: wrap; }
.history-button { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 850; white-space: nowrap; }
.history-button span { display: inline-flex; min-width: 18px; height: 18px; margin-left: 3px; align-items: center; justify-content: center; border-radius: 9px; color: #fff; background: var(--primary); font-size: 10px; }
.history-button:active { background: #eaf0f8; }
.new-record-button { min-height: 44px; padding: 0 11px; border: 1px solid #f0c36a; border-radius: 9px; color: #875400; background: #fff8df; font-size: 11px; font-weight: 850; white-space: nowrap; box-shadow: 0 1px 2px rgba(135,84,0,.08); }
.new-record-button:active { background: #ffefb9; }
.install-app { min-height: 44px; padding: 0 9px; border: 1px solid #bcd0ff; border-radius: 9px; color: var(--primary); background: #eff6ff; font-size: 11px; font-weight: 850; white-space: nowrap; }
.install-app:active { background: #dfe8ff; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 18px; }
.live-dot { color: var(--success); font-size: 10px; vertical-align: 2px; }
.direction-toggle { display: flex; padding: 2px; background: #e5ebf3; border-radius: 10px; }
.direction { min-height: 44px; min-width: 54px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 800; }
.direction.active { color: #fff; background: var(--primary); }
.meta-strip { align-items: stretch; flex-wrap: wrap; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.meta-strip label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.meta-strip input, .meta-strip select { width: 100px; min-height: 44px; padding: 0 7px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 7px; font-size: 13px; font-weight: 700; }
.meta-strip label:nth-child(2) input { width: 112px; }
.meta-strip span { margin-left: -3px; font-size: 11px; }
.location-control { flex: 1 1 210px; }
.location-input-wrap { display: flex; align-items: center; gap: 4px; margin-left: 0; }
.location-input-wrap input { width: 112px; min-width: 0; flex: 1 1 auto; }
.location-button { min-height: 44px; padding: 0 10px; border: 1px solid #bcd0ff; border-radius: 9px; color: var(--primary); background: #eff6ff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.location-button:disabled { opacity: .65; cursor: wait; }
.vehicle-strip, .warehouse-strip, .weigh-panel, .weights-panel, .settlement-panel { margin-top: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.strip-title { display: flex; align-items: center; justify-content: space-between; }
.strip-actions { display: flex; align-items: center; gap: 6px; }
.text-button { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--primary); background: #eff6ff; font-size: 12px; font-weight: 800; }
.warehouse-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 4px 0 2px; }
.warehouse-strip { position: sticky; top: env(safe-area-inset-top); z-index: 6; box-shadow: 0 6px 18px rgba(15,23,42,.08); background: rgba(255,255,255,.96); }
.vehicle-line { display: flex; gap: 7px; overflow-x: auto; padding: 4px 0 1px; scrollbar-width: thin; }
.vehicle-chip { min-width: 86px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface-subtle); text-align: left; flex: 0 0 auto; font-weight: 800; }
.vehicle-chip.selected { color: var(--primary); border: 2px solid var(--primary); padding: 6px 8px; background: #eff6ff; box-shadow: 0 0 0 1px rgba(37,99,235,.1); }
.vehicle-chip input { display: none; width: 68px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; font-weight: 700; }
.editing .vehicle-chip input { display: inline-block; }
.editing .vehicle-chip .vehicle-name { display: none; }
.vehicle-chip .remove-chip { display: none; }
.editing .vehicle-chip .remove-chip { display: inline-block; }
.add-vehicle { display: none; min-width: 56px; padding: 0 10px; border: 1px dashed var(--primary); border-radius: 8px; color: var(--primary); background: #f4f7ff; font-weight: 800; }
.editing .add-vehicle { display: block; }
.vehicle-single { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 10px; border: 1px solid #bcd0ff; border-radius: 9px; color: var(--primary); background: #eff6ff; }
.vehicle-single strong { font-size: 16px; }
.vehicle-single span { color: var(--muted); font-size: 11px; }
.status-normal { --status-color: #15803d; --status-soft: #f0fdf4; --status-border: #b7e2c4; }
.status-warning { --status-color: #a16207; --status-soft: #fff8db; --status-border: #e7cf72; }
.status-over { --status-color: #b91c1c; --status-soft: #fff1f2; --status-border: #efb0b0; }
.warehouse-chip { min-width: 0; min-height: 60px; padding: 6px 7px; border: 1px solid var(--status-border); border-top: 4px solid var(--status-color); border-radius: 8px; color: var(--ink); background: var(--status-soft); text-align: left; }
.warehouse-chip.selected { border-width: 2px; border-top-width: 4px; border-color: var(--status-color); padding: 6px 6px; box-shadow: 0 0 0 1px var(--primary); }
.warehouse-chip strong { display: block; font-size: 13px; }
.warehouse-chip small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.warehouse-edit-fields { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 2px; }
.warehouse-edit-fields label { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.warehouse-edit-fields input { display: block; width: 100%; min-height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 750; }
.editing .warehouse-line { grid-template-columns: 1fr; }
.editing .warehouse-chip { min-width: 0; }
.editing .warehouse-name-label { display: none; }
.editing .warehouse-edit-fields { display: grid; }
.editing .warehouse-chip small { display: none; }
.remove-chip { display: none; float: right; min-width: 44px; min-height: 44px; margin: -8px -8px 0 0; padding: 0; border: 0; color: var(--danger); background: transparent; font-weight: 900; }
.editing .remove-chip { display: inline-block; }
.add-chip { display: none; min-width: 56px; padding: 0 10px; border: 1px dashed var(--primary); border-radius: 8px; color: var(--primary); background: #f4f7ff; font-weight: 800; }
.editing .add-chip { display: block; }
.strip-helper { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.capacity-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; margin-left: 6px; }
.capacity-legend span { white-space: nowrap; }
.capacity-dot { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: var(--status-color); }
.weigh-heading { align-items: flex-start; }
.weigh-heading h2 { font-size: 20px; }
.active-warehouse-total { min-width: 96px; padding: 6px 8px; border: 1px solid var(--status-border, #d7e2f5); border-radius: 10px; color: var(--status-color, var(--primary)); background: var(--status-soft, #eff6ff); text-align: right; }
.active-warehouse-total span, .active-warehouse-total strong, .active-warehouse-total small { display: block; }
.active-warehouse-total span { font-size: 12px; font-weight: 800; }
.active-warehouse-total strong { margin-top: 1px; font-size: 15px; font-variant-numeric: tabular-nums; }
.active-warehouse-total small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.weight-label { display: block; margin: 17px 0 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.weight-entry-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: stretch; gap: 10px; }
.weight-entry-row > *, .meta-strip > *, .strip-title > *, .weigh-heading > * { min-width: 0; }
.weight-input-wrap { min-width: 0; }
.weight-input-wrap { display: flex; align-items: center; gap: 8px; min-height: 76px; padding: 0 10px; border: 1px solid var(--border); border-bottom: 3px solid var(--primary); border-radius: 12px; background: var(--surface-subtle); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.weight-input-wrap input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: clamp(52px, 15vw, 72px); font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.weight-input-wrap span { color: var(--muted); font-weight: 800; }
.weight-confirm-button { min-width: 82px; min-height: 76px; padding: 8px; border: 0; border-radius: 12px; color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(37,99,235,.18); }
.weight-confirm-button strong, .weight-confirm-button span { display: block; }
.weight-confirm-button strong { font-size: 18px; }
.weight-confirm-button span { margin-top: 2px; font-size: 10px; font-weight: 800; opacity: .88; }
.weight-confirm-button:active { background: var(--primary-dark); box-shadow: none; }
.fish-selectors { display: grid; gap: 8px; margin: 12px 0; }
.fish-selectors > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#fishOptions { width: 100%; }
.field-label { width: 38px; color: var(--muted); font-size: 12px; font-weight: 800; }
.select-chip { min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: #fff; font-size: 13px; font-weight: 800; }
.select-chip.active { color: var(--primary); border-color: var(--primary); background: #eff6ff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.tare-hint { color: var(--muted); font-size: 10px; white-space: nowrap; }
.inline-edit { min-height: 44px; padding: 0 8px; border: 0; border-bottom: 1px dashed var(--primary); color: var(--primary); background: transparent; font-size: 11px; font-weight: 800; }
.inline-edit.add-option { color: var(--success); border-bottom-color: #9ed3ad; }
.subtle-edit { color: var(--muted); border-bottom-color: var(--border); }
.option-chip-wrap { position: relative; display: inline-flex; }
.option-remove { position: absolute; top: -12px; right: -12px; z-index: 1; display: none; width: 44px; height: 44px; padding: 0; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--danger); font-size: 17px; font-weight: 900; line-height: 17px; box-shadow: 0 2px 5px rgba(20,34,53,.2); }
.option-editing .option-remove { display: block; }
.option-edit { display: none; min-width: 44px; min-height: 44px; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 14px; font-weight: 900; }
.option-editing .option-edit { display: inline-grid; place-items: center; }
.option-editing .select-chip { animation: option-jiggle .15s ease-in-out infinite alternate; }
@keyframes option-jiggle { from { transform: rotate(-1deg); } to { transform: rotate(1deg); } }
.calc-line { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.calc-line strong { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.entry-feedback { min-height: 16px; margin: 0; color: var(--muted); font-size: 11px; }
.entry-feedback.saved { color: var(--success); font-weight: 800; }
.warehouse-assignment { min-height: 26px; margin: 7px 0 0; padding: 5px 8px; border-radius: 7px; color: var(--primary); background: #eef3ff; font-size: 11px; font-weight: 800; }
.primary-action, .secondary-action { min-height: 46px; border-radius: 8px; font-weight: 850; }
.primary-action { width: 100%; border: 0; color: #fff; background: var(--primary); }
.primary-action:active { background: var(--primary-dark); }
.secondary-action { min-width: 96px; padding: 0 14px; border: 1px solid var(--primary); color: var(--primary); background: #fff; }
.vehicle-stats { min-width: 148px; padding: 6px 8px; border: 1px solid #d7e2f5; border-radius: 8px; background: #f7faff; }
.vehicle-stats-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; line-height: 1.25; }
.vehicle-stats-row + .vehicle-stats-row { margin-top: 3px; padding-top: 3px; border-top: 1px solid #e1e9f6; }
.vehicle-stats-row span { color: var(--muted); font-size: 9px; font-weight: 800; white-space: nowrap; }
.vehicle-stats-row strong { color: var(--primary); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; overflow-x: visible; margin-top: 9px; padding: 3px 1px 4px; }
.flow-filter-label { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 850; }
.flow-filter-chip { min-height: 44px; flex: 0 0 auto; padding: 0 10px; border: 1px solid var(--border); border-radius: 17px; color: var(--muted); background: var(--surface-subtle); font-size: 11px; font-weight: 800; white-space: nowrap; }
.flow-filter-chip small { margin-left: 2px; color: inherit; font-size: 10px; font-variant-numeric: tabular-nums; opacity: .75; }
.flow-filter-chip.active { color: var(--primary); border-color: #9db7ff; background: #eff6ff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.status-badge { padding: 6px 8px; border-radius: 6px; color: var(--success); background: #e9f7ef; font-size: 11px; font-weight: 800; white-space: nowrap; }
.flow-heading-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.weights-panel.editing { border-color: #9db7ff; box-shadow: inset 0 0 0 1px #dce6ff; }
.weight-groups { display: grid; gap: 8px; margin-top: 10px; contain: layout; }
.flow-fish-section { display: grid; gap: 7px; padding: 7px; border: 1px solid #d7e2f5; border-radius: 9px; background: #fbfdff; }
.flow-fish-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 1px 2px 2px; color: var(--ink); }
.flow-fish-heading strong { font-size: 14px; }
.flow-fish-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.flow-grade-section { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.flow-grade-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 1px 2px 2px; color: var(--ink); }
.flow-grade-heading strong { font-size: 12px; }
.flow-grade-heading span { color: var(--muted); font-size: 10px; font-weight: 750; }
.flow-tare-edit, .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-tare-edit:active, .history-tare-edit:active { background: #dbe6ff; }
.weight-group { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; content-visibility: auto; contain-intrinsic-size: 92px; }
.older-records { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; 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; }
.group-header { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px; color: var(--muted); background: var(--surface-subtle); font-size: 11px; font-weight: 800; }
.group-header button { padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 800; }
.weight-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.weight-cell { min-width: 0; min-height: 58px; padding: 8px 3px 7px; border-right: 1px solid var(--border); border-top: 3px solid var(--status-color, #dce3ea); background: var(--status-soft, #fff); text-align: center; cursor: grab; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.weight-cell.tap-pending { box-shadow: inset 0 0 0 2px #8aa9f7; }
.weight-cell-empty { cursor: default; border-top-color: transparent; background: transparent; pointer-events: none; }
.weight-cell:active { cursor: grabbing; }
.weight-cell.dragging { opacity: .42; outline: 2px dashed var(--primary); outline-offset: -3px; }
.weight-cell.drop-target { box-shadow: inset 0 0 0 2px var(--primary); }
.weight-cell:last-child { border-right: 0; }
.weight-cell strong, .weight-cell small, .weight-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weight-cell strong { color: var(--ink); font-size: 17px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.weight-cell small { margin-bottom: 3px; color: var(--muted); font-size: 10px; line-height: 1.1; }
.weight-cell span { margin-top: 3px; color: var(--primary); font-size: 8px; line-height: 1.05; font-weight: 800; }
.weight-cell .weight-cell-tare { color: var(--muted); }
.group-count { color: var(--muted); font-size: 10px; font-weight: 700; }
.weight-group-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); color: var(--muted); background: #f7faff; font-size: 12px; font-weight: 800; }
.weight-group-summary strong { color: var(--primary); font-size: 18px; font-variant-numeric: tabular-nums; }
.weight-total-cell { min-width: 0; padding: 6px 1px; color: var(--muted); background: #f1f5f9; border-left: 1px solid var(--border); text-align: center; font-size: 8px; font-weight: 800; white-space: nowrap; grid-row: 1; }
.weight-total-cell:nth-last-child(2) { grid-column: 11; }
.weight-total-cell:last-child { grid-column: 12; }
.weight-total-cell strong { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.time-detail { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 7px 9px; border-top: 1px solid var(--border); color: var(--muted); background: #fbfcfd; font-size: 10px; font-variant-numeric: tabular-nums; }
.empty-state { padding: 16px 10px; color: var(--muted); background: var(--surface-subtle); font-size: 12px; text-align: center; }
.audit-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.reorder-mode { cursor: grabbing; }
.warehouse-bulk-dialog { width: min(420px, calc(100vw - 24px)); max-height: min(86dvh, 720px); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.warehouse-bulk-dialog::backdrop { background: rgba(20, 34, 53, .38); }
.warehouse-bulk-dialog form { padding: 16px; }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.bulk-toolbar strong { font-size: 13px; }
.bulk-warehouse-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 42dvh; overflow-y: auto; margin-top: 9px; padding: 2px; }
.bulk-warehouse-option { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface-subtle); text-align: left; }
.bulk-warehouse-option.selected { border-color: var(--primary); background: #eef3ff; }
.bulk-check { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; flex: 0 0 auto; border: 2px solid #a8b5c7; border-radius: 6px; color: #fff; background: #fff; font-size: 15px; font-weight: 900; }
.bulk-warehouse-option.selected .bulk-check { border-color: var(--primary); background: var(--primary); }
.bulk-warehouse-option strong, .bulk-warehouse-option small { display: block; }
.bulk-warehouse-option strong { font-size: 13px; }
.bulk-warehouse-option small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.bulk-limit-field { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.bulk-limit-field input { width: 100%; min-height: 48px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface-subtle); font-size: 20px; font-weight: 800; }
.bulk-preview { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.record-editor { width: min(360px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.record-editor::backdrop { background: rgba(20, 34, 53, .34); }
.tare-preset-dialog { width: min(340px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.tare-preset-dialog::backdrop { background: rgba(20, 34, 53, .38); }
.tare-preset-dialog form { padding: 18px; }
.tare-preset-dialog h2 { font-size: 18px; }
.tare-preset-dialog p { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tare-preset-dialog label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.tare-preset-dialog input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 20px; font-weight: 800; }
.bulk-tare-dialog { width: min(380px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.bulk-tare-dialog::backdrop { background: rgba(20, 34, 53, .38); }
.bulk-tare-dialog form { padding: 18px; }
.bulk-tare-dialog h2 { font-size: 18px; }
.bulk-tare-field { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.bulk-tare-field input { width: 100%; min-height: 50px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface-subtle); font-size: 20px; font-weight: 800; }
.pending-price-dialog { width: min(360px, calc(100vw - 28px)); padding: 0; border: 1px solid #e7cf72; border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.pending-price-dialog::backdrop { background: rgba(20, 34, 53, .38); }
.pending-price-content { padding: 18px; }
.pending-price-content h2 { font-size: 18px; }
.pending-price-content p { margin: 8px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pending-price-list { display: grid; gap: 5px; max-height: 32dvh; overflow-y: auto; padding: 8px 10px; border-radius: 8px; color: #875400; background: #fff8df; font-size: 12px; font-weight: 750; }
.pending-price-list span { display: block; }
.switch-dialog { width: min(380px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); 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; }
.record-editor form { padding: 16px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 19px; }
.dialog-close { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: var(--surface-subtle); font-size: 21px; line-height: 1; }
.editor-helper { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.editor-fields { display: grid; gap: 9px; margin-top: 13px; }
.editor-fields label { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
.editor-fields select, .editor-fields input { width: 100%; min-height: 40px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: var(--surface-subtle); font-size: 13px; font-weight: 750; }
.editor-fields input[readonly] { color: var(--muted); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 15px; }
.dialog-actions .secondary-action, .dialog-actions .primary-action { min-height: 42px; }
.danger-action { width: 100%; min-height: 44px; margin-top: 14px; border: 1px solid #efb0b0; border-radius: 8px; color: var(--danger); background: #fff7f7; font-size: 12px; font-weight: 850; }
.danger-action:active { background: #ffe8e8; }
.history-dialog { width: min(560px, calc(100vw - 20px)); max-height: min(88dvh, 760px); padding: 0; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(20, 34, 53, .22); }
.history-dialog::backdrop { background: rgba(20, 34, 53, .38); }
.history-shell { padding: 16px; }
.history-content { max-height: calc(88dvh - 78px); overflow-y: auto; margin-top: 12px; overscroll-behavior: contain; }
.history-list { display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 72px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.history-item-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(--ink); 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-item-main strong, .history-item-main span, .history-item-main small { display: block; }
.history-item-main strong { font-size: 14px; }
.history-item-main span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-item-main small { margin-top: 3px; color: var(--primary); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.history-open { min-width: 66px; min-height: 48px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 7px; color: var(--primary); background: #fff; font-size: 12px; font-weight: 850; }
.history-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.history-back { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; }
.history-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; 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(--ink); font-size: 12px; overflow-wrap: anywhere; }
.history-session-fish { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 7px; padding: 7px 8px; border: 1px solid #d7e2f5; border-radius: 7px; color: var(--muted); background: #f7faff; font-size: 9px; font-variant-numeric: tabular-nums; }
.history-session-fish strong { color: var(--primary); font-size: 10px; white-space: nowrap; }
.history-section-title { margin: 14px 0 7px; font-size: 13px; }
.history-price-list { display: grid; gap: 5px; }
.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 > span { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.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(--ink); 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-editor .history-price-amount { grid-column: 1 / -1; color: var(--primary); text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.history-price-editor .history-price-amount.pending { color: var(--muted); }
.history-record-list { display: grid; gap: 3px; }
.history-record-card { padding: 4px 5px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-subtle); }
.history-record-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 4px; padding-bottom: 3px; border-bottom: 1px solid var(--border); }
.history-record-head strong { color: var(--ink); font-size: 10px; }
.history-record-head span { color: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; }
.history-record-head em { overflow: hidden; color: var(--primary); font-size: 9px; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.history-record-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding-top: 3px; }
.history-record-grid span { min-width: 0; color: var(--muted); font-size: 8px; line-height: 1.1; }
.history-record-grid strong { display: block; overflow: hidden; margin-top: 1px; color: var(--ink); font-size: 10px; line-height: 1.1; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.history-flow-list { display: grid; gap: 6px; }
.history-flow-grade { display: grid; gap: 4px; padding: 5px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.history-flow-grade-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 1px 2px; color: var(--ink); font-size: 10px; }
.history-flow-grade-head span { color: var(--muted); font-size: 8px; font-weight: 750; }
.history-flow-grade-head .history-tare-edit { grid-column: 1 / -1; }
.history-flow-group { overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-subtle); content-visibility: auto; contain-intrinsic-size: 58px; }
.history-vehicle-list { display: grid; gap: 10px; }
.history-vehicle { padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; content-visibility: auto; contain-intrinsic-size: 260px; }
.history-vehicle-heading, .settlement-vehicle-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.history-vehicle-heading strong, .settlement-vehicle-heading strong { font-size: 12px; }
.history-vehicle-heading span, .settlement-vehicle-heading span { color: var(--primary); font-size: 10px; font-weight: 800; white-space: nowrap; }
.history-fish-totals { display: flex; flex-wrap: wrap; gap: 4px 9px; margin: 5px 0 7px; color: var(--muted); font-size: 9px; }
.history-fish-totals strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.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 button { flex: 0 0 auto; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 9px; font-weight: 850; }
.history-flow-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.history-flow-cell { min-width: 0; 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(--ink); 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 span:last-child { color: var(--muted); }
.history-flow-empty { border-top-color: transparent; background: transparent; }
.history-flow-total { min-width: 0; padding: 5px 1px 3px; border-left: 1px solid var(--border); color: var(--muted); background: #f1f5f9; text-align: center; font-size: 7px; font-weight: 800; white-space: nowrap; }
.history-flow-total + .history-flow-total { border-left: 0; }
.history-flow-total strong { display: block; margin-top: 2px; color: var(--ink); font-size: 9px; font-variant-numeric: tabular-nums; }
.history-flow-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 7px; border-top: 1px solid var(--border); color: var(--muted); background: #f7faff; font-size: 9px; font-weight: 800; }
.history-flow-summary strong { color: var(--primary); font-size: 12px; }
.history-time-detail { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 5px 7px; border-top: 1px solid var(--border); color: var(--muted); background: #fff; font-size: 8px; font-variant-numeric: tabular-nums; }
.history-print { width: 100%; min-height: 48px; margin-top: 12px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); font-weight: 850; }
.app-toast { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; z-index: 20; max-width: 440px; min-height: 44px; margin: auto; padding: 12px 14px; border-radius: 9px; color: #fff; background: rgba(20, 34, 53, .96); font-size: 12px; font-weight: 800; text-align: center; box-shadow: 0 8px 24px rgba(20, 34, 53, .22); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.app-toast.show { opacity: 1; transform: translateY(0); }
.settlement-panel { display: block; }
.settlement-panel.submitted { border-color: #b7e2c4; background: #fbfffc; }
.settlement-session-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-top: 9px; padding: 7px 8px; border: 1px solid #d7e2f5; border-radius: 7px; color: var(--primary); background: #f7faff; font-size: 10px; }
.settlement-session-summary strong { font-size: 11px; white-space: nowrap; }
.settlement-session-summary span { color: var(--muted); font-variant-numeric: tabular-nums; }
.vehicle-price-list { display: grid; gap: 9px; margin-top: 10px; }
.settlement-vehicle { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfd; }
.settlement-vehicle .price-list { margin-top: 6px; }
.history-price-vehicle { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fbfcfd; }
.history-price-vehicle + .history-price-vehicle { margin-top: 6px; }
.settlement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.settlement-heading h2 { font-size: 15px; }
.settlement-heading p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.settlement-open { min-height: 48px; padding: 0 12px; border: 1px solid var(--primary); border-radius: 8px; color: var(--primary); background: #eef3ff; font-size: 12px; font-weight: 850; white-space: nowrap; }
.settlement-open:active { background: #dfe8ff; }
.settlement-status { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 7px; color: var(--success); background: #e9f7ef; font-size: 11px; font-weight: 800; white-space: nowrap; }
.settlement-status::before { content: '✓'; font-size: 14px; }
.price-list { margin-top: 10px; border-top: 1px solid var(--border); }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) 106px 70px; align-items: center; gap: 8px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.price-name strong, .price-name small { display: block; }
.price-name strong { font-size: 13px; }
.price-name small { margin-top: 3px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.price-input-wrap { display: flex; align-items: center; gap: 3px; min-height: 40px; padding: 0 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-subtle); }
.price-input-wrap input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.price-input-wrap span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.price-amount { color: var(--ink); font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.price-amount.pending { color: var(--muted); font-size: 11px; font-weight: 700; }
.settlement-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0 0; }
.settlement-total span { color: var(--muted); font-size: 12px; font-weight: 800; }
.settlement-total strong { color: var(--primary); font-size: 20px; font-variant-numeric: tabular-nums; }
.settlement-error { min-height: 15px; margin: 7px 0 0; color: var(--danger); font-size: 11px; font-weight: 700; }
.settlement-submit { margin-top: 10px; }
.settlement-submit:disabled { color: #fff; background: #8aa9f7; cursor: default; }
.settlement-actions { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.settlement-actions .secondary-action { min-height: 40px; }
.settlement-edit { min-height: 32px; padding: 0 8px; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 800; }
.print-report { display: none; }
.summary-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 3; display: flex; justify-content: center; gap: clamp(16px, 6vw, 48px); padding: 9px 14px calc(9px + env(safe-area-inset-bottom)); background: rgba(20, 34, 53, .97); color: #fff; box-shadow: 0 -4px 15px rgba(15, 30, 48, .16); }
.summary-bar div { display: flex; flex-direction: column; gap: 2px; }
.summary-bar span { color: #a9b9cd; font-size: 10px; }
.summary-bar strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.summary-bar .checkpoint strong { color: #ffcf76; }
@media (max-width: 560px) {
  .app-shell { padding: max(12px, calc(env(safe-area-inset-top) + 6px)) 10px calc(88px + env(safe-area-inset-bottom)); }
  h1 { font-size: 20px; }
  .topbar { display: block; }
  .topbar-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 6px; margin-top: 8px; }
  .direction-toggle { grid-column: 1 / -1; }
  .direction { flex: 1; }
  .history-button { min-height: 40px; padding: 0 7px; font-size: 10px; }
  .install-app { grid-column: 1 / -1; min-height: 40px; padding: 0 7px; font-size: 10px; }
  .new-record-button { min-height: 40px; padding: 0 7px; font-size: 10px; }
  .meta-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .meta-strip label:nth-child(2) { grid-column: 1 / -1; }
  .meta-strip input, .meta-strip select, .meta-strip label:nth-child(2) input { width: 100%; }
  .location-input-wrap { width: 100%; }
  .location-input-wrap input { width: auto !important; }
  .weight-cell { min-height: 56px; padding: 7px 2px; }
  .weight-cell strong { font-size: 15px; }
  .weight-cell small { font-size: 9px; letter-spacing: -0.15px; }
  .weight-entry-row { grid-template-columns: minmax(0, 1fr) 76px; gap: 7px; }
  .weight-confirm-button { min-width: 76px; }
  .weigh-heading { gap: 6px; }
  .weigh-heading h2 { white-space: normal; overflow-wrap: anywhere; }
  .active-warehouse-total { min-width: 94px; }
  .vehicle-stats { min-width: 132px; padding: 5px 6px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .flow-heading-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .vehicle-stats { min-width: 122px; }
  .history-price-row { grid-template-columns: minmax(0, 1fr) 124px; gap: 5px; }
  .summary-bar { gap: 0; justify-content: stretch; overflow: visible; }
  .summary-bar div { min-width: 0; flex: 1 1 25%; }
  .summary-bar strong { font-size: 13px; }
}
@media (max-width: 360px) {
  .app-shell { padding-right: 8px; padding-left: 8px; }
  .warehouse-line { gap: 5px; }
  .warehouse-chip { min-height: 56px; padding-right: 5px; padding-left: 5px; }
  .warehouse-chip strong { font-size: 12px; }
  .warehouse-chip small { font-size: 9px; }
  .weight-entry-row { grid-template-columns: minmax(0, 1fr) 72px; }
  .weight-confirm-button { min-width: 72px; padding-right: 5px; padding-left: 5px; }
  .weight-input-wrap input { font-size: 48px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .app-shell { max-width: 760px; padding-bottom: 16px; }
  .warehouse-line { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .warehouse-chip { 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-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .app-shell { display: none !important; }
  .print-report { display: block !important; color: #142235; font-family: Arial, "Microsoft YaHei", sans-serif; }
  .print-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid #142235; }
  .print-head h1 { margin: 0; font-size: 22px; }
  .print-head p { margin: 4px 0 0; color: #64748b; font-size: 11px; }
  .print-status { color: #198754; font-size: 12px; font-weight: 700; }
  .print-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; padding: 9px; border: 1px solid #dce3ea; border-radius: 6px; font-size: 11px; }
  .print-meta strong { display: block; margin-top: 3px; font-size: 12px; }
  .print-report h2 { margin: 16px 0 8px; font-size: 15px; }
  .print-report table { width: 100%; border-collapse: collapse; font-size: 9px; }
  .print-report thead { display: table-header-group; }
  .print-report tr { break-inside: avoid; page-break-inside: avoid; }
  .print-report th, .print-report td { padding: 5px 4px; border: 1px solid #dce3ea; text-align: left; }
  .print-report th { color: #475569; background: #f1f5f9; font-weight: 800; }
  .print-report td.num, .print-report th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .print-section-title { margin: 10px 0 5px; padding-bottom: 3px; border-bottom: 1.5px solid #142235; font-size: 13px; }
  .print-price-list, .print-flow-vehicles { display: grid; gap: 8px; }
  .print-price-card { break-inside: avoid; page-break-inside: avoid; padding: 7px 8px; border: 1px solid #dce3ea; border-radius: 8px; background: #fbfcfd; }
  .print-vehicle { padding: 7px 8px; border: 1px solid #dce3ea; border-radius: 8px; background: #fbfcfd; }
  .print-price-head, .print-vehicle-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .print-price-head h3, .print-vehicle-head h3 { margin: 0; font-size: 12px; }
  .print-price-head strong, .print-vehicle-head strong { color: #1d5cff; font-size: 10px; white-space: nowrap; }
  .print-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid #e6ebf0; }
  .print-price-row b, .print-price-row small { display: block; }
  .print-price-row b { font-size: 10px; }
  .print-price-row small { margin-top: 2px; color: #64748b; font-size: 9px; }
  .print-price-row > strong { flex: 0 0 auto; text-align: right; font-size: 10px; line-height: 1.35; }
  .print-fish-totals { margin: 4px 0 5px; color: #475569; font-size: 9px; }
  .print-flow-list { display: grid; gap: 5px; }
  .print-flow-group { break-inside: avoid; page-break-inside: avoid; overflow: hidden; border: 1px solid #dce3ea; border-radius: 7px; background: #fff; }
  .print-flow-header { padding: 4px 6px; color: #475569; font-size: 9px; font-weight: 800; background: #f1f5f9; }
  .print-flow-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .print-flow-cell { min-width: 0; padding: 5px 1px 4px; border-top: 3px solid #c63636; border-right: 1px solid #dce3ea; background: #fff9f9; text-align: center; }
  .print-flow-cell small, .print-flow-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .print-flow-cell small { margin-bottom: 2px; color: #64748b; font-size: 7px; line-height: 1; }
  .print-flow-cell strong { color: #142235; font-size: 10px; line-height: 1.05; font-variant-numeric: tabular-nums; }
  .print-flow-empty { border-top-color: transparent; background: #fff; }
  .print-flow-total { min-width: 0; padding: 5px 1px 3px; border-left: 1px solid #dce3ea; color: #64748b; background: #f1f5f9; text-align: center; font-size: 7px; font-weight: 800; white-space: nowrap; }
  .print-flow-total + .print-flow-total { border-left: 0; }
  .print-flow-total strong { display: block; margin-top: 2px; color: #142235; font-size: 10px; font-variant-numeric: tabular-nums; }
  .print-flow-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 5px 6px; border-top: 1px solid #e6ebf0; color: #64748b; background: #f7faff; font-size: 8px; font-weight: 800; }
  .print-flow-summary strong { color: #1d5cff; font-size: 11px; }
  .print-total { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; font-size: 13px; font-weight: 800; }
  .print-total strong { color: #1d5cff; font-size: 17px; }
  .print-footer { margin-top: 18px; color: #64748b; font-size: 9px; }
}

/* Pencil 专业版版式：与简洁版保持同一视觉骨架，保留专业版的数据密度。 */
.app-shell {
  width: min(100%, 480px);
  max-width: 480px;
  padding: max(12px, calc(env(safe-area-inset-top) + 6px)) 12px calc(92px + env(safe-area-inset-bottom));
}
.topbar { margin-bottom: 4px; padding: 4px 4px 6px; }
.title-lockup { min-width: 0; }
.title-line { display: flex; align-items: baseline; gap: 10px; }
.title-line h1 { font-size: 26px; line-height: 1.1; }
.mode-badge { color: #7c3aed; font-size: 12px; font-weight: 850; white-space: nowrap; }
.topbar-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.topbar-status strong { color: var(--success); font-size: 11px; white-space: nowrap; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; margin-top: 4px; gap: 5px; }
.topbar-actions .direction-toggle { display: flex; flex: 0 0 auto; }
.topbar-actions .history-button, .topbar-actions .install-app { flex: 0 0 auto; }
.topbar-actions .history-button, .topbar-actions .install-app, .topbar-actions .direction { min-height: 32px; font-size: 10px; }
.topbar-actions .direction { min-width: 48px; }
.new-record-button { min-height: 44px; padding: 0 17px; border: 0; border-radius: 22px; color: #fff; background: var(--primary); font-size: 12px; box-shadow: 0 4px 10px rgba(37,99,235,.18); }
.new-record-button:active { background: var(--primary-dark); }
.meta-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 12px; align-items: stretch; padding: 14px 12px; border-radius: 15px; }
.meta-strip label { display: grid; align-content: center; gap: 3px; color: var(--muted); font-size: 11px; }
.meta-strip label:nth-child(2) { grid-column: auto; }
.meta-strip input, .meta-strip select { width: 100%; min-height: 34px; padding: 0; border: 0; border-radius: 0; color: var(--ink); background: transparent; font-size: 16px; font-weight: 850; }
.location-control { min-width: 0; }
.location-input-wrap { width: 100%; min-width: 0; }
.location-input-wrap input { width: 100%; min-width: 0; }
.location-button { min-height: 32px; padding: 0 6px; border: 0; background: transparent; font-size: 10px; }
.vehicle-strip, .warehouse-strip { margin-top: 14px; padding: 0 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.warehouse-strip { position: static; }
.strip-title { min-height: 34px; }
.strip-title .eyebrow { color: var(--ink); font-size: 17px; letter-spacing: -.02em; }
.strip-actions { gap: 4px; }
.strip-actions .text-button { min-height: 32px; padding: 0 6px; border: 0; background: transparent; font-size: 10px; }
.vehicle-line { gap: 7px; padding: 2px 0; overflow-x: auto; }
.vehicle-single, .vehicle-chip { min-height: 38px; border-radius: 20px; }
.vehicle-single { justify-content: center; padding: 7px 16px; border: 1px solid #9db7ff; color: var(--primary); background: #eff6ff; }
.vehicle-single span { display: none; }
.vehicle-chip { min-width: 78px; padding: 6px 14px; border: 1px solid var(--border); background: #fff; text-align: center; }
.vehicle-chip.selected { padding: 5px 13px; border-width: 2px; border-radius: 20px; }
.vehicle-chip .remove-chip { margin: -7px -9px 0 0; }
.mode-nav-inline { display: inline-flex; flex: 0 0 auto; margin-left: auto; }
.mode-nav-inline .mode-nav-button { min-height: 34px; min-width: 116px; padding: 0 10px; border: 1px solid #9db7ff; border-radius: 18px; color: var(--primary); background: #eff6ff; font-size: 11px; box-shadow: none; }
.warehouse-line { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 2px 0 0; }
.warehouse-chip { min-height: 62px; padding: 8px 8px; border-top-width: 0; border-radius: 12px; }
.warehouse-chip.selected { border-top-width: 0; border-width: 2px; padding: 7px; box-shadow: 0 0 0 1px var(--primary); }
.warehouse-chip strong { font-size: 13px; }
.warehouse-chip small { margin-top: 4px; font-size: 10px; }
.warehouse-chip .warehouse-binding { margin-top: 3px; color: var(--status-color); font-size: 9px; font-weight: 750; }
.warehouse-chip .warehouse-load { margin-top: 2px; color: var(--muted); font-size: 10px; }
.strip-helper { display: none; }
.weigh-panel { margin-top: 15px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.weigh-heading { align-items: baseline; padding: 0 4px 8px; }
.weigh-heading .eyebrow { display: none; }
.weigh-heading h2 { font-size: 16px; white-space: nowrap; }
.sequence-note { color: var(--muted); font-size: 10px; font-weight: 700; }
.active-warehouse-total { min-width: 112px; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: right; }
.active-warehouse-total span { color: var(--primary); font-size: 11px; }
.active-warehouse-total strong { color: var(--primary); font-size: 14px; }
.active-warehouse-total small { display: none; }
.weigh-body { padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.warehouse-assignment { min-height: 0; margin: -2px 0 8px; padding: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.fish-selectors { gap: 0; margin: 0 0 10px; }
.fish-selectors > div { min-height: 50px; gap: 5px; border-bottom: 1px solid #eef2f5; }
.fish-selectors > div:last-child { border-bottom: 0; }
.field-label { width: 34px; font-size: 11px; }
.select-chip { min-height: 42px; padding: 0 14px; border-radius: 20px; background: #fff; font-size: 12px; }
.select-chip.active { background: #eff6ff; }
.inline-edit { min-height: 42px; padding: 0 6px; font-size: 10px; }
.weight-label { margin: 10px 0 4px; font-size: 11px; }
.weight-entry-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; }
.weight-input-wrap { min-height: 82px; padding: 0 14px; border-bottom-width: 1px; border-radius: 12px; }
.weight-input-wrap input { font-size: 42px; }
.weight-confirm-button { min-width: 118px; min-height: 82px; border-radius: 12px; background: #7c3aed; box-shadow: 0 5px 12px rgba(124,58,237,.18); }
.weight-confirm-button:active { background: #6d28d9; }
.calc-line { margin-top: 8px; padding-top: 8px; }
.entry-feedback { display: none; }
.weights-panel, .settlement-panel { margin-top: 16px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.section-heading { align-items: baseline; padding: 0 4px 8px; }
.section-heading .eyebrow { display: none; }
.section-heading h2 { font-size: 17px; }
.flow-heading-actions { gap: 4px; }
.vehicle-stats { min-width: 0; padding: 0; border: 0; background: transparent; }
.vehicle-stats-row { display: none; }
.flow-filters { margin: 0 0 7px; padding: 0 4px; gap: 5px; }
.flow-filter-label { display: none; }
.flow-filter-chip { min-height: 30px; padding: 0 9px; border-radius: 15px; font-size: 10px; }
.flow-filter-chip small { font-size: 9px; }
.flow-fish-section { gap: 7px; padding: 0; border: 0; background: transparent; }
.flow-fish-heading { padding: 0 4px 4px; }
.flow-fish-heading strong { font-size: 16px; }
.flow-fish-heading span { font-size: 10px; }
.flow-grade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.flow-grade-section { min-width: 0; gap: 5px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.flow-grade-heading { padding: 0 1px 4px; }
.flow-grade-heading strong { color: var(--primary); font-size: 12px; }
.flow-grade-heading span { display: block; max-width: 58%; color: var(--muted); font-size: 8px; line-height: 1.25; text-align: right; }
.weight-groups { gap: 6px; margin-top: 0; }
.weight-group { border-radius: 8px; }
.group-header { padding: 5px 6px; font-size: 9px; }
.group-count { display: none; }
.weight-cell { min-height: 64px; padding: 4px 2px 3px; border-top-width: 2px; }
.weight-cell small { margin-bottom: 2px; font-size: 7px; }
.weight-cell strong { font-size: 13px; }
.weight-cell span { margin-top: 2px; font-size: 8px; }
.weight-group-summary { grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px 6px; font-size: 8px; }
.weight-group-summary strong { font-size: 10px; text-align: right; }
.audit-note { margin: 6px 4px 0; font-size: 10px; }
.settlement-panel { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.summary-bar { gap: 0; }
.summary-bar div { min-width: 0; flex: 1 1 25%; }
.summary-bar strong { font-size: 13px; }
@media (max-width: 360px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .title-line h1 { font-size: 23px; }
  .mode-badge { font-size: 11px; }
  .mode-nav-inline .mode-nav-button { min-width: 96px; padding: 0 6px; }
  .weight-entry-row { grid-template-columns: minmax(0, 1fr) 104px; }
  .weight-confirm-button { min-width: 104px; }
  .select-chip { padding-right: 10px; padding-left: 10px; }
  .weight-cell { min-height: 60px; }
}
