:root {
  --ink: #17211b;
  --muted: #68746d;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --line: #dce3dd;
  --line-strong: #b8c5bb;
  --green: #185f43;
  --green-dark: #104932;
  --green-soft: #e7f1eb;
  --orange: #f28a2b;
  --yellow: #f7ef56;
  --red: #bf2f38;
  --red-soft: #fff0f1;
  --shadow: 0 10px 30px rgba(24, 56, 39, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: #123e2e; color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 26px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--orange); font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }.brand small { margin-top: 3px; color: #a8c0b4; }
.nav-list { display: grid; gap: 7px; }.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 13px; border: 0; border-radius: 10px; color: #c9d8d0; background: transparent; text-align: left; }
.nav-item span { width: 22px; font-weight: 800; text-align: center; }.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: #fff; }.nav-item.active { box-shadow: inset 3px 0 var(--orange); }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }.sidebar-footer small { color: #9db5a9; text-align: center; }.file-button input { display: none; }
.workspace { min-width: 0; }.topbar { height: 86px; padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.eyebrow { margin: 0 0 3px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }.topbar h1 { margin: 0; font-size: 23px; }.save-state { color: var(--muted); font-size: 13px; }
.view { display: none; padding: 24px 32px 60px; }.view.active { display: block; }.quote-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }.toolbar-spacer { flex: 1; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; color: var(--ink); background: #fff; }
.button.primary { color: #fff; background: var(--green); }.button.primary:hover { background: var(--green-dark); }.button.secondary { color: var(--green); border-color: #b8d2c3; background: var(--green-soft); }.button.ghost { color: inherit; border-color: rgba(127,145,134,.4); background: transparent; }.button.danger { color: var(--red); border-color: #efc9cc; background: var(--red-soft); }.button.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.form-section, .panel { margin-bottom: 16px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }.section-heading, .panel-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }.section-heading > div { display: flex; align-items: center; gap: 10px; }.section-heading h2, .panel-header h2 { margin: 0; font-size: 17px; }.section-heading p, .panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }.step { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 900; }
.form-grid { display: grid; gap: 14px; }.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }.span-2 { grid-column: span 2; }
label { display: grid; gap: 7px; color: #45524b; font-size: 12px; font-weight: 700; }input, select, textarea { width: 100%; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #cfd8d1; border-radius: 8px; outline: none; }textarea { resize: vertical; }input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,95,67,.1); }input[readonly] { background: #f3f5f3; color: #5d6962; }
.quote-items { display: grid; gap: 14px; }.quote-item { border: 1px solid var(--line-strong); border-radius: 13px; overflow: hidden; }.quote-item.risk { border-color: #e5a2a7; box-shadow: 0 0 0 3px rgba(191,47,56,.06); }.item-header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f6f8f6; border-bottom: 1px solid var(--line); }.item-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; background: var(--green); font-weight: 900; }.item-header strong { flex: 1; }.item-actions { display: flex; gap: 6px; }.item-body { padding: 15px; display: grid; gap: 15px; }.item-block { padding: 14px; border-radius: 10px; background: #fbfcfb; border: 1px solid #e6ebe7; }.item-block h3 { margin: 0 0 12px; color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }.cost-analysis { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(330px,.85fr); gap: 14px; }.cost-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }.metric { padding: 10px; border-radius: 8px; background: var(--green-soft); }.metric span, .metric strong { display: block; }.metric span { color: var(--muted); font-size: 11px; }.metric strong { margin-top: 4px; font-size: 15px; }.price-result { display: grid; gap: 8px; align-content: start; padding: 13px; color: #fff; background: var(--green); border-radius: 10px; }.price-result .price-main { font-size: 25px; font-weight: 900; }.price-result small { color: #cfe0d7; }.adjust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.risk-message { display: none; padding: 9px; color: #8e1e26; background: #ffe4e6; border-radius: 7px; font-size: 12px; font-weight: 800; }.risk .risk-message { display: block; }
.custom-pricing-layer { display: grid; gap: 14px; }.custom-pricing-layer .field-hint { display: block; margin-top: 5px; color: #65756c; font-size: 11px; line-height: 1.35; }.required-marker { color: var(--red); }.custom-pricing-layer input[aria-invalid="true"] { border-color: var(--red); background: #fff8f8; box-shadow: 0 0 0 3px rgba(191,47,56,.08); }.custom-input-warning { margin-top: 12px; padding: 9px 11px; color: #8a5513; background: #fff5dc; border: 1px solid #efd19a; border-radius: 7px; font-size: 12px; font-weight: 700; }.custom-pricing-layer input:disabled { color: #8b9690; background: #edf1ee; cursor: not-allowed; }
.custom-packing-preview { margin-top: 12px; padding: 11px 13px; border-left: 3px solid var(--green); border-radius: 7px; background: var(--green-soft); }.custom-packing-preview small,.custom-packing-preview strong { display: block; }.custom-packing-preview small { color: var(--muted); }.custom-packing-preview strong { margin-top: 5px; color: var(--green); line-height: 1.45; }
.blend-pricing-layer { display: grid; gap: 14px; }.blend-section-heading,.blend-component-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.blend-section-heading h3 { margin-bottom: 3px; }.blend-section-heading small { color: var(--muted); font-size: 11px; }.blend-component-list { display: grid; gap: 10px; margin-top: 12px; }.blend-component-row { padding: 12px; border: 1px solid #d9e4dc; border-radius: 9px; background: #fff; }.blend-component-heading { margin-bottom: 10px; }.blend-component-heading strong { color: var(--green); font-size: 13px; }.blend-totals { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }.blend-input-warning { margin-top: 11px; padding: 9px 11px; color: #8a5513; background: #fff5dc; border: 1px solid #efd19a; border-radius: 7px; font-size: 12px; font-weight: 700; }.blend-pricing-layer input[aria-invalid="true"],.blend-pricing-layer select[aria-invalid="true"] { border-color: var(--red); background: #fff8f8; box-shadow: 0 0 0 3px rgba(191,47,56,.08); }.blend-component-row .button:disabled,.blend-section-heading .button:disabled { opacity: .45; cursor: not-allowed; }
.custom-additional-costs { display: grid; gap: 10px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }.custom-additional-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.custom-additional-heading div,.custom-additional-heading small { display: block; }.custom-additional-heading small,.custom-additional-cost-row label small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }.custom-additional-cost-list { display: grid; gap: 9px; }.custom-additional-cost-row { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(145px,.45fr) minmax(260px,1.3fr) auto; gap: 9px; align-items: end; padding: 10px; border: 1px solid #dce5df; border-radius: 8px; background: #fff; }.custom-additional-cost-row .button { margin-bottom: 1px; }.custom-additional-empty { padding: 12px; color: var(--muted); background: #f4f7f5; border-radius: 7px; font-size: 12px; text-align: center; }
.private-cost-note,.private-cost-controls { display: grid; gap: 9px; margin-top: 15px; padding: 12px; border: 1px solid #dbe6df; border-radius: 9px; background: #f4f8f5; }.private-cost-note span,.private-cost-controls small { color: var(--muted); font-size: 12px; }.private-cost-controls > div:first-child strong,.private-cost-controls > div:first-child small { display: block; }.private-cost-control-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.private-cost-control { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 9px; border: 1px solid #d8e4dc; border-radius: 8px; background: #fff; }.private-cost-control > span { font-size: 12px; font-weight: 800; }.private-cost-control > strong { color: var(--green); font-size: 12px; }.private-cost-control > .button { grid-column: 2; grid-row: 1 / span 2; }.private-cost-control.removed { opacity: .72; background: #f0f2f1; }.private-cost-control.removed > strong { color: var(--muted); }.private-oil-cost { padding: 8px 10px; color: var(--muted); background: #fff; border-radius: 7px; font-size: 12px; }.private-cost-metric strong { color: var(--muted); font-size: 13px; }
.quote-image-editor { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 13px; align-items: center; margin-top: 13px; padding: 11px; border: 1px dashed #b9c9be; border-radius: 9px; background: #f7faf8; }.quote-image-preview { width: 120px; height: 100px; overflow: hidden; display: grid; place-items: center; border-radius: 7px; background: #e9efeb; }.quote-image-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }.quote-image-placeholder { padding: 10px; color: #87958d; text-align: center; font-size: 11px; }.quote-image-controls { display: grid; gap: 5px; }.quote-image-controls > span,.quote-image-controls > small { color: var(--muted); font-size: 11px; }.quote-image-controls .cell-actions { margin-top: 3px; }
.quote-image-library { max-width: 520px; margin: 3px 0; }.quote-image-library select { margin-top: 4px; }
.quote-summary { position: sticky; bottom: 18px; display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid #b8cabc; border-radius: 13px; box-shadow: 0 14px 38px rgba(15,54,36,.18); background: #bdd0c2; }.summary-cell { padding: 12px 14px; background: #fff; }.summary-cell span, .summary-cell strong { display: block; }.summary-cell span { color: var(--muted); font-size: 11px; }.summary-cell strong { margin-top: 4px; }.summary-cell.warning { background: #fff5dc; }.summary-cell.warning strong { color: #9a5b0a; }.summary-warning-note { display: block; margin-top: 4px; color: #9a5b0a; font-size: 10px; }.summary-total { display: grid; align-content: center; min-width: 180px; padding: 12px 18px; color: #fff; background: var(--green); }.summary-total small { color: #cfe0d7; }.summary-total strong { font-size: 22px; }.summary-total.risk { background: var(--red); }
.cif-price-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0; padding: 10px; border: 1px solid #d9c487; border-radius: 9px; background: #fff8df; }.cif-price-details .metric { padding: 8px; background: rgba(255,255,255,.72); border-radius: 7px; }.cif-price-details .metric span,.cif-price-details .metric strong { display: block; }.cif-price-details .metric span { color: #786531; font-size: 11px; }.cif-price-details .metric strong { margin-top: 4px; color: #51420e; }
.filter-row { display: flex; gap: 8px; }.filter-row input { min-width: 260px; }.table-scroll { overflow: auto; }.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }.data-table th { position: sticky; top: 0; z-index: 1; padding: 10px; color: #45524b; background: #eef3ef; text-align: left; white-space: nowrap; }.data-table td { padding: 10px; border-bottom: 1px solid #e8ece9; vertical-align: top; }.data-table tr:hover td { background: #fafcfb; }.cell-actions { display: flex; gap: 5px; flex-wrap: wrap; }.tag { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }.tag.warn { background: #fff1da; color: #9a5617; }
.inline-editor { display: grid; grid-template-columns: repeat(5,minmax(140px,1fr)); gap: 10px; margin-bottom: 18px; padding: 14px; background: #f7f9f7; border: 1px solid #e0e6e1; border-radius: 11px; }.inline-editor.compact { grid-template-columns: 1.2fr .6fr 2fr auto; }.inline-editor .button { align-self: end; }
.packaging-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 12px; }.pack-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }.pack-card-image { height: 130px; display: grid; place-items: center; background: #f3f6f3; }.pack-card-image img { width: 100%; height: 100%; object-fit: contain; }.pack-placeholder { color: #9aa69e; font-weight: 800; }.pack-card-body { padding: 12px; }.pack-card-body h3 { margin: 0 0 3px; font-size: 15px; }.pack-card-body p { margin: 4px 0; color: var(--muted); font-size: 12px; }.pack-card-stats { display: flex; justify-content: space-between; padding: 9px 0; font-size: 12px; }.settings-layout { display: grid; gap: 16px; }.settings-layout .panel { margin: 0; }
.modal { display: none; position: fixed; inset: 0; z-index: 100; overflow: auto; padding: 18px; background: rgba(12,25,18,.72); }.modal.open { display: block; }.modal-bar { position: sticky; top: 0; z-index: 2; display: flex; max-width: 1080px; margin: 0 auto 12px; padding: 10px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }.pi-document { width: 210mm; min-height: 297mm; margin: 0 auto; padding: 12mm 10mm; background: #fff; color: #111; font-family: Arial, "Microsoft YaHei", sans-serif; box-shadow: 0 20px 50px rgba(0,0,0,.25); }.pi-title { text-align: center; }.pi-title h1 { margin: 0; font-family: Georgia, serif; font-size: 20px; }.pi-title h2 { margin: 11px 0 18px; font-family: Georgia, serif; font-size: 17px; }.pi-meta { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; margin-bottom: 10px; font-size: 11px; }.pi-meta .right { text-align: right; }.pi-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8px; }.pi-table th, .pi-table td { padding: 4px 3px; border: 1px solid #222; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }.pi-table th { font-weight: 700; }.pi-table img { width: 34px; height: 34px; object-fit: contain; }.pi-table .left { text-align: left; }.pi-total-row { background: var(--yellow); font-weight: 800; }.pi-remarks { margin: 10px 0; padding: 8px; border: 1px solid #333; font-size: 8px; line-height: 1.55; }.pi-footer { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; font-size: 8px; line-height: 1.4; }.pi-footer h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 12px; }.pi-footer dl { margin: 0; }.pi-footer dt { color: #555; }.pi-footer dd { margin: 0 0 4px; font-weight: 600; }.pi-bank, .pi-company { break-inside: avoid; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; transform: translateY(16px); opacity: 0; pointer-events: none; padding: 11px 15px; color: #fff; background: #172b20; border-radius: 9px; box-shadow: var(--shadow); transition: .2s ease; }.toast.show { transform: none; opacity: 1; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }.muted { color: var(--muted); }.nowrap { white-space: nowrap; }
.price-latest-update { display: inline-block; margin-top: 7px; color: var(--green); font-size: 12px; font-weight: 700; }
.access-dialog { width: min(430px, 100%); margin: 15vh auto 0; padding: 24px; border-radius: 15px; background: var(--paper); box-shadow: 0 20px 50px rgba(0,0,0,.28); }.access-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }.access-dialog-header h2 { margin: 0; font-size: 20px; }.access-dialog .eyebrow { margin: 0 0 5px; }.access-dialog form { display: grid; gap: 14px; margin-top: 18px; }.access-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }.access-error { margin: -4px 0 0; color: var(--red); font-size: 12px; font-weight: 700; }
@media (max-width: 1100px) { .form-grid.cols-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }.cost-analysis { grid-template-columns: 1fr; }.inline-editor { grid-template-columns: repeat(3,minmax(140px,1fr)); }.quote-summary { grid-template-columns: repeat(3,1fr); }.summary-total { min-width: 0; } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; }.nav-list { grid-template-columns: repeat(2,1fr); }.sidebar-footer { margin-top: 16px; }.topbar { position: static; padding: 15px 18px; }.view { padding: 16px; }.form-grid.cols-4,.form-grid.cols-3,.form-grid.cols-2,.inline-editor,.inline-editor.compact,.custom-additional-cost-row,.private-cost-control-list { grid-template-columns: 1fr; }.span-2 { grid-column: auto; }.cost-grid { grid-template-columns: repeat(2,1fr); }.quote-summary { position: static; grid-template-columns: 1fr 1fr; }.pi-document { width: 100%; padding: 8mm; }.quote-toolbar { flex-wrap: wrap; }.quote-image-editor { grid-template-columns: 1fr; }.quote-image-preview { width: 100%; height: 160px; }.custom-additional-heading { align-items: flex-start; } }
.pi-total-row td { white-space: nowrap; }

/* Packaging cards: keep media and copy in separate layout rows. */
.packaging-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  align-items: start;
}
.pack-card {
  display: grid;
  grid-template-rows: 190px auto;
  align-self: start;
  min-width: 0;
}
.pack-card-image {
  position: relative;
  height: auto;
  min-height: 190px;
  overflow: hidden;
  isolation: isolate;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.pack-card-image img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 162px;
  object-fit: contain;
  object-position: center;
}
.pack-card-body {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: #fff;
}
.pack-card-body h3,
.pack-card-body p,
.pack-card-stats > * { overflow-wrap: anywhere; }
.pack-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

/* Quote items: gate detailed pricing behind an explicit type selection. */
.tag.pending { color: #8a5a16; background: #fff1d6; }
.quote-type-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  gap: 20px;
  align-items: center;
  padding: 16px;
  border: 1px solid #c8d9ce;
  border-radius: 11px;
  background: linear-gradient(135deg, #f2f8f4, #fffaf2);
}
.quote-type-copy { display: flex; gap: 12px; align-items: center; }
.quote-type-copy h3 { margin: 0; color: var(--green); font-size: 15px; }
.quote-type-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.quote-type-gate select { min-height: 42px; border-color: #9dbbac; font-weight: 800; }
.item-detail-layer { display: grid; gap: 15px; }
.quote-type-selected {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  color: #315445;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
}
.quote-type-selected strong { color: var(--green); }
.quote-type-empty {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 116px;
  padding: 24px;
  color: var(--muted);
  border: 1px dashed #b9c9bf;
  border-radius: 10px;
  background: #fbfcfb;
  text-align: center;
}
.quote-type-empty strong { color: #53665b; }

@media (max-width: 760px) {
  .packaging-grid { grid-template-columns: 1fr; }
  .quote-type-gate { grid-template-columns: 1fr; gap: 12px; }
  .quote-type-selected { align-items: flex-start; flex-direction: column; }
}

/* Daily Excel price import */
.price-importer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #c8d9ce;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f8f3, #fffaf1);
}
.price-import-copy { display: flex; gap: 12px; align-items: center; }
.price-import-copy .step { width: 44px; }
.price-import-copy h3 { margin: 0; color: var(--green); font-size: 15px; }
.price-import-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.price-import-actions { display: flex; gap: 10px; align-items: end; }
.price-import-actions label:first-child { min-width: 154px; }
.price-import-actions .file-button { min-height: 38px; white-space: nowrap; }
.price-import-result {
  grid-column: 1 / -1;
  min-height: 40px;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px dashed #bdcbc2;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  font-size: 12px;
}
.import-success,
.import-error { display: grid; gap: 3px; }
.import-success strong { color: var(--green); }
.import-error strong { color: var(--red); }
.import-loading { color: var(--green); font-weight: 800; }
.price-import-result details { margin-top: 8px; }
.price-import-result summary { cursor: pointer; color: #8a5a16; font-weight: 800; }
.price-import-result ul { margin: 7px 0 0; padding-left: 20px; }
.price-import-result li + li { margin-top: 4px; }
.pi-table img { display: block; width: 104px; height: 104px; margin: 0 auto; object-fit: contain; object-position: center; }

@media (max-width: 900px) {
  .price-importer { grid-template-columns: 1fr; }
  .price-import-actions { align-items: stretch; flex-direction: column; }
  .price-import-result { grid-column: auto; }
}
:root { --unused-price-change-marker: transparent; }
.metric.zero { color: var(--muted); background: #f7f8f7; border: 1px solid #e8ece9; }
.price-change { font-weight: 800; }.price-change.up { color: #b42318; }.price-change.down { color: #087443; }.price-change.flat { color: var(--muted); }
.suggested-breakdown { margin: 4px 0; font-size: 12px; color: #e4f1ea; }.suggested-breakdown summary { cursor: pointer; font-weight: 800; }.suggested-breakdown div { margin-top: 4px; }
.template-list { display: grid; gap: 10px; margin-top: 16px; }.template-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }.template-card h3 { margin: 0 0 5px; }.template-card p { margin: 0 0 5px; color: var(--muted); }.template-card .cell-actions { flex-shrink: 0; }
.pi-table { table-layout: auto; }
.pi-table th, .pi-table td { overflow-wrap: normal; word-break: normal; white-space: normal; }
.packing-document { width: 210mm; min-height: 297mm; margin: 0 auto; padding: 15mm; background: #fff; color: #111; font-family: Arial, "Microsoft YaHei", sans-serif; }.packing-heading { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1d3b2d; padding-bottom: 10px; margin-bottom: 16px; }.packing-company { color: #1d3b2d; font-size: 15px; font-weight: 800; letter-spacing: .04em; }.packing-document h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: .12em; }.packing-doc-label { text-align: right; color: #555; font-size: 11px; }.packing-doc-label strong { display: block; margin-top: 4px; color: #111; font-size: 12px; }.packing-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; margin-bottom: 20px; padding: 10px 12px; background: #f5f7f5; border: 1px solid #ccd7cf; font-size: 11px; line-height: 1.8; }.packing-meta > div:last-child { text-align: right; }.packing-document table { width: 100%; border-collapse: collapse; font-size: 10.5px; }.packing-document th, .packing-document td { border: 1px solid #1f2a24; padding: 8px 6px; text-align: center; }.packing-document thead th { background: #e8efe9; color: #1d3b2d; font-weight: 800; }.packing-document .packing-product { text-align: left; font-weight: 700; }.packing-document tfoot { font-weight: 800; background: #f5f7f5; }.packing-signatures { display: flex; justify-content: space-between; margin-top: 70px; font-size: 11px; color: #444; }
.quote-toolbar #preview-button { position: fixed; right: 24px; top: 50%; bottom: auto; transform: translateY(-50%); z-index: 60; border-radius: 999px; padding: 12px 18px; box-shadow: 0 10px 24px rgba(22, 73, 49, .25); }
@media (max-width: 680px) { .quote-toolbar #preview-button { right: 14px; } }

/* Keep document previews inside a phone viewport instead of clipping the A4 canvas. */
@media (max-width: 760px) {
  .modal { padding: 8px; }
  .modal-bar { width: 100%; margin-bottom: 8px; padding: 8px; }
  .pi-document,
  .packing-document {
    width: 100%;
    min-height: 0;
    padding: 16px 10px;
  }
  .pi-meta,
  .pi-footer,
  .packing-meta { grid-template-columns: 1fr; }
  .pi-meta .right,
  .packing-meta > div:last-child { text-align: left; }
  .pi-table { table-layout: fixed; font-size: 7px; }
  .pi-table th,
  .pi-table td { padding: 3px 2px; overflow-wrap: anywhere; word-break: break-word; }
  .pi-table img { width: 58px; height: 58px; }
  .packing-document { font-size: 9px; }
  .packing-document h1 { font-size: 18px; }
  .packing-document table { table-layout: fixed; font-size: 7.5px; }
  .packing-document th,
  .packing-document td { padding: 4px 2px; overflow-wrap: anywhere; word-break: break-word; }
  .packing-signatures { flex-direction: column; gap: 12px; margin-top: 34px; }
  .filter-row { flex-direction: column; }
  .filter-row input { min-width: 0; }
  .history-table { display: block; border: 0; }
  .history-table thead { display: none; }
  .history-table tbody,
  .history-table tr,
  .history-table td { display: block; width: 100%; }
  .history-table tr.history-detail {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(24, 56, 39, .06);
  }
  .history-table tr.history-detail td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid #eef2ef;
    overflow-wrap: anywhere;
  }
  .history-table tr.history-detail td:last-child { border-bottom: 0; }
  .history-table tr.history-detail td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }
  .history-table tr.history-detail td:nth-child(1)::before { content: "Invoice"; }
  .history-table tr.history-detail td:nth-child(2)::before { content: "客户"; }
  .history-table tr.history-detail td:nth-child(3)::before { content: "日期"; }
  .history-table tr.history-detail td:nth-child(4)::before { content: "最近修改"; }
  .history-table tr.history-detail td:nth-child(5)::before { content: "贸易条款"; }
  .history-table tr.history-detail td:nth-child(6)::before { content: "产品"; }
  .history-table tr.history-detail td:nth-child(7)::before { content: "总额 USD"; }
  .history-table tr.history-detail td:nth-child(8)::before { content: "状态"; }
  .history-table tr.history-detail td:nth-child(9)::before { content: "操作"; }
  .history-table .history-actions-cell .cell-actions { gap: 6px; }
  .history-table .history-actions-cell .button { flex: 1; min-width: 0; }
  .history-table tr.history-group { display: block; margin: 4px 0 10px; }
  .history-table tr.history-group td { display: block; padding: 11px 12px; border: 0; border-radius: 10px; }
  .history-table tr.history-group .history-toggle { float: none; margin: 9px 0 0; }
}
.history-group td { padding: 9px 10px; background: #eaf1ec; color: var(--green); border-top: 10px solid #fff; }.history-group .tag { float: right; }
.history-group .history-toggle { float: right; margin-right: 8px; }.history-detail.collapsed { display: none; }
.coa-editor { display: grid; gap: 16px; }
.coa-indicator-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 0 4px; }
.coa-indicator-toolbar .muted { flex: 1; }
.coa-required-hint { flex: 1; color: var(--red); font-size: 11px; font-weight: 800; }
.coa-indicator-table input { min-width: 100px; width: 100%; border: 1px solid #c8d5cc; border-radius: 6px; padding: 7px 8px; background: #fff; }
.coa-indicator-table tr.missing-result { background: #fff5f5; }
.coa-indicator-table tr.missing-result td { border-bottom-color: #f1c5c8; }
.coa-indicator-table tr.missing-result [data-coa-field="result"] { border-color: #d9535f; background: #fffafa; box-shadow: 0 0 0 2px rgba(191, 47, 56, .1); }
.coa-result-field { display: grid; gap: 4px; }
.coa-missing-hint { color: var(--red); font-size: 10px; font-weight: 800; }
.coa-test-item-field { display: grid; gap: 3px; }
.coa-test-item-field small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.coa-actions { display: flex; gap: 10px; justify-content: flex-end; }
.coa-history-heading { margin-top: 28px; }
.coa-document { width: 210mm; min-height: 297mm; margin: 0 auto; padding: 16mm; background: #fff; color: #111; font-family: Arial, "Microsoft YaHei", sans-serif; }
.coa-sheet { border: 1px solid #1d2a23; padding: 12mm 12mm 10mm; min-height: 260mm; }
.coa-company { text-align: center; color: #1d3b2d; font-size: 14px; font-weight: 800; letter-spacing: .03em; }
.coa-document h1 { margin: 9px 0 20px; text-align: center; font-size: 23px; letter-spacing: .08em; }
.coa-meta { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #222; margin-bottom: 14px; }
.coa-meta > div { display: grid; grid-template-columns: 42% 58%; border-bottom: 1px solid #bbb; padding: 7px 8px; font-size: 11px; }
.coa-meta > div:nth-child(odd) { border-right: 1px solid #bbb; }.coa-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
.coa-meta strong { font-weight: 700; }.coa-meta span { min-height: 15px; }
.coa-document table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.coa-document th, .coa-document td { border: 1px solid #222; padding: 8px 6px; text-align: center; }
.coa-document thead th { background: #e9efeb; font-weight: 800; }
.coa-conclusion { display: grid; grid-template-columns: 28% 72%; border: 1px solid #222; border-top: 0; padding: 9px 8px; font-size: 11px; }
.coa-signatures { display: flex; justify-content: space-between; gap: 12px; margin-top: 42px; font-size: 11px; }
.coa-footer { margin-top: 36px; padding-top: 10px; border-top: 1px solid #999; text-align: center; color: #555; font-size: 9px; line-height: 1.7; }
.product-source-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.supply-status { display: inline-flex; align-items: center; min-height: 32px; padding: 0 9px; border-radius: 999px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.supply-status.ok { color: #17623f; background: #e6f4eb; border: 1px solid #b8ddc5; }
.supply-status.warn { color: #9b3f24; background: #fff0eb; border: 1px solid #efc0b2; }
.field-error { display: block; color: #b32632; margin-top: 4px; font-size: 12px; }
[data-validation-invalid] { border-color: #b32632 !important; }
.validation-summary { margin: 12px 0; padding: 14px; border: 1px solid #e3afb5; border-radius: 8px; color: #952532; background: #fff4f4; }
.customer-lookup { display: flex; gap: 12px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.adopted-price-date { padding: 9px 18px; color: #17623f; background: #edf6f0; font-size: 12px; }
.draft-panel { max-width: 780px; margin: 40px auto; }
.draft-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.draft-row small { display: block; margin-top: 5px; color: var(--muted); }
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
#save-state { max-width: 430px; }
#published-price-version { overflow-wrap: anywhere; }
