/* Glazed Quotation Dashboard — Section-based + Adaptive Packed Layout
 *
 * Structure (no shared grid-row heights):
 *   .parameter-dashboard__main   — flex row: left stack | existing quotes
 *   .parameter-dashboard__pack   — flex-wrap pack zone for multiplier / calc cards
 *
 * Left  (.parameter-dashboard__left):   型号 → 报价 → 文件名
 * Right (.parameter-dashboard__quotes): 现存报价单（型号右侧，独立高度）
 * Pack  (.parameter-dashboard__pack):   倍率、价格计算及后续模块
 */

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard{
  display:flex!important;
  flex-direction:column!important;
  gap:18px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  align-items:stretch!important;
}

/* --- Main band: 左侧操作栈 | 现存报价单 --- */
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__main{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  align-content:flex-start!important;
  gap:18px!important;
  width:100%!important;
  min-width:0!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__left{
  display:flex!important;
  flex-direction:column!important;
  flex:0 1 auto!important;
  align-items:flex-start!important;
  gap:18px!important;
  min-width:0!important;
  max-width:100%!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__left>.card{
  width:fit-content!important;
  max-width:min(100%,360px)!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes{
  flex:1 1 320px!important;
  min-width:0!important;
  max-width:100%!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes>.existing-quotes-card{
  width:fit-content!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  overflow:visible!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes .existing-quotes-table-wrap{
  width:max-content!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes .existing-quotes-table{
  width:max-content!important;
  max-width:none!important;
  min-width:0!important;
  table-layout:auto!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes .existing-quotes-table th,
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes .existing-quotes-table td{
  white-space:nowrap!important;
}

/* --- Pack band: 倍率 / 价格计算自适应紧凑排列 --- */
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  align-content:flex-start!important;
  gap:18px!important;
  width:100%!important;
  min-width:0!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack>.card{
  flex:0 1 auto!important;
  width:fit-content!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
}

/* Multiplier: table + caption share width */
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-table-wrap{
  display:table!important;
  width:fit-content!important;
  max-width:100%!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-table-wrap .multiplier-table{
  display:table!important;
  width:auto!important;
  margin:0!important;
  table-layout:auto!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-table-wrap .exchange-rate-status{
  display:table-caption!important;
  caption-side:bottom!important;
  width:auto!important;
  max-width:100%!important;
  margin:0!important;
  padding:10px 12px 12px!important;
  box-sizing:border-box!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  text-align:left!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-table th,
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-table td{
  width:auto!important;
  white-space:nowrap!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .multiplier-input{
  width:72px!important;
  min-width:72px!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table-wrap{
  width:max-content!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table{
  width:max-content!important;
  max-width:none!important;
  min-width:0!important;
  table-layout:auto!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table th,
#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table td{
  width:auto!important;
  max-width:none!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table td:nth-child(2){
  text-align:center!important;
  white-space:nowrap!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table td:nth-child(3){
  min-width:180px!important;
  max-width:360px!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  line-height:1.35!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table tbody tr:nth-child(odd)>td:nth-child(3){
  background:#ffffff!important;
}

#parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table tbody tr:nth-child(even)>td:nth-child(3){
  background:#f2f7fc!important;
}

/* --- Mobile: single column, preserve reading order --- */
@media (max-width:760px){
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard{
    gap:16px!important;
  }

  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__main,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack{
    flex-direction:column!important;
    flex-wrap:nowrap!important;
  }

  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__left,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack{
    flex:1 1 auto!important;
    width:100%!important;
    max-width:100%!important;
  }

  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__left>.card,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes>.existing-quotes-card,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack>.card{
    width:100%!important;
    max-width:100%!important;
  }

  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__pack .height-tax-card .calc-table,
  #parametersSection[data-quote-backend="glazed"] .parameter-dashboard__quotes .existing-quotes-table{
    min-width:min(100%,480px)!important;
  }
}
