/**
 * 「基础信息」模块样式（2026-10-26 业务方要求）。
 *
 * 口径：
 *   · 左侧类目树仿产品结构树（一级类目 = 单据类型，二级类目 = 资料类别）；
 *   · 右侧配置面板**和真实报价合同 / 工厂合同的界面保持一致**——
 *     抬头区大字 + 地址 + 联系方式 + 右侧印章框；银行账户区是 Bank Info 那种标签值版式；
 *     工厂合同区是「商 品 购 销 合 同」抬头 + 需方资料 + 购销条款；
 *   · 颜色一律 var(--wb-*)，由 `npm run check:design` 校验。
 */

/* ---------------- 骨架：左树 + 右面板 ---------------- */

.bi-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--wb-space-4);
  align-items: start;
}

@media (max-width: 900px) {
  .bi-layout { grid-template-columns: minmax(0, 1fr); }
}

.bi-tree {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-panel-bg);
  padding: var(--wb-space-2);
  min-height: 0;
}

.bi-tree-group + .bi-tree-group {
  margin-top: var(--wb-space-3);
}

.bi-tree-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--wb-space-2);
  padding: var(--wb-space-2) var(--wb-space-3) 4px;
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-900);
  color: var(--wb-text-primary);
}

/* 2026-10-26：左树每一组 / 每一项左侧都有 ⠿ 手柄，直接拖、松手即存（同层换位）。 */
.bi-tree-grip {
  flex: 0 0 auto;
  align-self: center;
  padding: 2px 4px 2px 2px;
  color: var(--wb-text-placeholder);
  font-size: var(--wb-fs-13);
  line-height: 1;
  letter-spacing: 0;
  cursor: grab;
  user-select: none;
  /* 命中区放大一点：真机上六点本身太细，不好按 */
  touch-action: none;
}
.bi-tree-grip:hover { color: var(--wb-accent-ink); }
.bi-tree-grip:active { cursor: grabbing; }

.bi-tree-group-label { flex: 1 1 auto; min-width: 0; text-align: left; }

.bi-tree-group-title[draggable="true"],
.bi-tree-item[draggable="true"] { -webkit-user-drag: element; }

.bi-tree-group.is-dragging,
.bi-tree-item.is-dragging { opacity: .45; }

.bi-tree-group.is-drop-target > .bi-tree-group-title,
.bi-tree-item.is-drop-target {
  outline: 2px dashed var(--wb-accent);
  outline-offset: -2px;
  border-radius: var(--wb-radius-control);
}

.bi-tree-group-hint {
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-700);
  color: var(--wb-text-secondary);
}

.bi-tree-children {
  display: grid;
  gap: 2px;
  margin: 2px 0 var(--wb-space-2) 14px;
  padding-left: 10px;
  border-left: 1px solid var(--wb-border-strong);
}

.bi-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-space-2);
  width: 100%;
  min-height: 30px;
  padding: 4px 8px 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--wb-radius-control);
  background: transparent;
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-14);
  font-weight: var(--wb-fw-700);
  text-align: left;
  cursor: pointer;
}

.bi-tree-item:hover {
  border-color: var(--wb-border-strong);
  background: var(--wb-table-row-hover-bg);
  color: var(--wb-accent-ink);
}

.bi-tree-item.is-active {
  border-color: var(--wb-accent);
  background: var(--wb-table-row-selected-bg);
  color: var(--wb-accent-ink);
  font-weight: var(--wb-fw-850);
}

.bi-tree-item-hint {
  flex: 0 0 auto;
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-700);
  color: var(--wb-text-secondary);
}

.bi-tree-item.is-active .bi-tree-item-hint {
  color: var(--wb-accent-ink);
}

/* ---------------- 右侧通用 ---------------- */

.bi-stack {
  display: flex;
  flex-direction: column;
  gap: var(--wb-space-3);
  min-width: 0;
}

.bi-empty {
  margin: 0;
  padding: var(--wb-space-4);
  border: 1px dashed var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-13);
  background: var(--wb-fill-soft);
}

.bi-footnote {
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  line-height: 1.6;
}

.bi-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-space-2);
}

.bi-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 var(--wb-space-4);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-button:hover:not(:disabled) {
  border-color: var(--wb-accent);
  color: var(--wb-accent-ink);
}

.bi-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.bi-button-primary {
  background: var(--wb-accent);
  border-color: var(--wb-accent);
  color: var(--wb-btn-primary-ink);
}

