:root { color-scheme: light; font: 15px/1.55 "Segoe UI", "Microsoft YaHei", sans-serif; color: #222321; background: #f6f5f1; --line: #dedfd8; --muted: #646861; --ink: #223c31; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -.035em; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
input, select, button, textarea { font: inherit; }
textarea { width: 100%; resize: vertical; border: 1px solid #c9cdc4; border-radius: 6px; padding: 9px; margin: 8px 0; }
.source-text { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.review-hints { color: #86521d; font-size: 13px; }
.candidate-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#export-detail { margin-top: 12px; width: 100%; }
button { background: #fff; color: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: #869389; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #46745a; outline-offset: 3px; }
.primary { background: var(--ink); border-color: var(--ink); color: white; font-weight: 600; }
.primary:hover:not(:disabled) { background: #355646; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.mark { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: var(--ink); color: #fff; font-family: Georgia, serif; font-size: 19px; }
.login { width: min(410px, calc(100% - 36px)); margin: min(15vh, 110px) auto 0; background: white; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
.login h1 { margin-top: 24px; }
.login form { margin-top: 24px; }
.stack { display: grid; gap: 16px; }
.topbar, .top-actions, .rail-title, .section-title, .actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.topbar { height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #fff; }
.badge { padding: 3px 9px; border-radius: 20px; background: #edf2e8; color: #345443; font-size: 12px; }
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.rail { padding: 20px 14px; border-right: 1px solid var(--line); background: #efeee8; }
#quote-rail { display: grid; gap: 8px; }
#history { max-height: max(220px, calc(100vh - 450px)); overflow-y: auto; scrollbar-gutter: stable; }
#history-count { font-size: 12px; }
.rail > .primary { width: 100%; }
.main-nav { display: grid; gap: 8px; margin-bottom: 24px; }
.main-nav button { text-align: left; }
.main-nav button[aria-current=page] { border-color: #688374; background: #edf3ed; }
#me-desk > section + section { margin-top: 20px; }
.profile-heading { display: flex; align-items: center; gap: 14px; }
.profile-heading p { font-size: 12px; }
.profile-avatar { width: 54px; height: 54px; padding: 0; overflow: hidden; border-radius: 12px; background: var(--ink); color: white; font: bold 28px Georgia, serif; flex-shrink: 0; }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.conflict-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#conflicts-desk > * + * { margin-top: 16px; }
#default-flow-desk > * + * { margin-top: 16px; }
.default-flow-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: end; }
#customers-desk > * + *, #customer-list-view > * + * { margin-top: 16px; }
#orders-desk > * + * { margin-top: 16px; }
#order-note { white-space: pre-wrap; overflow-wrap: anywhere; }
#order-detail-title, #order-list h2 { overflow-wrap: anywhere; }
.order-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.order-steps button[aria-pressed=true] { border-color: #688374; background: #edf3ed; }
.order-product-image { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; }
#shipments-desk > * + * { margin-top: 16px; }
.shipment-photos { display: flex; flex-wrap: wrap; gap: 12px; }
.shipment-photos > div { width: 150px; }
.shipment-photos img { width: 120px; height: 100px; object-fit: cover; }
.shipment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shipment-actions button { white-space: nowrap; }
.shipment-remark { white-space: pre-wrap; overflow-wrap: anywhere; }
#shipment-photo-full { max-width: 100%; max-height: 70vh; object-fit: contain; }
#invoices-desk > * + * { margin-top: 16px; }
.invoice-table-scroll { overflow-x: auto; }
.invoice-table-scroll table { min-width: 760px; table-layout: auto; }
.invoice-table-scroll td { min-width: 110px; vertical-align: top; }
.invoice-table-scroll td:first-child { min-width: 210px; }
.invoice-table-scroll th, .invoice-table-scroll button { white-space: nowrap; }
#invoice-filenames { white-space: pre-wrap; overflow-wrap: anywhere; }
#pi-settings-list p { white-space: pre-wrap; overflow-wrap: anywhere; }
#pi-settings-view .top-actions { flex-wrap: wrap; justify-content: flex-start; }
.customer-record { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.customer-record button { margin: 8px 6px 0 0; }
.customer-record .muted { white-space: pre-wrap; }
#customer-list .top-actions { flex-wrap: wrap; justify-content: flex-start; }
#customer-list button { white-space: nowrap; }
.customer-record, #customer-detail-name { overflow-wrap: anywhere; }
#customer-consignee dd { white-space: pre-wrap; overflow-wrap: anywhere; }
#products-desk > * + * { margin-top: 16px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product-grid .panel { display: grid; align-content: start; gap: 8px; overflow-wrap: anywhere; }
.product-spec, .product-process { border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.product-anchors { position: sticky; top: 0; z-index: 2; display: flex; gap: 16px; flex-wrap: wrap; background: white; padding: 12px 0; border-bottom: 1px solid var(--line); }
.product-anchors a { color: var(--ink); text-decoration: none; }
#product-form > section { scroll-margin-top: 65px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.product-overview { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.product-photo > button { padding: 0; width: 160px; height: 160px; margin-top: 16px; overflow: hidden; }
.product-photo img, .product-card-photo { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.photo-actions button { padding: 4px 7px; font-size: 13px; }
.product-card-photo { aspect-ratio: 1; height: auto; border-radius: 6px; }
dialog { border: 1px solid var(--line); border-radius: 10px; max-width: min(640px, calc(100vw - 40px)); max-height: 90vh; overflow: auto; padding: 22px; color: inherit; }
dialog::backdrop { background: rgb(0 0 0 / .35); }
#product-crop-canvas { width: min(480px, 100%, calc(90vh - 240px)); aspect-ratio: 1; display: block; touch-action: none; cursor: grab; margin: 16px 0; }
#product-photo-full { max-width: 100%; max-height: 70vh; object-fit: contain; }
.flow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.flow-row > span { flex: 1; min-width: 140px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; background: #edf2e8; padding: 4px 8px; }
.tag-chip button { border: 0; background: transparent; font-size: 12px; padding: 0 3px; }
#product-tag-choices button[aria-pressed=true] { background: var(--ink); color: white; }
.tier-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; align-items: end; }
.button { display: inline-block; border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; color: inherit; text-decoration: none; background: white; }
#freight-desk > * + * { margin-top: 16px; }
.freight-preview { max-height: 400px; overflow: auto; margin-top: 12px; }
.freight-preview table { min-width: 650px; }
.freight-preview th { width: auto; }
.freight-preview summary { cursor: pointer; }
.rail-title { margin: 23px 0 10px; }
.rail-title button { font-size: 12px; padding: 4px 9px; }
.record { text-align: left; width: 100%; margin: 0 0 7px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.record small { color: var(--muted); font-variant-numeric: tabular-nums; }
.desk { width: min(100%, 1350px); padding: 26px clamp(20px, 3vw, 48px) 40px; }
.page-title { margin-bottom: 20px; }
.version-bar, .versions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.version-bar { justify-content: space-between; margin-bottom: 14px; }
.versions button[aria-current=true], .record[aria-current=true] { border-color: #688374; background: #edf3ed; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); align-items: start; gap: 18px; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 550; }
input:not([type=checkbox]), select { width: 100%; min-width: 0; height: 39px; border: 1px solid #c9cdc4; border-radius: 6px; background: #fff; color: inherit; padding: 7px 9px; }
.checkbox { display: flex; gap: 7px; align-self: end; align-items: center; min-height: 39px; }
.checkbox input { accent-color: var(--ink); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 10px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 5px; vertical-align: top; }
th { color: var(--muted); font-weight: 550; font-size: 13px; }
th:nth-child(2) { width: 94px; }
th:nth-child(3) { width: 103px; }
th:last-child { width: 55px; }
td small { display: block; color: var(--muted); margin-top: 4px; }
td button { font-size: 12px; padding: 6px 7px; }
.product-search { margin-bottom: 6px; }
.product-cell > select:first-child { margin-bottom: 6px; }
.product-cell { overflow-wrap: anywhere; }
.quote-options summary, .line-options summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.line-options { margin-top: 6px; font-size: 13px; }
.line-options .fields { gap: 8px; margin-top: 8px; }
.process-list { display: grid; gap: 5px; margin-top: 8px; }
.process-choice { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: 6px; }
.process-choice .checkbox { min-height: 32px; }
.process-choice input[type=number] { height: 32px; }
.actions { justify-content: flex-end; }
.message:not(:empty) { padding: 8px 10px; background: #eef3ea; border-radius: 7px; overflow-wrap: anywhere; }
.message[data-error=true] { color: #8c3021; background: #faeeea; }
.danger { color: #8c3021; border-color: #c58e81; }
.summary { position: sticky; top: 18px; }
.total { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.total span { color: var(--muted); font-size: 13px; }
.total strong { font-size: 33px; color: var(--ink); font-variant-numeric: tabular-nums; }
dl { display: grid; gap: 5px; margin: 13px 0 17px; }
dl div { display: flex; justify-content: space-between; gap: 8px; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 "Segoe UI", sans-serif; background: #f4f5ef; border-radius: 6px; padding: 11px; margin: 8px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1160px) { .columns { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 650px) {
  .layout { grid-template-columns: 1fr; }
  .rail { border-right: 0; }
  .fields { grid-template-columns: 1fr; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
  tbody td { display: block; min-width: 0; border: 0; align-self: end; }
  .product-cell { grid-column: 1 / -1; }
  td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
}
