.bm-dialog.wide {
  width: min(88rem, 97vw);
  max-width: 97vw;
  max-height: 95dvh;
}
.bid-measure {
  color: var(--ink, #162d3e);
}
.bid-measure [hidden] {
  display: none !important;
}
.bm-source {
  display: grid;
  grid-template-columns: minmax(10rem, 1.35fr) minmax(9rem, 1fr) minmax(8rem, 1fr);
  gap: 0.7rem;
}
.bm-source .field,
.bm-control .field {
  min-width: 0;
}
.bm-source select,
.bm-control select {
  width: 100%;
  text-overflow: ellipsis;
}
.bm-switch,
.bm-sheet-tools,
.bm-sheet-tools > div,
.bm-actions,
.bm-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.bm-switch {
  padding: 0.5rem 0.8rem;
  border-left: 3px solid #b67812;
  background: #faf4e4;
}
.bm-sheet-tools {
  justify-content: space-between;
  margin: 0.75rem 0;
}
.bm-identity {
  overflow-wrap: anywhere;
  font-weight: 650;
}
.bm-sheet-tools output {
  min-width: 3.3rem;
  text-align: center;
}
.bm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
  gap: 0.9rem;
  align-items: start;
}
.bm-stage {
  min-width: 0;
  min-height: 13rem;
  height: min(58dvh, 40rem);
  overflow: auto;
  background: #deddd4;
  border: 1px solid #a8b3b8;
  scrollbar-gutter: stable;
}
.bm-paper {
  position: relative;
  width: 100%;
  line-height: 0;
  background: white;
  isolation: isolate;
}
.bm-paper[data-zoom='2'] {
  width: 150%;
}
.bm-paper[data-zoom='3'] {
  width: 200%;
}
.bm-paper[data-zoom='4'] {
  width: 300%;
}
.bm-paper[data-zoom='5'] {
  width: 400%;
}
.bm-paper canvas {
  display: block;
  width: 100%;
  height: auto;
}
.bm-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-x pan-y;
}
.bm-paper[data-mode='pan'] .bm-overlay {
  cursor: grab;
}
.bm-overlay polyline,
.bm-overlay polygon,
.bm-overlay path {
  fill: none;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bm-overlay .bm-shell {
  stroke: #005082;
}
.bm-overlay polygon.bm-shell {
  fill: #0c77ad35;
}
.bm-overlay .bm-hole {
  stroke: #8f351f;
  stroke-dasharray: 7 3;
}
.bm-overlay polygon.bm-hole {
  fill: #fdab6966;
}
.bm-overlay .bm-reference {
  stroke: #764b02;
  stroke-dasharray: 7 3;
}
.bm-overlay circle.bm-shell,
.bm-overlay .bm-count {
  fill: #0da6d9;
}
.bm-overlay circle.bm-hole {
  fill: #bf6636;
}
.bm-overlay circle.bm-reference {
  fill: #e8a92f;
}
.bm-overlay circle {
  stroke: white;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.bm-overlay text {
  fill: #062d40;
  stroke: white;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  paint-order: stroke;
  font-weight: bold;
}
.bm-overlay .bm-cursor {
  stroke: #50396e;
  stroke-width: 3;
}
.bm-control {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}
.bm-control fieldset {
  margin: 0;
  padding: 0.65rem;
  border: 1px solid #c9d1d2;
  min-width: 0;
}
.bm-control legend {
  padding: 0 0.25rem;
  font-weight: 750;
}
.bm-result {
  display: grid;
  gap: 0.25rem;
  background: #123a50;
  color: white;
  border-left: 4px solid #0da6d9;
  padding: 0.7rem 1rem;
}
.bm-result span {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.bm-result strong {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.bm-actions {
  margin: 0.5rem 0;
}
.bm-actions [aria-pressed='true'],
.bm-control [aria-pressed='true'] {
  color: white;
  background: #17465c;
  border-color: #17465c;
}
.bm-foot {
  justify-content: flex-end;
}
.bid-measure [data-bm='status'] {
  min-height: 1.5rem;
}
@media (max-width: 760px) {
  .bm-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bm-source {
    grid-template-columns: 1fr 1fr;
  }
  .bm-source > .field:first-child {
    grid-column: 1/-1;
  }
  .bm-stage {
    height: 43dvh;
    min-height: 13rem;
  }
  .bm-control {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  }
  .bm-foot .btn,
  .bm-actions .btn {
    min-height: 2.65rem;
  }
}

[data-bid-line] [data-bid-part] {
  margin: 0;
  min-width: 0;
  padding: clamp(0.8rem, 2vw, 1.25rem);
  border: 1px solid #c4cfd1;
  border-left: 3px solid #087993;
  border-radius: 4px;
  background: #fcfcfa;
}
[data-bid-line] [data-bid-part] legend {
  padding: 0 0.4rem;
  color: #163b4c;
  background: #fcfcfa;
  font-size: 0.84rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}
[data-bid-line] .field,
[data-bid-check] .field {
  min-width: 0;
}
[data-bid-line] select,
[data-bid-check] select {
  text-overflow: ellipsis;
}
[data-bid-line] [data-part-total] {
  flex: 1 1 10rem;
  font-variant-numeric: tabular-nums;
  color: #174b5a;
  font-weight: 700;
}
[data-bid-line] [data-line-total],
[data-bid-check] [data-bid-match] {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  [data-bid-line] .two-col,
  [data-bid-check] .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}