.bi-button-primary:hover:not(:disabled) {
  color: var(--wb-btn-primary-ink);
  filter: brightness(1.05);
}

.bi-button-mini {
  height: 28px;
  padding: 0 var(--wb-space-3);
  font-size: var(--wb-fs-12);
}

.bi-button-ghost {
  background: transparent;
  color: var(--wb-text-secondary);
}

.bi-button-danger {
  color: var(--wb-danger);
  border-color: var(--wb-banner-danger-border);
}

.bi-button-danger:hover:not(:disabled) {
  color: var(--wb-danger);
  background: var(--wb-banner-danger-bg);
}

/* ---------------- 单据纸面（和合同一致） ---------------- */

.bi-sheet {
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  padding: var(--wb-space-4) var(--wb-space-5);
  box-shadow: var(--wb-shadow-soft);
}

.bi-sheet-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

/* 抬头两行都居中（PI 的 sellerCompany / sellerAddressContact 就是居中） */
.bi-sheet-pi .bi-title-main,
.bi-sheet-pi .bi-title-info {
  text-align: center;
}

.bi-sheet-pi .bi-lang-toggle {
  align-self: flex-start;
}

.bi-sheet-input {
  width: 100%;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-family: inherit;
  padding: 6px 10px;
  resize: vertical;
}

.bi-sheet-input:hover {
  border-color: var(--wb-border-strong);
}

.bi-sheet-input:focus {
  outline: none;
  border-color: var(--wb-input-focus-border);
  background: var(--wb-surface);
  box-shadow: var(--wb-focus-ring);
}

/* 抬头两行（2026-10-26 业务方）：第一行公司名最大，第二行公司基础信息整段 */
.bi-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  align-self: flex-start;
  padding: 2px;
  margin-bottom: var(--wb-space-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-fill-soft);
}

.bi-lang-btn {
  height: 24px;
  padding: 0 var(--wb-space-3);
  border: 1px solid transparent;
  border-radius: var(--wb-radius-control);
  background: transparent;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-lang-btn:hover {
  color: var(--wb-accent-ink);
}

.bi-lang-btn.is-active {
  border-color: var(--wb-border);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  box-shadow: var(--wb-shadow-soft);
}

.bi-title-main {
  font-size: var(--wb-fs-22);
  font-weight: var(--wb-fw-850);
  letter-spacing: .01em;
  line-height: 1.3;
}

.bi-title-info {
  margin-top: 2px;
  font-size: var(--wb-fs-12);
  line-height: 1.7;
  color: var(--wb-text-secondary);
  min-height: 24px;
  height: auto;
  overflow: hidden;
  resize: none;
}

/* 印章框：照 PI 里章的落点（右侧一列） */
.bi-seal-row {
  display: flex;
  justify-content: flex-end;
}

/* 印章一块横排：左边章图，右边两个按钮 + 说明（不把抬头纸面撑高） */
.bi-seal-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--wb-space-3);
  padding: var(--wb-space-2) var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-fill-soft);
}

.bi-seal-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  border: 1px dashed var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: var(--wb-fill-soft);
  overflow: hidden;
}

.bi-seal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.bi-seal-empty {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.bi-seal-actions {
  display: flex;
  gap: 4px;
  width: 168px;
}

.bi-seal-actions .bi-button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 var(--wb-space-2);
  font-size: var(--wb-fs-11);
  white-space: nowrap;
}

.bi-seal-file {
  display: none;
}

.bi-seal-note {
  margin: 0;
  max-width: 168px;
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
  line-height: 1.5;
}

/* ---------------- 底部切换按钮（多公司 / 多需方） ---------------- */

.bi-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-space-2);
  padding: var(--wb-space-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-fill-soft);
}

.bi-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-switch-btn:hover {
  border-color: var(--wb-accent);
  color: var(--wb-accent-ink);
}

.bi-switch-btn.is-active {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
  font-weight: var(--wb-fw-850);
}

.bi-switch-badge {
  padding: 0 6px;
  border-radius: var(--wb-radius-pill);
  background: var(--wb-accent);
  color: var(--wb-btn-primary-ink);
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-850);
}

.bi-switch-add {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--wb-space-3);
  border: 1px dashed var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: transparent;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-switch-add:hover {
  border-color: var(--wb-accent);
  color: var(--wb-accent-ink);
  background: var(--wb-surface);
}

/* ---------------- 银行账户（Bank Info 版式） ---------------- */

.bi-group-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-space-2);
}

