.bci-overlay[hidden],
#box-custom-imposition-button[hidden] {
  display: none !important;
}

.bci-overlay {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 34, 58, .38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

body.bci-open {
  overflow: hidden;
}

.lp-dxf-btn.pricing-only-disabled,
.lp-dxf-btn.pricing-only-disabled:hover {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(.35);
}

.bci-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(780px, calc(100dvh - 28px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  background: rgba(249, 252, 255, .98);
  box-shadow: 0 24px 80px rgba(22, 45, 84, .28);
  color: var(--color-text-primary, #1f2937);
}

.bci-head,
.bci-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
}

.bci-head {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  border-bottom: 1px solid rgba(100, 150, 230, .15);
  background: rgba(249, 252, 255, .96);
}

.bci-title {
  font-size: 17px;
  font-weight: 800;
}

.bci-subtitle {
  margin-top: 2px;
  color: #60708a;
  font-size: 11px;
}

.bci-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf3fb;
  color: #536176;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.bci-body {
  padding: 15px 18px 4px;
}

.bci-section {
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(92, 145, 225, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .7);
}

.bci-section-title {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 750;
}

.bci-counts {
  display: grid;
  gap: 7px;
}

.bci-count-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 74px 42px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 8px;
  border-radius: 9px;
  background: #f5f9ff;
}

.bci-item-name {
  font-size: 12px;
  font-weight: 750;
  color: #2868bf;
}

.bci-item-spec {
  min-width: 0;
  overflow: hidden;
  color: #65758d;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bci-count-row input,
.bci-size-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cfe0f8;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  text-align: center;
  font: inherit;
  font-weight: 700;
  box-shadow: none;
}

.bci-count-row input:focus,
.bci-size-row input:focus {
  outline: 0;
  border-color: #5794ef;
  box-shadow: 0 0 0 3px rgba(68, 139, 236, .12);
}

.bci-unit {
  color: #6c7890;
  font-size: 10px;
}

.bci-help {
  margin-top: 8px;
  color: #718096;
  font-size: 10px;
  line-height: 1.55;
}

.bci-radio,
.bci-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 7px 0;
  cursor: pointer;
}

.bci-radio input,
.bci-check input {
  margin-top: 3px;
  accent-color: #397fec;
}

.bci-radio span {
  display: grid;
  gap: 1px;
}

.bci-radio strong,
.bci-check span {
  font-size: 11.5px;
  font-weight: 650;
}

.bci-radio small {
  color: #718096;
  font-size: 9.5px;
}

.bci-rotation-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.bci-rotation-label {
  margin-right: 2px;
  color: #536176;
  font-size: 11px;
  font-weight: 700;
}

.bci-angle,
.bci-angle-fixed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: #f7faff;
  color: #536176;
  font-size: 10.5px;
  font-weight: 650;
}

.bci-angle {
  cursor: pointer;
}

.bci-angle input {
  margin: 0;
  accent-color: #397fec;
}

.bci-angle:has(input:checked) {
  border-color: #92baf5;
  background: #edf5ff;
  color: #246ac4;
}

.bci-angle-fixed {
  background: #f1f5f9;
  color: #718096;
}

.bci-size-row {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: end;
  gap: 7px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
  background: #f5f8fc;
  opacity: .55;
}

.bci-size-row.enabled {
  opacity: 1;
}

.bci-size-row label {
  display: grid;
  gap: 4px;
  color: #65758d;
  font-size: 9.5px;
}

.bci-times {
  padding-bottom: 8px;
  color: #8a96a9;
  text-align: center;
}

.bci-message {
  min-height: 37px;
  margin-bottom: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #eef6ff;
  color: #356baf;
  font-size: 10.5px;
  line-height: 1.55;
}

.bci-message.error {
  background: #fff1f1;
  color: #c33b3b;
}

.bci-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid rgba(100, 150, 230, .15);
  background: rgba(249, 252, 255, .96);
}

.bci-foot-spacer {
  flex: 1;
}

.bci-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.bci-btn:disabled {
  cursor: wait;
  opacity: .65;
}

.bci-primary {
  background: linear-gradient(135deg, #4388ee, #6965ee);
  color: #fff;
  box-shadow: 0 5px 14px rgba(68, 113, 225, .22);
}

.bci-cancel {
  border-color: #d8e4f3;
  background: #fff;
  color: #536176;
}

.bci-reset {
  border-color: #f1c9c9;
  background: #fff6f6;
  color: #c04444;
}

#box-custom-imposition-button.bci-entry {
  border-color: #9fdab3;
  background: #effcf3;
  color: #16834a;
}

#box-custom-imposition-button.bci-entry.active {
  border-color: #59bd7d;
  background: #dff7e7;
  box-shadow: 0 0 0 2px rgba(48, 176, 101, .1);
}

@media (max-width: 720px) {
  .bci-overlay {
    align-items: end;
    padding: 8px;
  }

  .bci-dialog {
    width: 100%;
    max-height: min(86dvh, 760px);
    border-radius: 17px;
  }

  .bci-count-row {
    grid-template-columns: 42px minmax(0, 1fr) 66px 38px;
    gap: 5px;
  }

  .bci-head,
  .bci-foot {
    padding-inline: 14px;
  }

  .bci-body {
    padding-inline: 12px;
  }

  .bci-btn {
    padding-inline: 11px;
  }
}
