/* 商业发票专属样式；在 pi.css 之上叠加，不修改 PI / 报价单 / 装箱单样式。 */
.ci-tool [hidden]{display:none!important}
.ci-tool button:disabled{opacity:.5;cursor:not-allowed}
.ci-tool .field{min-width:0}
.ci-tool .field input,.ci-tool .field select,.ci-tool .field textarea{min-width:0;width:100%}
.ci-tool .form-grid>.full{grid-column:1/-1}
.ci-tool #form-body>.section-heading{justify-content:flex-start;gap:10px}
.ci-tool .section-heading small{font-weight:400}
.ci-tool #validation{color:#875217;margin-top:10px}
.ci-tool #download-result:not(:empty){padding:12px 0}
.ci-tool #download-result a{overflow-wrap:anywhere;max-width:100%}
.ci-tool .ci-toggle{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0}
.ci-tool .ci-toggle>span{display:flex;flex-direction:column;gap:2px;font-weight:600}
.ci-tool .ci-toggle small{font-weight:400;color:var(--muted,#617283);font-size:12px}
.ci-tool .optional-section{margin-bottom:10px}
.ci-tool .optional-body{padding-bottom:6px}
.ci-tool .item-card .field textarea{min-height:64px}
.ci-tool .ci-words-editor{margin:8px 0 0;font-size:12px;color:var(--muted,#617283);line-height:1.5;overflow-wrap:anywhere}
.ci-tool .sum-row{gap:16px}
.ci-tool .sum-row strong,.ci-tool .sum-row span:last-child{text-align:right;overflow-wrap:anywhere}

/* 发票预览 */
.ci-tool .ci-parties{padding-bottom:0}
.ci-tool .ci-party-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.ci-tool .ci-party-grid>div{min-width:0;overflow-wrap:anywhere}
.ci-tool .ci-ship-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px;margin-top:12px;padding:10px 0 12px;border-top:1px solid #e0e6eb}
.ci-tool .ci-ship-grid div{min-width:0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
.ci-tool .ci-ship-grid span{font-size:.8em;letter-spacing:.04em;text-transform:uppercase;color:#617283}
.ci-tool .ci-ship-grid b{font-weight:600}
.ci-tool .ci-table th:nth-child(1){width:5%}
.ci-tool .ci-table th:nth-child(2){width:15%}
.ci-tool .ci-table th:nth-child(3){width:32%}
.ci-tool .ci-table th:nth-child(4){width:10%}
.ci-tool .ci-table th:nth-child(5){width:8%}
.ci-tool .ci-table th:nth-child(6){width:14%}
.ci-tool .ci-table th:nth-child(7){width:16%}
.ci-tool .ci-table th:nth-child(2),.ci-tool .ci-table td:nth-child(2),.ci-tool .ci-table th:nth-child(3),.ci-tool .ci-table td:nth-child(3){text-align:left}
.ci-tool .ci-table th:nth-child(5),.ci-tool .ci-table td:nth-child(5){text-align:center}
.ci-tool .ci-table td{overflow-wrap:anywhere}
.ci-tool .ci-marks{font-size:.92em;color:#3f4854}
.ci-tool .ci-summary{break-inside:avoid}
.ci-tool .ci-summary .sum-row.total span:first-child{overflow-wrap:anywhere}
.ci-tool .ci-words p{font-weight:600;letter-spacing:.01em}
.ci-tool .ci-sign{margin:22px 0 10px auto;width:46%;min-width:200px;font-size:10px;line-height:1.5;break-inside:avoid}
.ci-tool .ci-sign b{display:block;overflow-wrap:anywhere}
.ci-tool .ci-sign-space{height:48px}
.ci-tool .ci-sign-line{border-top:1px solid #263a30;padding-top:4px;color:#617283}
.ci-tool .export-page .ci-sign{font-size:12px}
.ci-tool .export-page .ci-sign-space{height:50px}
.ci-tool .export-page .ci-sign{margin-top:14px}
.ci-tool .export-page .ci-ship-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:10px;padding:8px 0 10px}
.ci-tool .ci-parties{padding-top:16px}
.ci-tool .export-page .ci-party-grid,.ci-tool .export-page .ci-ship-grid{font-size:12px}

@media(max-width:680px){
  .ci-tool .form-grid{grid-template-columns:minmax(0,1fr)}
  .ci-tool .page-heading{flex-wrap:wrap}
  .ci-tool #paper .pi-invoice-head{display:block}
  .ci-tool #paper .pi-invoice-head>div:last-child{max-width:none;margin-top:14px}
  .ci-tool #paper .pi-invoice-title,.ci-tool #paper .pi-invoice-meta{text-align:left}
  .ci-tool #paper .ci-party-grid{grid-template-columns:1fr}
  .ci-tool #paper .ci-ship-grid{grid-template-columns:1fr 1fr}
  .ci-tool #paper .ci-table thead{display:none}
  .ci-tool #paper .ci-table,.ci-tool #paper .ci-table tbody{display:block}
  .ci-tool #paper .ci-table tr{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid #cbd6e0;padding:10px 0;gap:6px}
  .ci-tool #paper .ci-table td{display:block;border:0;padding:4px;font-size:12px;text-align:left!important}
  .ci-tool #paper .ci-table td:before{display:block;color:#617283;font-size:10px}
  .ci-tool #paper .ci-table td:nth-child(1):before{content:'#'}
  .ci-tool #paper .ci-table td:nth-child(2):before{content:'Marks & Nos.'}
  .ci-tool #paper .ci-table td:nth-child(3){grid-column:1/-1;order:-1}
  .ci-tool #paper .ci-table td:nth-child(3):before{content:'Description of Goods'}
  .ci-tool #paper .ci-table td:nth-child(4):before{content:'Quantity'}
  .ci-tool #paper .ci-table td:nth-child(5):before{content:'Unit'}
  .ci-tool #paper .ci-table td:nth-child(6):before{content:'Unit Price'}
  .ci-tool #paper .ci-table td:nth-child(7):before{content:'Amount'}
  .ci-tool #paper .ci-sign{width:100%;min-width:0}
}
.ci-tool .ci-pack-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 14px}
.ci-tool .ci-pack-grid div{min-width:0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
.ci-tool .ci-pack-grid span{font-size:.8em;color:#617283}
@media(max-width:680px){.ci-tool #paper .ci-pack-grid{grid-template-columns:1fr 1fr}}
.ci-tool .ci-total-wrap{display:grid;grid-template-columns:minmax(0,1fr) 53%;gap:22px;align-items:start;break-inside:avoid}
.ci-tool .ci-total-wrap>.ci-summary{width:auto;margin:13px 0 18px}
.ci-tool .ci-words{margin-top:13px;font-size:8px}
.ci-tool .ci-words p{margin:4px 0 0}
.ci-tool .ci-bottom{display:grid;grid-template-columns:minmax(0,1fr) 40%;gap:22px;align-items:end}
.ci-tool .ci-bottom>.ci-sign{width:auto;min-width:0;margin:14px 0 10px}
.ci-tool .ci-bottom-text:empty{display:none}
.ci-tool .export-page .ci-words{font-size:12px}
@media(max-width:680px){.ci-tool #paper .ci-total-wrap,.ci-tool #paper .ci-bottom{grid-template-columns:1fr;gap:0}.ci-tool #paper .ci-total-wrap>.ci-summary{grid-column:1}}
.ci-tool .ci-total-wrap>.ci-summary{grid-column:2}
.ci-tool .export-page .ci-table td{padding:9px 6px}
.ci-tool .export-page .ci-parties{padding:12px 0 0}
.ci-tool .export-page .ci-bottom .ci-sign-space{height:40px}
.ci-tool .export-page .ci-bottom>.ci-sign{margin:8px 0 4px}