.bi-group-tab {
  height: 32px;
  padding: 0 var(--wb-space-4);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-group-tab:hover {
  border-color: var(--wb-accent);
  color: var(--wb-accent-ink);
}

.bi-group-tab.is-active {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
  font-weight: var(--wb-fw-850);
}

.bi-acct {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-panel-bg);
  padding: var(--wb-space-3) var(--wb-space-4);
}

.bi-acct + .bi-acct {
  margin-top: var(--wb-space-3);
}

.bi-acct-head {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  min-width: 0;
}

.bi-acct-name {
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-850);
  color: var(--wb-text-primary);
  white-space: nowrap;
}

.bi-acct-linked {
  /* 2026-10-26 业务方：贴着账户名放，不要推到最右边 */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-700);
  color: var(--wb-accent-ink);
  background: var(--wb-accent-soft);
  border: 1px solid var(--wb-accent);
  border-radius: var(--wb-radius-pill);
  padding: 1px 8px;
}

.bi-acct-body {
  margin-top: var(--wb-space-2);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  line-height: 1.7;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bi-acct-form .bi-field {
  margin-bottom: var(--wb-space-3);
}

.bi-acct-form-title {
  margin-bottom: var(--wb-space-3);
  padding-bottom: var(--wb-space-2);
  border-bottom: 1px dashed var(--wb-border);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-850);
  color: var(--wb-text-primary);
}

.bi-acct-link-row {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  margin-bottom: var(--wb-space-3);
}

.bi-link-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--wb-space-3);
  border: 1px dashed var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: transparent;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-link-btn:hover {
  border-color: var(--wb-accent);
  color: var(--wb-accent-ink);
  background: var(--wb-surface);
}

/* 关联公司弹窗 */
.bi-modal-backdrop {
  position: fixed;
  inset: 0;
  /* 2026-11-05 #34-B：裸值 60 连遮罩 1000 都压不过 → 并入统一刻度 */
  z-index: var(--wb-z-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wb-overlay-bg);
}

.bi-modal {
  width: min(420px, calc(100vw - 40px));
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-panel-bg);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.bi-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-space-3);
  padding: var(--wb-space-3) var(--wb-space-4);
  border-bottom: 1px solid var(--wb-border);
}

.bi-modal-head h4 {
  margin: 0;
  font-size: var(--wb-fs-14);
  font-weight: var(--wb-fw-850);
}

.bi-modal-close {
  border: 0;
  background: transparent;
  color: var(--wb-text-secondary);
  cursor: pointer;
  font-size: var(--wb-fs-13);
}

.bi-modal-list {
  display: grid;
  gap: var(--wb-space-2);
  padding: var(--wb-space-3) var(--wb-space-4);
  max-height: 320px;
  overflow: auto;
}

.bi-modal-option {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  padding: var(--wb-space-2) var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-600);
  color: var(--wb-text-primary);
  cursor: pointer;
}

.bi-modal-option.is-on {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
  font-weight: var(--wb-fw-800);
}

.bi-modal-note {
  margin: 0;
  padding: 0 var(--wb-space-4) var(--wb-space-3);
  font-size: var(--wb-fs-11);
  line-height: 1.6;
  color: var(--wb-text-secondary);
}

.bi-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--wb-space-2);
  padding: var(--wb-space-3) var(--wb-space-4);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-fill-soft);
}

.bi-bank-head {
  margin-top: var(--wb-space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--wb-space-4);
  padding-bottom: var(--wb-space-3);
  border-bottom: 1px solid var(--wb-border);
}

.bi-bank-name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 260px;
  min-width: 0;
}

.bi-bank-name {
  height: 32px;
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-850);
}

.bi-bank-currency-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.bi-bank-currency {
  height: 32px;
  min-width: 130px;
}

.bi-bank-default-badge {
  padding: 2px 8px;
  border-radius: var(--wb-radius-pill);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-850);
}

.bi-bank-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--wb-space-2) var(--wb-space-3);
  align-items: center;
  margin-top: var(--wb-space-3);
}

@media (max-width: 700px) {
  .bi-bank-grid { grid-template-columns: minmax(0, 1fr); }
}

.bi-bank-input {
  height: 30px;
  font-size: var(--wb-fs-13);
}

.bi-bank-bind {
  /* 2026-10-26 业务方：归属公司多选挪到每个账户的最上方 */
  padding-bottom: var(--wb-space-3);
  border-bottom: 1px dashed var(--wb-border);
}

.bi-bank-text {
  width: 100%;
  margin-top: var(--wb-space-2);
  padding: var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-family: inherit;
  font-size: var(--wb-fs-13);
  line-height: 1.7;
  resize: vertical;
}

