:root { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #202223; background: #f6f6f7; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1360px; margin: 0 auto; padding: 28px 24px 72px; }
.masthead { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.masthead h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.25; }
.eyebrow { margin: 0; color: #637381; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.revision { color: #43515c; background: #e3e8eb; border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
#notice:empty { display: none; }
#notice { padding: 12px 16px; margin-bottom: 18px; background: #eaf5ee; border: 1px solid #b8ddc5; border-radius: 9px; }
#notice.error { background: #fff0f0; border-color: #eeb6b6; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 18px; }
.card, .panel { background: white; border: 1px solid #dfe3e8; border-radius: 12px; box-shadow: 0 1px 2px #00000008; }
.card { padding: 20px; }
.card h2, .panel h2 { margin: 0 0 12px; font-size: 18px; }
.card h3 { margin: 14px 0 8px; font-size: 15px; }
.card p { margin: 6px 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 20px; border-bottom: 1px solid #dfe3e8; }
.panel > header h2 { margin: 0; }
.panel > .body { padding: 18px 20px 22px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar:last-child { margin-bottom: 0; }
button, .button { appearance: none; border: 1px solid #8c9196; border-radius: 7px; background: white; color: #202223; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #f1f2f3; }
button.primary { background: #005bd3; color: white; border-color: #005bd3; }
button.primary:hover { background: #004cb3; }
button.danger { color: #bf0711; border-color: #d82c0d; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #8c9196; border-radius: 7px; background: white; padding: 8px 10px; max-width: 100%; }
input[type="checkbox"] { width: auto; margin-right: 7px; }
input[type="file"] { border: none; padding: 5px 0; }
textarea { width: 100%; min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; }
label { display: grid; gap: 5px; font-weight: 600; }
label.checkbox { display: flex; align-items: center; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 12px; }
.limit-setting { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border, #d9dde3); border-radius: 8px; }
.limit-setting > label:first-child { display: grid; gap: 5px; }
.limit-setting .checkbox { min-height: 0; align-self: start; }
.limit-setting input:disabled { opacity: .55; }
.fields.wide { grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); }
.help, .muted { color: #6d7175; }
.help { font-size: 12px; margin: 5px 0; }
.pill { border-radius: 99px; padding: 3px 8px; background: #e3e8eb; font-size: 12px; }
.pill.ok { background: #d8f3dc; color: #155724; }
.pill.bad { background: #ffe3e3; color: #8c0e13; }
.table-wrap { overflow: auto; max-height: 600px; border: 1px solid #dfe3e8; border-radius: 8px; }
table { border-collapse: collapse; width: 100%; background: white; }
th, td { border-bottom: 1px solid #e3e8eb; padding: 9px 10px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f6f6f7; font-size: 12px; color: #454f5b; }
td input { min-width: 75px; width: 100%; }
td button { white-space: nowrap; }
details { border: 1px solid #dfe3e8; border-radius: 8px; background: white; margin: 8px 0; }
details > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; }
details > .detail-body { border-top: 1px solid #dfe3e8; padding: 14px; }
.split { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 14px; }
.listbox { max-height: 500px; overflow: auto; border: 1px solid #dfe3e8; border-radius: 8px; }
.listbox button { display: block; width: 100%; border: none; border-bottom: 1px solid #e3e8eb; border-radius: 0; text-align: left; font-weight: 400; }
.listbox button.selected { background: #e9f1fb; font-weight: 700; }
.log-record { margin: 8px 0; }
.log-record summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.log-record pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 600px; overflow: auto; background: #f6f6f7; padding: 12px; border-radius: 8px; font-size: 12px; }
.log-record > summary { justify-content: space-between; }
.log-record > summary.log-rate-summary { display: grid; grid-template-columns: 12px 190px 170px 175px minmax(260px, 1fr) 120px; gap: 14px; align-items: center; }
.log-caret { color: #637381; transition: transform .15s ease; }
.log-record[open] > summary .log-caret { transform: rotate(90deg); }
.log-summary-field { display: grid; gap: 2px; min-width: 0; font-weight: 400; }
.log-summary-field strong { overflow-wrap: anywhere; }
.log-summary-field small, .log-summary-status small { color: #6d7175; font-size: 12px; font-weight: 400; }
.log-summary-status { display: grid; justify-items: end; gap: 3px; }
.log-details { display: grid; gap: 12px; }
.log-details h3, .log-details h4 { margin: 8px 0 0; }
.log-details p { margin: 0; }
.log-section { margin: 0; }
.log-section > summary { display: flex; justify-content: space-between; gap: 12px; }
.log-cart > summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; box-sizing: border-box; }
.log-cart-heading { display: flex; justify-content: space-between; gap: 12px; }
.log-cart-groups { display: grid; gap: 5px; width: 100%; font-weight: 400; }
.log-cart-group { display: grid; grid-template-columns: minmax(100px, 1fr) repeat(3, minmax(85px, auto)); gap: 12px; align-items: center; padding: 6px 10px; border-radius: 5px; background: #f6f6f7; }
.log-cart-group > :last-child { text-align: right; }
.log-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #dfe3e8; border-radius: 8px; }
.log-table th { position: static; }
.log-table td:last-child, .log-table th:last-child { text-align: right; }
.log-cart-table tbody tr:last-child { font-weight: 700; background: #f6f6f7; }
.log-quote { margin: 6px 0; }
.log-quote > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.log-amount { margin-left: auto; font-size: 16px; }
.log-error { padding: 10px 12px; border: 1px solid #eeb6b6; background: #fff0f0; border-radius: 8px; }
.log-warnings { margin: 0; padding-left: 20px; }
.log-warnings li { margin: 3px 0; }
.log-raw > summary { color: #43515c; font-size: 12px; }
.legacy-log-content { max-height: 80vh; overflow: auto; white-space: pre; padding: 12px; background: #f6f6f7; border: 1px solid #dfe3e8; border-radius: 8px; font-size: 12px; }
.preview-summary { border-left: 4px solid #005bd3; background: #edf5ff; padding: 12px 16px; border-radius: 5px; }
.preview-summary p { margin: 3px 0; }
.change-list { max-height: 350px; overflow: auto; }
.change-list code { font-size: 12px; }
.field-change-header, .field-change-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(130px, 1fr) 20px minmax(130px, 1fr); gap: 12px; align-items: center; }
.field-change-header { padding: 7px 12px; color: #637381; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.field-change-row { padding: 10px 12px; border-top: 1px solid #e3e8eb; font-size: 13px; font-variant-numeric: tabular-nums; }
.field-change-row:nth-child(2n) { background: #f8faf9; }
.field-change-name { display: grid; min-width: 0; gap: 1px; }
.field-change-name strong, .field-change-name code { overflow-wrap: anywhere; }
.field-change-name code { color: #69766d; font-weight: 400; }
.field-change-arrow { color: #637381; text-align: center; }
.field-change-proposed { color: #17633e; }
.spacer { flex: 1; }
.order-workspace { max-width: 1120px; margin: 0 auto; }
.order-hero { padding: 28px 32px; border: 1px solid #c9d9f1; border-radius: 14px; background: linear-gradient(120deg, #f0f6ff, #ffffff 75%); }
.order-hero h2 { margin: 5px 0 8px; font-size: 25px; line-height: 1.2; }
.order-hero p:last-child { max-width: 670px; margin: 0; color: #506173; }
.order-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.order-summary-grid .order-stat { padding: 18px 20px; background: white; border: 1px solid #dfe3e8; border-radius: 12px; }
.order-stat { display: grid; gap: 2px; }
.order-stat strong { font-size: 21px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.order-stat span { color: #637381; font-size: 12px; }
.order-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.order-controls label { min-width: 170px; }
.order-controls button { min-height: 38px; }
.order-count[hidden] { display: none; }
.order-note { margin: 0; color: #637381; font-size: 12px; }
.order-job-status { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 16px 18px; border: 1px solid #dfe3e8; border-radius: 10px; background: #f8fafc; }
.order-status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 3px 10px; border-radius: 99px; color: #31415a; background: #e8eef7; font-size: 12px; font-weight: 700; white-space: nowrap; }
.order-status-badge.complete { color: #155724; background: #dcf4e4; }
.order-status-badge.failed { color: #a21b2d; background: #ffe7e8; }
.order-stats { display: flex; flex-wrap: wrap; gap: 18px; }
.order-stats .order-stat { min-width: 110px; }
.order-stats .order-stat strong { font-size: 17px; }
.order-error, .order-empty { margin: 0; padding: 16px 18px; border-radius: 9px; }
.order-error { color: #8c0e13; background: #fff0f0; border: 1px solid #eeb6b6; }
.order-empty { color: #506173; background: #f8fafc; border: 1px dashed #cbd5df; }
.order-results-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 5px; }
.order-results-heading h3 { margin: 3px 0 0; font-size: 20px; }
.order-impact { display: grid; gap: 9px; }
.order-impact-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.order-impact-grid .order-stat { padding: 14px 16px; border: 1px solid #dfe3e8; border-radius: 9px; background: #f8fafc; }
.order-impact-grid .order-stat strong { font-size: 19px; }
.order-histogram { padding: 18px 20px 14px; border: 1px solid #dfe3e8; border-radius: 10px; background: #fff; }
.order-histogram-heading, .order-histogram-actions { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.order-histogram-heading h4 { margin: 0 0 2px; font-size: 16px; }
.order-histogram-actions { align-items: center; white-space: nowrap; font-size: 12px; color: #637381; }
.order-histogram-clear { min-height: 28px; padding: 3px 8px; font-size: 12px; }
.order-histogram-scroll { overflow-x: auto; }
.order-histogram-groups { display: grid; grid-template-columns: 3fr 3fr 1fr; gap: 14px; min-width: 610px; margin-top: 15px; }
.order-histogram-group { min-width: 0; padding: 11px 11px 7px; border-radius: 9px; background: #f9fafb; }
.order-histogram-group.decrease { background: #fff7f7; }
.order-histogram-group.increase { background: #f4faf6; }
.order-histogram-group-title { color: #5c6874; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: center; }
.order-histogram-group.decrease .order-histogram-group-title { color: #a42b3b; }
.order-histogram-group.increase .order-histogram-group-title { color: #23734b; }
.order-histogram-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 5px; }
.order-histogram-group.other .order-histogram-bars { grid-template-columns: 1fr; }
.order-histogram-bar { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 5px 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 400; text-align: center; }
.order-histogram-bar:hover { background: #ffffffb8; }
.order-histogram-bar[aria-pressed="true"] { border-color: #005bd3; background: #eaf3ff; box-shadow: inset 0 0 0 1px #005bd3; }
.order-histogram-bar:focus-visible { outline: 2px solid #005bd3; outline-offset: 2px; }
.order-histogram-bar:disabled { opacity: .55; }
.order-histogram-bar strong { font-size: 15px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.order-histogram-track { display: flex; align-items: end; height: 66px; border-bottom: 1px solid #b8c0c8; }
.order-histogram-fill { display: block; width: 100%; border-radius: 4px 4px 0 0; background: #8996a3; }
.order-histogram-bar.increase .order-histogram-fill { background: #319567; }
.order-histogram-bar.decrease .order-histogram-fill { background: #d05662; }
.order-histogram-label { font-size: 11px; line-height: 1.3; white-space: nowrap; }
.order-histogram-footnote { margin: 11px 0 0; color: #637381; font-size: 11px; }
.order-range-label { padding: 4px 10px; border-radius: 99px; background: #e9f1fb; color: #164f98; font-size: 12px; font-weight: 700; white-space: nowrap; }
.order-result { overflow: hidden; border: 1px solid #dfe3e8; border-radius: 11px; background: white; }
.order-result > header { padding: 16px 20px; border-bottom: 1px solid #e3e8eb; }
.order-result h4 { margin: 0; overflow: hidden; color: #202223; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.order-result > header p { margin: 2px 0 0; color: #637381; }
.order-recorded { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 20px; padding: 14px 20px; background: #f8fafc; border-bottom: 1px solid #e3e8eb; }
.order-data-label { display: block; margin-bottom: 4px; color: #637381; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-recorded ul { display: grid; gap: 3px; max-width: 620px; margin: 0; padding: 0; list-style: none; }
.order-recorded li { display: flex; justify-content: space-between; gap: 12px; }
.order-recorded li strong, .order-recorded > div > strong { font-variant-numeric: tabular-nums; }
.order-recorded p { margin: 0; }
.order-recorded-note { padding: 9px 20px; border-bottom: 1px solid #e3e8eb; }
.order-quote-wrap { overflow-x: auto; }
.order-quote-table { min-width: 720px; table-layout: fixed; }
.order-quote-table > thead > tr > th:first-child { width: 40%; }
.order-quote-table th, .order-quote-table td { padding: 11px 20px; }
.order-quote-table thead th { position: static; background: white; color: #637381; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-quote-table tbody th { font-weight: 600; }
.order-quote-table tbody tr:last-child th, .order-quote-table tbody tr:last-child td { border-bottom: 0; }
.order-quote-table td { font-variant-numeric: tabular-nums; }
.order-quote-row { cursor: pointer; }
.order-quote-row:hover, .order-quote-row:hover th { background: #f1f6ff; }
.order-quote-row.selected, .order-quote-row.selected th { background: #eaf3ff; }
.order-quote-row.selected th:first-child { box-shadow: inset 4px 0 #005bd3; }
.order-expand { display: inline-flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.order-expand:hover { background: transparent; }
.order-expand:focus-visible { outline: 2px solid #005bd3; outline-offset: 3px; }
.order-chevron { color: #637381; transition: transform .15s ease; }
.order-expand[aria-expanded="true"] .order-chevron { transform: rotate(90deg); }
.order-selected-badge { margin-left: 5px; padding: 2px 7px; border-radius: 99px; background: #d5e8ff; color: #164f98; font-size: 11px; font-weight: 700; white-space: nowrap; }
.order-detail-row > td { padding: 0; background: #f8fafc; }
.order-breakdown { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 10px; padding: 18px 20px 22px; }
.order-breakdown h5 { margin: 7px 0 0; font-size: 14px; }
.order-breakdown .log-table-wrap { background: white; }
.order-breakdown .log-table th { white-space: nowrap; }
.order-breakdown .log-table td { font-variant-numeric: tabular-nums; }
.order-charge-table .order-charge-row.increase > * { background: #eaf6ee; color: #12623c; font-weight: 700; }
.order-charge-table .order-charge-row.decrease > * { background: #fff0f0; color: #a21b2d; font-weight: 700; }
.order-proposed { font-weight: 700; }
.order-delta { white-space: nowrap; font-weight: 700; }
.order-delta.increase { color: #147348; }
.order-delta.decrease { color: #a21b2d; }
.order-footer { display: flex; justify-content: flex-start; }
@media (max-width: 750px) { main { padding: 16px 12px 50px; } .masthead { align-items: start; flex-direction: column; } .split { grid-template-columns: 1fr; } }
@media (max-width: 750px) { .order-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 750px) { .order-histogram-heading { flex-wrap: wrap; } }
@media (max-width: 500px) { .log-cart-group { grid-template-columns: repeat(2, 1fr); } .log-cart-group > :last-child { text-align: left; } }

/* Configuration workspace */
:root { color: #202c2a; background: #f7f8f7; }
html { scroll-behavior: auto; }
main { max-width: 1280px; padding-top: 32px; }
.masthead { margin-bottom: 18px; }
.masthead h1 { font-size: clamp(25px, 2.3vw, 32px); font-weight: 700; letter-spacing: -.025em; }
.eyebrow { color: #62746c; letter-spacing: .07em; }
.revision { background: #e8eeeb; color: #3c574a; font-size: 12px; font-weight: 650; }
.stack { gap: 16px; }
.stack, .stack > *, .card, .panel, .panel > .body, .split, .split > * { min-width: 0; }
.card, .panel { border-color: #dfe5e0; box-shadow: 0 1px 2px #172e210a; }
.card { padding: 22px 24px; }
.card h2, .panel h2 { font-size: 17px; letter-spacing: -.015em; }
.panel > header { padding: 16px 22px; }
.panel > .body { padding: 20px 22px 22px; }
.fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.fields.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields > details { min-width: 0; }
.field-group { grid-column: 1 / -1; min-width: 0; padding: 16px 18px 18px; border: 1px solid #dfe5e0; border-radius: 9px; background: #fbfcfb; }
.field-group h3 { margin: 0 0 13px; font-size: 14px; }
.field-group .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.packaging-editor { display: grid; gap: 16px; }
.packaging-coolants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.packaging-group { min-width: 0; padding: 17px 18px; border: 1px solid #dfe5e0; border-radius: 9px; background: #fbfcfb; }
.packaging-group h3 { margin: 0; font-size: 15px; }
.packaging-group > .help { margin: 4px 0 16px; }
.packaging-group .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.volume-uplift-editor { background: #f7faf8; }
.volume-uplift-editor > .fields { max-width: 720px; }
.volume-uplift-status { margin: 12px 0 0; color: #245f42; font-size: 12px; }
.volume-uplift-status.error { color: #a21b2d; }
.volume-calculator { display: grid; gap: 12px; margin: 18px 0 15px; padding: 14px 16px; border: 1px solid #dfe5e0; border-radius: 8px; background: #fff; }
.volume-calculator strong { font-size: 13px; }
.volume-calculator .help { margin: 2px 0 0; }
.volume-calculator-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.volume-calculator-fields button { white-space: nowrap; }
.volume-uplift-editor > button { font-size: 12px; }
.liters-converter { background: #f7faf8; }
.liters-converter-fields { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(210px, 1.4fr) auto; gap: 12px; align-items: end; }
.liters-converter-fields button { white-space: nowrap; }
.volume-converter-result { margin: 10px 0 0; color: #245f42; font-size: 12px; }
.volume-converter-result.error { color: #a21b2d; }
.cutoff-settings { position: relative; }
.cutoff-settings > h3 { margin-right: 160px; }
.cutoff-settings-info { margin: 0; border: 0; background: transparent; }
.cutoff-settings-info > summary { position: absolute; top: 12px; right: 18px; padding: 4px 9px; border: 1px solid #b7c3ba; border-radius: 7px; background: #fff; color: #17633e; font-size: 12px; font-weight: 700; list-style: none; }
.cutoff-settings-info > summary::-webkit-details-marker { display: none; }
.cutoff-settings-info > summary::before { content: "ⓘ"; margin-right: 5px; font-size: 14px; }
.cutoff-settings-info[open] > summary { background: #eaf4ed; }
.cutoff-settings-explanation { margin-top: 14px; padding: 12px 14px; border: 1px solid #d3e5d8; border-radius: 8px; background: #f1f8f3; color: #33433a; font-size: 12px; line-height: 1.5; }
.cutoff-settings-explanation p { margin: 0; }
.cutoff-settings-explanation p + p { margin-top: 8px; }
.split .fields > details { grid-column: 1 / -1; }
.detail-body .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { min-width: 0; gap: 6px; font-size: 13px; }
input, select, textarea { min-height: 37px; border-color: #aab5ad; padding: 8px 11px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #17794c; outline-offset: 2px; }
input:not([type="checkbox"]):hover, select:hover, textarea:hover { border-color: #667e6d; }
input[type="checkbox"] { accent-color: #197a4c; min-height: 0; }
button, .button { border-color: #b7c3ba; min-height: 36px; transition: background .12s ease, border-color .12s ease; }
button.primary { background: #146c43; border-color: #146c43; }
button.primary:hover { background: #0f5635; border-color: #0f5635; }
button.danger { color: #a1272e; border-color: #efc6c8; }
button.danger:hover { background: #fff0f0; }
details { border-color: #dfe5e0; }
details > summary { padding: 10px 12px; }
details[open] > summary { background: #f5f8f5; }
.editor-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor-top .toolbar { margin: 0; }
.unit-note { margin: 0; border: 0; background: transparent; color: #506457; font-size: 12px; }
.unit-note > summary { padding: 7px 0; font-weight: 600; }
.unit-note[open] { flex-basis: 100%; padding: 0 12px 8px; background: #eef5ef; border-radius: 8px; }
.unit-note p { margin: 6px 0 0; }
.section-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px; border: 1px solid #dfe5e0; border-radius: 9px; background: #fff; }
.section-links a { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 11px; border-radius: 6px; color: #3d5c48; font-size: 12px; font-weight: 650; text-decoration: none; }
.section-links a:hover { background: #edf5ee; color: #146c43; }
.stack > [id] { scroll-margin-top: 18px; }
.checkbox { min-height: 37px; align-self: end; gap: 7px; font-weight: 550; }
textarea { min-height: 64px; }
.help { line-height: 1.45; }
.table-wrap { width: 100%; max-width: 100%; max-height: 460px; }
.table-wrap table { min-width: 1120px; }
.table-wrap th { background: #f5f7f5; white-space: nowrap; }
.table-wrap th, .table-wrap td { padding: 9px 10px; }
.table-wrap tr:hover td { background: #f9fbf9; }
.table-wrap td input:not([type="checkbox"]) { min-width: 90px; }
.table-field { position: relative; font-size: 13px; }
.table-field > .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.table-field.checkbox { min-height: 37px; justify-content: center; }
.split { grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); gap: 16px; }
.listbox { max-height: 390px; border-color: #dfe5e0; }
.listbox button { padding: 10px 12px; overflow-wrap: anywhere; }
.listbox button.selected { background: #eaf4ec; color: #145e3b; box-shadow: inset 3px 0 #197a4c; }
.split > div:last-child { min-width: 0; }
.split > div:last-child > .card { background: #fbfcfb; }
.log-record { margin: 6px 0; }
.log-tabs { gap: 4px; padding-bottom: 12px; border-bottom: 1px solid #dfe5e0; }
.log-tabs button { border-color: transparent; background: transparent; color: #4d6054; }
.log-tabs button:hover { background: #ebf3ed; }
.log-tabs button.primary { background: #e7f3e9; border-color: #d1e8d6; color: #145e3b; }
.log-tabs button.primary:hover { background: #dceee0; }
.log-tabs + .toolbar { align-items: end; }
.log-tabs + .toolbar input[type="search"] { flex: 1 1 240px; min-width: 220px; max-width: 440px; }
.log-record > summary { padding: 12px 14px; }
.log-record > summary.log-rate-summary { grid-template-columns: 12px minmax(125px, .9fr) minmax(130px, 1fr) minmax(200px, 2fr) minmax(85px, .7fr) minmax(100px, .8fr) 110px; gap: 12px; }
.log-summary-field strong { line-height: 1.3; }
.log-record > summary:hover { background: #f7faf7; }
.calendar-guide { margin: 0 0 22px; padding: 16px 18px; border: 1px solid #d8e5da; border-radius: 9px; background: #f5faf6; }
.calendar-guide h3 { margin: 0 0 8px; font-size: 15px; }
.calendar-guide p { margin: 0 0 9px; color: #40574a; }
.calendar-guide p:last-child { margin-bottom: 0; }
.calendar-guide ul { display: grid; gap: 7px; margin: 0 0 10px; padding-left: 20px; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; border: 0; }
.weekday-picker legend { margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.weekday-picker label { display: inline-flex; align-items: center; gap: 6px; min-height: 33px; padding: 5px 10px; border: 1px solid #d6e0d8; border-radius: 7px; background: #f9fbf9; cursor: pointer; }
.weekday-picker label:has(input:checked) { border-color: #e9bbb7; background: #fff0ee; color: #8f352f; }
.weekday-picker input { margin: 0; }
.calendar-area { min-width: 0; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.calendar-toolbar > strong { font-size: 18px; letter-spacing: -.02em; }
.calendar-toolbar .toolbar { margin: 0; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 10px; color: #625e5c; font-size: 12px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend span::before { content: ""; width: 12px; height: 12px; border: 1px solid #edc2b8; border-radius: 3px; background: #fff2ef; }
.calendar-legend .legend-transit::before { border-color: #dfa09a; background: #fbdedb; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.month-weekday { padding: 6px 8px; color: #64736a; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.month-day { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; min-width: 0; min-height: 76px; padding: 8px 10px; border-color: #e2e8e3; border-radius: 7px; background: #fbfcfb; text-align: left; font-weight: 700; }
.month-day:hover { background: #edf5ee; border-color: #9ebdab; }
.month-day.closed { color: #8b3b35; background: #fff2f0; border-color: #f0d4cf; }
.month-day.closed:hover { background: #fce8e5; }
.month-day.transit-stop { background: #fbdedb; border-color: #e9b8b0; }
.month-day.transit-stop:hover { background: #f8d2ce; }
.day-caption { display: -webkit-box; max-width: 100%; overflow: hidden; color: #8f4740; font-size: 11px; font-weight: 550; line-height: 1.25; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.holiday-area { margin-top: 22px; padding-top: 18px; border-top: 1px solid #dfe5e0; scroll-margin-top: 16px; }
.holiday-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.holiday-heading h3 { margin: 0; font-size: 16px; }
.holiday-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 210px; overflow: auto; }
.holiday-list button { overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: nowrap; font-weight: 500; }
.holiday-list button.selected { background: #eaf4ec; border-color: #b1d1bb; color: #145e3b; font-weight: 700; }
.holiday-form { display: grid; justify-items: start; gap: 13px; margin-top: 16px; padding: 18px; border: 1px solid #dfe5e0; border-radius: 9px; background: #fbfcfb; }
.holiday-form h4 { margin: 0; font-size: 15px; }
.holiday-form .fields { width: 100%; }
.holiday-form label[hidden] { display: none; }
.holiday-form .transit-option { align-self: auto; padding: 8px 10px; border: 1px solid #dfe5e0; border-radius: 7px; background: white; }
.packing-workspace { display: grid; gap: 16px; }
.packing-workspace .order-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.packing-controls { margin-bottom: 0; }
.packing-controls input[type="search"] { flex: 1 1 240px; min-width: 220px; max-width: 440px; }
.packing-order { padding: 0; border: 1px solid #dfe3e8; border-radius: 11px; background: #fff; }
.packing-order > summary.log-rate-summary { grid-template-columns: 12px minmax(140px, 1fr) minmax(130px, .8fr) minmax(180px, 1.1fr) minmax(230px, 2fr); }
.packing-order > summary .packing-order-number { font-size: 15px; }
.packing-order.selected { border-color: #b5ccef; box-shadow: 0 0 0 2px #eaf3ff; }
.packing-order-head { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(250px, 2fr) auto; align-items: center; gap: 15px; }
.packing-order-head > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.packing-order-number { color: #202223; font-size: 17px; }
.packing-order-meta { display: flex; gap: 12px; flex-wrap: wrap; color: #637381; font-size: 12px; text-transform: capitalize; }
.packing-address { margin: 6px 0 0; color: #637381; font-size: 13px; }
.packing-order-body { padding: 17px 20px; border-top: 1px solid #e3e8eb; }
.packing-table-scroll { width: 100%; overflow-x: auto; }
.packing-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.packing-table td:nth-child(3), .packing-table td:nth-child(4) { white-space: nowrap; }
.packing-table th, .packing-table td { padding: 11px 10px; border-bottom: 1px solid #e3e8eb; text-align: left; vertical-align: middle; }
.packing-table th { position: static; color: #637381; background: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.packing-table td { font-variant-numeric: tabular-nums; }
.packing-table th:last-child, .packing-table .packing-result { text-align: right; white-space: nowrap; }
.packing-piece-weights { display: flex; flex-wrap: wrap; gap: 7px; min-width: 130px; }
.packing-piece-weights label { display: grid; gap: 2px; color: #637381; font-size: 11px; font-weight: 600; }
.packing-piece-weights input { width: 95px; min-height: 34px; }
.packing-refund { color: #147348; }
.packing-charge { color: #a21b2d; }
.packing-neutral { color: #637381; }
.packing-total { display: grid; justify-items: end; gap: 8px; margin-top: 16px; padding: 16px; border-radius: 9px; background: #f8fafc; }
.packing-total > div { display: flex; align-items: center; gap: 16px; font-size: 16px; }
.packing-total p { max-width: 670px; margin: 0; text-align: right; font-size: 12px; }
.packing-total a { margin-top: 3px; }
@media (max-width: 1000px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-group .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packaging-coolants { grid-template-columns: 1fr; }
  .log-record > summary.log-rate-summary { grid-template-columns: 12px repeat(2, minmax(0, 1fr)); }
  .packing-order > summary.log-rate-summary { grid-template-columns: 12px repeat(2, minmax(0, 1fr)); }
  .log-summary-status { justify-items: start; }
  .packing-order-head { grid-template-columns: 1fr auto; }
  .packing-order-meta { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 650px) {
  main { padding: 20px 12px 50px; }
  .fields, .fields.wide, .detail-body .fields, .field-group .fields, .split { grid-template-columns: 1fr; }
  .packaging-group .fields, .volume-calculator-fields, .liters-converter-fields { grid-template-columns: 1fr; }
  .field-change-header { display: none; }
  .field-change-row { grid-template-columns: 1fr auto 20px auto; gap: 6px; }
  .field-change-name { grid-column: 1 / -1; }
  .card, .panel > .body { padding: 16px; }
  .panel > header { padding: 14px 16px; }
  .listbox { max-height: 180px; }
  .editor-top { align-items: start; }
  .section-links { flex-wrap: nowrap; overflow-x: auto; }
  .log-record > summary.log-rate-summary { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .packing-order > summary.log-rate-summary { grid-template-columns: 12px minmax(0, 1fr); }
  .log-record > summary.log-rate-summary .log-summary-field:nth-child(n+3) { grid-column: 2 / -1; }
  .month-grid { gap: 3px; }
  .month-day { min-height: 47px; padding: 6px; }
  .day-caption { display: none; }
  .month-weekday { padding: 4px; text-align: center; }
  .holiday-list { grid-template-columns: 1fr; }
  .packing-workspace .order-hero { align-items: start; flex-direction: column; }
  .packing-order-head { grid-template-columns: 1fr auto; }
  .packing-order { padding: 0; }
  .packing-total { justify-items: start; }
  .packing-total > div { flex-wrap: wrap; gap: 6px; }
  .packing-total p { text-align: left; }
}

/* Inventory uses the same tabs, panels, and expandable records as Logs. */
.revision:empty { display: none; }
.inventory-workspace .toolbar { margin-bottom: 0; }
.inventory-controls { align-items: end; gap: 10px; }
.inventory-controls input[type="search"] { flex: 1 1 260px; min-width: 0; max-width: 460px; margin-right: auto; }
.inventory-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; color: #69766d; font-size: 12px; }
.inventory-meta > span + span::before { content: "·"; margin-right: 22px; color: #a2afa6; }
.inventory-records > .log-record:first-child { margin-top: 0; }
.inventory-records > .log-record:last-child { margin-bottom: 0; }
.inventory-record > summary { list-style: none; }
.inventory-record > summary::-webkit-details-marker { display: none; }
.inventory-record > summary.inventory-stock-summary { display: grid; grid-template-columns: 12px minmax(180px, 1.8fr) minmax(70px, .6fr) minmax(130px, 1fr) minmax(130px, 1fr); gap: 18px; padding: 18px; }
.inventory-product { display: grid; gap: 4px; min-width: 0; }
.inventory-product > a, .inventory-product > strong { color: #243d30; font-size: 14px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; text-decoration: none; }
.inventory-product > a:hover { color: #146c43; text-decoration: underline; }
.inventory-product > small { color: #6d7870; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.inventory-quantity { font-size: 20px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.inventory-status { display: inline-flex; align-items: center; width: fit-content; min-height: 25px; padding: 3px 9px; background: #edf0ee; color: #526158; font-size: 11px; font-weight: 650; white-space: nowrap; }
.inventory-status.ok { background: #e5f3e9; color: #17633e; }
.inventory-status.bad { background: #fce9e7; color: #963e36; }
.inventory-status.warning { background: #fff3d8; color: #845c14; }
.inventory-record .detail-body { padding: 18px; background: #fbfcfb; border-radius: 0 0 8px 8px; }
.inventory-record-footer, .inventory-sync-bar, .inventory-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.inventory-record-footer .help { flex: 1 1 220px; }
.inventory-sync-bar { padding: 16px 20px; border: 1px solid #dfe5e0; border-radius: 10px; background: #f1f5f2; }
.inventory-sync-bar p { margin: 6px 0 0; }
.inventory-sync-bar > div { flex: 1 1 260px; }
.inventory-scroll { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid #e1e7e2; border-radius: 8px; }
.inventory-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inventory-table th { position: static; background: #f5f7f5; color: #66776b; font-size: 11px; font-weight: 650; white-space: nowrap; }
.inventory-table th, .inventory-table td { padding: 13px 14px; border-bottom: 1px solid #e4eae5; text-align: left; vertical-align: middle; }
.inventory-table tr:last-child td { border-bottom: 0; }
.inventory-table tbody tr:hover { background: #f9fbf9; }
.inventory-table td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inventory-table td:last-child { text-align: right; }
.inventory-table input[type="number"] { width: 7rem; }
.inventory-table input[type="checkbox"] { min-width: 0; width: auto; }
.inventory-table .inventory-number { font-size: 15px; }
.inventory-expiry { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inventory-comparison-table th:nth-child(n+2):nth-child(-n+4), .inventory-comparison-table td:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.inventory-comparison-table td:first-child { min-width: 190px; }
.inventory-comparison-table td:nth-child(6) { font-size: 12px; color: #69766d; min-width: 130px; }
.inventory-difference { display: inline-block; min-width: 30px; font-size: 14px; }
.inventory-difference.warning { color: #875f1e; }
.inventory-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.inventory-row-actions button { font-size: 12px; min-height: 32px; padding: 5px 9px; }
.inventory-callout { margin: 0; padding: 12px 14px; border: 1px solid #d3e5d8; border-radius: 8px; background: #edf6ef; color: #285e3c; font-size: 13px; }
.inventory-callout.warning { border-color: #ecd8a9; background: #fff8e8; color: #785519; }
.inventory-callout p { margin-bottom: 0; }
.inventory-empty { display: grid; justify-items: center; gap: 7px; padding: 38px 22px; text-align: center; border: 1px dashed #d6e1d8; border-radius: 9px; background: #fafcfb; }
.inventory-empty strong { color: #334b3d; font-size: 15px; }
.inventory-empty p { max-width: 440px; margin: 0; color: #69766d; font-size: 13px; }
.inventory-form { max-width: 900px; }
.inventory-form > p { margin: 0; }
.inventory-form > button { justify-self: start; }
.inventory-form > .toolbar { align-items: end; }
.inventory-form > .toolbar > label { flex: 1 1 170px; }
.inventory-help { margin: 0; }
.inventory-help pre { max-width: 100%; overflow-x: auto; margin: 0; color: #43594a; }
.inventory-correction { padding: 16px; border: 1px solid #d5e3d9; border-radius: 9px; background: #f0f6f2; }
.inventory-correction .fields { grid-template-columns: minmax(120px, 1fr) minmax(200px, 2fr); }
.inventory-correction p { margin: 0; }
.inventory-preview { scroll-margin-top: 20px; }
.inventory-preview .toolbar { align-items: end; }
.inventory-record > summary.inventory-activity-summary { display: grid; grid-template-columns: 12px minmax(135px, 1fr) minmax(175px, 1.6fr) minmax(150px, 1.1fr) minmax(100px, .8fr); gap: 18px; padding: 16px 18px; }
.inventory-activity-summary > .log-summary-field > strong { font-size: 12px; }
.inventory-change { color: #43554a; font-size: 19px; font-variant-numeric: tabular-nums; }
.inventory-change.positive { color: #176b42; }
.inventory-movement-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; }
.inventory-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; }
.inventory-facts dt { color: #6d7870; font-size: 11px; }
.inventory-facts dd { margin: 4px 0 0; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .inventory-record > summary.inventory-stock-summary { grid-template-columns: 12px minmax(150px, 1.6fr) 70px minmax(120px, 1fr); gap: 12px; }
  .inventory-stock-summary > .log-summary-status { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; }
  .inventory-record > summary.inventory-activity-summary { grid-template-columns: 12px minmax(120px, 1fr) minmax(170px, 1.5fr) 100px; gap: 12px; }
  .inventory-activity-summary > .inventory-movement-reason { grid-column: 3; grid-row: 2; }
  .inventory-activity-summary > .log-summary-status { grid-column: 4; grid-row: 1 / 3; }
  .inventory-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .inventory-controls > input[type="search"] { flex-basis: 100%; max-width: none; }
  .inventory-controls > button { flex: 1 1 auto; }
  .inventory-meta { gap: 4px 14px; }
  .inventory-meta > span + span::before { display: none; }
  .inventory-record > summary.inventory-stock-summary { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 14px 12px; }
  .inventory-stock-summary > .log-summary-field:nth-child(4) { grid-column: 2; }
  .inventory-stock-summary > .log-summary-status { grid-column: 2 / -1; flex-wrap: wrap; }
  .inventory-record > summary.inventory-activity-summary { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 14px 12px; }
  .inventory-activity-summary > .inventory-product { grid-column: 2; grid-row: 1; }
  .inventory-activity-summary > .log-summary-field:nth-child(2) { grid-column: 2; grid-row: 2; }
  .inventory-activity-summary > .inventory-movement-reason { grid-column: 2; grid-row: 3; }
  .inventory-activity-summary > .log-summary-status { grid-column: 3; grid-row: 1 / 4; }
  .inventory-activity-summary .log-summary-status small { max-width: 74px; text-align: right; }
  .inventory-record .detail-body { padding: 12px; }
  .inventory-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .inventory-table tbody, .inventory-table tr { display: block; }
  .inventory-table tr { padding: 12px; border-bottom: 1px solid #e1e7e2; }
  .inventory-table tr:last-child { border-bottom: 0; }
  .inventory-table th, .inventory-table td { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 7px 0; border: 0; text-align: right; min-width: 0; }
  .inventory-table td::before { content: attr(data-label); color: #6d7870; font-size: 12px; text-align: left; }
  .inventory-table td > .inventory-product { text-align: left; margin-right: auto; }
  .inventory-table td:has(> .inventory-product)::before { display: none; }
  .inventory-table td > input { min-width: 0; width: 60%; }
  .inventory-table td > input[type="checkbox"] { width: auto; }
  .inventory-comparison-table td:nth-child(6) { min-width: 0; }
  .inventory-correction .fields { grid-template-columns: 1fr; }
  .inventory-movement-detail { grid-template-columns: 1fr; }
  .inventory-sync-bar { padding: 14px 16px; }
}
