:root {
  color-scheme: light;
  --bg: #f5f5fa;
  --surface: #fff;
  --border: #e7e5ee;
  --ink: #201a32;
  --muted: #625c74;
  --soft: #746d86;
  --primary: #6639df;
  --primary-dark: #5228c5;
  --tint: #f1ebff;
  --radius: 16px;
  --shadow: 0 3px 12px #29144f07, 0 1px 2px #29144f07;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, input, select, textarea { color: inherit; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, dl, dd { margin: 0; }
i { font-style: normal; }
svg { width: 20px; height: 20px; display: block; flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner {
  min-height: 67px;
  max-width: 1320px;
  padding: 0 30px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}
.brand { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 1.14rem; font-weight: 760; letter-spacing: -.04em; }
.brand small { margin-left: 4px; color: var(--soft); font-size: .77rem; font-weight: 590; letter-spacing: .015em; }
.top-inner nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.top-inner nav a { white-space: nowrap; display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 8px; color: var(--muted); font-size: .875rem; font-weight: 620; }
.top-inner nav a:hover { background: #f8f6fc; }
.top-inner nav a[aria-current] { color: var(--primary-dark); background: var(--tint); }
.top-inner nav svg, .rules-trigger svg { width: 16px; height: 16px; }
.shell { padding: 24px 30px 0; max-width: 1320px; margin: auto; }
.hero {
  min-height: 208px;
  border-radius: 19px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: #1f1535;
  color: white;
  border: 1px solid #2d1e48;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 36%;
  z-index: -2;
  background: url("./assets/warehouse.webp") 50% 49% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #211536 0%, #211536 29%, #211536f9 37%, #2115368a 61%, #1c142623 83%), linear-gradient(0deg, #20142e82, transparent 46%);
}
.hero-content { padding: 30px 36px 34px; }
.hero-context { display: flex; align-items: center; gap: 7px; width: fit-content; color: #f1e8ff; font-size: .84rem; font-weight: 590; padding: 6px 10px; border: 1px solid #ffffff35; background: #ffffff14; border-radius: 6px; }
.hero-context svg { width: 15px; height: 15px; color: #d4bbff; }
.hero h1 { margin-top: 13px; font-size: clamp(2rem, 4.5vw, 2.85rem); font-weight: 780; line-height: 1.18; letter-spacing: -.055em; }
.hero p { color: #e0d6ed; line-height: 1.6; margin-top: 11px; }

.workbench { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 22px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.form-panel, .estimate { padding: 24px; }
.panel-heading { display: flex; align-items: center; gap: 12px; }
.heading-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; flex: none; }
.heading-icon svg { width: 22px; height: 22px; }
.lilac { color: var(--primary-dark); background: var(--tint); }
.panel-heading h2, .list-toolbar h2 { font-size: 1.14rem; font-weight: 730; letter-spacing: -.035em; line-height: 1.35; }
.panel-heading p { margin-top: 3px; color: var(--soft); font-size: .86rem; line-height: 1.45; }

.presets { margin: 20px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.preset { display: flex; position: relative; align-items: center; min-height: 67px; text-align: left; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); background: #fff; border-radius: 9px; white-space: nowrap; transition: border-color .15s, background .15s; }
.preset:hover { border-color: #ac90f0; background: #fcfaff; }
.preset[aria-pressed=true] { border-color: #9673ed; background: #f6f1ff; box-shadow: 0 0 0 1px #9673ed25 inset; }
.preset b { display: block; font-size: .885rem; font-weight: 700; }
.preset small { display: block; margin-top: 4px; font-size: .75rem; color: var(--muted); }
.preset-icon { color: #5f5477; background: #f4f2f8; border-radius: 8px; display: grid; place-items: center; width: 33px; height: 33px; flex: none; }
.preset-icon svg { width: 19px; height: 19px; }
.preset[aria-pressed=true] .preset-icon { background: #eadeff; color: var(--primary-dark); }
.preset-check { display: none; position: absolute; right: 6px; top: 6px; color: #fff; background: var(--primary); border-radius: 50%; padding: 2px; }
.preset-check svg { width: 9px; height: 9px; stroke-width: 2.8; }
.preset[aria-pressed=true] .preset-check { display: block; }

.form-grid { display: grid; gap: 13px; }
.product-fields { grid-template-columns: 1.65fr 1fr; margin-bottom: 19px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #3b334d; font-size: .875rem; font-weight: 630; }
.field input, .field select, .field textarea, .search-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #e4e1ec;
  border-radius: 8px;
  min-height: 42px;
  background: #fbfafc;
  padding: 9px 11px;
  font-weight: 490;
  font-size: .95rem;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #a587ed69; outline-offset: 0; border-color: #a587ed; background: #fff; }
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder { color: #746b87; }
.field select { appearance: none; padding-right: 28px; background: #fbfafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23625c74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; }
.field select:focus { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23625c74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; }
.field textarea { line-height: 1.5; resize: vertical; }
.field :disabled { opacity: .5; cursor: default; }
input[type=number] { appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-unit { position: relative; display: block; min-width: 0; }
.input-unit input { padding-right: 34px; }
.input-unit > span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--soft); pointer-events: none; font-size: .75rem; font-weight: 520; white-space: nowrap; }
.product-fields .input-unit input { padding-right: 59px; }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.section-label h3, .cost-heading h3 { font-size: .96rem; font-weight: 730; letter-spacing: -.015em; }
.text-button { border: 0; background: transparent; color: var(--primary-dark); font-weight: 670; font-size: .875rem; padding: 4px 2px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.text-button svg { width: 15px; height: 15px; }
.text-button:hover:not(:disabled) { color: #411ba8; text-decoration: underline; text-underline-offset: 3px; }
.muted-button { font-size: .81rem; }
.package-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; }
#packages[data-count]:not([data-count="1"]) .package-row { grid-template-columns: repeat(5, minmax(0, 1fr)) 22px; }
.package-row + .package-row { margin-top: 11px; padding-top: 10px; border-top: 1px solid #f0edf5; }
.remove-package { display: grid; place-items: center; color: var(--soft); border: 0; background: #f6f3fb; border-radius: 5px; width: 22px; height: 32px; margin-bottom: 5px; padding: 0; }
.remove-package svg { width: 15px; height: 15px; }
.remove-package:hover { color: #8a154e; background: #fbe8f2; }
.sample-note, .field-help { color: var(--soft); font-size: .79rem; line-height: 1.55; margin-top: 10px; }
.sample-note { display: flex; gap: 6px; align-items: start; }
.sample-note svg { width: 15px; height: 15px; margin-top: 2px; }
.form-divider { height: 1px; background: var(--border); margin: 17px 0 16px; }
.storage-fields { grid-template-columns: minmax(0, 1.65fr) repeat(2, minmax(0, .77fr)); gap: 10px; }
.storage-help { margin-top: 7px; }
.advanced { margin-top: 15px; background: #faf9fc; border: 1px solid var(--border); border-radius: 8px; }
.advanced > summary { display: flex; align-items: center; gap: 7px; min-height: 42px; color: #504660; font-size: .86rem; font-weight: 660; padding: 9px 11px; }
.advanced summary svg { width: 16px; height: 16px; }
.advanced summary .chevron { margin-left: auto; }
.advanced-fields { padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.check-fields { display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.check-fields label { font-size: .8rem; display: flex; gap: 6px; align-items: center; }
.check-fields input { accent-color: var(--primary); margin: 0; }
.sub-field { font-size: .72rem; font-weight: 480; color: var(--soft); }
.form-actions { display: grid; grid-template-columns: 1fr 1.63fr; gap: 10px; margin-top: 16px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border-radius: 8px; border: 1px solid transparent; padding: 9px 13px; font-size: .875rem; font-weight: 680; white-space: nowrap; transition: background .15s, border-color .15s; }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--primary); color: white; box-shadow: 0 1px 2px #32128320; }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); }
.button-outline { background: white; border-color: #e1dbea; color: #453956; }
.button-outline:hover:not(:disabled) { border-color: #b59be9; background: #fcfaff; }
.button-quiet { color: #504660; background: #fff; border-color: #e8e4ef; min-height: 37px; }
.button-quiet:hover { background: #f8f4ff; }

.currency { margin-left: auto; color: #635579; font-size: .75rem; letter-spacing: .065em; border: 1px solid #e8e1f3; padding: 4px 8px; background: #faf7ff; border-radius: 6px; font-weight: 730; }
.estimate-heading { margin-bottom: 17px; }
.total-box { border-radius: 12px; padding: 15px 17px; color: #2b1853; background: linear-gradient(120deg,#f0e9ff 0%,#f6f1ff 64%,#f1ebfd 100%); border: 1px solid #eee4ff; }
.total-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #5b417f; font-size: .875rem; font-weight: 650; }
.big-money { margin-top: 5px; display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; font-size: clamp(1.65rem, 3.1vw, 2.72rem); line-height: 1.17; font-weight: 770; letter-spacing: -.065em; overflow-wrap: anywhere; }
.big-money > span { font-size: .65em; font-weight: 650; }
.tax-mix { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; color: #57466f; font-size: .77rem; font-weight: 540; }
.tax-mix > span { display: block; width: 3px; height: 3px; background: #9d87b9; border-radius: 50%; }
.partial-badge { color: #6e480a; background: #fff0cb; border-radius: 5px; padding: 3px 6px; font-size: .75rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 17px 0 19px; }
.metrics > div { padding: 0 9px 0 12px; border-right: 1px solid var(--border); min-width: 0; }
.metrics > div:first-child { padding-left: 0; }
.metrics > div:last-child { border: 0; padding-right: 0; }
.metrics dt { font-size: .77rem; color: var(--soft); line-height: 1.45; }
.metrics dd { margin-top: 4px; font-weight: 740; font-size: 1.04rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics dd small { font-size: .73rem; font-weight: 540; color: var(--muted); }
.cost-heading { display: flex; gap: 13px; justify-content: space-between; align-items: center; }
.cost-heading > span { font-size: .76rem; color: var(--soft); }
.composition { margin-top: 11px; height: 6px; border-radius: 6px; overflow: hidden; display: flex; gap: 3px; }
.composition .in-color { background: #7751e6; }
.composition .store-color { background: #aa81ed; }
.composition .out-color { background: #61c5b9; }
.composition .extra-color { background: #e7af56; }
.cost-list { margin-top: 5px; }
.cost-item + .cost-item { border-top: 1px solid #efedf4; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.cost-item > summary { min-height: 50px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; color: #3b334b; }
.cost-item > summary:hover .cost-name { color: var(--primary-dark); }
.cost-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; }
.cost-icon svg { width: 17px; height: 17px; }
.cost-icon.in-color { color: #5b38c4; background: #ede7ff; }
.cost-icon.store-color { color: #7341a7; background: #f3eaff; }
.cost-icon.out-color { color: #18786e; background: #e2f6f1; }
.cost-icon.extra-color { color: #8b5a14; background: #fff3df; }
.cost-name { font-weight: 650; font-size: .875rem; }
.cost-item strong { color: var(--ink); font-weight: 710; font-size: .9rem; font-variant-numeric: tabular-nums; }
.chevron { color: #7c718a; }
.chevron svg { width: 14px; height: 14px; transition: transform .15s; }
details[open] > summary .chevron svg { transform: rotate(180deg); }
.cost-detail { padding: 0 0 8px 39px; }
.charge { display: flex; justify-content: space-between; align-items: start; gap: 7px; padding: 6px 0; font-size: .82rem; }
.charge small { display: block; margin-top: 4px; color: var(--soft); font-size: .75rem; }
.charge > span { color: #47365e; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-detail > p { color: var(--soft); font-size: .81rem; padding: 5px 0; }
.missing-text { display: block; color: #795318; font-size: .7rem; font-weight: 570; margin-top: 2px; }
.pending-note { font-size: .81rem; color: #795318; background: #fff6e1; padding: 8px; border-radius: 6px; margin-top: 6px; }
.estimate-actions { display: grid; grid-template-columns: minmax(0, 1fr) 43px; gap: 8px; margin-top: 10px; }
.icon-button { padding: 0; }
.estimate-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 2px 0; color: #655b76; font-size: .79rem; line-height: 1.6; }
.estimate-note svg { height: 15px; width: 15px; margin-top: 2px; }
.estimate-empty { text-align: center; padding: 40px 12px; background: #faf8ff; border: 1px dashed #e6dbf6; border-radius: 9px; }
.estimate-empty b { display: block; margin-top: 10px; }
.estimate-empty p { font-size: .875rem; color: var(--soft); margin-top: 5px; line-height: 1.55; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; border-top: 1px solid #e6e2ee; color: var(--soft); margin-top: 26px; font-size: .77rem; }
footer span:first-child { color: #5e4f71; font-weight: 690; }
.view-heading { padding: 15px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-heading h1 { font-size: 2.12rem; line-height: 1.2; letter-spacing: -.05em; }
.view-heading p { margin-top: 9px; color: var(--muted); line-height: 1.55; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 17px 22px; gap: 12px; }
.list-toolbar h2 small { color: var(--primary-dark); background: var(--tint); padding: 2px 6px; border-radius: 4px; font-size: .75rem; }
.search-field { display: flex; align-items: center; gap: 5px; color: #74678a; width: min(310px, 54%); position: relative; }
.search-field svg { position: absolute; left: 10px; width: 17px; height: 17px; pointer-events: none; }
.search-field input { padding-left: 34px; }
.table-scroll, .rate-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .875rem; line-height: 1.5; vertical-align: top; }
th { background: #faf8fd; color: #635775; font-weight: 670; }
.list-table td:first-child, .list-table th:first-child { padding-left: 22px; }
.list-table td:last-child, .list-table th:last-child { padding-right: 22px; }
.list-table th { white-space: nowrap; }
.list-table td small { display: block; margin-top: 4px; font-size: .77rem; color: var(--soft); }
.list-table td { overflow-wrap: anywhere; }
.list-table tr:last-child td { border-bottom: 0; }
.empty-list { min-height: 280px; border-top: 1px solid var(--border); display: grid; justify-items: center; align-content: center; text-align: center; gap: 9px; padding: 23px; }
.empty-list p { color: var(--soft); font-size: .9rem; }
.empty-list .button { margin-top: 6px; }
.local-notice { margin: 12px 2px; display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: .82rem; }
.local-notice svg { width: 15px; height: 15px; }

.dialog { width: min(560px, calc(100% - 28px)); max-height: min(88dvh, 900px); padding: 0; border: 1px solid #e3d9f1; border-radius: 17px; box-shadow: 0 18px 110px #1c0b4145; color: var(--ink); overflow: auto; }
.dialog::backdrop { background: #170f30a0; backdrop-filter: blur(3px); }
.rules-dialog { width: min(780px, calc(100% - 28px)); }
.dialog-header { position: sticky; top: 0; z-index: 1; background: #fff; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { font-size: 1.3rem; letter-spacing: -.025em; }
.dialog-header p, .record-meta { color: var(--soft); font-size: .875rem; margin-top: 5px; line-height: 1.5; }
.close-button { padding: 5px; background: #f6f3fb; border: 1px solid #eee8f6; border-radius: 6px; color: #61526f; }
.close-button:hover { background: #efe6ff; }
.dialog-body { padding: 18px 22px 22px; }
.rules-dialog h3 { font-size: 1rem; margin-bottom: 8px; }
.rules-dialog p { margin: 10px 0 16px; color: #594f6b; font-size: .875rem; line-height: 1.65; }
.rules-dialog .dialog-header p { margin: 5px 0 0; }
.rules-dialog .rule-evidence { background: #f6f1ff; padding: 12px; border-radius: 8px; margin: 12px 0 21px; font-size: .9rem; }
.rules-dialog .rule-evidence p { margin: 6px 0 0; }
#editor-form, .editor-fields { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.quote-preview { padding: 12px; border-radius: 8px; background: var(--tint); }
.quote-preview span { display: block; color: #5e4680; font-size: .85rem; margin-top: 3px; }
.record-product { font-size: 1.1rem; }
.record-meta { margin-bottom: 12px; }
.record-note { padding: 9px; border-radius: 6px; background: #f7f4fc; margin-bottom: 13px; color: var(--muted); font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 5; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 11px 16px; background: #2a2041; color: white; box-shadow: 0 5px 28px #27174742; border-radius: 8px; font-size: .9rem; text-align: center; max-width: calc(100vw - 20px); }
#print-view { display: none; }

@media (max-width: 1050px) {
  .shell, .top-inner { padding-left: 22px; padding-right: 22px; }
  .workbench { gap: 16px; }
  .form-panel, .estimate { padding: 18px; }
  .preset { padding-left: 7px; gap: 6px; }
  .preset-icon { width: 28px; height: 28px; }
  .preset-icon svg { width: 17px; height: 17px; }
  .preset small { font-size: .72rem; }
}
@media (max-width: 820px) {
  .top-inner { gap: 12px; }
  .top-inner nav a { padding-inline: 10px; }
  .workbench { grid-template-columns: 1fr; gap: 15px; margin-top: 16px; }
  .hero { min-height: 180px; }
  .hero-content { padding: 22px; }
  .form-panel, .estimate { padding: 21px; }
  .big-money { font-size: 2.55rem; }
}
@media (max-width: 860px) {
  .top-inner { display: grid; grid-template-columns: 1fr auto; min-height: auto; gap: 8px; padding-top: 9px; padding-bottom: 8px; }
  .top-inner nav { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; gap: 4px; }
  .top-inner nav a { flex: 1; justify-content: center; gap: 5px; padding: 8px 4px; font-size: .81rem; }
}
@media (max-width: 580px) {
  .top-inner, .shell { padding-left: 13px; padding-right: 13px; }
  .top-inner nav svg { width: 14px; height: 14px; }
  .brand img { width: 33px; height: 33px; }
  .brand { gap: 7px; }
  .shell { padding-top: 13px; }
  .hero { border-radius: 13px; min-height: 165px; }
  .hero-content { padding: 17px 15px; }
  .hero-context { font-size: .77rem; padding: 4px 7px; }
  .hero::before { left: 6%; }
  .hero::after { background: linear-gradient(90deg,#211536 0%,#211536ed 32%,#21153685 100%); }
  .hero h1 { font-size: 1.85rem; }
  .hero p { color: #eee4fa; font-size: .89rem; max-width: 95%; }
  .form-panel, .estimate { padding: 14px; border-radius: 12px; }
  .presets { gap: 6px; grid-template-columns: 1fr 1fr 1fr; margin: 15px 0; }
  .preset { min-height: 74px; align-items: flex-start; flex-direction: column; gap: 3px; padding: 6px; }
  .preset-icon { width: 23px; height: 22px; border-radius: 5px; }
  .preset small { margin-top: 2px; font-size: .69rem; }
  .preset b { font-size: .81rem; }
  .product-fields { gap: 8px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .field input, .field select, .field textarea, .search-field input { font-size: 1rem; }
  .package-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #packages[data-count]:not([data-count="1"]) .package-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .remove-package { justify-self: end; }
  .storage-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .storage-plan { grid-column: 1 / -1; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .view-heading h1 { font-size: 1.85rem; }
  .list-toolbar { padding: 12px; }
  th, td { padding: 8px; }
  .list-table th:first-child, .list-table td:first-child { padding-left: 12px; }
  .list-table th:last-child, .list-table td:last-child { padding-right: 12px; }
  .dialog-header, .dialog-body { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  .topbar, .shell, dialog, .toast { display: none !important; }
  dialog::backdrop { display: none; }
  #print-view { display: block; color: #000; padding: 10mm 3mm; font-size: 10pt; }
  body { background: #fff; }
  #print-view h1 { font-size: 20pt; margin-bottom: 5mm; }
  #print-view h2 { margin: 4mm 0 2mm; font-size: 14pt; }
  #print-view p { margin: 3mm 0; }
  #print-view tr { break-inside: avoid; }
}

.batch-hero { min-height: 185px; }
.workspace-hero { min-height:156px; border-radius:17px; }
.workspace-hero .hero-content { padding:22px 30px 25px; }
.workspace-hero .hero-context { background:none; border:0; padding:0; font-size:.9rem; }
.workspace-hero h1 { font-size:clamp(1.85rem,3.5vw,2.65rem); }
.batch-workspace-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; }
.batch-view-tabs { display:inline-flex; gap:3px; padding:4px; border:1px solid var(--border); border-radius:11px; background:#eeecf4; }
.batch-view-tabs button { display:flex; gap:7px; align-items:center; border:0; border-radius:7px; background:transparent; padding:8px 12px; font-size:.91rem; font-weight:670; color:var(--muted); white-space:nowrap; }
.batch-view-tabs button[aria-pressed=true] { color:var(--primary-dark); background:#fff; box-shadow:0 1px 3px #28165524; }
.batch-view-tabs svg { width:17px; height:17px; }
.workspace-intake { min-width:0; border-radius:11px; }
.workspace-intake.drop-active { outline:2px dashed var(--primary); outline-offset:4px; background:var(--tint); }
.workspace-intake .intake-status { max-width:38ch; margin-top:4px; }
.batch-overview { display:grid; gap:16px; margin-top:16px; }
.overview-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; min-width:0; }
.overview-heading h2,.overview-chart-toolbar h2 { font-size:1.21rem; letter-spacing:-.02em; }
.overview-heading p { color:var(--muted); font-size:.86rem; margin-top:4px; line-height:1.5; }
.overview-metrics { display:grid; gap:12px; grid-template-columns:1.23fr 1fr 1fr 1fr; }
.overview-metrics > div { min-width:0; padding:15px 17px; background:var(--surface); border:1px solid var(--border); border-radius:13px; box-shadow:var(--shadow); }
.overview-metrics dt { font-size:.88rem; color:var(--muted); font-weight:620; }
.overview-metrics dd { margin:5px 0 4px; font-size:clamp(1.3rem,2.35vw,2rem); font-weight:760; letter-spacing:-.045em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.overview-metrics small { font-size:.82rem; color:var(--muted); font-weight:550; letter-spacing:0; }
.overview-metrics > div > small { display:block; line-height:1.4; }
.overview-metrics .metric-total { color:#fff; background:linear-gradient(133deg,#34215b,#59339e); border-color:#4a2d80; }
.metric-total :is(dt,small) { color:#efe6fc; }
.overview-chart-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:3px; }
.chart-scope { display:inline-flex; align-items:center; gap:3px; padding:3px; background:#edebf4; border:1px solid var(--border); border-radius:9px; }
.chart-scope button { border:0; border-radius:6px; padding:7px 12px; background:transparent; color:var(--muted); font-weight:650; font-size:.87rem; white-space:nowrap; }
.chart-scope button[aria-pressed=true] { color:var(--primary-dark); background:var(--surface); box-shadow:0 1px 3px #2e175423; }
.overview-charts { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:14px; }
.chart-panel,.overview-fees { padding:18px 20px; }
.chart-heading { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:4px 8px; margin-bottom:14px; }
.chart-heading h3 { font-size:1.03rem; line-height:1.4; }
.chart-heading > span,.chart-annotation,.chart-axis,.chart-rows small { color:var(--muted); font-size:.82rem; }
.composition-body { display:grid; grid-template-columns:minmax(124px,.9fr) minmax(0,1.58fr); gap:14px; align-items:center; }
.cost-ring { max-width:182px; width:100%; aspect-ratio:1; justify-self:center; border-radius:50%; background:var(--ring); padding:14px; display:grid; align-items:stretch; }
.cost-ring > div { display:grid; place-content:center; gap:2px; border-radius:50%; background:#fff; text-align:center; }
.cost-ring span { color:var(--muted); font-size:.79rem; }
.cost-ring strong { font-variant-numeric:tabular-nums; font-size:clamp(.94rem,1.6vw,1.2rem); letter-spacing:-.035em; overflow-wrap:anywhere; }
.chart-legend,.tax-chart-lines { list-style:none; margin:0; padding:0; }
.chart-legend li+li { border-top:1px solid #efedf5; }
.chart-legend-item { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr) auto 3em; align-items:center; gap:7px; padding:8px 3px; border:0; background:none; text-align:left; font-size:.86rem; }
.chart-legend-item:hover { background:#f7f4fc; }
.chart-legend-item i,.tax-chart-lines i { width:9px; height:9px; flex:none; border-radius:3px; background:var(--series); }
.chart-legend-item b,.chart-legend-item small,.chart-label-line strong,.tax-chart-lines strong { text-align:right; font-variant-numeric:tabular-nums; }
.chart-legend-item small { font-size:.76rem; color:var(--muted); }
.chart-legend-item sup { color:#805620; }
.chart-annotation { margin-top:10px; line-height:1.45; }
.chart-axis { display:flex; justify-content:space-between; margin:1px 0 6px; font-variant-numeric:tabular-nums; }
.chart-rows { display:grid; gap:10px; max-height:288px; overflow:auto; }
.compare-mark,.capacity-row { display:grid; gap:6px; border-radius:8px; padding:8px; }
.compare-mark[data-current="true"],.capacity-row[data-current="true"] { background:#f7f4fd; }
.chart-label-line { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.chart-batch-link { border:0; background:none; padding:0; text-align:left; color:var(--muted); font-weight:680; font-size:.88rem; overflow-wrap:anywhere; }
.chart-batch-link:hover,.chart-batch-link[aria-current] { color:var(--primary-dark); }
.chart-label-line strong,.tax-chart-lines strong { font-size:.9rem; }
.compare-track,.tax-track,.chart-track { display:flex; width:100%; height:11px; overflow:hidden; border-radius:5px; background:#efedf5; }
.compare-track { background:linear-gradient(90deg,#efedf5 49.8%,#ded9eb 50%,#efedf5 50.2%); }
.compare-track span,.tax-track span,.chart-track span { flex:0 0 var(--fill); background:var(--series,#9d82dc); }
.compare-track span:hover,.tax-track span:hover { filter:brightness(1.15); }
.chart-track { height:6px; }
.chart-track span { border-radius:5px; }
.capacity-row { padding-top:6px; padding-bottom:6px; }
.tax-chart-lines { display:grid; gap:8px; margin-top:12px; }
.tax-chart-lines li { display:grid; align-items:center; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; font-size:.9rem; }
.tax-chart-lines small { color:var(--muted); font-variant-numeric:tabular-nums; }
.chart-empty { margin-top:8px; font-size:.88rem; color:var(--muted); }
.chart-difference { display:flex; align-items:baseline; justify-content:space-between; gap:8px; border-top:1px solid var(--border); margin-top:12px; padding:10px 8px 0; font-size:.87rem; color:var(--muted); }
.chart-difference strong { color:var(--ink); font-variant-numeric:tabular-nums; }
.overview-fees .table-scroll { margin-top:13px; border:1px solid var(--border); border-radius:9px; }
.overview-fee-actions,.batch-export-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.overview-fees table { min-width:425px; }
.overview-fees thead th:first-child { width:46%; }
.overview-fees :is(td,th):not(:first-child) { text-align:right; white-space:nowrap; }
.overview-fees tbody th { text-align:left; font-weight:600; }
.overview-fees td { font-variant-numeric:tabular-nums; }
.overview-fees tbody tr:nth-child(odd):not(.overview-section,.overview-options) { background:#fbfafd; }
.overview-fees td small { color:var(--muted); margin-left:6px; }
.overview-fees .overview-section :is(th,td) { color:#3b275c; background:#eee9f7; scroll-margin-top:18px; }
.overview-fees .overview-section th:focus-visible { outline-offset:-2px; }
.overview-fees .overview-total :is(th,td) { color:#fff; background:#423262; }
.overview-fees .overview-section small { font-size:.75rem; color:var(--muted); margin-left:6px; }
.overview-fees .overview-options td { color:var(--muted); background:#faf9fc; font-weight:600; }
.overview-code { color:#544266; background:#f1edf6; font-size:.75rem; font-variant-numeric:tabular-nums; padding:2px 5px; border-radius:4px; margin-right:7px; }
.overview-wait { color:#805620; }
.overview-fees > .overview-wait,.overview-fee-note { margin-top:6px; font-size:.85rem; line-height:1.5; }
.overview-fee-note { color:var(--muted); }
.batch-detail-links { display:flex; align-items:center; gap:4px 8px; position:sticky; top:5px; z-index:2; overflow-x:auto; border:1px solid var(--border); border-radius:9px; padding:5px; margin-top:14px; background:#fff; box-shadow:var(--shadow); }
.batch-detail-links button { border:0; padding:7px 9px; background:transparent; color:var(--primary-dark); white-space:nowrap; font-weight:650; font-size:.84rem; border-radius:6px; }
.batch-detail-links button:hover { background:var(--tint); }
.batch-detail-links [data-batch-view] { margin-left:auto; background:var(--tint); }
.batch-section[id],#batch-section-gtd { scroll-margin-top:60px; }
.gtd-paste { margin-top:13px; border:1px solid var(--border); padding:10px; border-radius:8px; background:#fff; }
.gtd-paste label { margin:8px 0; }
.gtd-paste textarea { max-width:43rem; }
.gtd-paste p { margin-top:7px; }
@media(max-width:900px) {
  .overview-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-charts { grid-template-columns:1fr 1fr; }
  .composition-body { grid-template-columns:1fr; }
  .cost-ring { max-width:147px; }
  .chart-panel,.overview-fees { padding:14px; }
}
@media(max-width:620px) {
  .workspace-hero .hero-content { padding:17px 15px; }
  .overview-metrics { gap:8px; }
  .overview-metrics > div,.overview-fees { padding:11px 10px; }
  .overview-charts { grid-template-columns:minmax(0,1fr); gap:10px; }
  .composition-body { grid-template-columns:minmax(94px,.65fr) minmax(0,1.35fr); gap:8px; }
  .cost-ring { padding:9px; max-width:133px; }
  .cost-ring strong { font-size:.81rem; }
  .cost-ring span { font-size:.73rem; }
  .chart-legend-item { grid-template-columns:auto minmax(0,1fr) auto; gap:5px; font-size:.79rem; }
  .chart-legend-item small { grid-column:2/-1; text-align:left; }
  .overview-fees table { min-width:0; }
  .overview-fees :is(td,th) { padding:8px 5px; font-size:.81rem; }
  .overview-fees td small { display:block; margin:2px 0 0; }
  .overview-fees thead th:first-child { width:40%; }
  .overview-code { display:inline-block; margin-right:4px; }
  .overview-heading { flex-wrap:wrap; }
  .workspace-intake .intake-actions { justify-content:flex-start; }
}
@media(max-width:360px) {
  .top-inner nav svg { display:none; }
}
.batch-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.batch-choice { display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 13px 15px; min-width: 0; }
.batch-choice b { display: block; font-size: 1rem; }
.batch-choice small { display: block; color: var(--soft); font-size: .79rem; overflow-wrap: anywhere; margin-top: 3px; }
.batch-choice[aria-pressed=true] { background: #f5efff; border-color: #a98beb; }
.batch-choice:hover { border-color: #a98beb; }
.batch-check { margin-left: auto; color: var(--primary); }
.batch-section { padding: 20px 23px; margin-top: 15px; }
.batch-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.batch-section-title h2 { font-size: 1.12rem; }
.batch-section-title .heading-icon { width: 36px; height: 36px; border-radius: 9px; }
.batch-section-title svg { width: 19px; height: 19px; }
.batch-source { color: var(--soft); font-size: .85rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.batch-products, .batch-fees, .batch-comparison { border: 1px solid var(--border); }
.batch-products { min-width: 770px; }
.batch-products th, .batch-products td { padding: 8px 10px; vertical-align: middle; }
.batch-products td:first-child { min-width: 180px; }
.batch-products td:last-child { min-width: 86px; font-variant-numeric: tabular-nums; }
.batch-products td small { font-size: .75rem; display: block; color: var(--soft); margin-top: 2px; }
.batch-products .weight-cell small { color: #80591d; }
.batch-products input { border: 1px solid #e6e0ee; border-radius: 5px; background: #fbfaff; font-size: .875rem; width: min(100%, 82px); color: var(--ink); padding: 6px 8px; min-height: 34px; }
.batch-products input:focus { border-color: #a688eb; background: white; outline: 1px solid #a688eb; outline-offset: 0; }
.batch-products input:invalid, .batch-settings input:invalid { border-color: #a21d4d; background: #fff3f6; }
.dim-inputs { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.dim-inputs input { flex: 0 0 58px; width: 58px; }
.dim-inputs span { color: var(--soft); }
.source-volume { color: var(--muted); white-space: nowrap; }
.batch-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 22px; padding: 12px; color: var(--muted); background: #f8f4ff; font-size: .85rem; border: 1px solid #eee7f6; border-top: 0; }
.batch-counts b { color: var(--primary-dark); font-size: 1rem; }
.batch-note { font-size: .83rem; line-height: 1.65; color: var(--muted); margin-top: 9px; }
.batch-checkbox { display: flex; gap: 7px; color: #413657; font-weight: 650; align-items: center; margin-top: 12px; font-size: .875rem; }
.batch-checkbox input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
.batch-pallet { display: grid; grid-template-columns: minmax(108px, 145px) 1fr; gap: 14px; align-items: center; background: #f6f0ff; color: #34205a; border: 1px solid #ebe1fb; border-radius: 9px; padding: 12px 14px; }
.batch-pallet > div { border-right: 1px solid #e5d7f5; }
.batch-pallet span { display: block; font-size: .85rem; font-weight: 650; }
.batch-pallet strong { display: inline-block; font-size: 2.4rem; line-height: 1.1; letter-spacing: -.06em; }
.batch-pallet p { font-size: .9rem; line-height: 1.6; }
.batch-settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 13px; }
.batch-settings .input-unit input { padding-right: 47px; }
.batch-fee-settings { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.batch-fee-top { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.batch-fee-top .batch-note { margin-top: 0; }
.fee-subtitle { font-size: 1rem; margin: 18px 0 7px; }
.batch-fees { min-width: 580px; }
.batch-fees td:nth-child(4), .batch-fees tfoot th:nth-child(2), .batch-comparison td, .batch-comparison tfoot td { font-variant-numeric: tabular-nums; }
.batch-fees td:nth-child(4) { font-weight: 670; }
.batch-fees td:nth-child(5), .batch-comparison td small { color: var(--soft); font-size: .8rem; }
.batch-comparison { min-width: 760px; }
.batch-comparison td small { display: block; }
.batch-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.batch-total { padding: 13px 15px; border-radius: 9px; background: #f3ecff; color: #3d216a; min-width: 0; }
.batch-total.fbs-total { background: #e7f6f3; color: #1d5a54; }
.batch-total > span, .batch-total > small { display: block; }
.batch-total > span { font-size: .86rem; font-weight: 670; }
.batch-total strong { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.055em; display: block; margin: 4px 0; overflow-wrap: anywhere; }
.batch-total small { font-size: .77rem; }
.batch-print { display: flex; justify-content: flex-end; margin-top: 13px; }
@media (max-width: 820px) {
  .batch-fee-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .batch-section { padding: 16px; }
}
@media (max-width: 580px) {
  .top-inner nav a { font-size: .75rem; gap: 3px; }
  .top-inner nav svg { width: 12px; height: 12px; }
  .batch-hero { min-height: 153px; }
  .batch-picker { gap: 7px; margin-top: 12px; }
  .batch-choice { padding: 8px; gap: 6px; }
  .batch-choice .heading-icon { width: 26px; height: 26px; border-radius: 6px; }
  .batch-choice svg { width: 16px; height: 16px; }
  .batch-choice b { font-size: .85rem; }
  .batch-choice small { font-size: .69rem; }
  .batch-section { padding: 12px; margin-top: 12px; }
  .batch-settings, .batch-fee-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-pallet { grid-template-columns: 78px minmax(0, 1fr); gap: 8px; padding: 9px; }
  .batch-pallet p { font-size: .8rem; }
  .batch-pallet strong { font-size: 1.9rem; }
  .batch-fee-top { align-items: start; }
  .batch-total { padding: 9px; }
}
@media print {
  #print-view .batch-products, #print-view .batch-fees, #print-view .batch-comparison { min-width: 0; }
  #print-view .table-scroll { overflow: visible; }
  #print-view th, #print-view td { padding: 4pt; font-size: 8.5pt; }
  #print-view h3 { margin: 3mm 0 2mm; break-after: avoid; }
  #print-view .printed-batch { margin-top: 5mm; }  #print-view .printed-batch + .printed-batch { break-before: page; }
}
.batch-total small + small { margin-top: 4px; }
.batch-total .text-button { margin-top: 7px; }
.fbs-total .text-button { color: #145c55; }
.table-swipe { display: none; }
@media (max-width: 820px) {
  .table-swipe { display: block; color: var(--soft); font-size: .77rem; margin-bottom: 7px; }
}

.intake-panel { position: relative; display: grid; grid-template-columns:minmax(0,1fr) auto; gap: 12px 18px; align-items: center; margin-top: 18px; padding: 18px 20px; border-color: #dcd0f2; }
.intake-panel.drop-active { outline: 2px dashed #9d79eb; outline-offset: -5px; background:#f9f4ff; }
.intake-copy { display:flex; gap:12px; align-items:flex-start; min-width:0; }
.intake-copy h2 { font-size:1.06rem; font-weight:730; }
.intake-copy p { margin-top:4px; color:var(--muted); font-size:.9rem; line-height:1.5; }
.intake-copy small { display:block; margin-top:5px; color:var(--soft); line-height:1.5; font-size:.79rem; }
.intake-copy .heading-icon { width:40px; height:40px; border-radius:10px; }
.intake-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:4px 12px; }
.intake-status { grid-column:1/-1; font-size:.84rem; color:#5d427d; overflow-wrap:anywhere; }
.intake-status:empty { display:none; }
.intake-dialog { width:min(780px,calc(100% - 28px)); }
.intake-review { display:grid; gap:12px; }
.intake-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.intake-mapping { margin:0; }
.intake-mapping .columns-grid { padding:11px; border-top:1px solid var(--border); }
.intake-map-count { font-size:.76rem; font-weight:520; color:var(--soft); margin-left:auto; }
.intake-warning { font-size:.85rem; color:#795318; line-height:1.55; margin-top:6px; }
.intake-model-status { border:1px solid #ded3f1; border-radius:9px; background:#f5f0fc; padding:10px 12px; color:#503477; font-size:.9rem; line-height:1.5; }
.intake-issues { border:1px solid #efd8a9; border-radius:10px; background:#fffbf2; padding:12px; margin-top:10px; color:#754d1a; }
.intake-issues h3 { font-size:.94rem; }
.intake-issues ul { display:grid; grid-template-columns:repeat(auto-fit,minmax(205px,1fr)); gap:7px 16px; margin:8px 0; padding:0; list-style:none; }
.intake-issues li { display:grid; gap:3px; font-size:.85rem; }
.intake-issues p,.intake-issues li span { font-size:.84rem; line-height:1.45; }
.intake-fill { background:#f8f5fd; border:1px solid #ded3f1; border-radius:12px; padding:13px; min-width:0; }
.intake-fill h3 { font-size:.98rem; }
.intake-fill p { color:var(--muted); font-size:.86rem; line-height:1.5; margin:5px 0 12px; }
.intake-fill-row { margin:9px 0 0; padding:7px 10px 10px; min-width:0; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.intake-fill-row legend { max-width:100%; overflow-wrap:anywhere; padding:0 5px; color:#513878; font-size:.86rem; font-weight:680; }
.intake-fill-pages { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:9px 12px; margin-top:9px; font-size:.84rem; }
.intake-fill-pages span { margin-right:auto; color:var(--muted); }
[data-fill-fields]:empty { display:none; }
.calculation-guide { margin-top:16px; padding:13px 16px; }
.calculation-guide summary { font-size:1rem; font-weight:720; color:var(--primary-dark); }
.calculation-guide ol { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); list-style:none; margin:12px 0 0; padding:0; gap:10px; }
.calculation-guide li { display:flex; align-items:flex-start; gap:10px; background:#f8f5fd; border:1px solid #eee8f6; padding:12px; border-radius:10px; }
.calculation-guide li .heading-icon { width:32px; height:32px; border-radius:8px; }
.calculation-guide li svg { width:17px; height:17px; }
.calculation-guide li strong { font-size:.91rem; }
.calculation-guide li p { margin-top:4px; line-height:1.5; color:var(--muted); font-size:.85rem; }
.customer-price-heading { margin:14px 0 17px; }
.customer-rate-panel { margin-bottom:15px; padding:18px 20px; }
.customer-rate-panel .table-scroll { margin-top:8px; }
.quote-explanation h2 { font-size:1.05rem; }
.quote-explanation ul { margin:9px 0 0; padding-left:1.3em; color:var(--muted); line-height:1.65; font-size:.9rem; }
.quote-explanation strong { color:var(--ink); }
@media(max-width:680px) {
  .calculation-guide ol { grid-template-columns:1fr; gap:7px; }
  .calculation-guide li,.customer-rate-panel { padding:12px; }
}
.preview-heading { display:flex; justify-content:space-between; gap:8px; align-items:center; margin:3px 0 7px; font-size:.875rem; }
.preview-heading span { color:var(--soft); font-size:.8rem; }
.intake-preview { border:1px solid var(--border); }
.intake-preview th,.intake-preview td { padding:6px 8px; }
.intake-preview td small { display:block; color:var(--soft); max-width:38ch; }
.batch-active-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin:19px 0 0; }
.batch-active-toolbar h2 { min-width:0; overflow-wrap:anywhere; font-size:clamp(1.17rem,2.5vw,1.42rem); letter-spacing:-.025em; }
.batch-print { flex-wrap:wrap; gap:8px; }
.upload-empty { text-align:center; margin-top:16px; padding:30px 17px; }
.upload-empty .heading-icon { margin-bottom:8px; }
.upload-empty h2 { font-size:1rem; }
.upload-empty p { color:var(--muted); font-size:.89rem; margin-top:6px; line-height:1.5; }
@media (max-width: 780px) {
  .intake-panel { grid-template-columns:1fr; padding:13px 15px; margin-top:12px; }
  .intake-actions { justify-content:flex-start; }
}
@media(max-width:580px) {
 .intake-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .intake-copy h2 { font-size:1rem; }
 .intake-copy .heading-icon { width:32px; height:32px; }
 .intake-copy svg { width:18px; height:18px; }
 .batch-active-toolbar { align-items:flex-start; }
}

.trade-intro { display:flex; gap:12px; justify-content:space-between; align-items:center; margin:0 0 14px; }
.trade-intro .batch-note { margin:0; }
.trade-fieldset { display:grid; gap:12px; background:#faf8fd; border:1px solid var(--border); border-radius:10px; padding:12px; margin-bottom:14px; }
.trade-fieldset h3 { margin:2px 0 0; font-size:.95rem; }
.trade-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px 12px; }
.trade-transport-fields { grid-template-columns:repeat(4,minmax(0,1fr)); }
.trade-fields[hidden] { display:none; }
.trade-fieldset .trade-note { margin:0; }
.trade-invoice { display:flex; align-items:baseline; flex-wrap:wrap; column-gap:10px; row-gap:2px; margin:0; font-size:.86rem; }
.trade-invoice span { color:var(--muted); }
.trade-date { display:flex; gap:8px 12px; align-items:end; flex-wrap:wrap; }
.trade-date [role=status] { align-self:center; color:var(--muted); font-size:.84rem; }
.payable-tax { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.payable-tax-item { display:grid; gap:3px; min-width:0; padding:10px 12px; background:#fff; border:1px solid var(--border); border-radius:8px; }
.payable-tax-item label { font-size:.875rem; font-weight:650; }
.payable-tax-item output { font-size:clamp(1.05rem,2vw,1.35rem); font-variant-numeric:tabular-nums; font-weight:730; color:var(--primary-dark); overflow-wrap:anywhere; }
.payable-tax-item small { color:var(--muted); font-size:.8rem; }
.payable-tax-pending output { color:#795318; }
.product-tax-intro { display:flex; gap:10px 15px; align-items:baseline; flex-wrap:wrap; }
.product-tax-intro .batch-note { margin:0; }
.product-tax-intro a { color:var(--primary-dark); font-size:.85rem; text-decoration:underline; text-underline-offset:2px; }
.product-tax-table { min-width:1090px; }
.product-tax-table th[scope="row"] { text-align:left; min-width:135px; }
.product-tax-table th small { display:block; color:var(--muted); font-weight:500; margin-top:3px; }
.product-tax-table td { vertical-align:top; min-width:80px; }
.product-tax-table td:nth-child(3) { min-width:145px; }
.product-tax-table td:nth-child(4) { min-width:125px; }
.product-tax-table td:nth-child(5) { min-width:158px; }
.product-tax-table :is(input,select,textarea) { width:100%; min-width:0; padding:5px 6px; font:inherit; color:var(--ink); background:#fff; border:1px solid var(--border); border-radius:6px; }
.product-tax-table output { white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:650; }
.product-tax-table td:nth-child(4) input { margin-top:3px; }
.tax-facts { margin-top:4px; color:var(--primary-dark); font-size:.8rem; }
.tax-facts summary { cursor:pointer; }
.tax-facts[open]+.tax-note { display:none; }
.tax-note { display:block; margin-top:3px; max-width:175px; color:var(--muted); }
.product-tax-rate { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:4px; margin-top:4px; }
.product-tax-rate label { color:var(--muted); font-size:.79rem; font-weight:500; }
.product-tax-rate input { display:block; margin-top:2px; font-size:.85rem; }
.product-tax-rate[hidden] { display:none; }
.trade-actual { border-top:1px solid var(--border); padding-top:10px; }
.trade-actual summary { cursor:pointer; font-size:.9rem; font-weight:650; color:var(--primary-dark); }
.trade-actual[open] .trade-fields { margin-top:10px; }
.trade-fields .input-unit input { padding-right:35px; }
.trade-fields .unit-long input { padding-right:77px; }
.trade-reference { grid-column:1/-1; }
.trade-fees td:last-child { font-weight:690; }
.trade-fees .trade-pending { color:#795318; }
.customs-dialog { width:min(790px,calc(100% - 24px)); }
.customs-sources { display:grid; gap:9px; list-style:none; margin:0; padding:0; }
.customs-sources li { padding:9px 12px; border:1px solid var(--border); border-radius:8px; }
.customs-sources p,.customs-assist .batch-note { font-size:.85rem; color:var(--muted); line-height:1.6; }
.customs-sources a { display:inline-block; margin-top:4px; color:var(--primary-dark); font-size:.81rem; text-decoration:underline; text-underline-offset:2px; }
.customs-assist { display:grid; gap:10px; margin-top:16px; padding:14px; border:1px solid var(--border); border-radius:10px; background:#faf7ff; }
.customs-assist :is(button,.field) { justify-self:start; }
.customs-assist .field { width:100%; }
.customs-assist-actions { display:flex; gap:8px; align-items:end; }
.customs-result { background:#fff; border:1px solid var(--border); padding:12px; white-space:pre-wrap; line-height:1.65; font-size:.88rem; border-radius:8px; }
.customs-candidates { display:grid; gap:6px; margin:0 0 10px; }
.customs-candidates label { display:flex; gap:8px; padding:8px; border-radius:6px; background:#fff; border:1px solid var(--border); align-items:start; }
.customs-candidates input { accent-color:var(--primary); margin-top:4px; }
.customs-candidates small { display:block; margin-top:3px; color:var(--muted); overflow-wrap:anywhere; }
@media(max-width:680px) {
  .trade-intro { align-items:flex-start; flex-direction:column; }
  .trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .trade-fields > .field:has(>select) { grid-column:1/-1; }
  .trade-fields .unit-long input { padding-right:62px; }
}
@media print {
  #print-view [data-full-save] { display:none; }
}

.trade-field-source { color:var(--primary-dark); font-size:.74rem; font-weight:540; }
.customs-assist { margin-top:0; }
.customs-assist .check { display:flex; gap:8px; align-items:flex-start; color:var(--ink); font-size:.85rem; }
.customs-assist .check input { accent-color:var(--primary); flex:none; margin:3px 0 0; }
.customs-assist-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.customs-docs { margin-top:14px; font-size:.86rem; }
.customs-docs summary { cursor:pointer; padding:8px 0; color:var(--primary-dark); font-weight:640; list-style:revert; }
.customs-candidates > div { padding:8px 10px; border:1px solid var(--border); border-radius:6px; background:#fff; }