.bi-bank-text:focus {
  outline: none;
  border-color: var(--wb-input-focus-border);
  box-shadow: var(--wb-focus-ring);
}

.bi-bank-bind-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wb-space-2);
  margin-top: var(--wb-space-2);
}

.bi-bank-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  cursor: pointer;
}

.bi-bank-chip.is-checked {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
  font-weight: var(--wb-fw-850);
}

.bi-bank-chip-box {
  margin: 0;
  cursor: pointer;
}

.bi-bank-bind-empty {
  font-size: var(--wb-fs-12);
  color: var(--wb-text-secondary);
}

/* ---------------- 字段标签 ---------------- */

.bi-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.bi-field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  color: var(--wb-text-secondary);
}

.bi-field-hint {
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-600);
  color: var(--wb-text-secondary);
}

/* ---------------- 工厂合同版式 ---------------- */

.bi-factory-title {
  text-align: center;
  font-size: var(--wb-fs-20);
  font-weight: var(--wb-fw-850);
  letter-spacing: .12em;
  color: var(--wb-text-primary);
  padding-bottom: var(--wb-space-3);
  border-bottom: 1px solid var(--wb-border);
}

.bi-factory-party {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  margin-top: var(--wb-space-3);
}

.bi-factory-party-label {
  flex: 0 0 auto;
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-850);
  color: var(--wb-text-primary);
}

.bi-factory-name {
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-850);
}

.bi-factory-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--wb-space-2) var(--wb-space-3);
  align-items: center;
  margin-top: var(--wb-space-3);
}

@media (max-width: 700px) {
  .bi-factory-grid { grid-template-columns: minmax(0, 1fr); }
}

.bi-factory-input {
  height: 30px;
  font-size: var(--wb-fs-13);
}

.bi-factory-address {
  font-size: var(--wb-fs-13);
  min-height: 52px;
  border-color: var(--wb-border);
}

.bi-terms-clause {
  font-size: var(--wb-fs-14);
  font-weight: var(--wb-fw-700);
  border-color: var(--wb-border);
  min-height: 36px;
}

.bi-terms-body {
  width: 100%;
  margin-top: var(--wb-space-2);
  padding: var(--wb-space-3);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-family: inherit;
  font-size: var(--wb-fs-13);
  line-height: 1.8;
  resize: vertical;
}

.bi-terms-body:focus {
  outline: none;
  border-color: var(--wb-input-focus-border);
  box-shadow: var(--wb-focus-ring);
}

/* 抬头/地址的多行输入不要露出拖拽手柄（要像纸上的字，不像表单） */
.bi-factory-address {
  resize: none;
}


/* ============================================================
 * 汇率（2026-10-26）：全站唯一的「本月默认汇率」入口
 * 左对齐、两行收口（标题+当前值+输入+保存 / 一句说明），字号放大、少占纵向空间。
 * ============================================================ */
.bi-rate-sheet {
  padding: var(--wb-space-4) var(--wb-space-5);
}

.bi-rate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-space-4);
  text-align: left;
}

.bi-rate-title {
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-22);
  font-weight: var(--wb-fw-900);
  line-height: 1.2;
  white-space: nowrap;
}

.bi-rate-status {
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-17);
  font-weight: var(--wb-fw-700);
  line-height: 1.3;
  min-width: 0;
}
.bi-rate-status.is-missing { color: var(--wb-pill-warn-ink); }

.bi-rate-input {
  width: 140px;
  padding: 4px 8px;
  font-size: var(--wb-fs-20);
  font-weight: var(--wb-fw-850);
  text-align: right;
}

.bi-rate-save {
  font-size: var(--wb-fs-16);
  padding: 6px 16px;
}

.bi-rate-footnote {
  margin: var(--wb-space-2) 0 0;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-14);
  line-height: 1.5;
}

.bi-rate-error {
  margin: 0;
  color: var(--wb-danger);
  font-size: var(--wb-fs-14);
}

.bi-rate-history {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--wb-space-2);
}

.bi-rate-history-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--wb-space-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-fill-soft);
  padding: var(--wb-space-2) var(--wb-space-3);
  font-size: var(--wb-fs-15);
  color: var(--wb-text-secondary);
}
.bi-rate-history-row strong {
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-17);
  font-weight: var(--wb-fw-850);
}
.bi-rate-history-row.is-current {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-ink);
}
.bi-rate-history-row.is-current strong { color: var(--wb-accent-ink); }
