/* --- Bias Suite: sidebar-safe layout fixes --- */
.ecb-card, .ecb-card * { box-sizing: border-box; max-width: 100%; }

/* Stack by default so narrow content + sidebars never force two columns */
.ecb-body {
  display: block!important;
  grid-template-columns: 1fr;   /* single column by default */
  gap: 16px;
  align-items: start;
}

/* Only use two columns when container is wide enough */
@media (min-width: 980px) {
  .ecb-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Prevent any child from pushing outside its lane */
.ecb-body > * { min-width: 0; }

/* Inputs: grid that auto-fits safely */
.ecb-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  min-width: 0;
}

/* Form controls must not overflow */
.ecb-row input,
.ecb-row select {
  width: 100%;
  max-width: 100%;
}

/* KPIs tile responsively; never overflow */
.ecb-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  min-width: 0;
}

/* Long lines in the parts box shouldn't push layout */
.ecb-parts {
  overflow-wrap: anywhere;   /* allow breaks anywhere */
  word-break: break-word;
  min-width: 0;
}

@media (min-width: 1120px) { .ecb-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
